if ((isset($showfile) == FALSE) && (isset($start) == FALSE) && (isset($all) == FALSE) && (isset($nohit) == FALSE))
$increase_hits = 1; // Only increase hit count when user loads main page without any extra stuff
include("functions.inc"); // Include main functions
// Start output
roiw_out_start();
roiw_out_tl();
roiw_out_tm();
roiw_out_tr();
roiw_out_tablerow();
roiw_out_left();
roiw_out_mainstart();
// Main content
if (isset($showfile))
{
if ($showfile == "guide") // Bleh
{
if (staff_getaccess() & ACCESS_STAFF)
readfile("guide.html");
}
elseif ($showfile == "about")
readfile("about.html");
else
print("Illegal showfile parameter!");
}
else
{
// Show 4 most recent stories and 1 most recent site news...
// Just stick site news at top
$acc = staff_getaccess();
$id = news_count();
if ($id > 0)
{
print("Latest site news:
");
print("
");
$title = news_attrib($id,"title");
printf("%s ",$title); // Print tile
print_staff(news_attrib($id,"author"));
printf(" %s",date("F j, Y, g:i a",intval(news_attrib($id,"time"))));
if ($acc & ACCESS_STAFF)
printf(" Edit Delete
",$id,$id);
else
print("
");
printf("%s
",news_attrib($id,"text"));
print("
");
}
print("Latest news stories:
");
print("
");
// 10 items per page
// Can set start item with 'start'
$start = story_count();
$end = $start-3;
if ($end<1)
$end = 1;
// List news items...
for ($id=$start;$id>=$end;$id--) // Reverse order so they come up in date order
{
$title = story_attrib($id,"title");
printf("%s By %s, posted by ",$title,story_attrib($id,"email"),story_attrib($id,"author")); // Print tile
print_staff(story_attrib($id,"poster"));
printf(" %s",date("F j, Y, g:i a",intval(story_attrib($id,"time"))));
if ($acc & ACCESS_STAFF)
printf(" Edit Delete
",$id,$id);
else
print("
");
printf("%s [full story...]
",story_attrib($id,"desc"),$id);
}
}
roiw_out_mainend();
roiw_out_right();
roiw_out_end();
// Yay!
?>