aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
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/includes
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/includes')
-rw-r--r--phpBB/includes/functions.php50
-rw-r--r--phpBB/includes/page_header.php31
-rw-r--r--phpBB/includes/page_tail.php9
3 files changed, 45 insertions, 45 deletions
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");