diff --git a/phpBB/admin/admin_database.php b/phpBB/admin/admin_database.php index 2a5c36ab82..2fde6824d9 100644 --- a/phpBB/admin/admin_database.php +++ b/phpBB/admin/admin_database.php @@ -18,17 +18,9 @@ * (at your option) any later version. * ***************************************************************************/ - -/*************************************************************************** -* We will attempt to create a file based backup of all of the data in the -* users phpBB database. The resulting file should be able to be imported by -* the db_restore.php function, or by using the mysql command_line -* -* Some functions are adapted from the upgrade_20.php script and others -* adapted from the unoficial phpMyAdmin 2.2.0. -***************************************************************************/ - -define('IN_PHPBB', 1); +// +// Some functions are adapted phpMyAdmin 2.2.0. +// if ( !empty($setmodules) ) { @@ -38,26 +30,29 @@ if ( !empty($setmodules) ) } $filename = basename(__FILE__); - $module['DB']['DB_Backup'] = $filename . "$SID&perform=backup"; + $module['DB']['DB_Backup'] = $filename . "$SID&mode=backup"; $file_uploads = @ini_get('file_uploads'); if( ( $file_uploads != 0 || empty($file_uploads) ) && strtolower($file_uploads) != 'off' && @phpversion() != '4.0.4pl1' ) { - $module['DB']['DB_Restore'] = $filename . "$SID&perform=restore"; + $module['DB']['DB_Restore'] = $filename . "$SID&mode=restore"; } return; } +define('IN_PHPBB', 1); // // Load default header // -$no_page_header = TRUE; -$phpbb_root_path = "../"; +$phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); +// +// +// if ( !$acl->get_acl_admin('general') ) { message_die(MESSAGE, $lang['No_admin']); @@ -73,11 +68,11 @@ if ( !$acl->get_acl_admin('general') ) // Begin program proper // -if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) +if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) { - $perform = ( isset($HTTP_POST_VARS['perform']) ) ? $HTTP_POST_VARS['perform'] : $HTTP_GET_VARS['perform']; + $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; - switch($perform) + switch($mode) { case 'backup': @@ -96,77 +91,73 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) break; } - include('page_header_admin.'.$phpEx); - - $template->assign_vars(array( - "MESSAGE_TITLE" => $lang['Information'], - "MESSAGE_TEXT" => $lang['Backups_not_supported']) - ); - + message_die(MESSAGE, $lang['Backups_not_supported']); break; } - $tables = array('auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_results', 'search_wordlist', 'search_wordmatch', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words'); + $tables = array('search_wordlist', 'search_wordmatch', 'auth_access', 'banlist', 'categories', 'config', 'disallow', 'forums', 'forum_prune', 'groups', 'posts', 'posts_text', 'privmsgs', 'privmsgs_text', 'ranks', 'search_results', 'search_results', 'sessions', 'smilies', 'themes', 'themes_name', 'topics', 'topics_watch', 'user_group', 'users', 'vote_desc', 'vote_results', 'vote_voters', 'words'); - $additional_tables = (isset($HTTP_POST_VARS['additional_tables'])) ? $HTTP_POST_VARS['additional_tables'] : ( ( isset($HTTP_GET_VARS['additional_tables']) ) ? $HTTP_GET_VARS['additional_tables'] : "" ); + $additional_tables = ( isset($HTTP_POST_VARS['additional_tables']) ) ? $HTTP_POST_VARS['additional_tables'] : ( ( isset($HTTP_GET_VARS['additional_tables']) ) ? $HTTP_GET_VARS['additional_tables'] : '' ); - $backup_type = (isset($HTTP_POST_VARS['backup_type'])) ? $HTTP_POST_VARS['backup_type'] : ( ( isset($HTTP_GET_VARS['backup_type']) ) ? $HTTP_GET_VARS['backup_type'] : "" ); + $backup_type = ( isset($HTTP_POST_VARS['backup_type']) ) ? $HTTP_POST_VARS['backup_type'] : ( ( isset($HTTP_GET_VARS['backup_type']) ) ? $HTTP_GET_VARS['backup_type'] : '' ); - $gzipcompress = (!empty($HTTP_POST_VARS['gzipcompress'])) ? $HTTP_POST_VARS['gzipcompress'] : ( ( !empty($HTTP_GET_VARS['gzipcompress']) ) ? $HTTP_GET_VARS['gzipcompress'] : 0 ); + $ignoresearch = ( !empty($HTTP_POST_VARS['ignoresearch']) ) ? $HTTP_POST_VARS['ignoresearch'] : ( ( !empty($HTTP_GET_VARS['ignoresearch']) ) ? $HTTP_GET_VARS['ignoresearch'] : 0 ); + + $gzipcompress = ( !empty($HTTP_POST_VARS['gzipcompress']) ) ? $HTTP_POST_VARS['gzipcompress'] : ( ( !empty($HTTP_GET_VARS['gzipcompress']) ) ? $HTTP_GET_VARS['gzipcompress'] : 0 ); if ( !empty($additional_tables) ) { - if ( ereg(",", $additional_tables)) - { - $additional_tables = split(",", $additional_tables); + $additional_tables = explode(', ', $additional_tables); - for($i = 0; $i < count($additional_tables); $i++) - { - $tables[] = trim($additional_tables[$i]); - } - - } - else + for($i = 0; $i < count($additional_tables); $i++) { - $tables[] = trim($additional_tables); + $tables[] = trim($additional_tables[$i]); } + unset($additional_tables); } if ( !isset($HTTP_POST_VARS['backupstart']) && !isset($HTTP_GET_VARS['backupstart'])) { - $s_hidden_fields = ''; + $s_hidden_fields = ''; - page_header($lang['DB']); + page_header($lang['DB_Backup']); ?>

-
"> +">
- - + + - - + + - - - - - - + + + - + + @@ -180,7 +171,7 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) else if ( !isset($HTTP_POST_VARS['startdownload']) && !isset($HTTP_GET_VARS['startdownload']) ) { $template->assign_vars(array( - "META" => "", + "META" => "", "MESSAGE_TITLE" => $lang['Database_Utilities'] . " : " . $lang['Backup'], "MESSAGE_TEXT" => $lang['Backup_download']) @@ -229,14 +220,15 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) echo "#\n# DATE : " . gmdate("d-m-Y H:i:s", time()) . " GMT\n"; echo "#\n"; - if(SQL_LAYER == 'postgresql') + if ( SQL_LAYER == 'postgresql' ) { echo "\n" . pg_get_sequences("\n", $backup_type); } + for($i = 0; $i < count($tables); $i++) { $table_name = $tables[$i]; - if(SQL_LAYER != 'mysql4') + if ( SQL_LAYER != 'mysql4' ) { $table_def_function = "get_table_def_" . SQL_LAYER; $table_content_function = "get_table_content_" . SQL_LAYER; @@ -247,19 +239,19 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) $table_content_function = "get_table_content_mysql"; } - if($backup_type != 'data') + if ( $backup_type != 'data' ) { echo "#\n# TABLE: " . $table_prefix . $table_name . "\n#\n"; echo $table_def_function($table_prefix . $table_name, "\n") . "\n"; } - if($backup_type != 'structure') + if ( $backup_type != 'structure' ) { $table_content_function($table_prefix . $table_name, "output_table_content"); } } - if($do_gzip_compress) + if ( $do_gzip_compress ) { $Size = ob_get_length(); $Crc = crc32(ob_get_contents()); @@ -275,9 +267,9 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) ) if ( !isset($restore_start) ) { - $s_hidden_fields = ''; + $s_hidden_fields = ''; - page_header($lang['DB']); + page_header($lang['DB_Restore']); ?> @@ -285,14 +277,21 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) )

-">
     

  

    
- - +">
+ - + + -
    :
+ + :
+ + + + + + - - - - - - \ No newline at end of file diff --git a/phpBB/admin/admin_email.php b/phpBB/admin/admin_email.php index 6c99d61fe1..e1e6af523d 100644 --- a/phpBB/admin/admin_email.php +++ b/phpBB/admin/admin_email.php @@ -116,7 +116,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $email_headers .= 'X-AntiAbuse: Board servername - ' . $server_name . "\n"; $email_headers .= 'X-AntiAbuse: User_id - ' . $userdata['user_id'] . "\n"; $email_headers .= 'X-AntiAbuse: Username - ' . $userdata['username'] . "\n"; - $email_headers .= 'X-AntiAbuse: User IP - ' . $user_ip . "\r\n"; + $email_headers .= 'X-AntiAbuse: User IP - ' . $user_ip . "\n"; $emailer->use_template('admin_send_email'); $emailer->email_address($board_config['board_email']); @@ -132,9 +132,7 @@ if ( isset($HTTP_POST_VARS['submit']) ) $emailer->send(); $emailer->reset(); - $message = $lang['Email_sent'] . '

' . sprintf($lang['Click_return_admin_index'], '', ''); - - message_die(MESSAGE, $message); + message_die(MESSAGE, $lang['Email_sent']); } } @@ -157,11 +155,11 @@ if ( $row = $db->sql_fetchrow($result) ) } $select_list .= ''; -page_header($lang['Users']); +page_header($lang['Mass_Email']); ?> -

+

diff --git a/phpBB/admin/admin_forums.php b/phpBB/admin/admin_forums.php index 644bd7ebfb..ce5ad24541 100644 --- a/phpBB/admin/admin_forums.php +++ b/phpBB/admin/admin_forums.php @@ -1,6 +1,6 @@ get_acl_admin('forum') ) + { + return; + } + $file = basename(__FILE__); $module['Forums']['Manage'] = $file . $SID; return; } +define('IN_PHPBB', 1); // -// Load default header +// Include files // -$phpbb_root_path = "../"; +$phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); -$forum_auth_ary = array( - "auth_view" => AUTH_ALL, - "auth_read" => AUTH_ALL, - "auth_post" => AUTH_ALL, - "auth_reply" => AUTH_ALL, - "auth_edit" => AUTH_REG, - "auth_delete" => AUTH_REG, - "auth_sticky" => AUTH_REG, - "auth_announce" => AUTH_MOD, - "auth_vote" => AUTH_REG, - "auth_pollcreate" => AUTH_REG -); +// +// Do we have forum admin permissions? +// +if ( !$acl->get_acl_admin('forum') ) +{ + message_die(MESSAGE, $lang['No_admin']); +} // // Mode setting // -if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) +if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) { $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; } else { - $mode = ""; + $mode = ''; } -// ------------------ -// Begin function block -// -function get_info($mode, $id) -{ - global $db; - - switch($mode) - { - case 'category': - $table = CATEGORIES_TABLE; - $idfield = 'cat_id'; - $namefield = 'cat_title'; - break; - - case 'forum': - $table = FORUMS_TABLE; - $idfield = 'forum_id'; - $namefield = 'forum_name'; - break; - - default: - message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); - break; - } - $sql = "SELECT count(*) as total - FROM $table"; - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql); - } - $count = $db->sql_fetchrow($result); - $count = $count['total']; - - $sql = "SELECT * - FROM $table - WHERE $idfield = $id"; - - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql); - } - - if( $db->sql_numrows($result) != 1 ) - { - message_die(GENERAL_ERROR, "Forum/Category doesn't exist or multiple forums/categories with ID $id", "", __LINE__, __FILE__); - } - - $return = $db->sql_fetchrow($result); - $return['number'] = $count; - return $return; -} - -function get_list($mode, $id, $select) -{ - global $db; - - switch($mode) - { - case 'category': - $table = CATEGORIES_TABLE; - $idfield = 'cat_id'; - $namefield = 'cat_title'; - break; - - case 'forum': - $table = FORUMS_TABLE; - $idfield = 'forum_id'; - $namefield = 'forum_name'; - break; - - default: - message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); - break; - } - - $sql = "SELECT * - FROM $table"; - if( $select == 0 ) - { - $sql .= " WHERE $idfield <> $id"; - } - - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't get list of Categories/Forums", "", __LINE__, __FILE__, $sql); - } - - $cat_list = ""; - - while( $row = $db->sql_fetchrow($result) ) - { - $s = ""; - if ($row[$idfield] == $id) - { - $s = " selected=\"selected\""; - } - $catlist .= "\n"; - } - - return($catlist); -} - -function renumber_order($mode, $cat = 0) -{ - global $db; - - switch($mode) - { - case 'category': - $table = CATEGORIES_TABLE; - $idfield = 'cat_id'; - $orderfield = 'cat_order'; - $cat = 0; - break; - - case 'forum': - $table = FORUMS_TABLE; - $idfield = 'forum_id'; - $orderfield = 'forum_order'; - $catfield = 'cat_id'; - break; - - default: - message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); - break; - } - - $sql = "SELECT * FROM $table"; - if( $cat != 0) - { - $sql .= " WHERE $catfield = $cat"; - } - $sql .= " ORDER BY $orderfield ASC"; - - - if( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't get list of Categories", "", __LINE__, __FILE__, $sql); - } - - $i = 10; - $inc = 10; - - while( $row = $db->sql_fetchrow($result) ) - { - $sql = "UPDATE $table - SET $orderfield = $i - WHERE $idfield = " . $row[$idfield]; - if( !$db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql); - } - $i += 10; - } - -} -// -// End function block -// ------------------ - // // Begin program proper // -if( isset($HTTP_POST_VARS['addforum']) || isset($HTTP_POST_VARS['addcategory']) ) +if ( isset($HTTP_POST_VARS['addforum']) || isset($HTTP_POST_VARS['addcategory']) ) { $mode = ( isset($HTTP_POST_VARS['addforum']) ) ? "addforum" : "addcat"; @@ -240,7 +77,7 @@ if( isset($HTTP_POST_VARS['addforum']) || isset($HTTP_POST_VARS['addcategory']) } } -if( !empty($mode) ) +if ( !empty($mode) ) { switch($mode) { @@ -831,6 +668,41 @@ if( !empty($mode) ) } } +page_header($lang['Manage']); + + +?> + +

Manage

+ +

Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum. In phpBB 2.2 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category).

+ +
+ + + + + + + + + + + + + + + + + + + + +
Forum Name   
   
  
+ +set_filenames(array( ); $template->assign_vars(array( - 'S_FORUM_ACTION' => append_sid("admin_forums.$phpEx"), + 'S_FORUM_ACTION' => "admin_forums.$phpEx$SID", 'L_FORUM_TITLE' => $lang['Forum_admin'], 'L_FORUM_EXPLAIN' => $lang['Forum_admin_explain'], 'L_CREATE_FORUM' => $lang['Create_forum'], @@ -854,22 +726,15 @@ $template->assign_vars(array( $sql = "SELECT cat_id, cat_title, cat_order FROM " . CATEGORIES_TABLE . " ORDER BY cat_order"; -if( !$q_categories = $db->sql_query($sql) ) -{ - message_die(GENERAL_ERROR, "Could not query categories list", "", __LINE__, __FILE__, $sql); -} +$q_categories = $db->sql_query($sql); -if( $total_categories = $db->sql_numrows($q_categories) ) +if ( $category_rows = $db->sql_fetchrowset($q_categories) ) { - $category_rows = $db->sql_fetchrowset($q_categories); $sql = "SELECT * FROM " . FORUMS_TABLE . " ORDER BY cat_id, forum_order"; - if(!$q_forums = $db->sql_query($sql)) - { - message_die(GENERAL_ERROR, "Could not query forums information", "", __LINE__, __FILE__, $sql); - } + $q_forums = $db->sql_query($sql); if( $total_forums = $db->sql_numrows($q_forums) ) { @@ -892,18 +757,18 @@ if( $total_categories = $db->sql_numrows($q_categories) ) 'CAT_ID' => $cat_id, 'CAT_DESC' => $category_rows[$i]['cat_title'], - 'U_CAT_EDIT' => append_sid("admin_forums.$phpEx?mode=editcat&" . POST_CAT_URL . "=$cat_id"), - 'U_CAT_DELETE' => append_sid("admin_forums.$phpEx?mode=deletecat&" . POST_CAT_URL . "=$cat_id"), - 'U_CAT_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=cat_order&move=-15&" . POST_CAT_URL . "=$cat_id"), - 'U_CAT_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=cat_order&move=15&" . POST_CAT_URL . "=$cat_id"), - 'U_VIEWCAT' => append_sid($phpbb_root_path."index.$phpEx?" . POST_CAT_URL . "=$cat_id")) + 'U_CAT_EDIT' => "admin_forums.$phpEx$SID&mode=editcat&c=$cat_id", + 'U_CAT_DELETE' => "admin_forums.$phpEx$SID&mode=deletecat&c=$cat_id", + 'U_CAT_MOVE_UP' => "admin_forums.$phpEx$SID&mode=cat_order&move=-15&c=$cat_id", + 'U_CAT_MOVE_DOWN' => "admin_forums.$phpEx$SID&mode=cat_order&move=15&c=$cat_id", + 'U_VIEWCAT' => $phpbb_root_path."index.$phpEx$SID&c=$cat_id") ); for($j = 0; $j < $total_forums; $j++) { $forum_id = $forum_rows[$j]['forum_id']; - if ($forum_rows[$j]['cat_id'] == $cat_id) + if ( $forum_rows[$j]['cat_id'] == $cat_id ) { $template->assign_block_vars("catrow.forumrow", array( @@ -913,12 +778,12 @@ if( $total_categories = $db->sql_numrows($q_categories) ) 'NUM_TOPICS' => $forum_rows[$j]['forum_topics'], 'NUM_POSTS' => $forum_rows[$j]['forum_posts'], - 'U_VIEWFORUM' => append_sid($phpbb_root_path."viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_EDIT' => append_sid("admin_forums.$phpEx?mode=editforum&" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_DELETE' => append_sid("admin_forums.$phpEx?mode=deleteforum&" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=forum_order&move=-15&" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&move=15&" . POST_FORUM_URL . "=$forum_id"), - 'U_FORUM_RESYNC' => append_sid("admin_forums.$phpEx?mode=forum_sync&" . POST_FORUM_URL . "=$forum_id")) + 'U_VIEWFORUM' => $phpbb_root_path."viewforum.$phpEx$SID&f=$forum_id", + 'U_FORUM_EDIT' => "admin_forums.$$SID&mode=editforum&f=$forum_id", + 'U_FORUM_DELETE' => "admin_forums.$phpEx$SID&mode=deleteforum&f=$forum_id", + 'U_FORUM_MOVE_UP' => "admin_forums.$phpEx$SID&mode=forum_order&move=-15&f=$forum_id", + 'U_FORUM_MOVE_DOWN' => "admin_forums.$phpEx$SID&mode=forum_order&move=15&f=$forum_id", + 'U_FORUM_RESYNC' => "admin_forums.$phpEx$SID&mode=forum_sync&f=$forum_id") ); }// if ... forumid == catid @@ -929,8 +794,171 @@ if( $total_categories = $db->sql_numrows($q_categories) ) }// if ... total_categories -$template->pparse("body"); +page_footer(); -include('page_footer_admin.'.$phpEx); +// +// END +// -?> +// ------------------ +// Begin function block +// +function get_info($mode, $id) +{ + global $db; + + switch($mode) + { + case 'category': + $table = CATEGORIES_TABLE; + $idfield = 'cat_id'; + $namefield = 'cat_title'; + break; + + case 'forum': + $table = FORUMS_TABLE; + $idfield = 'forum_id'; + $namefield = 'forum_name'; + break; + + default: + message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); + break; + } + $sql = "SELECT count(*) as total + FROM $table"; + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql); + } + $count = $db->sql_fetchrow($result); + $count = $count['total']; + + $sql = "SELECT * + FROM $table + WHERE $idfield = $id"; + + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't get Forum/Category information", "", __LINE__, __FILE__, $sql); + } + + if( $db->sql_numrows($result) != 1 ) + { + message_die(GENERAL_ERROR, "Forum/Category doesn't exist or multiple forums/categories with ID $id", "", __LINE__, __FILE__); + } + + $return = $db->sql_fetchrow($result); + $return['number'] = $count; + return $return; +} + +function get_list($mode, $id, $select) +{ + global $db; + + switch($mode) + { + case 'category': + $table = CATEGORIES_TABLE; + $idfield = 'cat_id'; + $namefield = 'cat_title'; + break; + + case 'forum': + $table = FORUMS_TABLE; + $idfield = 'forum_id'; + $namefield = 'forum_name'; + break; + + default: + message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); + break; + } + + $sql = "SELECT * + FROM $table"; + if( $select == 0 ) + { + $sql .= " WHERE $idfield <> $id"; + } + + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't get list of Categories/Forums", "", __LINE__, __FILE__, $sql); + } + + $cat_list = ""; + + while( $row = $db->sql_fetchrow($result) ) + { + $s = ""; + if ($row[$idfield] == $id) + { + $s = " selected=\"selected\""; + } + $catlist .= "\n"; + } + + return($catlist); +} + +function renumber_order($mode, $cat = 0) +{ + global $db; + + switch($mode) + { + case 'category': + $table = CATEGORIES_TABLE; + $idfield = 'cat_id'; + $orderfield = 'cat_order'; + $cat = 0; + break; + + case 'forum': + $table = FORUMS_TABLE; + $idfield = 'forum_id'; + $orderfield = 'forum_order'; + $catfield = 'cat_id'; + break; + + default: + message_die(GENERAL_ERROR, "Wrong mode for generating select list", "", __LINE__, __FILE__); + break; + } + + $sql = "SELECT * FROM $table"; + if( $cat != 0) + { + $sql .= " WHERE $catfield = $cat"; + } + $sql .= " ORDER BY $orderfield ASC"; + + + if( !$result = $db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't get list of Categories", "", __LINE__, __FILE__, $sql); + } + + $i = 10; + $inc = 10; + + while( $row = $db->sql_fetchrow($result) ) + { + $sql = "UPDATE $table + SET $orderfield = $i + WHERE $idfield = " . $row[$idfield]; + if( !$db->sql_query($sql) ) + { + message_die(GENERAL_ERROR, "Couldn't update order fields", "", __LINE__, __FILE__, $sql); + } + $i += 10; + } + +} +// +// End function block +// ------------------ + +?> \ No newline at end of file diff --git a/phpBB/admin/admin_permissions.php b/phpBB/admin/admin_permissions.php index 96b5ab711f..9230f63828 100644 --- a/phpBB/admin/admin_permissions.php +++ b/phpBB/admin/admin_permissions.php @@ -29,6 +29,7 @@ if ( !empty($setmodules) ) $filename = basename(__FILE__); $module['Forums']['Permissions'] = $filename . $SID . '&mode=forums'; $module['Forums']['Moderators'] = $filename . $SID . '&mode=moderators'; + $module['Forums']['Super_Moderators'] = $filename . $SID . '&mode=supermoderators'; $module['General']['Administrators'] = $filename . $SID . '&mode=administrators'; return; @@ -60,7 +61,7 @@ if ( isset($HTTP_GET_VARS['f']) || isset($HTTP_POST_VARS['f']) ) } else { - unset($forum_id); + $forum_id = 0; $forum_sql = ''; } @@ -81,6 +82,11 @@ switch ( $mode ) $l_title_explain = $lang['Moderators_explain']; $l_can = '_can'; break; + case 'supermoderators': + $l_title = $lang['Super_Moderators']; + $l_title_explain = $lang['Super_Moderators_explain']; + $l_can = '_can'; + break; case 'administrators': $l_title = $lang['Administrators']; $l_title_explain = $lang['Administrators_explain']; @@ -93,12 +99,15 @@ if ( isset($HTTP_POST_VARS['update']) ) switch ( $HTTP_POST_VARS['type'] ) { case 'group': - $acl->set_acl(15, false, 7530, $HTTP_POST_VARS['option']); + foreach ( $HTTP_POST_VARS['entries'] as $group_id ) + { + $acl->set_acl($forum_id, false, $group_id, $HTTP_POST_VARS['option']); + } break; case 'user': foreach ( $HTTP_POST_VARS['entries'] as $user_id ) { - $acl->set_acl(intval($HTTP_POST_VARS['f']), $user_id, false, $HTTP_POST_VARS['option']); + $acl->set_acl($forum_id, $user_id, false, $HTTP_POST_VARS['option']); } break; } @@ -109,7 +118,7 @@ if ( isset($HTTP_POST_VARS['update']) ) // no id was specified or just the requsted if it // was // -if ( !empty($forum_id) || $mode == 'administrators' ) +if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators' ) { // // Clear some vars, grab some info if relevant ... @@ -139,29 +148,30 @@ if ( !empty($forum_id) || $mode == 'administrators' )

+

+ sql_fetchrow($result) ) { - $group_list .= ''; + $group_list .= ''; } $db->sql_freeresult($result); @@ -189,7 +199,7 @@ if ( !empty($forum_id) || $mode == 'administrators' ) -
"> +
">sql_fetchrow($result) ) { - $groups .= ''; + $groups .= ''; } $db->sql_freeresult($result); @@ -287,7 +297,7 @@ if ( !empty($forum_id) || $mode == 'administrators' ) else { - $sql = "SELECT auth_option + $sql = "SELECT auth_option_id, auth_option FROM " . ACL_OPTIONS_TABLE . " WHERE auth_type LIKE '$type_sql'"; $result = $db->sql_query($sql); @@ -332,10 +342,11 @@ if ( !empty($forum_id) || $mode == 'administrators' ) $auth = array(); while ( $row = $db->sql_fetchrow($result) ) { - $ug_test = ( $row['name'] == 'ADMINISTRATORS' ) ? $lang['Admin_group'] : $row['name']; + $ug_test = ( !empty($lang[$row['name']]) ) ? $lang[$row['name']] : $row['name']; $ug .= ( !strstr($ug, $ug_test) ) ? $ug_test . "\n" : ''; + $ug_test = ''; - $ug_hidden = ( !strstr($ug_hidden, $ug_test) ) ? $ug_test : ''; + $ug_hidden .= ( !strstr($ug_hidden, $ug_test) ) ? $ug_test : ''; $auth[$row['auth_option']] = ( isset($auth_group[$row['auth_option']]) ) ? min($auth_group[$row['auth_option']], $row['auth_allow_deny']) : $row['auth_allow_deny']; } @@ -363,8 +374,8 @@ if ( !empty($forum_id) || $mode == 'administrators' ) ?> - - + +

+

+ ">
/> /> /> />
diff --git a/phpBB/admin/admin_prune.php b/phpBB/admin/admin_prune.php index 1660749a1f..f1b531cb7d 100644 --- a/phpBB/admin/admin_prune.php +++ b/phpBB/admin/admin_prune.php @@ -122,7 +122,7 @@ if ( isset($HTTP_POST_VARS['doprune']) ) } else { - page_header($lang['Forums']); + page_header($lang['Prune']); // // If they haven't selected a forum for pruning yet then @@ -145,7 +145,7 @@ else

-">
+">
@@ -174,7 +174,7 @@ else

-">
+">
@@ -191,10 +191,6 @@ else } } -// -// Actually output the page here. -// - page_footer(); ?> \ No newline at end of file diff --git a/phpBB/admin/admin_prune_users.php b/phpBB/admin/admin_prune_users.php index 211288083b..1169c4415d 100644 --- a/phpBB/admin/admin_prune_users.php +++ b/phpBB/admin/admin_prune_users.php @@ -69,7 +69,7 @@ if ( isset($HTTP_POST_VARS['prune']) ) { $values = array('prune', 'deactivate', 'delete', 'users', 'username', 'email', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'deleteposts'); - $l_message = '' . $lang['Confirm_prune_users'] . '

  '; + $l_message = '' . $lang['Confirm_prune_users'] . '

  '; foreach ( $values as $field ) { @@ -92,7 +92,7 @@ if ( isset($HTTP_POST_VARS['prune']) ) page_footer(); } - else if ( isset($HTTP_POST_VARS['yes']) ) + else if ( isset($HTTP_POST_VARS['confirm']) ) { if ( !empty($HTTP_POST_VARS['users']) ) { @@ -192,7 +192,7 @@ if ( isset($HTTP_POST_VARS['prune']) ) unset($user_ids); unset($usernames); - } + } message_die(MESSAGE, $lang['Success_user_prune']); } diff --git a/phpBB/admin/admin_search.php b/phpBB/admin/admin_search.php index 998955d401..9adfa2cae4 100644 --- a/phpBB/admin/admin_search.php +++ b/phpBB/admin/admin_search.php @@ -295,7 +295,7 @@ if ( isset($HTTP_POST_VARS['start']) || isset($HTTP_GET_VARS['batchstart']) ) WHERE config_name = 'board_disable'"; $db->sql_query($sql); - page_header($lang['DB']); + page_header($lang['Search_indexing']); ?> @@ -319,7 +319,7 @@ else if ( isset($HTTP_POST_VARS['cancel']) ) WHERE config_name = 'board_disable'"; $db->sql_query($sql); - page_header($lang['DB']); + page_header($lang['Search_indexing']); ?> @@ -334,7 +334,7 @@ else if ( isset($HTTP_POST_VARS['cancel']) ) } else { - page_header($lang['DB']); + page_header($lang['Search_indexing']); ?> diff --git a/phpBB/admin/admin_smilies.php b/phpBB/admin/admin_smilies.php index 7f212425a3..c930c3edc8 100644 --- a/phpBB/admin/admin_smilies.php +++ b/phpBB/admin/admin_smilies.php @@ -19,9 +19,6 @@ * ***************************************************************************/ -// -// First we do the setmodules stuff for the admin cp. -// if ( !empty($setmodules) ) { if ( !$acl->get_acl_admin('general') ) @@ -30,25 +27,27 @@ if ( !empty($setmodules) ) } $filename = basename(__FILE__); - $module['General']['Emoticons'] = $filename . $SID . "&mode=emoticons"; + $module['General']['Emoticons'] = $filename . $SID . '&mode=emoticons'; return; } define('IN_PHPBB', 1); +// +// Include files +// $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); // -// +// Do we have general permissions? // if ( !$acl->get_acl_admin('general') ) { message_die(MESSAGE, $lang['No_admin']); } - // // Check to see what mode we should operate in. // @@ -70,11 +69,11 @@ $dir = @opendir($phpbb_root_path . $board_config['smilies_path']); while( $file = @readdir($dir) ) { - if ( !is_dir($phpbb_root_path . $board_config['smilies_path'] . '/' . $file) ) + if ( is_file($phpbb_root_path . $board_config['smilies_path'] . '/' . $file) ) { $img_size = @getimagesize($phpbb_root_path . $board_config['smilies_path'] . '/' . $file); - if( $img_size[0] && $img_size[1] ) + if ( $img_size[0] && $img_size[1] ) { $smiley_images[] = $file; } @@ -97,14 +96,14 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' // $smile_pak = ( isset($HTTP_POST_VARS['smile_pak']) ) ? $HTTP_POST_VARS['smile_pak'] : $HTTP_GET_VARS['smile_pak']; $clear_current = ( isset($HTTP_POST_VARS['clear_current']) ) ? $HTTP_POST_VARS['clear_current'] : $HTTP_GET_VARS['clear_current']; - $replace_existing = ( isset($HTTP_POST_VARS['replace']) ) ? $HTTP_POST_VARS['replace'] : $HTTP_GET_VARS['replace']; + $replace_existing = ( isset($HTTP_POST_VARS['replace']) ) ? intval($HTTP_POST_VARS['replace']) : intval($HTTP_GET_VARS['replace']); if ( !empty($smile_pak) ) { // // The user has already selected a smile_pak file.. Import it. // - if( !empty($clear_current) ) + if ( !empty($clear_current) ) { $sql = "DELETE FROM " . SMILIES_TABLE; @@ -141,13 +140,12 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' // // Replace > and < with the proper html_entities for matching. // - $smile_data[$j] = str_replace("<", "<", $smile_data[$j]); - $smile_data[$j] = str_replace(">", ">", $smile_data[$j]); + $smile_data[$j] = htmlentities($smile_data[$j]); $k = $smile_data[$j]; - if( $smiles[$k] == 1 ) + if ( $smiles[$k] == 1 ) { - if( !empty($replace_existing) ) + if ( !empty($replace_existing) ) { $sql = "UPDATE " . SMILIES_TABLE . " SET smile_url = '" . str_replace("\'", "''", $smile_data[0]) . "', emoticon = '" . str_replace("\'", "''", $smile_data[1]) . "' @@ -171,7 +169,7 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' } } - message_die(GENERAL_MESSAGE, $lang['smiley_import_success']); + message_die(MESSAGE, $lang['smiley_import_success']); } else @@ -180,7 +178,8 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack' // Display the script to get the smile_pak cfg file... // $smile_paks_select = " - + diff --git a/phpBB/admin/admin_styles.php b/phpBB/admin/admin_styles.php index d46f61fedd..afe37454c4 100644 --- a/phpBB/admin/admin_styles.php +++ b/phpBB/admin/admin_styles.php @@ -197,7 +197,7 @@ switch ( $mode ) { $tpl = substr($file, 0, strpos($file, '.')); $selected = ( $tplname == $tpl ) ? ' selected="selected"' : ''; - $tplname_options .= ''; + $tplname_options .= ''; } } closedir($dp); @@ -217,7 +217,7 @@ switch ( $mode )

:  

-
<?php echo htmlspecialchars($row['code']); ?><?php echo htmlspecialchars($row['code']); ?> "> ">
+
@@ -242,7 +242,7 @@ switch ( $mode ) case 'edittheme': - $theme_id = ( isset($HTTP_POST_VARS['theme_id']) ) ? $HTTP_POST_VARS['theme_id'] : ''; + $theme_id = ( isset($HTTP_POST_VARS['themeroot']) ) ? $HTTP_POST_VARS['themeroot'] : ''; if ( isset($HTTP_POST_VARS['update']) ) { @@ -256,9 +256,9 @@ switch ( $mode ) $theme_name = $row['theme_name']; $css_data = ( !empty($HTTP_POST_VARS['css_data']) ) ? htmlentities($HTTP_POST_VARS['css_data']) : ''; - $css_external = ( !empty($HTTP_POST_VARS['css_external']) ) ? $HTTP_POST_VARS['css_external'] : ''; + $css_external = ( !empty($HTTP_POST_VARS['css_data']) ) ? $HTTP_POST_VARS['css_data'] : ''; - $sql = "UPDATE " . STYLES_CSS_TABLE . " + $sql = "UPDATE " > STYLES_CSS_TABLE . " SET css_data = '$css_data', css_external = '$css_external' WHERE theme_id = $theme_id"; $db->sql_query($sql); @@ -285,24 +285,9 @@ switch ( $mode ) while ( $row = $db->sql_fetchrow($result) ); } $db->sql_freeresult($result); - -?> - -"> - -

- -

- -
- - - - - - - + +"> + +

+ +

+ +
:  
+ + + @@ -329,14 +327,6 @@ switch ( $mode )
:  
:
- - - sql_fetchrow($result) ) { $selected = ( $tplroot == $row['template_path'] ) ? ' selected="selected"' : ''; - $tplroot_options .= ''; + $tplroot_options .= ''; } return $tplroot_options; diff --git a/phpBB/admin/admin_users.php b/phpBB/admin/admin_users.php index 1562c65476..378636dbd9 100644 --- a/phpBB/admin/admin_users.php +++ b/phpBB/admin/admin_users.php @@ -1012,42 +1012,28 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($HTTP_POST_VARS['username']) } else { - // - // Default user selection box - // - $sql = "SELECT user_id, username - FROM " . USERS_TABLE . " - WHERE user_id <> " . ANONYMOUS ." - ORDER BY username"; - $result = $db->sql_query($sql); - $select_list = ''; + page_header($lang['Manage']); - $template->set_filenames(array( - 'body' => 'admin/user_select_body.tpl') - ); +?> - $template->assign_vars(array( - 'L_USER_TITLE' => $lang['User_admin'], - 'L_USER_EXPLAIN' => $lang['User_admin_explain'], - 'L_USER_SELECT' => $lang['Select_a_User'], - 'L_LOOK_UP' => $lang['Look_up_user'], - 'L_FIND_USERNAME' => $lang['Find_username'], +

- 'U_SEARCH_USER' => "../search.$phpEx$SID&mode=searchuser", +

- 'S_USER_ACTION' => "admin_users.$phpEx$SID", - 'S_USER_SELECT' => $select_list) - ); - $template->display('body'); +
"> + + + + + + +
', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" />
+ + \ No newline at end of file diff --git a/phpBB/admin/admin_viewlogs.php b/phpBB/admin/admin_viewlogs.php index c31e04fa47..e09a98030f 100644 --- a/phpBB/admin/admin_viewlogs.php +++ b/phpBB/admin/admin_viewlogs.php @@ -181,7 +181,7 @@ page_header($l_title);

-
"> +"> - +
: :
'; } - page_header($lang['General']); + page_header($lang['Words_title']); ?> @@ -106,7 +106,7 @@ if( $mode != '' )

-"> +">
@@ -128,7 +128,7 @@ if( $mode != '' ) break; case 'save': - $word_id = ( isset($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : 0; + $word_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : 0; $word = ( isset($HTTP_POST_VARS['word']) ) ? trim($HTTP_POST_VARS['word']) : ''; $replacement = ( isset($HTTP_POST_VARS['replacement']) ) ? trim($HTTP_POST_VARS['replacement']) : ''; @@ -144,8 +144,6 @@ if( $mode != '' ) add_admin_log($log_action, stripslashes($word)); $message = ( $word_id ) ? $lang['Word_updated'] : $lang['Word_added']; - $message .= '

' . sprintf($lang['Click_return_wordadmin'], '', '') . '

' . sprintf($lang['Click_return_admin_index'], '', ''); - message_die(MESSAGE, $message); break; @@ -153,7 +151,7 @@ if( $mode != '' ) if ( isset($HTTP_POST_VARS['id']) || isset($HTTP_GET_VARS['id']) ) { - $word_id = ( isset($HTTP_POST_VARS['id']) ) ? $HTTP_POST_VARS['id'] : $HTTP_GET_VARS['id']; + $word_id = ( isset($HTTP_POST_VARS['id']) ) ? intval($HTTP_POST_VARS['id']) : intval($HTTP_GET_VARS['id']); } else { @@ -166,9 +164,7 @@ if( $mode != '' ) add_admin_log('log_delete_word'); - $message = $lang['Word_removed'] . '

' . sprintf($lang['Click_return_wordadmin'], '', '') . '

' . sprintf($lang['Click_return_admin_index'], '', ''); - - message_die(MESSAGE, $message); + message_die(MESSAGE, $lang['Word_removed']); break; } @@ -176,7 +172,7 @@ if( $mode != '' ) else { - page_header($lang['General']); + page_header($lang['Words_title']); ?> @@ -184,7 +180,7 @@ else

-">
+">
@@ -202,14 +198,14 @@ else { do { - $cell_bg = ( $cell_bg == 'row1' ) ? 'row2' : 'row1'; + $row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1'; ?> - - - - + + + + Group +INSERT INTO phpbb_user_group (group_id, user_id, user_pending) VALUES (1, -1, 0); INSERT INTO phpbb_user_group (group_id, user_id, user_pending) VALUES (1, 2, 0); -INSERT INTO phpbb_user_group (group_id, user_id, user_pending) VALUES (2, 2, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending) VALUES (5, 2, 0); # -- User auth -INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_allow_deny) SELECT -1, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_type LIKE 'forum' AND auth_option IN ('list', 'read', 'post', 'reply'); # -- Group auth -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_allow_deny) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_type IN ('admin'); -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_allow_deny) SELECT 1, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_type IN ('forum'); +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_allow_deny) SELECT 1, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_type IN ('forum') AND auth_option IN ('list', 'read', 'post', 'reply'); +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_allow_deny) SELECT 2, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_type IN ('forum'); +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_allow_deny) SELECT 5, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_type IN ('admin'); # -- Prefetch auth INSERT INTO phpbb_auth_prefetch (user_id, forum_id, auth_option_id, auth_allow_deny) SELECT -1, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_type LIKE 'forum' AND auth_option IN ('list', 'read', 'post', 'reply'); @@ -202,29 +209,22 @@ INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':D', 'icon_biggr INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':-D', 'icon_biggrin.gif', 'Very Happy'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':grin:', 'icon_biggrin.gif', 'Very Happy'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':)', 'icon_smile.gif', 'Smile'); -INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':-)', 'icon_smile.gif', 'Smile'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':smile:', 'icon_smile.gif', 'Smile'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':(', 'icon_sad.gif', 'Sad'); -INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':-(', 'icon_sad.gif', 'Sad'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':sad:', 'icon_sad.gif', 'Sad'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':o', 'icon_surprised.gif', 'Surprised'); -INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':-o', 'icon_surprised.gif', 'Surprised'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':eek:', 'icon_surprised.gif', 'Surprised'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( '8O', 'icon_eek.gif', 'Shocked'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( '8-O', 'icon_eek.gif', 'Shocked'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':shock:', 'icon_eek.gif', 'Shocked'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':?', 'icon_confused.gif', 'Confused'); -INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':-?', 'icon_confused.gif', 'Confused'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':???:', 'icon_confused.gif', 'Confused'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( '8)', 'icon_cool.gif', 'Cool'); -INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( '8-)', 'icon_cool.gif', 'Cool'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':cool:', 'icon_cool.gif', 'Cool'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':lol:', 'icon_lol.gif', 'Laughing'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':x', 'icon_mad.gif', 'Mad'); -INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':-x', 'icon_mad.gif', 'Mad'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':mad:', 'icon_mad.gif', 'Mad'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':P', 'icon_razz.gif', 'Razz'); -INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':-P', 'icon_razz.gif', 'Razz'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':razz:', 'icon_razz.gif', 'Razz'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':oops:', 'icon_redface.gif', 'Embarassed'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':cry:', 'icon_cry.gif', 'Crying or Very sad'); @@ -233,13 +233,11 @@ INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':twisted:', 'ico INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':roll:', 'icon_rolleyes.gif', 'Rolling Eyes'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':wink:', 'icon_wink.gif', 'Wink'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ';)', 'icon_wink.gif', 'Wink'); -INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ';-)', 'icon_wink.gif', 'Wink'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':!:', 'icon_exclaim.gif', 'Exclamation'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':?:', 'icon_question.gif', 'Question'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':idea:', 'icon_idea.gif', 'Idea'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':arrow:', 'icon_arrow.gif', 'Arrow'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':|', 'icon_neutral.gif', 'Neutral'); -INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':-|', 'icon_neutral.gif', 'Neutral'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':neutral:', 'icon_neutral.gif', 'Neutral'); INSERT INTO phpbb_smilies (code, smile_url, emoticon) VALUES ( ':mrgreen:', 'icon_mrgreen.gif', 'Mr. Green'); diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 7970c73693..644b909469 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -109,16 +109,6 @@ CREATE TABLE phpbb_config ( ); -# -------------------------------------------------------- -# -# Table structure for table 'phpbb_config_defaults' -# -CREATE TABLE phpbb_config_defaults ( - config_name varchar(255) NOT NULL, - config_value varchar(255) NOT NULL, - PRIMARY KEY (config_name) -); - # -------------------------------------------------------- # # Table structure for table 'phpbb_disallow' <- combine with banlist @@ -624,6 +614,7 @@ CREATE TABLE phpbb_users ( user_id mediumint(8) NOT NULL auto_increment, user_active tinyint(1) DEFAULT '1', + user_founder tintyint(1) DEFAULT '0' NOT NULL, user_ip varchar(40), user_regdate int(11) DEFAULT '0' NOT NULL, username varchar(30) NOT NULL, diff --git a/phpBB/modcp.php b/phpBB/modcp.php index d0bdc7bba1..3e66729246 100644 --- a/phpBB/modcp.php +++ b/phpBB/modcp.php @@ -8,7 +8,6 @@ * * $Id$ * - * ***************************************************************************/ /*************************************************************************** @@ -20,15 +19,6 @@ * ***************************************************************************/ -/** - * Moderator Control Panel - * - * From this 'Control Panel' the moderator of a forum will be able to do - * mass topic operations (locking/unlocking/moving/deleteing), and it will - * provide an interface to do quick locking/unlocking/moving/deleting of - * topics via the moderator operations buttons on all of the viewtopic pages. - */ - define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); @@ -36,46 +26,37 @@ include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'includes/bbcode.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); -// -// Start session management -// -$userdata = $session->start(); -$acl = new auth('forum', $userdata); -// -// End session management -// - // // Obtain initial var settings // -if ( isset($HTTP_GET_VARS[POST_FORUM_URL]) || isset($HTTP_POST_VARS[POST_FORUM_URL]) ) +if ( isset($HTTP_GET_VARS['f']) || isset($HTTP_POST_VARS['f']) ) { - $forum_id = (isset($HTTP_POST_VARS[POST_FORUM_URL])) ? intval($HTTP_POST_VARS[POST_FORUM_URL]) : intval($HTTP_GET_VARS[POST_FORUM_URL]); + $forum_id = (isset($HTTP_POST_VARS['f'])) ? intval($HTTP_POST_VARS['f']) : intval($HTTP_GET_VARS['f']); } else { $forum_id = ''; } -if ( isset($HTTP_GET_VARS[POST_POST_URL]) || isset($HTTP_POST_VARS[POST_POST_URL]) ) +if ( isset($HTTP_GET_VARS['p']) || isset($HTTP_POST_VARS['p']) ) { - $post_id = (isset($HTTP_POST_VARS[POST_POST_URL])) ? intval($HTTP_POST_VARS[POST_POST_URL]) : intval($HTTP_GET_VARS[POST_POST_URL]); + $post_id = (isset($HTTP_POST_VARS['p'])) ? intval($HTTP_POST_VARS['p']) : intval($HTTP_GET_VARS['p']); } else { $post_id = ''; } -if ( isset($HTTP_GET_VARS[POST_TOPIC_URL]) || isset($HTTP_POST_VARS[POST_TOPIC_URL]) ) +if ( isset($HTTP_GET_VARS['t']) || isset($HTTP_POST_VARS['t']) ) { - $topic_id = (isset($HTTP_POST_VARS[POST_TOPIC_URL])) ? intval($HTTP_POST_VARS[POST_TOPIC_URL]) : intval($HTTP_GET_VARS[POST_TOPIC_URL]); + $topic_id = (isset($HTTP_POST_VARS['t'])) ? intval($HTTP_POST_VARS['t']) : intval($HTTP_GET_VARS['t']); } else { $topic_id = ''; } -$confirm = ( $HTTP_POST_VARS['confirm'] ) ? TRUE : 0; +$confirm = ( !empty($HTTP_POST_VARS['confirm']) ) ? TRUE : 0; // // Check if user did or did not confirm @@ -85,11 +66,11 @@ if ( isset($HTTP_POST_VARS['cancel']) ) { if ( $topic_id ) { - $redirect = "viewtopic.$phpEx$SID&" . POST_TOPIC_URL . "=$topic_id"; + $redirect = "viewtopic.$phpEx$SID&t=$topic_id"; } else if ( $forum_id ) { - $redirect = "viewforum.$phpEx$SID&" . POST_FORUM_URL . "=$forum_id"; + $redirect = "viewforum.$phpEx$SID&f=$forum_id"; } else { @@ -98,6 +79,7 @@ if ( isset($HTTP_POST_VARS['cancel']) ) $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . $redirect); + exit; } // @@ -138,6 +120,16 @@ else } } +// +// Start session management +// +$userdata = $session->start(); +$acl = new auth('forum', $userdata, $forum_id); +// +// End session management +// +$session->configure($userdata); + // // Obtain relevant data // @@ -147,10 +139,8 @@ if ( !empty($topic_id) ) FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f WHERE t.topic_id = " . $topic_id . " AND f.forum_id = t.forum_id"; - if ( !($result = $db->sql_query($sql)) ) - { - message_die(GENERAL_MESSAGE, 'Topic_post_not_exist'); - } + $result = $db->sql_query($sql); + $topic_row = $db->sql_fetchrow($result); $forum_topics = ( $topic_row['forum_topics'] == 0 ) ? 1 : $topic_row['forum_topics']; @@ -162,10 +152,8 @@ else if ( !empty($forum_id) ) $sql = "SELECT forum_name, forum_topics FROM " . FORUMS_TABLE . " WHERE forum_id = " . $forum_id; - if ( !($result = $db->sql_query($sql)) ) - { - message_die(GENERAL_MESSAGE, 'Forum_not_exist'); - } + $result = $db->sql_query($sql); + $topic_row = $db->sql_fetchrow($result); $forum_topics = ( $topic_row['forum_topics'] == 0 ) ? 1 : $topic_row['forum_topics']; @@ -173,7 +161,7 @@ else if ( !empty($forum_id) ) } else { - message_die(GENERAL_MESSAGE, 'Forum_not_exist'); + message_die(MESSAGE, 'Forum_not_exist'); } // @@ -181,7 +169,7 @@ else // if ( !$acl->get_acl($forum_id, 'mod') ) { - message_die(GENERAL_MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']); + message_die(MESSAGE, $lang['Not_Moderator'], $lang['Not_Authorised']); } // @@ -202,16 +190,13 @@ switch( $mode ) $topic_id_sql = ''; for($i = 0; $i < count($topics); $i++) { - $topic_id_sql .= ( ( $topic_id_sql != '' ) ? ', ' : '' ) . $topics[$i]; + $topic_id_sql .= ( ( $topic_id_sql != '' ) ? ', ' : '' ) . intval($topics[$i]); } $sql = "SELECT post_id FROM " . POSTS_TABLE . " WHERE topic_id IN ($topic_id_sql)"; - if ( !$result = $db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, 'Could not get post id information', '', __LINE__, __FILE__, $sql); - } + $result = $db->sql_query($sql); $post_id_sql = ''; while ( $row = $db->sql_fetchrow($result) ) @@ -223,10 +208,7 @@ switch( $mode ) $sql = "SELECT vote_id FROM " . VOTE_DESC_TABLE . " WHERE topic_id IN ($topic_id_sql)"; - if ( !($result = $db->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Could not get vote id information', '', __LINE__, __FILE__, $sql); - } + $result = $db->sql_query($sql); $vote_id_sql = ''; while ( $row = $db->sql_fetchrow($result) ) @@ -252,18 +234,12 @@ switch( $mode ) $sql = "DELETE FROM " . POSTS_TABLE . " WHERE post_id IN ($post_id_sql)"; - if ( !$db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, 'Could not delete posts', '', __LINE__, __FILE__, $sql); - } + $db->sql_query($sql); $sql = "DELETE FROM " . POSTS_TEXT_TABLE . " WHERE post_id IN ($post_id_sql)"; - if ( !$db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, 'Could not delete posts text', '', __LINE__, __FILE__, $sql); - } + $db->sql_query($sql); remove_search_post($post_id_sql); } @@ -273,26 +249,17 @@ switch( $mode ) $sql = "DELETE FROM " . VOTE_DESC_TABLE . " WHERE vote_id IN ($vote_id_sql)"; - if ( !$db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, 'Could not delete vote descriptions', '', __LINE__, __FILE__, $sql); - } + $db->sql_query($sql); $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . " WHERE vote_id IN ($vote_id_sql)"; - if ( !$db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, 'Could not delete vote results', '', __LINE__, __FILE__, $sql); - } + $db->sql_query($sql); $sql = "DELETE FROM " . VOTE_USERS_TABLE . " WHERE vote_id IN ($vote_id_sql)"; - if ( !$db->sql_query($sql) ) - { - message_die(GENERAL_ERROR, 'Could not delete vote users', '', __LINE__, __FILE__, $sql); - } + $db->sql_query($sql); } $sql = "DELETE @@ -307,12 +274,12 @@ switch( $mode ) if ( !empty($topic_id) ) { - $redirect_page = append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"); + $redirect_page = "viewforum.$phpEx$SID&f==$forum_id"; $l_redirect = sprintf($lang['Click_return_forum'], '', ''); } else { - $redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id"); + $redirect_page = "modcp.$phpEx$SID&f==$forum_id"; $l_redirect = sprintf($lang['Click_return_modcp'], '', ''); } @@ -320,7 +287,7 @@ switch( $mode ) 'META' => '') ); - message_die(GENERAL_MESSAGE, $lang['Topics_Removed'] . '

' . $l_redirect); + message_die(MESSAGE, $lang['Topics_Removed'] . '

' . $l_redirect); } else { @@ -941,6 +908,11 @@ switch( $mode ) $page_title = $lang['Mod_CP']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); + $template->set_filenames(array( + 'body' => 'modcp_body.html') + ); + make_jumpbox('modcp.'.$phpEx); + $template->assign_vars(array( 'FORUM_NAME' => $forum_name, @@ -956,13 +928,9 @@ switch( $mode ) 'L_LASTPOST' => $lang['Last_Post'], 'L_SELECT' => $lang['Select'], - 'U_VIEW_FORUM' => append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id"), - 'S_HIDDEN_FIELDS' => '', - 'S_MODCP_ACTION' => append_sid("modcp.$phpEx")) - ); - - $template->set_filenames(array( - 'body' => 'modcp_body.tpl') + 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&f=$forum_id", + 'S_HIDDEN_FIELDS' => '', + 'S_MODCP_ACTION' => "modcp.$phpEx$SID") ); // @@ -979,10 +947,7 @@ switch( $mode ) AND p.post_id = t.topic_last_post_id ORDER BY t.topic_type DESC, p.post_time DESC LIMIT $start, " . $board_config['topics_per_page']; - if ( !($result = $db->sql_query($sql)) ) - { - message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql); - } + $result = $db->sql_query($sql); while ( $row = $db->sql_fetchrow($result) ) { @@ -1044,7 +1009,7 @@ switch( $mode ) $topic_title = preg_replace($orig_word, $replacement_word, $topic_title); } - $u_view_topic = append_sid("modcp.$phpEx?mode=split&" . POST_TOPIC_URL . "=$topic_id"); + $u_view_topic = "modcp.$phpEx$SID&mode=split&t=$topic_id"; $topic_replies = $row['topic_replies']; $last_post_time = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']); @@ -1062,15 +1027,14 @@ switch( $mode ) 'L_TOPIC_FOLDER_ALT' => $folder_alt) ); } + $db->sql_freeresult($result); $template->assign_vars(array( - 'PAGINATION' => generate_pagination("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id", $forum_topics, $board_config['topics_per_page'], $start), + 'PAGINATION' => generate_pagination("modcp.$phpEx$SID&f=$forum_id", $forum_topics, $board_config['topics_per_page'], $start), 'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $forum_topics / $board_config['topics_per_page'] )), 'L_GOTO_PAGE' => $lang['Goto_page']) ); - $template->pparse('body'); - break; } diff --git a/phpBB/search.php b/phpBB/search.php index 9f4fd4e457..ea5be19714 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -1304,6 +1304,7 @@ function username_search() global $db, $board_config, $template, $acl, $lang, $theme; global $starttime; + $form = ( !empty($HTTP_GET_VARS['form']) ) ? $HTTP_GET_VARS['form'] : 0; $field = ( isset($HTTP_GET_VARS['field']) ) ? $HTTP_GET_VARS['field'] : 'username'; $start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0; @@ -1392,7 +1393,7 @@ function username_search() $total_users = ( $row = $db->sql_fetchrow($result) ) ? $row['total_users'] : 0; - $pagination = generate_pagination("search.$phpEx$SID&mode=searchuser&field=$field&username=" . urlencode($username) . "&email=" . urlencode($email) . "&icq=$icq&aim=" . urlencode($aim) . "&yahoo=" . urlencode($yahoo) . "&msn=" . urlencode($msn) . "&joined=" . urlencode(implode('-', $joined)) . "&active=" . urlencode(implode('-', $active)) . "&count=$count&sort_order=$sort_order&sort_by=$sort_by&joined_select=$joined_select&active_select=$active_select&count_select=$count_select", $total_users, $board_config['topics_per_page'], $start); + $pagination = generate_pagination("search.$phpEx$SID&mode=searchuser&form=$form&field=$field&username=" . urlencode($username) . "&email=" . urlencode($email) . "&icq=$icq&aim=" . urlencode($aim) . "&yahoo=" . urlencode($yahoo) . "&msn=" . urlencode($msn) . "&joined=" . urlencode(implode('-', $joined)) . "&active=" . urlencode(implode('-', $active)) . "&count=$count&sort_order=$sort_order&sort_by=$sort_by&joined_select=$joined_select&active_select=$active_select&count_select=$count_select", $total_users, $board_config['topics_per_page'], $start); // // @@ -1437,6 +1438,7 @@ function username_search() 'L_MARK_ALL' => $lang['Mark_all'], 'L_UNMARK_ALL' => $lang['Unmark_all'], + 'S_FORM_NAME' => $form, 'S_FIELD_NAME' => $field, 'S_COUNT_OPTIONS' => $s_find_count, 'S_JOINED_TIME_OPTIONS' => $s_find_join_time,
 ">  ">  ">  ">