|
From: FlorinCB <ory...@us...> - 2008-12-31 02:07:19
|
Update of /cvsroot/mxbb/phpbb2mxp In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv12742 Added Files: common.php config.php extension.inc faq.php groupcp.php index.php login.php memberlist.php modcp.php posting.php privmsg.php profile.php robots.txt search.php viewforum.php viewonline.php viewtopic.php Log Message: upgrade to 2.0.24-beta1 --- NEW FILE: login.php --- <?php /*************************************************************************** * login.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: login.php,v 1.1 2008/12/31 01:43:48 orynider Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ // // Allow people to reach login page if // board is shut down // define("IN_LOGIN", true); define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // // Set page ID for session management // $userdata = session_pagestart($user_ip, PAGE_LOGIN); init_userprefs($userdata); // // End session management // // session id check if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid'])) { $sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid']; } else { $sid = ''; } if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($HTTP_POST_VARS['logout']) || isset($HTTP_GET_VARS['logout']) ) { if( ( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) ) && (!$userdata['session_logged_in'] || isset($HTTP_POST_VARS['admin'])) ) { $username = isset($HTTP_POST_VARS['username']) ? phpbb_clean_username($HTTP_POST_VARS['username']) : ''; $password = isset($HTTP_POST_VARS['password']) ? $HTTP_POST_VARS['password'] : ''; $sql = "SELECT user_id, username, user_password, user_active, user_level, user_login_tries, user_last_login_try FROM " . USERS_TABLE . " WHERE username = '" . str_replace("\\'", "''", $username) . "'"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Error in obtaining userdata', '', __LINE__, __FILE__, $sql); } if( $row = $db->sql_fetchrow($result) ) { if( $row['user_level'] != ADMIN && $board_config['board_disable'] ) { redirect(append_sid("index.$phpEx", true)); } else { // If the last login is more than x minutes ago, then reset the login tries/time if ($row['user_last_login_try'] && $board_config['login_reset_time'] && $row['user_last_login_try'] < (time() - ($board_config['login_reset_time'] * 60))) { $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_login_tries = 0, user_last_login_try = 0 WHERE user_id = ' . $row['user_id']); $row['user_last_login_try'] = $row['user_login_tries'] = 0; } // Check to see if user is allowed to login again... if his tries are exceeded if ($row['user_last_login_try'] && $board_config['login_reset_time'] && $board_config['max_login_attempts'] && $row['user_last_login_try'] >= (time() - ($board_config['login_reset_time'] * 60)) && $row['user_login_tries'] >= $board_config['max_login_attempts'] && $userdata['user_level'] != ADMIN) { message_die(GENERAL_MESSAGE, sprintf($lang['Login_attempts_exceeded'], $board_config['max_login_attempts'], $board_config['login_reset_time'])); } if( md5($password) == $row['user_password'] && $row['user_active'] ) { $autologin = ( isset($HTTP_POST_VARS['autologin']) ) ? TRUE : 0; $admin = (isset($HTTP_POST_VARS['admin'])) ? 1 : 0; $session_id = session_begin($row['user_id'], $user_ip, PAGE_INDEX, FALSE, $autologin, $admin); // Reset login tries $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_login_tries = 0, user_last_login_try = 0 WHERE user_id = ' . $row['user_id']); if( $session_id ) { $url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx"; redirect(append_sid($url, true)); } else { message_die(CRITICAL_ERROR, "Couldn't start session : login", "", __LINE__, __FILE__); } } // Only store a failed login attempt for an active user - inactive users can't login even with a correct password elseif( $row['user_active'] ) { // Save login tries and last login if ($row['user_id'] != ANONYMOUS) { $sql = 'UPDATE ' . USERS_TABLE . ' SET user_login_tries = user_login_tries + 1, user_last_login_try = ' . time() . ' WHERE user_id = ' . $row['user_id']; $db->sql_query($sql); } } $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : ''; $redirect = str_replace('?', '&', $redirect); if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r") || strstr(urldecode($redirect), ';url')) { message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.'); } $template->assign_vars(array( 'META' => "<meta http-equiv=\"refresh\" content=\"3;url=login.$phpEx?redirect=$redirect\">") ); $message = $lang['Error_login'] . '<br /><br />' . sprintf($lang['Click_return_login'], "<a href=\"login.$phpEx?redirect=$redirect\">", '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); message_die(GENERAL_MESSAGE, $message); } } else { $redirect = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : ""; $redirect = str_replace("?", "&", $redirect); if (strstr(urldecode($redirect), "\n") || strstr(urldecode($redirect), "\r") || strstr(urldecode($redirect), ';url')) { message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.'); } $template->assign_vars(array( 'META' => "<meta http-equiv=\"refresh\" content=\"3;url=login.$phpEx?redirect=$redirect\">") ); $message = $lang['Error_login'] . '<br /><br />' . sprintf($lang['Click_return_login'], "<a href=\"login.$phpEx?redirect=$redirect\">", '</a>') . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a>'); message_die(GENERAL_MESSAGE, $message); } } else if( ( isset($HTTP_GET_VARS['logout']) || isset($HTTP_POST_VARS['logout']) ) && $userdata['session_logged_in'] ) { // session id check if ($sid == '' || $sid != $userdata['session_id']) { message_die(GENERAL_ERROR, 'Invalid_session'); } if( $userdata['session_logged_in'] ) { session_end($userdata['session_id'], $userdata['user_id']); } if (!empty($HTTP_POST_VARS['redirect']) || !empty($HTTP_GET_VARS['redirect'])) { $url = (!empty($HTTP_POST_VARS['redirect'])) ? htmlspecialchars($HTTP_POST_VARS['redirect']) : htmlspecialchars($HTTP_GET_VARS['redirect']); $url = str_replace('&', '&', $url); redirect(append_sid($url, true)); } else { redirect(append_sid("index.$phpEx", true)); } } else { $url = ( !empty($HTTP_POST_VARS['redirect']) ) ? str_replace('&', '&', htmlspecialchars($HTTP_POST_VARS['redirect'])) : "index.$phpEx"; redirect(append_sid($url, true)); } } else { // // Do a full login page dohickey if // user not already logged in // if( !$userdata['session_logged_in'] || (isset($HTTP_GET_VARS['admin']) && $userdata['session_logged_in'] && $userdata['user_level'] == ADMIN)) { $page_title = $lang['Login']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'body' => 'login_body.tpl') ); $forward_page = ''; if( isset($HTTP_POST_VARS['redirect']) || isset($HTTP_GET_VARS['redirect']) ) { $forward_to = $HTTP_SERVER_VARS['QUERY_STRING']; if( preg_match("/^redirect=([a-z0-9\.#\/\?&=\+\-_]+)/si", $forward_to, $forward_matches) ) { $forward_to = ( !empty($forward_matches[3]) ) ? $forward_matches[3] : $forward_matches[1]; $forward_match = explode('&', $forward_to); if(count($forward_match) > 1) { for($i = 1; $i < count($forward_match); $i++) { if( !ereg("sid=", $forward_match[$i]) ) { if( $forward_page != '' ) { $forward_page .= '&'; } $forward_page .= $forward_match[$i]; } } $forward_page = $forward_match[0] . '?' . $forward_page; } else { $forward_page = $forward_match[0]; } } } $username = ( $userdata['user_id'] != ANONYMOUS ) ? $userdata['username'] : ''; $s_hidden_fields = '<input type="hidden" name="redirect" value="' . $forward_page . '" />'; $s_hidden_fields .= (isset($HTTP_GET_VARS['admin'])) ? '<input type="hidden" name="admin" value="1" />' : ''; make_jumpbox('viewforum.'.$phpEx); $template->assign_vars(array( 'USERNAME' => $username, 'L_ENTER_PASSWORD' => (isset($HTTP_GET_VARS['admin'])) ? $lang['Admin_reauthenticate'] : $lang['Enter_password'], 'L_SEND_PASSWORD' => $lang['Forgotten_password'], 'U_SEND_PASSWORD' => append_sid("profile.$phpEx?mode=sendpassword"), 'S_HIDDEN_FIELDS' => $s_hidden_fields) ); $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); } else { redirect(append_sid("index.$phpEx", true)); } } ?> --- NEW FILE: extension.inc --- <?php /*************************************************************************** * extension.inc * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: extension.inc,v 1.1 2008/12/31 01:43:48 orynider Exp $ * * ***************************************************************************/ if ( !defined('IN_PHPBB') ) { die("Hacking attempt"); } // // Change this if your extension is not .php! // $phpEx = "php"; $starttime = 0; ?> --- NEW FILE: posting.php --- <?php /*************************************************************************** * posting.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: posting.php,v 1.1 2008/12/31 01:43:48 orynider Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. [...1130 lines suppressed...] $template->assign_var_from_handle('POLLBOX', 'pollbody'); } // // Topic review // if( $mode == 'reply' && $is_auth['auth_read'] ) { require($phpbb_root_path . 'includes/topic_review.'.$phpEx); topic_review($topic_id, true); $template->assign_block_vars('switch_inline_mode', array()); $template->assign_var_from_handle('TOPIC_REVIEW_BOX', 'reviewbody'); } $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: search.php --- <?php /*************************************************************************** * search.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: search.php,v 1.1 2008/12/31 01:43:48 orynider Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. [...1415 lines suppressed...] 'L_SEARCH_PREVIOUS' => $lang['Search_previous'], 'L_DISPLAY_RESULTS' => $lang['Display_results'], 'L_FORUM' => $lang['Forum'], 'L_TOPICS' => $lang['Topics'], 'L_POSTS' => $lang['Posts'], 'S_SEARCH_ACTION' => append_sid("search.$phpEx?mode=results"), 'S_CHARACTER_OPTIONS' => $s_characters, 'S_FORUM_OPTIONS' => $s_forums, 'S_CATEGORY_OPTIONS' => $s_categories, 'S_TIME_OPTIONS' => $s_time, 'S_SORT_OPTIONS' => $s_sort_by, 'S_HIDDEN_FIELDS' => '') ); $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: index.php --- <?php /*************************************************************************** * index.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: index.php,v 1.1 2008/12/31 01:43:48 orynider Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); // // End session management // $viewcat = ( !empty($HTTP_GET_VARS[POST_CAT_URL]) ) ? $HTTP_GET_VARS[POST_CAT_URL] : -1; if( isset($HTTP_GET_VARS['mark']) || isset($HTTP_POST_VARS['mark']) ) { $mark_read = ( isset($HTTP_POST_VARS['mark']) ) ? $HTTP_POST_VARS['mark'] : $HTTP_GET_VARS['mark']; } else { $mark_read = ''; } // // Handle marking posts // if( $mark_read == 'forums' ) { if( $userdata['session_logged_in'] ) { setcookie($board_config['cookie_name'] . '_f_all', time(), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); } $template->assign_vars(array( "META" => '<meta http-equiv="refresh" content="3;url=' .append_sid("index.$phpEx") . '">') ); $message = $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . append_sid("index.$phpEx") . '">', '</a> '); message_die(GENERAL_MESSAGE, $message); } // // End handle marking posts // $tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_t"]) : array(); $tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . "_f"]) : array(); // // If you don't use these stats on your index you may want to consider // removing them // $total_posts = get_db_stat('postcount'); $total_users = get_db_stat('usercount'); $newest_userdata = get_db_stat('newestuser'); $newest_user = $newest_userdata['username']; $newest_uid = $newest_userdata['user_id']; if( $total_posts == 0 ) { $l_total_post_s = $lang['Posted_articles_zero_total']; } else if( $total_posts == 1 ) { $l_total_post_s = $lang['Posted_article_total']; } else { $l_total_post_s = $lang['Posted_articles_total']; } if( $total_users == 0 ) { $l_total_user_s = $lang['Registered_users_zero_total']; } else if( $total_users == 1 ) { $l_total_user_s = $lang['Registered_user_total']; } else { $l_total_user_s = $lang['Registered_users_total']; } // // Start page proper // $sql = "SELECT c.cat_id, c.cat_title, c.cat_order FROM " . CATEGORIES_TABLE . " c ORDER BY c.cat_order"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query categories list', '', __LINE__, __FILE__, $sql); } $category_rows = array(); while ($row = $db->sql_fetchrow($result)) { $category_rows[] = $row; } $db->sql_freeresult($result); // Begin Simple Subforums MOD $subforums_list = array(); // End Simple Subforums MOD if( ( $total_categories = count($category_rows) ) ) { // // Define appropriate SQL // switch(SQL_LAYER) { case 'postgresql': $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u WHERE p.post_id = f.forum_last_post_id AND u.user_id = p.poster_id UNION ( SELECT f.*, NULL, NULL, NULL, NULL FROM " . FORUMS_TABLE . " f WHERE NOT EXISTS ( SELECT p.post_time FROM " . POSTS_TABLE . " p WHERE p.post_id = f.forum_last_post_id ) ) ORDER BY cat_id, forum_order"; break; case 'oracle': $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id FROM " . FORUMS_TABLE . " f, " . POSTS_TABLE . " p, " . USERS_TABLE . " u WHERE p.post_id = f.forum_last_post_id(+) AND u.user_id = p.poster_id(+) ORDER BY f.cat_id, f.forum_order"; break; default: $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id FROM (( " . FORUMS_TABLE . " f LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id ) LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id ) ORDER BY f.cat_id, f.forum_order"; break; } if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql); } $forum_data = array(); while( $row = $db->sql_fetchrow($result) ) { $forum_data[] = $row; } $db->sql_freeresult($result); if ( !($total_forums = count($forum_data)) ) { message_die(GENERAL_MESSAGE, $lang['No_forums']); } // // Obtain a list of topic ids which contain // posts made since user last visited // if ($userdata['session_logged_in']) { // 60 days limit if ($userdata['user_lastvisit'] < (time() - 5184000)) { $userdata['user_lastvisit'] = time() - 5184000; } $sql = "SELECT t.forum_id, t.topic_id, p.post_time FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p WHERE p.post_id = t.topic_last_post_id AND p.post_time > " . $userdata['user_lastvisit'] . " AND t.topic_moved_id = 0"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query new topic information', '', __LINE__, __FILE__, $sql); } $new_topic_data = array(); while( $topic_data = $db->sql_fetchrow($result) ) { $new_topic_data[$topic_data['forum_id']][$topic_data['topic_id']] = $topic_data['post_time']; } $db->sql_freeresult($result); } // // Obtain list of moderators of each forum // First users, then groups ... broken into two queries // $sql = "SELECT aa.forum_id, u.user_id, u.username FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u WHERE aa.auth_mod = " . TRUE . " AND g.group_single_user = 1 AND ug.group_id = aa.group_id AND g.group_id = aa.group_id AND u.user_id = ug.user_id GROUP BY u.user_id, u.username, aa.forum_id ORDER BY aa.forum_id, u.user_id"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } $forum_moderators = array(); while( $row = $db->sql_fetchrow($result) ) { $forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '">' . $row['username'] . '</a>'; } $db->sql_freeresult($result); $sql = "SELECT aa.forum_id, g.group_id, g.group_name FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g WHERE aa.auth_mod = " . TRUE . " AND g.group_single_user = 0 AND g.group_type <> " . GROUP_HIDDEN . " AND ug.group_id = aa.group_id AND g.group_id = aa.group_id GROUP BY g.group_id, g.group_name, aa.forum_id ORDER BY aa.forum_id, g.group_id"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sql); } while( $row = $db->sql_fetchrow($result) ) { $forum_moderators[$row['forum_id']][] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $row['group_id']) . '">' . $row['group_name'] . '</a>'; } $db->sql_freeresult($result); // // Find which forums are visible for this user // $is_auth_ary = array(); $is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data); // // Start output of page // define('SHOW_ONLINE', true); $page_title = $lang['Index']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'body' => 'index_body.tpl') ); $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), 'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$newest_uid") . '">', $newest_user, '</a>'), 'FORUM_IMG' => $images['forum'], 'FORUM_NEW_IMG' => $images['forum_new'], 'FORUM_LOCKED_IMG' => $images['forum_locked'], 'L_FORUM' => $lang['Forum'], // Begin Simple Subforums MOD 'L_SUBFORUMS' => $lang['Subforums'], // End Simple Subforums MOD 'L_TOPICS' => $lang['Topics'], 'L_REPLIES' => $lang['Replies'], 'L_VIEWS' => $lang['Views'], 'L_POSTS' => $lang['Posts'], 'L_LASTPOST' => $lang['Last_Post'], 'L_NO_NEW_POSTS' => $lang['No_new_posts'], 'L_NEW_POSTS' => $lang['New_posts'], 'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], 'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], 'L_ONLINE_EXPLAIN' => $lang['Online_explain'], 'L_MODERATOR' => $lang['Moderators'], 'L_FORUM_LOCKED' => $lang['Forum_is_locked'], 'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'], 'U_MARK_READ' => append_sid("index.$phpEx?mark=forums")) ); // // Let's decide which categories we should display // $display_categories = array(); for ($i = 0; $i < $total_forums; $i++ ) { if ($is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']) { $display_categories[$forum_data[$i]['cat_id']] = true; } } // // Okay, let's build the index // for($i = 0; $i < $total_categories; $i++) { $cat_id = $category_rows[$i]['cat_id']; // // Yes, we should, so first dump out the category // title, then, if appropriate the forum list // if (isset($display_categories[$cat_id]) && $display_categories[$cat_id]) { $template->assign_block_vars('catrow', array( 'CAT_ID' => $cat_id, 'CAT_DESC' => $category_rows[$i]['cat_title'], 'U_VIEWCAT' => append_sid("index.$phpEx?" . POST_CAT_URL . "=$cat_id")) ); if ( $viewcat == $cat_id || $viewcat == -1 ) { for($j = 0; $j < $total_forums; $j++) { if ( $forum_data[$j]['cat_id'] == $cat_id ) { $forum_id = $forum_data[$j]['forum_id']; if ( $is_auth_ary[$forum_id]['auth_view'] ) { if ( $forum_data[$j]['forum_status'] == FORUM_LOCKED ) { $folder_image = $images['forum_locked']; $folder_alt = $lang['Forum_locked']; // Begin Simple Subforums MOD $unread_topics = false; $folder_images = array( 'default' => $folder_image, 'new' => $images['forum_locked'], 'sub' => ( isset($images['forums_locked']) ) ? $images['forums_locked'] : $images['forum_locked'], 'subnew' => ( isset($images['forums_locked']) ) ? $images['forums_locked'] : $images['forum_locked'], 'subalt' => $lang['Forum_locked'], 'subaltnew' => $lang['Forum_locked'], ); // End Simple Subforums MOD } else { $unread_topics = false; if ( $userdata['session_logged_in'] ) { if ( !empty($new_topic_data[$forum_id]) ) { $forum_last_post_time = 0; while( list($check_topic_id, $check_post_time) = @each($new_topic_data[$forum_id]) ) { if ( empty($tracking_topics[$check_topic_id]) ) { $unread_topics = true; $forum_last_post_time = max($check_post_time, $forum_last_post_time); } else { if ( $tracking_topics[$check_topic_id] < $check_post_time ) { $unread_topics = true; $forum_last_post_time = max($check_post_time, $forum_last_post_time); } } } if ( !empty($tracking_forums[$forum_id]) ) { if ( $tracking_forums[$forum_id] > $forum_last_post_time ) { $unread_topics = false; } } if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) ) { if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time ) { $unread_topics = false; } } } } $folder_image = ( $unread_topics ) ? $images['forum_new'] : $images['forum']; $folder_alt = ( $unread_topics ) ? $lang['New_posts'] : $lang['No_new_posts']; // Begin Simple Subforums MOD $folder_images = array( 'default' => $folder_image, 'new' => $images['forum_new'], 'sub' => ( isset($images['forums']) ) ? $images['forums'] : $images['forum'], 'subnew' => ( isset($images['forums_new']) ) ? $images['forums_new'] : $images['forum_new'], 'subalt' => $lang['No_new_posts'], 'subaltnew' => $lang['New_posts'], ); // End Simple Subforums MOD } $posts = $forum_data[$j]['forum_posts']; $topics = $forum_data[$j]['forum_topics']; if ( $forum_data[$j]['forum_last_post_id'] ) { $last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']); $last_post = $last_post_time . '<br />'; $last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> '; $last_post .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>'; // Begin Simple Subforums MOD $last_post_sub = '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . ($unread_topics ? $images['icon_newest_reply'] : $images['icon_latest_reply']) . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>'; $last_post_time = $forum_data[$j]['post_time']; // End Simple Subforums MOD } else { $last_post = $lang['No_Posts']; // Begin Simple Subforums MOD $last_post_sub = '<img src="' . $images['icon_minipost'] . '" border="0" alt="' . $lang['No_Posts'] . '" title="' . $lang['No_Posts'] . '" />'; $last_post_time = 0; // End Simple Subforums MOD } if ( count($forum_moderators[$forum_id]) > 0 ) { $l_moderators = ( count($forum_moderators[$forum_id]) == 1 ) ? $lang['Moderator'] : $lang['Moderators']; $moderator_list = implode(', ', $forum_moderators[$forum_id]); } else { $l_moderators = ' '; $moderator_list = ''; } $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; $template->assign_block_vars('catrow.forumrow', array( 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'FORUM_FOLDER_IMG' => $folder_image, 'FORUM_NAME' => $forum_data[$j]['forum_name'], 'FORUM_DESC' => $forum_data[$j]['forum_desc'], 'POSTS' => $forum_data[$j]['forum_posts'], 'TOPICS' => $forum_data[$j]['forum_topics'], 'LAST_POST' => $last_post, 'MODERATORS' => $moderator_list, 'L_MODERATOR' => $l_moderators, 'L_FORUM_FOLDER_ALT' => $folder_alt, // Begin Simple Subforums MOD 'FORUM_FOLDERS' => serialize($folder_images), 'HAS_SUBFORUMS' => 0, 'PARENT' => $forum_data[$j]['forum_parent'], 'ID' => $forum_data[$j]['forum_id'], 'UNREAD' => intval($unread_topics), 'TOTAL_UNREAD' => intval($unread_topics), 'TOTAL_POSTS' => $forum_data[$j]['forum_posts'], 'TOTAL_TOPICS' => $forum_data[$j]['forum_topics'], 'LAST_POST_FORUM' => $last_post, 'LAST_POST_TIME' => $last_post_time, 'LAST_POST_TIME_FORUM' => $last_post_time, // End Simple Subforums MOD 'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id")) ); // Begin Simple Subforums MOD if( $forum_data[$j]['forum_parent'] ) { $subforums_list[] = array( 'forum_data' => $forum_data[$j], 'folder_image' => $folder_image, 'last_post' => $last_post, 'last_post_sub' => $last_post_sub, 'moderator_list' => $moderator_list, 'unread_topics' => $unread_topics, 'l_moderators' => $l_moderators, 'folder_alt' => $folder_alt, 'last_post_time' => $last_post_time, 'desc' => $forum_data[$j]['forum_desc'], ); } // End Simple Subforums MOD } } } } } } // for ... categories }// if ... total_categories else { message_die(GENERAL_MESSAGE, $lang['No_forums']); } // Begin Simple Subforums MOD unset($data); unset($item); unset($cat_item); unset($row_item); for( $i = 0; $i < count($subforums_list); $i++ ) { $forum_data = $subforums_list[$i]['forum_data']; $parent_id = $forum_data['forum_parent']; // Find parent item if( isset($template->_tpldata['catrow.']) ) { $data = &$template->_tpldata['catrow.']; $count = count($data); for( $j = 0; $j < $count; $j++) { $cat_item = &$data[$j]; $row_item = &$cat_item['forumrow.']; $count2 = count($row_item); for( $k = 0; $k < $count2; $k++) { if( $row_item[$k]['ID'] == $parent_id ) { $item = &$row_item[$k]; break; } } if( isset($item) ) { break; } } } if( isset($item) ) { if( isset($item['sub.']) ) { $num = count($item['sub.']); $data = &$item['sub.']; } else { $num = 0; $item[] = 'sub.'; $data = &$item['sub.']; } // Append new entry $data[] = array( 'NUM' => $num, 'FORUM_FOLDER_IMG' => $subforums_list[$i]['folder_image'], 'FORUM_NAME' => $forum_data['forum_name'], 'FORUM_DESC' => $forum_data['forum_desc'], 'FORUM_DESC_HTML' => htmlspecialchars(preg_replace('@<[\/\!]*?[^<>]*?>@si', '', $forum_data['forum_desc'])), 'POSTS' => $forum_data['forum_posts'], 'TOPICS' => $forum_data['forum_topics'], 'LAST_POST' => $subforums_list[$i]['last_post'], 'LAST_POST_SUB' => $subforums_list[$i]['last_post_sub'], 'LAST_TOPIC' => $forum_data['topic_title'], 'MODERATORS' => $subforums_list[$i]['moderator_list'], 'PARENT' => $forum_data['forum_parent'], 'ID' => $forum_data['forum_id'], 'UNREAD' => intval($subforums_list[$i]['unread_topics']), 'L_MODERATOR' => $subforums_list[$i]['l_moderators'], 'L_FORUM_FOLDER_ALT' => $subforums_list[$i]['folder_alt'], 'U_VIEWFORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_data['forum_id']) ); $item['HAS_SUBFORUMS'] ++; $item['TOTAL_UNREAD'] += intval($subforums_list[$i]['unread_topics']); // Change folder image $images = unserialize($item['FORUM_FOLDERS']); $item['FORUM_FOLDER_IMG'] = $item['TOTAL_UNREAD'] ? $images['subnew'] : $images['sub']; $item['L_FORUM_FOLDER_ALT'] = $item['TOTAL_UNREAD'] ? $images['subaltnew'] : $images['subalt']; // Check last post if( $item['LAST_POST_TIME'] < $subforums_list[$i]['last_post_time'] ) { $item['LAST_POST'] = $subforums_list[$i]['last_post']; $item['LAST_POST_TIME'] = $subforums_list[$i]['last_post_time']; } if( !$item['LAST_POST_TIME_FORUM'] ) { $item['LAST_POST_FORUM'] = $item['LAST_POST']; } // Add topics/posts $item['TOTAL_POSTS'] += $forum_data['forum_posts']; $item['TOTAL_TOPICS'] += $forum_data['forum_topics']; } unset($item); unset($data); unset($cat_item); unset($row_item); } // End Simple Subforums MOD // // Generate the page // $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: viewonline.php --- <?php /*************************************************************************** * viewonline.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: viewonline.php,v 1.1 2008/12/31 01:43:48 orynider Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_VIEWONLINE); init_userprefs($userdata); // // End session management // // // Output page header and load viewonline template // $page_title = $lang['Who_is_Online']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'body' => 'viewonline_body.tpl') ); make_jumpbox('viewforum.'.$phpEx); $template->assign_vars(array( 'L_WHOSONLINE' => $lang['Who_is_Online'], 'L_ONLINE_EXPLAIN' => $lang['Online_explain'], 'L_USERNAME' => $lang['Username'], 'L_FORUM_LOCATION' => $lang['Forum_Location'], 'L_LAST_UPDATE' => $lang['Last_updated']) ); // // Forum info // $sql = "SELECT forum_name, forum_id FROM " . FORUMS_TABLE; if ( $result = $db->sql_query($sql) ) { while( $row = $db->sql_fetchrow($result) ) { $forum_data[$row['forum_id']] = $row['forum_name']; } } else { message_die(GENERAL_ERROR, 'Could not obtain user/online forums information', '', __LINE__, __FILE__, $sql); } // // Get auth data // $is_auth_ary = array(); $is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata); // // Get user list // $sql = "SELECT u.user_id, u.username, u.user_allow_viewonline, u.user_level, s.session_logged_in, s.session_time, s.session_page, s.session_ip FROM ".USERS_TABLE." u, ".SESSIONS_TABLE." s WHERE u.user_id = s.session_user_id AND s.session_time >= ".( time() - 300 ) . " ORDER BY u.username ASC, s.session_ip ASC"; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not obtain regd user/online information', '', __LINE__, __FILE__, $sql); } $guest_users = 0; $registered_users = 0; $hidden_users = 0; $reg_counter = 0; $guest_counter = 0; $prev_user = 0; $prev_ip = ''; while ( $row = $db->sql_fetchrow($result) ) { $view_online = false; if ( $row['session_logged_in'] ) { $user_id = $row['user_id']; if ( $user_id != $prev_user ) { $username = $row['username']; $style_color = ''; if ( $row['user_level'] == ADMIN ) { $username = '<b style="color:#' . $theme['fontcolor3'] . '">' . $username . '</b>'; } else if ( $row['user_level'] == MOD ) { $username = '<b style="color:#' . $theme['fontcolor2'] . '">' . $username . '</b>'; } if ( !$row['user_allow_viewonline'] ) { $view_online = ( $userdata['user_level'] == ADMIN ) ? true : false; $hidden_users++; $username = '<i>' . $username . '</i>'; } else { $view_online = true; $registered_users++; } $which_counter = 'reg_counter'; $which_row = 'reg_user_row'; $prev_user = $user_id; } } else { if ( $row['session_ip'] != $prev_ip ) { $username = $lang['Guest']; $view_online = true; $guest_users++; $which_counter = 'guest_counter'; $which_row = 'guest_user_row'; } } $prev_ip = $row['session_ip']; if ( $view_online ) { if ( $row['session_page'] < 1 || !$is_auth_ary[$row['session_page']]['auth_view'] ) { switch( $row['session_page'] ) { case PAGE_INDEX: $location = $lang['Forum_index']; $location_url = "index.$phpEx"; break; case PAGE_POSTING: $location = $lang['Posting_message']; $location_url = "index.$phpEx"; break; case PAGE_LOGIN: $location = $lang['Logging_on']; $location_url = "index.$phpEx"; break; case PAGE_SEARCH: $location = $lang['Searching_forums']; $location_url = "search.$phpEx"; break; case PAGE_PROFILE: $location = $lang['Viewing_profile']; $location_url = "index.$phpEx"; break; case PAGE_VIEWONLINE: $location = $lang['Viewing_online']; $location_url = "viewonline.$phpEx"; break; case PAGE_VIEWMEMBERS: $location = $lang['Viewing_member_list']; $location_url = "memberlist.$phpEx"; break; case PAGE_PRIVMSGS: $location = $lang['Viewing_priv_msgs']; $location_url = "privmsg.$phpEx"; break; case PAGE_FAQ: $location = $lang['Viewing_FAQ']; $location_url = "faq.$phpEx"; break; default: $location = $lang['Forum_index']; $location_url = "index.$phpEx"; } } else { $location_url = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $row['session_page']); $location = $forum_data[$row['session_page']]; } $row_color = ( $$which_counter % 2 ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( $$which_counter % 2 ) ? $theme['td_class1'] : $theme['td_class2']; $template->assign_block_vars("$which_row", array( 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'USERNAME' => $username, 'LASTUPDATE' => create_date($board_config['default_dateformat'], $row['session_time'], $board_config['board_timezone']), 'FORUM_LOCATION' => $location, 'U_USER_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $user_id), 'U_FORUM_LOCATION' => append_sid($location_url)) ); $$which_counter++; } } if( $registered_users == 0 ) { $l_r_user_s = $lang['Reg_users_zero_online']; } else if( $registered_users == 1 ) { $l_r_user_s = $lang['Reg_user_online']; } else { $l_r_user_s = $lang['Reg_users_online']; } if( $hidden_users == 0 ) { $l_h_user_s = $lang['Hidden_users_zero_online']; } else if( $hidden_users == 1 ) { $l_h_user_s = $lang['Hidden_user_online']; } else { $l_h_user_s = $lang['Hidden_users_online']; } if( $guest_users == 0 ) { $l_g_user_s = $lang['Guest_users_zero_online']; } else if( $guest_users == 1 ) { $l_g_user_s = $lang['Guest_user_online']; } else { $l_g_user_s = $lang['Guest_users_online']; } $template->assign_vars(array( 'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $registered_users) . sprintf($l_h_user_s, $hidden_users), 'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_users)) ); if ( $registered_users + $hidden_users == 0 ) { $template->assign_vars(array( 'L_NO_REGISTERED_USERS_BROWSING' => $lang['No_users_browsing']) ); } if ( $guest_users == 0 ) { $template->assign_vars(array( 'L_NO_GUESTS_BROWSING' => $lang['No_users_browsing']) ); } $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: robots.txt --- User-agent: * Disallow: /admin/ Disallow: /cache/ Disallow: /images/ Disallow: /includes/ Disallow: /language/ Disallow: /templates/ --- NEW FILE: viewtopic.php --- <?php /*************************************************************************** * viewtopic.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: viewtopic.php,v 1.1 2008/12/31 01:43:48 orynider Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. [...1203 lines suppressed...] 'EDIT' => $edit, 'QUOTE_IMG' => $quote_img, 'QUOTE' => $quote, 'IP_IMG' => $ip_img, 'IP' => $ip, 'DELETE_IMG' => $delpost_img, 'DELETE' => $delpost, 'L_MINI_POST_ALT' => $mini_post_alt, 'U_MINI_POST' => $mini_post_url, 'U_POST_ID' => $postrow[$i]['post_id']) ); } $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: faq.php --- <?php /*************************************************************************** * faq.php * ------------------- * begin : Sunday, Jul 8, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: faq.php,v 1.1 2008/12/31 01:43:48 orynider Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_FAQ); init_userprefs($userdata); // // End session management // // Set vars to prevent naughtiness $faq = array(); // // Load the appropriate faq file // if( isset($HTTP_GET_VARS['mode']) ) { switch( $HTTP_GET_VARS['mode'] ) { case 'bbcode': $lang_file = 'lang_bbcode'; $l_title = $lang['BBCode_guide']; break; default: $lang_file = 'lang_faq'; $l_title = $lang['FAQ']; break; } } else { $lang_file = 'lang_faq'; $l_title = $lang['FAQ']; } include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/' . $lang_file . '.' . $phpEx); // // Pull the array data from the lang pack // $j = 0; $counter = 0; $counter_2 = 0; $faq_block = array(); $faq_block_titles = array(); for($i = 0; $i < count($faq); $i++) { if( $faq[$i][0] != '--' ) { $faq_block[$j][$counter]['id'] = $counter_2; $faq_block[$j][$counter]['question'] = $faq[$i][0]; $faq_block[$j][$counter]['answer'] = $faq[$i][1]; $counter++; $counter_2++; } else { $j = ( $counter != 0 ) ? $j + 1 : 0; $faq_block_titles[$j] = $faq[$i][1]; $counter = 0; } } // // Lets build a page ... // $page_title = $l_title; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'body' => 'faq_body.tpl') ); make_jumpbox('viewforum.'.$phpEx); $template->assign_vars(array( 'L_FAQ_TITLE' => $l_title, 'L_BACK_TO_TOP' => $lang['Back_to_top']) ); for($i = 0; $i < count($faq_block); $i++) { if( count($faq_block[$i]) ) { $template->assign_block_vars('faq_block', array( 'BLOCK_TITLE' => $faq_block_titles[$i]) ); $template->assign_block_vars('faq_block_link', array( 'BLOCK_TITLE' => $faq_block_titles[$i]) ); for($j = 0; $j < count($faq_block[$i]); $j++) { $row_color = ( !($j % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($j % 2) ) ? $theme['td_class1'] : $theme['td_class2']; $template->assign_block_vars('faq_block.faq_row', array( 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'FAQ_QUESTION' => $faq_block[$i][$j]['question'], 'FAQ_ANSWER' => $faq_block[$i][$j]['answer'], 'U_FAQ_ID' => $faq_block[$i][$j]['id']) ); $template->assign_block_vars('faq_block_link.faq_row_link', array( 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'FAQ_LINK' => $faq_block[$i][$j]['question'], 'U_FAQ_LINK' => '#' . $faq_block[$i][$j]['id']) ); } } } $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: config.php --- <?php // phpBB 2.x auto-generated config file // Do not change anything in this file! $dbms = 'mysqli'; $dbhost = ''; $dbname = ''; $dbuser = ''; $dbpasswd = ''; $table_prefix = ''; ?> --- NEW FILE: memberlist.php --- <?php /*************************************************************************** * memberlist.php * ------------------- * begin : Friday, May 11, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: memberlist.php,v 1.1 2008/12/31 01:43:48 orynider Exp $ * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); // // Start session management // $userdata = session_pagestart($user_ip, PAGE_VIEWMEMBERS); init_userprefs($userdata); // // End session management // $start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0; $start = ($start < 0) ? 0 : $start; if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) { $mode = ( isset($HTTP_POST_VARS['mode']) ) ? htmlspecialchars($HTTP_POST_VARS['mode']) : htmlspecialchars($HTTP_GET_VARS['mode']); } else { $mode = 'joined'; } if(isset($HTTP_POST_VARS['order'])) { $sort_order = ($HTTP_POST_VARS['order'] == 'ASC') ? 'ASC' : 'DESC'; } else if(isset($HTTP_GET_VARS['order'])) { $sort_order = ($HTTP_GET_VARS['order'] == 'ASC') ? 'ASC' : 'DESC'; } else { $sort_order = 'ASC'; } // // Memberlist sorting // $mode_types_text = array($lang['Sort_Joined'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'], $lang['Sort_Website'], $lang['Sort_Top_Ten']); $mode_types = array('joined', 'username', 'location', 'posts', 'email', 'website', 'topten'); $select_sort_mode = '<select name="mode">'; for($i = 0; $i < count($mode_types_text); $i++) { $selected = ( $mode == $mode_types[$i] ) ? ' selected="selected"' : ''; $select_sort_mode .= '<option value="' . $mode_types[$i] . '"' . $selected . '>' . $mode_types_text[$i] . '</option>'; } $select_sort_mode .= '</select>'; $select_sort_order = '<select name="order">'; if($sort_order == 'ASC') { $select_sort_order .= '<option value="ASC" selected="selected">' . $lang['Sort_Ascending'] . '</option><option value="DESC">' . $lang['Sort_Descending'] . '</option>'; } else { $select_sort_order .= '<option value="ASC">' . $lang['Sort_Ascending'] . '</option><option value="DESC" selected="selected">' . $lang['Sort_Descending'] . '</option>'; } $select_sort_order .= '</select>'; // // Generate page // $page_title = $lang['Memberlist']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); $template->set_filenames(array( 'body' => 'memberlist_body.tpl') ); make_jumpbox('viewforum.'.$phpEx); $template->assign_vars(array( 'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], 'L_EMAIL' => $lang['Email'], 'L_WEBSITE' => $lang['Website'], 'L_FROM' => $lang['Location'], 'L_ORDER' => $lang['Order'], 'L_SORT' => $lang['Sort'], 'L_SUBMIT' => $lang['Sort'], 'L_AIM' => $lang['AIM'], 'L_YIM' => $lang['YIM'], 'L_MSNM' => $lang['MSNM'], 'L_ICQ' => $lang['ICQ'], 'L_JOINED' => $lang['Joined'], 'L_POSTS' => $lang['Posts'], 'L_PM' => $lang['Private_Message'], 'S_MODE_SELECT' => $select_sort_mode, 'S_ORDER_SELECT' => $select_sort_order, 'S_MODE_ACTION' => append_sid("memberlist.$phpEx")) ); switch( $mode ) { case 'joined': $order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page']; break; case 'username': $order_by = "username $sort_order LIMIT $start, " . $board_config['topics_per_page']; break; case 'location': $order_by = "user_from $sort_order LIMIT $start, " . $board_config['topics_per_page']; break; case 'posts': $order_by = "user_posts $sort_order LIMIT $start, " . $board_config['topics_per_page']; break; case 'email': $order_by = "user_email $sort_order LIMIT $start, " . $board_config['topics_per_page']; break; case 'website': $order_by = "user_website $sort_order LIMIT $start, " . $board_config['topics_per_page']; break; case 'topten': $order_by = "user_posts $sort_order LIMIT 10"; break; default: $order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page']; break; } $sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar FROM " . USERS_TABLE . " WHERE user_id <> " . ANONYMOUS . " ORDER BY $order_by"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $i = 0; do { $username = $row['username']; $user_id = $row['user_id']; $from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' '; $joined = create_date($lang['DATE_FORMAT'], $row['user_regdate'], $board_config['board_timezone']); $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0; $poster_avatar = ''; if ( $row['user_avatar_type'] && $user_id != ANONYMOUS && $row['user_allowavatar'] ) { switch( $row['user_avatar_type'] ) { case USER_AVATAR_UPLOAD: $poster_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : ''; break; case USER_AVATAR_REMOTE: $poster_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $row['user_avatar'] . '" alt="" border="0" />' : ''; break; case USER_AVATAR_GALLERY: $poster_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $row['user_avatar'] . '" alt="" border="0" />' : ''; break; } } if ( !empty($row['user_viewemail']) || $userdata['user_level'] == ADMIN ) { $email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL .'=' . $user_id) : 'mailto:' . $row['user_email']; $email_img = '<a href="' . $email_uri . '"><img src="' . $images['icon_email'] . '" alt="' . $lang['Send_email'] . '" title="' . $lang['Send_email'] . '" border="0" /></a>'; $email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>'; } else { $email_img = ' '; $email = ' '; } $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"); $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['Read_profile'] . '" title="' . $lang['Read_profile'] . '" border="0" /></a>'; $profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>'; $temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id"); $pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['Send_private_message'] . '" title="' . $lang['Send_private_message'] . '" border="0" /></a>'; $pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>'; $www_img = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww"><img src="' . $images['icon_www'] . '" alt="' . $lang['Visit_website'] . '" title="' . $lang['Visit_website'] . '" border="0" /></a>' : ''; $www = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : ''; if ( !empty($row['user_icq']) ) { $icq_status_img = '<a href="http://wwp.icq.com/' . $row['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>'; $icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>'; $icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $lang['ICQ'] . '</a>'; } else { $icq_status_img = ''; $icq_img = ''; $icq = ''; } $aim_img = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&message=Hello+Are+you+there?"><img src="' . $images['icon_aim'] . '" alt="' . $lang['AIM'] . '" title="' . $lang['AIM'] . '" border="0" /></a>' : ''; $aim = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : ''; $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"); $msn_img = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['MSNM'] . '" title="' . $lang['MSNM'] . '" border="0" /></a>' : ''; $msn = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : ''; $yim_img = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&.src=pg"><img src="' . $images['icon_yim'] . '" alt="' . $lang['YIM'] . '" title="' . $lang['YIM'] . '" border="0" /></a>' : ''; $yim = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&.src=pg">' . $lang['YIM'] . '</a>' : ''; $temp_url = append_sid("search.$phpEx?search_author=" . urlencode($username) . "&showresults=posts"); $search_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_search'] . '" alt="' . sprintf($lang['Search_user_posts'], $username) . '" title="' . sprintf($lang['Search_user_posts'], $username) . '" border="0" /></a>'; $search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $username) . '</a>'; $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; $template->assign_block_vars('memberrow', array( 'ROW_NUMBER' => $i + ( $start + 1 ), 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'USERNAME' => $username, 'FROM' => $from, 'JOINED' => $joined, 'POSTS' => $posts, 'AVATAR_IMG' => $poster_avatar, 'PROFILE_IMG' => $profile_img, 'PROFILE' => $profile, 'SEARCH_IMG' => $search_img, 'SEARCH' => $search, 'PM_IMG' => $pm_img, 'PM' => $pm, 'EMAIL_IMG' => $email_img, 'EMAIL' => $email, 'WWW_IMG' => $www_img, 'WWW' => $www, 'ICQ_STATUS_IMG' => $icq_status_img, 'ICQ_IMG' => $icq_img, 'ICQ' => $icq, 'AIM_IMG' => $aim_img, 'AIM' => $aim, 'MSN_IMG' => $msn_img, 'MSN' => $msn, 'YIM_IMG' => $yim_img, 'YIM' => $yim, 'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id")) ); $i++; } while ( $row = $db->sql_fetchrow($result) ); $db->sql_freeresult($result); } if ( $mode != 'topten' || $board_config['topics_per_page'] < 10 ) { $sql = "SELECT count(*) AS total FROM " . USERS_TABLE . " WHERE user_id <> " . ANONYMOUS; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql); } if ( $total = $db->sql_fetchrow($result) ) { $total_members = $total['total']; $pagination = generate_pagination("memberlist.$phpEx?mode=$mode&order=$sort_order", $total_members, $board_config['topics_per_page'], $start). ' '; } $db->sql_freeresult($result); } else { $pagination = ' '; $total_members = 10; } $template->assign_vars(array( 'PAGINATION' => $pagination, 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_members / $board_config['topics_per_page'] )), 'L_GOTO_PAGE' => $lang['Goto_page']) ); $template->pparse('body'); include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: groupcp.php --- <?php /*************************************************************************** * groupcp.php * ------------------- * begin : Saturday, Feb 13, 2001 * copyright : (C) 2001 The phpBB Group * email : su...@ph... * * $Id: groupcp.php,v 1.1 2008/12/31 01:43:48 orynider Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. [...1259 lines suppressed...] 'S_USERGROUP_ACTION' => append_sid("groupcp.$phpEx"), 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'GROUP_LIST_SELECT' => $s_group_list, 'GROUP_PENDING_SELECT' => $s_pending_groups, 'GROUP_MEMBER_SELECT' => $s_member_groups) ); $template->pparse('user'); } else { message_die(GENERAL_MESSAGE, $lang['No_groups_exist']); } } include($phpbb_root_path . 'includes/page_tail.'.$phpEx); ?> --- NEW FILE: viewforum.php --- <?php /*************************************************************************** * viewforum.php * ------------------- * begin ... [truncated message content] |