diff --git a/phpBB/extension.inc b/phpBB/extension.inc index bf5ba57676..89a877d414 100644 --- a/phpBB/extension.inc +++ b/phpBB/extension.inc @@ -22,6 +22,9 @@ * ***************************************************************************/ $phpEx = "php"; - +$mtime = microtime(); +$mtime = explode(" ",$mtime); +$mtime = $mtime[1] + $mtime[0]; +$starttime = $mtime; ?> diff --git a/phpBB/functions/auth.php b/phpBB/functions/auth.php index c1c1acc74f..c2293f4c63 100644 --- a/phpBB/functions/auth.php +++ b/phpBB/functions/auth.php @@ -123,7 +123,6 @@ function auth($type, function get_userdata_from_id($userid, $db) { - $sql = "SELECT * FROM ".USERS_TABLE." WHERE user_id = $userid"; if(!$result = $db->sql_query($sql)) { diff --git a/phpBB/functions/post.php b/phpBB/functions/post.php index b4278d1182..a6f3cdad39 100644 --- a/phpBB/functions/post.php +++ b/phpBB/functions/post.php @@ -1,12 +1,12 @@ - diff --git a/phpBB/index.php b/phpBB/index.php index 2295e3a34d..95893b5458 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -27,12 +27,14 @@ include('template.inc'); include('functions/error.'.$phpEx); include('functions/sessions.'.$phpEx); include('functions/auth.'.$phpEx); +include('functions/functions.'.$phpEx); include('db.'.$phpEx); -$total_users = 10; -$total_posts = 55668; -$newest_user = "Dave"; -$newest_uid = 10; +$total_users = get_user_count($db, $users_table); +$total_posts = get_total_posts($db, $forums_table); +$newest_userdata = get_newest_user($db, $users_table); +$newest_user = $newest_userdata["username"]; +$newest_uid = $newest_userdata["user_id"]; $users_browsing = "4 Users"; $pagetype = "index"; @@ -70,34 +72,37 @@ if($total_rows) $template->parse("cats", "catrow", true); for($y = 0; $y < $total_forums; $y++) { - $folder_image = ""; - $posts = $forum_rows[$y]["forum_posts"]; - $topics = $forum_rows[$y]["forum_topics"]; - $last_post = $forum_rows[$y]["forum_last_post"]; - $last_post = date($date_format, $last_post); - $moderators = "theFinn"; - if($row_color == "#DDDDDD") - { - $row_color = "#CCCCCC"; - } - else - { - $row_color = "#DDDDDD"; - } - $template->set_var(array("FOLDER" => $folder_image, - "FORUM_NAME" => stripslashes($forum_rows[$y]["forum_name"]), - "FORUM_ID" => $forum_rows[$y]["forum_id"], - "FORUM_DESC" => stripslashes($forum_rows[$y]["forum_desc"]), - "ROW_COLOR" => $row_color, - "PHPEX" => $phpEx, - "POSTS" => $posts, - "TOPICS" => $topics, - "LAST_POST" => $last_post, - "MODERATORS" => $moderators)); - $template->parse("forums", "forumrow", true); + $folder_image = ""; + $posts = $forum_rows[$y]["forum_posts"]; + $topics = $forum_rows[$y]["forum_topics"]; + $last_post = $forum_rows[$y]["forum_last_post"]; + $last_post = date($date_format, $last_post); + $last_post_user = get_userdata_from_id($forum_rows[$y]["forum_last_post_uid"], $db); + + $last_post = $last_post . "
" . $last_post_user["username"]; + $moderators = "theFinn"; + if($row_color == "#DDDDDD") + { + $row_color = "#CCCCCC"; + } + else + { + $row_color = "#DDDDDD"; + } + $template->set_var(array("FOLDER" => $folder_image, + "FORUM_NAME" => stripslashes($forum_rows[$y]["forum_name"]), + "FORUM_ID" => $forum_rows[$y]["forum_id"], + "FORUM_DESC" => stripslashes($forum_rows[$y]["forum_desc"]), + "ROW_COLOR" => $row_color, + "PHPEX" => $phpEx, + "POSTS" => $posts, + "TOPICS" => $topics, + "LAST_POST" => $last_post, + "MODERATORS" => $moderators)); + $template->parse("forums", "forumrow", true); } - $template->parse("cats", "forums", true); - $template->set_var("forums", ""); + $template->parse("cats", "forums", true); + $template->set_var("forums", ""); } } } diff --git a/phpBB/page_tail.php b/phpBB/page_tail.php index 2c9cfeb221..1e9155cb9c 100644 --- a/phpBB/page_tail.php +++ b/phpBB/page_tail.php @@ -40,5 +40,14 @@ $template->set_var(array("PHPBB_VERSION" => "2.0-alpha", $template->pparse("output", "overall_footer"); // Close our DB connection. -$db->close(); +$db->sql_close(); + +$mtime = microtime(); +$mtime = explode(" ",$mtime); +$mtime = $mtime[1] + $mtime[0]; +$endtime = $mtime; +$totaltime = ($endtime - $starttime); + +printf("
phpBB Created this page in %f seconds.
", $totaltime); + ?> diff --git a/phpBB/upgrade_20.php b/phpBB/upgrade_20.php index dd9e0386db..8087943884 100644 --- a/phpBB/upgrade_20.php +++ b/phpBB/upgrade_20.php @@ -265,9 +265,11 @@ Backups completed ok.

echo "Altered table config
"; - drop_column($db, "forums", "forum_moderator"); - change_column($db, "forums", "forum_access", "tinyint(3)", "null"); - change_column($db, "forums", "forum_type", "tinyint(3)", "null"); + drop_column($db, "forums", "forum_moderator"); + change_column($db, "forums", "forum_access", "tinyint(3)", "null"); + change_column($db, "forums", "forum_type", "tinyint(3)", "null"); + add_column($db, "forums", "forum_posts", "int(10)", "default '0' not null"); + add_column($db, "forums", "forum_topics", "int(10)", "default '0' not null"); echo "Altered table forums
";