diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-04-15 17:32:12 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2001-04-15 17:32:12 +0000 |
commit | eecdd3049f42166975864d2c1eb359ba09c9c229 (patch) | |
tree | 8e00f37521efd8c2a0eaf228dab6282742ef3a7e | |
parent | cbafa0db4ebb54217a222c86a3083f0244c0ec3b (diff) | |
download | forums-eecdd3049f42166975864d2c1eb359ba09c9c229.tar forums-eecdd3049f42166975864d2c1eb359ba09c9c229.tar.gz forums-eecdd3049f42166975864d2c1eb359ba09c9c229.tar.bz2 forums-eecdd3049f42166975864d2c1eb359ba09c9c229.tar.xz forums-eecdd3049f42166975864d2c1eb359ba09c9c229.zip |
error_die changes and various bug fixes to files
git-svn-id: file:///svn/phpbb/trunk@149 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/common.php | 2 | ||||
-rw-r--r-- | phpBB/index.php | 20 | ||||
-rw-r--r-- | phpBB/login.php | 8 | ||||
-rw-r--r-- | phpBB/posting.php | 4 | ||||
-rw-r--r-- | phpBB/profile.php | 20 | ||||
-rw-r--r-- | phpBB/viewforum.php | 16 | ||||
-rw-r--r-- | phpBB/viewonline.php | 10 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 12 |
8 files changed, 43 insertions, 49 deletions
diff --git a/phpBB/common.php b/phpBB/common.php index 1e319901aa..7028adf626 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -48,7 +48,7 @@ $sql = "SELECT * WHERE selected = 1"; if(!$result = $db->sql_query($sql)) { - error_die($db, SQL_CONNECT); + error_die(SQL_QUERY, "Could not query config information.", __LINE__, __FILE__); } else { diff --git a/phpBB/index.php b/phpBB/index.php index 4c297e1a8e..4b421a8194 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -57,8 +57,7 @@ $sql = "SELECT c.* ORDER BY c.cat_order"; if(!$q_categories = $db->sql_query($sql)) { - $db_error = $db->sql_error(); - error_die($db, QUERY_ERROR, $db_error["message"]); + error_die(SQL_QUERY, "Could not query categories list.", __LINE__, __FILE__); } $total_categories = $db->sql_numrows(); @@ -80,7 +79,7 @@ if($total_categories) ORDER BY f.cat_id, f.forum_order"; if(!$q_forums = $db->sql_query($sql)) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Could not query forums information.", __LINE__, __FILE__); } $sql = "SELECT f.forum_id, u.username, u.user_id @@ -90,7 +89,7 @@ if($total_categories) ORDER BY f.forum_id"; if(!$q_forum_mods = $db->sql_query($sql)) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Could not query forum moderator information.", __LINE__, __FILE__); } $total_forums = $db->sql_numrows($q_forums); @@ -105,10 +104,13 @@ if($total_categories) for($i = 0; $i < $total_categories; $i++) { - $template->assign_block_vars("catrow", array("CAT_ID" => $category_rows[$i]["cat_id"], - "PHP_SELF" => $PHP_SELF, - "POST_FORUM_URL" => POST_FORUM_URL, - "CAT_DESC" => stripslashes($category_rows[$i]["cat_title"]))); + $template->assign_block_vars("catrow", + array("CAT_ID" => $category_rows[$i]["cat_id"], + "PHP_SELF" => $PHP_SELF, + "POST_FORUM_URL" => POST_FORUM_URL, + "CAT_DESC" => stripslashes($category_rows[$i]["cat_title"]) + ) + ); for($j = 0; $j < $total_forums; $j++) { @@ -176,7 +178,7 @@ if($total_categories) }// if ... total_categories else { - error_die($db, GENERAL_ERROR, "There are no Categories or Foums on this board."); + error_die(GENERAL_ERROR, "There are no Categories or Foums on this board."); } $template->pparse("body"); diff --git a/phpBB/login.php b/phpBB/login.php index 1e8925fc21..26109ccccc 100644 --- a/phpBB/login.php +++ b/phpBB/login.php @@ -46,7 +46,7 @@ if(isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['submit'])) $result = $db->sql_query($sql); if(!$result) { - error_die($db, "Error in obtaining userdata : login"); + error_die(SQL_QUERY, "Error in obtaining userdata : login", __LINE__, __FILE__); } $rowresult = $db->sql_fetchrow($result); @@ -61,17 +61,17 @@ if(isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['submit'])) } else { - error_die($db, "Couldn't start session : login"); + error_die(GENERAL_ERROR, "Couldn't start session : login", __LINE__, __FILE__); } } else { - error_die($db, LOGIN_FAILED); + error_die(LOGIN_FAILED); } } else { - error_die($db, LOGIN_FAILED); + error_die(LOGIN_FAILED); } } else if($HTTP_GET_VARS['submit'] == "logout" && $userdata['session_logged_in']) diff --git a/phpBB/posting.php b/phpBB/posting.php index e707faafb0..7d5043f1e0 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -48,7 +48,7 @@ else case 'newtopic': if(!isset($forum_id)) { - error_die($db, GENERAL_ERROR, "Sorry, no there is no such forum"); + error_die(GENERAL_ERROR, "Sorry, no there is no such forum"); } $pagetype = "newtopic"; @@ -56,7 +56,7 @@ else $sql = "SELECT forum_name, forum_access FROM forums WHERE forum_id = '$forum_id'"; if(!$result = $db->sql_query($sql)) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Could not obtain forum/forum access information.", __LINE__, __FILE__); } $forum_info = $db->sql_fetchrowset($result); $forum_name = stripslashes($forum_info[0]["forum_name"]); diff --git a/phpBB/profile.php b/phpBB/profile.php index 0fea4b54a2..34c21f4c46 100644 --- a/phpBB/profile.php +++ b/phpBB/profile.php @@ -98,15 +98,7 @@ switch($mode) } else { - if(DEBUG) - { - $db_error = $db->sql_error(); - error_die($db, GENERAL_ERROR, "Error getting next user ID.<br>Reason: ".$db_error["message"]."<br>Line: ".__LINE__."<br>File: ".__FILE__); - } - else - { - error_die($db, QUERY_ERROR); - } + error_die(SQL_QUERY, "Couldn't obtained next user_id information.", __LINE__, __FILE__); } $md_pass = md5($password); @@ -189,7 +181,7 @@ switch($mode) { mail($email, $l_welcomesubj, $email_msg, "From: $email_from\r\n"); } - error_die($db, GENERAL_ERROR, $msg); + error_die(GENERAL_ERROR, $msg); } else { @@ -284,21 +276,21 @@ switch($mode) $sql_update = "UPDATE ".USERS_TABLE." SET user_active = 1, user_actkey = '' WHERE user_id = ".$rowset[0]["user_id"]; if($result = $db->sql_query($sql_update)) { - error_die($db, GENERAL_ERROR, $l_nowactive); + error_die(GENERAL_ERROR, $l_nowactive); } else { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY); } } else { - error_die($db, GENERAL_ERROR, $l_wrongactiv); + error_die(GENERAL_ERROR, $l_wrongactiv); } } else { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY); } break; } diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 9f8043c561..5590079f69 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -60,12 +60,12 @@ if(isset($forum_id)) } else { - error_die($db, "", "You have reached this page in error, please go back and try again"); + error_die(GENERAL_ERROR, "You have reached this page in error, please go back and try again"); } if(!$result = $db->sql_query($sql)) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Couldn't obtain forums information.", __LINE__, __FILE__); } // @@ -76,13 +76,13 @@ if(!$result = $db->sql_query($sql)) // If the query dosan't return any rows this isn't a valid forum. Inform the user. if(!$total_rows = $db->sql_numrows($result)) { - error_die($db, "", "The forum you selected does not exist. Please go back and try again."); + error_die(GENERAL_ERROR, "The forum you selected does not exist. Please go back and try again."); } $forum_row = $db->sql_fetchrowset($result); if(!$forum_row) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Couldn't obtain rowset.", __LINE__, __FILE__); } $forum_name = stripslashes($forum_row[0]["forum_name"]); @@ -112,7 +112,7 @@ $sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as i LIMIT $start, $topics_per_page"; if(!$t_result = $db->sql_query($sql)) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Couldn't obtain topic information.", __LINE__, __FILE__); } $total_topics = $db->sql_numrows(); @@ -188,7 +188,7 @@ if($total_topics) } else { - $pagination .= " <a href=\"viewforum.$phpEx?forum_id=$forum_id&start=$x\">$count</a> "; + $pagination .= " <a href=\"viewforum.$phpEx?".POST_FORUM_URL."=$forum_id&start=$x\">$count</a> "; } $count++; if(!($count % 20)) @@ -203,9 +203,9 @@ if($total_topics) } else { - error_die($db, NO_POSTS); + error_die(NO_POSTS); } include('includes/page_tail.'.$phpEx); -?> +?>
\ No newline at end of file diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 11dc8a51c3..4c6860b7fd 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -1,6 +1,6 @@ <?php /*************************************************************************** - * index.php + * viewonline.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group @@ -51,18 +51,18 @@ $sql = "SELECT u.username, u.user_id, f.forum_name, f.forum_id, s.session_page, $result = $db->sql_query($sql); if(!$result) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Couldn't obtain user/online information.", __LINE__, __FILE__); } $onlinerow = $db->sql_fetchrowset($result); if(!$onlinerow) { - error_die($db, QUERY_ERROR, "Couldn't fetchrow"); + error_die(SQL_QUERY, "Couldn't fetchrow", __LINE__, __FILE__); } $template->assign_vars(array( "PHP_SELF" => $PHP_SELF, "POST_FORUM_URL" => POST_FORUM_URL, - "POST_USER_URL" => POST_USER_URL, + "POST_USER_URL" => POST_USERS_URL, "L_WHOSONLINE" => $l_whosonline, "L_USERNAME" => $l_username, "L_LOCATION" => $l_location @@ -158,7 +158,7 @@ if($online_count) } else { - error_die($db, GENERAL_ERROR, "There are no users currently browsing this forum"); + error_die(GENERAL_ERROR, "There are no users currently browsing this forum"); } include('includes/page_tail.'.$phpEx); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 36b85407d9..7b0e90bed6 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -37,7 +37,7 @@ $is_moderator = 0; if(!isset($topic_id)) { - error_die($db, GENERAL_ERROR, "You have reached this page in error, please go back and try again"); + error_die(GENERAL_ERROR, "You have reached this page in error, please go back and try again"); } $sql = "SELECT t.topic_title, t.topic_status, t.topic_replies, @@ -50,11 +50,11 @@ $sql = "SELECT t.topic_title, t.topic_status, t.topic_replies, if(!$result = $db->sql_query($sql)) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Couldn't obtain topic information.", __LINE__, __FILE__); } if(!$total_rows = $db->sql_numrows($result)) { - error_die($db, GENERAL_ERROR, "The forum you selected does not exist. Please go back and try again."); + error_die(GENERAL_ERROR, "The forum you selected does not exist. Please go back and try again."); } $forum_row = $db->sql_fetchrowset($result); $topic_title = $forum_row[0]["topic_title"]; @@ -106,18 +106,18 @@ $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, LIMIT $start, $posts_per_page"; if(!$result = $db->sql_query($sql)) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Couldn't obtain post/user information.", __LINE__, __FILE__); } if(!$total_posts = $db->sql_numrows($result)) { - error_die($db, GENERAL_ERROR, "Error getting post data."); + error_die(GENERAL_ERROR, "There don't appear to be any posts for this topic.", __LINE__, __FILE__); } $sql = "SELECT * FROM ".RANKS_TABLE." ORDER BY rank_min"; if(!$ranks_result = $db->sql_query($sql)) { - error_die($db, QUERY_ERROR); + error_die(SQL_QUERY, "Couldn't obtain ranks information.", __LINE__, __FILE__); } $postrow = $db->sql_fetchrowset($result); $ranksrow = $db->sql_fetchrowset($ranksresult); |