diff options
| author | James Atkinson <thefinn@users.sourceforge.net> | 2001-02-23 23:39:42 +0000 |
|---|---|---|
| committer | James Atkinson <thefinn@users.sourceforge.net> | 2001-02-23 23:39:42 +0000 |
| commit | 4e5538cb78ceb8e93ae10ec9ad306547e6014972 (patch) | |
| tree | b235f5d42c0186805d4e6bfd8df5a78a6cf24b88 /phpBB/viewforum.php | |
| parent | 8523870f8e55c5e170529a68eec6a93b0059d5a2 (diff) | |
| download | forums-4e5538cb78ceb8e93ae10ec9ad306547e6014972.tar forums-4e5538cb78ceb8e93ae10ec9ad306547e6014972.tar.gz forums-4e5538cb78ceb8e93ae10ec9ad306547e6014972.tar.bz2 forums-4e5538cb78ceb8e93ae10ec9ad306547e6014972.tar.xz forums-4e5538cb78ceb8e93ae10ec9ad306547e6014972.zip | |
Viewforum works, and error die outputs nice, templated, errors
git-svn-id: file:///svn/phpbb/trunk@37 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewforum.php')
| -rw-r--r-- | phpBB/viewforum.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 03368d71b8..b11ae6143f 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -30,27 +30,36 @@ include('functions/functions.'.$phpEx); include('functions/error.'.$phpEx); include('db.'.$phpEx); +// Check if the user has acutally sent a forum ID with his/her request +// If not give them a nice error page. if(isset($forum_id)) { $sql = "SELECT f.forum_type, f.forum_name - FROM ".FORUMS_TABLE." f - WHERE forum_id = '$forum_id'"; + FROM ".FORUMS_TABLE." f + WHERE forum_id = '$forum_id'"; } else { - error_die($db, "You have reached this page in error, please go back and try again"); + error_die($db, "", "You have reached this page in error, please go back and try again"); } if(!$result = $db->sql_query($sql)) { error_die($db, QUERY_ERROR); } -$total_rows = $db->sql_numrows($result); + +// 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."); +} + $forum_row = $db->sql_fetchrowset($result); if(!$forum_row) { error_die($db, QUERY_ERROR); } + $forum_name = stripslashes($forum_row[0]["forum_name"]); $forum_moderators = "<a href=\"profile.$phpEx?mode=viewprofile&user_id=1\">james</a>"; $pagetype = "viewforum"; |
