Various updates

git-svn-id: file:///svn/phpbb/trunk@2816 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-08-03 23:52:33 +00:00
parent 66295f4bda
commit ca71651767
17 changed files with 489 additions and 535 deletions

View file

@ -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 = '<input type="hidden" name="perform" value="backup" /><input type="hidden" name="drop" value="1" /><input type="hidden" name="perform" value="$perform" />';
$s_hidden_fields = '<input type="hidden" name="mode" value="backup" /><input type="hidden" name="drop" value="1" /><input type="hidden" name="mode" value="$mode" />';
page_header($lang['DB']);
page_header($lang['DB_Backup']);
?>
<h1><?php echo $lang['DB_Backup']; ?></h1>
<p><?php echo $lang['Backup_explain']; ?></p>
<form method="post" action="<?php echo "admin_db_utilities.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<form method="post" action="<?php echo "admin_db_utilities.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th colspan="2"><?php echo $lang['Backup_options']; ?></th>
</tr>
<tr>
<td class="row2"><?php echo $lang['Full_backup']; ?></td>
<td class="row2"><input type="radio" name="backup_type" value="full" checked /></td>
<td class="row1"><?php echo $lang['Backup_type']; ?></td>
<td class="row2"><input type="radio" name="backup_type" value="full" checked="checked" /> <?php echo $lang['Full_backup']; ?>&nbsp;&nbsp;<input type="radio" name="backup_type" value="structure" /> <?php echo $lang['Structure_only']; ?>&nbsp;&nbsp;<input type="radio" name="backup_type" value="data" /> <?php echo $lang['Data_only']; ?></td>
</tr>
<tr>
<td class="row1"><?php echo $lang['Structure_backup']; ?></td>
<td class="row1"><input type="radio" name="backup_type" value="structure" /></td>
<td class="row1"><?php echo $lang['Include_search_index']; ?><br /><span class="gensmall"><?php echo $lang['Include_search_index_explain']; ?></span></td>
<td class="row2"><input type="radio" name="ignoresearch" value="0" /> <?php echo $lang['No']; ?>&nbsp;&nbsp;<input type="radio" name="ignoresearch" value="1" checked="checked" /> <?php echo $lang['Yes']; ?></td>
</tr>
<tr>
<td class="row2"><?php echo $lang['Data_backup']; ?></td>
<td class="row2"><input type="radio" name="backup_type" value="data" /></td>
</tr>
<tr>
<td class="row1"><?php echo $lang['Additional_tables']; ?></td>
<td class="row1"><input type="text" name="additional_tables" /></td>
<td class="row1"><?php echo $lang['Additional_tables']; ?><br /><span class="gensmall"><?php echo $lang['Additional_tables_explain']; ?></span></td>
<td class="row2"><input type="text" name="additional_tables" size="40" /></td>
</tr>
<?php
if ( extension_loaded('zlib') )
{
?>
<tr>
<td class="row1"><?php echo $lang['Gzip_compress']; ?></td>
<td class="row1"><?php echo $lang['No']; ?> <input type="radio" name="gzipcompress" value="0" checked /> &nbsp;<?php echo $lang['Yes']; ?> <input type="radio" name="gzipcompress" value="1" /></td>
<td class="row2"><input type="radio" name="gzipcompress" value="0" checked="checked" /> <?php echo $lang['No']; ?>&nbsp;&nbsp;<input type="radio" name="gzipcompress" value="1" /> <?php echo $lang['Yes']; ?></td>
</tr>
<?php
}
?>
<tr>
<td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="backupstart" value="<?php echo $lang['Start_backup']; ?>" class="mainoption" /></td>
</tr>
@ -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 http-equiv=\"refresh\" content=\"0;url=admin_db_utilities.$phpEx?perform=backup&amp;additional_tables=" . quotemeta($additional_tables) . "&amp;backup_type=$backup_type&amp;drop=1&amp;backupstart=1&amp;gzipcompress=$gzipcompress&amp;startdownload=1\">",
"META" => "<meta http-equiv=\"refresh\" content=\"0;url=admin_db_utilities.$phpEx?mode=backup&amp;additional_tables=" . quotemeta($additional_tables) . "&amp;backup_type=$backup_type&amp;drop=1&amp;backupstart=1&amp;gzipcompress=$gzipcompress&amp;startdownload=1\">",
"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 = '<input type="hidden" name="perform" value="restore" /><input type="hidden" name="perform" value="$perform" />';
$s_hidden_fields = '<input type="hidden" name="mode" value="restore" /><input type="hidden" name="mode" value="$mode" />';
page_header($lang['DB']);
page_header($lang['DB_Restore']);
?>
@ -285,14 +277,21 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) )
<p><?php echo $lang['Restore_explain']; ?></p>
<form enctype="multipart/form-data" method="post" action="<?php echo "admin_db_utilities.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<tr>
<th class="th"><?php echo $lang['Select_file']; ?></th>
<form enctype="multipart/form-data" method="post" action="<?php echo "admin_db_utilities.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
<th colspan="2"><?php echo $lang['Select_file']; ?></th>
</tr>
<tr>
<td class="row1" align="center"><?php echo $s_hidden_fields; ?>&nbsp;<input type="file" name="backup_file">&nbsp;&nbsp;<input type="submit" name="restore_start" value="<?php echo $lang['Start_Restore']; ?>" class="mainoption" />&nbsp;</td>
<td class="row1"><?php echo $lang['Upload_file']; ?>: </td>
<td class="row2"><input type="file" name="backup_file" /></td>
</tr>
</table></form>
<tr>
<td class="row1"><?php echo $lang['Local_backup_file']; ?>: <br /><span class="gensmall"><?php echo $lang['Local_backup_file_explain']; ?></span></td>
<td class="row2"><input type="text" name="local_file" size="40" /></td>
</tr>
<tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="restore_start" value="<?php echo $lang['Start_Restore']; ?>" class="mainoption" /></td>
</trs>
</table><?php echo $s_hidden_fields; ?></form>
<?php
@ -417,17 +416,10 @@ if ( isset($HTTP_GET_VARS['perform']) || isset($HTTP_POST_VARS['perform']) )
}
}
?>
</td>
</tr>
</table>
<?php
page_footer();
// -----------------------
// -----------------------------------------------
// The following functions are adapted from phpMyAdmin and upgrade_20.php
//
function gzip_PrintFourChars($Val)
@ -1016,6 +1008,6 @@ function output_table_content($content)
}
//
// End Functions
// -------------
// -----------------------------------------------
?>

View file

@ -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'] . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID?pane=right" . '">', '</a>');
message_die(MESSAGE, $message);
message_die(MESSAGE, $lang['Email_sent']);
}
}
@ -157,11 +155,11 @@ if ( $row = $db->sql_fetchrow($result) )
}
$select_list .= '</select>';
page_header($lang['Users']);
page_header($lang['Mass_Email']);
?>
<h1><?php echo $lang['Email']; ?></h1>
<h1><?php echo $lang['Mass_Email']; ?></h1>
<p><?php echo $lang['Mass_email_explain']; ?></p>

View file

@ -1,6 +1,6 @@
<?php
/***************************************************************************
* admin_forums.php
* admin_forums.php
* -------------------
* begin : Thursday, Jul 12, 2001
* copyright : (C) 2001 The phpBB Group
@ -8,7 +8,6 @@
*
* $Id$
*
*
***************************************************************************/
/***************************************************************************
@ -20,213 +19,51 @@
*
***************************************************************************/
define('IN_PHPBB', 1);
if( !empty($setmodules) )
if ( !empty($setmodules) )
{
if ( !$acl->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 .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\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']);
?>
<h1>Manage</h1>
<p>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).</p>
<form method="post" action=""><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th colspan="2">Forum Name</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
<tr>
<td class="row1" width="20"><img src="images/forum.gif" /></td>
<td class="row2" width="100%">&nbsp;</td>
<td class="row1">&nbsp;</td>
<td class="row2">&nbsp;</td>
<td class="row1" width="20"><img src="images/delete.gif" width="19" height="18" alt="" title="" /></td>
</tr>
<tr>
<td class="row2" width="20"><img src="images/forum_locked.gif" /></td>
<td class="row1"></td>
<td class="row2">&nbsp;</td>
<td class="row1">&nbsp;</td>
<td class="row2" width="20" align="center"><img src="images/delete.gif" width="19" height="18" alt="" title="" /></td>
</tr>
</table></form>
<?php
//
// Start page proper
//
@ -839,7 +711,7 @@ $template->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&amp;" . POST_CAT_URL . "=$cat_id"),
'U_CAT_DELETE' => append_sid("admin_forums.$phpEx?mode=deletecat&amp;" . POST_CAT_URL . "=$cat_id"),
'U_CAT_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=cat_order&amp;move=-15&amp;" . POST_CAT_URL . "=$cat_id"),
'U_CAT_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=cat_order&amp;move=15&amp;" . 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&amp;mode=editcat&amp;c=$cat_id",
'U_CAT_DELETE' => "admin_forums.$phpEx$SID&amp;mode=deletecat&amp;c=$cat_id",
'U_CAT_MOVE_UP' => "admin_forums.$phpEx$SID&amp;mode=cat_order&amp;move=-15&amp;c=$cat_id",
'U_CAT_MOVE_DOWN' => "admin_forums.$phpEx$SID&amp;mode=cat_order&amp;move=15&amp;c=$cat_id",
'U_VIEWCAT' => $phpbb_root_path."index.$phpEx$SID&amp;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&amp;" . POST_FORUM_URL . "=$forum_id"),
'U_FORUM_DELETE' => append_sid("admin_forums.$phpEx?mode=deleteforum&amp;" . POST_FORUM_URL . "=$forum_id"),
'U_FORUM_MOVE_UP' => append_sid("admin_forums.$phpEx?mode=forum_order&amp;move=-15&amp;" . POST_FORUM_URL . "=$forum_id"),
'U_FORUM_MOVE_DOWN' => append_sid("admin_forums.$phpEx?mode=forum_order&amp;move=15&amp;" . POST_FORUM_URL . "=$forum_id"),
'U_FORUM_RESYNC' => append_sid("admin_forums.$phpEx?mode=forum_sync&amp;" . POST_FORUM_URL . "=$forum_id"))
'U_VIEWFORUM' => $phpbb_root_path."viewforum.$phpEx$SID&amp;f=$forum_id",
'U_FORUM_EDIT' => "admin_forums.$$SID&amp;mode=editforum&amp;f=$forum_id",
'U_FORUM_DELETE' => "admin_forums.$phpEx$SID&amp;mode=deleteforum&amp;f=$forum_id",
'U_FORUM_MOVE_UP' => "admin_forums.$phpEx$SID&amp;mode=forum_order&amp;move=-15&amp;f=$forum_id",
'U_FORUM_MOVE_DOWN' => "admin_forums.$phpEx$SID&amp;mode=forum_order&amp;move=15&amp;f=$forum_id",
'U_FORUM_RESYNC' => "admin_forums.$phpEx$SID&amp;mode=forum_sync&amp;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 .= "<option value=\"$row[$idfield]\"$s>" . $row[$namefield] . "</option>\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
// ------------------
?>

View file

@ -29,6 +29,7 @@ if ( !empty($setmodules) )
$filename = basename(__FILE__);
$module['Forums']['Permissions'] = $filename . $SID . '&amp;mode=forums';
$module['Forums']['Moderators'] = $filename . $SID . '&amp;mode=moderators';
$module['Forums']['Super_Moderators'] = $filename . $SID . '&amp;mode=supermoderators';
$module['General']['Administrators'] = $filename . $SID . '&amp;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' )
<p><?php echo $l_title_explain; ?></p>
<p><?php echo $lang['Permissions_extra_explain']; ?></p>
<?php
switch ( $mode )
{
case 'forums':
$type_sql = 'forum';
$forum_sql = "AND a.forum_id = $forum_id";
break;
case 'moderators':
$type_sql = 'mod';
$forum_sql = "AND a.forum_id = $forum_id";
break;
case 'supermoderators':
$type_sql = 'mod';
$forum_sql = "AND a.forum_id = $forum_id";
break;
case 'administrators':
$type_sql = 'admin';
$forum_sql = '';
break;
}
@ -173,7 +183,7 @@ if ( !empty($forum_id) || $mode == 'administrators' )
$group_list = '';
while ( $row = $db->sql_fetchrow($result) )
{
$group_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
$group_list .= '<option value="' . $row['group_id'] . '">' . ( ( !empty($lang[$row['group_name']]) ) ? $lang[$row['group_name']] : $row['group_name'] ) . '</option>';
}
$db->sql_freeresult($result);
@ -189,7 +199,7 @@ if ( !empty($forum_id) || $mode == 'administrators' )
</tr>
<tr>
<td><form method="post" name="adminusers" action="<?php echo "admin_permissions.$phpEx$SID&amp;mode=$mode"; ?>"><table width="90%" class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<td><form method="post" action="<?php echo "admin_permissions.$phpEx$SID&amp;mode=$mode"; ?>"><table width="90%" class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<?php
$sql = "SELECT DISTINCT u.user_id, u.username
@ -235,7 +245,7 @@ if ( !empty($forum_id) || $mode == 'administrators' )
$groups = '';
while ( $row = $db->sql_fetchrow($result) )
{
$groups .= '<option value="' . $row['group_id'] . '">' . ( ( $row['group_name'] == 'ADMINISTRATORS' ) ? $lang['Admin_group'] : $row['group_name'] ) . '</option>';
$groups .= '<option value="' . $row['group_id'] . '">' . ( ( !empty($lang[$row['group_name']]) ) ? $lang[$row['group_name']] : $row['group_name'] ) . '</option>';
}
$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 = '<input type="hidden" name="entries[]" value="' . $row['id'] . '" />';
$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' )
?>
<tr>
<td class="<?php echo $row_class; ?>"><?php echo $l_can_cell; ?></td>
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $type_sql; ?>][<?php echo $auth_options[$i]['auth_option']; ?>]" value="1"<?php echo $can_type; ?> /></td>
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $type_sql; ?>][<?php echo $auth_options[$i]['auth_option']; ?>]" value="0"<?php echo $cannot_type; ?> /></td>
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $type_sql; ?>][<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="1"<?php echo $can_type; ?> /></td>
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $type_sql; ?>][<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="0"<?php echo $cannot_type; ?> /></td>
</tr>
<?php
@ -409,6 +420,8 @@ else
<p><?php echo $l_title_explain ?></p>
<p><?php echo $lang['Permissions_extra_explain']; ?></p>
<form method="post" action="<?php echo "admin_permissions.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th align="center"><?php echo $lang['Select_a_Forum']; ?></th>

View file

@ -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
<p><?php echo $lang['Forum_Prune_explain']; ?></p>
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th align="center"><?php echo $lang['Select_a_Forum']; ?></th>
</tr>
@ -174,7 +174,7 @@ else
<h2><?php echo $lang['Forum'] . ': ' . $forum_name; ?></h2>
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th class="th"><?php echo $lang['Forum_Prune']; ?></th>
</tr>
@ -191,10 +191,6 @@ else
}
}
//
// Actually output the page here.
//
page_footer();
?>

View file

@ -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 = '<form method="post" action="admin_prune_users.' . $phpEx . $SID . '">' . $lang['Confirm_prune_users'] . '<br /><br /><input class="liteoption" type="submit" name="yes" value="' . $lang['Yes'] . '" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="no" value="' . $lang['No'] . '" /><input type="hidden" name="confirm" value="1" />';
$l_message = '<form method="post" action="admin_prune_users.' . $phpEx . $SID . '">' . $lang['Confirm_prune_users'] . '<br /><br /><input class="liteoption" type="submit" name="confirm" value="' . $lang['Yes'] . '" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="cancel" value="' . $lang['No'] . '" />';
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']);
}

View file

@ -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']);
?>

View file

@ -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 . "&amp;mode=emoticons";
$module['General']['Emoticons'] = $filename . $SID . '&amp;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("<", "&lt;", $smile_data[$j]);
$smile_data[$j] = str_replace(">", "&gt;", $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 = "<select name='smile_pak'><option value=''>" . $lang['Select_pak'] . "</option>";
while( list($key, $value) = @each($smiley_paks) )
foreach ( $smiley_paks as $key => $value )
{
if ( !empty($value) )
{
@ -214,7 +213,7 @@ if ( isset($HTTP_GET_VARS['import_pack']) || isset($HTTP_POST_VARS['import_pack'
$template->pparse("body");
}
}
else if( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_pack']) )
else if ( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_pack']) )
{
//
// Export our smiley config as a smiley pak...
@ -243,7 +242,7 @@ else if( isset($HTTP_POST_VARS['export_pack']) || isset($HTTP_GET_VARS['export_p
exit;
}
message_die(GENERAL_MESSAGE, sprintf($lang['export_smiles'], '<a href="' . "admin_smilies.$phpEx$SID&amp;export_pack=send" . '">', '</a>'));
message_die(MESSAGE, sprintf($lang['export_smiles'], '<a href="' . "admin_smilies.$phpEx$SID&amp;export_pack=send" . '">', '</a>'));
}
else if( isset($HTTP_POST_VARS['add']) )
@ -315,6 +314,7 @@ switch( $mode )
$filename_list = "";
for( $i = 0; $i < count($smiley_images); $i++ )
{
// $selected =
if( $smiley_images[$i] == $smile_data['smile_url'] )
{
$smiley_selected = "selected=\"selected\"";
@ -379,7 +379,7 @@ switch( $mode )
WHERE smilies_id = $smile_id";
$db->sql_query($sql);
message_die(GENERAL_MESSAGE, $lang['smiley_edit_success']);
message_die(MESSAGE, $lang['smiley_edit_success']);
break;
case 'savenew':
@ -401,7 +401,7 @@ switch( $mode )
VALUES ('" . str_replace("\'", "''", $smile_code) . "', '" . str_replace("\'", "''", $smile_url) . "', '" . str_replace("\'", "''", $smile_emotion) . "')";
$db->sql_query($sql);
message_die(GENERAL_MESSAGE, $lang['smiley_add_success']);
message_die(MESSAGE, $lang['smiley_add_success']);
break;
default:
@ -436,7 +436,7 @@ switch( $mode )
?>
<tr>
<td class="<?php echo $row_class; ?>" align="center"><?php echo htmlspecialchars($row['code']); ?></td>
<td class="<?php echo $row_class; ?>" align="center"><img src="<?php echo './../' . $board_config['smilies_path'] . '/' . $row['smile_url']; ?>" alt="<?php echo htmlspecialchars($row['code']); ?>" /></td>
<td class="<?php echo $row_class; ?>" align="center"><img src="<?php echo './../' . $board_config['smilies_path'] . '/' . $row['smile_url']; ?>" width="<?php echo $row['smile_width']; ?>" height="<?php echo $row['smile_height']; ?>" alt="<?php echo htmlspecialchars($row['code']); ?>" /></td>
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['emoticon']; ?></td>
<td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&amp;mode=edit&amp;id=" . $row['smilies_id']; ?>"><?php echo $lang['Edit']; ?></a></td>
<td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&amp;mode=delete&amp;id=" . $row['smilies_id']; ?>"><?php echo $lang['Delete']; ?></a></td>

View file

@ -197,7 +197,7 @@ switch ( $mode )
{
$tpl = substr($file, 0, strpos($file, '.'));
$selected = ( $tplname == $tpl ) ? ' selected="selected"' : '';
$tplname_options .= '<option name="' . $tpl . '"' . $selected . '>' . $tpl . '</option>';
$tplname_options .= '<option value="' . $tpl . '"' . $selected . '>' . $tpl . '</option>';
}
}
closedir($dp);
@ -217,7 +217,7 @@ switch ( $mode )
<p><?php echo $lang['Select_template']; ?>: <select name="tplroot"><?php echo $tplroot_options; ?></select>&nbsp; <input class="liteoption" type="submit" name="tpl_root" value="Select" /></p>
<table class="bg" cellspacing="1" cellpadding="0" border="0" align="center"><!-- bgcolor="#98AAB1" -->
<table class="bg" width="95%" cellspacing="1" cellpadding="0" border="0" align="center">
<tr>
<td class="cat"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
@ -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);
@ -286,23 +286,8 @@ switch ( $mode )
}
$db->sql_freeresult($result);
?>
<form method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=$mode"; ?>">
<h2><?php echo $lang['Edit_theme']; ?></h2>
<p><?php echo $lang['Edit_theme_explain']; ?></p>
<table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th colspan="2"><?php echo $lang['Edit_theme']; ?></th>
</tr>
<tr>
<td class="cat" colspan="2" align="center"><?php echo $lang['Select_theme']; ?>: <select name="theme_id"><?php echo $theme_options; ?></select>&nbsp; <input class="liteoption" type="submit" name="tpl_root" value="<?php echo $lang['Select']; ?>" /></td>
</tr>
<?php
$css_data = '';
$css_external = '';
if ( $theme_id )
{
$sql = "SELECT css_data, css_external
@ -314,8 +299,21 @@ switch ( $mode )
{
$css_data = preg_replace('/\t{1,}/i', ' ', $row['css_data']);
$css_external = $row['css_external'];
}
}
?>
<form method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=$mode"; ?>">
<h2><?php echo $lang['Edit_theme']; ?></h2>
<p><?php echo $lang['Edit_theme_explain']; ?></p>
<table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<td class="cat" colspan="2" align="center"><?php echo $lang['Select_theme']; ?>: <select name="themeroot"><?php echo $theme_options; ?></select>&nbsp; <input class="liteoption" type="submit" name="tpl_root" value="<?php echo $lang['Select']; ?>" /></td>
</tr>
<tr>
<td class="row1"><?php echo $lang['CSS_data']; ?>: <br /><span class="gensmall"><?php echo $lang['CSS_data_explain']; ?></td>
<td class="row2"><textarea class="edit" cols="65" rows="15" name="css_data"><?php echo htmlentities($css_data); ?></textarea></td>
@ -329,14 +327,6 @@ switch ( $mode )
</tr>
</table></form>
<?php
}
}
?>
</form>
<?php
page_footer();
@ -361,7 +351,7 @@ function get_templates($tplroot = '')
while ( $row = $db->sql_fetchrow($result) )
{
$selected = ( $tplroot == $row['template_path'] ) ? ' selected="selected"' : '';
$tplroot_options .= '<option name="' . $row['template_path'] . '"' . $selected . '>' . $row['template_path'] . '</option>';
$tplroot_options .= '<option value="' . $row['template_path'] . '"' . $selected . '>' . $row['template_path'] . '</option>';
}
return $tplroot_options;

View file

@ -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 = '<select name="u">';
while( $row = $db->sql_fetchrow($result) )
{
$select_list .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>';
}
$select_list .= '</select>';
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'],
<h1><?php echo $lang['User_admin']; ?></h1>
'U_SEARCH_USER' => "../search.$phpEx$SID&amp;mode=searchuser",
<p><?php echo $lang['User_admin_explain']; ?></p>
'S_USER_ACTION' => "admin_users.$phpEx$SID",
'S_USER_SELECT' => $select_list)
);
$template->display('body');
<form method="post" name="post" action="<?php echo "admin_users.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th align="center"><?php echo $lang['Select_a_User']; ?></th>
</tr>
<tr>
<td class="row1" align="center"><input type="text" class="post" name="username" maxlength="50" size="20" /> <input type="hidden" name="mode" value="edit" /><input type="submit" name="submituser" value="<?php echo $lang['Look_up_user']; ?>" class="mainoption" /> <input type="submit" name="usersubmit" value="<?php echo $lang['Find_username']; ?>" class="liteoption" onClick="window.open('<?php echo "../search.$phpEx$SID&amp;mode=searchuser&amp;field=username"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /></td>
</tr>
</table></form>
<?php
}
include('page_footer_admin.'.$phpEx);
page_footer();
?>

View file

@ -181,7 +181,7 @@ page_header($l_title);
<p><?php echo $l_title_explain; ?></p>
<form method="post" name="log" action="<?php echo "admin_viewlogs.$phpEx$SID&amp;mode=$mode"; ?>">
<form method="post" action="<?php echo "admin_viewlogs.$phpEx$SID&amp;mode=$mode"; ?>">
<?php
if ( $mode == 'mod' )
@ -190,7 +190,7 @@ if ( $mode == 'mod' )
?>
<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
<td align="right"><?php echo $lang['Select_forum']; ?>: <select name="f"><?php echo $forum_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $lang['Go']; ?>" /></td>
<td align="right"><?php echo $lang['Select_forum']; ?>: <select name="f" onchange="this.form.submit()"><?php echo $forum_options; ?></select> <input class="liteoption" type="submit" value="<?php echo $lang['Go']; ?>" /></td>
</tr>
</table>
<?php

View file

@ -79,7 +79,7 @@ if( $mode != '' )
{
case 'edit':
case 'add':
$word_id = ( isset($HTTP_GET_VARS['id']) ) ? $HTTP_GET_VARS['id'] : 0;
$word_id = ( isset($HTTP_GET_VARS['id']) ) ? intval($HTTP_GET_VARS['id']) : 0;
$s_hidden_fields = '';
if ( $mode == 'edit' )
@ -98,7 +98,7 @@ if( $mode != '' )
$s_hidden_fields .= '<input type="hidden" name="id" value="' . $word_id . '" />';
}
page_header($lang['General']);
page_header($lang['Words_title']);
?>
@ -106,7 +106,7 @@ if( $mode != '' )
<p><?php echo $lang['Words_explain']; ?></p>
<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th colspan="2"><?php echo $lang['Edit_word_censor']; ?></th>
</tr>
@ -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 .= '<br /><br />' . sprintf($lang['Click_return_wordadmin'], '<a href="' . "admin_words.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>');
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'] . '<br /><br />' . sprintf($lang['Click_return_wordadmin'], '<a href="' . "admin_words.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>');
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
<p><?php echo $lang['Words_explain']; ?></p>
<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr>
<th><?php echo $lang['Word']; ?></th>
<th><?php echo $lang['Replacement']; ?></th>
@ -202,14 +198,14 @@ else
{
do
{
$cell_bg = ( $cell_bg == 'row1' ) ? 'row2' : 'row1';
$row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1';
?>
<tr>
<td class="<?php echo $cell_bg; ?>" align="center"><?php echo $row['word']; ?></td>
<td class="<?php echo $cell_bg; ?>" align="center"><?php echo $row['replacement']; ?></td>
<td class="<?php echo $cell_bg; ?>">&nbsp;<a href="<?php echo "admin_words.$phpEx$SID&amp;mode=edit&amp;id=" . $row['word_id']; ?>"><?php echo $lang['Edit']; ?></a>&nbsp;</td>
<td class="<?php echo $cell_bg; ?>">&nbsp;<a href="<?php echo "admin_words.$phpEx$SID&amp;mode=delete&amp;id=" . $row['word_id']; ?>"><?php echo $lang['Delete']; ?></a>&nbsp;</td>
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['word']; ?></td>
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['replacement']; ?></td>
<td class="<?php echo $row_class; ?>">&nbsp;<a href="<?php echo "admin_words.$phpEx$SID&amp;mode=edit&amp;id=" . $row['word_id']; ?>"><?php echo $lang['Edit']; ?></a>&nbsp;</td>
<td class="<?php echo $row_class; ?>">&nbsp;<a href="<?php echo "admin_words.$phpEx$SID&amp;mode=delete&amp;id=" . $row['word_id']; ?>"><?php echo $lang['Delete']; ?></a>&nbsp;</td>
</tr>
<?php

View file

@ -106,7 +106,7 @@ define('FORUMS_WATCH_TABLE', $table_prefix.'forums_watch');
define('GROUPS_TABLE', $table_prefix.'groups');
define('ICONS_TABLE', $table_prefix.'icons');
define('LOG_ADMIN_TABLE', $table_prefix.'log_admin');
define('LOG_MOD_TABLE', $table_prefix.'log_moderators');
define('LOG_MOD_TABLE', $table_prefix.'log_moderator');
define('POSTS_TABLE', $table_prefix.'posts');
define('POSTS_TEXT_TABLE', $table_prefix.'posts_text');
define('PRIVMSGS_TABLE', $table_prefix.'privmsgs');

View file

@ -37,6 +37,8 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_chars', '
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_post_smilies', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_sig_chars','255');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_poll_options','10');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_chars','3');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_search_chars','20');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes','4');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs','50');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_sig','Thanks, The Management');
@ -58,6 +60,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_gallery_pat
INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path','images/smiles');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('icons_path','images/icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('prune_enable','1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable','1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('privmsg_disable','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress','0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('coppa_enable','1');
@ -154,7 +157,7 @@ INSERT INTO phpbb_forums (forum_id, forum_name, forum_desc, cat_id, forum_order,
INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm, user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone, user_dateformat, user_actkey, user_newpasswd, user_notify, user_active) VALUES ( -1, 'Anonymous', 0, '', '', '', '', '', '', '', '', 0, NULL, '', '', '', 0, 0, 1, 0, 1, 0, 1, 1, NULL, '', '', '', '', '', '', 0, 0);
# -- username: admin password: admin (change this or remove it once everything is working!)
INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm, user_popup_pm, user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone, user_dateformat, user_actkey, user_newpasswd, user_notify, user_active) VALUES ( 2, 'Admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', '', '', '', '', '', '', 1, 1, '', '', '', 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, '', 'english', 0, 'd M Y h:i a', '', '', 0, 1);
INSERT INTO phpbb_users (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_viewemail, user_style, user_aim, user_yim, user_msnm, user_posts, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_pm, user_notify_pm, user_popup_pm, user_allow_viewonline, user_rank, user_avatar, user_lang, user_timezone, user_dateformat, user_actkey, user_newpasswd, user_notify, user_active, user_founder) VALUES ( 2, 'Admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', '', '', '', '', '', '', 1, 1, '', '', '', 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, '', 'english', 0, 'd M Y h:i a', '', '', 0, 1, 1);
# -- Ranks
@ -162,21 +165,25 @@ INSERT INTO phpbb_ranks (rank_id, rank_title, rank_min, rank_special, rank_image
# -- Groups
INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (1, 'REGISTERED', 0);
INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (2, 'ADMINISTRATOR', 0);
INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (1, 'GUESTS', 0);
INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (2, 'REGISTERED', 0);
INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (3, 'SUPER_MODERATORS', 0);
INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (4, 'ADMINISTRATORS', 0);
INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (5, 'SUPER_ADMINISTRATORS', 0);
# -- User -> 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');

View file

@ -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,

View file

@ -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&ampf==$forum_id";
$l_redirect = sprintf($lang['Click_return_forum'], '<a href="' . $redirect_page . '">', '</a>');
}
else
{
$redirect_page = append_sid("modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id");
$redirect_page = "modcp.$phpEx$SID&ampf==$forum_id";
$l_redirect = sprintf($lang['Click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>');
}
@ -320,7 +287,7 @@ switch( $mode )
'META' => '<meta http-equiv="refresh" content="3;url=' . $redirect_page . '">')
);
message_die(GENERAL_MESSAGE, $lang['Topics_Removed'] . '<br /><br />' . $l_redirect);
message_die(MESSAGE, $lang['Topics_Removed'] . '<br /><br />' . $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' => '<input type="hidden" name="' . POST_FORUM_URL . '" value="' . $forum_id . '">',
'S_MODCP_ACTION' => append_sid("modcp.$phpEx"))
);
$template->set_filenames(array(
'body' => 'modcp_body.tpl')
'U_VIEW_FORUM' => "viewforum.$phpEx$SID&amp;f=$forum_id",
'S_HIDDEN_FIELDS' => '<input type="hidden" name="f" value="' . $forum_id . '">',
'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&amp;" . POST_TOPIC_URL . "=$topic_id");
$u_view_topic = "modcp.$phpEx$SID&amp;mode=split&amp;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&amp;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;
}

View file

@ -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&amp;mode=searchuser&amp;field=$field&amp;username=" . urlencode($username) . "&amp;email=" . urlencode($email) . "&amp;icq=$icq&amp;aim=" . urlencode($aim) . "&amp;yahoo=" . urlencode($yahoo) . "&amp;msn=" . urlencode($msn) . "&amp;joined=" . urlencode(implode('-', $joined)) . "&amp;active=" . urlencode(implode('-', $active)) . "&amp;count=$count&amp;sort_order=$sort_order&amp;sort_by=$sort_by&amp;joined_select=$joined_select&amp;active_select=$active_select&amp;count_select=$count_select", $total_users, $board_config['topics_per_page'], $start);
$pagination = generate_pagination("search.$phpEx$SID&amp;mode=searchuser&amp;form=$form&amp;field=$field&amp;username=" . urlencode($username) . "&amp;email=" . urlencode($email) . "&amp;icq=$icq&amp;aim=" . urlencode($aim) . "&amp;yahoo=" . urlencode($yahoo) . "&amp;msn=" . urlencode($msn) . "&amp;joined=" . urlencode(implode('-', $joined)) . "&amp;active=" . urlencode(implode('-', $active)) . "&amp;count=$count&amp;sort_order=$sort_order&amp;sort_by=$sort_by&amp;joined_select=$joined_select&amp;active_select=$active_select&amp;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,