aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2001-05-03 22:10:23 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2001-05-03 22:10:23 +0000
commitaa8a051a981954b1d15d116fd2192d1e4778c8f6 (patch)
tree7aed219c2db7e5ec84e30fad84b7942173f81247 /phpBB
parentdf716e1e837e121bac29c987ccf4f9a8c68c8af2 (diff)
downloadforums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.tar
forums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.tar.gz
forums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.tar.bz2
forums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.tar.xz
forums-aa8a051a981954b1d15d116fd2192d1e4778c8f6.zip
Moved config, images vars to arrays and various other fixes
git-svn-id: file:///svn/phpbb/trunk@237 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/common.php110
-rw-r--r--phpBB/includes/functions.php50
-rw-r--r--phpBB/includes/page_header.php31
-rw-r--r--phpBB/includes/page_tail.php9
-rw-r--r--phpBB/index.php6
-rwxr-xr-xphpBB/language/lang_english.php33
-rw-r--r--phpBB/login.php5
-rw-r--r--phpBB/profile.php176
-rw-r--r--phpBB/templates/Default/viewforum_body.tpl10
-rw-r--r--phpBB/templates/Default/viewforum_footer.tpl2
-rw-r--r--phpBB/templates/Default/viewforum_header.tpl2
-rw-r--r--phpBB/templates/Default/viewtopic_body.tpl12
-rw-r--r--phpBB/templates/Default/viewtopic_footer.tpl4
-rw-r--r--phpBB/templates/Default/viewtopic_header.tpl8
-rw-r--r--phpBB/viewforum.php245
-rw-r--r--phpBB/viewtopic.php98
16 files changed, 438 insertions, 363 deletions
diff --git a/phpBB/common.php b/phpBB/common.php
index 42b47ad10c..e0011d4c05 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -22,35 +22,34 @@
*
***************************************************************************/
-include('config.'.$phpEx);
-include('includes/constants.'.$phpEx);
-
//
-// Default variable values - most if not all
-// of these have equivalents in a DB table but
-// for situations where the DB cannot be read or where
-// data is missing this data is used instead
+// Define some basic configuration arrays
//
-//$date_format = "m-d-Y H:i:s"; // American datesformat
-$date_format = "D, M d Y h:i:s a"; // European datesformat
-
-$url_images = "images";
-$image_quote = "$url_images/quote.gif";
-
-$image_edit = "$url_images/edit.gif";
-$image_profile = "$url_images/profile.gif";
-$image_email = "$url_images/email.gif";
-$image_pmsg = "$url_images/pm.gif";
-$image_delpost = "$url_images/edit.gif";
+$board_config = Array();
+$userdata = Array();
+$theme = Array();
+$images = Array();
-$image_ip = "$url_images/ip_logged.gif";
+include('config.'.$phpEx);
+include('includes/constants.'.$phpEx);
-$image_www = "$url_images/www_icon.gif";
-$image_icq = "$url_images/icq_add.gif";
-$image_aim = "$url_images/aim.gif";
-$image_yim = "$url_images/yim.gif";
-$image_msnm = "$url_images/msnm.gif";
-$theme = array();
+$url_images = "images";
+$images['quote'] = "$url_images/quote.gif";
+$images['edit'] = "$url_images/edit.gif";
+$images['profile'] = "$url_images/profile.gif";
+$images['email'] = "$url_images/email.gif";
+$images['pmsg'] = "$url_images/pm.gif";
+$images['delpost'] = "$url_images/edit.gif";
+$images['ip'] = "$url_images/ip_logged.gif";
+$images['www'] = "$url_images/www_icon.gif";
+$images['icq'] = "$url_images/icq_add.gif";
+$images['aim'] = "$url_images/aim.gif";
+$images['yim'] = "$url_images/yim.gif";
+$images['msnm'] = "$url_images/msnm.gif";
+$images['quote'] = "$url_images/quote.gif";
+$images['posticon'] = "$url_images/posticon.gif";
+$images['folder'] = "$url_images/folder.gif";
+$images['latest_reply'] = "$url_images/latest_reply.gif";
// Find Users real IP (if possible)
$user_ip = ($HTTP_X_FORWARDED_FOR) ? $HTTP_X_FORWARDED_FOR : $REMOTE_ADDR;
@@ -63,43 +62,54 @@ include('includes/auth.'.$phpEx);
include('includes/functions.'.$phpEx);
include('includes/db.'.$phpEx);
-// Initalize to keep safe
-$userdata = Array();
-
+//
// Setup forum wide options.
// This is also the first DB query/connect
+//
$sql = "SELECT *
FROM ".CONFIG_TABLE."
- WHERE selected = 1";
+ WHERE selected = '1'";
if(!$result = $db->sql_query($sql))
{
- // Our template class hasn't been instantiated so we do it here.
+ //
+ // Define some basic configuration
+ // vars, necessary since we haven't
+ // been able to get them from the DB
+ //
+ $board_config['default_template'] = "Default";
+ $board_config['default_timezone'] = 0;
+ $board_config['default_dateformat'] = "d M Y H:i";
+ $board_config['default_theme'] = 1;
+ $board_config['default_lang'] = "english";
+
+ // Our template class hasn't been instantiated
+ // so we do it here.
$template = new Template("templates/Default");
+
error_die(SQL_QUERY, "Could not query config information.", __LINE__, __FILE__);
}
else
{
$config = $db->sql_fetchrow($result);
- $sitename = stripslashes($config["sitename"]);
- $allow_html = $config["allow_html"];
- $allow_bbcode = $config["allow_bbcode"];
- $allow_sig = $config["allow_sig"];
- $allow_namechange = $config["allow_namechange"];
- $posts_per_page = $config["posts_per_page"];
- $hot_threshold = $config["hot_threshold"];
- $topics_per_page = $config["topics_per_page"];
- $override_user_themes = $config["override_themes"];
- $email_sig = stripslashes($config["email_sig"]);
- $email_from = $config["email_from"];
- $default_lang = $config["default_lang"];
- $default_theme = $config['default_theme'];
- $default_dateformat = $config['default_dateformat'];
- $require_activation = $config["require_activation"];
- $sys_timezone = $config["system_timezone"];
- $sys_template = $config['sys_template'];
- $sys_lang = $default_lang;
+
+ $board_config['sitename'] = stripslashes($config['sitename']);
+ $board_config['allow_html'] = $config['allow_html'];
+ $board_config['allow_bbcode'] = $config['allow_bbcode'];
+ $board_config['allow_sig'] = $config['allow_sig'];
+ $board_config['allow_namechange'] = $config['allow_namechange'];
+ $board_config['require_activation'] = $config['require_activation'];
+ $board_config['override_user_themes'] = $config['override_themes'];
+ $board_config['posts_per_page'] = $config['posts_per_page'];
+ $board_config['topics_per_page'] = $config['topics_per_page'];
+ $board_config['default_theme'] = $config['default_theme'];
+ $board_config['default_dateformat'] = stripslashes($config['default_dateformat']);
+ $board_config['default_template'] = stripslashes($config['sys_template']);
+ $board_config['default_timezone'] = $config['system_timezone'];
+ $board_config['default_lang'] = stripslashes($config['default_lang']);
+ $board_config['board_email'] = stripslashes(str_replace("<br />", "\n", $config['email_sig']));
+ $board_config['board_email_from'] = stripslashes($config['email_from']);
}
-include('language/lang_'.$default_lang.'.'.$phpEx);
+include('language/lang_'.$board_config['default_lang'].'.'.$phpEx);
-?>
+?> \ No newline at end of file
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index c4d872de2a..ba203c9281 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -144,11 +144,9 @@ function make_jumpbox()
// Initialise user settings on page load
function init_userprefs($userdata)
{
- global $override_user_theme, $template, $sys_template;
- global $default_lang, $default_theme, $date_format, $sys_timezone;
- global $theme;
+ global $board_config, $theme, $template, $lang, $phpEx;
- if(!$override_user_themes)
+ if(!$board_config['override_user_themes'])
{
if(($userdata['user_id'] != ANONYMOUS || $userdata['user_id'] != DELETED) && $userdata['user_theme'])
{
@@ -156,24 +154,24 @@ function init_userprefs($userdata)
}
else
{
- $theme = setuptheme($default_theme);
+ $theme = setuptheme($board_config['default_theme']);
}
}
else
{
- $theme = setuptheme($override_user_theme);
+ $theme = setuptheme($board_config['override_user_themes']);
}
if($userdata['user_lang'] != '')
{
- $default_lang = $userdata['user_lang'];
+ $board_config['default_lang'] = $userdata['user_lang'];
}
if($userdata['user_dateformat'] != '')
{
- $date_format = $userdata['user_dateformat'];
+ $board_config['default_dateformat'] = $userdata['user_dateformat'];
}
if(isset($userdata['user_timezone']))
{
- $sys_timezone = $userdata['user_timezone'];
+ $board_config['default_timezone'] = $userdata['user_timezone'];
}
// Setup user's Template
if($userdata['user_template'] != '')
@@ -182,35 +180,35 @@ function init_userprefs($userdata)
}
else
{
- $template = new Template("templates/".$sys_template);
+ $template = new Template("templates/".$board_config['default_template']);
}
-
- // Include the appropriate language file ... if it exists.
- if(!strstr($PHP_SELF, "admin"))
+
+ //
+ // This is currently worthless since all the individual
+ // language variables will only be locally defined in this
+ // function and not accessible to the board code globally.
+ // This will be fixed by moving all $l_xxxx vars into a single
+ // $lang[''] array
+ //
+ if( file_exists("language/lang_".$board_config['default_lang'].".".$phpEx) )
{
- if(file_exists('language/lang_'.$default_lang.'.'.$phpEx))
- {
- include('language/lang_'.$default_lang.'.'.$phpEx);
- }
+ include('language/lang_'.$board_config['default_lang'].'.'.$phpEx);
}
else
{
- if(strstr($PHP_SELF, "topicadmin"))
- {
- include('language/lang_'.$default_lang.'.'.$phpEx);
- }
- else
- {
- include('../language/lang_'.$default_lang.'.'.$phpEx);
- }
+ include('language/lang_english'.$phpEx);
}
+
return;
}
function setuptheme($theme)
{
global $db;
- $sql = "SELECT * FROM ".THEMES_TABLE." WHERE themes_id = '$theme'";
+
+ $sql = "SELECT *
+ FROM ".THEMES_TABLE."
+ WHERE themes_id = '$theme'";
if(!$result = $db->sql_query($sql))
{
diff --git a/phpBB/includes/page_header.php b/phpBB/includes/page_header.php
index c570ddbadf..3c542946b9 100644
--- a/phpBB/includes/page_header.php
+++ b/phpBB/includes/page_header.php
@@ -53,17 +53,17 @@ else
//
// Do timezone text output
//
-if($sys_timezone < 0)
+if($board_config['default_timezone'] < 0)
{
- $s_timezone = "$l_all_times GMT - ".(-$sys_timezone)." $l_hours";
+ $s_timezone = "$l_all_times GMT - ".(-$board_config['default_timezone'])." $l_hours";
}
-else if($sys_timezone == 0)
+else if($board_config['default_timezone'] == 0)
{
$s_timezone = "$l_all_times GMT";
}
else
{
- $s_timezone = "$l_all_times GMT + $sys_timezone $l_hours";
+ $s_timezone = "$l_all_times GMT + ".$board_config['default_timezone']." $l_hours";
}
//
@@ -73,8 +73,7 @@ else
$sql = "SELECT u.username, u.user_id, s.session_logged_in
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
WHERE u.user_id = s.session_user_id
- AND s.session_time >= '".(time()-300)."'
- ";
+ AND s.session_time >= '".(time() - 300)."'";
$result = $db->sql_query($sql);
if(!$result)
{
@@ -109,7 +108,7 @@ $l_is_are = ($logged_online == 1) ? $l_is : $l_are;
$userlist = ($logged_online > 0) ? "$l_Registered $l_r_user_s: " . $userlist : "$l_Registered $l_r_user_s: $l_None";
$template->assign_vars(array(
- "SITENAME" => $sitename,
+ "SITENAME" => $board_config['sitename'],
"PHPEX" => $phpEx,
"PHPSELF" => $PHP_SELF,
@@ -147,9 +146,11 @@ $template->assign_vars(array(
"L_AUTO_LOGIN" => $l_autologin,
"L_AUTHOR" => $l_author,
"L_MESSAGE" => $l_message,
+ "L_BY" => $l_by,
"L_LOGIN_LOGOUT" => $l_login_logout,
+ "U_INDEX" => "index.".$phpEx,
"U_REGISTER" => "profile.".$phpEx."?mode=register",
"U_PROFILE" => "profile.".$phpEx."?mode=editprofile",
"U_PRIVATEMSGS" => "priv_msgs.".$phpEx."?mode=read",
@@ -241,7 +242,8 @@ switch($pagetype)
$template->assign_vars(array(
"FORUM_ID" => $forum_id,
"FORUM_NAME" => $forum_name,
- "MODERATORS" => $forum_moderators));
+ "MODERATORS" => $forum_moderators,
+ "USERS_BROWSING" => $users_browsing));
$template->pparse("header");
break;
@@ -262,7 +264,8 @@ switch($pagetype)
"FORUM_NAME" => $forum_name,
"TOPIC_ID" => $topic_id,
"TOPIC_TITLE" => $topic_title,
- "POST_FORUM_URL" => POST_FORUM_URL));
+ "POST_FORUM_URL" => POST_FORUM_URL,
+ "USERS_BROWSING" => $users_browsing));
$template->pparse("header");
break;
@@ -306,12 +309,10 @@ switch($pagetype)
break;
case 'register':
- if(!isset($agreed))
+ if(!isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']))
{
- if(!isset($coppa))
- {
- $coppa = FALSE;
- }
+ $coppa = (!isset($HTTP_POST_VARS['coppa'])) ? FALSE : TRUE;
+
$template->set_filenames(array(
"body" => "agreement.tpl"));
$template->assign_vars(array(
@@ -330,4 +331,4 @@ switch($pagetype)
break;
}
-?>
+?> \ No newline at end of file
diff --git a/phpBB/includes/page_tail.php b/phpBB/includes/page_tail.php
index 4d0fd5fcf3..addc956d69 100644
--- a/phpBB/includes/page_tail.php
+++ b/phpBB/includes/page_tail.php
@@ -50,12 +50,13 @@ switch($pagetype)
//
if($userdata['session_logged_in'])
{
- $admin_link = "<a href=\"admin/index.php\">Administration Panel</a>";
+ $admin_link = "<a href=\"admin/index.$phpEx\">Administration Panel</a>";
}
$current_time = time();
-$template->assign_vars(array("PHPBB_VERSION" => "2.0-alpha",
- "CURRENT_TIME" => create_date($date_format, $current_time, $sys_timezone),
- "ADMIN_LINK" => $admin_link));
+$template->assign_vars(array(
+ "PHPBB_VERSION" => "2.0-alpha",
+ "CURRENT_TIME" => create_date($board_config['default_dateformat'], $current_time, $board_config['default_timezone']),
+ "ADMIN_LINK" => $admin_link));
$template->pparse("overall_footer");
diff --git a/phpBB/index.php b/phpBB/index.php
index adfd585707..33211f2ffd 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -122,15 +122,15 @@ if($total_categories)
( $category_rows[$i]["cat_id"] == $viewcat) )
{
- $folder_image = "<img src=\"images/folder.gif\">";
+ $folder_image = "<img src=\"".$images['folder']."\">";
$posts = $forum_rows[$j]["forum_posts"];
$topics = $forum_rows[$j]["forum_topics"];
if($forum_rows[$j]["username"] != "" && $forum_rows[$j]["post_time"] > 0)
{
- $last_post_time = create_date($date_format, $forum_rows[$j]["post_time"], $sys_timezone);
+ $last_post_time = create_date($board_config['default_dateformat'], $forum_rows[$j]["post_time"], $board_config['default_timezone']);
$last_post = $last_post_time."<br>by ";
$last_post .= "<a href=\"profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$forum_rows[$j]["user_id"];
- $last_post .= "\">".$forum_rows[$j]["username"]."</a>&nbsp;<a href=\"viewtopic.".$phpEx."?t=".$forum_rows[$j]['topic_id']."\"><img src=\"images/latest_reply.gif\" width=\"20\" height=\"11\" border=\"0\" alt=\"View Latest Post\"></a>";
+ $last_post .= "\">".$forum_rows[$j]["username"]."</a>&nbsp;<a href=\"viewtopic.".$phpEx."?t=".$forum_rows[$j]['topic_id']."\"><img src=\"".$images['latest_reply']."\" width=\"20\" height=\"11\" border=\"0\" alt=\"View Latest Post\"></a>";
}
else
{
diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php
index 070a4bbf2a..78ab7eb5e3 100755
--- a/phpBB/language/lang_english.php
+++ b/phpBB/language/lang_english.php
@@ -111,17 +111,18 @@ $l_indextitle = "Forum Index";
// Members and profile
$l_reginfo = "Registration Information";
-$l_profileinfo = "Profile Information (this information will be publicly viewable)";
+$l_profile_info = "Profile Information";
+$l_profile_info_notice = "This information will be publicly viewable";
$l_profile = "Profile";
$l_register = "Register";
$l_onlyreq = "Only requried if being changed";
$l_location = "From";
-$l_viewpostuser = "View posts by this user";
-$l_perday = "$l_messages per day";
-$l_oftotal = "of total";
+$l_view_users_posts = "View posts by this user";
+$l_per_day = "$l_messages per day";
+$l_of_total = "of total";
$l_url = "URL";
$l_icq = "ICQ";
-$l_icqnumber = "ICQ Number";
+$l_icq_number = "ICQ Number";
$l_icqadd = "Add";
$l_icqpager = "Pager";
$l_aim = "AIM";
@@ -138,11 +139,15 @@ $l_usertaken = "The $l_username you picked has been taken.";
$l_userdisallowed= "The $l_username you picked has been disallowed by the administrator. $l_tryagain";
$l_infoupdated = "Your Information has been updated";
$l_publicmail = "Allow other users to view my $l_emailaddress";
-$l_itemsreq = "Items marked with a * are required";
+$l_itemsreq = "Items marked with a * are required unless stated otherwise";
$l_nouserid = "You must supply a user ID number in order to view profile data.";
$l_viewingprofile = "Viewing profile of ";
$l_hidden = "hidden";
$l_boardtemplate = "Select Template";
+$l_date_format = "Date format";
+$l_date_format_explanation = "Only change this if you know what you are doing!";
+$l_password_if_changed = "You only need to supply a password if you want to change it.";
+$l_password_confirm_if_changed = "You only need to confirm your password if you changed it above.";
// Viewforum
@@ -234,8 +239,7 @@ $l_faxinfo = "
";
$l_coppa = "Your account has been created, however in complance with the COPPA act you must print out this page and have you parent or guardian mail it to: <br>$l_mailingaddress<br>Or fax it to: <br>$l_faxinfo<br> Once this information has been recived your account will be activated by the administrator and you will recive and email notification.";
$l_welcomesubj = "Welcome to $sitename Forums";
-$l_welcomemail =
-"
+$l_welcomemail = "
$l_welcomesubj,
Please keep this email for your records.
@@ -253,11 +257,9 @@ However, should you forget your password we provide an easy to use script to gen
Thank you for registering.
-$email_sig
";
-$l_welcomeemailactivate =
-"
+$l_welcomeemailactivate = "
$l_welcomesubj,
Please keep this email for your records.
@@ -278,7 +280,6 @@ However, should you forget your password we provide an easy to use script to gen
Thank you for registering.
-$email_sig
";
$l_beenadded = "You have been added to the database.";
@@ -380,7 +381,7 @@ Thank you for using $sitename forums.
Have a nice day.
-$email_sig';
+';
$l_quotemsg = '[quote]\nOn $m[post_time], $m[username] wrote:\n$text\n[/quote]';
@@ -414,7 +415,7 @@ $l_wrongmail = "The email address you entered does not match the one stored in o
$l_passsubj = "$sitename Forums Password Change";
-$l_pwdmessage = 'Dear $checkinfo[username],
+$l_pwdmessage = "Dear $checkinfo[username],
You are receiving this email because you (or someone pretending to be you)
has requested a passwordchange on $sitename forums. If you believe you have
received this message in error simply delete it and your password will remain
@@ -431,7 +432,7 @@ and you may login to the profile section and change it as desired.
Thank you for using $sitename Forums
-$email_sig';
+";
$l_passsent = "Your password has changed to a new, random, password. Please check your email on how to complete the password change procedure.";
$l_emailpass = "Email Lost Password";
@@ -444,4 +445,4 @@ $l_sendpass = "Send Password";
$l_autologin = "Log me on automatically each visit";
$l_resend_password = "I have forgotten my password";
-?>
+?> \ No newline at end of file
diff --git a/phpBB/login.php b/phpBB/login.php
index d73d05716c..4d912843c5 100644
--- a/phpBB/login.php
+++ b/phpBB/login.php
@@ -122,8 +122,9 @@ else
"body" => "login_body.tpl",
)
);
- if($mode)
+ if(isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']))
{
+ $mode = (isset($HTTP_POST_VARS['mode'])) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
$forward_page .= "?mode=".$mode;
}
@@ -144,4 +145,4 @@ else
}
-?>
+?> \ No newline at end of file
diff --git a/phpBB/profile.php b/phpBB/profile.php
index 3112515731..2f25008a5c 100644
--- a/phpBB/profile.php
+++ b/phpBB/profile.php
@@ -253,7 +253,7 @@ switch($mode)
"L_USERNAME" => $l_username,
"L_VIEW_USERS_POSTS" => $l_view_users_posts,
"L_JOINED" => $l_joined,
- "JOINED" => create_date($date_format, $profiledata['user_regdate'], $sys_timezone),
+ "JOINED" => create_date($board_config['default_dateformat'], $profiledata['user_regdate'], $board_config['default_timezone']),
"POSTS_PER_DAY" => $posts_per_day,
"L_PER_DAY" => $l_per_day,
"POSTS" => $profiledata['user_posts'],
@@ -293,74 +293,83 @@ switch($mode)
$page_title = "$l_register";
include('includes/page_header.'.$phpEx);
- $template->set_filenames(array("body" => "profile_add_body.tpl"));
- $template->assign_vars(array(
- "COPPA" => 0,
- "MODE" => $mode,
- "USERNAME" => $userdata['username'],
- "EMAIL" => $userdata['user_email'],
- "YIM" => $userdata['user_yim'],
- "ICQ" => $userdata['user_icq'],
- "MSN" => $userdata['user_msnm'],
- "AIM" => $userdata['user_aim'],
- "OCCUPATION" => $userdata['user_occ'],
- "SIGNATURE" => $userdata['user_sig'],
- "INTERESTS" => $userdata['user_interests'],
- "LOCATION" => $userdata['user_from'],
- "WEBSITE" => $userdata['user_website'],
- "VIEW_EMAIL_YES" => ($userdata['user_viewemail']) ? "CHECKED" : "",
- "VIEW_EMAIL_NO" => (!$userdata['user_viewemail']) ? "CHECKED" : "",
- "ALWAYS_ADD_SIGNATURE_YES" => ($userdata['user_attachsig']) ? "CHECKED" : "",
- "ALWAYS_ADD_SIGNATURE_NO" => (!$userdata['user_attachsig']) ? "CHECKED" : "",
- "ALWAYS_ALLOW_BBCODE_YES" => ($userdata['user_bbcode']) ? "CHECKED" : "",
- "ALWAYS_ALLOW_BBCODE_NO" => (!$userdata['user_bbcode']) ? "CHECKED" : "",
- "ALWAYS_ALLOW_HTML_YES" => ($userdata['user_html']) ? "CHECKED" : "",
- "ALWAYS_ALLOW_HTML_NO" => (!$userdata['user_html']) ? "CHECKED" : "",
- "ALWAYS_ALLOW_SMILIES_YES" => ($userdata['user_desmile']) ? "CHECKED" : "",
- "ALWAYS_ALLOW_SMILIES_NO" => (!$userdata['user_desmile']) ? "CHECKED" : "",
- "LANGUAGE_SELECT" => language_select($userdata['user_lang']),
- "THEME_SELECT" => theme_select($theme['theme_id']),
- "TIMEZONE_SELECT" => tz_select($userdata['user_timezone']),
- "DATE_FORMAT" => $userdata['user_dateformat'],
- "TEMPLATE_SELECT" => template_select($userdata['user_template']),
-
- "L_PASSWORD_IF_CHANGED" => $l_password_if_changed,
- "L_PASSWORD_CONFIRM_IF_CHANGED" => $l_password_confirm_if_changed,
- "L_SUBMIT" => $l_submit,
- "L_ICQ_NUMBER" => $l_icq_number,
- "L_MESSENGER" => $l_messenger,
- "L_YAHOO" => $l_yahoo,
- "L_WEBSITE" => $l_website,
- "L_AIM" => $l_aim,
- "L_LOCATION" => $l_from,
- "L_OCCUPATION" => $l_occupation,
- "L_BOARD_LANGUAGE" => $l_boardlang,
- "L_BOARD_THEME" => $l_boardtheme,
- "L_BOARD_TEMPLATE" => $l_boardtemplate,
- "L_TIMEZONE" => $l_timezone,
- "L_DATE_FORMAT" => $l_date_format,
- "L_DATE_FORMAT_EXPLANATION" => $l_date_format_explanation,
- "L_YES" => $l_yes,
- "L_NO" => $l_no,
- "L_INTERESTS" => $l_interests,
- "L_USER_UNIQUE" => $l_useruniq,
- "L_ALWAYS_ALLOW_SMILIES" => $l_alwayssmile,
- "L_ALWAYS_ALLOW_BBCODE" => $l_alwaysbbcode,
- "L_ALWAYS_ALLOW_HTML" => $l_alwayshtml,
- "L_ALWAYS_ADD_SIGNATURE" => $l_alwayssig,
- "L_SIGNATURE" => $l_signature,
- "L_SIGNATURE_EXPLAIN" => $l_sigexplain,
- "L_PREFERENCES" => $l_preferences,
- "L_PUBLIC_VIEW_EMAIL" => $l_publicmail,
- "L_ITEMS_REQUIRED" => $l_itemsreq,
- "L_REGISTRATION_INFO" => $l_reginfo,
- "L_PROFILE_INFO" => $l_profile_info,
- "L_PROFILE_INFO_NOTICE" => $l_profile_info_notice,
- "L_CONFIRM" => $l_confirm,
- "L_EMAIL_ADDRESS" => $l_emailaddress));
+ if(isset($HTTP_POST_VARS['submit']))
+ {
- $template->pparse("body");
- include('includes/page_tail.'.$phpEx);
+ }
+ else
+ {
+
+ $template->set_filenames(array(
+ "body" => "profile_add_body.tpl"));
+ $template->assign_vars(array(
+ "COPPA" => 0,
+ "MODE" => $mode,
+ "USERNAME" => $userdata['username'],
+ "EMAIL" => $userdata['user_email'],
+ "YIM" => $userdata['user_yim'],
+ "ICQ" => $userdata['user_icq'],
+ "MSN" => $userdata['user_msnm'],
+ "AIM" => $userdata['user_aim'],
+ "OCCUPATION" => $userdata['user_occ'],
+ "SIGNATURE" => str_replace("<br>", "\n", $userdata['user_sig']),
+ "INTERESTS" => $userdata['user_interests'],
+ "LOCATION" => $userdata['user_from'],
+ "WEBSITE" => $userdata['user_website'],
+ "VIEW_EMAIL_YES" => ($userdata['user_viewemail']) ? "CHECKED" : "",
+ "VIEW_EMAIL_NO" => (!$userdata['user_viewemail']) ? "CHECKED" : "",
+ "ALWAYS_ADD_SIGNATURE_YES" => ($userdata['user_attachsig']) ? "CHECKED" : "",
+ "ALWAYS_ADD_SIGNATURE_NO" => (!$userdata['user_attachsig']) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_BBCODE_YES" => ($userdata['user_bbcode']) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_BBCODE_NO" => (!$userdata['user_bbcode']) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_HTML_YES" => ($userdata['user_html']) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_HTML_NO" => (!$userdata['user_html']) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_SMILIES_YES" => ($userdata['user_desmile']) ? "CHECKED" : "",
+ "ALWAYS_ALLOW_SMILIES_NO" => (!$userdata['user_desmile']) ? "CHECKED" : "",
+ "LANGUAGE_SELECT" => language_select($userdata['user_lang']),
+ "THEME_SELECT" => theme_select($userdata['user_theme']),
+ "TIMEZONE_SELECT" => tz_select($userdata['user_timezone']),
+ "DATE_FORMAT" => $userdata['user_dateformat'],
+ "TEMPLATE_SELECT" => template_select($userdata['user_template']),
+
+ "L_PASSWORD_IF_CHANGED" => $l_password_if_changed,
+ "L_PASSWORD_CONFIRM_IF_CHANGED" => $l_password_confirm_if_changed,
+ "L_SUBMIT" => $l_submit,
+ "L_ICQ_NUMBER" => $l_icq_number,
+ "L_MESSENGER" => $l_messenger,
+ "L_YAHOO" => $l_yahoo,
+ "L_WEBSITE" => $l_website,
+ "L_AIM" => $l_aim,
+ "L_LOCATION" => $l_from,
+ "L_OCCUPATION" => $l_occupation,
+ "L_BOARD_LANGUAGE" => $l_boardlang,
+ "L_BOARD_THEME" => $l_boardtheme,
+ "L_BOARD_TEMPLATE" => $l_boardtemplate,
+ "L_TIMEZONE" => $l_timezone,
+ "L_DATE_FORMAT" => $l_date_format,
+ "L_DATE_FORMAT_EXPLANATION" => $l_date_format_explanation,
+ "L_YES" => $l_yes,
+ "L_NO" => $l_no,
+ "L_INTERESTS" => $l_interests,
+ "L_USER_UNIQUE" => $l_useruniq,
+ "L_ALWAYS_ALLOW_SMILIES" => $l_alwayssmile,
+ "L_ALWAYS_ALLOW_BBCODE" => $l_alwaysbbcode,
+ "L_ALWAYS_ALLOW_HTML" => $l_alwayshtml,
+ "L_ALWAYS_ADD_SIGNATURE" => $l_alwayssig,
+ "L_SIGNATURE" => $l_signature,
+ "L_SIGNATURE_EXPLAIN" => $l_sigexplain,
+ "L_PREFERENCES" => $l_preferences,
+ "L_PUBLIC_VIEW_EMAIL" => $l_publicmail,
+ "L_ITEMS_REQUIRED" => $l_itemsreq,
+ "L_REGISTRATION_INFO" => $l_reginfo,
+ "L_PROFILE_INFO" => $l_profile_info,
+ "L_PROFILE_INFO_NOTICE" => $l_profile_info_notice,
+ "L_CONFIRM" => $l_confirm,
+ "L_EMAIL_ADDRESS" => $l_emailaddress));
+
+ $template->pparse("body");
+ include('includes/page_tail.'.$phpEx);
+ }
break;
case 'register':
@@ -387,14 +396,12 @@ switch($mode)
$allowbbcode = $HTTP_POST_VARS['allowbbcode'];
$allowsmilies = $HTTP_POST_VARS['allowsmilies'];
- $user_theme = ($HTTP_POST_VARS['theme']) ? $HTTP_POST_VARS['theme'] : $default_theme;
- $user_lang = ($HTTP_POST_VARS['language']) ? $HTTP_POST_VARS['language'] : $default_lang;
- $user_timezone = (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $sys_timezone;
- $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $sys_template;
- $user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $default_dateformat;
+ $user_theme = ($HTTP_POST_VARS['theme']) ? $HTTP_POST_VARS['theme'] : $board_config['default_theme'];
+ $user_lang = ($HTTP_POST_VARS['language']) ? $HTTP_POST_VARS['language'] : $board_config['default_lang'];
+ $user_timezone = (isset($HTTP_POST_VARS['timezone'])) ? $HTTP_POST_VARS['timezone'] : $board_config['default_timezone'];
+ $user_template = ($HTTP_POST_VARS['template']) ? $HTTP_POST_VARS['template'] : $board_config['default_template'];
+ $user_dateformat = ($HTTP_POST_VARS['dateformat']) ? trim($HTTP_POST_VARS['dateformat']) : $board_config['default_dateformat'];
- $submit = $HTTP_POST_VARS['submit'];
-
list($hr, $min, $sec, $mon, $day, $year) = explode(",", gmdate("H,i,s,m,d,Y", time()));
$regdate = gmmktime($hr, $min, $sec, $mon, $day, $year);
@@ -402,14 +409,15 @@ switch($mode)
$page_title = "$l_register";
include('includes/page_header.'.$phpEx);
- if(!isset($agreed))
+
+ if(!isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']))
{
$template->pparse("body");
include('includes/page_tail.'.$phpEx);
}
else
{
- if(isset($submit))
+ if(isset($HTTP_POST_VARS['submit']))
{
$error = FALSE;
if(empty($username) || empty($password) || empty($password_confirm) || empty($email))
@@ -437,7 +445,7 @@ switch($mode)
}
}
- if(isset($submit) && !$error)
+ if(isset($HTTP_POST_VARS['submit']) && !$error)
{
//
// The AUTO_INCREMENT field in MySQL v3.23 doesn't work
@@ -463,7 +471,7 @@ switch($mode)
(user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_desmile, user_html, user_bbcode, user_timezone, user_dateformat, user_lang, user_template, user_theme, user_active, user_actkey)
VALUES
('$new_user_id', '$username', '$regdate', '$md_pass', '$email', '$icq', '$website', '$occupation', '$location', '$interests', '$signature', '$viewemail', '$aim', '$yim', '$msn', '$attachsig', '$allowsmilies', '$allowhtml', '$allowbbcode', '$user_timezone', '$user_dateformat', '$user_lang', '$user_template', '$user_theme', ";
- if($require_activation || $coppa)
+ if($require_activation || $HTTP_POST_VARS['coppa'])
{
$act_key = generate_activation_key();
$sql .= "0, '$act_key')";
@@ -533,10 +541,11 @@ switch($mode)
$coppa = FALSE;
}
- if(!isset($selected_template))
+ if(!isset($user_template))
{
- $selected_template = $sys_template;
+ $selected_template = $board_config['default_template'];
}
+
$template->assign_vars(array(
"MODE" => $mode,
"USERNAME" => $username,
@@ -601,10 +610,11 @@ switch($mode)
$template->pparse("body");
include('includes/page_tail.'.$phpEx);
- }
- break;
+ }
+ break;
case 'activate':
+
$sql = "SELECT user_id
FROM ".USERS_TABLE."
WHERE user_actkey = '$act_key'";
diff --git a/phpBB/templates/Default/viewforum_body.tpl b/phpBB/templates/Default/viewforum_body.tpl
index b9d952a9cf..5be8f6f258 100644
--- a/phpBB/templates/Default/viewforum_body.tpl
+++ b/phpBB/templates/Default/viewforum_body.tpl
@@ -15,12 +15,12 @@
<!-- BEGIN topicrow -->
<tr bgcolor="#DDDDDD" class="tablebody">
<td width="5%" align="center" valign="middle">{topicrow.FOLDER}</td>
- <td><a href="viewtopic.{PHPEX}?{S_TOPICS_URL}={topicrow.TOPIC_ID}&{topicrow.REPLIES}">{topicrow.TOPIC_TITLE}</a>{topicrow.GOTO_PAGE}</td>
- <td width="5%" align="center" valign="middle">{topicrow.REPLIES}</td>
- <td width="10%" align="center" valign="middle">{topicrow.TOPIC_POSTER}</td>
+ <td><a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a>&nbsp;{topicrow.GOTO_PAGE}</td>
+ <td width="5%" align="center" valign="middle">{topicrow.REPLIES}</td>
+ <td width="10%" align="center" valign="middle">{topicrow.TOPIC_POSTER}</td>
<td width="5%" align="center" valign="middle">{topicrow.VIEWS}</td>
- <td width="15%" align="center" valign="middle">{topicrow.LAST_POST}</td>
- </tr>
+ <td width="15%" align="center" valign="middle">{topicrow.LAST_POST_TIME}<br />{L_BY} <a href="{topicrow.U_LAST_POST_USER_PROFILE}">{topicrow.LAST_POST_USER}</a></td>
+ </tr>
<!-- END topicrow -->
</table>
</td>
diff --git a/phpBB/templates/Default/viewforum_footer.tpl b/phpBB/templates/Default/viewforum_footer.tpl
index c55d8ce53b..a89b71de55 100644
--- a/phpBB/templates/Default/viewforum_footer.tpl
+++ b/phpBB/templates/Default/viewforum_footer.tpl
@@ -8,7 +8,7 @@
<td>
<table border="0" width="100%" bgcolor="#CCCCCC" cellpadding="1" cellspacing="1">
<tr>
- <td align="left" style="{font-size: 8pt;}"><a href="posting.{PHPEX}?mode=newtopic&{S_FORUMS_URL}={FORUM_ID}"><img src="images/newpost.jpg" height="50" width="250" alt="Post New Topic" border="0"></a></td>
+ <td align="left" style="{font-size: 8pt;}"><a href="{U_POST_NEW_TOPIC}"><img src="images/newpost.jpg" height="50" width="250" alt="Post New Topic" border="0"></a></td>
</tr>
</table>
</td>
diff --git a/phpBB/templates/Default/viewforum_header.tpl b/phpBB/templates/Default/viewforum_header.tpl
index 76435867ef..dfc5c52b49 100644
--- a/phpBB/templates/Default/viewforum_header.tpl
+++ b/phpBB/templates/Default/viewforum_header.tpl
@@ -24,7 +24,7 @@
<table border="0" width="100%" bgcolor="#CCCCCC" cellpadding="1" cellspacing="1">
<tr>
<td align="right" style="{font-size: 8pt;}">
- <a href="posting.{PHPEX}?mode=newtopic&{S_FORUMS_URL}={FORUM_ID}">
+ <a href="{U_POST_NEW_TOPIC}">
<img src="images/newpost.jpg" height="50" width="250" alt="Post New Topic" border="0">
</a>
</td>
diff --git a/phpBB/templates/Default/viewtopic_body.tpl b/phpBB/templates/Default/viewtopic_body.tpl
index 3ed4ef5af8..0eeb777095 100644
--- a/phpBB/templates/Default/viewtopic_body.tpl
+++ b/phpBB/templates/Default/viewtopic_body.tpl
@@ -4,9 +4,9 @@
<tr>
<td>
<table border="0" width="100%" cellpadding="3" cellspacing="1">
- <tr><td wdith="90%" class="tablebody" bgcolor="#CCCCCC">This topic is {PAGES} long. {PAGINATION}</td>
- <td width="5%" class="tableheader" align="center"><a href="viewtopic.{PHPEX}?{S_TOPICS_URL}={TOPIC_ID}&view=older"><img src="images/prev.gif" alt="View previous topic" border="0"></a></td>
- <td width="5%" class="tableheader" align="center"><a href="viewtopic.{PHPEX}?{S_TOPICS_URL}={TOPIC_ID}&view=newer"><img src="images/next.gif" alt="View next topic" border="0"></a></td>
+ <tr><td wdith="90%" class="tablebody" bgcolor="#CCCCCC">This topic is {PAGES} {L_PAGES} long. {PAGINATION}</td>
+ <td width="5%" class="tableheader" align="center"><a href="{U_VIEW_OLDER_TOPIC}"><img src="images/prev.gif" alt="View previous topic" border="0"></a></td>
+ <td width="5%" class="tableheader" align="center"><a href="{U_VIEW_NEWER_TOPIC}"><img src="images/next.gif" alt="View next topic" border="0"></a></td>
</tr>
</table>
</td>
@@ -57,11 +57,11 @@
<td width="90%" class="tablebody" bgcolor="#CCCCCC"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td align="left" nowrap><b>{S_TIMEZONE}</b></td>
- <td align="right" nowrap>This topic is {PAGES} long. {PAGINATION}</td>
+ <td align="right" nowrap>This topic is {PAGES} {L_PAGES} long. {PAGINATION}</td>
</tr>
</table></td>
- <td width="5%" class="tableheader" align="center"><a href="viewtopic.{PHPEX}?{S_TOPICS_URL}={TOPIC_ID}&view=older"><img src="images/prev.gif" alt="View previous topic" border="0"></a></td>
- <td width="5%" class="tableheader" align="center"><a href="viewtopic.{PHPEX}?{S_TOPICS_URL}={TOPIC_ID}&view=newer"><img src="images/next.gif" alt="View next topic" border="0"></a></td>
+ <td width="5%" class="tableheader" align="center"><a href="{U_VIEW_OLDER_TOPIC}"><img src="images/prev.gif" alt="View previous topic" border="0"></a></td>
+ <td width="5%" class="tableheader" align="center"><a href="{U_VIEW_NEWER_TOPIC}"><img src="images/next.gif" alt="View next topic" border="0"></a></td>
</tr>
</table>
</td>
diff --git a/phpBB/templates/Default/viewtopic_footer.tpl b/phpBB/templates/Default/viewtopic_footer.tpl
index f4277d2cf5..0b03860f44 100644
--- a/phpBB/templates/Default/viewtopic_footer.tpl
+++ b/phpBB/templates/Default/viewtopic_footer.tpl
@@ -9,9 +9,9 @@
<table border="0" width="100%" bgcolor="#CCCCCC" cellpadding="1" cellspacing="1">
<tr>
<td align="left" style="{font-size: 8pt;}">
- <a href="posting.{PHPEX}?mode=newtopic&{S_FORUMS_URL}={FORUM_ID}">
+ <a href="{U_POST_NEW_TOPIC}">
<img src="images/newpost.jpg" height="50" width="125" alt="Post New Topic" border="0"></a>&nbsp;
- <a href="posting.{PHPEX}?mode=reply&{S_TOPICS_URL}={TOPIC_ID}">
+ <a href="{U_POST_REPLY_TOPIC}">
<img src="images/reply.jpg" height="50" width="125" alt="Reply to this topic" border="0">
</a>
</td>
diff --git a/phpBB/templates/Default/viewtopic_header.tpl b/phpBB/templates/Default/viewtopic_header.tpl
index 323162b098..352af43c9f 100644
--- a/phpBB/templates/Default/viewtopic_header.tpl
+++ b/phpBB/templates/Default/viewtopic_header.tpl
@@ -9,7 +9,7 @@
<table border="0" width="100%" bgcolor="#CCCCCC" cellpadding="1" cellspacing="1">
<tr>
<td align="left" valign="bottom" style="{font-size: 8pt; height: 55px;}" nowrap>
- <a href="index.{PHPEX}">{SITENAME} - Forum Index</a> >> <a href="viewforum.{PHPEX}?{S_FORUMS_URL}={FORUM_ID}">{FORUM_NAME}</a> >> {TOPIC_TITLE}
+ <a href="{U_INDEX}">{SITENAME} - Forum Index</a> >> <a href="{U_VIEW_FORUM}">{FORUM_NAME}</a> >> {TOPIC_TITLE}
</td>
</tr>
</table>
@@ -22,11 +22,7 @@
<table border="0" width="100%" bgcolor="#CCCCCC" cellpadding="1" cellspacing="1">
<tr>
<td align="right" style="{font-size: 8pt;}">
- <a href="posting.{PHPEX}?mode=newtopic&{S_FORUMS_URL}={FORUM_ID}">
- <img src="images/newpost.jpg" height="50" width="125" alt="Post New Topic" border="0"></a>&nbsp;
- <a href="posting.{PHPEX}?mode=reply&{S_TOPICS_URL}={TOPIC_ID}">
- <img src="images/reply.jpg" height="50" width="125" alt="Reply to this topic" border="0">
- </a>
+ <a href="{U_POST_NEW_TOPIC}"><img src="images/newpost.jpg" height="50" width="125" alt="Post New Topic" border="0"></a>&nbsp;<a href="{U_POST_REPLY_TOPIC}"><img src="images/reply.jpg" height="50" width="125" alt="Reply to this topic" border="0"></a>
</td>
</tr>
</table>
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 1205800e31..4bcf6a4f92 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -23,6 +23,9 @@
include('extension.inc');
include('common.'.$phpEx);
+$pagetype = "viewforum";
+$page_title = "View Forum - $forum_name";
+
//
// Obtain which forum id is required
//
@@ -35,21 +38,10 @@ else
$forum_id = ($HTTP_GET_VARS['forum']) ? $HTTP_GET_VARS['forum'] : $HTTP_POST_VARS['forum'];
}
-$pagetype = "viewforum";
-$page_title = "View Forum - $forum_name";
-
//
-// Start session management
-//
-$userdata = session_pagestart($user_ip, $forum_id, $session_length);
-init_userprefs($userdata);
-//
-// End session management
-//
-
-
-// Check if the user has acutally sent a forum ID with his/her request
+// Check if the user has actually 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, f.forum_topics, u.username, u.user_id
@@ -63,21 +55,31 @@ else
error_die(GENERAL_ERROR, "You have reached this page in error, please go back and try again");
}
+//
+// Start session management
+//
+$userdata = session_pagestart($user_ip, $forum_id, $session_length);
+init_userprefs($userdata);
+//
+// End session management
+//
+
if(!$result = $db->sql_query($sql))
{
error_die(SQL_QUERY, "Couldn't obtain forums information.", __LINE__, __FILE__);
}
+// If the query doesn't return any rows this
+// isn't a valid forum. Inform the user.
+if(!$total_rows = $db->sql_numrows($result))
+{
+ error_die(GENERAL_ERROR, "The forum you selected does not exist. Please go back and try again.");
+}
//
// Add checking for private forums here!!
//
-// 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(GENERAL_ERROR, "The forum you selected does not exist. Please go back and try again.");
-}
$forum_row = $db->sql_fetchrowset($result);
if(!$forum_row)
@@ -89,17 +91,15 @@ $forum_name = stripslashes($forum_row[0]["forum_name"]);
$topics_count = $forum_row[0]["forum_topics"];
for($x = 0; $x < $db->sql_numrows($result); $x++)
{
- if($x > 0)
- $forum_moderators .= ", ";
- $forum_moderators .= "<a href=\"profile.$phpEx?mode=viewprofile&user_id=".$forum_row[$x]["user_id"]."\">".$forum_row[$x]["username"]."</a>";
+ if($x > 0)
+ $forum_moderators .= ", ";
+
+ $forum_moderators .= "<a href=\"profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$forum_row[$x]["user_id"]."\">".$forum_row[$x]["username"]."</a>";
}
-include('includes/page_header.'.$phpEx);
-
-
if(!isset($start))
{
- $start = 0;
+ $start = 0;
}
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time
@@ -109,97 +109,128 @@ $sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as i
LEFT JOIN " . USERS_TABLE . " u2 ON p.poster_id = u2.user_id
WHERE t.forum_id = '$forum_id'
ORDER BY topic_time DESC
- LIMIT $start, $topics_per_page";
+ LIMIT $start, ".$board_config['topics_per_page'];
if(!$t_result = $db->sql_query($sql))
{
error_die(SQL_QUERY, "Couldn't obtain topic information.", __LINE__, __FILE__);
}
-$total_topics = $db->sql_numrows();
+$total_topics = $db->sql_numrows($t_result);
+
+//
+// Post URL generation for
+// templating vars
+//
+$post_new_topic_url = "posting.".$phpEx."?mode=newtopic&".POST_FORUM_URL."=$forum_id";
+$template->assign_vars(array(
+ "U_POST_NEW_TOPIC" => $post_new_topic_url));
+//
+// Dump out the page header
+//
+include('includes/page_header.'.$phpEx);
+
+//
+// Okay, lets dump out the page ...
+//
if($total_topics)
{
- $topic_rowset = $db->sql_fetchrowset($t_result);
- for($x = 0; $x < $total_topics; $x++)
- {
- $topic_title = stripslashes($topic_rowset[$x]["topic_title"]);
- $topic_id = $topic_rowset[$x]["topic_id"];
- $replies = $topic_rowset[$x]["topic_replies"];
- if($replies > $posts_per_page)
- {
- $goto_page = "&nbsp;&nbsp;&nbsp;(<img src=\"images/posticon.gif\">$l_gotopage: ";
- $times = 1;
- for($i = 0; $i < ($replies + 1); $i += $posts_per_page)
- {
- if($times > 4)
- {
- if(($i + $posts_per_page) >= ($replies + 1))
- {
- $goto_page.=" ... <a href=\"viewtopic.$phpEx?".POST_TOPIC_URL."=".$topic_id."&start=$i\">$times</a>";
- }
- }
+ $topic_rowset = $db->sql_fetchrowset($t_result);
+ for($x = 0; $x < $total_topics; $x++)
+ {
+ $topic_title = stripslashes($topic_rowset[$x]["topic_title"]);
+ $topic_id = $topic_rowset[$x]["topic_id"];
+ $replies = $topic_rowset[$x]["topic_replies"];
+ if($replies > $board_config['posts_per_page'])
+ {
+ $goto_page = "&nbsp;&nbsp;&nbsp;(<img src=\"".$images['posticon']."\">$l_gotopage: ";
+ $times = 1;
+ for($i = 0; $i < ($replies + 1); $i += $board_config['posts_per_page'])
+ {
+ if($times > 4)
+ {
+ if(($i + $board_config['posts_per_page']) >= ($replies + 1))
+ {
+ $goto_page.=" ... <a href=\"viewtopic.$phpEx?".POST_TOPIC_URL."=".$topic_id."&start=$i\">$times</a>";
+ }
+ }
+ else
+ {
+ if($times != 1)
+ {
+ $goto_page.= ", ";
+ }
+ $goto_page.= "<a href=\"viewtopic.$phpEx?".POST_TOPIC_URL."=".$topic_id."&start=$i\">$times</a>";
+ }
+ $times++;
+ }
+ $goto_page.= ")";
+ }
else
- {
- if($times != 1)
- {
- $goto_page.= ", ";
- }
- $goto_page.= "<a href=\"viewtopic.$phpEx?".POST_TOPIC_URL."=".$topic_id."&start=$i\">$times</a>";
- }
- $times++;
+ {
+ $goto_page = "";
+ }
+
+ $folder_img = "<img src=\"".$images['folder']."\">";
+
+ $view_topic_url = "viewtopic.".$phpEx."?".POST_TOPIC_URL."=".$topic_id."&".$replies;
+
+ $topic_poster = stripslashes($topic_rowset[$x]["username"]);
+ $topic_poster_profile_url = "profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$topic_rowset[$x]["user_id"];
+
+ $last_post_time = create_date($board_config['default_dateformat'], $topic_rowset[$x]["post_time"], $board_config['default_timezone']);
+ $last_post_user = $topic_rowset[$x]["user2"];
+ $last_post_profile_url = "profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$topic_rowset[$x]["id2"];
+
+ $views = $topic_rowset[$x]["topic_views"];
+
+ $template->assign_block_vars("topicrow", array(
+ "FORUM_ID" => $forum_id,
+ "TOPIC_ID" => $topic_id,
+ "FOLDER" => $folder_img,
+ "TOPIC_POSTER" => $topic_poster,
+ "U_TOPIC_POSTER_PROFILE" => $topic_poster_profile_url,
+ "GOTO_PAGE" => $goto_page,
+ "REPLIES" => $replies,
+ "TOPIC_TITLE" => $topic_title,
+ "VIEWS" => $views,
+ "LAST_POST_TIME" => $last_post_time,
+ "LAST_POST_USER" => $last_post_user,
+
+ "U_VIEW_TOPIC" => $view_topic_url,
+ "U_LAST_POST_USER_PROFILE" => $last_post_profile_url));
}
- $goto_page.= ")";
- }
- else
- {
- $goto_page = "";
- }
- $topic_poster = stripslashes($topic_rowset[$x]["username"]);
- $views = $topic_rowset[$x]["topic_views"];
- $last_post_time = create_date($date_format, $topic_rowset[$x]["post_time"], $sys_timezone);
- $last_post_user = $topic_rowset[$x]["user2"];
- $folder_img = "<img src=\"images/folder.gif\">";
- $template->assign_block_vars(
- "topicrow", array("FORUM_ID" => $forum_id,
- "TOPIC_ID" => $topic_id,
- "FOLDER" => $folder_img,
- "TOPIC_POSTER" => "<a href=\"profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$topic_rowset[$x]["user_id"]."\">".$topic_poster."</a>",
- "GOTO_PAGE" => $goto_page,
- "REPLIES" => $replies,
- "TOPIC_TITLE" => $topic_title,
- "VIEWS" => $views,
- "LAST_POST" => $last_post_time . "<br />$l_by <a href=\"profile.$phpEx?mode=viewprofile&".POST_USERS_URL."=".$topic_rowset[$x]["id2"]."\">" . $last_post_user ."</a>"));
- }
-
- $count = 1;
- $next = $start + $topics_per_page;
- if($topics_count > $topics_per_page)
- {
- if($next < $topics_count)
- {
- $pagination = "<a href=\"viewforum.$phpEx?forum_id=$forum_id&start=$next\">$l_nextpage</a> | ";
- }
- for($x = 0; $x < $topics_count; $x++)
- {
- if(!($x % $topics_per_page))
- {
- if($x == $start)
- {
- $pagination .= "$count";
- }
- else
- {
- $pagination .= " <a href=\"viewforum.$phpEx?".POST_FORUM_URL."=$forum_id&start=$x\">$count</a> ";
- }
- $count++;
- if(!($count % 20))
- {
- $pagination .= "<br>";
- }
- }
- }
- }
- $template->assign_vars(array("PAGINATION" => $pagination));
- $template->pparse("body");
+
+ $count = 1;
+ $next = $start + $board_config['topics_per_page'];
+ if($topics_count > $board_config['topics_per_page'])
+ {
+ if($next < $topics_count)
+ {
+ $pagination = "<a href=\"viewforum.$phpEx?".POST_FORUM_URL."=$forum_id&start=$next\">$l_nextpage</a> | ";
+ }
+ for($x = 0; $x < $topics_count; $x++)
+ {
+ if(!($x % $board_config['topics_per_page']))
+ {
+ if($x == $start)
+ {
+ $pagination .= "$count";
+ }
+ else
+ {
+ $pagination .= " <a href=\"viewforum.$phpEx?".POST_FORUM_URL."=$forum_id&start=$x\">$count</a> ";
+ }
+ $count++;
+ if(!($count % 20))
+ {
+ $pagination .= "<br>";
+ }
+ }
+ }
+ }
+ $template->assign_vars(array(
+ "PAGINATION" => $pagination));
+ $template->pparse("body");
}
else
{
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 07d321d87b..6892f3eadb 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -24,6 +24,9 @@ include('extension.inc');
include('common.'.$phpEx);
include('includes/bbcode.'.$phpEx);
+$page_title = "View Topic - $topic_title";
+$pagetype = "viewtopic";
+
if(!isset($HTTP_GET_VARS['topic'])) // For backward compatibility
{
$topic_id = $HTTP_GET_VARS[POST_TOPIC_URL];
@@ -84,11 +87,9 @@ for($x = 0; $x < $total_rows; $x++)
// Add checking for private forums here
//
-$total_replies = $forum_row[0]["topic_replies"] + 1;
-$page_title = "View Topic - $topic_title";
-$pagetype = "viewtopic";
-include('includes/page_header.'.$phpEx);
+
+$total_replies = $forum_row[0]["topic_replies"] + 1;
if(!isset($start))
{
@@ -103,7 +104,7 @@ $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website,
AND (r.rank_special = 1)
WHERE p.topic_id = '$topic_id'
ORDER BY p.post_time ASC
- LIMIT $start, $posts_per_page";
+ LIMIT $start, ".$board_config['posts_per_page'];
if(!$result = $db->sql_query($sql))
{
error_die(SQL_QUERY, "Couldn't obtain post/user information.", __LINE__, __FILE__);
@@ -122,14 +123,39 @@ if(!$ranks_result = $db->sql_query($sql))
$postrow = $db->sql_fetchrowset($result);
$ranksrow = $db->sql_fetchrowset($ranksresult);
+//
+// Post, reply and other URL generation for
+// templating vars
+//
+$new_topic_url = "posting.".$phpEx."?mode=newtopic&".POST_FORUM_URL."=$forum_id";
+$reply_topic_url = "posting.".$phpEx."?mode=reply&".POST_TOPIC_URL."=$topic_id";
+$view_forum_url = "viewforum.".$phpEx."?".POST_FORUM_URL."=$forum_id";
+$view_older_topic_url = "viewtopic.".$phpEx."?".POST_TOPIC_URL."=".$topic_id."&view=older";
+$view_newer_topic_url = "viewtopic.".$phpEx."?".POST_TOPIC_URL."=".$topic_id."&view=newer";
+$template->assign_vars(array(
+ "U_POST_NEW_TOPIC" => $new_topic_url,
+ "U_VIEW_FORUM" => $view_forum_url,
+ "U_VIEW_OLDER_TOPIC" => $view_older_topic_url,
+ "U_VIEW_NEWER_TOPIC" => $view_newer_topic_url,
+ "U_POST_REPLY_TOPIC" => $reply_topic_url));
+
+//
+// Dump out the page header
+//
+include('includes/page_header.'.$phpEx);
+
+//
+// Okay, let's do the loop, yeah come on baby let's do the loop
+// and it goes like this ...
+//
for($x = 0; $x < $total_posts; $x++)
{
$poster = stripslashes($postrow[$x]["username"]);
$poster_id = $postrow[$x]["user_id"];
- $post_date = create_date($date_format, $postrow[$x]["post_time"], $sys_timezone);
+ $post_date = create_date($board_config['default_dateformat'], $postrow[$x]["post_time"], $board_config['default_timezone']);
$poster_posts = $postrow[$x]["user_posts"];
$poster_from = ($postrow[$x]["user_from"]) ? "$l_from: ".$postrow[$x]["user_from"] : "";
- $poster_joined = create_date($date_format, $postrow[$x]["user_regdate"], $sys_timezone);
+ $poster_joined = create_date($board_config['default_dateformat'], $postrow[$x]["user_regdate"], $board_config['default_timezone']);
if($poster_id != ANONYMOUS && $poster_id != DELETED)
{
if(!$postrow[$x]["rank_title"])
@@ -154,16 +180,14 @@ for($x = 0; $x < $total_posts; $x++)
$poster_rank = "";
}
-
-
- $profile_img = "<a href=\"profile.$phpEx?mode=viewprofile&user_id=$poster_id\"><img src=\"$image_profile\" alt=\"$l_profileof $poster\" border=\"0\"></a>";
- $email_img = ($postrow[$x]["user_viewemail"] == 1) ? "<a href=\"mailto:".$postrow[$x]["user_email"]."\"><img src=\"$image_email\" alt=\"$l_email $poster\" border=\"0\"></a>" : "";
- $www_img = ($postrow[$x]["user_website"]) ? "<a href=\"".$postrow[$x]["user_website"]."\"><img src=\"$image_www\" alt=\"$l_viewsite\" border=\"0\"></a>" : "";
+ $profile_img = "<a href=\"profile.$phpEx?mode=viewprofile&user_id=$poster_id\"><img src=\"".$images['profile']."\" alt=\"$l_profileof $poster\" border=\"0\"></a>";
+ $email_img = ($postrow[$x]["user_viewemail"] == 1) ? "<a href=\"mailto:".$postrow[$x]["user_email"]."\"><img src=\"".$images['email']."\" alt=\"$l_email $poster\" border=\"0\"></a>" : "";
+ $www_img = ($postrow[$x]["user_website"]) ? "<a href=\"".$postrow[$x]["user_website"]."\"><img src=\"".$images['www']."\" alt=\"$l_viewsite\" border=\"0\"></a>" : "";
if($postrow[$x]["user_icq"])
{
$icq_status_img = "<a href=\"http://wwp.icq.com/".$postrow[$x]["user_icq"]."#pager\"><img src=\"http://online.mirabilis.com/scripts/online.dll?icq=".$postrow[$x]["user_icq"]."&img=5\" alt=\"$l_icqstatus\" border=\"0\"></a>";
- $icq_add_img = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=".$postrow[$x]["user_icq"]."\"><img src=\"$image_icq\" alt=\"$l_icq\" border=\"0\"></a>";
+ $icq_add_img = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=".$postrow[$x]["user_icq"]."\"><img src=\"".$images['icq']."\" alt=\"$l_icq\" border=\"0\"></a>";
}
else
{
@@ -171,30 +195,30 @@ for($x = 0; $x < $total_posts; $x++)
$icq_add_img = "";
}
- $aim_img = ($postrow[$x]["user_aim"]) ? "<a href=\"aim:goim?screenname=".$postrow[$x]["user_aim"]."&message=Hello+Are+you+there?\"><img src=\"$image_aim\" border=\"0\"></a>" : "";
- $msn_img = ($postrow[$x]["user_msnm"]) ? "<a href=\"profile.$phpEx?mode=viewprofile&user_id=$poster_id\"><img src=\"$image_msn\" border=\"0\"></a>" : "";
- $yim_img = ($postrow[$x]["user_yim"]) ? "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=".$postrow[$x]["user_yim"]."&.src=pg\"><img src=\"$image_yim\" border=\"0\"></a>" : "";
+ $aim_img = ($postrow[$x]["user_aim"]) ? "<a href=\"aim:goim?screenname=".$postrow[$x]["user_aim"]."&message=Hello+Are+you+there?\"><img src=\"".$images['aim']."\" border=\"0\"></a>" : "";
+ $msn_img = ($postrow[$x]["user_msnm"]) ? "<a href=\"profile.$phpEx?mode=viewprofile&user_id=$poster_id\"><img src=\"".$images['msn']."\" border=\"0\"></a>" : "";
+ $yim_img = ($postrow[$x]["user_yim"]) ? "<a href=\"http://edit.yahoo.com/config/send_webmesg?.target=".$postrow[$x]["user_yim"]."&.src=pg\"><img src=\"".$images['yim']."\" border=\"0\"></a>" : "";
- $edit_img = "<a href=\"posting.$phpEx?mode=editpost&post_id=".$postrow[$x]["post_id"]."&topic_id=$topic_id&forum_id=$forum_id\"><img src=\"$image_edit\" alt=\"$l_editdelete\" border=\"0\"></a>";
- $quote_img = "<a href=\"posting.$phpEx?mode=reply&quote=true&post_id=".$postrow[$x]["post_id"]."&topic_id=$topic_id&forum_id=$forum_id\"><img src=\"$image_quote\" alt=\"$l_replyquote\" border=\"0\"></a>";
- $pmsg_img = "<a href=\"priv_msgs.$phpEx?mode=send\"><img src=\"$image_pmsg\" alt=\"$l_sendpmsg\" border=\"0\"></a>";
+ $edit_img = "<a href=\"posting.$phpEx?mode=editpost&post_id=".$postrow[$x]["post_id"]."&topic_id=$topic_id&forum_id=$forum_id\"><img src=\"".$images['edit']."\" alt=\"$l_editdelete\" border=\"0\"></a>";
+ $quote_img = "<a href=\"posting.$phpEx?mode=reply&quote=true&post_id=".$postrow[$x]["post_id"]."&topic_id=$topic_id&forum_id=$forum_id\"><img src=\"".$images['quote']."\" alt=\"$l_replyquote\" border=\"0\"></a>";
+ $pmsg_img = "<a href=\"priv_msgs.$phpEx?mode=send\"><img src=\"".$images['pmsg']."\" alt=\"$l_sendpmsg\" border=\"0\"></a>";
if($is_moderator)
{
- $ip_img = "<a href=\"topicadmin.$phpEx?mode=viewip&user_id=".$poster_id."\"><img src=\"$image_ip\" alt=\"$l_viewip\" border=\"0\"></a>";
- $delpost_img = "<a href=\"topicadmin.$phpEx?mode=delpost$post_id=".$postrow[$x]["post_id"]."\"><img src=\"$image_delpost\" alt=\"$l_delete\" border=\"0\"></a>";
+ $ip_img = "<a href=\"topicadmin.$phpEx?mode=viewip&user_id=".$poster_id."\"><img src=\"".$images['ip']."\" alt=\"$l_viewip\" border=\"0\"></a>";
+ $delpost_img = "<a href=\"topicadmin.$phpEx?mode=delpost$post_id=".$postrow[$x]["post_id"]."\"><img src=\"".$images['delpost']."\" alt=\"$l_delete\" border=\"0\"></a>";
}
$message = stripslashes($postrow[$x]["post_text"]);
$bbcode_uid = $postrow[$x]['bbcode_uid'];
$user_sig = stripslashes($postrow[$x]['user_sig']);
- if(!$allow_html)
+ if(!$board_config['allow_html'])
{
$user_sig = strip_tags($user_sig);
$message = strip_tags($message);
}
- if($allow_bbcode)
+ if($board_config['allow_bbcode'])
{
// do bbcode stuff here
$sig_uid = make_bbcode_uid();
@@ -233,7 +257,8 @@ for($x = 0; $x < $total_posts; $x++)
$message = eregi_replace("\[addsig]$", "<br />_________________<br />" . nl2br($user_sig), $message);
- $template->assign_block_vars("postrow", array("TOPIC_TITLE" => $topic_title,
+ $template->assign_block_vars("postrow", array(
+ "TOPIC_TITLE" => $topic_title,
"POSTER_NAME" => $poster,
"POSTER_RANK" => $poster_rank,
"RANK_IMAGE" => $rank_image,
@@ -258,25 +283,25 @@ for($x = 0; $x < $total_posts; $x++)
"DELPOST_IMG" => $delpost_img));
}
-if($total_replies > $posts_per_page)
+if($total_replies > $board_config['posts_per_page'])
{
$times = 0;
- for($x = 0; $x < $total_replies; $x += $posts_per_page)
+ for($x = 0; $x < $total_replies; $x += $board_config['posts_per_page'])
{
$times++;
}
- $pages = $times . " pages";
+ $pages = $times . " $l_pages";
$times = 1;
$pagination = "$l_gotopage (";
- $last_page = $start - $posts_per_page;
+ $last_page = $start - $board_config['posts_per_page'];
if($start > 0)
{
- $pagination .= "<a href=\"$PHP_SELF?".POST_TOPIC_URL."=$topic_id&forum_id=$forum_id&start=$last_page\">$l_prevpage</a> ";
+ $pagination .= "<a href=\"$PHP_SELF?".POST_TOPIC_URL."=$topic_id&start=$last_page\">$l_prevpage</a> ";
}
- for($x = 0; $x < $total_replies; $x += $posts_per_page)
+ for($x = 0; $x < $total_replies; $x += $board_config['posts_per_page'])
{
if($times != 1)
{
@@ -292,24 +317,25 @@ if($total_replies > $posts_per_page)
}
else
{
- $pagination .= "<a href=\"$PHP_SELF?".POST_TOPIC_URL."=$topic_id&forum_id=$forum_id&start=$x\">$times</a>";
+ $pagination .= "<a href=\"$PHP_SELF?".POST_TOPIC_URL."=$topic_id&start=$x\">$times</a>";
}
$times++;
}
- if(($start + $posts_per_page) < $total_replies)
+ if(($start + $board_config['posts_per_page']) < $total_replies)
{
- $next_page = $start + $posts_per_page;
- $pagination .= " <a href=\"$PHP_SELF?".POST_TOPIC_URL."=$topic_id&forum_id=$forum_id&start=$next_page\">$l_nextpage</a>";
+ $next_page = $start + $board_config['posts_per_page'];
+ $pagination .= " <a href=\"$PHP_SELF?".POST_TOPIC_URL."=$topic_id&start=$next_page\">$l_nextpage</a>";
}
$pagination .= " )";
}
else
{
- $pages = "1 page";
+ $pages = "1 $l_page";
}
-$template->assign_vars(array("PAGES" => $pages,
+$template->assign_vars(array(
+ "PAGES" => $pages,
"PAGINATION" => $pagination));
$template->pparse("body");