mirror of
https://github.com/phpbb/phpbb.git
synced 2025-01-18 14:48:28 +01:00
Changes to include location + some other misc stuff
git-svn-id: file:///svn/phpbb/trunk@646 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
79d57c449f
commit
ea98341099
@ -23,9 +23,8 @@
|
||||
***************************************************************************/
|
||||
|
||||
//
|
||||
// Define some basic configuration arrays
|
||||
// this also prevents malicious rewriting
|
||||
// of language array values via URI params
|
||||
// Define some basic configuration arrays this also prevents
|
||||
// malicious rewriting of language array values via URI params
|
||||
//
|
||||
$board_config = Array();
|
||||
$userdata = Array();
|
||||
@ -33,38 +32,45 @@ $theme = Array();
|
||||
$images = Array();
|
||||
$lang = Array();
|
||||
|
||||
include('config.'.$phpEx);
|
||||
include('includes/constants.'.$phpEx);
|
||||
if(empty($phpbb_root_path))
|
||||
{
|
||||
$phpbb_root_path = "./";
|
||||
}
|
||||
include($phpbb_root_path . 'config.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/constants.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/template.inc');
|
||||
include($phpbb_root_path . 'includes/error.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/message.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/sessions.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/auth.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/db.'.$phpEx);
|
||||
|
||||
//
|
||||
// This would probably be best moved to a template
|
||||
// specific file, eg "images.tpl"
|
||||
//
|
||||
$url_images = "images";
|
||||
|
||||
$images['quote'] = "$url_images/icon_quote.gif";
|
||||
$images['edit'] = "$url_images/icon_edit.gif";
|
||||
$images['search_icon'] = "$url_images/search_icon.gif";
|
||||
$images['search_icon'] = "$url_images/icon_search.gif";
|
||||
$images['profile'] = "$url_images/icon_profile.gif";
|
||||
$images['privmsg'] = "$url_images/icon_pm.gif";
|
||||
$images['email'] = "$url_images/icon_email.gif";
|
||||
$images['delpost'] = "$url_images/edit.gif";
|
||||
$images['delpost'] = "$url_images/icon_delete.gif";
|
||||
$images['ip'] = "$url_images/icon_ip.gif";
|
||||
$images['www'] = "$url_images/icon_www.gif";
|
||||
$images['icq'] = "$url_images/icon_icq_add.gif";
|
||||
$images['aim'] = "$url_images/icon_aim.gif";
|
||||
$images['yim'] = "$url_images/icon_yim.gif";
|
||||
$images['msnm'] = "$url_images/icon_msnm.gif";
|
||||
$images['posticon'] = "$url_images/posticon.gif";
|
||||
$images['posticon'] = "$url_images/icon_minipost.gif";
|
||||
$images['folder'] = "$url_images/folder.gif";
|
||||
$images['new_folder'] = "$url_images/red_folder.gif";
|
||||
$images['latest_reply'] = "$url_images/latest_reply.gif";
|
||||
$images['new_folder'] = "$url_images/folder_new.gif";
|
||||
$images['latest_reply'] = "$url_images/icon_latest_reply.gif";
|
||||
$images['locked_folder'] = "$url_images/folder_lock.gif";
|
||||
|
||||
include('includes/template.inc');
|
||||
|
||||
include('includes/error.'.$phpEx);
|
||||
include('includes/message.'.$phpEx);
|
||||
include('includes/sessions.'.$phpEx);
|
||||
include('includes/auth.'.$phpEx);
|
||||
include('includes/functions.'.$phpEx);
|
||||
include('includes/db.'.$phpEx);
|
||||
|
||||
//
|
||||
// Obtain and encode users IP
|
||||
//
|
||||
@ -140,7 +146,13 @@ else
|
||||
$board_config['smtp_host'] = $config['smtp_host'];
|
||||
}
|
||||
|
||||
include('language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
|
||||
//
|
||||
// This doesn't need to be here, it's only neccesary
|
||||
// for the following if loop because a language file
|
||||
// will be loaded post-session initialisation (or the default
|
||||
// English one will load if a CRITICAL_ERROR occurs)
|
||||
//
|
||||
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
|
||||
|
||||
if($board_config['board_disable'])
|
||||
{
|
||||
|
@ -22,8 +22,9 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
//
|
||||
// Start session management
|
||||
@ -34,8 +35,8 @@ init_userprefs($userdata);
|
||||
// End session management
|
||||
//
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
@ -22,8 +22,9 @@
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
//
|
||||
// Start session management
|
||||
@ -34,8 +35,8 @@ init_userprefs($userdata);
|
||||
// End session management
|
||||
//
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
@ -24,19 +24,23 @@
|
||||
switch($dbms)
|
||||
{
|
||||
case 'mysql':
|
||||
include('db/mysql.'.$phpEx);
|
||||
include($phpbb_root_path . 'db/mysql.'.$phpEx);
|
||||
break;
|
||||
|
||||
case 'postgres':
|
||||
include('db/postgres7.'.$phpEx);
|
||||
include($phpbb_root_path . 'db/postgres7.'.$phpEx);
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
include('db/mssql.'.$phpEx);
|
||||
include($phpbb_root_path . 'db/mssql.'.$phpEx);
|
||||
break;
|
||||
|
||||
case 'odbc':
|
||||
include('db/odbc.'.$phpEx);
|
||||
include($phpbb_root_path . 'db/odbc.'.$phpEx);
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
include('db/oracle.'.$phpEx);
|
||||
include($phpbb_root_path . 'db/oracle.'.$phpEx);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -24,27 +24,27 @@
|
||||
|
||||
function error_die($error_code, $error_msg = "", $line = "", $file = "")
|
||||
{
|
||||
global $db, $template, $phpEx, $default_lang, $theme;
|
||||
global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path;
|
||||
|
||||
if(!defined("HEADER_INC"))
|
||||
{
|
||||
if(!empty($default_lang))
|
||||
if(!empty($board_config['default_lang']))
|
||||
{
|
||||
include('language/lang_'.$default_lang.'.'.$phpEx);
|
||||
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
include('language/lang_english.'.$phpEx);
|
||||
include($phpbb_root_path . 'language/lang_english.'.$phpEx);
|
||||
}
|
||||
if(!$template)
|
||||
{
|
||||
$template = new Template("templates/Default");
|
||||
$template = new Template($phpbb_root_path . "templates/Default");
|
||||
}
|
||||
if(!$theme)
|
||||
{
|
||||
$theme = setuptheme(1);
|
||||
}
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
}
|
||||
if(!$error_msg)
|
||||
{
|
||||
@ -55,13 +55,19 @@ function error_die($error_code, $error_msg = "", $line = "", $file = "")
|
||||
{
|
||||
$error_msg = "An Error Occured";
|
||||
}
|
||||
if(!$message_title)
|
||||
{
|
||||
$message_title = "General Error";
|
||||
}
|
||||
break;
|
||||
|
||||
case SQL_CONNECT:
|
||||
$message_title = "General Error";
|
||||
$error_msg = "Couldn't connect to database!";
|
||||
break;
|
||||
|
||||
case BANNED:
|
||||
$message_title = $lang['Information'];
|
||||
$error_msg = "You have been banned from this forum.";
|
||||
break;
|
||||
|
||||
@ -69,15 +75,18 @@ function error_die($error_code, $error_msg = "", $line = "", $file = "")
|
||||
break;
|
||||
|
||||
case SESSION_CREATE:
|
||||
$error_msg = "Error creating session. Could not log you in. Please go back and try again.";
|
||||
$message_title = "General Error";
|
||||
$error_msg = "Error creating session<br>Could not log you in, please go back and try again.";
|
||||
break;
|
||||
|
||||
case NO_POSTS:
|
||||
$error_msg = "There are no posts in this forum. Click on the <b>Post New Topic</b> link on this page to post one.";
|
||||
$message_title = $lang['Information'];
|
||||
$error_msg = "There are no posts in this forum<br>Click on the <b>Post New Topic</b> link on this page to post one.";
|
||||
break;
|
||||
|
||||
case LOGIN_FAILED:
|
||||
$error_msg = "Login Failed. You have specified an incorrect/inactive username or invalid password, please go back and try again.";
|
||||
$message_title = $lang['Information'];
|
||||
$error_msg = "Login Failed<br>You have specified an incorrect/inactive username or invalid password, please go back and try again.";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -88,12 +97,14 @@ function error_die($error_code, $error_msg = "", $line = "", $file = "")
|
||||
}
|
||||
|
||||
$template->set_filenames(array(
|
||||
"error_body" => "error_body.tpl"));
|
||||
"message_body" => "error_body.tpl")
|
||||
);
|
||||
$template->assign_vars(array(
|
||||
"ERROR_MESSAGE" => $error_msg));
|
||||
$template->pparse("error_body");
|
||||
"ERROR_MESSAGE" => $error_msg)
|
||||
);
|
||||
$template->pparse("message_body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
exit();
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ function make_forum_box($box_name, $default_forum = -1)
|
||||
// Initialise user settings on page load
|
||||
function init_userprefs($userdata)
|
||||
{
|
||||
global $board_config, $theme, $template, $lang, $phpEx;
|
||||
global $board_config, $theme, $template, $lang, $phpEx, $phpbb_root_path;
|
||||
|
||||
if(!$board_config['override_user_themes'])
|
||||
{
|
||||
@ -270,15 +270,15 @@ function init_userprefs($userdata)
|
||||
}
|
||||
}
|
||||
|
||||
$template = new Template("templates/" . $board_config['default_template']);
|
||||
$template = new Template($phpbb_root_path . "templates/" . $board_config['default_template']);
|
||||
|
||||
if(file_exists("language/lang_".$board_config['default_lang'].".".$phpEx) )
|
||||
{
|
||||
include('language/lang_'.$board_config['default_lang'].'.'.$phpEx);
|
||||
include($phpbb_root_path . 'language/lang_'.$board_config['default_lang'].'.'.$phpEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
include('language/lang_english.'.$phpEx);
|
||||
include($phpbb_root_path . 'language/lang_english.'.$phpEx);
|
||||
}
|
||||
|
||||
return;
|
||||
|
@ -47,7 +47,7 @@
|
||||
//
|
||||
function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "", $err_file = "", $sql = "")
|
||||
{
|
||||
global $db, $template, $board_config, $theme, $lang, $phpEx;
|
||||
global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path;
|
||||
global $userdata, $user_ip, $session_length;
|
||||
global $starttime;
|
||||
|
||||
@ -64,16 +64,16 @@ function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "",
|
||||
{
|
||||
if( !empty($board_config['default_lang']) )
|
||||
{
|
||||
include('language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
|
||||
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '.'.$phpEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
include('language/lang_english.'.$phpEx);
|
||||
include($phpbb_root_path . 'language/lang_english.'.$phpEx);
|
||||
}
|
||||
|
||||
if( empty($template) )
|
||||
{
|
||||
$template = new Template("templates/Default");
|
||||
$template = new Template($phpbb_root_path . "templates/Default");
|
||||
}
|
||||
|
||||
if( empty($theme) )
|
||||
@ -84,7 +84,7 @@ function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "",
|
||||
//
|
||||
// Load the Page Header
|
||||
//
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
}
|
||||
|
||||
switch($msg_code)
|
||||
@ -119,7 +119,7 @@ function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "",
|
||||
// Critical errors mean we cannot rely on _ANY_ DB information being
|
||||
// available so we're going to dump out a simple echo'd statement
|
||||
//
|
||||
include('language/lang_english.'.$phpEx);
|
||||
include($phpbb_root_path . 'language/lang_english.'.$phpEx);
|
||||
|
||||
if($msg_text == "")
|
||||
{
|
||||
@ -176,7 +176,7 @@ function message_die($msg_code, $msg_text = "", $msg_title = "", $err_line = "",
|
||||
);
|
||||
$template->pparse("message_body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
235
phpBB/index.php
235
phpBB/index.php
@ -21,8 +21,9 @@
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
$pagetype = "index";
|
||||
$page_title = "Forum Index";
|
||||
@ -36,86 +37,26 @@ init_userprefs($userdata);
|
||||
// End session management
|
||||
//
|
||||
|
||||
$viewcat = (!empty($HTTP_GET_VARS['viewcat'])) ? $HTTP_GET_VARS['viewcat'] : -1;
|
||||
|
||||
//
|
||||
// If you don't use these stats on your index
|
||||
// you may want to consider removing them since
|
||||
// it will reduce the number of queries speeding
|
||||
// up page generation a little
|
||||
//
|
||||
$total_posts = get_db_stat('postcount');
|
||||
$total_users = get_db_stat('usercount');
|
||||
$total_topics = get_db_stat('topiccount');
|
||||
$newest_userdata = get_db_stat('newestuser');
|
||||
$newest_user = $newest_userdata["username"];
|
||||
$newest_uid = $newest_userdata["user_id"];
|
||||
|
||||
$viewcat = (!empty($HTTP_GET_VARS['viewcat'])) ? $HTTP_GET_VARS['viewcat'] : -1;
|
||||
|
||||
/*
|
||||
//
|
||||
// This code allows for individual topic read tracking, on small, low volume sites
|
||||
// it'll probably work very well. However, for busy sites the use of a text field in
|
||||
// the DB combined with the additional UPDATE's required in viewtopic may be
|
||||
// unacceptable. So, by default this code is off, however you may want to play
|
||||
// ... remember that the users table needs a 'user_topics_unvisited' field of type
|
||||
// TEXT ( or equiv) and you need to remove the commented out code above the folder_img
|
||||
// code in the loop below (this applies to viewforum too).
|
||||
//
|
||||
// psoTFX
|
||||
//
|
||||
if($userdata['user_id'] != ANONYMOUS)
|
||||
{
|
||||
$unread_topic_list = unserialize($userdata['user_topics_unvisited']);
|
||||
|
||||
$last_update_time = (isset($unread_topic_list['lastupdate'])) ? $unread_topic_list['lastupdate'] : $userdata['session_last_visit'];
|
||||
|
||||
$sql = "SELECT forum_id, topic_id
|
||||
FROM " . TOPICS_TABLE . "
|
||||
WHERE topic_time > $last_update_time";
|
||||
if(!$s_topic_times = $db->sql_query($sql))
|
||||
{
|
||||
message_die(SQL_QUERY, "Could not query topic times.", __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
if($db->sql_numrows($s_topic_times))
|
||||
{
|
||||
while($new_topics_ary = $db->sql_fetchrow($s_topic_times))
|
||||
{
|
||||
$unread_topic_list[$new_topics_ary['forum_id']][$new_topics_ary['topic_id']] = 1;
|
||||
}
|
||||
|
||||
$unread_topic_list['lastupdate'] = time();
|
||||
|
||||
$sql = "UPDATE " . USERS_TABLE . "
|
||||
SET user_topics_unvisited = '" . serialize($unread_topic_list) . "'
|
||||
WHERE user_id = " . $userdata['user_id'];
|
||||
if(!$s_topic_times = $db->sql_query($sql))
|
||||
{
|
||||
message_die(SQL_QUERY, "Could not update user topics list.", __LINE__, __FILE__);
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
$newest_user = $newest_userdata['username'];
|
||||
$newest_uid = $newest_userdata['user_id'];
|
||||
|
||||
//
|
||||
// Output page header and
|
||||
// open the index body template
|
||||
//
|
||||
include('includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "index_body.tpl"));
|
||||
|
||||
$template->assign_vars(array(
|
||||
"TOTAL_POSTS" => $total_posts,
|
||||
"TOTAL_USERS" => $total_users,
|
||||
"TOTAL_TOPICS" => $total_topics,
|
||||
"NEWEST_USER" => $newest_user,
|
||||
"NEWEST_UID" => $newest_uid,
|
||||
"USERS_BROWSING" => $users_browsing,
|
||||
|
||||
"U_NEWEST_USER_PROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid"))
|
||||
);
|
||||
|
||||
//
|
||||
// Start main
|
||||
// Start page proper
|
||||
//
|
||||
$sql = "SELECT c.cat_id, c.cat_title, c.cat_order
|
||||
FROM ".CATEGORIES_TABLE." c, ".FORUMS_TABLE." f
|
||||
FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
|
||||
WHERE f.cat_id = c.cat_id
|
||||
GROUP BY c.cat_id, c.cat_title, c.cat_order
|
||||
ORDER BY c.cat_order";
|
||||
@ -124,13 +65,12 @@ if(!$q_categories = $db->sql_query($sql))
|
||||
message_die(GENERAL_ERROR, "Could not query categories list", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$total_categories = $db->sql_numrows();
|
||||
|
||||
if($total_categories)
|
||||
if($total_categories = $db->sql_numrows($q_categories))
|
||||
{
|
||||
$category_rows = $db->sql_fetchrowset($q_categories);
|
||||
|
||||
$limit_forums = "";
|
||||
|
||||
//
|
||||
// Define appropriate SQL
|
||||
//
|
||||
@ -138,6 +78,7 @@ if($total_categories)
|
||||
{
|
||||
case 'postgresql':
|
||||
$limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : "";
|
||||
|
||||
$sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, p.post_username
|
||||
FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p, " . USERS_TABLE . " u
|
||||
WHERE f.forum_last_post_id = p.post_id
|
||||
@ -153,12 +94,12 @@ if($total_categories)
|
||||
WHERE f.forum_last_post_id = p.post_id
|
||||
)
|
||||
$limit_forums
|
||||
)
|
||||
ORDER BY f.cat_id, f.forum_order";
|
||||
)";
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$limit_forums = ($viewcat != -1) ? "AND f.cat_id = $viewcat " : "";
|
||||
|
||||
$sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time, p.post_username
|
||||
FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u
|
||||
WHERE f.forum_last_post_id = p.post_id(+)
|
||||
@ -169,14 +110,13 @@ if($total_categories)
|
||||
break;
|
||||
|
||||
default:
|
||||
// This works on: MySQL, MSSQL and ODBC (Access)
|
||||
$limit_forums = ($viewcat != -1) ? "WHERE f.cat_id = $viewcat " : "";
|
||||
|
||||
$sql = "SELECT f.*, t.topic_id, t.topic_replies, t.topic_last_post_id, u.username, u.user_id, p.post_time
|
||||
FROM ((( ".FORUMS_TABLE." f
|
||||
LEFT JOIN ".POSTS_TABLE." p ON f.forum_last_post_id = p.post_id )
|
||||
LEFT JOIN ".TOPICS_TABLE." t ON p.post_id = t.topic_last_post_id )
|
||||
LEFT JOIN ".USERS_TABLE." u ON p.poster_id = u.user_id )
|
||||
FROM ((( " . FORUMS_TABLE . " f
|
||||
LEFT JOIN " . POSTS_TABLE . " p ON f.forum_last_post_id = p.post_id )
|
||||
LEFT JOIN " . TOPICS_TABLE . " t ON p.post_id = t.topic_last_post_id )
|
||||
LEFT JOIN " . USERS_TABLE . " u ON p.poster_id = u.user_id )
|
||||
$limit_forums
|
||||
ORDER BY f.cat_id, f.forum_order";
|
||||
break;
|
||||
@ -186,15 +126,17 @@ if($total_categories)
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not query forums information", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
$total_forums = $db->sql_numrows($q_forums);
|
||||
if( !$total_forums = $db->sql_numrows($q_forums) )
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, $lang['No_forums']);
|
||||
}
|
||||
$forum_rows = $db->sql_fetchrowset($q_forums);
|
||||
|
||||
//
|
||||
// Obtain list of moderators of each
|
||||
// forum
|
||||
// Obtain list of moderators of each forum
|
||||
//
|
||||
$sql = "SELECT f.forum_id, u.username, u.user_id
|
||||
FROM ".FORUMS_TABLE." f, ".USERS_TABLE." u, ".USER_GROUP_TABLE." ug, ".AUTH_ACCESS_TABLE." aa
|
||||
FROM " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa
|
||||
WHERE aa.forum_id = f.forum_id
|
||||
AND aa.auth_mod = " . TRUE . "
|
||||
AND ug.group_id = aa.group_id
|
||||
@ -210,14 +152,64 @@ if($total_categories)
|
||||
{
|
||||
$forum_mods_name[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['username'];
|
||||
$forum_mods_id[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['user_id'];
|
||||
|
||||
$forum_mods_single_user[$forum_mods_list[$i]['forum_id']][] = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
$sql = "SELECT f.forum_id, g.group_name, g.group_id, g.group_single_user, ug.user_id
|
||||
FROM " . FORUMS_TABLE . " f, " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug, " . AUTH_ACCESS_TABLE . " aa
|
||||
WHERE aa.forum_id = f.forum_id
|
||||
AND aa.auth_mod = " . TRUE . "
|
||||
AND g.group_id = aa.group_id
|
||||
AND ug.group_id = g.group_id
|
||||
ORDER BY f.forum_id, g.group_id";
|
||||
if(!$q_forum_mods = $db->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Could not query forum moderator information", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
$forum_mods_list = $db->sql_fetchrowset($q_forum_mods);
|
||||
|
||||
for($i = 0; $i < count($forum_mods_list); $i++)
|
||||
{
|
||||
$forum_mods_name[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['group_name'];
|
||||
$forum_mods_single_user[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['group_single_user'];
|
||||
|
||||
if($forum_mods_list[$i]['group_single_user'])
|
||||
{
|
||||
$forum_mods_id[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['user_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_mods_id[$forum_mods_list[$i]['forum_id']][] = $forum_mods_list[$i]['group_id'];
|
||||
}
|
||||
}*/
|
||||
|
||||
//
|
||||
// Find which forums are visible for
|
||||
// this user
|
||||
// Find which forums are visible for this user
|
||||
//
|
||||
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_rows);
|
||||
|
||||
//
|
||||
// Output page header and open the index body template
|
||||
//
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "index_body.tpl")
|
||||
);
|
||||
|
||||
$template->assign_vars(array(
|
||||
"TOTAL_POSTS" => $total_posts,
|
||||
"TOTAL_USERS" => $total_users,
|
||||
"TOTAL_TOPICS" => $total_topics,
|
||||
"NEWEST_USER" => $newest_user,
|
||||
"NEWEST_UID" => $newest_uid,
|
||||
"USERS_BROWSING" => $users_browsing,
|
||||
|
||||
"U_NEWEST_USER_PROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid"))
|
||||
);
|
||||
|
||||
//
|
||||
// Okay, let's build the index
|
||||
//
|
||||
@ -243,21 +235,14 @@ if($total_categories)
|
||||
$gen_cat[$cat_id] = 1;
|
||||
}
|
||||
|
||||
// if($userdata['user_id'] != ANONYMOUS)
|
||||
// {
|
||||
// $folder_image = (count($unread_topic_list[$forum_rows[$j]['forum_id']])) ? "<img src=\"".$images['new_folder']."\">" : "<img src=\"".$images['folder']."\">";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
if($userdata['session_start'] == $userdata['session_time'])
|
||||
{
|
||||
$folder_image = ($forum_rows[$j]['post_time'] > $userdata['session_last_visit']) ? "<img src=\"" . $images['new_folder'] . "\">" : "<img src=\"" . $images['folder'] . "\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
$folder_image = ($forum_rows[$j]['post_time'] > $userdata['session_time'] - 300) ? "<img src=\"" . $images['new_folder'] . "\">" : "<img src=\"" . $images['folder'] . "\">";
|
||||
}
|
||||
// }
|
||||
if($userdata['session_start'] >= $userdata['session_time'] - 300)
|
||||
{
|
||||
$folder_image = ($forum_rows[$j]['post_time'] > $userdata['session_last_visit']) ? "<img src=\"" . $images['new_folder'] . "\">" : "<img src=\"" . $images['folder'] . "\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
$folder_image = ($forum_rows[$j]['post_time'] >= $userdata['session_time'] - 300) ? "<img src=\"" . $images['new_folder'] . "\">" : "<img src=\"" . $images['folder'] . "\">";
|
||||
}
|
||||
|
||||
$posts = $forum_rows[$j]['forum_posts'];
|
||||
$topics = $forum_rows[$j]['forum_topics'];
|
||||
@ -277,7 +262,7 @@ if($total_categories)
|
||||
$last_post = $last_post_time . "<br />by ";
|
||||
$last_post .= "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $forum_rows[$j]['user_id']) . "\">" . $last_poster . "</a> ";
|
||||
|
||||
$last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $forum_rows[$j]['topic_last_post_id']) . "#" . $forum_rows[$j]['topic_last_post_id'] . "\"><img src=\"" . $images['latest_reply'] . "\" width=\"20\" height=\"11\" border=\"0\" alt=\"View Latest Post\"></a>";
|
||||
$last_post .= "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $forum_rows[$j]['topic_last_post_id']) . "#" . $forum_rows[$j]['topic_last_post_id'] . "\"><img src=\"" . $images['latest_reply'] . "\" width=\"20\" height=\"11\" border=\"0\" alt=\"" . $lang['View_latest_post'] . "\"></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -285,20 +270,38 @@ if($total_categories)
|
||||
$forum_rows[$j]['forum_name'] = stripslashes($forum_rows[$j]['forum_name']);
|
||||
}
|
||||
|
||||
$mod_count = 0;
|
||||
unset($moderators_links);
|
||||
for($mods = 0; $mods < count($forum_mods_name[$forum_id]); $mods++)
|
||||
{
|
||||
if(isset($moderators_links))
|
||||
if( !strstr($moderators_links, $forum_mods_name[$forum_id][$mods]) )
|
||||
{
|
||||
$moderators_links .= ", ";
|
||||
if(isset($moderators_links))
|
||||
{
|
||||
$moderators_links .= ", ";
|
||||
}
|
||||
|
||||
if(!($mod_count % 2) && $mod_count != 0)
|
||||
{
|
||||
$moderators_links .= "<br />";
|
||||
}
|
||||
|
||||
if( $forum_mods_single_user[$forum_id][$mods])
|
||||
{
|
||||
$moderators_links .= "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $forum_mods_id[$forum_id][$mods]) . "\">" . $forum_mods_name[$forum_id][$mods] . "</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$moderators_links .= "<a href=\"" . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $forum_mods_id[$forum_id][$mods]) . "\">" . $forum_mods_name[$forum_id][$mods] . "</a>";
|
||||
}
|
||||
|
||||
$mod_count++;
|
||||
}
|
||||
if(!($mods % 2) && $mods != 0)
|
||||
{
|
||||
$moderators_links .= "<br />";
|
||||
}
|
||||
$moderators_links .= "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $forum_mods_id[$forum_id][$mods]) . "\">" . $forum_mods_name[$forum_id][$mods] . "</a>";
|
||||
}
|
||||
|
||||
//
|
||||
// This should end up in the template using IF...ELSE...ENDIF
|
||||
//
|
||||
if($row_color == "#DDDDDD")
|
||||
{
|
||||
$row_color = "#CCCCCC";
|
||||
@ -341,8 +344,12 @@ else
|
||||
{
|
||||
message_die(GENERAL_MESSAGE, "There are no Categories or Forums on this board", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
//
|
||||
// Generate the page
|
||||
//
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
@ -6,11 +6,7 @@
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
<<<<<<< login.php
|
||||
* $Id$
|
||||
=======
|
||||
* $Id$
|
||||
>>>>>>> 1.21
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
@ -25,8 +21,9 @@
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
//
|
||||
// Set page ID for session management
|
||||
@ -44,19 +41,20 @@ if(isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['submit']))
|
||||
|
||||
$username = $HTTP_POST_VARS['username'];
|
||||
$password = $HTTP_POST_VARS['password'];
|
||||
|
||||
$sql = "SELECT user_id, username, user_password, user_active
|
||||
FROM ".USERS_TABLE."
|
||||
WHERE username = '$username'";
|
||||
$result = $db->sql_query($sql);
|
||||
if(!$result)
|
||||
{
|
||||
error_die(SQL_QUERY, "Error in obtaining userdata : login", __LINE__, __FILE__);
|
||||
message_die(GENERAL_ERROR, "Error in obtaining userdata : login", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$rowresult = $db->sql_fetchrow($result);
|
||||
if(count($rowresult))
|
||||
{
|
||||
if((md5($password) == $rowresult['user_password']) && $rowresult['user_active'] != 0)
|
||||
if((md5($password) == $rowresult['user_password']) && $rowresult['user_active'] != 0)
|
||||
{
|
||||
$autologin = (isset($HTTP_POST_VARS['autologin'])) ? TRUE : FALSE;
|
||||
|
||||
@ -75,17 +73,17 @@ if(isset($HTTP_POST_VARS['submit']) || isset($HTTP_GET_VARS['submit']))
|
||||
}
|
||||
else
|
||||
{
|
||||
error_die(GENERAL_ERROR, "Couldn't start session : login", __LINE__, __FILE__);
|
||||
message_die(CRITICAL_ERROR, "Couldn't start session : login", __LINE__, __FILE__);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error_die(LOGIN_FAILED);
|
||||
message_die(GENERAL_MESSAGE, $lang['Error_login']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error_die(LOGIN_FAILED);
|
||||
message_die(GENERAL_MESSAGE, $lang['Error_login']);
|
||||
}
|
||||
}
|
||||
else if($HTTP_GET_VARS['submit'] == "logout" && $userdata['session_logged_in'])
|
||||
@ -124,7 +122,8 @@ else
|
||||
if(!$userdata['session_logged_in'])
|
||||
{
|
||||
$page_title = "Log In";
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "login_body.tpl")
|
||||
);
|
||||
@ -152,8 +151,16 @@ else
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$forward_page = $forward_match[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$forward_page = "";
|
||||
}
|
||||
|
||||
$username = ($userdata['user_id'] != ANONYMOUS) ? $userdata['username'] : "";
|
||||
|
||||
@ -169,7 +176,7 @@ else
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -18,8 +18,10 @@
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
***************************************************************************/
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
$pagetype = "memberlist";
|
||||
$page_title = $lang['Memberlist'];
|
||||
@ -33,7 +35,7 @@ init_userprefs($userdata);
|
||||
// End session management
|
||||
//
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
if(!isset($HTTP_GET_VARS['start']))
|
||||
{
|
||||
@ -293,6 +295,6 @@ if(($selected_members = $db->sql_numrows($result)) > 0)
|
||||
$template->pparse("body");
|
||||
}
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
@ -31,9 +31,10 @@
|
||||
* topics via the moderator operations buttons on all of the viewtopic pages.
|
||||
*/
|
||||
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
include('includes/bbcode.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
||||
|
||||
$pagetype = "modcp";
|
||||
$page_title = "Modertator Control Panel";
|
||||
@ -109,7 +110,7 @@ if($HTTP_POST_VARS['not_confirm'])
|
||||
header("Location: index.$phpEx");
|
||||
}
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
// Set template files
|
||||
$template->set_filenames(array("body" => "modcp_body.tpl", "confirm" => "confirm_body.tpl", "split_body" => "split_body.tpl"));
|
||||
@ -273,14 +274,14 @@ switch($mode)
|
||||
"S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"),
|
||||
"S_HIDDEN_FIELDS" => $hidden_fields));
|
||||
$template->pparse("confirm");
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
exit();
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'move':
|
||||
echo 'Move';
|
||||
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'lock':
|
||||
if($confirm)
|
||||
{
|
||||
@ -346,8 +347,7 @@ switch($mode)
|
||||
"S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"),
|
||||
"S_HIDDEN_FIELDS" => $hidden_fields));
|
||||
$template->pparse("confirm");
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
exit();
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -417,8 +417,7 @@ switch($mode)
|
||||
"S_CONFIRM_ACTION" => append_sid("modcp.$phpEx"),
|
||||
"S_HIDDEN_FIELDS" => $hidden_fields));
|
||||
$template->pparse("confirm");
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
exit();
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -609,7 +608,7 @@ switch($mode)
|
||||
|
||||
if(!$t_result = $db->sql_query($sql))
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
$total_topics = $db->sql_numrows($t_result);
|
||||
$topics = $db->sql_fetchrowset($t_result);
|
||||
@ -654,18 +653,22 @@ switch($mode)
|
||||
}
|
||||
|
||||
$pagination = generate_pagination("modcp.$phpEx?".POST_FORUM_URL."=$forum_id", $forum_topics, $board_config['topics_per_page'], $start);
|
||||
|
||||
$template->assign_vars(array("PAGINATION" => $pagination,
|
||||
"FORUM_ID" => $forum_id,
|
||||
"POST_FORUM_URL" => POST_FORUM_URL,
|
||||
"ON_PAGE" => (floor($start/$board_config['topics_per_page'])+1),
|
||||
"TOTAL_PAGES" => ceil($forum_topics/$board_config['topics_per_page']),
|
||||
"L_OF" => $lang['of'],
|
||||
"L_PAGE" => $lang['Page'],
|
||||
"L_GOTO_PAGE" => $lang['Goto_page']));
|
||||
"FORUM_ID" => $forum_id,
|
||||
"POST_FORUM_URL" => POST_FORUM_URL,
|
||||
"ON_PAGE" => (floor($start/$board_config['topics_per_page'])+1),
|
||||
"TOTAL_PAGES" => ceil($forum_topics/$board_config['topics_per_page']),
|
||||
"L_OF" => $lang['of'],
|
||||
"L_PAGE" => $lang['Page'],
|
||||
"L_GOTO_PAGE" => $lang['Goto_page'])
|
||||
);
|
||||
|
||||
$template->pparse("body");
|
||||
break;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
||||
?>
|
@ -20,10 +20,11 @@
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
include('includes/post.'.$phpEx);
|
||||
include('includes/bbcode.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/post.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
||||
|
||||
//
|
||||
// Start session management
|
||||
@ -594,7 +595,7 @@ else if( $mode == "editpost" && $topic_status == TOPIC_UNLOCKED )
|
||||
//
|
||||
// Output confirmation page
|
||||
//
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"confirm_body" => "confirm_body.tpl")
|
||||
@ -611,7 +612,7 @@ else if( $mode == "editpost" && $topic_status == TOPIC_UNLOCKED )
|
||||
);
|
||||
$template->pparse("confirm_body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
}
|
||||
else if( isset($HTTP_GET_VARS['confirm']) || isset($HTTP_POST_VARS['confirm']) ||
|
||||
@ -915,7 +916,7 @@ else if( $mode == "editpost" && $topic_status == TOPIC_UNLOCKED )
|
||||
//
|
||||
// Output page
|
||||
//
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
//
|
||||
// Start: Error handling
|
||||
@ -1194,6 +1195,6 @@ $template->assign_vars(array(
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
@ -21,10 +21,11 @@
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
include('includes/post.'.$phpEx);
|
||||
include('includes/bbcode.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/post.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
||||
|
||||
$pagetype = "privmsgs";
|
||||
$page_title = "Private Messageing";
|
||||
@ -178,7 +179,7 @@ if($mode == "read")
|
||||
|
||||
$s_hidden_fields = "<input type=\"hidden\" name=\"mark[]\" value=\"$privmsgs_id\">";
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
//
|
||||
// Load templates
|
||||
@ -300,7 +301,7 @@ if($mode == "read")
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
}
|
||||
else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
@ -702,7 +703,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
}
|
||||
}
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
if($preview && !$error)
|
||||
{
|
||||
@ -866,7 +867,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
}
|
||||
else if( ( isset($HTTP_POST_VARS['delete']) && !empty($HTTP_POST_VARS['mark']) ) || !empty($HTTP_POST_VARS['deleteall']) )
|
||||
@ -1030,7 +1031,7 @@ if(!$userdata['session_logged_in'])
|
||||
header("Location: " . append_sid("login.$phpEx?forward_page=privmsg.$phpEx&folder=inbox"));
|
||||
}
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
//
|
||||
// Load templates
|
||||
@ -1244,6 +1245,6 @@ $template->assign_vars(array(
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
@ -21,9 +21,9 @@
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
//
|
||||
// Start session management
|
||||
@ -202,7 +202,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
|
||||
// Output page header and
|
||||
// profile_view template
|
||||
//
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "profile_view_body.tpl",
|
||||
@ -316,7 +316,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
}
|
||||
else if($mode == "editprofile" || $mode == "register")
|
||||
@ -330,7 +330,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
|
||||
$pagetype = ($mode == "edit") ? "editprofile" : "register";
|
||||
$page_title = ($mode == "edit") ? $lang['Edit_profile'] : $lang['Register'];
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
//
|
||||
// Start processing for output
|
||||
@ -361,7 +361,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
|
||||
);
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
}
|
||||
else if(isset($HTTP_POST_VARS['submit']) || $mode == "register")
|
||||
@ -384,8 +384,8 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
|
||||
$website = (!empty($HTTP_POST_VARS['website'])) ? trim(strip_tags($HTTP_POST_VARS['website'])) : "";
|
||||
$location = (!empty($HTTP_POST_VARS['location'])) ? trim(strip_tags($HTTP_POST_VARS['location'])) : "";
|
||||
$occupation = (!empty($HTTP_POST_VARS['occupation'])) ? trim(strip_tags($HTTP_POST_VARS['occupation'])) : "";
|
||||
$interests = (!empty($HTTP_POST_VARS['interests'])) ? trim($HTTP_POST_VARS['interests']) : "";
|
||||
$signature = (!empty($HTTP_POST_VARS['signature'])) ? trim(str_replace("<br />", "\n", $HTTP_POST_VARS['signature'])) : "";
|
||||
$interests = (!empty($HTTP_POST_VARS['interests'])) ? trim(strip_tags($HTTP_POST_VARS['interests'])) : "";
|
||||
$signature = (!empty($HTTP_POST_VARS['signature'])) ? trim(strip_tags(str_replace("<br />", "\n", $HTTP_POST_VARS['signature']))) : "";
|
||||
|
||||
$viewemail = (isset($HTTP_POST_VARS['viewemail'])) ? $HTTP_POST_VARS['viewemail'] : 0;
|
||||
$allowviewonline = (isset($HTTP_POST_VARS['hideonline'])) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : 1 ) : 1;
|
||||
@ -840,7 +840,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
|
||||
|
||||
if($board_config['smtp_delivery'] && $board_config['smtp_host'] != "")
|
||||
{
|
||||
include('includes/smtp.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/smtp.'.$phpEx);
|
||||
smtpmail($email, $lang['Welcome_subject'], $email_msg, $email_headers);
|
||||
}
|
||||
else
|
||||
@ -1037,7 +1037,7 @@ if(isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']))
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
else if($mode == "activate")
|
||||
{
|
||||
|
@ -27,9 +27,9 @@
|
||||
//
|
||||
// PSO : 2001
|
||||
//
|
||||
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
$pagetype = "search";
|
||||
$page_title = "Search Forums";
|
||||
@ -380,7 +380,7 @@ if((isset($HTTP_POST_VARS['dosearch']) || isset($HTTP_GET_VARS['dosearch'])) &&
|
||||
//
|
||||
// Output header
|
||||
//
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "search_results_body.tpl",
|
||||
@ -473,7 +473,7 @@ if((isset($HTTP_POST_VARS['dosearch']) || isset($HTTP_GET_VARS['dosearch'])) &&
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -520,7 +520,7 @@ for($i = 0; $i < count($sortby_types); $i++)
|
||||
$s_sortby .= "<option value=\"$i\">".$sortby_types[$i]."</option>";
|
||||
}
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "search_body.tpl",
|
||||
@ -553,6 +553,6 @@ $template->assign_vars(array(
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
@ -50,7 +50,7 @@
|
||||
|
||||
<div align="center"><table align="center" border="0" width="98%">
|
||||
<tr>
|
||||
<td width="30" align="center"><img src="images/red_folder.gif"></td>
|
||||
<td width="30" align="center"><img src="images/folder_new.gif"></td>
|
||||
<td><span class="gensmall">{L_NEWPOSTS}</span></td>
|
||||
<td align="right" valign="top"><span class="gensmall"><b>{S_TIMEZONE}</b></span></td>
|
||||
</tr>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div align="center"><table width="98%" cellspacing="0" cellpadding="4" border="0">
|
||||
<tr><form method="post" action="{S_POST_DAYS_ACTION}">
|
||||
<td align="left" valign="bottom" nowrap><span class="gensmall"><a href="{U_INDEX}">{SITENAME} {L_INDEX}</a> -> {FORUM_NAME}</span></td>
|
||||
<td align="right" valign="bottom" nowrap><span class="gensmall">Display Topics from previous : {S_SELECT_POST_DAYS} <input type="submit" value="Go"></span></td>
|
||||
<td align="right" valign="bottom" nowrap><span class="gensmall">{L_DISPLAY_TOPICS}: {S_SELECT_POST_DAYS} <input type="submit" value="Go"></span></td>
|
||||
</form></tr>
|
||||
</table></div>
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
<tr>
|
||||
<td class="cat" colspan="6"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td><span class="cattitle">{FORUM_NAME}</span><br><span class="gensmall">{L_MODERATOR} : {MODERATORS}</span></TD>
|
||||
<td><span class="cattitle">{FORUM_NAME}</span><br><span class="gensmall">{L_MODERATOR}: {MODERATORS}</span></TD>
|
||||
<td align="right"><a href="{U_POST_NEW_TOPIC}"><img src="templates/PSO/images/post.gif" border="1"></a></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
@ -33,7 +33,7 @@
|
||||
<td class="row1" align="center" valign="middle"><span class="gen">{topicrow.VIEWS}</span></td>
|
||||
<td class="row2" align="center" valign="middle"><span class="gensmall">{topicrow.LAST_POST}</span></td>
|
||||
</tr>
|
||||
<!-- END topicrow -->
|
||||
<!-- END topicrow -->
|
||||
<tr>
|
||||
<td class="cat" colspan="6"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
@ -54,11 +54,11 @@
|
||||
<td rowspan="6" align="right" valign="top" nowrap>{JUMPBOX}<br><span class="gensmall">{S_AUTH_LIST}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="images/red_folder.gif"></td>
|
||||
<td><img src="images/folder_new.gif"></td>
|
||||
<td><span class="gensmall">{L_NEWPOSTS}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="images/hot_red_folder.gif"></td>
|
||||
<td><img src="images/folder_new_hot.gif"></td>
|
||||
<td><span class="gensmall">{L_NEWPOSTS} [ > {L_HOT_THRESHOLD} ]</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -66,11 +66,11 @@
|
||||
<td><span class="gensmall">{L_NONEWPOSTS}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="images/hot_folder.gif"></td>
|
||||
<td><img src="images/folder_hot.gif"></td>
|
||||
<td><span class="gensmall">{L_NONEWPOSTS} [ > {L_HOT_THRESHOLD} ]</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="images/lock.gif"></td>
|
||||
<td><img src="images/folder_lock.gif"></td>
|
||||
<td><span class="gensmall">{L_TOPIC_IS_LOCKED}</span></td>
|
||||
</tr>
|
||||
</table></div>
|
@ -34,7 +34,7 @@
|
||||
<tr>
|
||||
<td><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td valign="middle"><img src="images/posticon.gif" alt="Post image icon"><span class="gensmall">{L_POSTED}: {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
|
||||
<td valign="middle"><img src="images/icon_minipost.gif" alt="Post image icon"><span class="gensmall">{L_POSTED}: {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>
|
||||
<td align="right" valign="middle" nowrap> {postrow.EDIT_IMG} {postrow.QUOTE_IMG} </td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -21,8 +21,9 @@
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
$pagetype = "viewforum";
|
||||
$page_title = "View Forum - $forum_name";
|
||||
@ -109,7 +110,7 @@ if( ( $is_auth['auth_mod'] || $is_auth['auth_admin'] ) && $board_config['prune_e
|
||||
{
|
||||
if( $forum_row['prune_next'] < time() && $forum_row['prune_enable'] )
|
||||
{
|
||||
include('includes/prune.php');
|
||||
include($phpbb_root_path . 'includes/prune.php');
|
||||
auto_prune($forum_id);
|
||||
}
|
||||
}
|
||||
@ -174,8 +175,8 @@ if(!empty($HTTP_POST_VARS['postdays']) || !empty($HTTP_GET_VARS['postdays']))
|
||||
{
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain limited topics count information", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
$topics_count = $db->sql_fetchfield("forum_topics", -1, $result);
|
||||
|
||||
list($topics_count) = $db->sql_fetchrow($result);
|
||||
|
||||
$limit_posts_time = "AND ( p.post_time > $min_post_time OR t.topic_type = " . POST_ANNOUNCE . " ) ";
|
||||
|
||||
if(!empty($HTTP_POST_VARS['postdays']))
|
||||
@ -235,7 +236,7 @@ $template->assign_vars(array(
|
||||
//
|
||||
// Dump out the page header and load viewforum template
|
||||
//
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "viewforum_body.tpl",
|
||||
@ -423,6 +424,6 @@ else
|
||||
message_die(GENERAL_MESSAGE, $lang['No_topics_post_one']);
|
||||
}
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
@ -21,8 +21,9 @@
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
|
||||
$pagetype = "viewonline";
|
||||
$page_title = "Who's Online";
|
||||
@ -40,12 +41,13 @@ init_userprefs($userdata);
|
||||
// Output page header and load
|
||||
// viewonline template
|
||||
//
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "viewonline_body.tpl",
|
||||
"jumpbox" => "jumpbox.tpl")
|
||||
);
|
||||
|
||||
$jumpbox = make_jumpbox();
|
||||
$template->assign_vars(array(
|
||||
"JUMPBOX_LIST" => $jumpbox,
|
||||
@ -57,34 +59,28 @@ $template->assign_var_from_handle("JUMPBOX", "jumpbox");
|
||||
//
|
||||
|
||||
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, s.session_page, s.session_logged_in, s.session_time
|
||||
FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s
|
||||
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) . "
|
||||
ORDER BY s.session_time DESC";
|
||||
$result = $db->sql_query($sql);
|
||||
if(!$result)
|
||||
if(!$result = $db->sql_query($sql))
|
||||
{
|
||||
error_die(SQL_QUERY, "Couldn't obtain user/online information.", __LINE__, __FILE__);
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain user/online information.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
$onlinerow = $db->sql_fetchrowset($result);
|
||||
|
||||
$sql = "SELECT forum_name, forum_id
|
||||
FROM ".FORUMS_TABLE;
|
||||
$forums_result = $db->sql_query($sql);
|
||||
if(!$forums_result)
|
||||
{
|
||||
error_die(SQL_QUERY, "Couldn't obtain user/online forums information.", __LINE__, __FILE__);
|
||||
}
|
||||
else
|
||||
if($forums_result = $db->sql_query($sql))
|
||||
{
|
||||
while($forumsrow = $db->sql_fetchrow($forums_result))
|
||||
{
|
||||
$forum_data[$forumsrow['forum_id']] = $forumsrow['forum_name'];
|
||||
}
|
||||
}
|
||||
|
||||
if(!$onlinerow || !$forum_data)
|
||||
else
|
||||
{
|
||||
error_die(SQL_QUERY, "Couldn't fetchrow.", __LINE__, __FILE__);
|
||||
message_die(GENERAL_ERROR, "Couldn't obtain user/online forums information.", "", __LINE__, __FILE__, $sql);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
@ -165,6 +161,10 @@ if($online_count)
|
||||
$location = $lang['Forum_index'];
|
||||
$location_url = "index.$phpEx";
|
||||
break;
|
||||
case PAGE_POSTING:
|
||||
$location = "";
|
||||
$location_url = "";
|
||||
break;
|
||||
case PAGE_LOGIN:
|
||||
$location = $lang['Loggin_on'];
|
||||
$location_url = "index.$phpEx";
|
||||
@ -204,45 +204,34 @@ if($online_count)
|
||||
$location = $forum_data[$onlinerow[$i]['session_page']];
|
||||
}
|
||||
|
||||
//
|
||||
// What would be nice here is to let
|
||||
// the template designer decide whether
|
||||
// to display all users, registered users
|
||||
// or just logged in users ... but we need
|
||||
// if... constructs in the templating system
|
||||
// for that ...
|
||||
//
|
||||
if( $logged_on && ( !$hidden || $userdata['user_level'] == ADMIN ) )
|
||||
{
|
||||
$template->assign_block_vars("userrow",
|
||||
array(
|
||||
"ROW_COLOR" => $row_color,
|
||||
"USERNAME" => $username,
|
||||
"LOGGED_ON" => $logged_on,
|
||||
"LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow[$i]['session_time'], $board_config['default__timezone']),
|
||||
"LOCATION" => $location,
|
||||
"U_USER_PROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $onlinerow[$i]['user_id']),
|
||||
"U_FORUM_LOCATION" => append_sid($location_url)
|
||||
)
|
||||
$template->assign_block_vars("userrow", array(
|
||||
"ROW_COLOR" => $row_color,
|
||||
"USERNAME" => $username,
|
||||
"LOGGED_ON" => $logged_on,
|
||||
"LASTUPDATE" => create_date($board_config['default_dateformat'], $onlinerow[$i]['session_time'], $board_config['default__timezone']),
|
||||
"LOCATION" => $location,
|
||||
|
||||
"U_USER_PROFILE" => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $onlinerow[$i]['user_id']),
|
||||
"U_FORUM_LOCATION" => append_sid($location_url))
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
"ACTIVE_USERS" => $active_users,
|
||||
"HIDDEN_USERS" => $hidden_users,
|
||||
"GUEST_USERS" => $guest_users
|
||||
)
|
||||
"GUEST_USERS" => $guest_users)
|
||||
);
|
||||
|
||||
$template->pparse("body");
|
||||
}
|
||||
else
|
||||
{
|
||||
error_die(GENERAL_ERROR, "There are no users currently browsing this forum");
|
||||
message_die(GENERAL_MESSAGE, "There are no users currently browsing this forum");
|
||||
}
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
@ -20,9 +20,10 @@
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
include('extension.inc');
|
||||
include('common.'.$phpEx);
|
||||
include('includes/bbcode.'.$phpEx);
|
||||
$phpbb_root_path = "./";
|
||||
include($phpbb_root_path . 'extension.inc');
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
|
||||
|
||||
$page_title = $lang['View_topic'] ." - $topic_title";
|
||||
$pagetype = "viewtopic";
|
||||
@ -195,7 +196,7 @@ $ranksrow = $db->sql_fetchrowset($ranksresult);
|
||||
//
|
||||
// Dump out the page header and oad viewtopic body template
|
||||
//
|
||||
include('includes/page_header.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
|
||||
|
||||
$template->set_filenames(array(
|
||||
"body" => "viewtopic_body.tpl",
|
||||
@ -496,6 +497,6 @@ $template->assign_vars(array(
|
||||
|
||||
$template->pparse("body");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user