Mostly changes to turn userdata into user->data, lang into user->lang + bitstring 2nd format + inheritance for permission admin and various other updates/fixes/changes ... note that user->lang & user->theme isn't final

git-svn-id: file:///svn/phpbb/trunk@2958 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-10-20 19:19:07 +00:00
parent 4887cf1e49
commit 0e9f0ac4ec
52 changed files with 2146 additions and 2127 deletions

View file

@ -528,8 +528,27 @@ switch ( $mode )
<th colspan="2"><?php echo $l_unban_title; ?></th> <th colspan="2"><?php echo $l_unban_title; ?></th>
</tr> </tr>
<tr> <tr>
<?php
if ( $banned_options != '' )
{
?>
<td class="row1" width="45%"><?php echo $l_ban_cell; ?>: <br /></td> <td class="row1" width="45%"><?php echo $l_ban_cell; ?>: <br /></td>
<td class="row1"> <?php if ( $banned_options != '' ) { ?><select name="unban[]" multiple="multiple" size="5"><?php echo $banned_options; ?></select><?php } else { echo $l_no_ban_cell; } ?></td> <td class="row1"> <select name="unban[]" multiple="multiple" size="5"><?php echo $banned_options; ?></select></td>
<?php
}
else
{
?>
<td class="row1" colspan="2" align="center"><?php echo $l_no_ban_cell; ?></td>
<?php
}
?>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="unbansubmit" value="<?php echo $lang['Submit']; ?>" class="mainoption" /></td> <td class="cat" colspan="2" align="center"><input type="submit" name="unbansubmit" value="<?php echo $lang['Submit']; ?>" class="mainoption" /></td>

View file

@ -46,7 +46,7 @@ require('pagestart.' . $phpEx);
// Are we authed? // Are we authed?
if ( !$auth->acl_get('a_general') ) if ( !$auth->acl_get('a_general') )
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
// Get mod // Get mod
@ -84,7 +84,7 @@ while ( $row = $db->sql_fetchrow($result) )
if ( isset($_POST['submit']) ) if ( isset($_POST['submit']) )
{ {
add_admin_log('log_' . $mode . '_config'); add_admin_log('log_' . $mode . '_config');
message_die(MESSAGE, $lang['Config_updated']); message_die(MESSAGE, $user->lang['Config_updated']);
} }
// //
@ -120,17 +120,17 @@ switch ( $mode )
return; return;
} }
page_header($lang[$l_title]); page_header($user->lang[$l_title]);
?> ?>
<h1><?php echo $lang[$l_title]; ?></h1> <h1><?php echo $user->lang[$l_title]; ?></h1>
<p><?php echo $lang[$l_title . '_explain']; ?></p> <p><?php echo $user->lang[$l_title . '_explain']; ?></p>
<form action="<?php echo "admin_board.$phpEx$SID&amp;mode=$mode"; ?>" method="post"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center"> <form action="<?php echo "admin_board.$phpEx$SID&amp;mode=$mode"; ?>" method="post"><table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $lang[$l_title]; ?></th> <th colspan="2"><?php echo $user->lang[$l_title]; ?></th>
</tr> </tr>
<?php <?php
@ -146,20 +146,20 @@ switch ( $mode )
?> ?>
<tr> <tr>
<td class="row1" width="50%"><?php echo $lang['Cookie_domain']; ?>: </td> <td class="row1" width="50%"><?php echo $user->lang['Cookie_domain']; ?>: </td>
<td class="row2"><input type="text" maxlength="255" name="cookie_domain" value="<?php echo $new['cookie_domain']; ?>" /></td> <td class="row2"><input type="text" maxlength="255" name="cookie_domain" value="<?php echo $new['cookie_domain']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Cookie_name']; ?>: </td> <td class="row1"><?php echo $user->lang['Cookie_name']; ?>: </td>
<td class="row2"><input type="text" maxlength="16" name="cookie_name" value="<?php echo $new['cookie_name']; ?>" /></td> <td class="row2"><input type="text" maxlength="16" name="cookie_name" value="<?php echo $new['cookie_name']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Cookie_path']; ?>: </td> <td class="row1"><?php echo $user->lang['Cookie_path']; ?>: </td>
<td class="row2"><input type="text" maxlength="255" name="cookie_path" value="<?php echo $new['cookie_path']; ?>" /></td> <td class="row2"><input type="text" maxlength="255" name="cookie_path" value="<?php echo $new['cookie_path']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Cookie_secure']; ?>: <br /><span class="gensmall"><?php echo $lang['Cookie_secure_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Cookie_secure']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Cookie_secure_explain']; ?></span></td>
<td class="row2"><input type="radio" name="cookie_secure" value="0"<?php echo $cookie_secure_no; ?> /><?php echo $lang['Disabled']; ?>&nbsp; &nbsp;<input type="radio" name="cookie_secure" value="1"<?php echo $cookie_secure_yes; ?> /><?php echo $lang['Enabled']; ?></td> <td class="row2"><input type="radio" name="cookie_secure" value="0"<?php echo $cookie_secure_no; ?> /><?php echo $user->lang['Disabled']; ?>&nbsp; &nbsp;<input type="radio" name="cookie_secure" value="1"<?php echo $cookie_secure_yes; ?> /><?php echo $user->lang['Enabled']; ?></td>
</tr> </tr>
<?php <?php
@ -176,31 +176,31 @@ switch ( $mode )
?> ?>
<tr> <tr>
<td class="row1" width="50%"><?php echo $lang['Allow_local']; ?>: </td> <td class="row1" width="50%"><?php echo $user->lang['Allow_local']; ?>: </td>
<td class="row2"><input type="radio" name="allow_avatar_local" value="1"<?php echo $avatars_local_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_local" value="0"<?php echo $avatars_local_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_avatar_local" value="1"<?php echo $avatars_local_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_local" value="0"<?php echo $avatars_local_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allow_remote']; ?>: <br /><span class="gensmall"><?php echo $lang['Allow_remote_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Allow_remote']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Allow_remote_explain']; ?></span></td>
<td class="row2"><input type="radio" name="allow_avatar_remote" value="1"<?php echo $avatars_remote_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_remote" value="0"<?php echo $avatars_remote_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_avatar_remote" value="1"<?php echo $avatars_remote_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_remote" value="0"<?php echo $avatars_remote_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allow_upload']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_upload']; ?>: </td>
<td class="row2"><input type="radio" name="allow_avatar_upload" value="1"<?php echo $avatars_upload_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_upload" value="0"<?php echo $avatars_upload_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_avatar_upload" value="1"<?php echo $avatars_upload_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_avatar_upload" value="0"<?php echo $avatars_upload_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Max_filesize']; ?>: <br /><span class="gensmall"><?php echo $lang['Max_filesize_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Max_filesize']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_filesize_explain']; ?></span></td>
<td class="row2"><input type="text" size="4" maxlength="10" name="avatar_filesize" value="<?php echo $new['avatar_filesize']; ?>" /> Bytes</td> <td class="row2"><input type="text" size="4" maxlength="10" name="avatar_filesize" value="<?php echo $new['avatar_filesize']; ?>" /> Bytes</td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Max_avatar_size']; ?>: <br /><span class="gensmall"><?php echo $lang['Max_avatar_size_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Max_avatar_size']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_avatar_size_explain']; ?></span></td>
<td class="row2"><input type="text" size="3" maxlength="4" name="avatar_max_height" value="<?php echo $new['avatar_max_height']; ?>" /> x <input type="text" size="3" maxlength="4" name="avatar_max_width" value="<?php echo $new['avatar_max_width']; ?>"></td> <td class="row2"><input type="text" size="3" maxlength="4" name="avatar_max_height" value="<?php echo $new['avatar_max_height']; ?>" /> x <input type="text" size="3" maxlength="4" name="avatar_max_width" value="<?php echo $new['avatar_max_width']; ?>"></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Avatar_storage_path']; ?>: <br /><span class="gensmall"><?php echo $lang['Avatar_storage_path_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Avatar_storage_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Avatar_storage_path_explain']; ?></span></td>
<td class="row2"><input type="text" size="20" maxlength="255" name="avatar_path" value="<?php echo $new['avatar_path']; ?>" /></td> <td class="row2"><input type="text" size="20" maxlength="255" name="avatar_path" value="<?php echo $new['avatar_path']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Avatar_gallery_path']; ?>: <br /><span class="gensmall"><?php echo $lang['Avatar_gallery_path_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Avatar_gallery_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Avatar_gallery_path_explain']; ?></span></td>
<td class="row2"><input type="text" size="20" maxlength="255" name="avatar_gallery_path" value="<?php echo $new['avatar_gallery_path']; ?>" /></td> <td class="row2"><input type="text" size="20" maxlength="255" name="avatar_gallery_path" value="<?php echo $new['avatar_gallery_path']; ?>" /></td>
</tr> </tr>
<?php <?php
@ -239,67 +239,67 @@ switch ( $mode )
?> ?>
<tr> <tr>
<td class="row1" width="50%"><?php echo $lang['Default_style']; ?></td> <td class="row1" width="50%"><?php echo $user->lang['Default_style']; ?></td>
<td class="row2"><?php echo $style_select; ?></td> <td class="row2"><?php echo $style_select; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Override_style']; ?>: <br /><span class="gensmall"><?php echo $lang['Override_style_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Override_style']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Override_style_explain']; ?></span></td>
<td class="row2"><input type="radio" name="override_user_style" value="1" <?php echo $override_user_style_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="override_user_style" value="0" <?php echo $override_user_style_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="override_user_style" value="1" <?php echo $override_user_style_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="override_user_style" value="0" <?php echo $override_user_style_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Default_language']; ?>: </td> <td class="row1"><?php echo $user->lang['Default_language']; ?>: </td>
<td class="row2"><?php echo $lang_select; ?></td> <td class="row2"><?php echo $lang_select; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Date_format']; ?>: <br /><span class="gensmall"><?php echo $lang['Date_format_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Date_format']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Date_format_explain']; ?></span></td>
<td class="row2"><input type="text" name="default_dateformat" value="<?php echo $new['default_dateformat']; ?>" /></td> <td class="row2"><input type="text" name="default_dateformat" value="<?php echo $new['default_dateformat']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['System_timezone']; ?>: </td> <td class="row1"><?php echo $user->lang['System_timezone']; ?>: </td>
<td class="row2"><?php echo $timezone_select; ?></td> <td class="row2"><?php echo $timezone_select; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Char_limit']; ?><br />: <span class="gensmall"><?php echo $lang['Char_limit_explain']; ?></span</td> <td class="row1"><?php echo $user->lang['Char_limit']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Char_limit_explain']; ?></span</td>
<td class="row2"><input type="text" size="4" maxlength="4" name="max_post_chars" value="<?php echo $new['max_post_chars']; ?>" /></td> <td class="row2"><input type="text" size="4" maxlength="4" name="max_post_chars" value="<?php echo $new['max_post_chars']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Smilies_limit']; ?>: <br /><span class="gensmall"><?php echo $lang['Smilies_limit_explain']; ?></span</td> <td class="row1"><?php echo $user->lang['Smilies_limit']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Smilies_limit_explain']; ?></span</td>
<td class="row2"><input type="text" size="4" maxlength="4" name="max_post_smilies" value="<?php echo $new['max_post_smilies']; ?>" /></td> <td class="row2"><input type="text" size="4" maxlength="4" name="max_post_smilies" value="<?php echo $new['max_post_smilies']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allow_topic_notify']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_topic_notify']; ?>: </td>
<td class="row2"><input type="radio" name="allow_topic_notify" value="1" <?php echo $topic_notify_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_topic_notify" value="0" <?php echo $topic_notify_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_topic_notify" value="1" <?php echo $topic_notify_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_topic_notify" value="0" <?php echo $topic_notify_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allow_forum_notify']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_forum_notify']; ?>: </td>
<td class="row2"><input type="radio" name="allow_forum_notify" value="1" <?php echo $forum_notify_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_forum_notify" value="0" <?php echo $forum_notify_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_forum_notify" value="1" <?php echo $forum_notify_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_forum_notify" value="0" <?php echo $forum_notify_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allow_name_change']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_name_change']; ?>: </td>
<td class="row2"><input type="radio" name="allow_namechange" value="1" <?php echo $namechange_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_namechange" value="0" <?php echo $namechange_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_namechange" value="1" <?php echo $namechange_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_namechange" value="0" <?php echo $namechange_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allow_HTML']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_HTML']; ?>: </td>
<td class="row2"><input type="radio" name="allow_html" value="1" <?php echo $html_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_html" value="0" <?php echo $html_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_html" value="1" <?php echo $html_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_html" value="0" <?php echo $html_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allowed_tags']; ?>: <br /><span class="gensmall"><?php echo $lang['Allowed_tags_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Allowed_tags']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Allowed_tags_explain']; ?></span></td>
<td class="row2"><input type="text" size="30" maxlength="255" name="allow_html_tags" value="<?php echo $new['allow_html_tags']; ?>" /></td> <td class="row2"><input type="text" size="30" maxlength="255" name="allow_html_tags" value="<?php echo $new['allow_html_tags']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allow_BBCode']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_BBCode']; ?>: </td>
<td class="row2"><input type="radio" name="allow_bbcode" value="1" <?php echo $bbcode_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_bbcode" value="0" <?php echo $bbcode_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_bbcode" value="1" <?php echo $bbcode_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_bbcode" value="0" <?php echo $bbcode_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allow_smilies']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_smilies']; ?>: </td>
<td class="row2"><input type="radio" name="allow_smilies" value="1" <?php echo $smile_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_smilies" value="0" <?php echo $smile_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_smilies" value="1" <?php echo $smile_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_smilies" value="0" <?php echo $smile_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Allow_sig']; ?>: </td> <td class="row1"><?php echo $user->lang['Allow_sig']; ?>: </td>
<td class="row2"><input type="radio" name="allow_sig" value="1" <?php echo $sig_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_sig" value="0" <?php echo $sig_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="allow_sig" value="1" <?php echo $sig_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="allow_sig" value="0" <?php echo $sig_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Max_sig_length']; ?>: <br /><span class="gensmall"><?php echo $lang['Max_sig_length_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Max_sig_length']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_sig_length_explain']; ?></span></td>
<td class="row2"><input type="text" size="5" maxlength="4" name="max_sig_chars" value="<?php echo $new['max_sig_chars']; ?>" /></td> <td class="row2"><input type="text" size="5" maxlength="4" name="max_sig_chars" value="<?php echo $new['max_sig_chars']; ?>" /></td>
</tr> </tr>
<?php <?php
@ -327,79 +327,79 @@ switch ( $mode )
?> ?>
<tr> <tr>
<td class="row1" width="50%"><?php echo $lang['Site_name']; ?>: </td> <td class="row1" width="50%"><?php echo $user->lang['Site_name']; ?>: </td>
<td class="row2"><input type="text" size="40" maxlength="255" name="sitename" value="<?php echo htmlentities($new['sitename']); ?>" /></td> <td class="row2"><input type="text" size="40" maxlength="255" name="sitename" value="<?php echo htmlentities($new['sitename']); ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Site_desc']; ?>: </td> <td class="row1"><?php echo $user->lang['Site_desc']; ?>: </td>
<td class="row2"><input type="text" size="40" maxlength="255" name="site_desc" value="<?php echo htmlentities($new['site_desc']); ?>" /></td> <td class="row2"><input type="text" size="40" maxlength="255" name="site_desc" value="<?php echo htmlentities($new['site_desc']); ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Board_disable']; ?>: <br /><span class="gensmall"><?php echo $lang['Board_disable_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Board_disable']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Board_disable_explain']; ?></span></td>
<td class="row2"><input type="radio" name="board_disable" value="1" <?php echo $disable_board_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="board_disable" value="0" <?php echo $disable_board_no; ?> /> <?php echo $lang['No']; ?><br /><input type="text" name="board_disable_msg" maxlength="255" size="40" value="<?php echo $new['board_disable_msg']; ?>" /></td> <td class="row2"><input type="radio" name="board_disable" value="1" <?php echo $disable_board_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="board_disable" value="0" <?php echo $disable_board_no; ?> /> <?php echo $user->lang['No']; ?><br /><input type="text" name="board_disable_msg" maxlength="255" size="40" value="<?php echo $new['board_disable_msg']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Enable_prune']; ?>: </td> <td class="row1"><?php echo $user->lang['Enable_prune']; ?>: </td>
<td class="row2"><input type="radio" name="prune_enable" value="1" <?php echo $prune_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="prune_enable" value="0" <?php echo $prune_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="prune_enable" value="1" <?php echo $prune_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="prune_enable" value="0" <?php echo $prune_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Acct_activation']; ?>: <br /><span class="gensmall"><?php echo $lang['Acct_activation_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Acct_activation']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Acct_activation_explain']; ?></span></td>
<td class="row2"><input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_NONE; ?>" <?php echo $activation_none; ?> /><?php echo $lang['Acc_None']; ?>&nbsp; &nbsp;<input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF; ?>" <?php echo $activation_user; ?> /><?php echo $lang['Acc_User']; ?>&nbsp; &nbsp;<input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_ADMIN; ?>" <?php echo $activation_admin; ?> /><?php echo $lang['Acc_Admin']; ?>&nbsp; &nbsp;<input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_DISABLE; ?>" <?php echo $activation_disable; ?> /><?php echo $lang['Acc_Disable']; ?></td> <td class="row2"><input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_NONE; ?>" <?php echo $activation_none; ?> /><?php echo $user->lang['Acc_None']; ?>&nbsp; &nbsp;<input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF; ?>" <?php echo $activation_user; ?> /><?php echo $user->lang['Acc_User']; ?>&nbsp; &nbsp;<input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_ADMIN; ?>" <?php echo $activation_admin; ?> /><?php echo $user->lang['Acc_Admin']; ?>&nbsp; &nbsp;<input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_DISABLE; ?>" <?php echo $activation_disable; ?> /><?php echo $user->lang['Acc_Disable']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Enable_COPPA']; ?>: <br /><span class="gensmall"><?php echo $lang['Enable_COPPA_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Enable_COPPA']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Enable_COPPA_explain']; ?></span></td>
<td class="row2"><input type="radio" name="coppa_enable" value="1" <?php echo $coppa_enable_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="coppa_enable" value="0" <?php echo $coppa_enable_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="coppa_enable" value="1" <?php echo $coppa_enable_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="coppa_enable" value="0" <?php echo $coppa_enable_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['COPPA_fax']; ?>: </td> <td class="row1"><?php echo $user->lang['COPPA_fax']; ?>: </td>
<td class="row2"><input type="text" size="25" maxlength="100" name="coppa_fax" value="<?php echo $new['coppa_fax']; ?>" /></td> <td class="row2"><input type="text" size="25" maxlength="100" name="coppa_fax" value="<?php echo $new['coppa_fax']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['COPPA_mail']; ?>: <br /><span class="gensmall"><?php echo $lang['COPPA_mail_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['COPPA_mail']; ?>: <br /><span class="gensmall"><?php echo $user->lang['COPPA_mail_explain']; ?></span></td>
<td class="row2"><textarea name="coppa_mail" rows="5" cols="40"><?php echo $new['coppa_mail']; ?></textarea></td> <td class="row2"><textarea name="coppa_mail" rows="5" cols="40"><?php echo $new['coppa_mail']; ?></textarea></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Private_Messaging']; ?>: </td> <td class="row1"><?php echo $user->lang['Private_Messaging']; ?>: </td>
<td class="row2"><input type="radio" name="privmsg_disable" value="0" <?php echo $privmsg_on; ?> /><?php echo $lang['Enabled']; ?>&nbsp; &nbsp;<input type="radio" name="privmsg_disable" value="1" <?php echo $privmsg_off; ?> /><?php echo $lang['Disabled']; ?></td> <td class="row2"><input type="radio" name="privmsg_disable" value="0" <?php echo $privmsg_on; ?> /><?php echo $user->lang['Enabled']; ?>&nbsp; &nbsp;<input type="radio" name="privmsg_disable" value="1" <?php echo $privmsg_off; ?> /><?php echo $user->lang['Disabled']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Boxes_max']; ?>: <br /><span class="gensmall"><?php echo $lang['Boxes_max_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Boxes_max']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Boxes_max_explain']; ?></span></td>
<td class="row2"><input type="text" maxlength="4" size="4" name="pm_max_boxes" value="<?php echo $new['pm_max_boxes']; ?>" /></td> <td class="row2"><input type="text" maxlength="4" size="4" name="pm_max_boxes" value="<?php echo $new['pm_max_boxes']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Boxes_limit']; ?>: <br /><span class="gensmall"><?php echo $lang['Boxes_limit_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Boxes_limit']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Boxes_limit_explain']; ?></span></td>
<td class="row2"><input type="text" maxlength="4" size="4" name="pm_max_msgs" value="<?php echo $new['pm_max_msgs']; ?>" /></td> <td class="row2"><input type="text" maxlength="4" size="4" name="pm_max_msgs" value="<?php echo $new['pm_max_msgs']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Flood_Interval']; ?>: <br /><span class="gensmall"><?php echo $lang['Flood_Interval_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Flood_Interval']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Flood_Interval_explain']; ?></span></td>
<td class="row2"><input type="text" size="3" maxlength="4" name="flood_interval" value="<?php echo $new['flood_interval']; ?>" /></td> <td class="row2"><input type="text" size="3" maxlength="4" name="flood_interval" value="<?php echo $new['flood_interval']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Search_Interval']; ?>: <br /><span class="gensmall"><?php echo $lang['Search_Interval_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Search_Interval']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Search_Interval_explain']; ?></span></td>
<td class="row2"><input type="text" size="3" maxlength="4" name="search_interval" value="<?php echo $new['search_interval']; ?>" /></td> <td class="row2"><input type="text" size="3" maxlength="4" name="search_interval" value="<?php echo $new['search_interval']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Min_search_chars']; ?>: <br /><span class="gensmall"><?php echo $lang['Min_search_chars_explain']; ?></span</td> <td class="row1"><?php echo $user->lang['Min_search_chars']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Min_search_chars_explain']; ?></span</td>
<td class="row2"><input type="text" size="3" maxlength="3" name="min_search_chars" value="<?php echo $new['min_search_chars']; ?>" /></td> <td class="row2"><input type="text" size="3" maxlength="3" name="min_search_chars" value="<?php echo $new['min_search_chars']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Max_search_chars']; ?>: <br /><span class="gensmall"><?php echo $lang['Max_search_chars_explain']; ?></span</td> <td class="row1"><?php echo $user->lang['Max_search_chars']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Max_search_chars_explain']; ?></span</td>
<td class="row2"><input type="text" size="3" maxlength="3" name="max_search_chars" value="<?php echo $new['max_search_chars']; ?>" /></td> <td class="row2"><input type="text" size="3" maxlength="3" name="max_search_chars" value="<?php echo $new['max_search_chars']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Topics_per_page']; ?>: </td> <td class="row1"><?php echo $user->lang['Topics_per_page']; ?>: </td>
<td class="row2"><input type="text" name="topics_per_page" size="3" maxlength="4" value="<?php echo $new['topics_per_page']; ?>" /></td> <td class="row2"><input type="text" name="topics_per_page" size="3" maxlength="4" value="<?php echo $new['topics_per_page']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Posts_per_page']; ?>: </td> <td class="row1"><?php echo $user->lang['Posts_per_page']; ?>: </td>
<td class="row2"><input type="text" name="posts_per_page" size="3" maxlength="4" value="<?php echo $new['posts_per_page']; ?>" /></td> <td class="row2"><input type="text" name="posts_per_page" size="3" maxlength="4" value="<?php echo $new['posts_per_page']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Hot_threshold']; ?>: </td> <td class="row1"><?php echo $user->lang['Hot_threshold']; ?>: </td>
<td class="row2"><input type="text" name="hot_threshold" size="3" maxlength="4" value="<?php echo $new['hot_threshold']; ?>" /></td> <td class="row2"><input type="text" name="hot_threshold" size="3" maxlength="4" value="<?php echo $new['hot_threshold']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Max_poll_options']; ?>: </td> <td class="row1"><?php echo $user->lang['Max_poll_options']; ?>: </td>
<td class="row2"><input type="text" name="max_poll_options" size="4" maxlength="4" value="<?php echo $new['max_poll_options']; ?>" /></td> <td class="row2"><input type="text" name="max_poll_options" size="4" maxlength="4" value="<?php echo $new['max_poll_options']; ?>" /></td>
</tr> </tr>
<?php <?php
@ -419,35 +419,35 @@ switch ( $mode )
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['Enable_email']; ?>: <br /><span class="gensmall"><?php echo $lang['Enable_email_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Enable_email']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Enable_email_explain']; ?></span></td>
<td class="row2"><input type="radio" name="email_enable" value="1" <?php echo $email_yes; ?> /> <?php echo $lang['Enabled']; ?>&nbsp;&nbsp;<input type="radio" name="email_enable" value="0" <?php echo $email_no; ?> /> <?php echo $lang['Disabled']; ?></td> <td class="row2"><input type="radio" name="email_enable" value="1" <?php echo $email_yes; ?> /> <?php echo $user->lang['Enabled']; ?>&nbsp;&nbsp;<input type="radio" name="email_enable" value="0" <?php echo $email_no; ?> /> <?php echo $user->lang['Disabled']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Board_email_form']; ?>: <br /><span class="gensmall"><?php echo $lang['Board_email_form_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Board_email_form']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Board_email_form_explain']; ?></span></td>
<td class="row2"><input type="radio" name="board_email_form" value="1" <?php echo $board_email_form_yes; ?> /> <?php echo $lang['Enabled']; ?>&nbsp;&nbsp;<input type="radio" name="board_email_form" value="0" <?php echo $board_email_form_no; ?> /> <?php echo $lang['Disabled']; ?></td> <td class="row2"><input type="radio" name="board_email_form" value="1" <?php echo $board_email_form_yes; ?> /> <?php echo $user->lang['Enabled']; ?>&nbsp;&nbsp;<input type="radio" name="board_email_form" value="0" <?php echo $board_email_form_no; ?> /> <?php echo $user->lang['Disabled']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1" width="50%"><?php echo $lang['Admin_email']; ?>: </td> <td class="row1" width="50%"><?php echo $user->lang['Admin_email']; ?>: </td>
<td class="row2"><input type="text" size="25" maxlength="100" name="board_email" value="<?php echo $new['board_email']; ?>" /></td> <td class="row2"><input type="text" size="25" maxlength="100" name="board_email" value="<?php echo $new['board_email']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Email_sig']; ?>: <br /><span class="gensmall"><?php echo $lang['Email_sig_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Email_sig']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Email_sig_explain']; ?></span></td>
<td class="row2"><textarea name="board_email_sig" rows="5" cols="30"><?php echo $new['board_email_sig']; ?></textarea></td> <td class="row2"><textarea name="board_email_sig" rows="5" cols="30"><?php echo $new['board_email_sig']; ?></textarea></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Use_SMTP']; ?>: <br /><span class="gensmall"><?php echo $lang['Use_SMTP_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Use_SMTP']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Use_SMTP_explain']; ?></span></td>
<td class="row2"><input type="radio" name="smtp_delivery" value="1" <?php echo $smtp_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="smtp_delivery" value="0" <?php echo $smtp_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="smtp_delivery" value="1" <?php echo $smtp_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="smtp_delivery" value="0" <?php echo $smtp_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['SMTP_server']; ?>: </td> <td class="row1"><?php echo $user->lang['SMTP_server']; ?>: </td>
<td class="row2"><input type="text" name="smtp_host" value="<?php echo $new['smtp_host']; ?>" size="25" maxlength="50" /></td> <td class="row2"><input type="text" name="smtp_host" value="<?php echo $new['smtp_host']; ?>" size="25" maxlength="50" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['SMTP_username']; ?>: <br /><span class="gensmall"><?php echo $lang['SMTP_username_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['SMTP_username']; ?>: <br /><span class="gensmall"><?php echo $user->lang['SMTP_username_explain']; ?></span></td>
<td class="row2"><input type="text" name="smtp_username" value="<?php echo $new['smtp_username']; ?>" size="25" maxlength="255" /></td> <td class="row2"><input type="text" name="smtp_username" value="<?php echo $new['smtp_username']; ?>" size="25" maxlength="255" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['SMTP_password']; ?>: <br /><span class="gensmall"><?php echo $lang['SMTP_password_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['SMTP_password']; ?>: <br /><span class="gensmall"><?php echo $user->lang['SMTP_password_explain']; ?></span></td>
<td class="row2"><input type="password" name="smtp_password" value="<?php echo $new['smtp_password']; ?>" size="25" maxlength="255" /></td> <td class="row2"><input type="password" name="smtp_password" value="<?php echo $new['smtp_password']; ?>" size="25" maxlength="255" /></td>
</tr> </tr>
<?php <?php
@ -465,43 +465,43 @@ switch ( $mode )
$gzip_no = ( !$new['gzip_compress'] ) ? 'checked="checked"' : ''; $gzip_no = ( !$new['gzip_compress'] ) ? 'checked="checked"' : '';
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['Server_name']; ?>: <br /><span class="gensmall"><?php echo $lang['Server_name_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Server_name']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Server_name_explain']; ?></span></td>
<td class="row2"><input type="text" maxlength="255" size="40" name="server_name" value="<?php echo $new['server_name']; ?>" /></td> <td class="row2"><input type="text" maxlength="255" size="40" name="server_name" value="<?php echo $new['server_name']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Server_port']; ?>: <br /><span class="gensmall"><?php echo $lang['Server_port_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Server_port']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Server_port_explain']; ?></span></td>
<td class="row2"><input type="text" maxlength="5" size="5" name="server_port" value="<?php echo $new['server_port']; ?>" /></td> <td class="row2"><input type="text" maxlength="5" size="5" name="server_port" value="<?php echo $new['server_port']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Script_path']; ?>: <br /><span class="gensmall"><?php echo $lang['Script_path_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Script_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Script_path_explain']; ?></span></td>
<td class="row2"><input type="text" maxlength="255" name="script_path" value="<?php echo $new['script_path']; ?>" /></td> <td class="row2"><input type="text" maxlength="255" name="script_path" value="<?php echo $new['script_path']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['IP_valid']; ?>: <br /><span class="gensmall"><?php echo $lang['IP_valid_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['IP_valid']; ?>: <br /><span class="gensmall"><?php echo $user->lang['IP_valid_explain']; ?></span></td>
<td class="row2"><input type="radio" name="ip_check" value="4" <?php echo $ip_all; ?> /> <?php echo $lang['All']; ?>&nbsp;&nbsp;<input type="radio" name="ip_check" value="3" <?php echo $ip_classc; ?> /> <?php echo $lang['Class_C']; ?>&nbsp;&nbsp;<input type="radio" name="ip_check" value="2" <?php echo $ip_classb; ?> /> <?php echo $lang['Class_B']; ?>&nbsp;&nbsp;<input type="radio" name="ip_check" value="0" <?php echo $ip_none; ?> /> <?php echo $lang['None']; ?>&nbsp;&nbsp;</td> <td class="row2"><input type="radio" name="ip_check" value="4" <?php echo $ip_all; ?> /> <?php echo $user->lang['All']; ?>&nbsp;&nbsp;<input type="radio" name="ip_check" value="3" <?php echo $ip_classc; ?> /> <?php echo $user->lang['Class_C']; ?>&nbsp;&nbsp;<input type="radio" name="ip_check" value="2" <?php echo $ip_classb; ?> /> <?php echo $user->lang['Class_B']; ?>&nbsp;&nbsp;<input type="radio" name="ip_check" value="0" <?php echo $ip_none; ?> /> <?php echo $user->lang['None']; ?>&nbsp;&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Limit_load']; ?>: <br /><span class="gensmall"><?php echo $lang['Limit_load_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Limit_load']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Limit_load_explain']; ?></span></td>
<td class="row2"><input type="text" size="4" maxlength="4" name="limit_load" value="<?php echo $new['limit_load']; ?>" /></td> <td class="row2"><input type="text" size="4" maxlength="4" name="limit_load" value="<?php echo $new['limit_load']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Session_length']; ?>: </td> <td class="row1"><?php echo $user->lang['Session_length']; ?>: </td>
<td class="row2"><input type="text" maxlength="5" size="5" name="session_length" value="<?php echo $new['session_length']; ?>" /></td> <td class="row2"><input type="text" maxlength="5" size="5" name="session_length" value="<?php echo $new['session_length']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Limit_sessions']; ?>: <br /><span class="gensmall"><?php echo $lang['Limit_sessions_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Limit_sessions']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Limit_sessions_explain']; ?></span></td>
<td class="row2"><input type="text" size="4" maxlength="4" name="active_sessions" value="<?php echo $new['active_sessions']; ?>" /></td> <td class="row2"><input type="text" size="4" maxlength="4" name="active_sessions" value="<?php echo $new['active_sessions']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Enable_gzip']; ?>: </td> <td class="row1"><?php echo $user->lang['Enable_gzip']; ?>: </td>
<td class="row2"><input type="radio" name="gzip_compress" value="1" <?php echo $gzip_yes; ?> /> <?php echo $lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="gzip_compress" value="0" <?php echo $gzip_no; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="gzip_compress" value="1" <?php echo $gzip_yes; ?> /> <?php echo $user->lang['Yes']; ?>&nbsp;&nbsp;<input type="radio" name="gzip_compress" value="0" <?php echo $gzip_no; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Smilies_path']; ?>: <br /><span class="gensmall"><?php echo $lang['Smilies_path_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Smilies_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Smilies_path_explain']; ?></span></td>
<td class="row2"><input type="text" size="20" maxlength="255" name="smilies_path" value="<?php echo $new['smilies_path']; ?>" /></td> <td class="row2"><input type="text" size="20" maxlength="255" name="smilies_path" value="<?php echo $new['smilies_path']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Icons_path']; ?>: <br /><span class="gensmall"><?php echo $lang['Icons_path_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Icons_path']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Icons_path_explain']; ?></span></td>
<td class="row2"><input type="text" size="20" maxlength="255" name="icons_path" value="<?php echo $new['icons_path']; ?>" /></td> <td class="row2"><input type="text" size="20" maxlength="255" name="icons_path" value="<?php echo $new['icons_path']; ?>" /></td>
</tr> </tr>
<?php <?php
@ -532,7 +532,7 @@ switch ( $mode )
?> ?>
<tr> <tr>
<td class="row1" width="50%"><?php echo $lang['Auth_method']; ?>:</td> <td class="row1" width="50%"><?php echo $user->lang['Auth_method']; ?>:</td>
<td class="row2"><select name="auth_method"><?php echo $auth_select; ?></select></td> <td class="row2"><select name="auth_method"><?php echo $auth_select; ?></select></td>
</tr> </tr>
<?php <?php
@ -572,7 +572,7 @@ switch ( $mode )
?> ?>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $lang['Submit']; ?>" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="<?php echo $lang['Reset']; ?>" class="liteoption" /></td> <td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $user->lang['Submit']; ?>" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="<?php echo $user->lang['Reset']; ?>" class="liteoption" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -52,7 +52,7 @@ include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
// //
if ( !$auth->acl_get('a_general') ) if ( !$auth->acl_get('a_general') )
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
// //
@ -85,7 +85,7 @@ switch( $mode )
break; break;
} }
message_die(MESSAGE, $lang['Backups_not_supported']); message_die(MESSAGE, $user->lang['Backups_not_supported']);
break; break;
} }
@ -97,32 +97,32 @@ switch( $mode )
if ( !isset($_POST['backupstart']) && !isset($_GET['backupstart']) ) if ( !isset($_POST['backupstart']) && !isset($_GET['backupstart']) )
{ {
page_header($lang['DB_Backup']); page_header($user->lang['DB_Backup']);
?> ?>
<h1><?php echo $lang['DB_Backup']; ?></h1> <h1><?php echo $user->lang['DB_Backup']; ?></h1>
<p><?php echo $lang['Backup_explain']; ?></p> <p><?php echo $user->lang['Backup_explain']; ?></p>
<form method="post" action="<?php echo "admin_database.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="<?php echo "admin_database.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $lang['Backup_options']; ?></th> <th colspan="2"><?php echo $user->lang['Backup_options']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Backup_type']; ?>: </td> <td class="row1"><?php echo $user->lang['Backup_type']; ?>: </td>
<td class="row2"><input type="radio" name="type" value="full" checked="checked" /> <?php echo $lang['Full_backup']; ?>&nbsp;&nbsp;<input type="radio" name="type" value="structure" /> <?php echo $lang['Structure_only']; ?>&nbsp;&nbsp;<input type="radio" name="type" value="data" /> <?php echo $lang['Data_only']; ?></td> <td class="row2"><input type="radio" name="type" value="full" checked="checked" /> <?php echo $user->lang['Full_backup']; ?>&nbsp;&nbsp;<input type="radio" name="type" value="structure" /> <?php echo $user->lang['Structure_only']; ?>&nbsp;&nbsp;<input type="radio" name="type" value="data" /> <?php echo $user->lang['Data_only']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Include_search_index']; ?>: <br /><span class="gensmall"><?php echo $lang['Include_search_index_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Include_search_index']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Include_search_index_explain']; ?></span></td>
<td class="row2"><input type="radio" name="search" value="0" /> <?php echo $lang['No']; ?>&nbsp;&nbsp;<input type="radio" name="search" value="1" checked="checked" /> <?php echo $lang['Yes']; ?></td> <td class="row2"><input type="radio" name="search" value="0" /> <?php echo $user->lang['No']; ?>&nbsp;&nbsp;<input type="radio" name="search" value="1" checked="checked" /> <?php echo $user->lang['Yes']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Additional_tables']; ?>: <br /><span class="gensmall"><?php echo $lang['Additional_tables_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Additional_tables']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Additional_tables_explain']; ?></span></td>
<td class="row2"><input type="text" name="tables" size="40" /></td> <td class="row2"><input type="text" name="tables" size="40" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Store_local']; ?>: <br /><span class="gensmall"><?php echo $lang['Store_local_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Store_local']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Store_local_explain']; ?></span></td>
<td class="row2"><input type="text" name="store" size="40" /></td> <td class="row2"><input type="text" name="store" size="40" /></td>
</tr> </tr>
<?php <?php
@ -132,8 +132,8 @@ switch( $mode )
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['Compress_file']; ?>: </td> <td class="row1"><?php echo $user->lang['Compress_file']; ?>: </td>
<td class="row2"><input type="radio" name="compress" value="none" checked="checked" /> <?php echo $lang['None']; ?><?php <td class="row2"><input type="radio" name="compress" value="none" checked="checked" /> <?php echo $user->lang['None']; ?><?php
if ( extension_loaded('zlib') ) if ( extension_loaded('zlib') )
{ {
@ -158,7 +158,7 @@ switch( $mode )
?> ?>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="backupstart" value="<?php echo $lang['Start_backup']; ?>" class="mainoption" /></td> <td class="cat" colspan="2" align="center"><input type="submit" name="backupstart" value="<?php echo $user->lang['Start_backup']; ?>" class="mainoption" /></td>
</tr> </tr>
</table></form> </table></form>
@ -170,10 +170,10 @@ switch( $mode )
{ {
$meta = "<meta http-equiv=\"refresh\" content=\"0;url=admin_database.$phpEx?mode=backup&amp;type=$backup_type&amp;tables=" . quotemeta($additional_tables) . "&amp;search=$search&amp;store=" . quotemeta($store_path) . "&amp;compress=$compress&amp;backupstart=1&amp;startdownload=1\">"; $meta = "<meta http-equiv=\"refresh\" content=\"0;url=admin_database.$phpEx?mode=backup&amp;type=$backup_type&amp;tables=" . quotemeta($additional_tables) . "&amp;search=$search&amp;store=" . quotemeta($store_path) . "&amp;compress=$compress&amp;backupstart=1&amp;startdownload=1\">";
$message = ( empty($store_path) ) ? $lang['Backup_download'] : $lang['Backup_writing']; $message = ( empty($store_path) ) ? $user->lang['Backup_download'] : $user->lang['Backup_writing'];
page_header($lang['DB_Backup'], $meta); page_header($user->lang['DB_Backup'], $meta);
page_message($lang['DB_Backup'], $message); page_message($user->lang['DB_Backup'], $message);
page_footer(); page_footer();
} }
@ -301,7 +301,7 @@ switch( $mode )
fclose($fp); fclose($fp);
unset($contents); unset($contents);
message_die(MESSAGE, $lang['Backup_success']); message_die(MESSAGE, $user->lang['Backup_success']);
} }
exit; exit;
@ -328,19 +328,19 @@ switch( $mode )
if ( $file_tmpname == '' || $filename == '' || !file_exists($file_tmpname) ) if ( $file_tmpname == '' || $filename == '' || !file_exists($file_tmpname) )
{ {
message_die(MESSAGE, $lang['Restore_Error_no_file']); message_die(MESSAGE, $user->lang['Restore_Error_no_file']);
} }
$ext = substr($filename, strrpos($filename, '.') + 1); $ext = substr($filename, strrpos($filename, '.') + 1);
if ( !preg_match('/^(sql|gz|bz2)$/', $ext) ) if ( !preg_match('/^(sql|gz|bz2)$/', $ext) )
{ {
message_die(MESSAGE, $lang['Restore_Error_filename']); message_die(MESSAGE, $user->lang['Restore_Error_filename']);
} }
if ( ( !extension_loaded('zlib') && $ext == 'gz' ) || ( !extension_loaded('zip') && $ext == 'zip' ) || ( $ext == 'bz2' && !extension_loaded('bz2') ) ) if ( ( !extension_loaded('zlib') && $ext == 'gz' ) || ( !extension_loaded('zip') && $ext == 'zip' ) || ( $ext == 'bz2' && !extension_loaded('bz2') ) )
{ {
message_die(MESSAGE, $lang['Compress_unsupported']); message_die(MESSAGE, $user->lang['Compress_unsupported']);
} }
$sql_query = ''; $sql_query = '';
@ -383,27 +383,27 @@ switch( $mode )
add_admin_log('log_db_restore'); add_admin_log('log_db_restore');
message_die(MESSAGE, $lang['Restore_success']); message_die(MESSAGE, $user->lang['Restore_success']);
} }
// //
// Restore page // Restore page
// //
page_header($lang['DB_Restore']); page_header($user->lang['DB_Restore']);
?> ?>
<h1><?php echo $lang['DB_Restore']; ?></h1> <h1><?php echo $user->lang['DB_Restore']; ?></h1>
<p><?php echo $lang['Restore_explain']; ?></p> <p><?php echo $user->lang['Restore_explain']; ?></p>
<form enctype="multipart/form-data" method="post" action="<?php echo "admin_database.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> <form enctype="multipart/form-data" method="post" action="<?php echo "admin_database.$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> <th colspan="2"><?php echo $user->lang['Select_file']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Upload_file']; ?>: <br /><span class="gensmall"><?php <td class="row1"><?php echo $user->lang['Upload_file']; ?>: <br /><span class="gensmall"><?php
echo $lang['Supported_extensions']; echo $user->lang['Supported_extensions'];
$types = ': <u>sql</u>'; $types = ': <u>sql</u>';
if ( extension_loaded('zlib') ) if ( extension_loaded('zlib') )
@ -421,11 +421,11 @@ switch( $mode )
<td class="row2"><input type="file" name="backup_file" /></td> <td class="row2"><input type="file" name="backup_file" /></td>
</tr> </tr>
<tr> <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="row1"><?php echo $user->lang['Local_backup_file']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Local_backup_file_explain']; ?></span></td>
<td class="row2"><input type="text" name="local" size="40" /></td> <td class="row2"><input type="text" name="local" size="40" /></td>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="restorestart" value="<?php echo $lang['Start_Restore']; ?>" class="mainoption" /></td> <td class="cat" colspan="2" align="center"><input type="submit" name="restorestart" value="<?php echo $user->lang['Start_Restore']; ?>" class="mainoption" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -59,7 +59,7 @@ if( isset($_POST['add_name']) )
if ( !validate_username($disallowed_user) ) if ( !validate_username($disallowed_user) )
{ {
$message = $lang['Disallowed_already']; $message = $user->lang['Disallowed_already'];
} }
else else
{ {
@ -67,10 +67,10 @@ if( isset($_POST['add_name']) )
VALUES('" . str_replace("\'", "''", $disallowed_user) . "')"; VALUES('" . str_replace("\'", "''", $disallowed_user) . "')";
$result = $db->sql_query( $sql ); $result = $db->sql_query( $sql );
$message = $lang['Disallow_successful']; $message = $user->lang['Disallow_successful'];
} }
$message .= '<br /><br />' . sprintf($lang['Click_return_disallowadmin'], '<a href="' . "admin_disallow.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>'); $message .= '<br /><br />' . sprintf($user->lang['Click_return_disallowadmin'], '<a href="' . "admin_disallow.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($user->lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>');
add_admin_log('log_disallow_add', str_replace('%', '*', $disallowed_user)); add_admin_log('log_disallow_add', str_replace('%', '*', $disallowed_user));
@ -84,7 +84,7 @@ else if( isset($_POST['delete_name']) )
WHERE disallow_id = $disallowed_id"; WHERE disallow_id = $disallowed_id";
$db->sql_query($sql); $db->sql_query($sql);
$message .= $lang['Disallowed_deleted'] . '<br /><br />' . sprintf($lang['Click_return_disallowadmin'], '<a href="' . "admin_disallow.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>'); $message .= $user->lang['Disallowed_deleted'] . '<br /><br />' . sprintf($user->lang['Click_return_disallowadmin'], '<a href="' . "admin_disallow.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($user->lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>');
add_admin_log('log_disallow_delete'); add_admin_log('log_disallow_delete');
@ -112,28 +112,28 @@ if ( $row = $db->sql_fetchrow($result) )
// //
// Output page // Output page
// //
page_header($lang['Users']); page_header($user->lang['Users']);
?> ?>
<h1><?php echo $lang['Disallow_control']; ?></h1> <h1><?php echo $user->lang['Disallow_control']; ?></h1>
<p><?php echo $lang['Disallow_explain']; ?></p> <p><?php echo $user->lang['Disallow_explain']; ?></p>
<form method="post" action="<?php echo "admin_disallow.$phpEx$SID"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="<?php echo "admin_disallow.$phpEx$SID"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $lang['Add_disallow_title']; ?></th> <th colspan="2"><?php echo $user->lang['Add_disallow_title']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Username']; ?><br /><span class="gensmall"><?php echo $lang['Add_disallow_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Username']; ?><br /><span class="gensmall"><?php echo $user->lang['Add_disallow_explain']; ?></span></td>
<td class="row2"><input type="text" name="disallowed_user" size="30" />&nbsp;<input type="submit" name="add_name" value="<?php echo $lang['Add_disallow']; ?>" class="mainoption" /></td> <td class="row2"><input type="text" name="disallowed_user" size="30" />&nbsp;<input type="submit" name="add_name" value="<?php echo $user->lang['Add_disallow']; ?>" class="mainoption" /></td>
</tr> </tr>
<tr> <tr>
<th colspan="2"><?php echo $lang['Delete_disallow_title']; ?></th> <th colspan="2"><?php echo $user->lang['Delete_disallow_title']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Username']; ?><br /><span class="gensmall"><?php echo $lang['Delete_disallow_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Username']; ?><br /><span class="gensmall"><?php echo $user->lang['Delete_disallow_explain']; ?></span></td>
<td class="row2"><?php if ( $disallow_select != '' ) { ?><select name="disallowed_id"><?php echo $disallow_select; ?></select>&nbsp;<input type="submit" name="delete_name" value="<?php echo $lang['Delete']; ?>" class="liteoption" /><?php } else { echo $lang['No_disallowed']; } ?></td> <td class="row2"><?php if ( $disallow_select != '' ) { ?><select name="disallowed_id"><?php echo $disallow_select; ?></select>&nbsp;<input type="submit" name="delete_name" value="<?php echo $user->lang['Delete']; ?>" class="liteoption" /><?php } else { echo $user->lang['No_disallowed']; } ?></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -132,7 +132,7 @@ if ( isset($_POST['submit']) )
$emailer->send(); $emailer->send();
$emailer->reset(); $emailer->reset();
message_die(MESSAGE, $lang['Email_sent']); message_die(MESSAGE, $user->lang['Email_sent']);
} }
} }
@ -144,7 +144,7 @@ $sql = "SELECT group_id, group_name
FROM ".GROUPS_TABLE; FROM ".GROUPS_TABLE;
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$select_list = '<select name = "g"><option value = "-1">' . $lang['All_users'] . '</option>'; $select_list = '<select name = "g"><option value = "-1">' . $user->lang['All_users'] . '</option>';
if ( $row = $db->sql_fetchrow($result) ) if ( $row = $db->sql_fetchrow($result) )
{ {
do do
@ -155,32 +155,32 @@ if ( $row = $db->sql_fetchrow($result) )
} }
$select_list .= '</select>'; $select_list .= '</select>';
page_header($lang['Mass_Email']); page_header($user->lang['Mass_Email']);
?> ?>
<h1><?php echo $lang['Mass_Email']; ?></h1> <h1><?php echo $user->lang['Mass_Email']; ?></h1>
<p><?php echo $lang['Mass_email_explain']; ?></p> <p><?php echo $user->lang['Mass_email_explain']; ?></p>
<form method="post" action="<?php echo "admin_mass_email.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1"> <form method="post" action="<?php echo "admin_mass_email.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<tr> <tr>
<th colspan="2"><?php echo $lang['Compose']; ?></th> <th colspan="2"><?php echo $user->lang['Compose']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" align="right"><b><?php echo $lang['Recipients']; ?></b></td> <td class="row1" align="right"><b><?php echo $user->lang['Recipients']; ?></b></td>
<td class="row2" align="left"><?php echo $select_list; ?></td> <td class="row2" align="left"><?php echo $select_list; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1" align="right"><b><?php echo $lang['Subject']; ?></b></td> <td class="row1" align="right"><b><?php echo $user->lang['Subject']; ?></b></td>
<td class="row2"><span class="gen"><input type="text" name="subject" size="45" maxlength="100" tabindex="2" class="post" value="<?php echo $subject; ?>" /></span></td> <td class="row2"><span class="gen"><input type="text" name="subject" size="45" maxlength="100" tabindex="2" class="post" value="<?php echo $subject; ?>" /></span></td>
</tr> </tr>
<tr> <tr>
<td class="row1" align="right" valign="top"><span class="gen"><b><?php echo $lang['Message']; ?></b></span> <td class="row1" align="right" valign="top"><span class="gen"><b><?php echo $user->lang['Message']; ?></b></span>
<td class="row2"><textarea class="post" name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3"><?php echo $message; ?></textarea></td> <td class="row2"><textarea class="post" name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3"><?php echo $message; ?></textarea></td>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input type="submit" value="<?php echo $lang['Email']; ?>" name="submit" class="mainoption" /></td> <td class="cat" colspan="2" align="center"><input type="submit" value="<?php echo $user->lang['Email']; ?>" name="submit" class="mainoption" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -45,7 +45,7 @@ include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
// //
if (!$auth->acl_get('a_forum')) if (!$auth->acl_get('a_forum'))
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
// //
@ -202,7 +202,7 @@ switch ($mode)
VALUES ($forum_id, '$forum_name', '$forum_desc', $parent_id, $left_id, $right_id, $forum_status, $forum_style, $post_count_inc, $prune_enable, $prune_days, $prune_freq)"; VALUES ($forum_id, '$forum_name', '$forum_desc', $parent_id, $left_id, $right_id, $forum_status, $forum_style, $post_count_inc, $prune_enable, $prune_days, $prune_freq)";
$db->sql_query($sql); $db->sql_query($sql);
$message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $parent_id . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="index.' . $phpEx . $SID . '?pane=right' . '">', '</a>'); $message = $user->lang['Forums_updated'] . "<br /><br />" . sprintf($user->lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $parent_id . '">', '</a>') . '<br /><br />' . sprintf($user->lang['Click_return_admin_index'], '<a href="index.' . $phpEx . $SID . '?pane=right' . '">', '</a>');
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
break; break;
@ -252,7 +252,7 @@ switch ($mode)
$db->sql_query_array('UPDATE ' . FORUMS_TABLE . " SET WHERE forum_id = $forum_id", $sql); $db->sql_query_array('UPDATE ' . FORUMS_TABLE . " SET WHERE forum_id = $forum_id", $sql);
$message = $lang['Forums_updated'] . "<br /><br />" . sprintf($lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $parent_id . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="index.' . $phpEx . $SID . '?pane=right' . '">', '</a>'); $message = $user->lang['Forums_updated'] . "<br /><br />" . sprintf($user->lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $parent_id . '">', '</a>') . '<br /><br />' . sprintf($user->lang['Click_return_admin_index'], '<a href="index.' . $phpEx . $SID . '?pane=right' . '">', '</a>');
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
break; break;
@ -280,7 +280,7 @@ switch ($mode)
{ {
if (empty($_POST['posts_to_id'])) if (empty($_POST['posts_to_id']))
{ {
$message = $lang['No_destination_forum'] . '<br /><br />' . sprintf($lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&mode=delete&f=' . $forum_id. '">', '</a>'); $message = $user->lang['No_destination_forum'] . '<br /><br />' . sprintf($user->lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&mode=delete&f=' . $forum_id. '">', '</a>');
message_die(ERROR, $message); message_die(ERROR, $message);
} }
@ -305,7 +305,7 @@ switch ($mode)
{ {
if (empty($_POST['subforums_to_id'])) if (empty($_POST['subforums_to_id']))
{ {
$message = $lang['No_destination_forum'] . '<br /><br />' . sprintf($lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&mode=delete&f=' . $forum_id. '">', '</a>'); $message = $user->lang['No_destination_forum'] . '<br /><br />' . sprintf($user->lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&mode=delete&f=' . $forum_id. '">', '</a>');
message_die(ERROR, $message); message_die(ERROR, $message);
} }
@ -340,7 +340,7 @@ switch ($mode)
$db->sql_query($sql); $db->sql_query($sql);
$return_id = (!empty($_POST['subforums_to_id'])) ? $_POST['subforums_to_id'] : $parent_id; $return_id = (!empty($_POST['subforums_to_id'])) ? $_POST['subforums_to_id'] : $parent_id;
$message = $lang['Forum_deleted'] . '<br /><br />' . sprintf($lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $return_id. '">', '</a>'); $message = $user->lang['Forum_deleted'] . '<br /><br />' . sprintf($user->lang['Click_return_forumadmin'], '<a href="admin_forums.' . $phpEx . $SID . '&parent_id=' . $return_id. '">', '</a>');
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
break; break;
@ -371,9 +371,9 @@ switch ($mode)
$parents_list = make_forums_list('all', $parent_id, $subforums_id); $parents_list = make_forums_list('all', $parent_id, $subforums_id);
$l_title = ($forum_status != ITEM_CATEGORY) ? $lang['Edit_forum'] : $lang['Edit_category']; $l_title = ($forum_status != ITEM_CATEGORY) ? $user->lang['Edit_forum'] : $user->lang['Edit_category'];
$newmode = 'modify'; $newmode = 'modify';
$buttonvalue = $lang['Update']; $buttonvalue = $user->lang['Update'];
$prune_enabled = ($prune_enable) ? 'checked="checked" ' : ''; $prune_enabled = ($prune_enable) ? 'checked="checked" ' : '';
if ($forum_status != ITEM_CATEGORY) if ($forum_status != ITEM_CATEGORY)
@ -390,9 +390,9 @@ switch ($mode)
} }
$parents_list = make_forums_list('all', $parent_id); $parents_list = make_forums_list('all', $parent_id);
$l_title = $lang['Create_forum']; $l_title = $user->lang['Create_forum'];
$newmode = 'create'; $newmode = 'create';
$buttonvalue = $lang['Create_forum']; $buttonvalue = $user->lang['Create_forum'];
$forum_desc = ''; $forum_desc = '';
$forum_style = ''; $forum_style = '';
@ -414,27 +414,27 @@ switch ($mode)
$forum_checked = ($forum_status != ITEM_CATEGORY) ? 'checked="checked" ' : ''; $forum_checked = ($forum_status != ITEM_CATEGORY) ? 'checked="checked" ' : '';
$category_checked = ($forum_status == ITEM_CATEGORY) ? 'checked="checked" ' : ''; $category_checked = ($forum_status == ITEM_CATEGORY) ? 'checked="checked" ' : '';
$statuslist = '<option value="' . ITEM_UNLOCKED . '"' . $forumunlocked . '>' . $lang['Unlocked'] . "</option>\n"; $statuslist = '<option value="' . ITEM_UNLOCKED . '"' . $forumunlocked . '>' . $user->lang['Unlocked'] . "</option>\n";
$statuslist .= '<option value="' . ITEM_LOCKED . '"' . $forumlocked . '>' . $lang['Locked'] . "</option>\n"; $statuslist .= '<option value="' . ITEM_LOCKED . '"' . $forumlocked . '>' . $user->lang['Locked'] . "</option>\n";
page_header($l_title); page_header($l_title);
?> ?>
<h1><?php echo $l_title ?></h1> <h1><?php echo $l_title ?></h1>
<p><?php echo $lang['Forum_edit_delete_explain'] ?></p> <p><?php echo $user->lang['Forum_edit_delete_explain'] ?></p>
<form action="<?php echo "admin_forums.$phpEx$SID" ?>" method="post"> <form action="<?php echo "admin_forums.$phpEx$SID" ?>" method="post">
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> <table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<tr> <tr>
<th class="thHead" colspan="2"><?php echo $lang['General_settings'] ?></th> <th class="thHead" colspan="2"><?php echo $user->lang['General_settings'] ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo ($forum_status != ITEM_CATEGORY) ? $lang['Forum_name'] : $lang['Category_name'] ?></td> <td class="row1"><?php echo ($forum_status != ITEM_CATEGORY) ? $user->lang['Forum_name'] : $user->lang['Category_name'] ?></td>
<td class="row2"><input type="text" size="25" name="forum_name" value="<?php echo $forum_name ?>" class="post" /></td> <td class="row2"><input type="text" size="25" name="forum_name" value="<?php echo $forum_name ?>" class="post" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Forum_desc'] ?></td> <td class="row1"><?php echo $user->lang['Forum_desc'] ?></td>
<td class="row2"><textarea rows="5" cols="45" wrap="virtual" name="forum_desc" class="post"><?php echo $forum_desc ?></textarea></td> <td class="row2"><textarea rows="5" cols="45" wrap="virtual" name="forum_desc" class="post"><?php echo $forum_desc ?></textarea></td>
</tr> </tr>
<?php <?php
@ -443,22 +443,22 @@ switch ($mode)
{ {
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['Forum_type'] ?></td> <td class="row1"><?php echo $user->lang['Forum_type'] ?></td>
<td class="row2"><input type="radio" name="is_category" value="0" <?php echo $forum_checked ?>/><?php echo $lang['Forum'] ?> &nbsp; <input type="radio" name="is_category" value="1" <?php echo $category_checked ?>/><?php echo $lang['Category'] ?></td> <td class="row2"><input type="radio" name="is_category" value="0" <?php echo $forum_checked ?>/><?php echo $user->lang['Forum'] ?> &nbsp; <input type="radio" name="is_category" value="1" <?php echo $category_checked ?>/><?php echo $user->lang['Category'] ?></td>
</tr> </tr>
<?php <?php
} }
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['Parent'] ?></td> <td class="row1"><?php echo $user->lang['Parent'] ?></td>
<td class="row2"><select name="parent_id"> <td class="row2"><select name="parent_id">
<option value="0"><?php echo $lang['No_parent'] ?></option> <option value="0"><?php echo $user->lang['No_parent'] ?></option>
<?php echo $parents_list ?></select></td> <?php echo $parents_list ?></select></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Style'] ?></td> <td class="row1"><?php echo $user->lang['Style'] ?></td>
<td class="row2"><select name="forum_style"><option value="0"><?php echo $lang['Default_style'] ?></option><?php echo $styles_list ?></select></td> <td class="row2"><select name="forum_style"><option value="0"><?php echo $user->lang['Default_style'] ?></option><?php echo $styles_list ?></select></td>
</tr> </tr>
<?php <?php
@ -466,16 +466,16 @@ switch ($mode)
{ {
?> ?>
<tr> <tr>
<th class="thHead" colspan="2"><?php echo $lang['Forum_settings'] ?></th> <th class="thHead" colspan="2"><?php echo $user->lang['Forum_settings'] ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Forum_status'] ?></td> <td class="row1"><?php echo $user->lang['Forum_status'] ?></td>
<td class="row2"><select name="forum_status"><?php echo $statuslist ?></select></td> <td class="row2"><select name="forum_status"><?php echo $statuslist ?></select></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Options'] ?></td> <td class="row1"><?php echo $user->lang['Options'] ?></td>
<td class="row2"> <td class="row2">
<input type="checkbox" name="disable_post_count" <?php echo ((!empty($post_count_inc)) ? '' : 'checked="checked" ') ?>/><?php echo $lang['Disable_post_count'] ?> <input type="checkbox" name="disable_post_count" <?php echo ((!empty($post_count_inc)) ? '' : 'checked="checked" ') ?>/><?php echo $user->lang['Disable_post_count'] ?>
<?php <?php
if ($mode == 'edit' && $parent_id > 0) if ($mode == 'edit' && $parent_id > 0)
{ {
@ -488,7 +488,7 @@ switch ($mode)
{ {
?> ?>
<br /> <br />
<input type="checkbox" name="display_on_index" <?php echo ((!empty($display_on_index)) ? '' : 'checked="checked" ') ?>/><?php echo $lang['Display_on_index'] ?> <input type="checkbox" name="display_on_index" <?php echo ((!empty($display_on_index)) ? '' : 'checked="checked" ') ?>/><?php echo $user->lang['Display_on_index'] ?>
<?php <?php
} }
} }
@ -500,29 +500,29 @@ switch ($mode)
{ {
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['Forum_type'] ?></td> <td class="row1"><?php echo $user->lang['Forum_type'] ?></td>
<td class="row2"><input type="checkbox" name="set_category" /><?php echo $lang['Set_as_category'] ?><br /> <td class="row2"><input type="checkbox" name="set_category" /><?php echo $user->lang['Set_as_category'] ?><br />
&nbsp; &nbsp; &nbsp;<input type="radio" name="action" value="delete" checked="checked" /><?php echo $lang['Delete_all_posts'] ?><br /> &nbsp; &nbsp; &nbsp;<input type="radio" name="action" value="delete" checked="checked" /><?php echo $user->lang['Delete_all_posts'] ?><br />
&nbsp; &nbsp; &nbsp;<input type="radio" name="action" value="move" /><?php echo $lang['Move_posts_to'] ?> <select name="to_forum_id"><?php echo $forums_list ?></select> &nbsp; &nbsp; &nbsp;<input type="radio" name="action" value="move" /><?php echo $user->lang['Move_posts_to'] ?> <select name="to_forum_id"><?php echo $forums_list ?></select>
</td> </td>
</tr> </tr>
<?php <?php
} }
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['Forum_pruning'] ?></td> <td class="row1"><?php echo $user->lang['Forum_pruning'] ?></td>
<td class="row2"><table cellspacing="0" cellpadding="1" border="0"> <td class="row2"><table cellspacing="0" cellpadding="1" border="0">
<tr> <tr>
<td align="right" valign="middle"><?php echo $lang['Enabled'] ?></td> <td align="right" valign="middle"><?php echo $user->lang['Enabled'] ?></td>
<td align="left" valign="middle"><input type="checkbox" name="prune_enable" value="1" <?php echo $prune_enabled ?>/></td> <td align="left" valign="middle"><input type="checkbox" name="prune_enable" value="1" <?php echo $prune_enabled ?>/></td>
</tr> </tr>
<tr> <tr>
<td align="right" valign="middle"><?php echo $lang['prune_days'] ?></td> <td align="right" valign="middle"><?php echo $user->lang['prune_days'] ?></td>
<td align="left" valign="middle">&nbsp;<input type="text" name="prune_days" value="<?php echo $prune_days ?>" size="5" class="post" />&nbsp;<?php echo $lang['Days'] ?></td> <td align="left" valign="middle">&nbsp;<input type="text" name="prune_days" value="<?php echo $prune_days ?>" size="5" class="post" />&nbsp;<?php echo $user->lang['Days'] ?></td>
</tr> </tr>
<tr> <tr>
<td align="right" valign="middle"><?php echo $lang['prune_freq'] ?></td> <td align="right" valign="middle"><?php echo $user->lang['prune_freq'] ?></td>
<td align="left" valign="middle">&nbsp;<input type="text" name="prune_freq" value="<?php echo $prune_freq ?>" size="5" class="post" />&nbsp;<?php echo $lang['Days'] ?></td> <td align="left" valign="middle">&nbsp;<input type="text" name="prune_freq" value="<?php echo $prune_freq ?>" size="5" class="post" />&nbsp;<?php echo $user->lang['Days'] ?></td>
</tr> </tr>
</table></td> </table></td>
</tr> </tr>
@ -542,7 +542,7 @@ switch ($mode)
break; break;
case 'delete': case 'delete':
page_header($lang['Forum_delete']); page_header($user->lang['Forum_delete']);
extract(get_forum_info($_GET['f'])); extract(get_forum_info($_GET['f']));
$subforums_id = array(); $subforums_id = array();
@ -556,17 +556,17 @@ switch ($mode)
$move_posts_list = make_forums_list('forums', $parent_id, $subforums_id); $move_posts_list = make_forums_list('forums', $parent_id, $subforums_id);
?> ?>
<h1><?php echo $lang['Forum_delete'] ?></h1> <h1><?php echo $user->lang['Forum_delete'] ?></h1>
<p><?php echo $lang['Forum_delete_explain'] ?></p> <p><?php echo $user->lang['Forum_delete_explain'] ?></p>
<form action="admin_forums.<?php echo $phpEx . $SID ?>&mode=remove&f=<?php echo $forum_id ?>" method="post"> <form action="admin_forums.<?php echo $phpEx . $SID ?>&mode=remove&f=<?php echo $forum_id ?>" method="post">
<table cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> <table cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<tr> <tr>
<th colspan="2" class="thHead"><?php echo $lang['Forum_delete'] ?></th> <th colspan="2" class="thHead"><?php echo $user->lang['Forum_delete'] ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo ($forum_status == ITEM_CATEGORY) ? $lang['Category_name'] : $lang['Forum_name'] ?></td> <td class="row1"><?php echo ($forum_status == ITEM_CATEGORY) ? $user->lang['Category_name'] : $user->lang['Forum_name'] ?></td>
<td class="row1"><span class="row1"><?php echo $forum_name ?></span></td> <td class="row1"><span class="row1"><?php echo $forum_name ?></span></td>
</tr> </tr>
<?php <?php
@ -574,12 +574,12 @@ switch ($mode)
{ {
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['Action'] ?></td> <td class="row1"><?php echo $user->lang['Action'] ?></td>
<td class="row1"><input type="radio" name="action_posts" value="delete" checked="checked" /> <?php echo $lang['Delete_all_posts'] ?></td> <td class="row1"><input type="radio" name="action_posts" value="delete" checked="checked" /> <?php echo $user->lang['Delete_all_posts'] ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"></td> <td class="row1"></td>
<td class="row1"><input type="radio" name="action_posts" value="move" /> <?php echo $lang['Move_posts_to'] ?> <select name="posts_to_id" ?><option value="0"></option><?php echo $move_posts_list ?></select></td> <td class="row1"><input type="radio" name="action_posts" value="move" /> <?php echo $user->lang['Move_posts_to'] ?> <select name="posts_to_id" ?><option value="0"></option><?php echo $move_posts_list ?></select></td>
</tr> </tr>
<?php <?php
} }
@ -587,18 +587,18 @@ switch ($mode)
{ {
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['Action'] ?></td> <td class="row1"><?php echo $user->lang['Action'] ?></td>
<td class="row1"><input type="radio" name="action_subforums" value="delete" checked="checked" /> <?php echo $lang['Delete_subforums'] ?></td> <td class="row1"><input type="radio" name="action_subforums" value="delete" checked="checked" /> <?php echo $user->lang['Delete_subforums'] ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"></td> <td class="row1"></td>
<td class="row1"><input type="radio" name="action_subforums" value="move" /> <?php echo $lang['Move_subforums_to'] ?> <select name="subforums_to_id" ?><option value="0"></option><?php echo $forums_list ?></select></td> <td class="row1"><input type="radio" name="action_subforums" value="move" /> <?php echo $user->lang['Move_subforums_to'] ?> <select name="subforums_to_id" ?><option value="0"></option><?php echo $forums_list ?></select></td>
</tr> </tr>
<?php <?php
} }
?> ?>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $lang['Move_and_Delete'] ?>" class="mainoption" /></td> <td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $user->lang['Move_and_Delete'] ?>" class="mainoption" /></td>
</tr> </tr>
</table> </table>
</form> </form>
@ -615,7 +615,7 @@ if (empty($show_index))
page_footer(); page_footer();
} }
page_header($lang['Manage']); page_header($user->lang['Manage']);
$parent_id = (!empty($_GET['parent_id'])) ? $_GET['parent_id'] : 0; $parent_id = (!empty($_GET['parent_id'])) ? $_GET['parent_id'] : 0;
@ -648,7 +648,7 @@ else
<?php echo $navigation ?><br /> <?php echo $navigation ?><br />
<form method="post" action="<?php echo "admin_forums.$phpEx$SID&mode=add" ?>"><table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center"> <form method="post" action="<?php echo "admin_forums.$phpEx$SID&mode=add" ?>"><table width="100%" cellpadding="4" cellspacing="1" border="0" class="forumline" align="center">
<tr> <tr>
<th class="thHead" colspan="9"><?php echo $lang['Forum_admin'] ?></th> <th class="thHead" colspan="9"><?php echo $user->lang['Forum_admin'] ?></th>
</tr> </tr>
<?php <?php
@ -690,9 +690,9 @@ while ($row = $db->sql_fetchrow($result))
?> ?>
<tr> <tr>
<td class="cat" colspan="5"><span class="cattitle"><b><?php echo $forum_title ?></b></span></td> <td class="cat" colspan="5"><span class="cattitle"><b><?php echo $forum_title ?></b></span></td>
<td class="cat" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $lang['Edit'] ?></a></span></td> <td class="cat" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $user->lang['Edit'] ?></a></span></td>
<td class="cat" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $lang['Delete'] ?></a></span></td> <td class="cat" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $user->lang['Delete'] ?></a></span></td>
<td class="cat" align="center" valign="middle" nowrap="nowrap"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up&parent_id=<?php echo $parent_id ?>"><?php echo $lang['Move_up'] ?></a> <a href="admin_forums.<?php echo $url ?>&mode=move_down&parent_id=<?php echo $parent_id ?>"><?php echo $lang['Move_down'] ?></a></span></td> <td class="cat" align="center" valign="middle" nowrap="nowrap"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_up'] ?></a> <a href="admin_forums.<?php echo $url ?>&mode=move_down&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_down'] ?></a></span></td>
<td class="cat" align="center" valign="middle"><span class="gen">&nbsp</span></td> <td class="cat" align="center" valign="middle"><span class="gen">&nbsp</span></td>
</tr> </tr>
@ -732,17 +732,17 @@ while ($row = $db->sql_fetchrow($result))
<td width="1" class="row3"></td> <td width="1" class="row3"></td>
<td width="40%" class="row2"<?php echo $colspan ?>><span class="gen"><?php echo $forum_title ?></span><br /><span class="gensmall"><?php echo $forum_desc ?></span></td> <td width="40%" class="row2"<?php echo $colspan ?>><span class="gen"><?php echo $forum_title ?></span><br /><span class="gensmall"><?php echo $forum_desc ?></span></td>
<?php echo $forum_stats ?> <?php echo $forum_stats ?>
<td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $lang['Edit'] ?></a></span></td> <td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $user->lang['Edit'] ?></a></span></td>
<td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $lang['Delete'] ?></a></span></td> <td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $user->lang['Delete'] ?></a></span></td>
<td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up&parent_id=<?php echo $parent_id ?>"><?php echo $lang['Move_up'] ?></a> <br /> <a href="admin_forums.<?php echo $url ?>&mode=move_down&parent_id=<?php echo $parent_id ?>"><?php echo $lang['Move_down'] ?></a></span></td> <td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_up'] ?></a> <br /> <a href="admin_forums.<?php echo $url ?>&mode=move_down&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_down'] ?></a></span></td>
<td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=resync&parent_id=<?php echo $parent_id ?>"><?php echo ($sub_row['forum_status'] != ITEM_CATEGORY) ? $lang['Resync'] : '&nbsp;' ?></a></span></td> <td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=resync&parent_id=<?php echo $parent_id ?>"><?php echo ($sub_row['forum_status'] != ITEM_CATEGORY) ? $user->lang['Resync'] : '&nbsp;' ?></a></span></td>
</tr> </tr>
<?php <?php
} }
?> ?>
<tr> <tr>
<td width="1" class="row3"></td> <td width="1" class="row3"></td>
<td width="100%" colspan="8" class="row2"><input type="text" name="forum_name[<? echo $row['forum_id'] ?>]" /> <input type="submit" class="liteoption" name="parent_id[<? echo $row['forum_id'] ?>]" value="<?php echo $lang['Create_forum'] ?>" /></td> <td width="100%" colspan="8" class="row2"><input type="text" name="forum_name[<? echo $row['forum_id'] ?>]" /> <input type="submit" class="liteoption" name="parent_id[<? echo $row['forum_id'] ?>]" value="<?php echo $user->lang['Create_forum'] ?>" /></td>
</tr> </tr>
<?php <?php
} }
@ -752,10 +752,10 @@ while ($row = $db->sql_fetchrow($result))
<tr> <tr>
<td width="40%" class="row2"<?php echo $colspan ?>><span class="gen"><?php echo $forum_title ?></span><br /><span class="gensmall"><?php echo $forum_desc ?></span></td> <td width="40%" class="row2"<?php echo $colspan ?>><span class="gen"><?php echo $forum_title ?></span><br /><span class="gensmall"><?php echo $forum_desc ?></span></td>
<?php echo $forum_stats ?> <?php echo $forum_stats ?>
<td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $lang['Edit'] ?></a></span></td> <td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $user->lang['Edit'] ?></a></span></td>
<td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $lang['Delete'] ?></a></span></td> <td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $user->lang['Delete'] ?></a></span></td>
<td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up&parent_id=<?php echo $parent_id ?>"><?php echo $lang['Move_up'] ?></a> <br /> <a href="admin_forums.<?php echo $url ?>&mode=move_down&parent_id=<?php echo $parent_id ?>"><?php echo $lang['Move_down'] ?></a></span></td> <td class="row2" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=move_up&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_up'] ?></a> <br /> <a href="admin_forums.<?php echo $url ?>&mode=move_down&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Move_down'] ?></a></span></td>
<td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=resync&parent_id=<?php echo $parent_id ?>"><?php echo $lang['Resync'] ?></a></span></td> <td class="row1" align="center" valign="middle"><span class="gen"><a href="admin_forums.<?php echo $url ?>&mode=resync&parent_id=<?php echo $parent_id ?>"><?php echo $user->lang['Resync'] ?></a></span></td>
</tr> </tr>
<?php <?php
} }
@ -763,7 +763,7 @@ while ($row = $db->sql_fetchrow($result))
?> ?>
<tr> <tr>
<td width="100%" colspan="9" class="cat"><input type="text" name="forum_name[<? echo $parent_id ?>]" /> <input type="submit" class="liteoption" name="parent_id[<? echo $parent_id ?>]" value="<?php echo $lang['Create_forum'] ?>" /></td> <td width="100%" colspan="9" class="cat"><input type="text" name="forum_name[<? echo $parent_id ?>]" /> <input type="submit" class="liteoption" name="parent_id[<? echo $parent_id ?>]" value="<?php echo $user->lang['Create_forum'] ?>" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -47,7 +47,7 @@ require('pagestart.' . $phpEx);
// //
if ( !$auth->acl_get('a_group') ) if ( !$auth->acl_get('a_group') )
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
if( isset($_POST[POST_GROUPS_URL]) || isset($_GET[POST_GROUPS_URL]) ) if( isset($_POST[POST_GROUPS_URL]) || isset($_GET[POST_GROUPS_URL]) )
@ -96,7 +96,7 @@ if( isset($_POST['edit']) || isset($_POST['new']) )
if( !$db->sql_numrows($result) ) if( !$db->sql_numrows($result) )
{ {
message_die(GENERAL_MESSAGE, $lang['Group_not_exist']); message_die(GENERAL_MESSAGE, $user->lang['Group_not_exist']);
} }
$group_info = $db->sql_fetchrow($result); $group_info = $db->sql_fetchrow($result);
@ -151,23 +151,23 @@ if( isset($_POST['edit']) || isset($_POST['new']) )
"GROUP_DESCRIPTION" => $group_info['group_description'], "GROUP_DESCRIPTION" => $group_info['group_description'],
"GROUP_MODERATOR" => $group_moderator, "GROUP_MODERATOR" => $group_moderator,
"L_GROUP_TITLE" => $lang['Group_administration'], "L_GROUP_TITLE" => $user->lang['Group_administration'],
"L_GROUP_EDIT_DELETE" => ( isset($_POST['new']) ) ? $lang['New_group'] : $lang['Edit_group'], "L_GROUP_EDIT_DELETE" => ( isset($_POST['new']) ) ? $user->lang['New_group'] : $user->lang['Edit_group'],
"L_GROUP_NAME" => $lang['group_name'], "L_GROUP_NAME" => $user->lang['group_name'],
"L_GROUP_DESCRIPTION" => $lang['group_description'], "L_GROUP_DESCRIPTION" => $user->lang['group_description'],
"L_GROUP_MODERATOR" => $lang['group_moderator'], "L_GROUP_MODERATOR" => $user->lang['group_moderator'],
"L_FIND_USERNAME" => $lang['Find_username'], "L_FIND_USERNAME" => $user->lang['Find_username'],
"L_GROUP_STATUS" => $lang['group_status'], "L_GROUP_STATUS" => $user->lang['group_status'],
"L_GROUP_OPEN" => $lang['group_open'], "L_GROUP_OPEN" => $user->lang['group_open'],
"L_GROUP_CLOSED" => $lang['group_closed'], "L_GROUP_CLOSED" => $user->lang['group_closed'],
"L_GROUP_HIDDEN" => $lang['group_hidden'], "L_GROUP_HIDDEN" => $user->lang['group_hidden'],
"L_GROUP_DELETE" => $lang['group_delete'], "L_GROUP_DELETE" => $user->lang['group_delete'],
"L_GROUP_DELETE_CHECK" => $lang['group_delete_check'], "L_GROUP_DELETE_CHECK" => $user->lang['group_delete_check'],
"L_SUBMIT" => $lang['Submit'], "L_SUBMIT" => $user->lang['Submit'],
"L_RESET" => $lang['Reset'], "L_RESET" => $user->lang['Reset'],
"L_DELETE_MODERATOR" => $lang['delete_group_moderator'], "L_DELETE_MODERATOR" => $user->lang['delete_group_moderator'],
"L_DELETE_MODERATOR_EXPLAIN" => $lang['delete_moderator_explain'], "L_DELETE_MODERATOR_EXPLAIN" => $user->lang['delete_moderator_explain'],
"L_YES" => $lang['Yes'], "L_YES" => $user->lang['Yes'],
"U_SEARCH_USER" => append_sid("../search.$phpEx?mode=searchuser"), "U_SEARCH_USER" => append_sid("../search.$phpEx?mode=searchuser"),
@ -212,7 +212,7 @@ else if( isset($_POST['group_update']) )
message_die(GENERAL_ERROR, "Couldn't update auth_access", "", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Couldn't update auth_access", "", __LINE__, __FILE__, $sql);
} }
$message = $lang['Deleted_group'] . "<br /><br />" . sprintf($lang['Click_return_groupsadmin'], "<a href=\"" . append_sid("admin_groups.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");; $message = $user->lang['Deleted_group'] . "<br /><br />" . sprintf($user->lang['Click_return_groupsadmin'], "<a href=\"" . append_sid("admin_groups.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($user->lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");;
message_die(GENERAL_MESSAGE, $message); message_die(GENERAL_MESSAGE, $message);
} }
@ -226,11 +226,11 @@ else if( isset($_POST['group_update']) )
if( $group_name == "" ) if( $group_name == "" )
{ {
message_die(GENERAL_MESSAGE, $lang['No_group_name']); message_die(GENERAL_MESSAGE, $user->lang['No_group_name']);
} }
else if( $group_moderator == "" ) else if( $group_moderator == "" )
{ {
message_die(GENERAL_MESSAGE, $lang['No_group_moderator']); message_die(GENERAL_MESSAGE, $user->lang['No_group_moderator']);
} }
$this_userdata = get_userdata($group_moderator); $this_userdata = get_userdata($group_moderator);
@ -238,7 +238,7 @@ else if( isset($_POST['group_update']) )
if( !$group_moderator ) if( !$group_moderator )
{ {
message_die(GENERAL_MESSAGE, $lang['No_group_moderator']); message_die(GENERAL_MESSAGE, $user->lang['No_group_moderator']);
} }
if( $mode == "editgroup" ) if( $mode == "editgroup" )
@ -253,7 +253,7 @@ else if( isset($_POST['group_update']) )
} }
if( !$db->sql_numrows($result) ) if( !$db->sql_numrows($result) )
{ {
message_die(GENERAL_MESSAGE, $lang['Group_not_exist']); message_die(GENERAL_MESSAGE, $user->lang['Group_not_exist']);
} }
$group_info = $db->sql_fetchrow($result); $group_info = $db->sql_fetchrow($result);
@ -284,7 +284,7 @@ else if( isset($_POST['group_update']) )
message_die(GENERAL_ERROR, "Couldn't update group", "", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Couldn't update group", "", __LINE__, __FILE__, $sql);
} }
$message = $lang['Updated_group'] . "<br /><br />" . sprintf($lang['Click_return_groupsadmin'], "<a href=\"" . append_sid("admin_groups.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");; $message = $user->lang['Updated_group'] . "<br /><br />" . sprintf($user->lang['Click_return_groupsadmin'], "<a href=\"" . append_sid("admin_groups.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($user->lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");;
message_die(GENERAL_MESSAGE, $message); message_die(GENERAL_MESSAGE, $message);
} }
@ -314,29 +314,29 @@ else if( isset($_POST['group_update']) )
message_die(GENERAL_ERROR, "Couldn't insert new user-group info", "", __LINE__, __FILE__, $sql); message_die(GENERAL_ERROR, "Couldn't insert new user-group info", "", __LINE__, __FILE__, $sql);
} }
$message = $lang['Added_new_group'] . "<br /><br />" . sprintf($lang['Click_return_groupsadmin'], "<a href=\"" . append_sid("admin_groups.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");; $message = $user->lang['Added_new_group'] . "<br /><br />" . sprintf($user->lang['Click_return_groupsadmin'], "<a href=\"" . append_sid("admin_groups.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($user->lang['Click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");;
message_die(GENERAL_MESSAGE, $message); message_die(GENERAL_MESSAGE, $message);
} }
else else
{ {
message_die(GENERAL_MESSAGE, $lang['Group_mode_not_selected']); message_die(GENERAL_MESSAGE, $user->lang['Group_mode_not_selected']);
} }
} }
} }
page_header($lang['Manage']); page_header($user->lang['Manage']);
?> ?>
<h1><?php echo $lang['Manage']; ?></h1> <h1><?php echo $user->lang['Manage']; ?></h1>
<p><?php echo $lang['Group_manage_explain']; ?></p> <p><?php echo $user->lang['Group_manage_explain']; ?></p>
<form method="post" action="<?php echo "admin_groups.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="<?php echo "admin_groups.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="3"><?php echo $lang['Manage']; ?></th> <th colspan="3"><?php echo $user->lang['Manage']; ?></th>
</tr> </tr>
<?php <?php
@ -375,13 +375,13 @@ page_header($lang['Manage']);
foreach ( $groups as $group_ary ) foreach ( $groups as $group_ary )
{ {
$group_id = $group_ary['group_id']; $group_id = $group_ary['group_id'];
$group_name = ( !empty($lang[$group_ary['group_name']]) ) ? $lang[$group_ary['group_name']] : $group_ary['group_name']; $group_name = ( !empty($user->lang[$group_ary['group_name']]) ) ? $user->lang[$group_ary['group_name']] : $group_ary['group_name'];
?> ?>
<tr> <tr>
<td class="cat"><span class="cattitle"><?php echo $group_name;?></span></td> <td class="cat"><span class="cattitle"><?php echo $group_name;?></span></td>
<td class="cat" align="center">&nbsp;<input class="liteoption" type="submit" name="edit[<?php echo $group_id; ?>]" value="<?php echo $lang['Edit'];?>" />&nbsp;</td> <td class="cat" align="center">&nbsp;<input class="liteoption" type="submit" name="edit[<?php echo $group_id; ?>]" value="<?php echo $user->lang['Edit'];?>" />&nbsp;</td>
<td class="cat" align="center">&nbsp;<input class="liteoption" type="submit" name="delete[<?php echo $group_id; ?>]" value="<?php echo $lang['Delete'];?>" />&nbsp;</td> <td class="cat" align="center">&nbsp;<input class="liteoption" type="submit" name="delete[<?php echo $group_id; ?>]" value="<?php echo $user->lang['Delete'];?>" />&nbsp;</td>
</tr> </tr>
<?php <?php
@ -394,8 +394,8 @@ page_header($lang['Manage']);
?> ?>
<tr> <tr>
<td class="<?php echo $row_class; ?>"><?php echo $pending_ary['username'];?></td> <td class="<?php echo $row_class; ?>"><?php echo $pending_ary['username'];?></td>
<td class="<?php echo $row_class; ?>" align="center"><input class="liteoption" type="submit" name="approve[<?php echo $pending_ary['user_id']; ?>]" value="<?php echo $lang['Approve_selected'];?>" /></td> <td class="<?php echo $row_class; ?>" align="center"><input class="liteoption" type="submit" name="approve[<?php echo $pending_ary['user_id']; ?>]" value="<?php echo $user->lang['Approve_selected'];?>" /></td>
<td class="<?php echo $row_class; ?>" align="center"><input class="liteoption" type="submit" name="decline[<?php echo $pending_ary['user_id']; ?>]" value="<?php echo $lang['Deny_selected'];?>" /></td> <td class="<?php echo $row_class; ?>" align="center"><input class="liteoption" type="submit" name="decline[<?php echo $pending_ary['user_id']; ?>]" value="<?php echo $user->lang['Deny_selected'];?>" /></td>
</tr> </tr>
<?php <?php
} }

View file

@ -36,9 +36,8 @@ if ( !empty($setmodules) )
} }
define('IN_PHPBB', 1); define('IN_PHPBB', 1);
//
// Include files // Include files
//
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
@ -47,7 +46,7 @@ require($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
// Do we have forum admin permissions? // Do we have forum admin permissions?
if ( !$auth->acl_get('a_auth') ) if ( !$auth->acl_get('a_auth') )
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
// Define some vars // Define some vars
@ -71,77 +70,55 @@ else
$mode = ''; $mode = '';
} }
//
// Start program proper // Start program proper
//
switch ( $mode ) switch ( $mode )
{ {
case 'forums': case 'forums':
$l_title = $lang['Permissions']; $l_title = $user->lang['Permissions'];
$l_title_explain = $lang['Permissions_explain']; $l_title_explain = $user->lang['Permissions_explain'];
$l_can = '_can'; $l_can = '_can';
break; break;
case 'moderators': case 'moderators':
$l_title = $lang['Moderators']; $l_title = $user->lang['Moderators'];
$l_title_explain = $lang['Moderators_explain']; $l_title_explain = $user->lang['Moderators_explain'];
$l_can = '_can'; $l_can = '_can';
break; break;
case 'supermoderators': case 'supermoderators':
$l_title = $lang['Super_Moderators']; $l_title = $user->lang['Super_Moderators'];
$l_title_explain = $lang['Super_Moderators_explain']; $l_title_explain = $user->lang['Super_Moderators_explain'];
$l_can = '_can'; $l_can = '_can';
break; break;
case 'administrators': case 'administrators':
$l_title = $lang['Administrators']; $l_title = $user->lang['Administrators'];
$l_title_explain = $lang['Administrators_explain']; $l_title_explain = $user->lang['Administrators_explain'];
$l_can = '_can_admin'; $l_can = '_can_admin';
break; break;
} }
// // Call update or delete, both can take multiple user/group
// Brief explanation of how things work when updating ... // ids. Additionally inheritance is handled (by the auth API)
//
// Granting someone any admin permissions grants them permissions
// to all other options, e.g. Moderator and Forums across the board.
// This is done via the acl class
//
if ( isset($_POST['update']) ) if ( isset($_POST['update']) )
{ {
$auth_admin = new auth_admin(); $auth_admin = new auth_admin();
switch ( $_POST['type'] ) // Admin wants subforums to inherit permissions ... so handle this
if ( !empty($_POST['inherit']) )
{ {
case 'user': array_push($_POST['inherit'], $forum_id);
$set = 'acl_set_user'; $forum_id = $_POST['inherit'];
break;
case 'group':
$set = 'acl_set_group';
break;
} }
foreach ( $_POST['entries'] as $id ) foreach ( $_POST['entries'] as $id )
{ {
$auth_admin->$set($forum_id, $id, $_POST['option']); $auth_admin->acl_set($_POST['type'], $forum_id, $id, $_POST['option']);
} }
message_die(MESSAGE, 'Permissions updated successfully'); trigger_error('Permissions updated successfully');
} }
else if ( isset($_POST['delete']) ) else if ( isset($_POST['delete']) )
{ {
$auth_admin = new auth_admin(); $auth_admin = new auth_admin();
switch ( $_POST['type'] )
{
case 'user':
$set = 'acl_delete_user';
break;
case 'group':
$set = 'acl_delete_group';
break;
}
$option_ids = false; $option_ids = false;
if ( !empty($_POST['option']) ) if ( !empty($_POST['option']) )
{ {
@ -164,23 +141,21 @@ else if ( isset($_POST['delete']) )
foreach ( $_POST['entries'] as $id ) foreach ( $_POST['entries'] as $id )
{ {
$auth_admin->$set($forum_id, $id, $option_ids); $auth_admin->acl_delete($_POST['type'], $forum_id, $id, $option_ids);
} }
message_die(MESSAGE, 'Permissions updated successfully'); trigger_error('Permissions updated successfully');
} }
//
// Get required information, either all forums if // Get required information, either all forums if
// no id was specified or just the requsted if it // no id was specified or just the requsted if it
// was // was
//
if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators' ) if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators' )
{ {
// //
// Clear some vars, grab some info if relevant ... // Clear some vars, grab some info if relevant ...
//
$s_hidden_fields = ''; $s_hidden_fields = '';
if ( !empty($forum_id) ) if ( !empty($forum_id) )
{ {
$sql = "SELECT forum_name $sql = "SELECT forum_name
@ -194,17 +169,13 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
$l_title .= ' : <i>' . $forum_info['forum_name'] . '</i>'; $l_title .= ' : <i>' . $forum_info['forum_name'] . '</i>';
} }
//
// Generate header // Generate header
//
page_header($l_title); page_header($l_title);
?> ?>
<h1><?php echo $l_title; ?></h1> <h1><?php echo $l_title; ?></h1>
<p><?php echo $l_title_explain; ?></p>
<?php <?php
switch ( $mode ) switch ( $mode )
@ -238,7 +209,7 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
$group_list = ''; $group_list = '';
while ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{ {
$group_list .= '<option value="' . $row['group_id'] . '">' . ( ( !empty($lang[$row['group_name']]) ) ? $lang[$row['group_name']] : $row['group_name'] ) . '</option>'; $group_list .= '<option value="' . $row['group_id'] . '">' . ( ( !empty($user->lang[$row['group_name']]) ) ? $user->lang[$row['group_name']] : $row['group_name'] ) . '</option>';
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -247,10 +218,12 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
?> ?>
<p><?php echo $l_title_explain; ?></p>
<table width="100%" cellspacing="0" cellpadding="0" border="0"> <table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr> <tr>
<td align="center"><h1><?php echo $lang['Users']; ?></h1></td> <td align="center"><h1><?php echo $user->lang['Users']; ?></h1></td>
<td align="center"><h1><?php echo $lang['Groups']; ?></h1></td> <td align="center"><h1><?php echo $user->lang['Groups']; ?></h1></td>
</tr> </tr>
<tr> <tr>
@ -275,13 +248,13 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
?> ?>
<tr> <tr>
<th><?php echo $lang['Manage_users']; ?></th> <th><?php echo $user->lang['Manage_users']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $users; ?></select></td> <td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $users; ?></select></td>
</tr> </tr>
<tr> <tr>
<td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $lang['Remove_selected']; ?>" /> &nbsp; <input class="liteoption" type="submit" name="advanced" value="<?php echo $lang['Advanced']; ?>" /><input type="hidden" name="type" value="user" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td> <td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['Remove_selected']; ?>" /> &nbsp; <input class="liteoption" type="submit" name="advanced" value="<?php echo $user->lang['Advanced']; ?>" /><input type="hidden" name="type" value="user" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td>
</tr> </tr>
</table></form></td> </table></form></td>
@ -300,19 +273,19 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
$groups = ''; $groups = '';
while ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{ {
$groups .= '<option value="' . $row['group_id'] . '">' . ( ( !empty($lang[$row['group_name']]) ) ? $lang[$row['group_name']] : $row['group_name'] ) . '</option>'; $groups .= '<option value="' . $row['group_id'] . '">' . ( ( !empty($user->lang[$row['group_name']]) ) ? $user->lang[$row['group_name']] : $row['group_name'] ) . '</option>';
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
?> ?>
<tr> <tr>
<th><?php echo $lang['Manage_groups']; ?></th> <th><?php echo $user->lang['Manage_groups']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $groups; ?></select></td> <td class="row1" align="center"><select style="width:280px" name="entries[]" multiple="multiple" size="5"><?php echo $groups; ?></select></td>
</tr> </tr>
<tr> <tr>
<td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $lang['Remove_selected']; ?>" /> &nbsp; <input class="liteoption" type="submit" name="advanced" value="<?php echo $lang['Advanced']; ?>" /><input type="hidden" name="type" value="group" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td> <td class="cat" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['Remove_selected']; ?>" /> &nbsp; <input class="liteoption" type="submit" name="advanced" value="<?php echo $user->lang['Advanced']; ?>" /><input type="hidden" name="type" value="group" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="option" value="<?php echo $type_sql; ?>" /></td>
</tr> </tr>
</table></form></td> </table></form></td>
@ -321,25 +294,25 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
<td><form method="post" action="<?php echo "admin_permissions.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" width="90%" cellspacing="1" cellpadding="4" border="0" align="center"> <td><form method="post" action="<?php echo "admin_permissions.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" width="90%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th><?php echo $lang['Add_users']; ?></th> <th><?php echo $user->lang['Add_users']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" align="center"><textarea cols="40" rows="4" name="entries"></textarea></td> <td class="row1" align="center"><textarea cols="40" rows="4" name="entries"></textarea></td>
</tr> </tr>
<tr> <tr>
<td class="cat" align="center"> <input type="submit" name="add" value="<?php echo $lang['Submit']; ?>" class="mainoption" />&nbsp; <input type="reset" value="<?php echo $lang['Reset']; ?>" class="liteoption" />&nbsp; <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;form=2&amp;field=entries', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /><input type="hidden" name="type" value="user" /><input type="hidden" name="advanced" value="1" /><input type="hidden" name="new" value="1" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /></td> <td class="cat" align="center"> <input type="submit" name="add" value="<?php echo $user->lang['Submit']; ?>" class="mainoption" />&nbsp; <input type="reset" value="<?php echo $user->lang['Reset']; ?>" class="liteoption" />&nbsp; <input type="submit" name="usersubmit" value="<?php echo $user->lang['Find_username']; ?>" class="liteoption" onclick="window.open('<?php echo "../search.$phpEx$SID"; ?>&amp;mode=searchuser&amp;form=2&amp;field=entries', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /><input type="hidden" name="type" value="user" /><input type="hidden" name="advanced" value="1" /><input type="hidden" name="new" value="1" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /></td>
</tr> </tr>
</table></form></td> </table></form></td>
<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"> <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">
<tr> <tr>
<th><?php echo $lang['Add_groups']; ?></th> <th><?php echo $user->lang['Add_groups']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" align="center"><select name="entries[]" multiple="multiple" size="4"><?php echo $group_list; ?></select></td> <td class="row1" align="center"><select name="entries[]" multiple="multiple" size="4"><?php echo $group_list; ?></select></td>
</tr> </tr>
<tr> <tr>
<td class="cat" align="center"> <input type="submit" name="add" value="<?php echo $lang['Submit']; ?>" class="mainoption" />&nbsp; <input type="reset" value="<?php echo $lang['Reset']; ?>" class="liteoption" /><input type="hidden" name="type" value="group" /><input type="hidden" name="advanced" value="1" /><input type="hidden" name="new" value="1" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /></td> <td class="cat" align="center"> <input type="submit" name="add" value="<?php echo $user->lang['Submit']; ?>" class="mainoption" />&nbsp; <input type="reset" value="<?php echo $user->lang['Reset']; ?>" class="liteoption" /><input type="hidden" name="type" value="group" /><input type="hidden" name="advanced" value="1" /><input type="hidden" name="new" value="1" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /></td>
</tr> </tr>
</table></form></td> </table></form></td>
@ -403,7 +376,7 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
$auth = array(); $auth = array();
while ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{ {
$ug_test = ( !empty($lang[$row['name']]) ) ? $lang[$row['name']] : $row['name']; $ug_test = ( !empty($user->lang[$row['name']]) ) ? $user->lang[$row['name']] : $row['name'];
$ug .= ( !strstr($ug, $ug_test) ) ? $ug_test . "\n" : ''; $ug .= ( !strstr($ug, $ug_test) ) ? $ug_test . "\n" : '';
$ug_test = '<input type="hidden" name="entries[]" value="' . $row['id'] . '" />'; $ug_test = '<input type="hidden" name="entries[]" value="' . $row['id'] . '" />';
@ -415,17 +388,80 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
?> ?>
<p><?php echo $lang['Permissions_extra_explain']; ?></p> <script language="Javascript" type="text/javascript">
<!--
<p><?php echo $lang['Permissions_extra2_explain']; ?></p> // NEEDS COMPLETING ... OR SCRAPPING :D
quick_options = new Array();
quick_options['basic'] = new Array();
quick_options['basic']['allow'] = '34, 36,';
quick_options['basic']['deny'] = '35,';
quick_options['basic']['inherit'] = '';
quick_options['advanced'] = new Array();
<form method="post" action="<?php echo "admin_permissions.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> function marklist(match, status)
{
for (i = 0; i < document.acl.length; i++)
{
if (document.acl.elements[i].name.indexOf(match) == 0)
document.acl.elements[i].checked = status;
}
}
function quick_set(option)
{
if (option)
{
var expr = new RegExp(/\d+/);
for (i = 0; i < document.acl.length; i++)
{
var elem = document.acl.elements[i];
if (elem.name.indexOf('option') == 0)
{
switch (option)
{
case 'all_allow':
if (elem.value == <?php echo ACL_ALLOW; ?>)
elem.checked = true;
break;
case 'all_deny':
if (elem.value == <?php echo ACL_DENY; ?>)
elem.checked = true;
break;
case 'all_inherit':
if (elem.value == <?php echo ACL_INHERIT; ?>)
elem.checked = true;
break;
default:
option_id = elem.name.match(expr)[0];
if (quick_options[option]['allow'].indexOf(option_id + ',') != -1 && elem.value == <?php echo ACL_ALLOW; ?>)
elem.checked = true;
else if (quick_options[option]['deny'].indexOf(option_id + ',') != -1 && elem.value == <?php echo ACL_DENY; ?>)
elem.checked = true;
else if (quick_options[option]['inherit'].indexOf(option_id + ',') != -1 && elem.value == <?php echo ACL_INHERIT; ?>)
elem.checked = true;
break;
}
}
}
}
}
//-->
</script>
<p><?php echo $user->lang['ACL_explain']; ?></p>
<form method="post" name="acl" action="<?php echo "admin_permissions.$phpEx$SID&amp;mode=$mode"; ?>"><table cellspacing="1" cellpadding="0" border="0" align="center">
<tr> <tr>
<th>&nbsp;<?php echo $lang[$l_type . $l_can]; ?>&nbsp;</th> <td align="right">Quick settings: <select name="set" onchange="quick_set(this.options[this.selectedIndex].value);"><option><?php echo '-- ' . $user->lang['Select'] . ' --'; ?></option><option value="all_allow"><?php echo $user->lang['All_Allow']; ?></option><option value="all_deny"><?php echo $user->lang['All_Deny']; ?></option><option value="all_inherit"><?php echo $user->lang['All_Inherit']; ?></option><option value="basic"><?php echo $user->lang['Basic']; ?></option><option value="advanced"><?php echo $user->lang['Advanced']; ?></option></select></td>
<th>&nbsp;<?php echo $lang['Permit']; ?>&nbsp;</th> </tr>
<th>&nbsp;<?php echo $lang['Allow']; ?>&nbsp;</th> <tr>
<th>&nbsp;<?php echo $lang['Deny']; ?>&nbsp;</th> <td><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<th>&nbsp;<?php echo $lang['Prevent']; ?>&nbsp;</th> <tr>
<th>&nbsp;<?php echo $user->lang['Option']; ?>&nbsp;</th>
<th>&nbsp;<?php echo $user->lang['Allow']; ?>&nbsp;</th>
<th>&nbsp;<?php echo $user->lang['Deny']; ?>&nbsp;</th>
<th>&nbsp;<?php echo $user->lang['Inherit']; ?>&nbsp;</th>
</tr> </tr>
<?php <?php
@ -433,20 +469,45 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
{ {
$row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1'; $row_class = ( $row_class == 'row1' ) ? 'row2' : 'row1';
$l_can_cell = ( !empty($lang['acl_' . $auth_options[$i]['auth_value']]) ) ? $lang['acl_' . $auth_options[$i]['auth_value']] : $auth_options[$i]['auth_value']; $l_can_cell = ( !empty($user->lang['acl_' . $auth_options[$i]['auth_value']]) ) ? $user->lang['acl_' . $auth_options[$i]['auth_value']] : ucfirst(preg_replace('#.*?_#', '', $auth_options[$i]['auth_value']));
$permit_type = ( $auth[$auth_options[$i]['auth_value']] == ACL_PERMIT ) ? ' checked="checked"' : '';
$allow_type = ( $auth[$auth_options[$i]['auth_value']] == ACL_ALLOW ) ? ' checked="checked"' : ''; $allow_type = ( $auth[$auth_options[$i]['auth_value']] == ACL_ALLOW ) ? ' checked="checked"' : '';
$deny_type = ( $auth[$auth_options[$i]['auth_value']] == ACL_DENY ) ? ' checked="checked"' : ''; $deny_type = ( $auth[$auth_options[$i]['auth_value']] == ACL_DENY ) ? ' checked="checked"' : '';
$prevent_type = ( $auth[$auth_options[$i]['auth_value']] == ACL_PREVENT ) ? ' checked="checked"' : ''; $inherit_type = ( $auth[$auth_options[$i]['auth_value']] == ACL_INHERIT ) ? ' checked="checked"' : '';
?> ?>
<tr> <tr>
<td class="<?php echo $row_class; ?>"><?php echo $l_can_cell; ?></td> <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 $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_PERMIT; ?>"<?php echo $permit_type; ?> /></td>
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $allow_type; ?> /></td> <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_ALLOW; ?>"<?php echo $allow_type; ?> /></td>
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $deny_type; ?> /></td> <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_DENY; ?>"<?php echo $deny_type; ?> /></td>
<td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_PREVENT; ?>"<?php echo $prevent_type; ?> /></td> <td class="<?php echo $row_class; ?>" align="center"><input type="radio" name="option[<?php echo $auth_options[$i]['auth_option_id']; ?>]" value="<?php echo ACL_INHERIT; ?>"<?php echo $inherit_type; ?> /></td>
</tr>
<?php
}
if ( $type_sql == 'f' || $type_sql == 'm' )
{
$children = get_forum_branch($forum_id, 'children', 'descending', false);
if ( !empty($children) )
{
?>
<tr>
<th colspan="4"><?php echo $user->lang['Inheritance']; ?></th>
</tr>
<tr>
<td class="row1" colspan="4"><table width="100%" cellspacing="1" cellpadding="0" border="0">
<tr>
<td colspan="4" height="16"><span class="gensmall"><?php echo $user->lang['Inheritance_explain']; ?></span></td>
</tr>
<?php
foreach ( $children as $row )
{
?>
<tr>
<td><input type="checkbox" name="inherit[]" value="<?php echo $row['forum_id']; ?>" /> <?php echo $row['forum_name']; ?></td>
</tr> </tr>
<?php <?php
@ -454,13 +515,26 @@ if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators
?> ?>
<tr> <tr>
<th colspan="5"><?php echo $lang['Applies_to_' . $l_type]; ?></th> <td height="16" align="center"><a class="gensmall" href="javascript:marklist('inherit', true);"><?php echo $user->lang['Mark_all']; ?></a> :: <a href="javascript:marklist('inherit', false);" class="gensmall"><?php echo $user->lang['Unmark_all']; ?></a></td>
</tr>
</table></td>
</tr>
<?php
}
}
?>
<tr>
<td class="cat" colspan="4" align="center"><input class="mainoption" type="submit" name="update" value="<?php echo $user->lang['Update']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="cancel" value="<?php echo $user->lang['Cancel']; ?>" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="type" value="<?php echo $_POST['type']; ?>" /><?php echo $ug_hidden; ?></td>
</tr>
<!-- tr>
<th colspan="4"><?php echo $user->lang['Applies_to_' . $l_type]; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" colspan="5" align="center"><textarea cols="40" rows="3"><?php echo trim($ug); ?></textarea></td> <td class="row1" colspan="4" align="center"><textarea cols="40" rows="3"><?php echo trim($ug); ?></textarea></td>
</tr> </tr -->
<tr> </table></td>
<td class="cat" colspan="5" align="center"><input class="mainoption" type="submit" name="update" value="<?php echo $lang['Update']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="cancel" value="<?php echo $lang['Cancel']; ?>" /><input type="hidden" name="f" value="<?php echo $forum_id; ?>" /><input type="hidden" name="type" value="<?php echo $_POST['type']; ?>" /><?php echo $ug_hidden; ?></td>
</tr> </tr>
</table></form> </table></form>
@ -484,10 +558,10 @@ else
<form method="post" action="<?php echo "admin_permissions.$phpEx$SID&amp;mode=$mode"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <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> <tr>
<th align="center"><?php echo $lang['Select_a_Forum']; ?></th> <th align="center"><?php echo $user->lang['Select_a_Forum']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" align="center">&nbsp;<select name="f"><?php echo $select_list; ?></select> &nbsp;<input type="submit" value="<?php echo $lang['Look_up_Forum']; ?>" class="mainoption" />&nbsp;</td> <td class="row1" align="center">&nbsp;<select name="f"><?php echo $select_list; ?></select> &nbsp;<input type="submit" value="<?php echo $user->lang['Look_up_Forum']; ?>" class="mainoption" />&nbsp;</td>
</tr> </tr>
</table></form> </table></form>

View file

@ -44,7 +44,7 @@ require($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
// Do we have forum admin permissions? // Do we have forum admin permissions?
if ( !$auth->acl_get('a_forum') ) if ( !$auth->acl_get('a_forum') )
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
// //
@ -107,11 +107,11 @@ if ( isset($_POST['doprune']) )
} }
$template->assign_vars(array( $template->assign_vars(array(
'L_FORUM_PRUNE' => $lang['Forum_Prune'], 'L_FORUM_PRUNE' => $user->lang['Forum_Prune'],
'L_FORUM' => $lang['Forum'], 'L_FORUM' => $user->lang['Forum'],
'L_TOPICS_PRUNED' => $lang['Topics_pruned'], 'L_TOPICS_PRUNED' => $user->lang['Topics_pruned'],
'L_POSTS_PRUNED' => $lang['Posts_pruned'], 'L_POSTS_PRUNED' => $user->lang['Posts_pruned'],
'L_PRUNE_RESULT' => $lang['Prune_success']) 'L_PRUNE_RESULT' => $user->lang['Prune_success'])
); );
add_admin_log('log_prune', $log_data); add_admin_log('log_prune', $log_data);
@ -119,7 +119,7 @@ if ( isset($_POST['doprune']) )
} }
else else
{ {
page_header($lang['Prune']); page_header($user->lang['Prune']);
// //
// If they haven't selected a forum for pruning yet then // If they haven't selected a forum for pruning yet then
@ -130,7 +130,7 @@ else
// //
// Output a selection table if no forum id has been specified. // Output a selection table if no forum id has been specified.
// //
$select_list = '<option value="-1">' . $lang['All_Forums'] . '</option>'; $select_list = '<option value="-1">' . $user->lang['All_Forums'] . '</option>';
$right = 0; $right = 0;
$subforum = ''; $subforum = '';
@ -153,16 +153,16 @@ else
?> ?>
<h1><?php echo $lang['Prune']; ?></h1> <h1><?php echo $user->lang['Prune']; ?></h1>
<p><?php echo $lang['Forum_Prune_explain']; ?></p> <p><?php echo $user->lang['Forum_Prune_explain']; ?></p>
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th align="center"><?php echo $lang['Select_a_Forum']; ?></th> <th align="center"><?php echo $user->lang['Select_a_Forum']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" align="center"><?php echo $s_hidden_fields; ?>&nbsp;<select name="f"><?php echo $select_list; ?></select>&nbsp;&nbsp;<input type="submit" value="<?php echo $lang['Look_up_Forum']; ?>" class="mainoption" />&nbsp;</td> <td class="row1" align="center"><?php echo $s_hidden_fields; ?>&nbsp;<select name="f"><?php echo $select_list; ?></select>&nbsp;&nbsp;<input type="submit" value="<?php echo $user->lang['Look_up_Forum']; ?>" class="mainoption" />&nbsp;</td>
</tr> </tr>
</table></form> </table></form>
@ -171,30 +171,30 @@ else
} }
else else
{ {
$forum_name = ( $forum_id == -1 ) ? $lang['All_Forums'] : $forum_rows[0]['forum_name']; $forum_name = ( $forum_id == -1 ) ? $user->lang['All_Forums'] : $forum_rows[0]['forum_name'];
$prune_data = $lang['Prune_topics_not_posted'] . " "; $prune_data = $user->lang['Prune_topics_not_posted'] . " ";
$prune_data .= '<input type="text" name="prunedays" size="4"> ' . $lang['Days']; $prune_data .= '<input type="text" name="prunedays" size="4"> ' . $user->lang['Days'];
$s_hidden_fields = '<input type="hidden" name="f" value="' . $forum_id . '">'; $s_hidden_fields = '<input type="hidden" name="f" value="' . $forum_id . '">';
?> ?>
<h1><?php echo $lang['Prune']; ?></h1> <h1><?php echo $user->lang['Prune']; ?></h1>
<p><?php echo $lang['Forum_Prune_explain']; ?></p> <p><?php echo $user->lang['Forum_Prune_explain']; ?></p>
<h2><?php echo $lang['Forum'] . ': ' . $forum_name; ?></h2> <h2><?php echo $user->lang['Forum'] . ': ' . $forum_name; ?></h2>
<form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="<?php echo "admin_prune.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th class="th"><?php echo $lang['Forum_Prune']; ?></th> <th class="th"><?php echo $user->lang['Forum_Prune']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $prune_data; ?></td> <td class="row1"><?php echo $prune_data; ?></td>
</tr> </tr>
<tr> <tr>
<td class="cat" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="doprune" value="<?php echo $lang['Do_Prune']; ?>" class="mainoption"></td> <td class="cat" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="doprune" value="<?php echo $user->lang['Do_Prune']; ?>" class="mainoption"></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -69,7 +69,7 @@ if ( isset($_POST['prune']) )
{ {
$values = array('prune', 'deactivate', 'delete', 'users', 'username', 'email', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'deleteposts'); $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="confirm" value="' . $lang['Yes'] . '" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="cancel" value="' . $lang['No'] . '" />'; $l_message = '<form method="post" action="admin_prune_users.' . $phpEx . $SID . '">' . $user->lang['Confirm_prune_users'] . '<br /><br /><input class="liteoption" type="submit" name="confirm" value="' . $user->lang['Yes'] . '" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="cancel" value="' . $user->lang['No'] . '" />';
foreach ( $values as $field ) foreach ( $values as $field )
{ {
@ -78,17 +78,17 @@ if ( isset($_POST['prune']) )
$l_message .= '</form>'; $l_message .= '</form>';
page_header($lang['Prune_users']); page_header($user->lang['Prune_users']);
?> ?>
<h1><?php echo $lang['Prune_users']; ?></h1> <h1><?php echo $user->lang['Prune_users']; ?></h1>
<p><?php echo $lang['Prune_users_explain']; ?></p> <p><?php echo $user->lang['Prune_users_explain']; ?></p>
<?php <?php
page_message($lang['Confirm'], $l_message, false); page_message($user->lang['Confirm'], $l_message, false);
page_footer(); page_footer();
} }
@ -194,14 +194,14 @@ if ( isset($_POST['prune']) )
unset($usernames); unset($usernames);
} }
message_die(MESSAGE, $lang['Success_user_prune']); message_die(MESSAGE, $user->lang['Success_user_prune']);
} }
} }
// //
// //
// //
$find_count = array('lt' => $lang['Less_than'], 'eq' => $lang['Equal_to'], 'gt' => $lang['More_than']); $find_count = array('lt' => $user->lang['Less_than'], 'eq' => $user->lang['Equal_to'], 'gt' => $user->lang['More_than']);
$s_find_count = ''; $s_find_count = '';
foreach ( $find_count as $key => $value ) foreach ( $find_count as $key => $value )
{ {
@ -209,7 +209,7 @@ foreach ( $find_count as $key => $value )
$s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>'; $s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
} }
$find_time = array('lt' => $lang['Before'], 'gt' => $lang['After']); $find_time = array('lt' => $user->lang['Before'], 'gt' => $user->lang['After']);
$s_find_join_time = ''; $s_find_join_time = '';
foreach ( $find_time as $key => $value ) foreach ( $find_time as $key => $value )
{ {
@ -224,48 +224,48 @@ foreach ( $find_time as $key => $value )
// //
// //
// //
page_header($lang['Prune_users']); page_header($user->lang['Prune_users']);
?> ?>
<h1><?php echo $lang['Prune_users']; ?></h1> <h1><?php echo $user->lang['Prune_users']; ?></h1>
<p><?php echo $lang['Prune_users_explain']; ?></p> <p><?php echo $user->lang['Prune_users_explain']; ?></p>
<form method="post" name="post" action="<?php echo "admin_prune_users.$phpEx$SID"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" name="post" action="<?php echo "admin_prune_users.$phpEx$SID"; ?>"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $lang['Prune_users']; ?></th> <th colspan="2"><?php echo $user->lang['Prune_users']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Username']; ?>: </td> <td class="row1"><?php echo $user->lang['Username']; ?>: </td>
<td class="row2"><input class="post" type="text" name="username" /></td> <td class="row2"><input class="post" type="text" name="username" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Email']; ?>: </td> <td class="row1"><?php echo $user->lang['Email']; ?>: </td>
<td class="row2"><input class="post" type="text" name="email" /></td> <td class="row2"><input class="post" type="text" name="email" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Joined']; ?>: <br /><span class="gensmall"><?php echo $lang['Joined_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Joined']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Joined_explain']; ?></span></td>
<td class="row2"><select name="joined_select"><?php echo $s_find_join_time; ?></select> <input class="post" type="text" name="joined" maxlength="10" size="10" /></td> <td class="row2"><select name="joined_select"><?php echo $s_find_join_time; ?></select> <input class="post" type="text" name="joined" maxlength="10" size="10" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Last_active']; ?>: <br /><span class="gensmall"><?php echo $lang['Last_active_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Last_active']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Last_active_explain']; ?></span></td>
<td class="row2"><select name="active_select"><?php echo $s_find_active_time; ?></select> <input class="post" type="text" name="active" maxlength="10" size="10" /></td> <td class="row2"><select name="active_select"><?php echo $s_find_active_time; ?></select> <input class="post" type="text" name="active" maxlength="10" size="10" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Posts']; ?>: </td> <td class="row1"><?php echo $user->lang['Posts']; ?>: </td>
<td class="row2"><select name="count_select"><?php echo $s_find_count; ?></select> <input class="post" type="text" name="count" /></td> <td class="row2"><select name="count_select"><?php echo $s_find_count; ?></select> <input class="post" type="text" name="count" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Prune_users']; ?>: <br /><span class="gensmall"><?php echo $lang['Select_users_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Prune_users']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Select_users_explain']; ?></span></td>
<td class="row2"><textarea name="users" cols="40" rows="5"></textarea></td> <td class="row2"><textarea name="users" cols="40" rows="5"></textarea></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Delete_user_posts']; ?>: <br /><span class="gensmall"><?php echo $lang['Delete_user_posts_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['Delete_user_posts']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Delete_user_posts_explain']; ?></span></td>
<td class="row2"><input type="radio" name="deleteposts" value="1" /> <?php echo $lang['Yes']; ?> &nbsp;&nbsp; <input type="radio" name="deleteposts" value="0" checked="checked" /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="deleteposts" value="1" /> <?php echo $user->lang['Yes']; ?> &nbsp;&nbsp; <input type="radio" name="deleteposts" value="0" checked="checked" /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $lang['Prune_users']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="deactivate" value="<?php echo $lang['Deactivate']; ?>" />&nbsp;&nbsp;<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=users"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /><input type="hidden" name="prune" value="1" /></td> <td class="cat" colspan="2" align="center"><input class="liteoption" type="submit" name="delete" value="<?php echo $user->lang['Prune_users']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="deactivate" value="<?php echo $user->lang['Deactivate']; ?>" />&nbsp;&nbsp;<input type="submit" name="usersubmit" value="<?php echo $user->lang['Find_username']; ?>" class="liteoption" onClick="window.open('<?php echo "../search.$phpEx$SID&amp;mode=searchuser&amp;field=users"; ?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=650');return false;" /><input type="hidden" name="prune" value="1" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -92,7 +92,7 @@ if ( $mode != '' )
{ {
if ( empty($rank_id) ) if ( empty($rank_id) )
{ {
message_die(MESSAGE, $lang['Must_select_rank']); message_die(MESSAGE, $user->lang['Must_select_rank']);
} }
$sql = "SELECT * FROM " . RANKS_TABLE . " $sql = "SELECT * FROM " . RANKS_TABLE . "
@ -108,36 +108,36 @@ if ( $mode != '' )
$rank_info['rank_special'] = 0; $rank_info['rank_special'] = 0;
} }
page_header($lang['Ranks']); page_header($user->lang['Ranks']);
?> ?>
<h1><?php echo $lang['Ranks']; ?></h1> <h1><?php echo $user->lang['Ranks']; ?></h1>
<p><?php echo $lang['Ranks_explain']; ?></p> <p><?php echo $user->lang['Ranks_explain']; ?></p>
<form method="post" action="<?php echo "admin_ranks.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="<?php echo "admin_ranks.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $lang['Ranks']; ?></th> <th colspan="2"><?php echo $user->lang['Ranks']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" width="40%"><?php echo $lang['Rank_title']; ?>: </td> <td class="row1" width="40%"><?php echo $user->lang['Rank_title']; ?>: </td>
<td class="row2"><input type="text" name="title" size="35" maxlength="40" value="<?php echo $rank_info['rank_title']; ?>" /></td> <td class="row2"><input type="text" name="title" size="35" maxlength="40" value="<?php echo $rank_info['rank_title']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1" width="40%"><?php echo $lang['Rank_special']; ?>: </td> <td class="row1" width="40%"><?php echo $user->lang['Rank_special']; ?>: </td>
<td class="row2"><input type="radio" name="special_rank" value="1"<?php echo ( $rank_info['rank_special'] ) ? ' checked="checked"' : ''; ?> /><?php echo $lang['Yes']; ?> &nbsp;&nbsp;<input type="radio" name="special_rank" value="0"<?php echo ( !$rank_info['rank_special'] ) ? ' checked="checked"' : ''; ?> /> <?php echo $lang['No']; ?></td> <td class="row2"><input type="radio" name="special_rank" value="1"<?php echo ( $rank_info['rank_special'] ) ? ' checked="checked"' : ''; ?> /><?php echo $user->lang['Yes']; ?> &nbsp;&nbsp;<input type="radio" name="special_rank" value="0"<?php echo ( !$rank_info['rank_special'] ) ? ' checked="checked"' : ''; ?> /> <?php echo $user->lang['No']; ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1" width="40%"><?php echo $lang['Rank_minimum']; ?>: </td> <td class="row1" width="40%"><?php echo $user->lang['Rank_minimum']; ?>: </td>
<td class="row2"><input type="text" name="min_posts" size="5" maxlength="10" value="<?php echo ( $rank_info['rank_special'] ) ? '' : $rank_info['rank_min']; ?>" /></td> <td class="row2"><input type="text" name="min_posts" size="5" maxlength="10" value="<?php echo ( $rank_info['rank_special'] ) ? '' : $rank_info['rank_min']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1" width="40%"><?php echo $lang['Rank_image']; ?>: <br /><span class="gensmall"><?php echo $lang['Rank_image_explain']; ?></span></td> <td class="row1" width="40%"><?php echo $user->lang['Rank_image']; ?>: <br /><span class="gensmall"><?php echo $user->lang['Rank_image_explain']; ?></span></td>
<td class="row2"><input type="text" name="rank_image" size="40" maxlength="255" value="<?php echo ( $rank_info['rank_image'] != '' ) ? $rank_info['rank_image'] : ''; ?>" /><br /><?php echo ( $rank_info['rank_image'] != '' ) ? '<img src="../' . $rank_info['rank_image'] . '" />' : ''; ?></td> <td class="row2"><input type="text" name="rank_image" size="40" maxlength="255" value="<?php echo ( $rank_info['rank_image'] != '' ) ? $rank_info['rank_image'] : ''; ?>" /><br /><?php echo ( $rank_info['rank_image'] != '' ) ? '<img src="../' . $rank_info['rank_image'] . '" />' : ''; ?></td>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="submit" value="<?php echo $lang['Submit']; ?>" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="<?php echo $lang['Reset']; ?>" class="liteoption" /></td> <td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="submit" value="<?php echo $user->lang['Submit']; ?>" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="<?php echo $user->lang['Reset']; ?>" class="liteoption" /></td>
</tr> </tr>
</table></form> </table></form>
@ -160,7 +160,7 @@ if ( $mode != '' )
if ( $rank_title == '' ) if ( $rank_title == '' )
{ {
message_die(MESSAGE, $lang['Must_select_rank']); message_die(MESSAGE, $user->lang['Must_select_rank']);
} }
if ( $special_rank == 1 ) if ( $special_rank == 1 )
@ -185,19 +185,19 @@ if ( $mode != '' )
SET rank_title = '" . str_replace("\'", "''", $rank_title) . "', rank_special = $special_rank, rank_min = $min_posts, rank_image = '" . str_replace("\'", "''", $rank_image) . "' SET rank_title = '" . str_replace("\'", "''", $rank_title) . "', rank_special = $special_rank, rank_min = $min_posts, rank_image = '" . str_replace("\'", "''", $rank_image) . "'
WHERE rank_id = $rank_id"; WHERE rank_id = $rank_id";
$message = $lang['Rank_updated']; $message = $user->lang['Rank_updated'];
} }
else else
{ {
$sql = "INSERT INTO " . RANKS_TABLE . " (rank_title, rank_special, rank_min, rank_image) $sql = "INSERT INTO " . RANKS_TABLE . " (rank_title, rank_special, rank_min, rank_image)
VALUES ('" . str_replace("\'", "''", $rank_title) . "', $special_rank, $min_posts, '" . str_replace("\'", "''", $rank_image) . "')"; VALUES ('" . str_replace("\'", "''", $rank_title) . "', $special_rank, $min_posts, '" . str_replace("\'", "''", $rank_image) . "')";
$message = $lang['Rank_added']; $message = $user->lang['Rank_added'];
} }
$db->sql_query($sql); $db->sql_query($sql);
$message .= '<br /><br />' . sprintf($lang['Click_return_rankadmin'], '<a href="' . "admin_ranks.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>'); $message .= '<br /><br />' . sprintf($user->lang['Click_return_rankadmin'], '<a href="' . "admin_ranks.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($user->lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>');
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
@ -228,33 +228,33 @@ if ( $mode != '' )
WHERE user_rank = $rank_id"; WHERE user_rank = $rank_id";
$db->sql_query($sql); $db->sql_query($sql);
$message = $lang['Rank_removed'] . '<br /><br />' . sprintf($lang['Click_return_rankadmin'], '<a href="' . "admin_ranks.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>'); $message = $user->lang['Rank_removed'] . '<br /><br />' . sprintf($user->lang['Click_return_rankadmin'], '<a href="' . "admin_ranks.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($user->lang['Click_return_admin_index'], '<a href="' . "index.$phpEx$SID&amp;pane=right" . '">', '</a>');
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
} }
else else
{ {
message_die(MESSAGE, $lang['Must_select_rank']); message_die(MESSAGE, $user->lang['Must_select_rank']);
} }
} }
} }
page_header($lang['Ranks']); page_header($user->lang['Ranks']);
?> ?>
<h1><?php echo $lang['Ranks']; ?></h1> <h1><?php echo $user->lang['Ranks']; ?></h1>
<p><?php echo $lang['Ranks_explain']; ?></p> <p><?php echo $user->lang['Ranks_explain']; ?></p>
<form method="post" action="<?php echo "admin_ranks.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="<?php echo "admin_ranks.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th><?php echo $lang['Rank_title']; ?></th> <th><?php echo $user->lang['Rank_title']; ?></th>
<th><?php echo $lang['Rank_minimum']; ?></th> <th><?php echo $user->lang['Rank_minimum']; ?></th>
<th><?php echo $lang['Rank_special']; ?></th> <th><?php echo $user->lang['Rank_special']; ?></th>
<th><?php echo $lang['Edit']; ?></th> <th><?php echo $user->lang['Edit']; ?></th>
<th><?php echo $lang['Delete']; ?></th> <th><?php echo $user->lang['Delete']; ?></th>
</tr> </tr>
<?php <?php
@ -274,9 +274,9 @@ if ( $row = $db->sql_fetchrow($result) )
<tr> <tr>
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['rank_title']; ?></td> <td class="<?php echo $row_class; ?>" align="center"><?php echo $row['rank_title']; ?></td>
<td class="<?php echo $row_class; ?>" align="center"><?php echo ( $row['rank_special'] ) ? '-' : $row['rank_min']; ?></td> <td class="<?php echo $row_class; ?>" align="center"><?php echo ( $row['rank_special'] ) ? '-' : $row['rank_min']; ?></td>
<td class="<?php echo $row_class; ?>" align="center"><?php echo ( $row['rank_special'] ) ? $lang['Yes'] : $lang['No']; ?></td> <td class="<?php echo $row_class; ?>" align="center"><?php echo ( $row['rank_special'] ) ? $user->lang['Yes'] : $user->lang['No']; ?></td>
<td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_ranks.$phpEx$SID&amp;mode=edit&amp;id=" . $row['rank_id']; ?>"><?php echo $lang['Edit']; ?></a></td> <td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_ranks.$phpEx$SID&amp;mode=edit&amp;id=" . $row['rank_id']; ?>"><?php echo $user->lang['Edit']; ?></a></td>
<td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_ranks.$phpEx$SID&amp;mode=delete&amp;id=" . $row['rank_id']; ?>"><?php echo $lang['Delete']; ?></a></td> <td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_ranks.$phpEx$SID&amp;mode=delete&amp;id=" . $row['rank_id']; ?>"><?php echo $user->lang['Delete']; ?></a></td>
</tr> </tr>
<?php <?php
@ -286,7 +286,7 @@ if ( $row = $db->sql_fetchrow($result) )
?> ?>
<tr> <tr>
<td class="cat" colspan="6" align="center"><input type="submit" class="mainoption" name="add" value="<?php echo $lang['Add_new_rank']; ?>" /></td> <td class="cat" colspan="6" align="center"><input type="submit" class="mainoption" name="add" value="<?php echo $user->lang['Add_new_rank']; ?>" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -46,7 +46,7 @@ include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
// //
if ( !$auth->acl_get('a_general') ) if ( !$auth->acl_get('a_general') )
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
// //
@ -295,13 +295,13 @@ if ( isset($_POST['start']) || isset($_GET['batchstart']) )
WHERE config_name = 'board_disable'"; WHERE config_name = 'board_disable'";
$db->sql_query($sql); $db->sql_query($sql);
page_header($lang['Search_indexing']); page_header($user->lang['Search_indexing']);
?> ?>
<h1><?php echo $lang['Search_indexing']; ?></h1> <h1><?php echo $user->lang['Search_indexing']; ?></h1>
<p><?php echo $lang['Search_indexing_complete']; ?></p> <p><?php echo $user->lang['Search_indexing_complete']; ?></p>
<?php <?php
@ -319,13 +319,13 @@ else if ( isset($_POST['cancel']) )
WHERE config_name = 'board_disable'"; WHERE config_name = 'board_disable'";
$db->sql_query($sql); $db->sql_query($sql);
page_header($lang['Search_indexing']); page_header($user->lang['Search_indexing']);
?> ?>
<h1><?php echo $lang['Search_indexing']; ?></h1> <h1><?php echo $user->lang['Search_indexing']; ?></h1>
<p><?php echo $lang['Search_indexing_cancel']; ?></p> <p><?php echo $user->lang['Search_indexing_cancel']; ?></p>
<?php <?php
@ -334,17 +334,17 @@ else if ( isset($_POST['cancel']) )
} }
else else
{ {
page_header($lang['Search_indexing']); page_header($user->lang['Search_indexing']);
?> ?>
<h1><?php echo $lang['Search_indexing']; ?></h1> <h1><?php echo $user->lang['Search_indexing']; ?></h1>
<p><?php echo $lang['Search_indexing_explain']; ?></p> <p><?php echo $user->lang['Search_indexing_explain']; ?></p>
<form method="post" action="<?php echo "admin_search.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1"> <form method="post" action="<?php echo "admin_search.$phpEx$SID"; ?>"><table cellspacing="1" cellpadding="4" border="0" align="center" bgcolor="#98AAB1">
<tr> <tr>
<td class="cat" height="28" align="center">&nbsp;<input type="submit" name="start" value="<?php echo $lang['Start']; ?>" class="mainoption" /> &nbsp; <input type="submit" name="cancel" value="<?php echo $lang['Cancel']; ?>" class="mainoption" />&nbsp;</td> <td class="cat" height="28" align="center">&nbsp;<input type="submit" name="start" value="<?php echo $user->lang['Start']; ?>" class="mainoption" /> &nbsp; <input type="submit" name="cancel" value="<?php echo $user->lang['Cancel']; ?>" class="mainoption" />&nbsp;</td>
</tr> </tr>
</table></form> </table></form>

View file

@ -45,7 +45,7 @@ require('pagestart.' . $phpEx);
// //
if (!$auth->acl_get('a_general')) if (!$auth->acl_get('a_general'))
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
// //
@ -173,13 +173,13 @@ if (isset($_POST['import_pak']))
} }
} }
message_die(MESSAGE, $lang['Smilies_import_success']); message_die(MESSAGE, $user->lang['Smilies_import_success']);
} }
else else
{ {
if (!count($smilies_paks)) if (!count($smilies_paks))
{ {
$smilies_paks_select = $lang['No_smilies_pak']; $smilies_paks_select = $user->lang['No_smilies_pak'];
} }
else else
{ {
@ -192,33 +192,33 @@ if (isset($_POST['import_pak']))
$smilies_paks_select .= '</select>'; $smilies_paks_select .= '</select>';
} }
page_header($lang['Import_smilies']); page_header($user->lang['Import_smilies']);
?> ?>
<h1><?php echo $lang['Import_smilies'] ?></h1> <h1><?php echo $user->lang['Import_smilies'] ?></h1>
<p><?php echo $lang['Import_smilies_explain'] ?></p> <p><?php echo $user->lang['Import_smilies_explain'] ?></p>
<form method="post" action="admin_smilies.<?php echo $phpEx . $SID ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="admin_smilies.<?php echo $phpEx . $SID ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $lang['Smilies_import'] ?></th> <th colspan="2"><?php echo $user->lang['Smilies_import'] ?></th>
</tr> </tr>
<tr> <tr>
<td class="row2"><?php echo $lang['Select_package'] ?></td> <td class="row2"><?php echo $user->lang['Select_package'] ?></td>
<td class="row2"><?php echo $smilies_paks_select ?></td> <td class="row2"><?php echo $smilies_paks_select ?></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Delete_existing_smilies'] ?></td> <td class="row1"><?php echo $user->lang['Delete_existing_smilies'] ?></td>
<td class="row1"><input type="checkbox" name="clear_current" /></td> <td class="row1"><input type="checkbox" name="clear_current" /></td>
</tr> </tr>
<tr> <tr>
<td class="row2" colspan="2" align="center"><?php echo $lang['Smilies_conflicts'] ?><br /> <td class="row2" colspan="2" align="center"><?php echo $user->lang['Smilies_conflicts'] ?><br />
<table align="center" border="0"><tr><td> <table align="center" border="0"><tr><td>
&nbsp;<input type="radio" name="replace_existing" value="1" checked="checked" /> <?php echo $lang['Replace_existing_smilies'] ?>&nbsp;<br /> &nbsp;<input type="radio" name="replace_existing" value="1" checked="checked" /> <?php echo $user->lang['Replace_existing_smilies'] ?>&nbsp;<br />
&nbsp;<input type="radio" name="replace_existing" value="0" /> <?php echo $lang['Keep_existing_smilies'] ?>&nbsp;</td></tr></table> &nbsp;<input type="radio" name="replace_existing" value="0" /> <?php echo $user->lang['Keep_existing_smilies'] ?>&nbsp;</td></tr></table>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input class="mainoption" name="import_pak" type="submit" value="<?php echo $lang['Import_smilies'] ?>" /></td> <td class="cat" colspan="2" align="center"><input class="mainoption" name="import_pak" type="submit" value="<?php echo $user->lang['Import_smilies'] ?>" /></td>
</tr> </tr>
</table></form> </table></form>
<?php <?php
@ -250,8 +250,8 @@ elseif (isset($_GET['export_pak']))
} }
elseif (isset($_POST['export_pak'])) elseif (isset($_POST['export_pak']))
{ {
page_header($lang['Export_smilies']); page_header($user->lang['Export_smilies']);
message_die(MESSAGE, sprintf($lang['Export_smilies_explain'], '<a href="admin_smilies.' . $phpEx . $SID . '&amp;export_pak=send">', '</a>')); message_die(MESSAGE, sprintf($user->lang['Export_smilies_explain'], '<a href="admin_smilies.' . $phpEx . $SID . '&amp;export_pak=send">', '</a>'));
} }
elseif (isset($_POST['add'])) elseif (isset($_POST['add']))
{ {
@ -265,9 +265,9 @@ elseif (isset($_POST['add']))
$filename_list .= '<option value="' . $smile_url . '">' . htmlspecialchars($smile_url) . '</option>'; $filename_list .= '<option value="' . $smile_url . '">' . htmlspecialchars($smile_url) . '</option>';
} }
page_header($lang['Add_smile']); page_header($user->lang['Add_smile']);
?> ?>
<h1><?php echo $lang['Add_smile'] ?></h1> <h1><?php echo $user->lang['Add_smile'] ?></h1>
<script language="javascript" type="text/javascript" defer="defer"> <script language="javascript" type="text/javascript" defer="defer">
<!-- <!--
@ -288,30 +288,30 @@ function update_smile_dimensions()
<form method="post" action="admin_smilies.<?php echo $phpEx . $SID ?>&amp;mode=create"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="admin_smilies.<?php echo $phpEx . $SID ?>&amp;mode=create"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $lang['smile_config'] ?></th> <th colspan="2"><?php echo $user->lang['smile_config'] ?></th>
</tr> </tr>
<tr> <tr>
<td class="row2"><?php echo $lang['Smile_code'] ?></td> <td class="row2"><?php echo $user->lang['Smile_code'] ?></td>
<td class="row2"><input type="text" name="smile_code" /></td> <td class="row2"><input type="text" name="smile_code" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Smile_url'] ?></td> <td class="row1"><?php echo $user->lang['Smile_url'] ?></td>
<td class="row1"><select name="smile_url" onChange="update_smile(this.options[selectedIndex].value);"><?php echo $filename_list ?></select> &nbsp; <img name="smile_image" src="<?php echo (!empty($default_image)) ? $phpbb_root_path . $board_config['smilies_path'] . '/' . $default_image : '../images/spacer.gif' ?>" border="0" alt="" onLoad="update_smile_dimensions()" /> &nbsp;</td> <td class="row1"><select name="smile_url" onChange="update_smile(this.options[selectedIndex].value);"><?php echo $filename_list ?></select> &nbsp; <img name="smile_image" src="<?php echo (!empty($default_image)) ? $phpbb_root_path . $board_config['smilies_path'] . '/' . $default_image : '../images/spacer.gif' ?>" border="0" alt="" onLoad="update_smile_dimensions()" /> &nbsp;</td>
</tr> </tr>
<tr> <tr>
<td class="row2"><?php echo $lang['Smile_width'] ?></td> <td class="row2"><?php echo $user->lang['Smile_width'] ?></td>
<td class="row2"><input type="text" size="4" name="smile_width" value="0" /></td> <td class="row2"><input type="text" size="4" name="smile_width" value="0" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Smile_height'] ?></td> <td class="row1"><?php echo $user->lang['Smile_height'] ?></td>
<td class="row1"><input type="text" size="4" name="smile_height" value="0" /></td> <td class="row1"><input type="text" size="4" name="smile_height" value="0" /></td>
</tr> </tr>
<tr> <tr>
<td class="row2"><?php echo $lang['Smile_emotion'] ?></td> <td class="row2"><?php echo $user->lang['Smile_emotion'] ?></td>
<td class="row2"><input type="text" name="smile_emotion" /></td> <td class="row2"><input type="text" name="smile_emotion" /></td>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input class="mainoption" type="submit" value="<?php echo $lang['Submit'] ?>" /></td> <td class="cat" colspan="2" align="center"><input class="mainoption" type="submit" value="<?php echo $user->lang['Submit'] ?>" /></td>
</tr> </tr>
</table></form> </table></form>
<?php <?php
@ -323,7 +323,7 @@ switch ($mode)
{ {
case 'delete': case 'delete':
$db->sql_query('DELETE FROM ' . SMILIES_TABLE . ' WHERE smilies_id = ' . intval($_GET['smile_id'])); $db->sql_query('DELETE FROM ' . SMILIES_TABLE . ' WHERE smilies_id = ' . intval($_GET['smile_id']));
message_die(MESSAGE, $lang['Smile_deleted']); message_die(MESSAGE, $user->lang['Smile_deleted']);
break; break;
case 'edit': case 'edit':
@ -346,10 +346,10 @@ switch ($mode)
$selected = ' selected="selected"'; $selected = ' selected="selected"';
$after = FALSE; $after = FALSE;
} }
$order_list = '<option value="' . ($row['smile_order'] + 1) . '"' . $selected . '>' . sprintf($lang['After_smile'], htmlspecialchars($row['code'])) . '</option>' . $order_list; $order_list = '<option value="' . ($row['smile_order'] + 1) . '"' . $selected . '>' . sprintf($user->lang['After_smile'], htmlspecialchars($row['code'])) . '</option>' . $order_list;
} }
} }
$order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $lang['First'] . '</option>' . $order_list; $order_list = '<option value="1"' . ((!isset($after)) ? ' selected="selected"' : '') . '>' . $user->lang['First'] . '</option>' . $order_list;
$filename_list = ''; $filename_list = '';
foreach ($smilies_images as $smile_url) foreach ($smilies_images as $smile_url)
@ -367,9 +367,9 @@ switch ($mode)
$filename_list .= '<option value="' . $smile_url . '"' . htmlspecialchars($smile_url) . $smile_selected . '>' . $smile_url . '</option>'; $filename_list .= '<option value="' . $smile_url . '"' . htmlspecialchars($smile_url) . $smile_selected . '>' . $smile_url . '</option>';
} }
page_header($lang['Edit_smile']); page_header($user->lang['Edit_smile']);
?> ?>
<h1><?php echo $lang['Edit_smile'] ?></h1> <h1><?php echo $user->lang['Edit_smile'] ?></h1>
<script language="javascript" type="text/javascript" defer="defer"> <script language="javascript" type="text/javascript" defer="defer">
<!-- <!--
@ -390,38 +390,38 @@ function update_smile_dimensions()
<form method="post" action="admin_smilies.<?php echo $phpEx . $SID ?>&amp;mode=modify"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="admin_smilies.<?php echo $phpEx . $SID ?>&amp;mode=modify"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th class="th" colspan="2"><?php echo $lang['Smile_config'] ?></th> <th class="th" colspan="2"><?php echo $user->lang['Smile_config'] ?></th>
</tr> </tr>
<tr> <tr>
<td class="row2"><?php echo $lang['Smile_code'] ?></td> <td class="row2"><?php echo $user->lang['Smile_code'] ?></td>
<td class="row2"><input type="text" name="smile_code" value="<?php echo $smile_data['code'] ?>" /></td> <td class="row2"><input type="text" name="smile_code" value="<?php echo $smile_data['code'] ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Smile_url'] ?></td> <td class="row1"><?php echo $user->lang['Smile_url'] ?></td>
<td class="row1"><select name="smile_url" onChange="update_smile(this.options[selectedIndex].value);"><?php echo $filename_list ?></select> &nbsp; <img name="smile_image" src="<?php echo $phpbb_root_path . $board_config['smilies_path'] . '/' . $smile_edit_img ?>" border="0" alt="" onLoad="update_smile_dimensions()" /> &nbsp;</td> <td class="row1"><select name="smile_url" onChange="update_smile(this.options[selectedIndex].value);"><?php echo $filename_list ?></select> &nbsp; <img name="smile_image" src="<?php echo $phpbb_root_path . $board_config['smilies_path'] . '/' . $smile_edit_img ?>" border="0" alt="" onLoad="update_smile_dimensions()" /> &nbsp;</td>
</tr> </tr>
<tr> <tr>
<td class="row2"><?php echo $lang['Smile_emotion'] ?></td> <td class="row2"><?php echo $user->lang['Smile_emotion'] ?></td>
<td class="row2"><input type="text" name="smile_emotion" value="<?php echo $smile_data['emoticon'] ?>" /></td> <td class="row2"><input type="text" name="smile_emotion" value="<?php echo $smile_data['emoticon'] ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Smile_width'] ?></td> <td class="row1"><?php echo $user->lang['Smile_width'] ?></td>
<td class="row1"><input type="text" size="3" name="smile_width" value="<?php echo $smile_data['smile_width'] ?>" /></td> <td class="row1"><input type="text" size="3" name="smile_width" value="<?php echo $smile_data['smile_width'] ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row2"><?php echo $lang['Smile_height'] ?></td> <td class="row2"><?php echo $user->lang['Smile_height'] ?></td>
<td class="row2"><input type="text" size="3" name="smile_height" value="<?php echo $smile_data['smile_height'] ?>" /></td> <td class="row2"><input type="text" size="3" name="smile_height" value="<?php echo $smile_data['smile_height'] ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Display_on_posting'] ?></td> <td class="row1"><?php echo $user->lang['Display_on_posting'] ?></td>
<td class="row1"><input type="checkbox" name="smile_on_posting" <?php echo ($smile_data['smile_on_posting']) ? ' checked="checked"' : '' ?>/></td> <td class="row1"><input type="checkbox" name="smile_on_posting" <?php echo ($smile_data['smile_on_posting']) ? ' checked="checked"' : '' ?>/></td>
</tr> </tr>
<tr> <tr>
<td class="row2"><?php echo $lang['Smile_order'] ?></td> <td class="row2"><?php echo $user->lang['Smile_order'] ?></td>
<td class="row2"><select name="smile_order"><?php echo $order_list ?></select></td> <td class="row2"><select name="smile_order"><?php echo $order_list ?></select></td>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input type="hidden" name="smile_id" value="<?php echo $smile_data['smilies_id'] ?>" /><input class="mainoption" type="submit" value="<?php echo $lang['Submit'] ?>" /></td> <td class="cat" colspan="2" align="center"><input type="hidden" name="smile_id" value="<?php echo $smile_data['smilies_id'] ?>" /><input class="mainoption" type="submit" value="<?php echo $user->lang['Submit'] ?>" /></td>
</tr> </tr>
</table></form> </table></form>
<?php <?php
@ -491,12 +491,12 @@ function update_smile_dimensions()
if ($mode == 'modify') if ($mode == 'modify')
{ {
$db->sql_query_array('UPDATE ' . SMILIES_TABLE . " SET WHERE smilies_id = $smile_id", $sql); $db->sql_query_array('UPDATE ' . SMILIES_TABLE . " SET WHERE smilies_id = $smile_id", $sql);
message_die(MESSAGE, $lang['Smile_edited']); message_die(MESSAGE, $user->lang['Smile_edited']);
} }
else else
{ {
$db->sql_query_array('INSERT INTO ' . SMILIES_TABLE, $sql); $db->sql_query_array('INSERT INTO ' . SMILIES_TABLE, $sql);
message_die(MESSAGE, $lang['Smile_added']); message_die(MESSAGE, $user->lang['Smile_added']);
} }
break; break;
@ -533,20 +533,20 @@ function update_smile_dimensions()
FROM ' . SMILIES_TABLE . ' FROM ' . SMILIES_TABLE . '
ORDER BY smile_on_posting DESC, smile_order ASC'; ORDER BY smile_on_posting DESC, smile_order ASC';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
page_header($lang['Emoticons']); page_header($user->lang['Emoticons']);
?> ?>
<h1><?php echo $lang['Emoticons']; ?></h1> <h1><?php echo $user->lang['Emoticons']; ?></h1>
<p><?php echo $lang['Emoticons_explain']; ?></p> <p><?php echo $user->lang['Emoticons_explain']; ?></p>
<form method="post" action="admin_smilies.<?php echo $phpEx . $SID ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="admin_smilies.<?php echo $phpEx . $SID ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th><?php echo $lang['Code']; ?></th> <th><?php echo $user->lang['Code']; ?></th>
<th><?php echo $lang['Smile']; ?></th> <th><?php echo $user->lang['Smile']; ?></th>
<th><?php echo $lang['Emotion']; ?></th> <th><?php echo $user->lang['Emotion']; ?></th>
<th colspan="2"><?php echo $lang['Action']; ?></th> <th colspan="2"><?php echo $user->lang['Action']; ?></th>
<th colspan="2"><?php echo $lang['Reorder']; ?></th> <th colspan="2"><?php echo $user->lang['Reorder']; ?></th>
</tr> </tr>
<?php <?php
@ -558,7 +558,7 @@ function update_smile_dimensions()
$spacer = TRUE; $spacer = TRUE;
?> ?>
<tr> <tr>
<td class="row3" colspan="7" align="center"><?php echo $lang['Smilies_not_displayed'] ?></td> <td class="row3" colspan="7" align="center"><?php echo $user->lang['Smilies_not_displayed'] ?></td>
</tr> </tr>
<?php <?php
} }
@ -568,10 +568,10 @@ function update_smile_dimensions()
<td class="<?php echo $row_class; ?>" align="center"><?php echo htmlspecialchars($row['code']); ?></td> <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']; ?>" 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"><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"><?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;smile_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=edit&amp;smile_id=" . $row['smilies_id']; ?>"><?php echo $user->lang['Edit']; ?></a></td>
<td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&amp;mode=delete&amp;smile_id=" . $row['smilies_id']; ?>"><?php echo $lang['Delete']; ?></a></td> <td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&amp;mode=delete&amp;smile_id=" . $row['smilies_id']; ?>"><?php echo $user->lang['Delete']; ?></a></td>
<td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&amp;mode=move_up&amp;smile_order=" . $row['smile_order']; ?>"><?php echo $lang['Up']; ?></a></td> <td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&amp;mode=move_up&amp;smile_order=" . $row['smile_order']; ?>"><?php echo $user->lang['Up']; ?></a></td>
<td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&amp;mode=move_down&amp;smile_order=" . $row['smile_order']; ?>"><?php echo $lang['Down']; ?></a></td> <td class="<?php echo $row_class; ?>" align="center"><a href="<?php echo "admin_smilies.$phpEx$SID&amp;mode=move_down&amp;smile_order=" . $row['smile_order']; ?>"><?php echo $user->lang['Down']; ?></a></td>
</tr> </tr>
<?php <?php
@ -579,7 +579,7 @@ function update_smile_dimensions()
?> ?>
<tr> <tr>
<td class="cat" colspan="7" align="center"><input type="submit" name="add" value="<?php echo $lang['Add_smile']; ?>" class="mainoption" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="import_pak" value="<?php echo $lang['Import_smilies']; ?>">&nbsp;&nbsp;<input class="liteoption" type="submit" name="export_pak" value="<?php echo $lang['Export_smilies']; ?>"></td> <td class="cat" colspan="7" align="center"><input type="submit" name="add" value="<?php echo $user->lang['Add_smile']; ?>" class="mainoption" />&nbsp;&nbsp;<input class="liteoption" type="submit" name="import_pak" value="<?php echo $user->lang['Import_smilies']; ?>">&nbsp;&nbsp;<input class="liteoption" type="submit" name="export_pak" value="<?php echo $user->lang['Export_smilies']; ?>"></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -29,7 +29,7 @@ require('pagestart.' . $phpEx);
// //
if ( !$auth->acl_get('a_styles') ) if ( !$auth->acl_get('a_styles') )
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
/* /*
@ -53,17 +53,8 @@ $mode = ( isset($_GET['mode']) ) ? $_GET['mode'] : $_POST['mode'];
switch ( $mode ) switch ( $mode )
{ {
case 'editimageset': case 'editimageset':
$imgroot = ( isset($_POST['imgroot']) ) ? $_POST['imgroot'] : 'subSilver'; $imgroot = ( isset($_POST['imgroot']) ) ? $_POST['imgroot'] : $board_config['default_style'];
if ( isset($_POST['img_root']) )
{
$sql = "SELECT *
FROM " . STYLES_IMAGE_TABLE . "
WHERE imageset_path LIKE '" . $_POST['imgroot'] . "'";
$result = $db->sql_query($sql);
$images = $db->sql_fetchrow($result);
}
if ( isset($_POST['img_addconfig']) ) if ( isset($_POST['img_addconfig']) )
{ {
} }
@ -71,7 +62,7 @@ switch ( $mode )
{ {
} }
$imageset = array('imageset_path', 'post_new', 'post_locked', 'post_pm', 'reply_new', 'reply_pm', 'reply_locked', 'icon_profile', 'icon_pm', 'icon_delete', 'icon_ip', 'icon_quote', 'icon_search', 'icon_edit', 'icon_email', 'icon_www', 'icon_icq', 'icon_aim', 'icon_yim', 'icon_msnm', 'icon_no_email', 'icon_no_www', 'icon_no_icq', 'icon_no_aim', 'icon_no_yim', 'icon_no_msnm', 'goto_post', 'goto_post_new', 'goto_post_latest', 'goto_post_newest', 'forum', 'forum_new', 'forum_locked', 'folder', 'folder_new', 'folder_hot', 'folder_hot_new', 'folder_locked', 'folder_locked_new', 'folder_sticky', 'folder_sticky_new', 'folder_announce', 'folder_announce_new', 'topic_watch', 'topic_unwatch', 'poll_left', 'poll_center', 'poll_right', 'rating'); $imageset = array('imageset_path', 'post_new', 'post_locked', 'post_pm', 'reply_new', 'reply_pm', 'reply_locked', 'icon_profile', 'icon_pm', 'icon_delete', 'icon_ip', 'icon_quote', 'icon_search', 'icon_edit', 'icon_email', 'icon_www', 'icon_icq', 'icon_aim', 'icon_yim', 'icon_msnm', 'icon_no_email', 'icon_no_www', 'icon_no_icq', 'icon_no_aim', 'icon_no_yim', 'icon_no_msnm', 'goto_post', 'goto_post_new', 'goto_post_latest', 'goto_post_newest', 'forum', 'forum_new', 'forum_locked', 'sub_forum', 'sub_forum_new', 'folder', 'folder_new', 'folder_hot', 'folder_hot_new', 'folder_locked', 'folder_locked_new', 'folder_sticky', 'folder_sticky_new', 'folder_announce', 'folder_announce_new', 'topic_watch', 'topic_unwatch', 'poll_left', 'poll_center', 'poll_right', 'rating');
$sql = "SELECT imageset_name, imageset_path $sql = "SELECT imageset_name, imageset_path
FROM " . STYLES_IMAGE_TABLE . " FROM " . STYLES_IMAGE_TABLE . "
@ -100,42 +91,64 @@ switch ( $mode )
// //
// Output page // Output page
// //
page_header($lang['Styles']); page_header($user->lang['Edit_Imageset']);
echo '<form method="post" action="admin_styles.' . $phpEx . '?mode=editimageset">'; ?>
echo '<h2>Edit Imageset</h2>'; <form method="post" action="admin_styles.<?php echo $phpEx . $SID; ?>&amp;mode=editimageset">
echo '<p>Template set: <select name="imgroot">' . $imgroot_options . '</select>&nbsp; <input class="liteoption" type="submit" name="img_root" value="Select" /></p>'; <h2>Edit Imageset</h2>
echo '<p>Use this panel to edit or remove imagesets from the database.</p>'; <p>Template set: <select name="imgroot"><?php echo $imgroot_options; ?></select>&nbsp; <input class="liteoption" type="submit" name="img_root" value="Select set" /> &nbsp; <input class="liteoption" type="submit" name="create" value="Create new set" /></p>
echo '<table cellspacing="1" cellpadding="2" border="0" align="center" bgcolor="#98AAB1">'; <p>Here you can create, edit, delete and download imagesets.</p>
echo '<tr>';
echo '<td class="cat" colspan="6" height="28" align="center"><span class="gen">Available images: <select name="imageset">' . $imgname_options . '</select></span></td>';
echo '</tr>';
echo '<tr>';
echo '<th height="25">Image</th><th>Source</th><th>Width</th><th>Height</th><th>Border</th><th>&nbsp;</th>';
echo '</tr>';
for($i = 0; $i < count($imageset); $i++) <?php
if ( isset($_POST['img_root']) )
{ {
$class = ( !($i%2) ) ? 'row1' : 'row2'; $sql = "SELECT *
FROM " . STYLES_IMAGE_TABLE . "
WHERE imageset_path LIKE '" . $_POST['imgroot'] . "'";
$result = $db->sql_query($sql);
$images = $db->sql_fetchrow($result);
?>
<table class="bg" cellspacing="1" cellpadding="2" border="0" align="center">
<tr>
<th height="25">Image</th><th>Graphic</th><th>&nbsp;</th>
</tr>
<?php
for($i = 1; $i < count($imageset); $i++)
{
$row_class = ( !($i%2) ) ? 'row1' : 'row2';
$img = ( !empty($images[$imageset[$i]]) ) ? '<img src=' . $images[$imageset[$i]] . ' />' : '';
$img = str_replace('"imagesets/', '"../imagesets/', $img);
$img = str_replace('{LANG}', $user->img_lang, $img);
$img = str_replace('{RATE}', 3, $img);
?>
<tr>
<td class="<?php echo $row_class; ?>" height="25"><span class="gen"><?php echo ucfirst(str_replace('_', ' ', $imageset[$i])); ?></span></td>
<td class="<?php echo $row_class; ?>" align="center"><?php echo $img; ?></td>
<td class="<?php echo $row_class; ?>" align="center">&nbsp;<input class="liteoption" type="submit" value="Edit" /></td>
</tr>
<?php
}
?>
<tr>
<td class="cat" colspan="3" height="28" align="center"> <input class="liteoption" type="submit" name="download" value="Download set" &nbsp; <input class="liteoption" type="submit" name="img_delete" value="Delete set" /> </td>
</tr>
</table></form>
<?php
echo '<tr>';
echo '<td class="' . $class . '" height="25"><span class="gen">' . ucfirst(str_replace('_', ' ', $imageset[$i])) . '</span></td>';
echo '<td class="' . $class . '"><input class="text" type="text" name="src[' . $imageset[$i] . ']" value="' . ( ( !empty($images[$imageset[$i]]) ) ? $images[$imageset[$i]] : '' ) . '" size="20" maxsize="30" /></td>';
echo '<td class="' . $class . '"><input class="text" type="text" name="width[' . $imageset[$i] . ']" size="3" maxsize="3" /></td>';
echo '<td class="' . $class . '"><input class="text" type="text" name="height[' . $imageset[$i] . ']" size="3" maxsize="3" /></td>';
echo '<td class="' . $class . '"><input class="text" type="text" name="border[' . $imageset[$i] . ']" size="2" maxsize="2" /></td>';
echo '<td class="' . $class . '"><input class="liteoption" type="submit" value="Update" onclick="this.form.' . $imageset[$i] . '.value=this.form.imageset.options[this.form.imageset.selectedIndex].value;return false" />&nbsp;<input class="liteoption" type="submit" value="Clear" onclick="this.form.' . $imageset[$i] . '.value=\'\';return false" />&nbsp;</td>';
echo '</tr>';
} }
echo '<td class="cat" colspan="6" height="28" align="center"><input class="liteoption" type="submit" name="img_update" value="Update set" /> &nbsp; <input class="liteoption" type="submit" name="img_delete" value="Delete set" /> &nbsp; <input class="liteoption" type="reset" value="Undo" /></td>';
echo '</tr>';
echo '</table>';
echo '</form>';
page_footer(); page_footer();
break; break;
@ -205,17 +218,17 @@ switch ( $mode )
// //
// //
// //
page_header($lang['Edit_template']); page_header($user->lang['Edit_template']);
?> ?>
<h2><?php echo $lang['Edit_template']; ?></h2> <h2><?php echo $user->lang['Edit_template']; ?></h2>
<p><?php echo $lang['Edit_template_explain']; ?></p> <p><?php echo $user->lang['Edit_template_explain']; ?></p>
<form method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=edittemplate"; ?>"> <form method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=edittemplate"; ?>">
<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> <p><?php echo $user->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" width="95%" cellspacing="1" cellpadding="0" border="0" align="center"> <table class="bg" width="95%" cellspacing="1" cellpadding="0" border="0" align="center">
<tr> <tr>
@ -265,11 +278,11 @@ switch ( $mode )
add_admin_log('log_theme_edit', $theme_name); add_admin_log('log_theme_edit', $theme_name);
message_die(MESSAGE, $lang['Success_theme_update']); message_die(MESSAGE, $user->lang['Success_theme_update']);
} }
} }
page_header($lang['Edit_theme']); page_header($user->lang['Edit_theme']);
$sql = "SELECT theme_id, theme_name $sql = "SELECT theme_id, theme_name
FROM " . STYLES_CSS_TABLE; FROM " . STYLES_CSS_TABLE;
@ -306,24 +319,24 @@ switch ( $mode )
<form method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=$mode"; ?>"> <form method="post" action="<?php echo "admin_styles.$phpEx$SID&amp;mode=$mode"; ?>">
<h2><?php echo $lang['Edit_theme']; ?></h2> <h2><?php echo $user->lang['Edit_theme']; ?></h2>
<p><?php echo $lang['Edit_theme_explain']; ?></p> <p><?php echo $user->lang['Edit_theme_explain']; ?></p>
<table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center"> <table class="bg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <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> <td class="cat" colspan="2" align="center"><?php echo $user->lang['Select_theme']; ?>: <select name="themeroot"><?php echo $theme_options; ?></select>&nbsp; <input class="liteoption" type="submit" name="tpl_root" value="<?php echo $user->lang['Select']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['CSS_data']; ?>: <br /><span class="gensmall"><?php echo $lang['CSS_data_explain']; ?></td> <td class="row1"><?php echo $user->lang['CSS_data']; ?>: <br /><span class="gensmall"><?php echo $user->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> <td class="row2"><textarea class="edit" cols="65" rows="15" name="css_data"><?php echo htmlentities($css_data); ?></textarea></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['CSS_sheet']; ?>: </td> <td class="row1"><?php echo $user->lang['CSS_sheet']; ?>: </td>
<td class="row2"><input type="text" name="css_external" maxlength="60" size="60" value="<?php echo $css_external; ?>" /></td> <td class="row2"><input type="text" name="css_external" maxlength="60" size="60" value="<?php echo $css_external; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><input class="liteoption" type="submit" name="update" value="<?php echo $lang['Update']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="reset" value="<?php echo $lang['Reset']; ?>" /></td> <td class="cat" colspan="2" align="center"><input class="liteoption" type="submit" name="update" value="<?php echo $user->lang['Update']; ?>" />&nbsp;&nbsp;<input class="liteoption" type="reset" value="<?php echo $user->lang['Reset']; ?>" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -78,7 +78,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
$this_userdata = get_userdata($user_id); $this_userdata = get_userdata($user_id);
if( !$this_userdata ) if( !$this_userdata )
{ {
message_die(MESSAGE, $lang['No_user_id_specified'] ); message_die(MESSAGE, $user->lang['No_user_id_specified'] );
} }
$username = ( !empty($_POST['username']) ) ? trim(strip_tags( $_POST['username'] ) ) : ''; $username = ( !empty($_POST['username']) ) ? trim(strip_tags( $_POST['username'] ) ) : '';
@ -175,7 +175,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
if( !validate_username($username) ) if( !validate_username($username) )
{ {
$error = TRUE; $error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Invalid_username']; $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $user->lang['Invalid_username'];
} }
else else
{ {
@ -193,7 +193,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
if($password != $password_confirm) if($password != $password_confirm)
{ {
$error = TRUE; $error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch']; $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $user->lang['Password_mismatch'];
} }
else else
{ {
@ -204,12 +204,12 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
else if( $password && !$password_confirm ) else if( $password && !$password_confirm )
{ {
$error = TRUE; $error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch']; $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $user->lang['Password_mismatch'];
} }
else if( !$password && $password_confirm ) else if( !$password && $password_confirm )
{ {
$error = TRUE; $error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Password_mismatch']; $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $user->lang['Password_mismatch'];
} }
if( $user_status == 0 ) if( $user_status == 0 )
@ -239,7 +239,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
if ( strlen($sig_length_check) > $board_config['max_sig_chars'] ) if ( strlen($sig_length_check) > $board_config['max_sig_chars'] )
{ {
$error = TRUE; $error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Signature_too_long']; $error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $user->lang['Signature_too_long'];
} }
} }
@ -274,7 +274,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
{ {
$error_msg .= "<br />"; $error_msg .= "<br />";
} }
$error_msg .= $lang['Only_one_avatar']; $error_msg .= $user->lang['Only_one_avatar'];
} }
if( $user_avatar_loc != "" ) if( $user_avatar_loc != "" )
@ -306,7 +306,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
break; break;
default: default:
$error = true; $error = true;
$error_msg = (!empty($error_msg)) ? $error_msg . "<br />" . $lang['Avatar_filetype'] : $lang['Avatar_filetype']; $error_msg = (!empty($error_msg)) ? $error_msg . "<br />" . $user->lang['Avatar_filetype'] : $user->lang['Avatar_filetype'];
break; break;
} }
@ -333,7 +333,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
} }
else else
{ {
$l_avatar_size = sprintf($lang['Avatar_imagesize'], $board_config['avatar_max_width'], $board_config['avatar_max_height']); $l_avatar_size = sprintf($user->lang['Avatar_imagesize'], $board_config['avatar_max_width'], $board_config['avatar_max_height']);
$error = true; $error = true;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $l_avatar_size : $l_avatar_size; $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $l_avatar_size : $l_avatar_size;
@ -342,7 +342,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
} }
else else
{ {
$l_avatar_size = sprintf($lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024)); $l_avatar_size = sprintf($user->lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024));
$error = true; $error = true;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $l_avatar_size : $l_avatar_size; $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $l_avatar_size : $l_avatar_size;
@ -351,7 +351,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
else else
{ {
$error = true; $error = true;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Avatar_filetype'] : $lang['Avatar_filetype']; $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $user->lang['Avatar_filetype'] : $user->lang['Avatar_filetype'];
} }
} }
else if( !empty($user_avatar_url) ) else if( !empty($user_avatar_url) )
@ -406,7 +406,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
break; break;
default: default:
$error = true; $error = true;
$error_msg = (!empty($error_msg)) ? $error_msg . "<br />" . $lang['Avatar_filetype'] : $lang['Avatar_filetype']; $error_msg = (!empty($error_msg)) ? $error_msg . "<br />" . $user->lang['Avatar_filetype'] : $user->lang['Avatar_filetype'];
break; break;
} }
@ -443,7 +443,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
} }
else else
{ {
$l_avatar_size = sprintf($lang['Avatar_imagesize'], $board_config['avatar_max_width'], $board_config['avatar_max_height']); $l_avatar_size = sprintf($user->lang['Avatar_imagesize'], $board_config['avatar_max_width'], $board_config['avatar_max_height']);
$error = true; $error = true;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $l_avatar_size : $l_avatar_size; $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $l_avatar_size : $l_avatar_size;
@ -465,7 +465,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
// No data // No data
// //
$error = true; $error = true;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['File_no_data'] : $lang['File_no_data']; $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $user->lang['File_no_data'] : $user->lang['File_no_data'];
} }
} }
else else
@ -474,18 +474,18 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
// No connection // No connection
// //
$error = true; $error = true;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['No_connection_URL'] : $lang['No_connection_URL']; $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $user->lang['No_connection_URL'] : $user->lang['No_connection_URL'];
} }
} }
else else
{ {
$error = true; $error = true;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Incomplete_URL'] : $lang['Incomplete_URL']; $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $user->lang['Incomplete_URL'] : $user->lang['Incomplete_URL'];
} }
} }
else if( !empty($user_avatar_name) ) else if( !empty($user_avatar_name) )
{ {
$l_avatar_size = sprintf($lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024)); $l_avatar_size = sprintf($user->lang['Avatar_filesize'], round($board_config['avatar_filesize'] / 1024));
$error = true; $error = true;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $l_avatar_size : $l_avatar_size; $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $l_avatar_size : $l_avatar_size;
@ -505,7 +505,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
else else
{ {
$error = true; $error = true;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Wrong_remote_avatar_format'] : $lang['Wrong_remote_avatar_format']; $error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $user->lang['Wrong_remote_avatar_format'] : $user->lang['Wrong_remote_avatar_format'];
} }
} }
else if( $user_avatar_local != "" && $avatar_sql == "" && !$error ) else if( $user_avatar_local != "" && $avatar_sql == "" && !$error )
@ -564,7 +564,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
$db->sql_transaction('commit'); $db->sql_transaction('commit');
$message = $lang['User_deleted']; $message = $user->lang['User_deleted'];
} }
else else
@ -582,10 +582,10 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
$db->sql_query($sql); $db->sql_query($sql);
} }
$message .= $lang['Admin_user_updated']; $message .= $user->lang['Admin_user_updated'];
} }
$message .= '<br /><br />' . sprintf($lang['Click_return_useradmin'], '<a href="' . "admin_users.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . "index.$phpE$SID?pane=right" . '">', '</a>'); $message .= '<br /><br />' . sprintf($user->lang['Click_return_useradmin'], '<a href="' . "admin_users.$phpEx$SID" . '">', '</a>') . '<br /><br />' . sprintf($user->lang['Click_return_admin_index'], '<a href="' . "index.$phpE$SID?pane=right" . '">', '</a>');
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
} }
@ -629,7 +629,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
$this_userdata = get_userdata($user_id); $this_userdata = get_userdata($user_id);
if( !$this_userdata ) if( !$this_userdata )
{ {
message_die(MESSAGE, $lang['No_user_id_specified'] ); message_die(MESSAGE, $user->lang['No_user_id_specified'] );
} }
} }
else else
@ -637,7 +637,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
$this_userdata = get_userdata( $_POST['username'] ); $this_userdata = get_userdata( $_POST['username'] );
if( !$this_userdata ) if( !$this_userdata )
{ {
message_die(MESSAGE, $lang['No_user_id_specified'] ); message_die(MESSAGE, $user->lang['No_user_id_specified'] );
} }
} }
@ -684,9 +684,9 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
$COPPA = false; $COPPA = false;
$html_status = ($this_userdata['user_allowhtml'] ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF']; $html_status = ($this_userdata['user_allowhtml'] ) ? $user->lang['HTML_is_ON'] : $user->lang['HTML_is_OFF'];
$bbcode_status = ($this_userdata['user_allowbbcode'] ) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF']; $bbcode_status = ($this_userdata['user_allowbbcode'] ) ? $user->lang['BBCode_is_ON'] : $user->lang['BBCode_is_OFF'];
$smilies_status = ($this_userdata['user_allowsmile'] ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF']; $smilies_status = ($this_userdata['user_allowsmile'] ) ? $user->lang['Smilies_are_ON'] : $user->lang['Smilies_are_OFF'];
} }
if( isset($_POST['avatargallery']) && !$error ) if( isset($_POST['avatargallery']) && !$error )
@ -805,13 +805,13 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
$s_hidden_fields .= '<input type="hidden" name="user_rank" value="' . $user_rank . '" />'; $s_hidden_fields .= '<input type="hidden" name="user_rank" value="' . $user_rank . '" />';
$template->assign_vars(array( $template->assign_vars(array(
"L_USER_TITLE" => $lang['User_admin'], "L_USER_TITLE" => $user->lang['User_admin'],
"L_USER_EXPLAIN" => $lang['User_admin_explain'], "L_USER_EXPLAIN" => $user->lang['User_admin_explain'],
"L_AVATAR_GALLERY" => $lang['Avatar_gallery'], "L_AVATAR_GALLERY" => $user->lang['Avatar_gallery'],
"L_SELECT_AVATAR" => $lang['Select_avatar'], "L_SELECT_AVATAR" => $user->lang['Select_avatar'],
"L_RETURN_PROFILE" => $lang['Return_profile'], "L_RETURN_PROFILE" => $user->lang['Return_profile'],
"L_CATEGORY" => $lang['Select_category'], "L_CATEGORY" => $user->lang['Select_category'],
"L_GO" => $lang['Go'], "L_GO" => $user->lang['Go'],
"S_OPTIONS_CATEGORIES" => $s_categories, "S_OPTIONS_CATEGORIES" => $s_categories,
"S_COLSPAN" => $s_colspan, "S_COLSPAN" => $s_colspan,
@ -855,7 +855,7 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
ORDER BY rank_title"; ORDER BY rank_title";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$rank_select_box = '<option value="0">' . $lang['No_assigned_rank'] . '</option>'; $rank_select_box = '<option value="0">' . $user->lang['No_assigned_rank'] . '</option>';
while( $row = $db->sql_fetchrow($result) ) while( $row = $db->sql_fetchrow($result) )
{ {
$rank = $row['rank_title']; $rank = $row['rank_title'];
@ -921,72 +921,72 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
'USER_ACTIVE_NO' => (!$user_status) ? 'checked="checked"' : '', 'USER_ACTIVE_NO' => (!$user_status) ? 'checked="checked"' : '',
'RANK_SELECT_BOX' => $rank_select_box, 'RANK_SELECT_BOX' => $rank_select_box,
'L_USER_TITLE' => $lang['User_admin'], 'L_USER_TITLE' => $user->lang['User_admin'],
'L_USER_EXPLAIN' => $lang['User_admin_explain'], 'L_USER_EXPLAIN' => $user->lang['User_admin_explain'],
'L_NEW_PASSWORD' => $lang['New_password'], 'L_NEW_PASSWORD' => $user->lang['New_password'],
'L_PASSWORD_IF_CHANGED' => $lang['password_if_changed'], 'L_PASSWORD_IF_CHANGED' => $user->lang['password_if_changed'],
'L_CONFIRM_PASSWORD' => $lang['Confirm_password'], 'L_CONFIRM_PASSWORD' => $user->lang['Confirm_password'],
'L_PASSWORD_CONFIRM_IF_CHANGED' => $lang['password_confirm_if_changed'], 'L_PASSWORD_CONFIRM_IF_CHANGED' => $user->lang['password_confirm_if_changed'],
'L_SUBMIT' => $lang['Submit'], 'L_SUBMIT' => $user->lang['Submit'],
'L_RESET' => $lang['Reset'], 'L_RESET' => $user->lang['Reset'],
'L_ICQ_NUMBER' => $lang['ICQ'], 'L_ICQ_NUMBER' => $user->lang['ICQ'],
'L_MESSENGER' => $lang['MSNM'], 'L_MESSENGER' => $user->lang['MSNM'],
'L_YAHOO' => $lang['YIM'], 'L_YAHOO' => $user->lang['YIM'],
'L_WEBSITE' => $lang['Website'], 'L_WEBSITE' => $user->lang['Website'],
'L_AIM' => $lang['AIM'], 'L_AIM' => $user->lang['AIM'],
'L_LOCATION' => $lang['From'], 'L_LOCATION' => $user->lang['From'],
'L_OCCUPATION' => $lang['Occupation'], 'L_OCCUPATION' => $user->lang['Occupation'],
'L_BOARD_LANGUAGE' => $lang['Board_lang'], 'L_BOARD_LANGUAGE' => $user->lang['Board_lang'],
'L_BOARD_STYLE' => $lang['Board_style'], 'L_BOARD_STYLE' => $user->lang['Board_style'],
'L_TIMEZONE' => $lang['Timezone'], 'L_TIMEZONE' => $user->lang['Timezone'],
'L_DATE_FORMAT' => $lang['Date_format'], 'L_DATE_FORMAT' => $user->lang['Date_format'],
'L_DATE_FORMAT_EXPLAIN' => $lang['Date_format_explain'], 'L_DATE_FORMAT_EXPLAIN' => $user->lang['Date_format_explain'],
'L_YES' => $lang['Yes'], 'L_YES' => $user->lang['Yes'],
'L_NO' => $lang['No'], 'L_NO' => $user->lang['No'],
'L_INTERESTS' => $lang['Interests'], 'L_INTERESTS' => $user->lang['Interests'],
'L_ALWAYS_ALLOW_SMILIES' => $lang['Always_smile'], 'L_ALWAYS_ALLOW_SMILIES' => $user->lang['Always_smile'],
'L_ALWAYS_ALLOW_BBCODE' => $lang['Always_bbcode'], 'L_ALWAYS_ALLOW_BBCODE' => $user->lang['Always_bbcode'],
'L_ALWAYS_ALLOW_HTML' => $lang['Always_html'], 'L_ALWAYS_ALLOW_HTML' => $user->lang['Always_html'],
'L_HIDE_USER' => $lang['Hide_user'], 'L_HIDE_USER' => $user->lang['Hide_user'],
'L_ALWAYS_ADD_SIGNATURE' => $lang['Always_add_sig'], 'L_ALWAYS_ADD_SIGNATURE' => $user->lang['Always_add_sig'],
'L_SPECIAL' => $lang['User_special'], 'L_SPECIAL' => $user->lang['User_special'],
'L_SPECIAL_EXPLAIN' => $lang['User_specail_explain'], 'L_SPECIAL_EXPLAIN' => $user->lang['User_specail_explain'],
'L_USER_ACTIVE' => $lang['User_status'], 'L_USER_ACTIVE' => $user->lang['User_status'],
'L_ALLOW_PM' => $lang['User_allowpm'], 'L_ALLOW_PM' => $user->lang['User_allowpm'],
'L_ALLOW_AVATAR' => $lang['User_allowavatar'], 'L_ALLOW_AVATAR' => $user->lang['User_allowavatar'],
'L_AVATAR_PANEL' => $lang['Avatar_panel'], 'L_AVATAR_PANEL' => $user->lang['Avatar_panel'],
'L_AVATAR_EXPLAIN' => $lang['Admin_avatar_explain'], 'L_AVATAR_EXPLAIN' => $user->lang['Admin_avatar_explain'],
'L_DELETE_AVATAR' => $lang['Delete_Image'], 'L_DELETE_AVATAR' => $user->lang['Delete_Image'],
'L_CURRENT_IMAGE' => $lang['Current_Image'], 'L_CURRENT_IMAGE' => $user->lang['Current_Image'],
'L_UPLOAD_AVATAR_FILE' => $lang['Upload_Avatar_file'], 'L_UPLOAD_AVATAR_FILE' => $user->lang['Upload_Avatar_file'],
'L_UPLOAD_AVATAR_URL' => $lang['Upload_Avatar_URL'], 'L_UPLOAD_AVATAR_URL' => $user->lang['Upload_Avatar_URL'],
'L_AVATAR_GALLERY' => $lang['Select_from_gallery'], 'L_AVATAR_GALLERY' => $user->lang['Select_from_gallery'],
'L_SHOW_GALLERY' => $lang['View_avatar_gallery'], 'L_SHOW_GALLERY' => $user->lang['View_avatar_gallery'],
'L_LINK_REMOTE_AVATAR' => $lang['Link_remote_Avatar'], 'L_LINK_REMOTE_AVATAR' => $user->lang['Link_remote_Avatar'],
'L_SIGNATURE' => $lang['Signature'], 'L_SIGNATURE' => $user->lang['Signature'],
'L_SIGNATURE_EXPLAIN' => sprintf($lang['Signature_explain'], $board_config['max_sig_chars'] ), 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['Signature_explain'], $board_config['max_sig_chars'] ),
'L_NOTIFY_ON_PRIVMSG' => $lang['Notify_on_privmsg'], 'L_NOTIFY_ON_PRIVMSG' => $user->lang['Notify_on_privmsg'],
'L_NOTIFY_ON_REPLY' => $lang['Always_notify'], 'L_NOTIFY_ON_REPLY' => $user->lang['Always_notify'],
'L_POPUP_ON_PRIVMSG' => $lang['Popup_on_privmsg'], 'L_POPUP_ON_PRIVMSG' => $user->lang['Popup_on_privmsg'],
'L_PREFERENCES' => $lang['Preferences'], 'L_PREFERENCES' => $user->lang['Preferences'],
'L_PUBLIC_VIEW_EMAIL' => $lang['Public_view_email'], 'L_PUBLIC_VIEW_EMAIL' => $user->lang['Public_view_email'],
'L_ITEMS_REQUIRED' => $lang['Items_required'], 'L_ITEMS_REQUIRED' => $user->lang['Items_required'],
'L_REGISTRATION_INFO' => $lang['Registration_info'], 'L_REGISTRATION_INFO' => $user->lang['Registration_info'],
'L_PROFILE_INFO' => $lang['Profile_info'], 'L_PROFILE_INFO' => $user->lang['Profile_info'],
'L_PROFILE_INFO_NOTICE' => $lang['Profile_info_warn'], 'L_PROFILE_INFO_NOTICE' => $user->lang['Profile_info_warn'],
'L_EMAIL_ADDRESS' => $lang['Email_address'], 'L_EMAIL_ADDRESS' => $user->lang['Email_address'],
'S_FORM_ENCTYPE' => $form_enctype, 'S_FORM_ENCTYPE' => $form_enctype,
'HTML_STATUS' => $html_status, 'HTML_STATUS' => $html_status,
'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="../' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>'), 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="../' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>'),
'SMILIES_STATUS' => $smilies_status, 'SMILIES_STATUS' => $smilies_status,
'L_DELETE_USER' => $lang['User_delete'], 'L_DELETE_USER' => $user->lang['User_delete'],
'L_DELETE_USER_EXPLAIN' => $lang['User_delete_explain'], 'L_DELETE_USER_EXPLAIN' => $user->lang['User_delete_explain'],
'L_SELECT_RANK' => $lang['Rank_title'], 'L_SELECT_RANK' => $user->lang['Rank_title'],
'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_HIDDEN_FIELDS' => $s_hidden_fields,
'S_PROFILE_ACTION' => "admin_users.$phpEx$SID") 'S_PROFILE_ACTION' => "admin_users.$phpEx$SID")
@ -1013,20 +1013,20 @@ if ( $mode == 'edit' || $mode == 'save' && ( isset($_POST['username']) || isset(
else else
{ {
page_header($lang['Manage']); page_header($user->lang['Manage']);
?> ?>
<h1><?php echo $lang['User_admin']; ?></h1> <h1><?php echo $user->lang['User_admin']; ?></h1>
<p><?php echo $lang['User_admin_explain']; ?></p> <p><?php echo $user->lang['User_admin_explain']; ?></p>
<form method="post" name="post" action="<?php echo "admin_users.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" name="post" action="<?php echo "admin_users.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th align="center"><?php echo $lang['Select_a_User']; ?></th> <th align="center"><?php echo $user->lang['Select_a_User']; ?></th>
</tr> </tr>
<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> <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 $user->lang['Look_up_user']; ?>" class="mainoption" /> <input type="submit" name="usersubmit" value="<?php echo $user->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> </tr>
</table></form> </table></form>

View file

@ -46,7 +46,7 @@ require('pagestart.' . $phpEx);
// //
if ( !$auth->acl_get('a_general') ) if ( !$auth->acl_get('a_general') )
{ {
message_die(MESSAGE, $lang['No_admin']); message_die(MESSAGE, $user->lang['No_admin']);
} }
// //
@ -74,8 +74,8 @@ else
// Define some vars depending on which logs we're looking at // Define some vars depending on which logs we're looking at
$log_table_sql = ( $mode == 'admin' ) ? LOG_ADMIN_TABLE : LOG_MOD_TABLE; $log_table_sql = ( $mode == 'admin' ) ? LOG_ADMIN_TABLE : LOG_MOD_TABLE;
$l_title = ( $mode == 'admin' ) ? $lang['Admin_logs'] : $lang['Mod_logs']; $l_title = ( $mode == 'admin' ) ? $user->lang['Admin_logs'] : $user->lang['Mod_logs'];
$l_title_explain = ( $mode == 'admin' ) ? $lang['Admin_logs_explain'] : $lang['Mod_logs_explain']; $l_title_explain = ( $mode == 'admin' ) ? $user->lang['Admin_logs_explain'] : $user->lang['Mod_logs_explain'];
// //
// Delete entries if requested and able // Delete entries if requested and able
@ -126,8 +126,8 @@ else
$sort_dir = 'd'; $sort_dir = 'd';
} }
$previous_days = array(0 => $lang['All_Entries'], 1 => $lang['1_Day'], 7 => $lang['7_Days'], 14 => $lang['2_Weeks'], 30 => $lang['1_Month'], 90 => $lang['3_Months'], 180 => $lang['6_Months'], 364 => $lang['1_Year']); $previous_days = array(0 => $user->lang['All_Entries'], 1 => $user->lang['1_Day'], 7 => $user->lang['7_Days'], 14 => $user->lang['2_Weeks'], 30 => $user->lang['1_Month'], 90 => $user->lang['3_Months'], 180 => $user->lang['6_Months'], 364 => $user->lang['1_Year']);
$sort_by_text = array('u' => $lang['Sort_Username'], 't' => $lang['Sort_date'], 'i' => $lang['Sort_ip'], 'o' => $lang['Sort_action']); $sort_by_text = array('u' => $user->lang['Sort_Username'], 't' => $user->lang['Sort_date'], 'i' => $user->lang['Sort_ip'], 'o' => $user->lang['Sort_action']);
$sort_by = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); $sort_by = array('u' => 'l.user_id', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
$sort_day_options = ''; $sort_day_options = '';
@ -144,7 +144,7 @@ foreach ( $sort_by_text as $key => $text )
$sort_key_options .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>'; $sort_key_options .= '<option value="' . $key . '"' . $selected . '>' . $text . '</option>';
} }
$sort_order_options = ( $sort_dir == 'a' ) ? '<option value="a" selected="selected">' . $lang['Sort_Ascending'] . '</option><option value="d">' . $lang['Sort_Descending'] . '</option>' : '<option value="a">' . $lang['Sort_Ascending'] . '</option><option value="d" selected="selected">' . $lang['Sort_Descending'] . '</option>'; $sort_order_options = ( $sort_dir == 'a' ) ? '<option value="a" selected="selected">' . $user->lang['Sort_Ascending'] . '</option><option value="d">' . $user->lang['Sort_Descending'] . '</option>' : '<option value="a">' . $user->lang['Sort_Ascending'] . '</option><option value="d" selected="selected">' . $user->lang['Sort_Descending'] . '</option>';
$sort_sql = $sort_by[$sort_key] . ' ' . ( ( $sort_dir == 'd' ) ? 'DESC' : 'ASC' ); $sort_sql = $sort_by[$sort_key] . ' ' . ( ( $sort_dir == 'd' ) ? 'DESC' : 'ASC' );
@ -169,7 +169,7 @@ if ( $mode == 'mod' )
?> ?>
<table width="100%" cellpadding="1" cellspacing="1" border="0"> <table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr> <tr>
<td align="right"><?php echo $lang['Select_forum']; ?>: <select name="f" onchange="this.form.submit()"><?php echo $forum_box; ?></select> <input class="liteoption" type="submit" value="<?php echo $lang['Go']; ?>" /></td> <td align="right"><?php echo $user->lang['Select_forum']; ?>: <select name="f" onchange="this.form.submit()"><?php echo $forum_box; ?></select> <input class="liteoption" type="submit" value="<?php echo $user->lang['Go']; ?>" /></td>
</tr> </tr>
</table> </table>
<?php <?php
@ -180,14 +180,14 @@ if ( $mode == 'mod' )
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0"> <table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
<tr> <tr>
<td class="cat" colspan="5" height="28" align="center"><span class="gensmall"><?php echo $lang['Display_log']; ?>: &nbsp;<select name="sort_days"><?php echo $sort_day_options; ?></select>&nbsp;<?php echo $lang['Sort_by']; ?> <select name="sort_key"><?php echo $sort_key_options; ?></select> <select name="sort_dir"><?php echo $sort_order_options; ?></select>&nbsp;<input class="liteoption" type="submit" value="<?php echo $lang['Go']; ?>" name="sort" /></span></td> <td class="cat" colspan="5" height="28" align="center"><span class="gensmall"><?php echo $user->lang['Display_log']; ?>: &nbsp;<select name="sort_days"><?php echo $sort_day_options; ?></select>&nbsp;<?php echo $user->lang['Sort_by']; ?> <select name="sort_key"><?php echo $sort_key_options; ?></select> <select name="sort_dir"><?php echo $sort_order_options; ?></select>&nbsp;<input class="liteoption" type="submit" value="<?php echo $user->lang['Go']; ?>" name="sort" /></span></td>
</tr> </tr>
<tr> <tr>
<th width="15%" height="25" nowrap="nowrap"><?php echo $lang['Username']; ?></th> <th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['Username']; ?></th>
<th width="15%" nowrap="nowrap"><?php echo $lang['IP']; ?></th> <th width="15%" nowrap="nowrap"><?php echo $user->lang['IP']; ?></th>
<th width="20%" nowrap="nowrap"><?php echo $lang['Time']; ?></th> <th width="20%" nowrap="nowrap"><?php echo $user->lang['Time']; ?></th>
<th width="45%" nowrap="nowrap"><?php echo $lang['Action']; ?></th> <th width="45%" nowrap="nowrap"><?php echo $user->lang['Action']; ?></th>
<th nowrap="nowrap"><?php echo $lang['Mark']; ?></th> <th nowrap="nowrap"><?php echo $user->lang['Mark']; ?></th>
</tr> </tr>
<?php <?php
@ -208,7 +208,7 @@ if ( $log_count )
<tr> <tr>
<td class="<?php echo $row_class; ?>" nowrap="nowrap"><?php echo $log_data[$i]['username']; ?></td> <td class="<?php echo $row_class; ?>" nowrap="nowrap"><?php echo $log_data[$i]['username']; ?></td>
<td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><?php echo $log_data[$i]['ip']; ?></td> <td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><?php echo $log_data[$i]['ip']; ?></td>
<td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><?php echo create_date($board_config['default_dateformat'], $log_data[$i]['time'], $board_config['board_timezone']); ?></td> <td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><?php echo $user->format_date($log_data[$i]['time']); ?></td>
<td class="<?php echo $row_class; ?>"><?php echo $log_data[$i]['action']; ?></td> <td class="<?php echo $row_class; ?>"><?php echo $log_data[$i]['action']; ?></td>
<td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><input type="checkbox" name="mark[]" value="<?php echo $log_data[$i]['id']; ?>" /></td> <td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><input type="checkbox" name="mark[]" value="<?php echo $log_data[$i]['id']; ?>" /></td>
</tr> </tr>
@ -221,7 +221,7 @@ if ( $log_count )
?> ?>
<tr> <tr>
<td class="cat" colspan="5" height="28" align="right"><input class="liteoption" type="submit" name="delmarked" value="<?php echo $lang['Delete_marked']; ?>" />&nbsp; <input class="liteoption" type="submit" name="delall" value="<?php echo $lang['Delete_all']; ?>" />&nbsp;</td> <td class="cat" colspan="5" height="28" align="right"><input class="liteoption" type="submit" name="delmarked" value="<?php echo $user->lang['Delete_marked']; ?>" />&nbsp; <input class="liteoption" type="submit" name="delall" value="<?php echo $user->lang['Delete_all']; ?>" />&nbsp;</td>
</tr> </tr>
<?php <?php
@ -231,7 +231,7 @@ else
{ {
?> ?>
<tr> <tr>
<td class="row1" colspan="5" align="center" nowrap="nowrap"><?php echo $lang['No_entries']; ?></td> <td class="row1" colspan="5" align="center" nowrap="nowrap"><?php echo $user->lang['No_entries']; ?></td>
</tr> </tr>
<?php <?php
@ -249,7 +249,7 @@ else
{ {
?><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $lang['Mark_all']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $lang['Unmark_all']; ?></a></span></b>&nbsp;<br /><br /><?php ?><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $user->lang['Mark_all']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $user->lang['Unmark_all']; ?></a></span></b>&nbsp;<br /><br /><?php
} }

View file

@ -86,7 +86,7 @@ if( $mode != '' )
{ {
if ( !$word_id ) if ( !$word_id )
{ {
message_die(MESSAGE, $lang['No_word_selected']); message_die(MESSAGE, $user->lang['No_word_selected']);
} }
$sql = "SELECT * $sql = "SELECT *
@ -98,28 +98,28 @@ if( $mode != '' )
$s_hidden_fields .= '<input type="hidden" name="id" value="' . $word_id . '" />'; $s_hidden_fields .= '<input type="hidden" name="id" value="' . $word_id . '" />';
} }
page_header($lang['Words_title']); page_header($user->lang['Words_title']);
?> ?>
<h1><?php echo $lang['Words_title']; ?></h1> <h1><?php echo $user->lang['Words_title']; ?></h1>
<p><?php echo $lang['Words_explain']; ?></p> <p><?php echo $user->lang['Words_explain']; ?></p>
<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th colspan="2"><?php echo $lang['Edit_word_censor']; ?></th> <th colspan="2"><?php echo $user->lang['Edit_word_censor']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Word']; ?></td> <td class="row1"><?php echo $user->lang['Word']; ?></td>
<td class="row2"><input type="text" name="word" value="<?php echo $word_info['word']; ?>" /></td> <td class="row2"><input type="text" name="word" value="<?php echo $word_info['word']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['Replacement']; ?></td> <td class="row1"><?php echo $user->lang['Replacement']; ?></td>
<td class="row2"><input type="text" name="replacement" value="<?php echo $word_info['replacement']; ?>" /></td> <td class="row2"><input type="text" name="replacement" value="<?php echo $word_info['replacement']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input class="mainoption" type="submit" name="save" value="<?php echo $lang['Submit']; ?>" /></td> <td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input class="mainoption" type="submit" name="save" value="<?php echo $user->lang['Submit']; ?>" /></td>
</tr> </tr>
</table></form> </table></form>
@ -134,7 +134,7 @@ if( $mode != '' )
if ( $word == '' || $replacement == '' ) if ( $word == '' || $replacement == '' )
{ {
message_die(MESSAGE, $lang['Must_enter_word']); message_die(MESSAGE, $user->lang['Must_enter_word']);
} }
$sql = ( $word_id ) ? "UPDATE " . WORDS_TABLE . " SET word = '" . str_replace("\'", "''", $word) . "', replacement = '" . str_replace("\'", "''", $replacement) . "' WHERE word_id = $word_id" : "INSERT INTO " . WORDS_TABLE . " (word, replacement) VALUES ('" . str_replace("\'", "''", $word) . "', '" . str_replace("\'", "''", $replacement) . "')"; $sql = ( $word_id ) ? "UPDATE " . WORDS_TABLE . " SET word = '" . str_replace("\'", "''", $word) . "', replacement = '" . str_replace("\'", "''", $replacement) . "' WHERE word_id = $word_id" : "INSERT INTO " . WORDS_TABLE . " (word, replacement) VALUES ('" . str_replace("\'", "''", $word) . "', '" . str_replace("\'", "''", $replacement) . "')";
@ -143,7 +143,7 @@ if( $mode != '' )
$log_action = ( $word_id ) ? 'log_edit_word' : 'log_add_word'; $log_action = ( $word_id ) ? 'log_edit_word' : 'log_add_word';
add_admin_log($log_action, stripslashes($word)); add_admin_log($log_action, stripslashes($word));
$message = ( $word_id ) ? $lang['Word_updated'] : $lang['Word_added']; $message = ( $word_id ) ? $user->lang['Word_updated'] : $user->lang['Word_added'];
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
break; break;
@ -155,7 +155,7 @@ if( $mode != '' )
} }
else else
{ {
message_die(MESSAGE, $lang['Must_specify_word']); message_die(MESSAGE, $user->lang['Must_specify_word']);
} }
$sql = "DELETE FROM " . WORDS_TABLE . " $sql = "DELETE FROM " . WORDS_TABLE . "
@ -164,7 +164,7 @@ if( $mode != '' )
add_admin_log('log_delete_word'); add_admin_log('log_delete_word');
message_die(MESSAGE, $lang['Word_removed']); message_die(MESSAGE, $user->lang['Word_removed']);
break; break;
} }
@ -172,19 +172,19 @@ if( $mode != '' )
else else
{ {
page_header($lang['Words_title']); page_header($user->lang['Words_title']);
?> ?>
<h1><?php echo $lang['Words_title']; ?></h1> <h1><?php echo $user->lang['Words_title']; ?></h1>
<p><?php echo $lang['Words_explain']; ?></p> <p><?php echo $user->lang['Words_explain']; ?></p>
<form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <form method="post" action="<?php echo "admin_words.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<th><?php echo $lang['Word']; ?></th> <th><?php echo $user->lang['Word']; ?></th>
<th><?php echo $lang['Replacement']; ?></th> <th><?php echo $user->lang['Replacement']; ?></th>
<th colspan="2"><?php echo $lang['Action']; ?></th> <th colspan="2"><?php echo $user->lang['Action']; ?></th>
</tr> </tr>
<?php <?php
@ -204,8 +204,8 @@ else
<tr> <tr>
<td class="<?php echo $row_class; ?>" align="center"><?php echo $row['word']; ?></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; ?>" 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=edit&amp;id=" . $row['word_id']; ?>"><?php echo $user->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> <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 $user->lang['Delete']; ?></a>&nbsp;</td>
</tr> </tr>
<?php <?php
@ -215,7 +215,7 @@ else
?> ?>
<tr> <tr>
<td class="cat" colspan="5" height="28" align="center"><?php echo $s_hidden_fields; ?><input class="mainoption" type="submit" name="add" value="<?php echo $lang['Add_new_word']; ?>" /></td> <td class="cat" colspan="5" height="28" align="center"><?php echo $s_hidden_fields; ?><input class="mainoption" type="submit" name="add" value="<?php echo $user->lang['Add_new_word']; ?>" /></td>
</tr> </tr>
</table></form> </table></form>

View file

@ -21,25 +21,19 @@
define('IN_PHPBB', 1); define('IN_PHPBB', 1);
//
// Define some vars // Define some vars
//
$pane = ( isset($_GET['pane']) ) ? $_GET['pane'] : ''; $pane = ( isset($_GET['pane']) ) ? $_GET['pane'] : '';
$update = ( $pane == 'right' ) ? true : false; $update = ( $pane == 'right' ) ? true : false;
//
// Include files // Include files
//
$phpbb_root_path = '../'; $phpbb_root_path = '../';
require($phpbb_root_path . 'extension.inc'); require($phpbb_root_path . 'extension.inc');
require('pagestart.' . $phpEx); require('pagestart.' . $phpEx);
//
// Do we have any admin permissions at all? // Do we have any admin permissions at all?
//
if ( !$auth->acl_get('a_') ) if ( !$auth->acl_get('a_') )
{ {
message_die(MESSAGE, 'No_admin', '', true); trigger_error('No_admin');
} }
// Generate relevant output // Generate relevant output
@ -52,7 +46,7 @@ if ( isset($_GET['pane']) && $_GET['pane'] == 'top' )
<table width="100%" cellspacing="0" cellpadding="0" border="0"> <table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr> <tr>
<td><a href="../index.<?php echo $phpEx . $SID; ?>" target="_top"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td> <td><a href="../index.<?php echo $phpEx . $SID; ?>" target="_top"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td>
<td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $lang['Admin_title']; ?></span> &nbsp; &nbsp; &nbsp;</td> <td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $user->lang['Admin_title']; ?></span> &nbsp; &nbsp; &nbsp;</td>
</tr> </tr>
</table> </table>
@ -88,13 +82,13 @@ else if ( isset($_GET['pane']) && $_GET['pane'] == 'left' )
<tr> <tr>
<td width="100%"><table width="100%" cellpadding="4" cellspacing="1" border="0"> <td width="100%"><table width="100%" cellpadding="4" cellspacing="1" border="0">
<tr> <tr>
<th class="menu" height="25">&#0187; <?php echo $lang['Return_to']; ?></th> <th class="menu" height="25">&#0187; <?php echo $user->lang['Return_to']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1"><a class="genmed" href="index.<?php echo $phpEx . $SID; ?>&amp;pane=right" target="main"><?php echo $lang['Admin_Index']; ?></a></td> <td class="row1"><a class="genmed" href="index.<?php echo $phpEx . $SID; ?>&amp;pane=right" target="main"><?php echo $user->lang['Admin_Index']; ?></a></td>
</tr> </tr>
<tr> <tr>
<td class="row2"><a class="genmed" href="../index.<?php echo $phpEx . $SID; ?>" target="_top"><?php echo $lang['Forum_index']; ?></a></td> <td class="row2"><a class="genmed" href="../index.<?php echo $phpEx . $SID; ?>" target="_top"><?php echo $user->lang['Forum_index']; ?></a></td>
</tr> </tr>
<?php <?php
@ -103,7 +97,7 @@ else if ( isset($_GET['pane']) && $_GET['pane'] == 'left' )
@ksort($module); @ksort($module);
foreach ( $module as $cat => $action_ary ) foreach ( $module as $cat => $action_ary )
{ {
$cat = ( !empty($lang[$cat . '_cat']) ) ? $lang[$cat . '_cat'] : preg_replace('/_/', ' ', $cat); $cat = ( !empty($user->lang[$cat . '_cat']) ) ? $user->lang[$cat . '_cat'] : preg_replace('/_/', ' ', $cat);
?> ?>
<tr> <tr>
@ -115,7 +109,7 @@ else if ( isset($_GET['pane']) && $_GET['pane'] == 'left' )
foreach ( $action_ary as $action => $file ) foreach ( $action_ary as $action => $file )
{ {
$action = ( !empty($lang[$action]) ) ? $lang[$action] : preg_replace('/_/', ' ', $action); $action = ( !empty($user->lang[$action]) ) ? $user->lang[$action] : preg_replace('/_/', ' ', $action);
$cell_bg = ( $cell_bg == 'row1' ) ? 'row2' : 'row1'; $cell_bg = ( $cell_bg == 'row1' ) ? 'row2' : 'row1';
?> ?>
@ -225,7 +219,7 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
else else
{ {
// Couldn't open Avatar dir. // Couldn't open Avatar dir.
$avatar_dir_size = $lang['Not_available']; $avatar_dir_size = $user->lang['Not_available'];
} }
if ( $posts_per_day > $total_posts ) if ( $posts_per_day > $total_posts )
@ -283,12 +277,12 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
} }
else else
{ {
$dbsize = $lang['Not_available']; $dbsize = $user->lang['Not_available'];
} }
} }
else else
{ {
$dbsize = $lang['Not_available']; $dbsize = $user->lang['Not_available'];
} }
} }
else if ( preg_match('/^mssql/', SQL_LAYER) ) else if ( preg_match('/^mssql/', SQL_LAYER) )
@ -297,11 +291,11 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
FROM sysfiles"; FROM sysfiles";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$dbsize = ( $row = $db->sql_fetchrow($result) ) ? intval($row['dbsize']) : $lang['Not_available']; $dbsize = ( $row = $db->sql_fetchrow($result) ) ? intval($row['dbsize']) : $user->lang['Not_available'];
} }
else else
{ {
$dbsize = $lang['Not_available']; $dbsize = $user->lang['Not_available'];
} }
if ( is_int($dbsize) ) if ( is_int($dbsize) )
@ -309,7 +303,7 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
$dbsize = ( $dbsize >= 1048576 ) ? sprintf('%.2f MB', ( $dbsize / 1048576 )) : ( ( $dbsize >= 1024 ) ? sprintf('%.2f KB', ( $dbsize / 1024 )) : sprintf('%.2f Bytes', $dbsize) ); $dbsize = ( $dbsize >= 1048576 ) ? sprintf('%.2f MB', ( $dbsize / 1048576 )) : ( ( $dbsize >= 1024 ) ? sprintf('%.2f KB', ( $dbsize / 1024 )) : sprintf('%.2f Bytes', $dbsize) );
} }
page_header($lang['Admin_Index']); page_header($user->lang['Admin_Index']);
?> ?>
@ -325,64 +319,64 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
//--> //-->
</script> </script>
<h1><?php echo $lang['Welcome_phpBB']; ?></h1> <h1><?php echo $user->lang['Welcome_phpBB']; ?></h1>
<p><?php echo $lang['Admin_intro']; ?></p> <p><?php echo $user->lang['Admin_intro']; ?></p>
<h1><?php echo $lang['Forum_stats']; ?></h1> <h1><?php echo $user->lang['Forum_stats']; ?></h1>
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0"> <table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
<tr> <tr>
<th width="25%" nowrap="nowrap" height="25"><?php echo $lang['Statistic']; ?></th> <th width="25%" nowrap="nowrap" height="25"><?php echo $user->lang['Statistic']; ?></th>
<th width="25%"><?php echo $lang['Value']; ?></th> <th width="25%"><?php echo $user->lang['Value']; ?></th>
<th width="25%" nowrap="nowrap"><?php echo $lang['Statistic']; ?></th> <th width="25%" nowrap="nowrap"><?php echo $user->lang['Statistic']; ?></th>
<th width="25%"><?php echo $lang['Value']; ?></th> <th width="25%"><?php echo $user->lang['Value']; ?></th>
</tr> </tr>
<tr> <tr>
<td class="row1" nowrap="nowrap"><?php echo $lang['Number_posts']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Number_posts']; ?>:</td>
<td class="row2"><b><?php echo $total_posts; ?></b></td> <td class="row2"><b><?php echo $total_posts; ?></b></td>
<td class="row1" nowrap="nowrap"><?php echo $lang['Posts_per_day']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Posts_per_day']; ?>:</td>
<td class="row2"><b><?php echo $posts_per_day; ?></b></td> <td class="row2"><b><?php echo $posts_per_day; ?></b></td>
</tr> </tr>
<tr> <tr>
<td class="row1" nowrap="nowrap"><?php echo $lang['Number_topics']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Number_topics']; ?>:</td>
<td class="row2"><b><?php echo $total_topics; ?></b></td> <td class="row2"><b><?php echo $total_topics; ?></b></td>
<td class="row1" nowrap="nowrap"><?php echo $lang['Topics_per_day']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Topics_per_day']; ?>:</td>
<td class="row2"><b><?php echo $topics_per_day; ?></b></td> <td class="row2"><b><?php echo $topics_per_day; ?></b></td>
</tr> </tr>
<tr> <tr>
<td class="row1" nowrap="nowrap"><?php echo $lang['Number_users']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Number_users']; ?>:</td>
<td class="row2"><b><?php echo $total_users; ?></b></td> <td class="row2"><b><?php echo $total_users; ?></b></td>
<td class="row1" nowrap="nowrap"><?php echo $lang['Users_per_day']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Users_per_day']; ?>:</td>
<td class="row2"><b><?php echo $users_per_day; ?></b></td> <td class="row2"><b><?php echo $users_per_day; ?></b></td>
</tr> </tr>
<tr> <tr>
<td class="row1" nowrap="nowrap"><?php echo $lang['Board_started']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Board_started']; ?>:</td>
<td class="row2"><b><?php echo $start_date; ?></b></td> <td class="row2"><b><?php echo $start_date; ?></b></td>
<td class="row1" nowrap="nowrap"><?php echo $lang['Avatar_dir_size']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Avatar_dir_size']; ?>:</td>
<td class="row2"><b><?php echo $avatar_dir_size; ?></b></td> <td class="row2"><b><?php echo $avatar_dir_size; ?></b></td>
</tr> </tr>
<tr> <tr>
<td class="row1" nowrap="nowrap"><?php echo $lang['Database_size']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Database_size']; ?>:</td>
<td class="row2"><b><?php echo $dbsize; ?></b></td> <td class="row2"><b><?php echo $dbsize; ?></b></td>
<td class="row1" nowrap="nowrap"><?php echo $lang['Gzip_compression']; ?>:</td> <td class="row1" nowrap="nowrap"><?php echo $user->lang['Gzip_compression']; ?>:</td>
<td class="row2"><b><?php echo ( $board_config['gzip_compress'] ) ? $lang['ON'] : $lang['OFF']; ?></b></td> <td class="row2"><b><?php echo ( $board_config['gzip_compress'] ) ? $user->lang['ON'] : $user->lang['OFF']; ?></b></td>
</tr> </tr>
<!-- tr> <!-- tr>
<td class="row1" colspan="4"><?php echo sprintf($lang['Record_online_users'], $board_config['record_online_users'], $user->format_date($board_config['record_online_date'])); ?></td> <td class="row1" colspan="4"><?php echo sprintf($user->lang['Record_online_users'], $board_config['record_online_users'], $user->format_date($board_config['record_online_date'])); ?></td>
</tr --> </tr -->
</table> </table>
<h1><?php echo $lang['Admin_log']; ?></h1> <h1><?php echo $user->lang['Admin_log']; ?></h1>
<p><?php echo $lang['Admin_log_index_explain']; ?></p> <p><?php echo $user->lang['Admin_log_index_explain']; ?></p>
<table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0"> <table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
<tr> <tr>
<th width="15%" height="25" nowrap="nowrap"><?php echo $lang['Username']; ?></th> <th width="15%" height="25" nowrap="nowrap"><?php echo $user->lang['Username']; ?></th>
<th width="15%"><?php echo $lang['IP']; ?></th> <th width="15%"><?php echo $user->lang['IP']; ?></th>
<th width="20%"><?php echo $lang['Time']; ?></th> <th width="20%"><?php echo $user->lang['Time']; ?></th>
<th width="45%" nowrap="nowrap"><?php echo $lang['Action']; ?></th> <th width="45%" nowrap="nowrap"><?php echo $user->lang['Action']; ?></th>
</tr> </tr>
<?php <?php
@ -406,15 +400,15 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
?> ?>
</table> </table>
<h1><?php echo $lang['Inactive_users']; ?></h1> <h1><?php echo $user->lang['Inactive_users']; ?></h1>
<p><?php echo $lang['Inactive_users_explain']; ?></p> <p><?php echo $user->lang['Inactive_users_explain']; ?></p>
<form method="post" name="inactive" action="<?php echo "index.$phpEx$SID&amp;pane=right"; ?>"><table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0"> <form method="post" name="inactive" action="<?php echo "index.$phpEx$SID&amp;pane=right"; ?>"><table class="bg" width="100%" cellpadding="4" cellspacing="1" border="0">
<tr> <tr>
<th width="45%" height="25" nowrap="nowrap"><?php echo $lang['Username']; ?></th> <th width="45%" height="25" nowrap="nowrap"><?php echo $user->lang['Username']; ?></th>
<th width="45%"><?php echo $lang['Joined']; ?></th> <th width="45%"><?php echo $user->lang['Joined']; ?></th>
<th width="5%" nowrap="nowrap"><?php echo $lang['Mark']; ?></th> <th width="5%" nowrap="nowrap"><?php echo $user->lang['Mark']; ?></th>
</tr> </tr>
<?php <?php
@ -454,7 +448,7 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
?> ?>
<tr> <tr>
<td class="row1" colspan="3" align="center"><?php echo $lang['No_inactive_users']; ?></td> <td class="row1" colspan="3" align="center"><?php echo $user->lang['No_inactive_users']; ?></td>
</tr> </tr>
<?php <?php
@ -465,7 +459,7 @@ elseif ( isset($_GET['pane']) && $_GET['pane'] == 'right' )
<table width="100%" cellspacing="1" cellpadding="4" border="0" align="center"> <table width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
<tr> <tr>
<td align="right" valign="top" nowrap="nowrap"><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $lang['Mark_all']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $lang['Unmark_all']; ?></a></span></b></td> <td align="right" valign="top" nowrap="nowrap"><b><span class="gensmall"><a href="javascript:marklist(true);" class="gensmall"><?php echo $user->lang['Mark_all']; ?></a> :: <a href="javascript:marklist(false);" class="gensmall"><?php echo $user->lang['Unmark_all']; ?></a></span></b></td>
</tr> </tr>
</table></form> </table></form>
@ -481,12 +475,12 @@ else
// //
header("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT"); header("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Content-type: text/html; charset=" . $lang['ENCODING']); header("Content-type: text/html; charset=" . $user->lang['ENCODING']);
?> ?>
<html> <html>
<head> <head>
<title><?php echo $lang['Admin_title']; ?></title> <title><?php echo $user->lang['Admin_title']; ?></title>
</head> </head>
<frameset rows="60, *" border="0" framespacing="0" frameborder="NO"> <frameset rows="60, *" border="0" framespacing="0" frameborder="NO">
@ -499,7 +493,7 @@ else
<noframes> <noframes>
<body bgcolor="white" text="#000000"> <body bgcolor="white" text="#000000">
<p><?php echo $lang['No_frames']; ?></p> <p><?php echo $user->lang['No_frames']; ?></p>
</body> </body>
</noframes> </noframes>
</html> </html>

View file

@ -27,24 +27,20 @@ if ( !defined('IN_PHPBB') )
define('IN_ADMIN', true); define('IN_ADMIN', true);
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management // Start session management
// $user->start($update);
$userdata = $session->start($update); $user->setup();
$auth->acl($userdata, false, 'a_'); $auth->acl($user->data);
$user = new user($userdata);
//
// End session management // End session management
//
// //
// If session_ids do not match, rewrite the URL correctly then redirect the user // If session_ids do not match, rewrite the URL correctly then redirect the user
// //
if ($_REQUEST['sid'] != $userdata['session_id']) if ($_REQUEST['sid'] != $user->data['session_id'])
{ {
$url = preg_replace('/sid=([^&]*)(&?)/i', '', $_SERVER['REQUEST_URI']); $url = preg_replace('/sid=([^&]*)(&?)/i', '', $_SERVER['REQUEST_URI']);
$url = preg_replace('/\?$/', '', $url); $url = preg_replace('/\?$/', '', $url);
$url .= ((strpos($url, '?')) ? '&' : '?') . 'sid=' . $userdata['session_id']; $url .= ((strpos($url, '?')) ? '&' : '?') . 'sid=' . $user->data['session_id'];
redirect($url); redirect($url);
} }
@ -52,7 +48,7 @@ if ($_REQUEST['sid'] != $userdata['session_id'])
// Functions // Functions
function page_header($sub_title, $meta = '', $table_html = true) function page_header($sub_title, $meta = '', $table_html = true)
{ {
global $board_config, $db, $lang, $phpEx; global $board_config, $db, $user, $phpEx;
define('HEADER_INC', true); define('HEADER_INC', true);
@ -65,13 +61,13 @@ function page_header($sub_title, $meta = '', $table_html = true)
} }
} }
header("Content-type: text/html; charset=" . $lang['ENCODING']); header("Content-type: text/html; charset=" . $user->lang['ENCODING']);
?> ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $lang['ENCODING']; ?>"> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $user->lang['ENCODING']; ?>">
<meta http-equiv="Content-Style-Type" content="text/css"> <meta http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" href="subSilver.css" type="text/css"> <link rel="stylesheet" href="subSilver.css" type="text/css">
<?php <?php
@ -115,7 +111,7 @@ td.cat { background-image: url('images/cellpic1.gif') }
function page_footer($copyright_html = true) function page_footer($copyright_html = true)
{ {
global $board_config, $db, $lang, $phpEx; global $board_config, $db, $phpEx;
// Close our DB connection. // Close our DB connection.
$db->sql_close(); $db->sql_close();
@ -146,7 +142,7 @@ function page_footer($copyright_html = true)
function page_message($title, $message, $show_header = false) function page_message($title, $message, $show_header = false)
{ {
global $phpEx, $SID, $lang; global $phpEx, $SID, $user;
if ( $show_header ) if ( $show_header )
{ {
@ -156,7 +152,7 @@ function page_message($title, $message, $show_header = false)
<table width="100%" cellspacing="0" cellpadding="0" border="0"> <table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr> <tr>
<td><a href="../index.<?php echo $phpEx . $SID; ?>"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td> <td><a href="../index.<?php echo $phpEx . $SID; ?>"><img src="images/header_left.jpg" width="200" height="60" alt="phpBB Logo" title="phpBB Logo" border="0"/></a></td>
<td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $lang['Admin_title']; ?></span> &nbsp; &nbsp; &nbsp;</td> <td width="100%" background="images/header_bg.jpg" height="60" align="right" nowrap="nowrap"><span class="maintitle"><?php echo $user->lang['Admin_title']; ?></span> &nbsp; &nbsp; &nbsp;</td>
</tr> </tr>
</table> </table>
@ -185,7 +181,7 @@ function page_message($title, $message, $show_header = false)
function add_admin_log() function add_admin_log()
{ {
global $db, $userdata, $user_ip; global $db, $user;
$arguments = func_get_args(); $arguments = func_get_args();
@ -193,7 +189,7 @@ function add_admin_log()
$data = ( !sizeof($arguments) ) ? '' : addslashes(serialize($arguments)); $data = ( !sizeof($arguments) ) ? '' : addslashes(serialize($arguments));
$sql = "INSERT INTO " . LOG_ADMIN_TABLE . " (user_id, log_ip, log_time, log_operation, log_data) $sql = "INSERT INTO " . LOG_ADMIN_TABLE . " (user_id, log_ip, log_time, log_operation, log_data)
VALUES (" . $userdata['user_id'] . ", '$user_ip', " . time() . ", '$action', '$data')"; VALUES (" . $user->data['user_id'] . ", '$user->ip', " . time() . ", '$action', '$data')";
$db->sql_query($sql); $db->sql_query($sql);
return; return;
@ -201,7 +197,7 @@ function add_admin_log()
function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC') function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
{ {
global $db, $lang, $phpEx, $SID; global $db, $user, $phpEx, $SID;
$table_sql = ( $mode == 'admin' ) ? LOG_ADMIN_TABLE : LOG_MOD_TABLE; $table_sql = ( $mode == 'admin' ) ? LOG_ADMIN_TABLE : LOG_MOD_TABLE;
$forum_sql = ( $mode == 'mod' && $forum_id ) ? "AND l.forum_id = $forum_id" : ''; $forum_sql = ( $mode == 'mod' && $forum_id ) ? "AND l.forum_id = $forum_id" : '';
@ -227,7 +223,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
$log[$i]['ip'] = $row['log_ip']; $log[$i]['ip'] = $row['log_ip'];
$log[$i]['time'] = $row['log_time']; $log[$i]['time'] = $row['log_time'];
$log[$i]['action'] = ( !empty($lang[$row['log_operation']]) ) ? $lang[$row['log_operation']] : ucfirst(str_replace('_', ' ', $row['log_operation'])); $log[$i]['action'] = ( !empty($user->lang[$row['log_operation']]) ) ? $user->lang[$row['log_operation']] : ucfirst(str_replace('_', ' ', $row['log_operation']));
if ( !empty($row['log_data']) ) if ( !empty($row['log_data']) )
{ {

View file

@ -28,6 +28,14 @@ error_reporting(E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitia
//error_reporting(E_ALL); //error_reporting(E_ALL);
set_magic_quotes_runtime(0); set_magic_quotes_runtime(0);
// If magic quotes is off, addslashes
if ( !get_magic_quotes_gpc() )
{
$_GET = slash_input_data($_GET);
$_POST = slash_input_data($_POST);
$_COOKIE = slash_input_data($_COOKIE);
}
require($phpbb_root_path . 'config.'.$phpEx); require($phpbb_root_path . 'config.'.$phpEx);
if ( !defined('PHPBB_INSTALLED') ) if ( !defined('PHPBB_INSTALLED') )
@ -36,12 +44,17 @@ if ( !defined('PHPBB_INSTALLED') )
exit; exit;
} }
//set_error_handler('message'); // Set PHP error handler to ours
set_error_handler('msg_handler');
// Define some constants/variables // Define some constants/variables
define('ANONYMOUS', 0); $board_config = array();
$theme = array();
$lang = array();
// User related // User related
define('ANONYMOUS', 0);
define('USER_ACTIVATION_NONE', 0); define('USER_ACTIVATION_NONE', 0);
define('USER_ACTIVATION_SELF', 1); define('USER_ACTIVATION_SELF', 1);
define('USER_ACTIVATION_ADMIN', 2); define('USER_ACTIVATION_ADMIN', 2);
@ -53,10 +66,9 @@ define('USER_AVATAR_REMOTE', 2);
define('USER_AVATAR_GALLERY', 3); define('USER_AVATAR_GALLERY', 3);
// ACL // ACL
define('ACL_PREVENT', 1); define('ACL_DENY', 0);
define('ACL_DENY', 2); define('ACL_ALLOW', 1);
define('ACL_ALLOW', 4); define('ACL_INHERIT', 2);
define('ACL_PERMIT', 8);
// Group settings // Group settings
define('GROUP_OPEN', 0); define('GROUP_OPEN', 0);
@ -123,51 +135,20 @@ define('VOTE_DESC_TABLE', $table_prefix.'vote_desc');
define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results'); define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results');
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters'); define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');
// If magic quotes is off, addslashes
if ( !get_magic_quotes_gpc() )
{
$HTTP_GET_VARS = slash_input_data($HTTP_GET_VARS);
$HTTP_POST_VARS = slash_input_data($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = slash_input_data($HTTP_COOKIE_VARS);
}
$board_config = array();
$userdata = array();
$theme = array();
$images = array();
$lang = array();
// Include files // Include files
require($phpbb_root_path . 'includes/template.'.$phpEx); require($phpbb_root_path . 'includes/template.'.$phpEx);
require($phpbb_root_path . 'includes/session.'.$phpEx); require($phpbb_root_path . 'includes/session.'.$phpEx);
require($phpbb_root_path . 'includes/functions.'.$phpEx); require($phpbb_root_path . 'includes/functions.'.$phpEx);
require($phpbb_root_path . 'db/' . $dbms . '.'.$phpEx); require($phpbb_root_path . 'db/' . $dbms . '.'.$phpEx);
require($phpbb_root_path . 'config_cache.'.$phpEx);
// Instantiate some basic classes // Instantiate some basic classes
$session = new session(); $user = new user();
$auth = new auth(); $auth = new auth();
$template = new Template(); $template = new Template();
$db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false); $db = new sql_db($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false);
// Obtain users IP // Obtain boardwide default config
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']) || !empty($_ENV['HTTP_X_FORWARDED_FOR']))
{
$user_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : $REMOTE_ADDR );
$x_ip = ( !empty($_SERVER['HTTP_X_FORWARDED_FOR']) ) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_ENV['HTTP_X_FORWARDED_FOR'];
if ( preg_match('/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/', $x_ip, $ip_list) )
{
$private_ip = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/');
$user_ip = preg_replace($private_ip, $client_ip, $ip_list[1]);
}
}
else
{
$user_ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : ( ( !empty($_ENV['REMOTE_ADDR']) ) ? $_ENV['REMOTE_ADDR'] : $REMOTE_ADDR );
}
// Setup forum wide options, if this fails we output a CRITICAL_ERROR since
// basic forum information is not available
$sql = "SELECT * $sql = "SELECT *
FROM " . CONFIG_TABLE; FROM " . CONFIG_TABLE;
$result = $db->sql_query($sql, false); $result = $db->sql_query($sql, false);

View file

@ -0,0 +1,15 @@
<?php
// phpBB 2.x auto-generated config file
// Do not change anything in this file!
$dbms = "mysql";
$dbhost = "localhost";
$dbname = "phpbb_test";
$dbuser = "devhttp";
$dbpasswd = "efx2KarizonaD";
$table_prefix = "phpbb_";
define('PHPBB_INSTALLED', true);
define('DEBUG', 1);
?>

View file

@ -117,7 +117,7 @@ class sql_db
// //
// Base query method // Base query method
// //
function sql_query($query = '', $transaction = false) function sql_query($query = '')
{ {
if ($query != '') if ($query != '')
{ {
@ -181,10 +181,10 @@ class sql_db
return false; return false;
} }
return ( $this->query_result) ? $this->query_result : ( ( $transaction == END_TRANSACTION ) ? true : false ); return ( $this->query_result) ? $this->query_result : fals;
} }
function sql_query_limit($query = '', $total, $offset = 0, $transaction = false) function sql_query_limit($query = '', $total, $offset = 0)
{ {
if ( $query != '' ) if ( $query != '' )
{ {
@ -205,7 +205,7 @@ class sql_db
} }
// Idea for this from Ikonboard // Idea for this from Ikonboard
function sql_query_array($query = '', $assoc_ary = false, $transaction = false) function sql_query_array($query = '', $assoc_ary = false)
{ {
if (!is_array($assoc_ary)) if (!is_array($assoc_ary))
{ {
@ -392,8 +392,8 @@ class sql_db
$this_page = ( !empty($_SERVER['PHP_SELF']) ) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']; $this_page = ( !empty($_SERVER['PHP_SELF']) ) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF'];
$this_page .= '&' . ( ( !empty($_SERVER['QUERY_STRING']) ) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING'] ); $this_page .= '&' . ( ( !empty($_SERVER['QUERY_STRING']) ) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING'] );
$message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @mysql_error() . '<br /><br /><u>PAGE</u><br /><br />' . $this_page . ( ( $sql != '' ) ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '' ) . '<br />'; $message = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @mysql_error() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . $this_page . ( ( $sql != '' ) ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '' ) . '<br />';
message_die(ERROR, $message); trigger_error($message, E_USER_ERROR);
} }
$result['message'] = @mysql_error(); $result['message'] = @mysql_error();

View file

@ -27,7 +27,7 @@
// Remove or comment the next line (die(".... ) to enable this script. // Remove or comment the next line (die(".... ) to enable this script.
// Do NOT FORGET to either remove this script or disable it after you have used it. // Do NOT FORGET to either remove this script or disable it after you have used it.
// //
die("Please read the first lines of this script for instructions on how to enable it"); //die("Please read the first lines of this script for instructions on how to enable it");
$vars = array('lang_main' => 'lang', 'lang_admin' => 'lang', 'lang_faq' => 'faq', 'lang_bbcode' => 'faq'); $vars = array('lang_main' => 'lang', 'lang_admin' => 'lang', 'lang_faq' => 'faq', 'lang_bbcode' => 'faq');
@ -36,7 +36,7 @@ $dir = opendir($dirname);
while ( $file = readdir($dir) ) while ( $file = readdir($dir) )
{ {
if ( ereg("^lang_", $file) && !is_file($dirname . "/" . $file) && !is_link($dirname . "/" . $file) ) if ( $file != 'CVS' && !is_file($dirname . "/" . $file) && !is_link($dirname . "/" . $file) )
{ {
foreach($vars as $lang_file => $lang_var) foreach($vars as $lang_file => $lang_var)
{ {

View file

@ -25,9 +25,9 @@ include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
// Start session management // Start session management
$userdata = $session->start(); $user->start();
$auth->acl($userdata); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management
// Load the appropriate faq file // Load the appropriate faq file

View file

@ -111,8 +111,9 @@ function generate_user_info(&$row, $date_format, $group_mod, &$from, &$posts, &$
// //
// Start session management // Start session management
// //
$userdata = $session->start(); $user->start();
$auth->acl($userdata); $user->setup();
$auth->acl($user->data);
// //
// End session management // End session management
// //
@ -125,40 +126,39 @@ $server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config
$server_url = $server_protocol . $server_name . $server_port . $script_name; $server_url = $server_protocol . $server_name . $server_port . $script_name;
if ( isset($HTTP_GET_VARS[POST_GROUPS_URL]) || isset($HTTP_POST_VARS[POST_GROUPS_URL]) ) if ( isset($_GET[POST_GROUPS_URL]) || isset($_POST[POST_GROUPS_URL]) )
{ {
$group_id = ( isset($HTTP_GET_VARS[POST_GROUPS_URL]) ) ? intval($HTTP_GET_VARS[POST_GROUPS_URL]) : intval($HTTP_POST_VARS[POST_GROUPS_URL]); $group_id = ( isset($_GET[POST_GROUPS_URL]) ) ? intval($_GET[POST_GROUPS_URL]) : intval($_POST[POST_GROUPS_URL]);
} }
else else
{ {
$group_id = ''; $group_id = '';
} }
if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) ) if ( isset($_POST['mode']) || isset($_GET['mode']) )
{ {
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; $mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode'];
} }
else else
{ {
$mode = ''; $mode = '';
} }
$confirm = ( isset($HTTP_POST_VARS['confirm']) ) ? TRUE : 0; $confirm = ( isset($_POST['confirm']) ) ? TRUE : 0;
$cancel = ( isset($HTTP_POST_VARS['cancel']) ) ? TRUE : 0; $cancel = ( isset($_POST['cancel']) ) ? TRUE : 0;
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0; $start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;
// //
// Default var values // Default var values
// //
$header_location = ( @preg_match('/Microsoft|WebSTAR/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
$is_moderator = FALSE; $is_moderator = FALSE;
if ( isset($HTTP_POST_VARS['groupstatus']) && $group_id ) if ( isset($_POST['groupstatus']) && $group_id )
{ {
if ( !$userdata['session_logged_in'] ) if ( !$user->data['session_logged_in'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect("login.$phpEx$SIDredirect=groupcp.$phpEx&g=$group_id");
} }
$sql = "SELECT group_moderator $sql = "SELECT group_moderator
@ -171,7 +171,7 @@ if ( isset($HTTP_POST_VARS['groupstatus']) && $group_id )
$row = $db->sql_fetchrow($result); $row = $db->sql_fetchrow($result);
if ( $row['group_moderator'] != $userdata['user_id'] && $userdata['user_level'] != ADMIN ) if ( $row['group_moderator'] != $user->data['user_id'] && $user->data['user_level'] != ADMIN )
{ {
$template->assign_vars(array( $template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">') 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
@ -183,7 +183,7 @@ if ( isset($HTTP_POST_VARS['groupstatus']) && $group_id )
} }
$sql = "UPDATE " . GROUPS_TABLE . " $sql = "UPDATE " . GROUPS_TABLE . "
SET group_type = " . intval($HTTP_POST_VARS['group_type']) . " SET group_type = " . intval($_POST['group_type']) . "
WHERE group_id = $group_id"; WHERE group_id = $group_id";
if ( !($result = $db->sql_query($sql)) ) if ( !($result = $db->sql_query($sql)) )
{ {
@ -199,15 +199,15 @@ if ( isset($HTTP_POST_VARS['groupstatus']) && $group_id )
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
} }
else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id ) else if ( isset($_POST['joingroup']) && $group_id )
{ {
// //
// First, joining a group // First, joining a group
// If the user isn't logged in redirect them to login // If the user isn't logged in redirect them to login
// //
if ( !$userdata['session_logged_in'] ) if ( !$user->data['session_logged_in'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect("login.$phpEx$SID&redirect=groupcp.$phpEx&g=$group_id");
} }
$sql = "SELECT ug.user_id, g.group_type $sql = "SELECT ug.user_id, g.group_type
@ -226,7 +226,7 @@ else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id )
{ {
do do
{ {
if ( $userdata['user_id'] == $row['user_id'] ) if ( $user->data['user_id'] == $row['user_id'] )
{ {
$template->assign_vars(array( $template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">') 'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
@ -255,7 +255,7 @@ else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id )
} }
$sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending) $sql = "INSERT INTO " . USER_GROUP_TABLE . " (group_id, user_id, user_pending)
VALUES ($group_id, " . $userdata['user_id'] . ", 1)"; VALUES ($group_id, " . $user->data['user_id'] . ", 1)";
if ( !($result = $db->sql_query($sql)) ) if ( !($result = $db->sql_query($sql)) )
{ {
message_die(ERROR, "Error inserting user group subscription", "", __LINE__, __FILE__, $sql); message_die(ERROR, "Error inserting user group subscription", "", __LINE__, __FILE__, $sql);
@ -300,7 +300,7 @@ else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id )
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
} }
else if ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending']) && $group_id ) else if ( isset($_POST['unsub']) || isset($_POST['unsubpending']) && $group_id )
{ {
// //
// Second, unsubscribing from a group // Second, unsubscribing from a group
@ -308,28 +308,28 @@ else if ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending
// //
if ( $cancel ) if ( $cancel )
{ {
header($header_location . append_sid("groupcp.$phpEx", true)); redirect("groupcp.$phpEx$SID");
} }
elseif ( !$userdata['session_logged_in'] ) elseif ( !$user->data['session_logged_in'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect("login.$phpEx$SID&redirect=groupcp.$phpEx&g=$group_id");
} }
if ( $confirm ) if ( $confirm )
{ {
$sql = "DELETE FROM " . USER_GROUP_TABLE . " $sql = "DELETE FROM " . USER_GROUP_TABLE . "
WHERE user_id = " . $userdata['user_id'] . " WHERE user_id = " . $user->data['user_id'] . "
AND group_id = $group_id"; AND group_id = $group_id";
if ( !($result = $db->sql_query($sql)) ) if ( !($result = $db->sql_query($sql)) )
{ {
message_die(ERROR, 'Could not delete group memebership data', '', __LINE__, __FILE__, $sql); message_die(ERROR, 'Could not delete group memebership data', '', __LINE__, __FILE__, $sql);
} }
if ( $userdata['user_level'] != ADMIN && $userdata['user_level'] == MOD ) if ( $user->data['user_level'] != ADMIN && $user->data['user_level'] == MOD )
{ {
$sql = "SELECT COUNT(auth_mod) AS is_auth_mod $sql = "SELECT COUNT(auth_mod) AS is_auth_mod
FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug
WHERE ug.user_id = " . $userdata['user_id'] . " WHERE ug.user_id = " . $user->data['user_id'] . "
AND aa.group_id = ug.group_id AND aa.group_id = ug.group_id
AND aa.auth_mod = 1"; AND aa.auth_mod = 1";
if ( !($result = $db->sql_query($sql)) ) if ( !($result = $db->sql_query($sql)) )
@ -341,7 +341,7 @@ else if ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending
{ {
$sql = "UPDATE " . USERS_TABLE . " $sql = "UPDATE " . USERS_TABLE . "
SET user_level = " . USER . " SET user_level = " . USER . "
WHERE user_id = " . $userdata['user_id']; WHERE user_id = " . $user->data['user_id'];
if ( !($result = $db->sql_query($sql)) ) if ( !($result = $db->sql_query($sql)) )
{ {
message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql); message_die(ERROR, 'Could not update user level', '', __LINE__, __FILE__, $sql);
@ -359,7 +359,7 @@ else if ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending
} }
else else
{ {
$unsub_msg = ( isset($HTTP_POST_VARS['unsub']) ) ? $lang['Confirm_unsub'] : $lang['Confirm_unsub_pending']; $unsub_msg = ( isset($_POST['unsub']) ) ? $lang['Confirm_unsub'] : $lang['Confirm_unsub_pending'];
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" /><input type="hidden" name="unsub" value="1" />'; $s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" /><input type="hidden" name="unsub" value="1" />';
@ -391,11 +391,11 @@ else if ( $group_id )
// Did the group moderator get here through an email? // Did the group moderator get here through an email?
// If so, check to see if they are logged in. // If so, check to see if they are logged in.
// //
if ( isset($HTTP_GET_VARS['validate']) ) if ( isset($_GET['validate']) )
{ {
if ( !$userdata['session_logged_in'] ) if ( !$user->data['user_id'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect("login.$phpEx$SID&redirect=groupcp.$phpEx&g=$group_id");
} }
} }
@ -444,7 +444,7 @@ else if ( $group_id )
{ {
$group_moderator = $group_info['group_moderator']; $group_moderator = $group_info['group_moderator'];
if ( $group_moderator == $userdata['user_id'] || $userdata['user_level'] == ADMIN ) if ( $group_moderator == $user->data['user_id'] || $user->data['user_level'] == ADMIN )
{ {
$is_moderator = TRUE; $is_moderator = TRUE;
} }
@ -452,11 +452,11 @@ else if ( $group_id )
// //
// Handle Additions, removals, approvals and denials // Handle Additions, removals, approvals and denials
// //
if ( !empty($HTTP_POST_VARS['add']) || !empty($HTTP_POST_VARS['remove']) || isset($HTTP_POST_VARS['approve']) || isset($HTTP_POST_VARS['deny']) ) if ( !empty($_POST['add']) || !empty($_POST['remove']) || isset($_POST['approve']) || isset($_POST['deny']) )
{ {
if ( !$userdata['session_logged_in'] ) if ( !$user->data['session_logged_in'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect("login.$phpEx$SIDredirect=groupcp.$phpEx&g=$group_id");
} }
if ( !$is_moderator ) if ( !$is_moderator )
@ -470,9 +470,9 @@ else if ( $group_id )
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
} }
if ( isset($HTTP_POST_VARS['add']) ) if ( isset($_POST['add']) )
{ {
$username = ( isset($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : ""; $username = ( isset($_POST['username']) ) ? $_POST['username'] : "";
$sql = "SELECT user_id, user_email, user_lang, user_level $sql = "SELECT user_id, user_email, user_lang, user_level
FROM " . USERS_TABLE . " FROM " . USERS_TABLE . "
@ -583,10 +583,10 @@ else if ( $group_id )
} }
else else
{ {
if ( ( ( isset($HTTP_POST_VARS['approve']) || isset($HTTP_POST_VARS['deny']) ) && isset($HTTP_POST_VARS['pending_members']) ) || ( isset($HTTP_POST_VARS['remove']) && isset($HTTP_POST_VARS['members']) ) ) if ( ( ( isset($_POST['approve']) || isset($_POST['deny']) ) && isset($_POST['pending_members']) ) || ( isset($_POST['remove']) && isset($_POST['members']) ) )
{ {
$members = ( isset($HTTP_POST_VARS['approve']) || isset($HTTP_POST_VARS['deny']) ) ? $HTTP_POST_VARS['pending_members'] : $HTTP_POST_VARS['members']; $members = ( isset($_POST['approve']) || isset($_POST['deny']) ) ? $_POST['pending_members'] : $_POST['members'];
$sql_in = ''; $sql_in = '';
for($i = 0; $i < count($members); $i++) for($i = 0; $i < count($members); $i++)
@ -594,7 +594,7 @@ else if ( $group_id )
$sql_in .= ( ( $sql_in != '' ) ? ', ' : '' ) . $members[$i]; $sql_in .= ( ( $sql_in != '' ) ? ', ' : '' ) . $members[$i];
} }
if ( isset($HTTP_POST_VARS['approve']) ) if ( isset($_POST['approve']) )
{ {
if ( $group_info['auth_mod'] ) if ( $group_info['auth_mod'] )
{ {
@ -616,7 +616,7 @@ else if ( $group_id )
FROM ". USERS_TABLE . " FROM ". USERS_TABLE . "
WHERE user_id IN ($sql_in)"; WHERE user_id IN ($sql_in)";
} }
else if ( isset($HTTP_POST_VARS['deny']) || isset($HTTP_POST_VARS['remove']) ) else if ( isset($_POST['deny']) || isset($_POST['remove']) )
{ {
if ( $group_info['auth_mod'] ) if ( $group_info['auth_mod'] )
{ {
@ -678,7 +678,7 @@ else if ( $group_id )
// //
// Email users when they are approved // Email users when they are approved
// //
if ( isset($HTTP_POST_VARS['approve']) ) if ( isset($_POST['approve']) )
{ {
if ( !($result = $db->sql_query($sql_select)) ) if ( !($result = $db->sql_query($sql_select)) )
{ {
@ -711,7 +711,7 @@ else if ( $group_id )
$email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\nBcc: " . $email_addresses . "\r\n"; $email_headers = 'From: ' . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\nBcc: " . $email_addresses . "\r\n";
$emailer->use_template('group_approved'); $emailer->use_template('group_approved');
$emailer->email_address($userdata['user_email']); $emailer->email_address($user->data['user_email']);
$emailer->set_subject();//$lang['Group_approved'] $emailer->set_subject();//$lang['Group_approved']
$emailer->extra_headers($email_headers); $emailer->extra_headers($email_headers);
@ -807,7 +807,7 @@ else if ( $group_id )
{ {
for($i = 0; $i < $members_count; $i++) for($i = 0; $i < $members_count; $i++)
{ {
if ( $group_members[$i]['user_id'] == $userdata['user_id'] && $userdata['session_logged_in'] ) if ( $group_members[$i]['user_id'] == $user->data['user_id'] && $user->data['session_logged_in'] )
{ {
$is_group_member = TRUE; $is_group_member = TRUE;
} }
@ -819,19 +819,19 @@ else if ( $group_id )
{ {
for($i = 0; $i < $modgroup_pending_count; $i++) for($i = 0; $i < $modgroup_pending_count; $i++)
{ {
if ( $modgroup_pending_list[$i]['user_id'] == $userdata['user_id'] && $userdata['session_logged_in'] ) if ( $modgroup_pending_list[$i]['user_id'] == $user->data['user_id'] && $user->data['session_logged_in'] )
{ {
$is_group_pending_member = TRUE; $is_group_pending_member = TRUE;
} }
} }
} }
if ( $userdata['user_level'] == ADMIN ) if ( $user->data['user_level'] == ADMIN )
{ {
$is_moderator = TRUE; $is_moderator = TRUE;
} }
if ( $userdata['user_id'] == $group_info['group_moderator'] ) if ( $user->data['user_id'] == $group_info['group_moderator'] )
{ {
$is_moderator = TRUE; $is_moderator = TRUE;
@ -847,7 +847,7 @@ else if ( $group_id )
$s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />'; $s_hidden_fields = '<input type="hidden" name="' . POST_GROUPS_URL . '" value="' . $group_id . '" />';
} }
else if ( $userdata['user_id'] == ANONYMOUS ) else if ( $user->data['user_id'] == ANONYMOUS )
{ {
$group_details = $lang['Login_to_join']; $group_details = $lang['Login_to_join'];
$s_hidden_fields = ''; $s_hidden_fields = '';
@ -1143,11 +1143,11 @@ else
// Select all group that the user is a member of or where the user has // Select all group that the user is a member of or where the user has
// a pending membership. // a pending membership.
// //
if ( $userdata['session_logged_in'] ) if ( $user->data['session_logged_in'] )
{ {
$sql = "SELECT g.group_id, g.group_name, g.group_type, ug.user_pending $sql = "SELECT g.group_id, g.group_name, g.group_type, ug.user_pending
FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
WHERE ug.user_id = " . $userdata['user_id'] . " WHERE ug.user_id = " . $user->data['user_id'] . "
AND ug.group_id = g.group_id AND ug.group_id = g.group_id
AND g.group_single_user <> " . TRUE . " AND g.group_single_user <> " . TRUE . "
ORDER BY g.group_name, ug.user_id"; ORDER BY g.group_name, ug.user_id";
@ -1198,7 +1198,7 @@ else
$s_group_list_opt = ''; $s_group_list_opt = '';
while( $row = $db->sql_fetchrow($result) ) while( $row = $db->sql_fetchrow($result) )
{ {
if ( $row['group_type'] != GROUP_HIDDEN || $userdata['user_level'] == ADMIN ) if ( $row['group_type'] != GROUP_HIDDEN || $user->data['user_level'] == ADMIN )
{ {
$s_group_list_opt .='<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>'; $s_group_list_opt .='<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
} }
@ -1237,7 +1237,7 @@ else
$template->assign_block_vars('switch_groups_remaining', array() ); $template->assign_block_vars('switch_groups_remaining', array() );
} }
$s_hidden_fields = '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; $s_hidden_fields = '<input type="hidden" name="sid" value="' . $user->data['session_id'] . '" />';
$template->assign_vars(array( $template->assign_vars(array(
'L_GROUP_MEMBERSHIP_DETAILS' => $lang['Group_member_details'], 'L_GROUP_MEMBERSHIP_DETAILS' => $lang['Group_member_details'],

View file

@ -47,19 +47,19 @@ function login_ldap(&$username, &$password)
// //
function admin_ldap(&$new) function admin_ldap(&$new)
{ {
global $lang; global $user;
?> ?>
<tr> <tr>
<td class="row1"><?php echo $lang['LDAP_server']; ?>:<br /><span class="gensmall"><?php echo $lang['LDAP_server_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['LDAP_server']; ?>:<br /><span class="gensmall"><?php echo $user->lang['LDAP_server_explain']; ?></span></td>
<td class="row2"><input type="text" size="40" name="ldap_server" value="<?php echo $new['ldap_server']; ?>" /></td> <td class="row2"><input type="text" size="40" name="ldap_server" value="<?php echo $new['ldap_server']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['LDAP_dn']; ?>:<br /><span class="gensmall"><?php echo $lang['LDAP_dn_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['LDAP_dn']; ?>:<br /><span class="gensmall"><?php echo $user->lang['LDAP_dn_explain']; ?></span></td>
<td class="row2"><input type="text" size="40" name="ldap_base_dn" value="<?php echo $new['ldap_base_dn']; ?>" /></td> <td class="row2"><input type="text" size="40" name="ldap_base_dn" value="<?php echo $new['ldap_base_dn']; ?>" /></td>
</tr> </tr>
<tr> <tr>
<td class="row1"><?php echo $lang['LDAP_uid']; ?>:<br /><span class="gensmall"><?php echo $lang['LDAP_uid_explain']; ?></span></td> <td class="row1"><?php echo $user->lang['LDAP_uid']; ?>:<br /><span class="gensmall"><?php echo $user->lang['LDAP_uid_explain']; ?></span></td>
<td class="row2"><input type="text" size="40" name="ldap_uid" value="<?php echo $new['ldap_uid']; ?>" /></td> <td class="row2"><input type="text" size="40" name="ldap_uid" value="<?php echo $new['ldap_uid']; ?>" /></td>
</tr> </tr>
<?php <?php

View file

@ -53,57 +53,42 @@ foreach ($forum_rows as $row)
switch ($forum_status) switch ($forum_status)
{ {
case ITEM_CATEGORY: case ITEM_CATEGORY:
$folder_image = $theme['sub_forum']; $folder_image = 'sub_forum';
$folder_alt = $lang['Category']; $folder_alt = 'Category';
break; break;
case ITEM_LOCKED: case ITEM_LOCKED:
$folder_image = $theme['forum_locked']; $folder_image = 'forum_locked';
$folder_alt = $lang['Forum_locked']; $folder_alt = 'Forum_locked';
break; break;
default: default:
$unread_topics = false; $unread_topics = false;
if ($userdata['user_id'] && $forum_last_post_time > $userdata['user_lastvisit']) if ($user->data['user_id'] && $forum_last_post_time > $user->data['user_lastvisit'])
{ {
$unread_topics = true; $unread_topics = true;
if (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']))
{
if ($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $forum_last_post_time)
{
$unread_topics = false;
}
} }
if (isset($mark_topics[$forum_id]) || isset($mark_forums[$forum_id])) $folder_image = ($unread_topics) ? 'forum_new' : 'forum';
{ $folder_alt = ($unread_topics) ? 'New_posts' : 'No_new_posts';
if ($mark_forums[$forum_id] > $userdata['user_lastvisit'] || !max($mark_topics[$forum_id]))
{
$unread_topics = false;
}
}
}
$folder_image = ($unread_topics) ? $theme['forum_new'] : $theme['forum'];
$folder_alt = ($unread_topics) ? $lang['New_posts'] : $lang['No_new_posts'];
} }
if ($forum_last_post_id) if ($forum_last_post_id)
{ {
$last_post = create_date($board_config['default_dateformat'], $forum_last_post_time, $board_config['board_timezone']) . '<br />'; $last_post = $user->format_date($forum_last_post_time) . '<br />';
$last_post .= ($forum_last_poster_id == ANONYMOUS) ? (($forum_last_poster_name != '') ? $forum_last_poster_name . ' ' : $lang['Guest'] . ' ') : '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $forum_last_poster_id . '">' . $username . '</a> '; $last_post .= ($forum_last_poster_id == ANONYMOUS) ? (($forum_last_poster_name != '') ? $forum_last_poster_name . ' ' : $user->lang['Guest'] . ' ') : '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $forum_last_poster_id . '">' . $username . '</a> ';
$last_post .= '<a href="viewtopic.' . $phpEx . '$SID&amp;f=' . $forum_id . '&amp;p=' . $forum_last_post_id . '#' . $forum_last_post_id . '">' . create_img($theme['goto_post_latest'], $lang['View_latest_post']) . '</a>'; $last_post .= '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;p=' . $forum_last_post_id . '#' . $forum_last_post_id . '">' . $user->img('goto_post_latest', 'View_latest_post') . '</a>';
} }
else else
{ {
$last_post = $lang['No_Posts']; $last_post = $user->lang['No_Posts'];
} }
if (!empty($forum_moderators[$forum_id])) if (!empty($forum_moderators[$forum_id]))
{ {
$l_moderator = (count($forum_moderators[$forum_id]) == 1) ? $lang['Moderator'] . ': ' : $lang['Moderators'] . ': ' ; $l_moderator = (count($forum_moderators[$forum_id]) == 1) ? $user->lang['Moderator'] . ': ' : $user->lang['Moderators'] . ': ' ;
$moderators_list = implode(', ', $forum_moderators[$forum_id]); $moderators_list = implode(', ', $forum_moderators[$forum_id]);
} }
else else
@ -127,7 +112,7 @@ foreach ($forum_rows as $row)
} }
$subforums_list = implode(', ', $links); $subforums_list = implode(', ', $links);
$l_subforums = (count($subforums[$forum_id]) == 1) ? $lang['Subforum'] . ': ' : $lang['Subforums'] . ': '; $l_subforums = (count($subforums[$forum_id]) == 1) ? $user->lang['Subforum'] . ': ' : $user->lang['Subforums'] . ': ';
} }
else else
{ {
@ -157,7 +142,7 @@ foreach ($forum_rows as $row)
$template->assign_block_vars('forumrow', array( $template->assign_block_vars('forumrow', array(
$forum_type_switch => TRUE, $forum_type_switch => TRUE,
'FORUM_FOLDER_IMG' => create_img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt),
'FORUM_NAME' => $forum_name, 'FORUM_NAME' => $forum_name,
'FORUM_DESC' => $forum_desc, 'FORUM_DESC' => $forum_desc,

View file

@ -103,14 +103,16 @@ function get_forum_branch($forum_id, $type='all', $order='descending', $include_
default: default:
$condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id OR f1.left_id BETWEEN f2.left_id AND f2.right_id'; $condition = 'f2.left_id BETWEEN f1.left_id AND f1.right_id OR f1.left_id BETWEEN f2.left_id AND f2.right_id';
} }
$sql = 'SELECT f2.*
FROM ' . FORUMS_TABLE . ' f1
LEFT JOIN ' . FORUMS_TABLE . " f2 ON $condition
WHERE f1.forum_id = $forum_id
ORDER BY f2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC');
$rows = array(); $rows = array();
$sql = 'SELECT f2.*
FROM ( ' . FORUMS_TABLE . ' f1
LEFT JOIN ' . FORUMS_TABLE . " f2 ON $condition )
WHERE f1.forum_id = $forum_id
ORDER BY f2.left_id " . ( ($order == 'descending') ? 'ASC' : 'DESC' );
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
if (!$include_forum && $row['forum_id'] == $forum_id) if (!$include_forum && $row['forum_id'] == $forum_id)
@ -122,10 +124,8 @@ function get_forum_branch($forum_id, $type='all', $order='descending', $include_
return $rows; return $rows;
} }
//
// Obtain list of moderators of each forum // Obtain list of moderators of each forum
// First users, then groups ... broken into two queries // First users, then groups ... broken into two queries
//
function get_moderators(&$forum_moderators, $forum_id = false) function get_moderators(&$forum_moderators, $forum_id = false)
{ {
global $SID, $db, $phpEx; global $SID, $db, $phpEx;
@ -166,17 +166,17 @@ function get_moderators(&$forum_moderators, $forum_id = false)
// //
function get_forum_rules($mode, &$rules, &$forum_id) function get_forum_rules($mode, &$rules, &$forum_id)
{ {
global $SID, $auth, $lang, $phpEx; global $SID, $auth, $user, $phpEx;
$rules .= ( ( $auth->acl_get('f_post', $forum_id) ) ? $lang['Rules_post_can'] : $lang['Rules_post_cannot'] ) . '<br />'; $rules .= ( ( $auth->acl_get('f_post', $forum_id) ) ? $user->lang['Rules_post_can'] : $user->lang['Rules_post_cannot'] ) . '<br />';
$rules .= ( ( $auth->acl_get('f_reply', $forum_id) ) ? $lang['Rules_reply_can'] : $lang['Rules_reply_cannot'] ) . '<br />'; $rules .= ( ( $auth->acl_get('f_reply', $forum_id) ) ? $user->lang['Rules_reply_can'] : $user->lang['Rules_reply_cannot'] ) . '<br />';
$rules .= ( ( $auth->acl_get('f_edit', $forum_id) ) ? $lang['Rules_edit_can'] : $lang['Rules_edit_cannot'] ) . '<br />'; $rules .= ( ( $auth->acl_get('f_edit', $forum_id) ) ? $user->lang['Rules_edit_can'] : $user->lang['Rules_edit_cannot'] ) . '<br />';
$rules .= ( ( $auth->acl_get('f_delete', $forum_id) || $auth->acl_get('m_delete', $forum_id) ) ? $lang['Rules_delete_can'] : $lang['Rules_delete_cannot'] ) . '<br />'; $rules .= ( ( $auth->acl_get('f_delete', $forum_id) || $auth->acl_get('m_delete', $forum_id) ) ? $user->lang['Rules_delete_can'] : $user->lang['Rules_delete_cannot'] ) . '<br />';
$rules .= ( ( $auth->acl_get('f_attach', $forum_id) ) ? $lang['Rules_attach_can'] : $lang['Rules_attach_cannot'] ) . '<br />'; $rules .= ( ( $auth->acl_get('f_attach', $forum_id) ) ? $user->lang['Rules_attach_can'] : $user->lang['Rules_attach_cannot'] ) . '<br />';
if ( $auth->acl_get('a_') || $auth->acl_get('m_', $forum_id) ) if ( $auth->acl_get('a_') || $auth->acl_get('m_', $forum_id) )
{ {
$rules .= sprintf($lang['Rules_moderate'], '<a href="modcp.' . $phpEx . $SID . '&amp;f=' . $forum_id . '">', '</a>'); $rules .= sprintf($user->lang['Rules_moderate'], '<a href="modcp.' . $phpEx . $SID . '&amp;f=' . $forum_id . '">', '</a>');
} }
return; return;
@ -184,9 +184,9 @@ function get_forum_rules($mode, &$rules, &$forum_id)
function make_jumpbox($action, $forum_id = false) function make_jumpbox($action, $forum_id = false)
{ {
global $auth, $template, $lang, $db, $nav_links, $phpEx; global $auth, $template, $user, $db, $nav_links, $phpEx;
$boxstring = '<select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $lang['Select_forum'] . '</option><option value="-1">&nbsp;</option>'; $boxstring = '<select name="f" onChange="if(this.options[this.selectedIndex].value != -1){ forms[\'jumpbox\'].submit() }"><option value="-1">' . $user->lang['Select_forum'] . '</option><option value="-1">&nbsp;</option>';
$sql = 'SELECT forum_id, forum_name, forum_status, left_id, right_id $sql = 'SELECT forum_id, forum_name, forum_status, left_id, right_id
FROM ' . FORUMS_TABLE . ' FROM ' . FORUMS_TABLE . '
@ -249,9 +249,7 @@ function make_jumpbox($action, $forum_id = false)
$holding = ''; $holding = '';
} }
//
// TODO: do not add empty categories to nav links // TODO: do not add empty categories to nav links
//
$nav_links['chapter forum'][$row['forum_id']] = array ( $nav_links['chapter forum'][$row['forum_id']] = array (
'url' => ($row['forum_status'] == ITEM_CATEGORY) ? "index.$phpEx$SIDc=" : "viewforum.$phpEx$SID&f=" . $row['forum_id'], 'url' => ($row['forum_status'] == ITEM_CATEGORY) ? "index.$phpEx$SIDc=" : "viewforum.$phpEx$SID&f=" . $row['forum_id'],
'title' => $row['forum_name'] 'title' => $row['forum_name']
@ -263,13 +261,13 @@ function make_jumpbox($action, $forum_id = false)
if (!$right) if (!$right)
{ {
$boxstring .= '<option value="-1">' . $lang['No_forums'] . '</option>'; $boxstring .= '<option value="-1">' . $user->lang['No_forums'] . '</option>';
} }
$boxstring .= '</select>'; $boxstring .= '</select>';
$template->assign_vars(array( $template->assign_vars(array(
'L_GO' => $lang['Go'], 'L_GO' => $user->lang['Go'],
'L_JUMP_TO' => $lang['Jump_to'], 'L_JUMP_TO' => $user->lang['Jump_to'],
'S_JUMPBOX_SELECT' => $boxstring, 'S_JUMPBOX_SELECT' => $boxstring,
'S_JUMPBOX_ACTION' => $action) 'S_JUMPBOX_ACTION' => $action)
@ -278,16 +276,14 @@ function make_jumpbox($action, $forum_id = false)
return; return;
} }
//
// Pick a language, any language ... // Pick a language, any language ...
//
function language_select($default, $select_name = "language", $dirname="language") function language_select($default, $select_name = "language", $dirname="language")
{ {
global $phpEx; global $phpEx;
$dir = opendir($dirname); $dir = opendir($dirname);
$lang = array(); $user = array();
while ( $file = readdir($dir) ) while ( $file = readdir($dir) )
{ {
if ( preg_match('#^lang_#', $file) && !is_file($dirname . '/' . $file) && !is_link($dirname . '/' . $file) ) if ( preg_match('#^lang_#', $file) && !is_file($dirname . '/' . $file) && !is_link($dirname . '/' . $file) )
@ -295,30 +291,28 @@ function language_select($default, $select_name = "language", $dirname="language
$filename = trim(str_replace('lang_', '', $file)); $filename = trim(str_replace('lang_', '', $file));
$displayname = preg_replace('/^(.*?)_(.*)$/', '\\1 [ \\2 ]', $filename); $displayname = preg_replace('/^(.*?)_(.*)$/', '\\1 [ \\2 ]', $filename);
$displayname = preg_replace('/\[(.*?)_(.*)\]/', '[ \\1 - \\2 ]', $displayname); $displayname = preg_replace('/\[(.*?)_(.*)\]/', '[ \\1 - \\2 ]', $displayname);
$lang[$displayname] = $filename; $user->lang[$displayname] = $filename;
} }
} }
closedir($dir); closedir($dir);
@asort($lang); @asort($user);
@reset($lang); @reset($user);
$lang_select = '<select name="' . $select_name . '">'; $user_select = '<select name="' . $select_name . '">';
foreach ( $lang as $displayname => $filename ) foreach ( $user as $displayname => $filename )
{ {
$selected = ( strtolower($default) == strtolower($filename) ) ? ' selected="selected"' : ''; $selected = ( strtolower($default) == strtolower($filename) ) ? ' selected="selected"' : '';
$lang_select .= '<option value="' . $filename . '"' . $selected . '>' . ucwords($displayname) . '</option>'; $user_select .= '<option value="' . $filename . '"' . $selected . '>' . ucwords($displayname) . '</option>';
} }
$lang_select .= '</select>'; $user_select .= '</select>';
return $lang_select; return $user_select;
} }
//
// Pick a template/theme combo, // Pick a template/theme combo,
// function style_select($default_style, $select_name = 'style', $dirname = 'templates')
function style_select($default_style, $select_name = "style", $dirname = "templates")
{ {
global $db; global $db;
@ -339,15 +333,13 @@ function style_select($default_style, $select_name = "style", $dirname = "templa
return $style_select; return $style_select;
} }
//
// Pick a timezone // Pick a timezone
//
function tz_select($default, $select_name = 'timezone') function tz_select($default, $select_name = 'timezone')
{ {
global $sys_timezone, $lang; global $sys_timezone, $user;
$tz_select = '<select name="' . $select_name . '">'; $tz_select = '<select name="' . $select_name . '">';
while( list($offset, $zone) = @each($lang['tz']) ) foreach ( $user->lang['tz'] as $offset => $zone )
{ {
$selected = ( $offset == $default ) ? ' selected="selected"' : ''; $selected = ( $offset == $default ) ? ' selected="selected"' : '';
$tz_select .= '<option value="' . $offset . '"' . $selected . '>' . $zone . '</option>'; $tz_select .= '<option value="' . $offset . '"' . $selected . '>' . $zone . '</option>';
@ -357,20 +349,16 @@ function tz_select($default, $select_name = 'timezone')
return $tz_select; return $tz_select;
} }
//
// Topic and forum watching common code // Topic and forum watching common code
//
function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $match_id) function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $match_id)
{ {
global $template, $db, $lang, $phpEx, $SID, $start; global $template, $db, $user, $phpEx, $SID, $start;
$table_sql = ( $mode == 'forum' ) ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE; $table_sql = ( $mode == 'forum' ) ? FORUMS_WATCH_TABLE : TOPICS_WATCH_TABLE;
$where_sql = ( $mode == 'forum' ) ? 'forum_id' : 'topic_id'; $where_sql = ( $mode == 'forum' ) ? 'forum_id' : 'topic_id';
$u_url = ( $mode == 'forum' ) ? 'f' : 't'; $u_url = ( $mode == 'forum' ) ? 'f' : 't';
//
// Is user watching this thread? // Is user watching this thread?
//
if ( $user_id ) if ( $user_id )
{ {
$can_watch = TRUE; $can_watch = TRUE;
@ -399,7 +387,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
'META' => '<meta http-equiv="refresh" content="3;url=' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">') 'META' => '<meta http-equiv="refresh" content="3;url=' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">')
); );
$message = $lang['No_longer_watching_' . $mode] . '<br /><br />' . sprintf($lang['Click_return_' . $mode], '<a href="' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">', '</a>'); $message = $user->lang['No_longer_watching_' . $mode] . '<br /><br />' . sprintf($user->lang['Click_return_' . $mode], '<a href="' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">', '</a>');
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
} }
else else
@ -433,7 +421,7 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
'META' => '<meta http-equiv="refresh" content="3;url=' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">') 'META' => '<meta http-equiv="refresh" content="3;url=' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">')
); );
$message = $lang['You_are_watching_' . $mode] . '<br /><br />' . sprintf($lang['Click_return_' . $mode], '<a href="' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">', '</a>'); $message = $user->lang['You_are_watching_' . $mode] . '<br /><br />' . sprintf($user->lang['Click_return_' . $mode], '<a href="' . "view$mode.$phpEx$SID&amp;" . $u_url . "=$match_id&amp;start=$start" . '">', '</a>');
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
} }
else else
@ -460,58 +448,16 @@ function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $mat
if ( $can_watch ) if ( $can_watch )
{ {
if ( $is_watching ) $s_watching = ( $is_watching ) ? '<a href="' . "view$mode." . $phpEx . $SID . '&amp;' . $u_url . "=$match_id&amp;unwatch=$mode&amp;start=$start" . '">' . $user->lang['Stop_watching_' . $mode] . '</a>' : '<a href="' . "view$mode." . $phpEx . $SID . '&amp;' . $u_url . "=$match_id&amp;watch=$mode&amp;start=$start" . '">' . $user->lang['Start_watching_' . $mode] . '</a>';
{
$watch_url = "view$mode." . $phpEx . $SID . '&amp;' . $u_url . "=$match_id&amp;unwatch=$mode&amp;start=$start";
$img = ( $mode == 'forum' ) ? $images['Forum_un_watch'] : $images['Topic_un_watch'];
$s_watching = '<a href="' . $watch_url . '">' . $lang['Stop_watching_' . $mode] . '</a>';
$s_watching_img = ( isset($img) ) ? '<a href="' . $watch_url . '"><img src="' . $img . '" alt="' . $lang['Stop_watching_' . $mode] . '" title="' . $lang['Stop_watching_' . $mode] . '" border="0"></a>' : '';
}
else
{
$watch_url = "view$mode." . $phpEx . $SID . '&amp;' . $u_url . "=$match_id&amp;watch=$mode&amp;start=$start";
$img = ( $mode == 'forum' ) ? $images['Forum_watch'] : $images['Topic_watch'];
$s_watching = '<a href="' . $watch_url . '">' . $lang['Start_watching_' . $mode] . '</a>';
$s_watching_img = ( isset($img) ) ? '<a href="' . $watch_url . '"><img src="' . $img . '" alt="' . $lang['Stop_watching_' . $mode] . '" title="' . $lang['Start_watching_' . $mode] . '" border="0"></a>' : '';
}
} }
return; return;
} }
// // Pagination routine, generates page number sequence
// Create date/time from format and timezone
//
function create_date($format, $gmepoch, $tz)
{
global $board_config, $lang;
static $translate;
if ( empty($translate) && $board_config['default_lang'] != 'english' )
{
foreach ( $lang['datetime'] as $match => $replace )
{
$translate[$match] = $replace;
}
}
return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz));
}
function create_img($img, $alt = '')
{
return '<img src=' . $img . ' alt="' . $alt . '" title="' . $alt . '" />';
}
//
// Pagination routine, generates
// page number sequence
//
function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE) function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE)
{ {
global $lang; global $user;
$total_pages = ceil($num_items/$per_page); $total_pages = ceil($num_items/$per_page);
@ -522,7 +468,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
$on_page = floor($start_item / $per_page) + 1; $on_page = floor($start_item / $per_page) + 1;
$page_string = ( $on_page == 1 ) ? '<b>1</b>' : '<a href="' . $base_url . "&amp;start=" . ( ( $on_page - 2 ) * $per_page ) . '">' . $lang['Previous'] . '</a>&nbsp;&nbsp;<a href="' . $base_url . '">1</a>'; $page_string = ( $on_page == 1 ) ? '<b>1</b>' : '<a href="' . $base_url . "&amp;start=" . ( ( $on_page - 2 ) * $per_page ) . '">' . $user->lang['Previous'] . '</a>&nbsp;&nbsp;<a href="' . $base_url . '">1</a>';
if ( $total_pages > 5 ) if ( $total_pages > 5 )
{ {
@ -556,18 +502,18 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
} }
} }
$page_string .= ( $on_page == $total_pages ) ? '<b>' . $total_pages . '</b>' : '<a href="' . $base_url . '&amp;start=' . ( ( $total_pages - 1 ) * $per_page ) . '">' . $total_pages . '</a>&nbsp;&nbsp;<a href="' . $base_url . "&amp;start=" . ( $on_page * $per_page ) . '">' . $lang['Next'] . '</a>'; $page_string .= ( $on_page == $total_pages ) ? '<b>' . $total_pages . '</b>' : '<a href="' . $base_url . '&amp;start=' . ( ( $total_pages - 1 ) * $per_page ) . '">' . $total_pages . '</a>&nbsp;&nbsp;<a href="' . $base_url . "&amp;start=" . ( $on_page * $per_page ) . '">' . $user->lang['Next'] . '</a>';
$page_string = $lang['Goto_page'] . ' ' . $page_string; $page_string = $user->lang['Goto_page'] . ' ' . $page_string;
return $page_string; return $page_string;
} }
function on_page($num_items, $per_page, $start) function on_page($num_items, $per_page, $start)
{ {
global $lang; global $user;
return sprintf($lang['Page_of'], floor( $start / $per_page ) + 1, max(ceil( $num_items / $per_page ), 1) ); return sprintf($user->lang['Page_of'], floor( $start / $per_page ) + 1, max(ceil( $num_items / $per_page ), 1) );
} }
// Obtain list of naughty words and build preg style replacement arrays for use by the // Obtain list of naughty words and build preg style replacement arrays for use by the
@ -581,25 +527,20 @@ function obtain_word_list(&$orig_word, &$replacement_word)
FROM " . WORDS_TABLE; FROM " . WORDS_TABLE;
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{
do
{ {
$orig_word[] = '#\b(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')\b#i'; $orig_word[] = '#\b(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')\b#i';
$replacement_word[] = $row['replacement']; $replacement_word[] = $row['replacement'];
} }
while ( $row = $db->sql_fetchrow($result) );
}
return true; return true;
} }
//
// Redirects the user to another page then exits the script nicely // Redirects the user to another page then exits the script nicely
//
function redirect($location) function redirect($location)
{ {
global $db; global $db;
if (isset($db)) if (isset($db))
{ {
$db->sql_close(); $db->sql_close();
@ -610,39 +551,26 @@ function redirect($location)
exit; exit;
} }
//
// This is general replacement for die(), allows templated output in users (or default) // This is general replacement for die(), allows templated output in users (or default)
// language, etc. $msg_code can be one of these constants: // language, etc. $msg_code can be one of these constants:
// //
// -> MESSAGE : Use for any simple text message, eg. results of an operation, authorisation // -> MESSAGE : Use for any simple text message, eg. results of an operation, authorisation
// failures, etc. // failures, etc.
// -> ERROR : Use for any error, a simple page will be output // -> ERROR : Use for any error, a simple page will be output
//
// $errno, $errstr, $errfile, $errline
function message_die($msg_code, $msg_text = '', $msg_title = '') function message_die($msg_code, $msg_text = '', $msg_title = '')
{ {
global $db, $session, $auth, $template, $board_config, $theme, $lang, $user; global $db, $auth, $template, $board_config, $user, $nav_links;
global $userdata, $user_ip, $phpEx, $phpbb_root_path, $nav_links, $starttime; global $phpEx, $phpbb_root_path, $starttime;
switch ( $msg_code ) switch ( $msg_code )
{ {
case MESSAGE: case MESSAGE:
if ( empty($lang) && !empty($board_config['default_lang']) ) $msg_title = ( $msg_title == '' ) ? $user->lang['Information'] : $msg_title;
{ $msg_text = ( !empty($user->lang[$msg_text]) ) ? $user->lang[$msg_text] : $msg_text;
if ( !file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) )
{
$board_config['default_lang'] = 'english';
}
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);
}
$msg_title = ( $msg_title == '' ) ? $lang['Information'] : $msg_title;
$msg_text = ( !empty($lang[$msg_text]) ) ? $lang[$msg_text] : $msg_text;
if ( !defined('HEADER_INC') ) if ( !defined('HEADER_INC') )
{ {
if ( empty($userdata) ) if ( empty($user->lang) )
{ {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="Content-Style-Type" content="text/css"><link rel="stylesheet" href="admin/subSilver.css" type="text/css"><style type="text/css">th { background-image: url(\'admin/images/cellpic3.gif\') } td.cat { background-image: url(\'admin/images/cellpic1.gif\') }</style><title>' . $msg_title . '</title></html>' . "\n"; echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="Content-Style-Type" content="text/css"><link rel="stylesheet" href="admin/subSilver.css" type="text/css"><style type="text/css">th { background-image: url(\'admin/images/cellpic3.gif\') } td.cat { background-image: url(\'admin/images/cellpic1.gif\') }</style><title>' . $msg_title . '</title></html>' . "\n";
echo '<body><table width="100%" height="100%" border="0"><tr><td align="center" valign="middle"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0"><tr><th>' . $msg_title . '</th></tr><tr><td class="row1" align="center">' . $msg_text . '</td></tr></table></td></tr></table></body></html>'; echo '<body><table width="100%" height="100%" border="0"><tr><td align="center" valign="middle"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0"><tr><th>' . $msg_title . '</th></tr><tr><td class="row1" align="center">' . $msg_text . '</td></tr></table></td></tr></table></body></html>';
@ -694,8 +622,8 @@ function message_die($msg_code, $msg_text = '', $msg_title = '')
// Error and message handler, call with trigger_error if reqd // Error and message handler, call with trigger_error if reqd
function msg_handler($errno, $msg_text, $errfile, $errline) function msg_handler($errno, $msg_text, $errfile, $errline)
{ {
global $db, $session, $auth, $template, $board_config, $theme, $lang, $userdata, $user_ip; global $db, $auth, $template, $board_config, $user, $nav_links;
global $phpEx, $phpbb_root_path, $nav_links, $starttime; global $phpEx, $phpbb_root_path, $starttime;
switch ( $errno ) switch ( $errno )
{ {
@ -705,33 +633,26 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
case E_NOTICE: case E_NOTICE:
break; break;
case E_ERROR:
case E_USER_ERROR: case E_USER_ERROR:
if ( isset($db) )
{
$db->sql_close(); $db->sql_close();
}
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><title>phpBB 2 :: General Error</title></html>' . "\n"; echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="Content-Style-Type" content="text/css"><link rel="stylesheet" href="admin/subSilver.css" type="text/css"><style type="text/css">th { background-image: url(\'admin/images/cellpic3.gif\') } td.cat { background-image: url(\'admin/images/cellpic1.gif\') }</style><title>' . $msg_title . '</title></html>' . "\n";
echo '<body><h1 style="font-family:Verdana,serif;font-size:18pt;font-weight:bold">phpBB2 :: General Error</h1><hr style="height:2px;border-style:dashed;color:black" /><p style="font-family:Verdana,serif;font-size:10pt">' . $msg_text . '</p><hr style="height:2px;border-style:dashed;color:black" /><p style="font-family:Verdana,serif;font-size:10pt">Contact the site administrator to report this failure</p></body></html>'; echo '<body><table width="100%" height="100%" border="0"><tr><td align="center" valign="middle"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0"><tr><th>' . $msg_title . '</th></tr><tr><td class="row1" align="center">' . $msg_text . '</td></tr></table></td></tr></table></body></html>';
exit;
break; break;
case E_USER_NOTICE: case E_USER_NOTICE:
if ( empty($lang) && !empty($board_config['default_lang']) ) $msg_text = ( !empty($user->lang[$msg_text]) ) ? $user->lang[$msg_text] : $msg_text;
{
if ( !file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) )
{
$board_config['default_lang'] = 'english';
}
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);
}
$msg_text = ( !empty($lang[$msg_text]) ) ? $lang[$msg_text] : $msg_text;
if ( !defined('HEADER_INC') ) if ( !defined('HEADER_INC') )
{ {
if ( empty($userdata) ) if ( empty($user->data) )
{ {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="Content-Style-Type" content="text/css"><link rel="stylesheet" href="admin/subSilver.css" type="text/css"><style type="text/css">th { background-image: url(\'admin/images/cellpic3.gif\') } td.cat { background-image: url(\'admin/images/cellpic1.gif\') }</style><title>' . $lang['Information'] . '</title></html>' . "\n"; echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="Content-Style-Type" content="text/css"><link rel="stylesheet" href="admin/subSilver.css" type="text/css"><style type="text/css">th { background-image: url(\'admin/images/cellpic3.gif\') } td.cat { background-image: url(\'admin/images/cellpic1.gif\') }</style><title>' . $user->lang['Information'] . '</title></html>' . "\n";
echo '<body><table width="100%" height="100%" border="0"><tr><td align="center" valign="middle"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0"><tr><th>' . $lang['Information'] . '</th></tr><tr><td class="row1" align="center">' . $msg_text . '</td></tr></table></td></tr></table></body></html>'; echo '<body><table width="100%" height="100%" border="0"><tr><td align="center" valign="middle"><table class="bg" width="80%" cellspacing="1" cellpadding="4" border="0"><tr><th>' . $user->lang['Information'] . '</th></tr><tr><td class="row1" align="center">' . $msg_text . '</td></tr></table></td></tr></table></body></html>';
$db->sql_close(); $db->sql_close();
exit; exit;
} }

View file

@ -387,7 +387,6 @@ function split_sql_file($sql, $delimiter)
// save memory. // save memory.
$tokens[$j] = ''; $tokens[$j] = '';
} }
} // for.. } // for..
} // else } // else
} }
@ -399,107 +398,63 @@ function split_sql_file($sql, $delimiter)
// Extension of auth class for changing permissions // Extension of auth class for changing permissions
class auth_admin extends auth class auth_admin extends auth
{ {
function acl_set_user(&$forum_id, &$user_id, &$auth) // Note that the set/delete methods are basically the same
// so if possible they should be merged
function acl_set($mode, &$forum_id, &$ug_id, &$auth)
{ {
global $db; global $db;
$forum_sql = ( $forum_id ) ? "AND a.forum_id IN ($forum_id, 0)" : ''; if ( !is_array($forum_id) )
{
$forum_id = array($forum_id);
}
// NOTE THIS USED TO BE IN ($forum_id, 0) ...
$forum_sql = 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')';
$sql = "SELECT o.auth_option_id, o.auth_value, a.auth_allow_deny $sql = ( $mode == 'user' ) ? "SELECT o.auth_option_id, o.auth_value, a.forum_id, a.auth_allow_deny FROM " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $forum_sql AND a.user_id = $ug_id" :"SELECT o.auth_option_id, o.auth_value, a.forum_id, a.auth_allow_deny FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o WHERE a.auth_option_id = o.auth_option_id $forum_sql AND a.group_id = $ug_id";
FROM " . ACL_USERS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o
WHERE a.auth_option_id = o.auth_option_id
$forum_sql
AND a.user_id = $user_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$user_auth = array(); $cur_auth = array();
if ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{ {
do $cur_auth[$row['forum_id']][$row['auth_option_id']] = $row['auth_allow_deny'];
{
$user_auth[$user_id][$row['auth_option_id']] = $row['auth_allow_deny'];
}
while ( $row = $db->sql_fetchrow($result) );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
$table = ( $mode == 'user' ) ? ACL_USERS_TABLE : ACL_GROUPS_TABLE;
$id_field = $mode . '_id';
foreach ( $forum_id as $forum)
{
foreach ( $auth as $auth_option_id => $allow ) foreach ( $auth as $auth_option_id => $allow )
{ {
if ( !empty($user_auth) ) if ( !empty($cur_auth[$forum]) )
{ {
foreach ( $user_auth as $user => $user_auth_ary ) $sql_ary[] = ( !isset($cur_auth[$forum][$auth_option_id]) ) ? "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_allow_deny) VALUES ($ug_id, $forum, $auth_option_id, $allow)" : ( ( $cur_auth[$forum][$auth_option_id] != $allow ) ? "UPDATE " . $table . " SET auth_allow_deny = $allow WHERE $id_field = $ug_id AND forum_id = $forum AND auth_option_id = $auth_option_id" : '' );
{
$sql_ary[] = ( !isset($user_auth_ary[$auth_option_id]) ) ? "INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($user_id, $forum_id, $auth_option_id, $allow)" : ( ( $user_auth_ary[$auth_option_id] != $allow ) ? "UPDATE " . ACL_USERS_TABLE . " SET auth_allow_deny = $allow WHERE user_id = $user_id AND forum_id = $forum_id AND auth_option_id = $auth_option_id" : '' );
}
} }
else else
{ {
$sql_ary[] = "INSERT INTO " . ACL_USERS_TABLE . " (user_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($user_id, $forum_id, $auth_option_id, $allow)"; $sql_ary[] = "INSERT INTO $table ($id_field, forum_id, auth_option_id, auth_allow_deny) VALUES ($ug_id, $forum, $auth_option_id, $allow)";
} }
} }
foreach ( $sql_ary as $sql )
{
$db->sql_query($sql);
} }
unset($forum_id);
unset($user_auth); unset($user_auth);
unset($sql_ary);
$this->acl_clear_prefetch();
}
function acl_set_group(&$forum_id, &$group_id, &$auth)
{
global $db;
$forum_sql = "AND a.forum_id IN ($forum_id, 0)";
$sql = "SELECT o.auth_option_id, o.auth_value, a.auth_allow_deny
FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " o
WHERE a.auth_option_id = o.auth_option_id
$forum_sql
AND a.group_id = $group_id";
$result = $db->sql_query($sql);
$group_auth = array();
if ( $row = $db->sql_fetchrow($result) )
{
do
{
$group_auth[$group_id][$row['auth_option_id']] = $row['auth_allow_deny'];
}
while ( $row = $db->sql_fetchrow($result) );
}
$db->sql_freeresult($result);
foreach ( $auth as $auth_option_id => $allow )
{
if ( !empty($group_auth) )
{
foreach ( $group_auth as $group => $group_auth_ary )
{
$sql_ary[] = ( !isset($group_auth_ary[$auth_option_id]) ) ? "INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($group_id, $forum_id, $auth_option_id, $allow)" : ( ( $group_auth_ary[$auth_option_id] != $allow ) ? "UPDATE " . ACL_GROUPS_TABLE . " SET auth_allow_deny = $allow WHERE group_id = $group_id AND forum_id = $forum_id and auth_option_id = $auth_option_id" : '' );
}
}
else
{
$sql_ary[] = "INSERT INTO " . ACL_GROUPS_TABLE . " (group_id, forum_id, auth_option_id, auth_allow_deny) VALUES ($group_id, $forum_id, $auth_option_id, $allow)";
}
}
foreach ( $sql_ary as $sql ) foreach ( $sql_ary as $sql )
{ {
$db->sql_query($sql); if ( $sql != '' )
{
$result = $db->sql_query($sql);
$db->sql_freeresult($result);
}
} }
unset($group_auth);
unset($sql_ary); unset($sql_ary);
$this->acl_clear_prefetch(); $this->acl_clear_prefetch();
} }
function acl_delete_user($forum_id, $user_id, $auth_ids = false) function acl_delete($mode, &$forum_id, &$ug_id, $auth_ids = false)
{ {
global $db; global $db;
@ -513,31 +468,11 @@ class auth_admin extends auth
$auth_sql = " AND auth_option_id IN ($auth_sql)"; $auth_sql = " AND auth_option_id IN ($auth_sql)";
} }
$sql = "DELETE FROM " . ACL_USERS_TABLE . " $table = ( $mode == 'user' ) ? ACL_USERS_TABLE : ACL_GROUPS_TABLE;
WHERE user_id = $user_id $id_field = $mode . '_id';
AND forum_id = $forum_id
$auth_sql";
$db->sql_query($sql);
$this->acl_clear_prefetch(); $sql = "DELETE FROM $table
} WHERE $id_field = $ug_id
function acl_delete_group($forum_id, $group_id, $auth_type = false)
{
global $db;
$auth_sql = '';
if ( $auth_ids )
{
for($i = 0; $i < count($auth_ids); $i++)
{
$auth_sql .= ( ( $auth_sql != '' ) ? ', ' : '' ) . $auth_ids[$i];
}
$auth_sql = " AND auth_option_id IN ($auth_sql)";
}
$sql = "DELETE FROM " . ACL_GROUPS_TABLE . "
WHERE group_id = $group_id
AND forum_id = $forum_id AND forum_id = $forum_id
$auth_sql"; $auth_sql";
$db->sql_query($sql); $db->sql_query($sql);
@ -555,6 +490,25 @@ class auth_admin extends auth
return; return;
} }
function acl_add_option($options)
{
global $db;
if ( !is_array($options) )
{
message_die(ERROR, 'Incorrect parameter for acl_add_option');
}
// If we go with the | GLOBAL | FORUM | setup the array
// needs to be a hash setup appropriately. We then need
// to insert each new option with an appropriate global
// or local id
//
// If we stay with the current | FORUM | setup the array
// need not be a hash. Each entry would simply be inserted
}
} }
?> ?>

View file

@ -36,22 +36,19 @@ if ( $board_config['gzip_compress'] )
} }
// Generate logged in/logged out status // Generate logged in/logged out status
if ( $userdata['user_id'] ) if ( $user->data['user_id'] )
{ {
$u_login_logout = 'login.'.$phpEx. $SID . '&amp;logout=true'; $u_login_logout = 'login.'.$phpEx. $SID . '&amp;logout=true';
$l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]'; $l_login_logout = $user->lang['Logout'] . ' [ ' . $user->data['username'] . ' ]';
} }
else else
{ {
$u_login_logout = 'login.'.$phpEx . $SID; $u_login_logout = 'login.'.$phpEx . $SID;
$l_login_logout = $lang['Login']; $l_login_logout = $user->lang['Login'];
} }
// Last visit date/time // Last visit date/time
$s_last_visit = ( $userdata['user_id'] ) ? $user->format_date($userdata['session_last_visit']) : ''; $s_last_visit = ( $user->data['user_id'] ) ? $user->format_date($user->data['session_last_visit']) : '';
// Timezone : $user->dst
$s_timezone = ( $userdata['user_dst'] ) ? sprintf($lang['All_times'], $lang[floatval($board_config['board_timezone'])], $lang['tz']['dst']) : sprintf($lang['All_times'], $lang[floatval($board_config['board_timezone'])], '');
// Get users online list // Get users online list
$userlist_ary = array(); $userlist_ary = array();
@ -64,12 +61,17 @@ $online_userlist = '';
$prev_user_id = 0; $prev_user_id = 0;
$prev_user_ip = ''; $prev_user_ip = '';
// && $auth->acl_get('forum', 'read', $_GET['f'])
$user_forum_sql = ( empty($_GET['f'])) ? '' : "AND s.session_page LIKE '%f=" . intval($_GET['f']) . "%'"; $reading_sql = '';
if ( !empty($_GET['f']) || !empty($_GET['t']) )
{
$reading_sql = "AND s.session_page LIKE '%" . ( ( !empty($_GET['t']) ) ? 't=' . intval($_GET['t']) : 'f=' . intval($_GET['f']) ) . "%'";
}
$sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_colour, s.session_ip $sql = "SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_colour, s.session_ip
FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE ." s FROM " . USERS_TABLE . " u, " . SESSIONS_TABLE ." s
WHERE s.session_time >= ".( time() - 300 ) . " WHERE s.session_time >= ".( time() - 300 ) . "
$user_forum_sql $reading_sql
AND u.user_id = s.session_user_id AND u.user_id = s.session_user_id
ORDER BY u.username ASC, s.session_ip ASC"; ORDER BY u.username ASC, s.session_ip ASC";
$result = $db->sql_query($sql, false); $result = $db->sql_query($sql, false);
@ -77,7 +79,7 @@ $result = $db->sql_query($sql, false);
while( $row = $db->sql_fetchrow($result) ) while( $row = $db->sql_fetchrow($result) )
{ {
// User is logged in and therefor not a guest // User is logged in and therefor not a guest
if ( $row['user_id'] ) if ($row['user_id'] != ANONYMOUS)
{ {
// Skip multiple sessions for one user // Skip multiple sessions for one user
if ( $row['user_id'] != $prev_user_id ) if ( $row['user_id'] != $prev_user_id )
@ -120,16 +122,16 @@ while( $row = $db->sql_fetchrow($result) )
if ( empty($online_userlist) ) if ( empty($online_userlist) )
{ {
$online_userlist = $lang['None']; $online_userlist = $user->lang['None'];
} }
if ( empty($_GET['f']) ) if ( empty($_GET['f']) )
{ {
$online_userlist = $lang['Registered_users'] . ' ' . $online_userlist; $online_userlist = $user->lang['Registered_users'] . ' ' . $online_userlist;
} }
else else
{ {
$l_online = ( $guests_online == 1 ) ? $lang['Browsing_forum_guest'] : $lang['Browsing_forum_guests']; $l_online = ( $guests_online == 1 ) ? $user->lang['Browsing_forum_guest'] : $user->lang['Browsing_forum_guests'];
$online_userlist = sprintf($l_online, $online_userlist, $guests_online); $online_userlist = sprintf($l_online, $online_userlist, $guests_online);
} }
@ -153,54 +155,54 @@ if ( $total_online_users > $board_config['record_online_users'])
if ( $total_online_users == 0 ) if ( $total_online_users == 0 )
{ {
$l_t_user_s = $lang['Online_users_zero_total']; $l_t_user_s = $user->lang['Online_users_zero_total'];
} }
else if ( $total_online_users == 1 ) else if ( $total_online_users == 1 )
{ {
$l_t_user_s = $lang['Online_user_total']; $l_t_user_s = $user->lang['Online_user_total'];
} }
else else
{ {
$l_t_user_s = $lang['Online_users_total']; $l_t_user_s = $user->lang['Online_users_total'];
} }
if ( $logged_visible_online == 0 ) if ( $logged_visible_online == 0 )
{ {
$l_r_user_s = $lang['Reg_users_zero_total']; $l_r_user_s = $user->lang['Reg_users_zero_total'];
} }
else if ( $logged_visible_online == 1 ) else if ( $logged_visible_online == 1 )
{ {
$l_r_user_s = $lang['Reg_user_total']; $l_r_user_s = $user->lang['Reg_user_total'];
} }
else else
{ {
$l_r_user_s = $lang['Reg_users_total']; $l_r_user_s = $user->lang['Reg_users_total'];
} }
if ( $logged_hidden_online == 0 ) if ( $logged_hidden_online == 0 )
{ {
$l_h_user_s = $lang['Hidden_users_zero_total']; $l_h_user_s = $user->lang['Hidden_users_zero_total'];
} }
else if ( $logged_hidden_online == 1 ) else if ( $logged_hidden_online == 1 )
{ {
$l_h_user_s = $lang['Hidden_user_total']; $l_h_user_s = $user->lang['Hidden_user_total'];
} }
else else
{ {
$l_h_user_s = $lang['Hidden_users_total']; $l_h_user_s = $user->lang['Hidden_users_total'];
} }
if ( $guests_online == 0 ) if ( $guests_online == 0 )
{ {
$l_g_user_s = $lang['Guest_users_zero_total']; $l_g_user_s = $user->lang['Guest_users_zero_total'];
} }
else if ( $guests_online == 1 ) else if ( $guests_online == 1 )
{ {
$l_g_user_s = $lang['Guest_user_total']; $l_g_user_s = $user->lang['Guest_user_total'];
} }
else else
{ {
$l_g_user_s = $lang['Guest_users_total']; $l_g_user_s = $user->lang['Guest_users_total'];
} }
$l_online_users = sprintf($l_t_user_s, $total_online_users); $l_online_users = sprintf($l_t_user_s, $total_online_users);
@ -208,62 +210,52 @@ $l_online_users .= sprintf($l_r_user_s, $logged_visible_online);
$l_online_users .= sprintf($l_h_user_s, $logged_hidden_online); $l_online_users .= sprintf($l_h_user_s, $logged_hidden_online);
$l_online_users .= sprintf($l_g_user_s, $guests_online); $l_online_users .= sprintf($l_g_user_s, $guests_online);
// // Obtain number of new private messages if user is logged in
// Obtain number of new private messages if ($user->data['user_id'] != ANONYMOUS)
// if user is logged in
//
if ( $userdata['user_id'] )
{ {
if ( $userdata['user_new_privmsg'] ) if ($user->data['user_new_privmsg'])
{ {
$l_message_new = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['New_pm'] : $lang['New_pms']; $l_message_new = ( $user->data['user_new_privmsg'] == 1 ) ? $user->lang['New_pm'] : $user->lang['New_pms'];
$l_privmsgs_text = sprintf($l_message_new, $userdata['user_new_privmsg']); $l_privmsgs_text = sprintf($l_message_new, $user->data['user_new_privmsg']);
if ( $userdata['user_last_privmsg'] > $userdata['session_last_visit'] ) if ( $user->data['user_last_privmsg'] > $user->data['session_last_visit'] )
{ {
$sql = "UPDATE " . USERS_TABLE . " $sql = "UPDATE " . USERS_TABLE . "
SET user_last_privmsg = " . $userdata['session_last_visit'] . " SET user_last_privmsg = " . $user->data['session_last_visit'] . "
WHERE user_id = " . $userdata['user_id']; WHERE user_id = " . $user->data['user_id'];
$db->sql_query($sql); $db->sql_query($sql);
$s_privmsg_new = 1; $s_privmsg_new = 1;
$icon_pm = $images['pm_new_msg'];
} }
else else
{ {
$s_privmsg_new = 0; $s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'];
} }
} }
else else
{ {
$l_privmsgs_text = $lang['No_new_pm']; $l_privmsgs_text = $user->lang['No_new_pm'];
$s_privmsg_new = 0; $s_privmsg_new = 0;
$icon_pm = $images['pm_no_new_msg'];
} }
if ( $userdata['user_unread_privmsg'] ) if ( $user->data['user_unread_privmsg'] )
{ {
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms']; $l_message_unread = ( $user->data['user_unread_privmsg'] == 1 ) ? $user->lang['Unread_pm'] : $user->lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']); $l_privmsgs_text_unread = sprintf($l_message_unread, $user->data['user_unread_privmsg']);
} }
else else
{ {
$l_privmsgs_text_unread = $lang['No_unread_pm']; $l_privmsgs_text_unread = $user->lang['No_unread_pm'];
} }
} }
else else
{ {
$icon_pm = $images['pm_no_new_msg']; $l_privmsgs_text = $user->lang['Login_check_pm'];
$l_privmsgs_text = $lang['Login_check_pm'];
$l_privmsgs_text_unread = ''; $l_privmsgs_text_unread = '';
$s_privmsg_new = 0; $s_privmsg_new = 0;
} }
//
// Generate HTML required for Mozilla Navigation bar // Generate HTML required for Mozilla Navigation bar
//
$nav_links_html = ''; $nav_links_html = '';
/* /*
$nav_link_proto = '<link rel="%s" href="%s" title="%s" />' . "\n"; $nav_link_proto = '<link rel="%s" href="%s" title="%s" />' . "\n";
@ -283,77 +275,78 @@ foreach ( $nav_links as $nav_item => $nav_array )
} }
} }
*/ */
//
// The following assigns all _common_ variables that may be used at any point // The following assigns all _common_ variables that may be used at any point
// in a template. // in a template.
//
$template->assign_vars(array( $template->assign_vars(array(
'SITENAME' => $board_config['sitename'], 'SITENAME' => $board_config['sitename'],
'SITE_DESCRIPTION' => $board_config['site_desc'], 'SITE_DESCRIPTION' => $board_config['site_desc'],
'PAGE_TITLE' => $page_title, 'PAGE_TITLE' => $page_title,
'LAST_VISIT_DATE' => sprintf($lang['You_last_visit'], $s_last_visit), 'LAST_VISIT_DATE' => sprintf($user->lang['You_last_visit'], $s_last_visit),
'CURRENT_TIME' => sprintf($lang['Current_time'], $user->format_date(time())), 'CURRENT_TIME' => sprintf($user->lang['Current_time'], $user->format_date(time())),
'TOTAL_USERS_ONLINE' => $l_online_users, 'TOTAL_USERS_ONLINE' => $l_online_users,
'LOGGED_IN_USER_LIST' => $online_userlist, 'LOGGED_IN_USER_LIST' => $online_userlist,
'RECORD_USERS' => sprintf($lang['Record_online_users'], $board_config['record_online_users'], $user->format_date($board_config['record_online_date'])), 'RECORD_USERS' => sprintf($user->lang['Record_online_users'], $board_config['record_online_users'], $user->format_date($board_config['record_online_date'])),
'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text, 'PRIVATE_MESSAGE_INFO' => $l_privmsgs_text,
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new, 'PRIVATE_MESSAGE_NEW_FLAG' => $s_privmsg_new,
'PRIVATE_MESSAGE_INFO_UNREAD' => $l_privmsgs_text_unread,
'PRIVMSG_IMG' => $icon_pm, 'L_USERNAME' => $user->lang['Username'],
'L_PASSWORD' => $user->lang['Password'],
'L_USERNAME' => $lang['Username'],
'L_PASSWORD' => $lang['Password'],
'L_LOGIN_LOGOUT' => $l_login_logout, 'L_LOGIN_LOGOUT' => $l_login_logout,
'L_LOGIN' => $lang['Login'], 'L_LOGIN' => $user->lang['Login'],
'L_LOG_ME_IN' => $lang['Log_me_in'], 'L_LOG_ME_IN' => $user->lang['Log_me_in'],
'L_AUTO_LOGIN' => $lang['Log_me_in'], 'L_AUTO_LOGIN' => $user->lang['Log_me_in'],
'L_INDEX' => sprintf($lang['Forum_Index'], $board_config['sitename']), 'L_INDEX' => sprintf($user->lang['Forum_Index'], $board_config['sitename']),
'L_REGISTER' => $lang['Register'], 'L_FAQ' => $user->lang['FAQ'],
'L_PROFILE' => $lang['Profile'], 'L_REGISTER' => $user->lang['Register'],
'L_SEARCH' => $lang['Search'], 'L_PROFILE' => $user->lang['Profile'],
'L_PRIVATEMSGS' => $lang['Private_Messages'], 'L_SEARCH' => $user->lang['Search'],
'L_WHO_IS_ONLINE' => $lang['Who_is_Online'], 'L_PRIVATEMSGS' => $user->lang['Private_Messages'],
'L_MEMBERLIST' => $lang['Memberlist'], 'L_MEMBERLIST' => $user->lang['Memberlist'],
'L_FAQ' => $lang['FAQ'], 'L_USERGROUPS' => $user->lang['Usergroups'],
'L_USERGROUPS' => $lang['Usergroups'], 'L_SEARCH_NEW' => $user->lang['Search_new'],
'L_SEARCH_NEW' => $lang['Search_new'], 'L_SEARCH_SELF' => $user->lang['Search_your_posts'],
'L_SEARCH_UNANSWERED' => $lang['Search_unanswered'], 'L_WHO_IS_ONLINE' => $user->lang['Who_is_Online'],
'L_SEARCH_SELF' => $lang['Search_your_posts'], 'L_SEARCH_UNANSWERED' => $user->lang['Search_unanswered'],
'U_SEARCH_UNANSWERED' => 'search.'.$phpEx.$SID.'&amp;search_id=unanswered',
'U_SEARCH_SELF' => 'search.'.$phpEx.$SID.'&amp;search_id=egosearch',
'U_SEARCH_NEW' => 'search.'.$phpEx.$SID.'&amp;search_id=newposts',
'U_INDEX' => 'index.'.$phpEx.$SID,
'U_REGISTER' => 'profile.'.$phpEx.$SID.'&amp;mode=register',
'U_PROFILE' => 'profile.'.$phpEx.$SID.'&amp;mode=editprofile',
'U_PRIVATEMSGS' => 'privmsg.'.$phpEx.$SID.'&amp;folder=inbox', 'U_PRIVATEMSGS' => 'privmsg.'.$phpEx.$SID.'&amp;folder=inbox',
'U_PRIVATEMSGS_POPUP' => 'privmsg.'.$phpEx.$SID.'&amp;mode=newpm',
'U_SEARCH' => 'search.'.$phpEx.$SID,
'U_MEMBERLIST' => 'memberlist.'.$phpEx.$SID, 'U_MEMBERLIST' => 'memberlist.'.$phpEx.$SID,
'U_MODCP' => 'modcp.'.$phpEx.$SID,
'U_FAQ' => 'faq.'.$phpEx.$SID,
'U_VIEWONLINE' => 'viewonline.'.$phpEx.$SID, 'U_VIEWONLINE' => 'viewonline.'.$phpEx.$SID,
'U_LOGIN_LOGOUT' => $u_login_logout,
'U_MEMBERSLIST' => 'memberlist.'.$phpEx.$SID, 'U_MEMBERSLIST' => 'memberlist.'.$phpEx.$SID,
'U_GROUP_CP' => 'groupcp.'.$phpEx.$SID, 'U_GROUP_CP' => 'groupcp.'.$phpEx.$SID,
'U_LOGIN_LOGOUT'=> $u_login_logout,
'U_INDEX' => 'index.'.$phpEx.$SID,
'U_SEARCH' => 'search.'.$phpEx.$SID,
'U_REGISTER' => 'profile.'.$phpEx.$SID.'&amp;mode=register',
'U_PROFILE' => 'profile.'.$phpEx.$SID.'&amp;mode=editprofile',
'U_MODCP' => 'modcp.'.$phpEx.$SID,
'U_FAQ' => 'faq.'.$phpEx.$SID,
'U_SEARCH_SELF' => 'search.'.$phpEx.$SID.'&amp;search_id=egosearch',
'U_SEARCH_NEW' => 'search.'.$phpEx.$SID.'&amp;search_id=newposts',
'U_PRIVATEMSGS_POPUP' => 'privmsg.'.$phpEx.$SID.'&amp;mode=newpm',
'U_SEARCH_UNANSWERED' => 'search.'.$phpEx.$SID.'&amp;search_id=unanswered',
'S_USER_LOGGED_IN' => ( $userdata['user_id'] ) ? true : false, 'S_USER_LOGGED_IN' => ( $user->data['user_id'] ) ? true : false,
'S_USER_PM_POPUP' => ( !empty($userdata['user_popup_pm']) ) ? true : false, 'S_USER_PM_POPUP' => ( !empty($user->data['user_popup_pm']) ) ? true : false,
'S_USER_BROWSER' => $userdata['session_browser'], 'S_USER_BROWSER' => $user->data['session_browser'],
'S_CONTENT_DIRECTION' => $lang['DIRECTION'], 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
'S_CONTENT_ENCODING' => $lang['ENCODING'], 'S_CONTENT_ENCODING' => $user->lang['ENCODING'],
'S_CONTENT_DIR_LEFT' => $lang['LEFT'], 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'],
'S_TIMEZONE' => $s_timezone,
'S_LOGIN_ACTION' => 'login.'.$phpEx.$SID, 'S_LOGIN_ACTION' => 'login.'.$phpEx.$SID,
'S_TIMEZONE' => ( $user->data['user_dst'] ) ? sprintf($user->lang['All_times'], $user->lang[floatval($board_config['board_timezone'])], $user->lang['tz']['dst']) : sprintf($user->lang['All_times'], $user->lang[floatval($board_config['board_timezone'])], ''),
'T_STYLESHEET_DATA' => $theme['css_data'], 'T_STYLESHEET_DATA' => $user->theme['css_data'],
'T_STYLESHEET_LINK' => 'templates/' . $theme['css_external'], 'T_STYLESHEET_LINK' => 'templates/' . $user->theme['css_external'],
'NAV_LINKS' => $nav_links_html) 'NAV_LINKS' => $nav_links_html)
); );
/*if ( $board_config['send_encoding'] )
{
header ('Content-type: text/html; charset: ' . $user->lang['ENCODING']);
}*/
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0'); header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT'); header ('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); header ('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');

View file

@ -19,14 +19,10 @@
* *
***************************************************************************/ ***************************************************************************/
//
// Close our DB connection. // Close our DB connection.
//
$db->sql_close(); $db->sql_close();
//
// Output page creation time // Output page creation time
//
if (defined('DEBUG')) if (defined('DEBUG'))
{ {
$mtime = explode(' ', microtime()); $mtime = explode(' ', microtime());
@ -51,7 +47,7 @@ if (defined('DEBUG'))
$template->assign_vars(array( $template->assign_vars(array(
'PHPBB_VERSION' => $board_config['version'], 'PHPBB_VERSION' => $board_config['version'],
'ADMIN_LINK' => ( $auth->acl_get('a_') ) ? '<a href="' . "admin/index.$phpEx?sid=" . $userdata['session_id'] . '">' . $lang['Admin_panel'] . '</a><br /><br />' : '', 'ADMIN_LINK' => ( $auth->acl_get('a_') ) ? '<a href="' . "admin/index.$phpEx?sid=" . $user->data['session_id'] . '">' . $user->lang['Admin_panel'] . '</a><br /><br />' : '',
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '' 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : ''
)); ));

View file

@ -19,17 +19,19 @@
* *
***************************************************************************/ ***************************************************************************/
class session { class session
{
var $session_id = ''; var $session_id = '';
var $data = array();
var $browser = ''; var $browser = '';
var $user_ip = '';
var $page = ''; var $page = '';
var $load; var $load;
// Called at each page start ... checks for, updates and/or creates a session // Called at each page start ... checks for, updates and/or creates a session
function start($update = true) function start($update = true)
{ {
global $SID, $db, $board_config, $user_ip; global $SID, $db, $board_config;
$current_time = time(); $current_time = time();
$this->browser = ( !empty($_SERVER['HTTP_USER_AGENT']) ) ? $_SERVER['HTTP_USER_AGENT'] : $_ENV['HTTP_USER_AGENT']; $this->browser = ( !empty($_SERVER['HTTP_USER_AGENT']) ) ? $_SERVER['HTTP_USER_AGENT'] : $_ENV['HTTP_USER_AGENT'];
@ -49,16 +51,28 @@ class session {
$SID = '?sid=' . $this->session_id; $SID = '?sid=' . $this->session_id;
} }
// Obtain users IP
$this->ip = ( !empty($_SERVER['REMOTE_ADDR']) ) ? $_SERVER['REMOTE_ADDR'] : $REMOTE_ADDR;
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
if ( preg_match('/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/', $_SERVER['HTTP_X_FORWARDED_FOR'], $ip_list) )
{
$private_ip = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10\..*/', '/^224\..*/', '/^240\..*/');
$this->ip = preg_replace($private_ip, $this->ip, $ip_list[1]);
}
}
// Load limit check (if applicable) // Load limit check (if applicable)
if ( $board_config['limit_load'] && file_exists('/proc/loadavg') ) if ( intval($board_config['limit_load']) && file_exists('/proc/loadavg') )
{ {
if ( $load = @file('/proc/loadavg') ) if ( $load = @file('/proc/loadavg') )
{ {
list($this->load) = explode(' ', $load[0]); list($this->load) = explode(' ', $load[0]);
if ( $this->load > $board_config['limit_load'] ) if ( $this->load > intval($board_config['limit_load']) )
{ {
message_die(MESSAGE, 'Board_unavailable'); trigger_error('Board_unavailable');
} }
} }
} }
@ -72,20 +86,20 @@ class session {
AND u.user_id = s.session_user_id"; AND u.user_id = s.session_user_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$userdata = $db->sql_fetchrow($result); $this->data = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Did the session exist in the DB? // Did the session exist in the DB?
if ( isset($userdata['user_id']) ) if ( isset($this->data['user_id']) )
{ {
// Validate IP length according to admin ... has no effect on IPv6 // Validate IP length according to admin ... has no effect on IPv6
$s_ip = implode('.', array_slice(explode('.', $userdata['session_ip']), 0, $board_config['ip_check'])); $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $board_config['ip_check']));
$u_ip = implode('.', array_slice(explode('.', $user_ip), 0, $board_config['ip_check'])); $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $board_config['ip_check']));
if ( $u_ip == $s_ip ) if ( $u_ip == $s_ip )
{ {
// Only update session DB a minute or so after last update or if page changes // Only update session DB a minute or so after last update or if page changes
if ( ( $current_time - $userdata['session_time'] > 60 || $userdata['session_page'] != $user_page ) && $update ) if ( ( $current_time - $this->data['session_time'] > 60 || $this->data['session_page'] != $user_page ) && $update )
{ {
$sql = "UPDATE " . SESSIONS_TABLE . " $sql = "UPDATE " . SESSIONS_TABLE . "
SET session_time = $current_time, session_page = '$this->page' SET session_time = $current_time, session_page = '$this->page'
@ -93,7 +107,7 @@ class session {
$db->sql_query($sql); $db->sql_query($sql);
} }
return $userdata; return true;
} }
} }
} }
@ -109,7 +123,7 @@ class session {
// Create a new session // Create a new session
function create(&$user_id, &$autologin) function create(&$user_id, &$autologin)
{ {
global $SID, $db, $board_config, $user_ip; global $SID, $db, $board_config;
$sessiondata = array(); $sessiondata = array();
$current_time = time(); $current_time = time();
@ -127,7 +141,7 @@ class session {
if ( intval($row['sessions']) > intval($board_config['active_sessions']) ) if ( intval($row['sessions']) > intval($board_config['active_sessions']) )
{ {
message_die(MESSAGE, 'Board_unavailable'); trigger_error('Board_unavailable');
} }
} }
@ -146,14 +160,14 @@ class session {
ORDER BY s.session_time DESC"; ORDER BY s.session_time DESC";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$userdata = $db->sql_fetchrow($result); $this->data = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Check autologin request, is it valid? // Check autologin request, is it valid?
if ( $userdata['user_password'] != $autologin || !$userdata['user_active'] || !$user_id ) if ( $this->data['user_password'] != $autologin || !$this->data['user_active'] || !$user_id )
{ {
$autologin = ''; $autologin = '';
$userdata['user_id'] = $user_id = ANONYMOUS; $this->data['user_id'] = $user_id = ANONYMOUS;
} }
$sql = "SELECT ban_ip, ban_userid, ban_email $sql = "SELECT ban_ip, ban_userid, ban_email
@ -162,30 +176,26 @@ class session {
OR ban_end = 0"; OR ban_end = 0";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{ {
do if ( ( $row['user_id'] == $this->data['user_id'] ||
( $row['ban_ip'] && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $this->ip) ) ||
( $row['ban_email'] && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $this->data['user_email']) ) )
&& !$this->data['user_founder'] )
{ {
if ( ( $row['user_id'] == $userdata['user_id'] || trigger_error('You_been_banned');
( $row['ban_ip'] && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ip) ) ||
( $row['ban_email'] && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $userdata['user_email']) ) )
&& !$userdata['user_founder'] )
{
message_die(MESSAGE, 'You_been_banned');
} }
} }
while ( $row = $db->sql_fetchrow($result) );
}
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Is there an existing session? If so, grab last visit time from that // Is there an existing session? If so, grab last visit time from that
$userdata['session_last_visit'] = ( $userdata['session_time'] ) ? $userdata['session_time'] : ( ( $userdata['user_lastvisit'] ) ? $userdata['user_lastvisit'] : time() ); $this->data['session_last_visit'] = ( $this->data['session_time'] ) ? $this->data['session_time'] : ( ( $this->data['user_lastvisit'] ) ? $this->data['user_lastvisit'] : time() );
// Create or update the session // Create or update the session
$db->sql_return_on_error(true); $db->sql_return_on_error(true);
$sql = "UPDATE " . SESSIONS_TABLE . " $sql = "UPDATE " . SESSIONS_TABLE . "
SET session_user_id = $user_id, session_last_visit = " . $userdata['session_last_visit'] . ", session_start = $current_time, session_time = $current_time, session_browser = '$this->browser', session_page = '$this->page' SET session_user_id = $user_id, session_last_visit = " . $this->data['session_last_visit'] . ", session_start = $current_time, session_time = $current_time, session_browser = '$this->browser', session_page = '$this->page'
WHERE session_id = '" . $this->session_id . "'"; WHERE session_id = '" . $this->session_id . "'";
if ( !$db->sql_query($sql) || !$db->sql_affectedrows() ) if ( !$db->sql_query($sql) || !$db->sql_affectedrows() )
{ {
@ -194,12 +204,12 @@ class session {
$sql = "INSERT INTO " . SESSIONS_TABLE . " $sql = "INSERT INTO " . SESSIONS_TABLE . "
(session_id, session_user_id, session_last_visit, session_start, session_time, session_ip, session_browser, session_page) (session_id, session_user_id, session_last_visit, session_start, session_time, session_ip, session_browser, session_page)
VALUES ('" . $this->session_id . "', $user_id, " . $userdata['session_last_visit'] . ", $current_time, $current_time, '$user_ip', '$this->browser', '$this->page')"; VALUES ('" . $this->session_id . "', $user_id, " . $this->data['session_last_visit'] . ", $current_time, $current_time, '$this->ip', '$this->browser', '$this->page')";
$db->sql_query($sql); $db->sql_query($sql);
} }
$db->sql_return_on_error(false); $db->sql_return_on_error(false);
$userdata['session_id'] = $this->session_id; $this->data['session_id'] = $this->session_id;
$sessiondata['autologinid'] = ( $autologin && $user_id ) ? $autologin : ''; $sessiondata['autologinid'] = ( $autologin && $user_id ) ? $autologin : '';
$sessiondata['userid'] = $user_id; $sessiondata['userid'] = $user_id;
@ -208,17 +218,23 @@ class session {
$this->set_cookie('sid', $this->session_id, 0); $this->set_cookie('sid', $this->session_id, 0);
$SID = '?sid=' . $this->session_id; $SID = '?sid=' . $this->session_id;
// Events ... ? if ( $this->data['user_id'] )
if ( $userdata['user_id'] )
{ {
// Events ... ?
// do_events('days'); // do_events('days');
// First page ... ?
// if (!empty($this->data['user_firstpage']))
// {
// redirect($userdata['user_firstpage']);
// }
} }
return $userdata; return true;
} }
// Destroy a session // Destroy a session
function destroy(&$userdata) function destroy()
{ {
global $SID, $db, $board_config; global $SID, $db, $board_config;
@ -230,13 +246,13 @@ class session {
// Delete existing session, update last visit info first! // Delete existing session, update last visit info first!
$sql = "UPDATE " . USERS_TABLE . " $sql = "UPDATE " . USERS_TABLE . "
SET user_lastvisit = " . intval($userdata['session_time']) . " SET user_lastvisit = " . intval($this->data['session_time']) . "
WHERE user_id = " . $userdata['user_id']; WHERE user_id = " . $this->data['user_id'];
$db->sql_query($sql); $db->sql_query($sql);
$sql = "DELETE FROM " . SESSIONS_TABLE . " $sql = "DELETE FROM " . SESSIONS_TABLE . "
WHERE session_id = '" . $this->session_id . "' WHERE session_id = '" . $this->session_id . "'
AND session_user_id = " . $userdata['user_id']; AND session_user_id = " . $this->data['user_id'];
$db->sql_query($sql); $db->sql_query($sql);
$this->session_id = ''; $this->session_id = '';
@ -247,14 +263,14 @@ class session {
// Garbage collection // Garbage collection
function gc(&$current_time) function gc(&$current_time)
{ {
global $db, $board_config, $user_ip; global $db, $board_config;
// Get expired sessions, only most recent for each user // Get expired sessions, only most recent for each user
$sql = "SELECT session_user_id, MAX(session_time) AS recent_time $sql = "SELECT session_user_id, MAX(session_time) AS recent_time
FROM " . SESSIONS_TABLE . " FROM " . SESSIONS_TABLE . "
WHERE session_time < " . ( $current_time - $board_config['session_length'] ) . " WHERE session_time < " . ( $current_time - $board_config['session_length'] ) . "
GROUP BY session_user_id GROUP BY session_user_id
LIMIT 10"; LIMIT 5";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$del_user_id = ''; $del_user_id = '';
@ -282,9 +298,9 @@ class session {
$db->sql_query($sql); $db->sql_query($sql);
} }
if ( $del_sessions < 10 ) if ( $del_sessions < 5 )
{ {
// Less than 10 sessions, update gc timer ... else we want gc // Less than 5 sessions, update gc timer ... else we want gc
// called again to delete other sessions // called again to delete other sessions
$sql = "UPDATE " . CONFIG_TABLE . " $sql = "UPDATE " . CONFIG_TABLE . "
SET config_value = '$current_time' SET config_value = '$current_time'
@ -306,33 +322,41 @@ class session {
// Contains (at present) basic user methods such as configuration // Contains (at present) basic user methods such as configuration
// creating date/time ... keep this? // creating date/time ... keep this?
class user class user extends session
{ {
var $lang_name; var $lang = array();
var $lang_path; var $theme = array();
var $date_format; var $date_format;
var $timezone; var $timezone;
var $dst; var $dst;
function user(&$userdata, $lang_set = false, $style = false) var $lang_name;
{ var $lang_path;
global $db, $template, $lang, $board_config, $theme, $images; var $img_lang;
global $phpEx, $phpbb_root_path;
if ( $userdata['user_id'] ) function setup($lang_set = false, $style = false)
{ {
$this->lang_name = ( file_exists($phpbb_root_path . 'language/' . $userdata['user_lang']) ) ? $userdata['user_lang'] : $board_config['default_lang']; global $db, $template, $board_config, $phpEx, $phpbb_root_path;
if ( $this->data['user_id'] != ANONYMOUS )
{
$this->lang_name = ( file_exists($phpbb_root_path . 'language/' . $this->data['user_lang']) ) ? $this->data['user_lang'] : $board_config['default_lang'];
$this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/'; $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
$this->date_format = $userdata['user_dateformat']; $this->date_format = $this->data['user_dateformat'];
$this->timezone = $userdata['user_timezone'] * 3600; $this->timezone = $this->data['user_timezone'] * 3600;
$this->dst = $userdata['user_dst'] * 3600; $this->dst = $this->data['user_dst'] * 3600;
} }
else if ( isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ) else
{ {
$this->lang_name = $board_config['default_lang']; $this->lang_name = $board_config['default_lang'];
$this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/'; $this->lang_path = $phpbb_root_path . 'language/' . $this->lang_name . '/';
$this->date_format = $board_config['default_dateformat'];
$this->timezone = $board_config['board_timezone'] * 3600;
$this->dst = 0;
if ( isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) )
{
$accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']); $accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
foreach ( $accept_lang_ary as $accept_lang ) foreach ( $accept_lang_ary as $accept_lang )
{ {
@ -356,10 +380,7 @@ class user
} }
} }
} }
}
$this->date_format = $board_config['default_dateformat'];
$this->timezone = $board_config['board_timezone'] * 3600;
$this->dst = 0;
} }
include($this->lang_path . 'lang_main.' . $phpEx); include($this->lang_path . 'lang_main.' . $phpEx);
@ -367,6 +388,7 @@ class user
{ {
include($this->lang_path . 'lang_admin.' . $phpEx); include($this->lang_path . 'lang_admin.' . $phpEx);
} }
/* /*
if ( is_array($lang_set) ) if ( is_array($lang_set) )
{ {
@ -375,18 +397,18 @@ class user
$lang_set = explode(',', $lang_set); $lang_set = explode(',', $lang_set);
foreach ( $lang_set as $lang_file ) foreach ( $lang_set as $lang_file )
{ {
include($this->lang_path . '/' . trim($lang_file) . '.' . $phpEx); include($this->lang_path . '/' . $lang_file . '.' . $phpEx);
} }
unset($lang_set); unset($lang_set);
} }
else else
{ {
include($this->lang_path . '/common.' . $phpEx); include($this->lang_path . '/common.' . $phpEx);
include($this->lang_path . '/' . trim($lang_set) . '.' . $phpEx); include($this->lang_path . '/' . $lang_set . '.' . $phpEx);
} }
*/ */
// Set up style // Set up style
$style = ( $style ) ? $style : ( ( !$board_config['override_user_style'] && $userdata['user_id'] ) ? $userdata['user_style'] : $board_config['default_style'] ); $style = ( $style ) ? $style : ( ( !$board_config['override_user_style'] && $this->data['user_id'] ) ? $this->data['user_style'] : $board_config['default_style'] );
$sql = "SELECT t.template_path, t.poll_length, t.pm_box_length, c.css_data, c.css_external, i.* $sql = "SELECT t.template_path, t.poll_length, t.pm_box_length, c.css_data, c.css_external, i.*
FROM " . STYLES_TABLE . " s, " . STYLES_TPL_TABLE . " t, " . STYLES_CSS_TABLE . " c, " . STYLES_IMAGE_TABLE . " i FROM " . STYLES_TABLE . " s, " . STYLES_TPL_TABLE . " t, " . STYLES_CSS_TABLE . " c, " . STYLES_IMAGE_TABLE . " i
@ -396,33 +418,25 @@ class user
AND i.imageset_id = s.imageset_id"; AND i.imageset_id = s.imageset_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ( !($theme = $db->sql_fetchrow($result)) ) if ( !($this->theme = $db->sql_fetchrow($result)) )
{ {
message_die(ERROR, 'Could not get style data'); message_die(ERROR, 'Could not get style data');
} }
$template->set_template($theme['template_path']); $template->set_template($this->theme['template_path']);
$img_lang = ( file_exists('imagesets/' . $theme['imageset_path'] . '/' . $this->lang_name) ) ? $this->lang_name : $board_config['default_lang']; $this->img_lang = ( file_exists($phpbb_root_path . 'imagesets/' . $this->theme['imageset_path'] . '/' . $this->lang_name) ) ? $this->lang_name : $board_config['default_lang'];
$i10n = array('post_new', 'post_locked', 'post_pm', 'reply_new', 'reply_pm', 'reply_locked', 'icon_quote', 'icon_edit', 'icon_search', 'icon_profile', 'icon_pm', 'icon_email', 'icon_www', 'icon_icq', 'icon_aim', 'icon_yim', 'icon_msnm', 'icon_delete', 'icon_ip', 'icon_no_email', 'icon_no_www', 'icon_no_icq', 'icon_no_aim', 'icon_no_yim', 'icon_no_msnm');
foreach ( $i10n as $icon )
{
$theme[$icon] = str_replace('{LANG}', $img_lang, $theme[$icon]);
}
return; return;
} }
function format_date($gmepoch, $format = false) function format_date($gmepoch, $format = false)
{ {
global $lang;
static $lang_dates; static $lang_dates;
if ( empty($lang_dates) ) if ( empty($lang_dates) )
{ {
foreach ( $lang['datetime'] as $match => $replace ) foreach ( $this->lang['datetime'] as $match => $replace )
{ {
$lang_dates[$match] = $replace; $lang_dates[$match] = $replace;
} }
@ -431,6 +445,18 @@ class user
$format = ( !$format ) ? $this->date_format : $format; $format = ( !$format ) ? $this->date_format : $format;
return strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates); return strtr(@gmdate($format, $gmepoch + $this->timezone + $this->dst), $lang_dates);
} }
function img($img, $alt = '', $tag = false)
{
static $imgs;
if (empty($imgs[$img]))
{
$imgs[$img] = '<img src=' . str_replace('{LANG}', $this->img_lang, $this->theme[$img]) . '" alt="' . $this->lang[$alt] . '" title="' . $this->lang[$alt] . '" />';
}
return $imgs[$img];
}
} }
// Will be keeping my eye of 'other products' to ensure these things don't // Will be keeping my eye of 'other products' to ensure these things don't
@ -438,29 +464,36 @@ class user
class auth class auth
{ {
var $founder = false; var $founder = false;
var $acl = false; var $acl = array();
var $options = array(); var $acl_options = array();
function acl(&$userdata, $forum_id = false, $options = false) function acl(&$userdata, $forum_id = false, $options_in = false, $options_or = false)
{ {
global $db; global $db, $acl_options;
$this->acl_options = &$acl_options;
if (!$this->founder = $userdata['user_founder']) if (!$this->founder = $userdata['user_founder'])
{ {
// $mtime = explode(' ', microtime());
// $starttime = $mtime[1] + $mtime[0];
/*
$in_sql = "'a_', 'f_list'"; $in_sql = "'a_', 'f_list'";
$or_sql = '';
if ( $options ) if ( is_array($options_in) )
{ {
if ( is_array($options) ) foreach ( $options_in as $option )
{
foreach ( $options as $option )
{ {
$in_sql .= ", '$option'"; $in_sql .= ", '$option'";
} }
} }
else
if ( is_array($options_or) )
{ {
$or_sql = " OR auth_value LIKE '$option%'"; foreach ( $options_or as $option )
{
$or_sql .= " OR auth_value LIKE '$option%'";
} }
} }
@ -480,6 +513,9 @@ class auth
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// $mtime = explode(' ', microtime());
// echo $mtime[1] + $mtime[0] - $starttime . " :: ";
// This is preliminary and can no doubt be improved. The 12 in // This is preliminary and can no doubt be improved. The 12 in
// the chunk_split relates to the current 96bits (12 bytes) per forum // the chunk_split relates to the current 96bits (12 bytes) per forum
if ( !empty($userdata['user_permissions']) ) if ( !empty($userdata['user_permissions']) )
@ -503,9 +539,57 @@ class auth
$this->acl_cache($userdata); $this->acl_cache($userdata);
} }
/*
$sql = "SELECT auth_value, global_id, local_id
FROM " . ACL_OPTIONS_TABLE . "
WHERE auth_value IN ($in_sql) $or_sql";
$result = $db->sql_query($sql);
while ( $row = $db->sql_fetchrow($result) )
{
if ( isset($row['global_id']) )
{
$this->options['global'][$row['auth_value']] = $row['global_id'];
}
if ( isset($row['local_id']) )
{
$this->options['local'][$row['auth_value']] = $row['local_id'];
}
}
$db->sql_freeresult($result);
*/
if ( empty($userdata['user_permissions']) )
{
$this->acl_cache($userdata);
}
// This is preliminary and can no doubt be improved
$global_chars = ceil(sizeof($this->acl_options['global']) / 8);
$local_chars = ceil(sizeof($this->acl_options['local']) / 8) + 2;
$globals = substr($userdata['user_permissions'], 0, $global_chars);
$locals = substr($userdata['user_permissions'], $global_chars);
for($i = 0; $i < $global_chars; $i++)
{
$this->acl['global'] .= str_pad(decbin(ord(substr($globals, $i, 1))), 8, 0, STR_LEFT_PAD);
}
$forums = explode("\r\n", chunk_split($locals, $local_chars));
array_pop($forums);
foreach ( $forums as $forum )
{
$forum_id = bindec(str_pad(decbin(ord(substr($forum, 0, 1))), 8, 0, STR_PAD_LEFT) . str_pad(decbin(ord(substr($forum, 1, 1))), 8, 0, STR_PAD_LEFT));
for($i = 2; $i < $local_chars; $i++)
{
$this->acl['local'][$forum_id] .= str_pad(decbin(ord(substr($forum, $i, 1))), 8, 0, STR_PAD_LEFT);
}
}
unset($forums);
}
// $mtime = explode(' ', microtime()); // $mtime = explode(' ', microtime());
// echo $mtime[1] + $mtime[0] - $starttime . " :: "; // echo $mtime[1] + $mtime[0] - $starttime . " :: ";
}
return; return;
} }
@ -513,8 +597,26 @@ class auth
// Look up an option // Look up an option
function acl_get($option, $forum_id = 0) function acl_get($option, $forum_id = 0)
{ {
return ( $this->founder ) ? true : substr($this->acl[$forum_id], $this->options[$option], 1); static $acl_cache;
// return ( $this->founder ) ? true : $this->acl[$forum_id][$option]; /*
if ( !isset($acl_cache[$forum_id][$option]) && !$this->founder )
{
$acl_cache[$forum_id][$option] = substr($this->acl[$forum_id], $this->options[$option], 1);
}
*/
if ( !isset($acl_cache[$forum_id][$option]) && !$this->founder )
{
if ( isset($this->acl_options['global'][$option]) )
{
$acl_cache[$forum_id][$option] = substr($this->acl['global'], $this->acl_options['global'][$option], 1);
}
if ( isset($this->acl_options['local'][$option]) )
{
$acl_cache[$forum_id][$option] |= substr($this->acl['local'][$forum_id], $this->acl_options['local'][$option], 1);
}
}
return ( $this->founder ) ? true : $acl_cache[$forum_id][$option];
} }
// Cache data // Cache data
@ -522,28 +624,18 @@ class auth
{ {
global $db; global $db;
$sql = "SELECT a.forum_id, a.auth_allow_deny, ao.auth_option_id, ao.auth_value $acl_db = array();
$sql = "SELECT a.forum_id, a.auth_allow_deny, ao.auth_value
FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " ao, " . USER_GROUP_TABLE . " ug FROM " . ACL_GROUPS_TABLE . " a, " . ACL_OPTIONS_TABLE . " ao, " . USER_GROUP_TABLE . " ug
WHERE ug.user_id = " . $userdata['user_id'] . " WHERE ug.user_id = " . $userdata['user_id'] . "
AND a.group_id = ug.group_id AND a.group_id = ug.group_id
AND ao.auth_option_id = a.auth_option_id"; AND ao.auth_option_id = a.auth_option_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{ {
do $acl_db[] = $row;
{
switch ( $this->acl[$row['forum_id']][$row['auth_option_id']] )
{
case ACL_PERMIT:
case ACL_DENY:
case ACL_PREVENT:
break;
default:
$this->acl[$row['forum_id']][$row['auth_option_id']] = $row['auth_allow_deny'];
}
}
while ( $row = $db->sql_fetchrow($result) );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -553,33 +645,30 @@ class auth
AND ao.auth_option_id = a.auth_option_id"; AND ao.auth_option_id = a.auth_option_id";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
if ( $row = $db->sql_fetchrow($result) ) while ( $row = $db->sql_fetchrow($result) )
{ {
do $acl_db[] = $row;
{
switch ( $this->acl[$row['forum_id']][$row['auth_option_id']] )
{
case ACL_PERMIT:
case ACL_PREVENT:
break;
default:
$this->acl[$row['forum_id']][$row['auth_option_id']] = $row['auth_allow_deny'];
break;
}
}
while ( $row = $db->sql_fetchrow($result) );
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
if ( is_array($this->acl) ) if ( is_array($acl_db) )
{ {
sort($acl_db);
/* foreach ( $acl_db as $row )
{
if ( $row['auth_allow_deny'] != ACL_INHERIT && $this->acl[$row['forum_id']][$row['auth_value']] !== ACL_DENY )
{
$this->acl[$row['forum_id']][$row['auth_option_id']] = intval($row['auth_allow_deny']);
}
}
unset($acl_db);
foreach ( $this->acl as $forum_id => $auth_ary ) foreach ( $this->acl as $forum_id => $auth_ary )
{ {
$holding = array(); $holding = array();
for($i = 0; $i < 80; $i++) for($i = 0; $i < 80; $i++)
{ {
$allow = ( isset($this->acl[$forum_id][$i]) ) ? $this->acl[$forum_id][$i] : 0; $holding[] = ( isset($this->acl[$forum_id][$i]) ) ? $this->acl[$forum_id][$i] : 0;
$holding[] = ( $allow == ACL_ALLOW || $allow == ACL_PERMIT ) ? 1 : 0;
} }
$bitstring = explode("\r\n", chunk_split(str_pad(decbin($forum_id), 16, 0, STR_PAD_LEFT) . implode('', $holding), 8)); $bitstring = explode("\r\n", chunk_split(str_pad(decbin($forum_id), 16, 0, STR_PAD_LEFT) . implode('', $holding), 8));
@ -589,8 +678,75 @@ class auth
$userdata['user_permissions'] .= chr(bindec($byte)); $userdata['user_permissions'] .= chr(bindec($byte));
} }
} }
unset($holding);*/
foreach ( $acl_db as $row )
{
if ( $row['auth_allow_deny'] != ACL_INHERIT && $this->acl[$row['forum_id']][$row['auth_value']] !== ACL_DENY )
{
$this->acl[$row['forum_id']][$row['auth_value']] = intval($row['auth_allow_deny']);
}
}
unset($acl_db);
$global_bits = 8 * ceil(sizeof($this->acl_options['global']) / 8);
$local_bits = 8 * ceil(sizeof($this->acl_options['local']) / 8 );
$local_hold = '';
$global_hold = '';
foreach ( $this->acl as $forum_id => $auth_ary )
{
$holding = array();
if ( !$forum_id )
{
$fill = $global_bits;
$ary_key = 'global';
$hold_str = 'global_hold';
}
else
{
$fill = $local_bits;
$ary_key = 'local';
$hold_str = 'local_hold';
}
for($i = 0; $i < $fill; $i++)
{
$holding[$i] = 0;
}
foreach ( $auth_ary as $option => $allow )
{
if ( $allow )
{
$holding[$this->acl_options[$ary_key][$option]] = 1;
}
}
$forum_id = ( $forum_id ) ? str_pad(decbin($forum_id), 16, 0, STR_PAD_LEFT) : '';
$bitstring = explode("\r\n", chunk_split($forum_id . implode('', $holding), 8));
array_pop($bitstring);
foreach ( $bitstring as $byte )
{
$$hold_str .= chr(bindec($byte));
}
}
unset($holding); unset($holding);
if ( $global_hold == '' )
{
for($i = 0; $i < $global_bits; $i++)
{
$global_hold .= '0';
}
}
$userdata['user_permissions'] .= $global_hold . $local_hold;
unset($global_hold);
unset($local_hold);
$sql = "UPDATE " . USERS_TABLE . " $sql = "UPDATE " . USERS_TABLE . "
SET user_permissions = '" . addslashes($userdata['user_permissions']) . "' SET user_permissions = '" . addslashes($userdata['user_permissions']) . "'
WHERE user_id = " . $userdata['user_id']; WHERE user_id = " . $userdata['user_id'];
@ -625,7 +781,7 @@ class auth
} }
} }
message_die(ERROR, 'Authentication method not found'); trigger_error('Authentication method not found', E_USER_ERROR);
} }
} }

View file

@ -27,11 +27,11 @@ if ( !defined('IN_PHPBB') )
exit; exit;
} }
if ( empty($HTTP_GET_VARS['u']) || $HTTP_GET_VARS['u'] == ANONYMOUS ) if ( empty($_GET['u']) || $_GET['u'] == ANONYMOUS )
{ {
message_die(MESSAGE, $lang['No_user_id_specified']); message_die(MESSAGE, $user->lang['No_user_id_specified']);
} }
$profiledata = get_userdata(intval($HTTP_GET_VARS['u'])); $profiledata = get_userdata(intval($_GET['u']));
$sql = "SELECT * $sql = "SELECT *
FROM " . RANKS_TABLE . " FROM " . RANKS_TABLE . "
@ -117,8 +117,8 @@ if ( $profiledata['user_viewemail'] || $auth->acl_get('a_') )
{ {
$email_uri = ( $board_config['board_email_form'] ) ? "profile.$phpEx$SID&amp;mode=email&amp;u=" . $profiledata['user_id'] : 'mailto:' . $profiledata['user_email']; $email_uri = ( $board_config['board_email_form'] ) ? "profile.$phpEx$SID&amp;mode=email&amp;u=" . $profiledata['user_id'] : 'mailto:' . $profiledata['user_email'];
$email_img = '<a href="' . $email_uri . '">' . create_img($theme['icon_email'], $lang['Send_email']) . '</a>'; $email_img = '<a href="' . $email_uri . '">' . $user->img('icon_email', $user->lang['Send_email']) . '</a>';
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>'; $email = '<a href="' . $email_uri . '">' . $user->lang['Send_email'] . '</a>';
} }
else else
{ {
@ -127,21 +127,21 @@ else
} }
$temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id"; $temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id";
$profile_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_profile'], $lang['Read_profile']) . '</a>'; $profile_img = '<a href="' . $temp_url . '">' . $user->img('icon_profile', $user->lang['Read_profile']) . '</a>';
$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>'; $profile = '<a href="' . $temp_url . '">' . $user->lang['Read_profile'] . '</a>';
$temp_url = "privmsg.$phpEx$SID&amp;mode=post&amp;u=$user_id"; $temp_url = "privmsg.$phpEx$SID&amp;mode=post&amp;u=$user_id";
$pm_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_pm'], $lang['Send_private_message']) . '</a>'; $pm_img = '<a href="' . $temp_url . '">' . $user->img('icon_pm', $user->lang['Send_private_message']) . '</a>';
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>'; $pm = '<a href="' . $temp_url . '">' . $user->lang['Send_private_message'] . '</a>';
$www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . create_img($theme['icon_www'], $lang['Visit_website']) . '</a>' : ''; $www_img = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $user->img('icon_www', $user->lang['Visit_website']) . '</a>' : '';
$www = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : ''; $www = ( $profiledata['user_website'] ) ? '<a href="' . $profiledata['user_website'] . '" target="_userwww">' . $user->lang['Visit_website'] . '</a>' : '';
if ( !empty($profiledata['user_icq']) ) if ( !empty($profiledata['user_icq']) )
{ {
$icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>'; $icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
$icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '">' . create_img($theme['icon_icq'], $lang['ICQ']) . '</a>'; $icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '">' . $user->img('icon_icq', $user->lang['ICQ']) . '</a>';
$icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '">' . $lang['ICQ'] . '</a>'; $icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $profiledata['user_icq'] . '">' . $user->lang['ICQ'] . '</a>';
} }
else else
{ {
@ -150,36 +150,36 @@ else
$icq = ''; $icq = '';
} }
$aim_img = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&amp;message=Hello+Are+you+there?">' . create_img($theme['icon_aim'], $lang['AIM']) . '</a>' : ''; $aim_img = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $user->img('icon_aim', $user->lang['AIM']) . '</a>' : '';
$aim = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : ''; $aim = ( $profiledata['user_aim'] ) ? '<a href="aim:goim?screenname=' . $profiledata['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $user->lang['AIM'] . '</a>' : '';
$temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id"; $temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id";
$msn_img = ( $profiledata['user_msnm'] ) ? '<a href="' . $temp_url . '">' . create_img($theme['icon_msnm'], $lang['MSNM']) . '</a>' : ''; $msn_img = ( $profiledata['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $user->img('icon_msnm', $user->lang['MSNM']) . '</a>' : '';
$msn = ( $profiledata['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : ''; $msn = ( $profiledata['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $user->lang['MSNM'] . '</a>' : '';
$yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&amp;.src=pg">' . create_img($theme['icon_yim'], $lang['YIM']) . '</a>' : ''; $yim_img = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&amp;.src=pg">' . $user->img('icon_yim', $user->lang['YIM']) . '</a>' : '';
$yim = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&amp;.src=pg">' . $lang['YIM'] . '</a>' : ''; $yim = ( $profiledata['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $profiledata['user_yim'] . '&amp;.src=pg">' . $user->lang['YIM'] . '</a>' : '';
$temp_url = "search.$phpEx$SID&amp;search_author=" . urlencode($profiledata['username']) . "&amp;showresults=posts"; $temp_url = "search.$phpEx$SID&amp;search_author=" . urlencode($profiledata['username']) . "&amp;showresults=posts";
$search_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_search'], $lang['Search_user_posts']) . '</a>'; $search_img = '<a href="' . $temp_url . '">' . $user->img('icon_search', $user->lang['Search_user_posts']) . '</a>';
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>'; $search = '<a href="' . $temp_url . '">' . $user->lang['Search_user_posts'] . '</a>';
// //
// Generate page // Generate page
// //
$page_title = $lang['Viewing_profile']; $page_title = $user->lang['Viewing_profile'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->assign_vars(array( $template->assign_vars(array(
'USERNAME' => $profiledata['username'], 'USERNAME' => $profiledata['username'],
'JOINED' => $user->format_date($profiledata['user_regdate'], $lang['DATE_FORMAT']), 'JOINED' => $user->format_date($profiledata['user_regdate'], $user->lang['DATE_FORMAT']),
'POSTER_RANK' => $poster_rank, 'POSTER_RANK' => $poster_rank,
'RANK_IMAGE' => $rank_image, 'RANK_IMAGE' => $rank_image,
'POSTS_PER_DAY' => $posts_per_day, 'POSTS_PER_DAY' => $posts_per_day,
'POSTS' => $profiledata['user_posts'], 'POSTS' => $profiledata['user_posts'],
'PERCENTAGE' => $percentage . '%', 'PERCENTAGE' => $percentage . '%',
'POST_DAY_STATS' => sprintf($lang['User_post_day_stats'], $posts_per_day), 'POST_DAY_STATS' => sprintf($user->lang['User_post_day_stats'], $posts_per_day),
'POST_PERCENT_STATS' => sprintf($lang['User_post_pct_stats'], $percentage), 'POST_PERCENT_STATS' => sprintf($user->lang['User_post_pct_stats'], $percentage),
'SEARCH_IMG' => $search_img, 'SEARCH_IMG' => $search_img,
'SEARCH' => $search, 'SEARCH' => $search,
@ -204,25 +204,25 @@ $template->assign_vars(array(
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&nbsp;', 'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&nbsp;',
'AVATAR_IMG' => $avatar_img, 'AVATAR_IMG' => $avatar_img,
'L_VIEWING_PROFILE' => sprintf($lang['Viewing_user_profile'], $profiledata['username']), 'L_VIEWING_PROFILE' => sprintf($user->lang['Viewing_user_profile'], $profiledata['username']),
'L_ABOUT_USER' => sprintf($lang['About_user'], $profiledata['username']), 'L_ABOUT_USER' => sprintf($user->lang['About_user'], $profiledata['username']),
'L_AVATAR' => $lang['Avatar'], 'L_AVATAR' => $user->lang['Avatar'],
'L_POSTER_RANK' => $lang['Poster_rank'], 'L_POSTER_RANK' => $user->lang['Poster_rank'],
'L_JOINED' => $lang['Joined'], 'L_JOINED' => $user->lang['Joined'],
'L_TOTAL_POSTS' => $lang['Total_posts'], 'L_TOTAL_POSTS' => $user->lang['Total_posts'],
'L_SEARCH_USER_POSTS' => sprintf($lang['Search_user_posts'], $profiledata['username']), 'L_SEARCH_USER_POSTS' => sprintf($user->lang['Search_user_posts'], $profiledata['username']),
'L_CONTACT' => $lang['Contact'], 'L_CONTACT' => $user->lang['Contact'],
'L_EMAIL_ADDRESS' => $lang['Email_address'], 'L_EMAIL_ADDRESS' => $user->lang['Email_address'],
'L_EMAIL' => $lang['Email'], 'L_EMAIL' => $user->lang['Email'],
'L_PM' => $lang['Private_Message'], 'L_PM' => $user->lang['Private_Message'],
'L_ICQ_NUMBER' => $lang['ICQ'], 'L_ICQ_NUMBER' => $user->lang['ICQ'],
'L_YAHOO' => $lang['YIM'], 'L_YAHOO' => $user->lang['YIM'],
'L_AIM' => $lang['AIM'], 'L_AIM' => $user->lang['AIM'],
'L_MESSENGER' => $lang['MSNM'], 'L_MESSENGER' => $user->lang['MSNM'],
'L_WEBSITE' => $lang['Website'], 'L_WEBSITE' => $user->lang['Website'],
'L_LOCATION' => $lang['Location'], 'L_LOCATION' => $user->lang['Location'],
'L_OCCUPATION' => $lang['Occupation'], 'L_OCCUPATION' => $user->lang['Occupation'],
'L_INTERESTS' => $lang['Interests'], 'L_INTERESTS' => $user->lang['Interests'],
'U_SEARCH_USER' => "search.$phpEx$SID&amp;search_author=" . urlencode($profiledata['username']), 'U_SEARCH_USER' => "search.$phpEx$SID&amp;search_author=" . urlencode($profiledata['username']),

View file

@ -37,9 +37,9 @@ else
} }
// Start session management // Start session management
$userdata = $session->start(); $user->start();
$auth->acl($userdata); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management
// Handle marking posts // Handle marking posts
@ -54,14 +54,14 @@ if ($mark_read == 'forums')
'META' => '<meta http-equiv="refresh" content="3;url=' . "index.$phpEx$SID" . '">') 'META' => '<meta http-equiv="refresh" content="3;url=' . "index.$phpEx$SID" . '">')
); );
$message = $lang['Forums_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_index'], '<a href="' . "index.$phpEx$SID" . '">', '</a> '); $message = $user->lang['Forums_marked_read'] . '<br /><br />' . sprintf($user->lang['Click_return_index'], '<a href="' . "index.$phpEx$SID" . '">', '</a> ');
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
} }
// End handle marking posts // End handle marking posts
// Topic/forum marked read info // Topic/forum marked read info
$mark_topics = (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t'])) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t'])) : array(); $mark_topics = (isset($_COOKIE[$board_config['cookie_name'] . '_t'])) ? unserialize(stripslashes($_COOKIE[$board_config['cookie_name'] . '_t'])) : array();
$mark_forums = (isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f'])) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f'])) : array(); $mark_forums = (isset($_COOKIE[$board_config['cookie_name'] . '_f'])) ? unserialize(stripslashes($_COOKIE[$board_config['cookie_name'] . '_f'])) : array();
// Set some stats, get posts count from forums data if we... hum... retrieve all forums data // Set some stats, get posts count from forums data if we... hum... retrieve all forums data
$total_users = $board_config['num_users']; $total_users = $board_config['num_users'];
@ -70,15 +70,15 @@ $newest_uid = $board_config['newest_user_id'];
if ($total_users == 0) if ($total_users == 0)
{ {
$l_total_user_s = $lang['Registered_users_zero_total']; $l_total_user_s = $user->lang['Registered_users_zero_total'];
} }
else if ($total_users == 1) else if ($total_users == 1)
{ {
$l_total_user_s = $lang['Registered_user_total']; $l_total_user_s = $user->lang['Registered_user_total'];
} }
else else
{ {
$l_total_user_s = $lang['Registered_users_total']; $l_total_user_s = $user->lang['Registered_users_total'];
} }
// Forum moderators ... a static template var could allow us // Forum moderators ... a static template var could allow us
@ -117,7 +117,7 @@ else
if (!$auth->acl_get('f_list', $cat_id)) if (!$auth->acl_get('f_list', $cat_id))
{ {
// TODO: Deal with hidden categories // TODO: Deal with hidden categories
message_die(ERROR, $lang['Category_not_exist']); message_die(ERROR, $user->lang['Category_not_exist']);
} }
// NOTE: make sure that categories post count is set to 0 // NOTE: make sure that categories post count is set to 0
@ -205,44 +205,44 @@ include($phpbb_root_path . 'includes/forums_display.' . $phpEx);
if ($total_posts == 0) if ($total_posts == 0)
{ {
$l_total_post_s = $lang['Posted_articles_zero_total']; $l_total_post_s = $user->lang['Posted_articles_zero_total'];
} }
else if ($total_posts == 1) else if ($total_posts == 1)
{ {
$l_total_post_s = $lang['Posted_article_total']; $l_total_post_s = $user->lang['Posted_article_total'];
} }
else else
{ {
$l_total_post_s = $lang['Posted_articles_total']; $l_total_post_s = $user->lang['Posted_articles_total'];
} }
$template->assign_vars(array( $template->assign_vars(array(
'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts), 'TOTAL_POSTS' => sprintf($l_total_post_s, $total_posts),
'TOTAL_USERS' => sprintf($l_total_user_s, $total_users), 'TOTAL_USERS' => sprintf($l_total_user_s, $total_users),
'NEWEST_USER' => sprintf($lang['Newest_user'], '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $newest_uid . '">', $newest_user, '</a>'), 'NEWEST_USER' => sprintf($user->lang['Newest_user'], '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $newest_uid . '">', $newest_user, '</a>'),
'FORUM_IMG' => create_img($theme['forum'], $lang['No_new_posts']), 'FORUM_IMG' => $user->img('forum', $user->lang['No_new_posts']),
'FORUM_NEW_IMG' => create_img($theme['forum_new'], $lang['New_posts']), 'FORUM_NEW_IMG' => $user->img('forum_new', $user->lang['New_posts']),
'FORUM_LOCKED_IMG' => create_img($theme['forum_locked'], $lang['No_new_posts_locked']), 'FORUM_LOCKED_IMG' => $user->img('forum_locked', $user->lang['No_new_posts_locked']),
'L_FORUM' => $lang['Forum'], 'L_FORUM' => $user->lang['Forum'],
'L_TOPICS' => $lang['Topics'], 'L_TOPICS' => $user->lang['Topics'],
'L_REPLIES' => $lang['Replies'], 'L_REPLIES' => $user->lang['Replies'],
'L_VIEWS' => $lang['Views'], 'L_VIEWS' => $user->lang['Views'],
'L_POSTS' => $lang['Posts'], 'L_POSTS' => $user->lang['Posts'],
'L_LASTPOST' => $lang['Last_Post'], 'L_LASTPOST' => $user->lang['Last_Post'],
'L_MODERATORS' => $lang['Moderators'], 'L_MODERATORS' => $user->lang['Moderators'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'], 'L_NO_NEW_POSTS' => $user->lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'], 'L_NEW_POSTS' => $user->lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], 'L_NO_NEW_POSTS_LOCKED' => $user->lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], 'L_NEW_POSTS_LOCKED' => $user->lang['New_posts_locked'],
'L_ONLINE_EXPLAIN' => $lang['Online_explain'], 'L_ONLINE_EXPLAIN' => $user->lang['Online_explain'],
'L_VIEW_MODERATORS' => $lang['View_moderators'], 'L_VIEW_MODERATORS' => $user->lang['View_moderators'],
'L_FORUM_LOCKED' => $lang['Forum_is_locked'], 'L_FORUM_LOCKED' => $user->lang['Forum_is_locked'],
'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'], 'L_MARK_FORUMS_READ' => $user->lang['Mark_all_forums'],
'L_LEGEND' => $lang['Legend'], 'L_LEGEND' => $user->lang['Legend'],
'L_NO_FORUMS' => $lang['No_forums'], 'L_NO_FORUMS' => $user->lang['No_forums'],
'U_MARK_READ' => "index.$phpEx$SID&amp;mark=forums") 'U_MARK_READ' => "index.$phpEx$SID&amp;mark=forums")
); );
@ -265,7 +265,7 @@ foreach ($nav_forums as $row)
} }
// Start output of page // Start output of page
$page_title = $lang['Index']; $page_title = $user->lang['Index'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array( $template->set_filenames(array(

View file

@ -627,6 +627,7 @@ CREATE TABLE phpbb_users (
user_session_time int(11) DEFAULT '0' NOT NULL, user_session_time int(11) DEFAULT '0' NOT NULL,
user_session_page smallint(5) DEFAULT '0' NOT NULL, user_session_page smallint(5) DEFAULT '0' NOT NULL,
user_lastvisit int(11) DEFAULT '0' NOT NULL, user_lastvisit int(11) DEFAULT '0' NOT NULL,
user_startpage varchar(100) DEFAULT '',
user_colour varchar(6) DEFAULT '' NOT NULL, user_colour varchar(6) DEFAULT '' NOT NULL,
user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, user_posts mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
user_lang varchar(50), user_lang varchar(50),
@ -634,6 +635,7 @@ CREATE TABLE phpbb_users (
user_dst tinyint(1) DEFAULT '0' NOT NULL, user_dst tinyint(1) DEFAULT '0' NOT NULL,
user_dateformat varchar(15) DEFAULT 'd M Y H:i' NOT NULL, user_dateformat varchar(15) DEFAULT 'd M Y H:i' NOT NULL,
user_style tinyint(4), user_style tinyint(4),
user_rank int(11) DEFAULT '0',
user_new_privmsg smallint(5) UNSIGNED DEFAULT '0' NOT NULL, user_new_privmsg smallint(5) UNSIGNED DEFAULT '0' NOT NULL,
user_unread_privmsg smallint(5) UNSIGNED DEFAULT '0' NOT NULL, user_unread_privmsg smallint(5) UNSIGNED DEFAULT '0' NOT NULL,
user_last_privmsg int(11) DEFAULT '0' NOT NULL, user_last_privmsg int(11) DEFAULT '0' NOT NULL,
@ -651,12 +653,11 @@ CREATE TABLE phpbb_users (
user_allowsmile tinyint(1) DEFAULT '1', user_allowsmile tinyint(1) DEFAULT '1',
user_allowavatar tinyint(1) DEFAULT '1' NOT NULL, user_allowavatar tinyint(1) DEFAULT '1' NOT NULL,
user_allow_pm tinyint(1) DEFAULT '1' NOT NULL, user_allow_pm tinyint(1) DEFAULT '1' NOT NULL,
user_allow_viewonline tinyint(1) DEFAULT '1' NOT NULL,
user_allow_email tinyint(1) DEFAULT '1' NOT NULL, user_allow_email tinyint(1) DEFAULT '1' NOT NULL,
user_allow_viewonline tinyint(1) DEFAULT '1' NOT NULL,
user_notify tinyint(1) DEFAULT '1' NOT NULL, user_notify tinyint(1) DEFAULT '1' NOT NULL,
user_notify_pm tinyint(1) DEFAULT '1' NOT NULL, user_notify_pm tinyint(1) DEFAULT '1' NOT NULL,
user_popup_pm tinyint(1) DEFAULT '0' NOT NULL, user_popup_pm tinyint(1) DEFAULT '0' NOT NULL,
user_rank int(11) DEFAULT '0',
user_avatar char(100), user_avatar char(100),
user_avatar_type tinyint(4) DEFAULT '0' NOT NULL, user_avatar_type tinyint(4) DEFAULT '0' NOT NULL,
user_avatar_width tinyint(4) UNSIGNED, user_avatar_width tinyint(4) UNSIGNED,

View file

@ -19,7 +19,7 @@
* *
***************************************************************************/ ***************************************************************************/
$lang = array_merge($lang, array( $this->lang = array_merge($this->lang, array(
'Admin_title' => 'Administration Panel', 'Admin_title' => 'Administration Panel',
'No_admin' => 'You are not authorised to administer this board', 'No_admin' => 'You are not authorised to administer this board',
'No_frames' => 'Sorry, your browser does not support frames', 'No_frames' => 'Sorry, your browser does not support frames',
@ -166,14 +166,13 @@ $lang = array_merge($lang, array(
'Restore_Error_filename' => 'The file you uploaded had an unsupported extension.', 'Restore_Error_filename' => 'The file you uploaded had an unsupported extension.',
'Compress_unsupported' => 'The version of PHP installed on this server does not support the type of compression used for your backup. Please use a compression method listed on the previous page.', 'Compress_unsupported' => 'The version of PHP installed on this server does not support the type of compression used for your backup. Please use a compression method listed on the previous page.',
'Restore_Error_no_file' => 'No file was uploaded', 'Restore_Error_no_file' => 'No file was uploaded',
'Permissions_explain' => 'Here you can alter which users and groups can access which forums. Permissions can be set for individual operations such as; reading, posting, voting, etc via the <i>Advanced</i> form. This page only applies to forum permissions. To assign moderators or define administrators please use the appropriate page (see left hand side menu).', 'ACL_explain' => 'Permissions are based on an ALLOW / INHERIT / DENY system with all options being denied by default. The precedent is DENY &gt; ALLOW &gt; INHERIT for any combination of user or group settings. The INHERIT setting causes permissions granted elsewhere for the option being used in place of a specific ALLOW / DENY setting here.',
'Permissions_extra_explain' => 'Permissions are based on a; PERMIT, ALLOW, DENY, PREVENT system. By default users and groups are set to DENY access to all operations, to do anything users or groups have to be granted ALLOW access. When conflicts exist, e.g. a user having ALLOW permissions to a function belongs to a group that is set to DENY such a function the user setting takes precidence, i.e. in this case the user would be ALLOWed access to this function. Similarly a user denied access to a function will be denied even if they belong to a group that grants them access. If a user belongs to two groups one of which grants an ALLOW while another is set to DENY the user will be denied access.', 'Permissions_explain' => 'Here you can alter which users and groups can access which forums. To assign moderators or define administrators please use the appropriate page (see left hand side menu).',
'Permissions_extra2_explain' => 'There may be times when you want to deny (or allow) access to a group no matter what their individual user settings are, this is what PERMIT and PREVENT are for. By setting a user (or more likely a group) to one of these will PERMIT (ALLOW) or PREVENT (DENY) access to a function no matter what their user settings are. You may find this useful for things such as "banned" groups, etc. doing away with any need to check for individual user permissions.',
'Moderators' => 'Moderators', 'Moderators' => 'Moderators',
'Moderators_explain' => 'Here you can assign users and groups as forum moderators. You can give users or groups individual access to certain moderator functions as you set fit via the <i>Advanced</i> form. Moderators have additional power in a given forum and by default can post and reply even when a forum or topic is locked.', 'Moderators_explain' => 'Here you can assign users and groups as forum moderators. To assign users access to forums, to define super moderators or administrators please use the appropriate page (see left hand side menu).',
'Super_Moderators' => 'Super Moderators', 'Super_Moderators' => 'Super Moderators',
'Super_Moderators_explain' => 'Here you can assign users and groups as super moderators. Super Moderators are like ordinary moderators accept they have access to every forum on your board. You can give users or groups individual access to certain moderator functions as you set fit via the <i>Advanced</i> form. As with moderators, super moderators have additional power in a given forum and by default can post and reply even when a forum or topic is locked.', 'Super_Moderators_explain' => 'Here you can assign users and groups as super moderators. Super Moderators are like ordinary moderators accept they have access to every forum on your board. To assign users access to forums or define administrators please use the appropriate page (see left hand side menu).',
'Administrators_explain' => 'Here you can assign administrator rights to users or groups. All users with admin permissions can view the administration panel. However you can limit selected users or groups to only certain sections if you wish by clicking <i>Advanced</i>.', 'Administrators_explain' => 'Here you can assign administrator rights to users or groups. All users with admin permissions can view the administration panel.',
'Manage_users' => 'Manage Users', 'Manage_users' => 'Manage Users',
'Add_users' => 'Add Users', 'Add_users' => 'Add Users',
'Manage_groups' => 'Manage Groups', 'Manage_groups' => 'Manage Groups',
@ -190,12 +189,16 @@ $lang = array_merge($lang, array(
'Applies_to_Group' => 'Applies to Group ...', 'Applies_to_Group' => 'Applies to Group ...',
'User_can' => 'User can ... ', 'User_can' => 'User can ... ',
'Group_can' => 'Group can ... ', 'Group_can' => 'Group can ... ',
'User_can_admin' => 'User can admin ... ', 'Option' => 'Option',
'Group_can_admin' => 'Group can admin ... ',
'Allow' => 'Allow', 'Allow' => 'Allow',
'Permit' => 'Permit', 'Inherit' => 'Inherit',
'Deny' => 'Deny', 'Deny' => 'Deny',
'Prevent' => 'Prevent', 'Basic' => 'Basic',
'All_Allow' => 'All Allow',
'All_Deny' => 'All Deny',
'All_Inherit' => 'All Inherit',
'Inheritance' => 'Inheritance',
'Inheritance_explain' => 'Select the subforums you want to inherit these permissions',
'acl_a_general' => 'General Settings', 'acl_a_general' => 'General Settings',
'acl_a_user' => 'Users', 'acl_a_user' => 'Users',
'acl_a_group' => 'Groups', 'acl_a_group' => 'Groups',

View file

@ -19,7 +19,7 @@
* *
***************************************************************************/ ***************************************************************************/
$lang = array_merge($lang, array( $this->lang = array_merge($this->lang, array(
'ENCODING' => 'iso-8859-15', 'ENCODING' => 'iso-8859-15',
'DIRECTION' => 'ltr', 'DIRECTION' => 'ltr',
'LEFT' => 'left', 'LEFT' => 'left',
@ -72,6 +72,7 @@ $lang = array_merge($lang, array(
'Next' => 'Next', 'Next' => 'Next',
'Previous' => 'Previous', 'Previous' => 'Previous',
'Goto_page' => 'Goto page', 'Goto_page' => 'Goto page',
'Start_page' => 'Make my start page',
'Joined' => 'Joined', 'Joined' => 'Joined',
'IP_Address' => 'IP Address', 'IP_Address' => 'IP Address',
'Select_forum' => 'Select a forum', 'Select_forum' => 'Select a forum',

View file

@ -27,9 +27,9 @@ include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
// Set page ID for session management // Set page ID for session management
$userdata = $session->start(); $user->start();
$auth = new auth($userdata); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management
extract($_GET); extract($_GET);
@ -40,7 +40,7 @@ $redirect = (!empty($redirect)) ? $_SERVER['QUERY_STRING'] : '';
// Do the login/logout/form/whatever // Do the login/logout/form/whatever
if ( isset($login) || isset($logout) ) if ( isset($login) || isset($logout) )
{ {
if ( isset($login) && !$userdata['user_id'] ) if ( isset($login) && !$user->data['user_id'] )
{ {
$autologin = ( !empty($autologin) ) ? true : false; $autologin = ( !empty($autologin) ) ? true : false;
@ -62,9 +62,9 @@ if ( isset($login) || isset($logout) )
message_die(MESSAGE, $message); message_die(MESSAGE, $message);
} }
} }
else if ( $userdata['user_id'] ) else if ( $user->data['user_id'] )
{ {
$session->destroy($userdata); $session->destroy($user->data);
} }
// //
@ -74,7 +74,7 @@ if ( isset($login) || isset($logout) )
redirect($redirect_url); redirect($redirect_url);
} }
if ( !$userdata['user_id'] ) if ( !$user->data['user_id'] )
{ {
$template->assign_vars(array( $template->assign_vars(array(
'L_ENTER_PASSWORD' => $lang['Enter_password'], 'L_ENTER_PASSWORD' => $lang['Enter_password'],

View file

@ -25,9 +25,9 @@ include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
// Start session management // Start session management
$userdata = $session->start(); $user->start();
$auth->acl($userdata); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management
$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0; $start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;
@ -71,7 +71,7 @@ else
// //
// Memberlist sorting // Memberlist sorting
// //
$mode_types_text = array($lang['Sort_Joined'], $lang['Sort_Username'], $lang['Sort_Location'], $lang['Sort_Posts'], $lang['Sort_Email'], $lang['Sort_Website'], $lang['Sort_Top_Ten']); $mode_types_text = array($user->lang['Sort_Joined'], $user->lang['Sort_Username'], $user->lang['Sort_Location'], $user->lang['Sort_Posts'], $user->lang['Sort_Email'], $user->lang['Sort_Website'], $user->lang['Sort_Top_Ten']);
$mode_types = array('joindate', 'username', 'location', 'posts', 'email', 'website', 'topten'); $mode_types = array('joindate', 'username', 'location', 'posts', 'email', 'website', 'topten');
$select_sort_mode = '<select name="mode">'; $select_sort_mode = '<select name="mode">';
@ -83,7 +83,7 @@ for($i = 0; $i < count($mode_types_text); $i++)
$select_sort_mode .= '</select>'; $select_sort_mode .= '</select>';
$select_sort_order = '<select name="order">'; $select_sort_order = '<select name="order">';
$select_sort_order .= ( $sort_order == 'a' ) ? '<option value="a" selected="selected">' . $lang['Sort_Ascending'] . '</option><option value="d">' . $lang['Sort_Descending'] . '</option>' : '<option value="a">' . $lang['Sort_Ascending'] . '</option><option value="d" selected="selected">' . $lang['Sort_Descending'] . '</option>'; $select_sort_order .= ( $sort_order == 'a' ) ? '<option value="a" selected="selected">' . $user->lang['Sort_Ascending'] . '</option><option value="d">' . $user->lang['Sort_Descending'] . '</option>' : '<option value="a">' . $user->lang['Sort_Ascending'] . '</option><option value="d" selected="selected">' . $user->lang['Sort_Descending'] . '</option>';
$select_sort_order .= '</select>'; $select_sort_order .= '</select>';
if ( $mode != 'topten' || $board_config['topics_per_page'] < 10 ) if ( $mode != 'topten' || $board_config['topics_per_page'] < 10 )
@ -102,22 +102,22 @@ else
// //
$template->assign_vars(array( $template->assign_vars(array(
'PAGINATION' => $pagination, 'PAGINATION' => $pagination,
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_members / $board_config['topics_per_page'] )), 'PAGE_NUMBER' => sprintf($user->lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_members / $board_config['topics_per_page'] )),
'L_SELECT_SORT_METHOD' => $lang['Select_sort_method'], 'L_SELECT_SORT_METHOD' => $user->lang['Select_sort_method'],
'L_EMAIL' => $lang['Email'], 'L_EMAIL' => $user->lang['Email'],
'L_WEBSITE' => $lang['Website'], 'L_WEBSITE' => $user->lang['Website'],
'L_FROM' => $lang['Location'], 'L_FROM' => $user->lang['Location'],
'L_ORDER' => $lang['Order'], 'L_ORDER' => $user->lang['Order'],
'L_SORT' => $lang['Sort'], 'L_SORT' => $user->lang['Sort'],
'L_SUBMIT' => $lang['Sort'], 'L_SUBMIT' => $user->lang['Sort'],
'L_AIM' => $lang['AIM'], 'L_AIM' => $user->lang['AIM'],
'L_YIM' => $lang['YIM'], 'L_YIM' => $user->lang['YIM'],
'L_MSNM' => $lang['MSNM'], 'L_MSNM' => $user->lang['MSNM'],
'L_ICQ' => $lang['ICQ'], 'L_ICQ' => $user->lang['ICQ'],
'L_JOINED' => $lang['Joined'], 'L_JOINED' => $user->lang['Joined'],
'L_POSTS' => $lang['Posts'], 'L_POSTS' => $user->lang['Posts'],
'L_GOTO_PAGE' => $lang['Goto_page'], 'L_GOTO_PAGE' => $user->lang['Goto_page'],
'S_MODE_SELECT' => $select_sort_mode, 'S_MODE_SELECT' => $select_sort_mode,
'S_ORDER_SELECT' => $select_sort_order, 'S_ORDER_SELECT' => $select_sort_order,
@ -176,7 +176,7 @@ if ( $row = $db->sql_fetchrow($result) )
$user_id = $row['user_id']; $user_id = $row['user_id'];
$from = ( !empty($row['user_from']) ) ? $row['user_from'] : '&nbsp;'; $from = ( !empty($row['user_from']) ) ? $row['user_from'] : '&nbsp;';
$joined = $user->format_date($row['user_regdate'], $lang['DATE_FORMAT']); $joined = $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']);
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0; $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
$poster_avatar = ''; $poster_avatar = '';
@ -200,8 +200,8 @@ if ( $row = $db->sql_fetchrow($result) )
{ {
$email_uri = ( $board_config['board_email_form'] ) ? "profile.$phpEx$SID&amp;mode=email&amp;u=" . $user_id : 'mailto:' . $row['user_email']; $email_uri = ( $board_config['board_email_form'] ) ? "profile.$phpEx$SID&amp;mode=email&amp;u=" . $user_id : 'mailto:' . $row['user_email'];
$email_img = '<a href="' . $email_uri . '">' . create_img($theme['icon_email'], $lang['Send_email']) . '</a>'; $email_img = '<a href="' . $email_uri . '">' . $user->img('icon_email', $user->lang['Send_email']) . '</a>';
$email = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>'; $email = '<a href="' . $email_uri . '">' . $user->lang['Send_email'] . '</a>';
} }
else else
{ {
@ -210,21 +210,21 @@ if ( $row = $db->sql_fetchrow($result) )
} }
$temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id"; $temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id";
$profile_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_profile'], $lang['Read_profile']) . '</a>'; $profile_img = '<a href="' . $temp_url . '">' . $user->img('icon_profile', $user->lang['Read_profile']) . '</a>';
$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>'; $profile = '<a href="' . $temp_url . '">' . $user->lang['Read_profile'] . '</a>';
$temp_url = "privmsg.$phpEx$SID&amp;mode=post&amp;u=$user_id"; $temp_url = "privmsg.$phpEx$SID&amp;mode=post&amp;u=$user_id";
$pm_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_pm'], $lang['Send_private_message']) . '</a>'; $pm_img = '<a href="' . $temp_url . '">' . $user->img('icon_pm', $user->lang['Send_private_message']) . '</a>';
$pm = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>'; $pm = '<a href="' . $temp_url . '">' . $user->lang['Send_private_message'] . '</a>';
$www_img = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . create_img($theme['icon_www'], $lang['Visit_website']) . '</a>' : ''; $www_img = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $user->img('icon_www', $user->lang['Visit_website']) . '</a>' : '';
$www = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : ''; $www = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $user->lang['Visit_website'] . '</a>' : '';
if ( !empty($row['user_icq']) ) if ( !empty($row['user_icq']) )
{ {
$icq_status_img = '<a href="http://wwp.icq.com/' . $row['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>'; $icq_status_img = '<a href="http://wwp.icq.com/' . $row['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
$icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . create_img($theme['icon_icq'], $lang['ICQ']) . '</a>'; $icq_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $user->img('icon_icq', $user->lang['ICQ']) . '</a>';
$icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $lang['ICQ'] . '</a>'; $icq = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $user->lang['ICQ'] . '</a>';
} }
else else
{ {
@ -233,19 +233,19 @@ if ( $row = $db->sql_fetchrow($result) )
$icq = ''; $icq = '';
} }
$aim_img = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . create_img($theme['icon_aim'], $lang['AIM']) . '</a>' : ''; $aim_img = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $user->img('icon_aim', $user->lang['AIM']) . '</a>' : '';
$aim = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : ''; $aim = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $user->lang['AIM'] . '</a>' : '';
$temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id"; $temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id";
$msn_img = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . create_img($theme['icon_msnm'], $lang['MSNM']) . '</a>' : ''; $msn_img = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $user->img('icon_msnm', $user->lang['MSNM']) . '</a>' : '';
$msn = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : ''; $msn = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $user->lang['MSNM'] . '</a>' : '';
$yim_img = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . create_img($theme['icon_yim'], $lang['YIM']) . '</a>' : ''; $yim_img = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $user->img('icon_yim', $user->lang['YIM']) . '</a>' : '';
$yim = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $lang['YIM'] . '</a>' : ''; $yim = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $user->lang['YIM'] . '</a>' : '';
$temp_url = "search.$phpEx$SID&amp;search_author=" . urlencode($username) . "&amp;showresults=posts"; $temp_url = "search.$phpEx$SID&amp;search_author=" . urlencode($username) . "&amp;showresults=posts";
$search_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_search'], $lang['Search_user_posts']) . '</a>'; $search_img = '<a href="' . $temp_url . '">' . $user->img('icon_search', $user->lang['Search_user_posts']) . '</a>';
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>'; $search = '<a href="' . $temp_url . '">' . $user->lang['Search_user_posts'] . '</a>';
$template->assign_block_vars('memberrow', array( $template->assign_block_vars('memberrow', array(
'ROW_NUMBER' => $i + ( $start + 1 ), 'ROW_NUMBER' => $i + ( $start + 1 ),
@ -284,7 +284,7 @@ if ( $row = $db->sql_fetchrow($result) )
while ( $row = $db->sql_fetchrow($result) ); while ( $row = $db->sql_fetchrow($result) );
} }
$page_title = $lang['Memberlist']; $page_title = $user->lang['Memberlist'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array( $template->set_filenames(array(
@ -325,7 +325,7 @@ function username_search()
// //
// //
// //
$sort_by_types_text = array($lang['Sort_Username'], $lang['Sort_Email'], $lang['Sort_Post_count'], $lang['Sort_Joined'], $lang['Sort_Last_active']); $sort_by_types_text = array($user->lang['Sort_Username'], $user->lang['Sort_Email'], $user->lang['Sort_Post_count'], $user->lang['Sort_Joined'], $user->lang['Sort_Last_active']);
$s_sort_by = ''; $s_sort_by = '';
for($i = 0; $i < count($sort_by_types_text); $i++) for($i = 0; $i < count($sort_by_types_text); $i++)
{ {
@ -333,7 +333,7 @@ function username_search()
$s_sort_by .= '<option value="' . $i . '"' . $selected . '>' . $sort_by_types_text[$i] . '</option>'; $s_sort_by .= '<option value="' . $i . '"' . $selected . '>' . $sort_by_types_text[$i] . '</option>';
} }
$sort_order_text = array('a' => $lang['Ascending'], 'd' => $lang['Descending']); $sort_order_text = array('a' => $user->lang['Ascending'], 'd' => $user->lang['Descending']);
$s_sort_order = ''; $s_sort_order = '';
foreach ( $sort_order_text as $key => $value ) foreach ( $sort_order_text as $key => $value )
{ {
@ -341,7 +341,7 @@ function username_search()
$s_sort_order .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>'; $s_sort_order .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
} }
$find_count = array('lt' => $lang['Less_than'], 'eq' => $lang['Equal_to'], 'gt' => $lang['More_than']); $find_count = array('lt' => $user->lang['Less_than'], 'eq' => $user->lang['Equal_to'], 'gt' => $user->lang['More_than']);
$s_find_count = ''; $s_find_count = '';
foreach ( $find_count as $key => $value ) foreach ( $find_count as $key => $value )
{ {
@ -349,7 +349,7 @@ function username_search()
$s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>'; $s_find_count .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
} }
$find_time = array('lt' => $lang['Before'], 'gt' => $lang['After']); $find_time = array('lt' => $user->lang['Before'], 'gt' => $user->lang['After']);
$s_find_join_time = ''; $s_find_join_time = '';
foreach ( $find_time as $key => $value ) foreach ( $find_time as $key => $value )
{ {
@ -395,7 +395,7 @@ function username_search()
// //
// //
// //
$page_title = $lang['Search']; $page_title = $user->lang['Search'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array( $template->set_filenames(array(
@ -414,26 +414,26 @@ function username_search()
'COUNT' => $count, 'COUNT' => $count,
'PAGINATION' => $pagination, 'PAGINATION' => $pagination,
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_users / $board_config['topics_per_page'] )), 'PAGE_NUMBER' => sprintf($user->lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_users / $board_config['topics_per_page'] )),
'L_SEARCH_USERNAME' => $lang['Find_username'], 'L_SEARCH_USERNAME' => $user->lang['Find_username'],
'L_SEARCH_EXPLAIN' => $lang['Find_username_explain'], 'L_SEARCH_EXPLAIN' => $user->lang['Find_username_explain'],
'L_RESET' => $lang['Reset'], 'L_RESET' => $user->lang['Reset'],
'L_EMAIL' => $lang['Email'], 'L_EMAIL' => $user->lang['Email'],
'L_ICQ_NUMBER' => $lang['ICQ'], 'L_ICQ_NUMBER' => $user->lang['ICQ'],
'L_MESSENGER' => $lang['MSNM'], 'L_MESSENGER' => $user->lang['MSNM'],
'L_YAHOO' => $lang['YIM'], 'L_YAHOO' => $user->lang['YIM'],
'L_AIM' => $lang['AIM'], 'L_AIM' => $user->lang['AIM'],
'L_JOINED' => $lang['Joined'], 'L_JOINED' => $user->lang['Joined'],
'L_ACTIVE' => $lang['Last_active'], 'L_ACTIVE' => $user->lang['Last_active'],
'L_POSTS' => $lang['Posts'], 'L_POSTS' => $user->lang['Posts'],
'L_SORT_BY' => $lang['Sort_by'], 'L_SORT_BY' => $user->lang['Sort_by'],
'L_SORT_ASCENDING' => $lang['Sort_Ascending'], 'L_SORT_ASCENDING' => $user->lang['Sort_Ascending'],
'L_SORT_DESCENDING' => $lang['Sort_Descending'], 'L_SORT_DESCENDING' => $user->lang['Sort_Descending'],
'L_SELECT_MARKED' => $lang['Select_marked'], 'L_SELECT_MARKED' => $user->lang['Select_marked'],
'L_MARK' => $lang['Mark'], 'L_MARK' => $user->lang['Mark'],
'L_MARK_ALL' => $lang['Mark_all'], 'L_MARK_ALL' => $user->lang['Mark_all'],
'L_UNMARK_ALL' => $lang['Unmark_all'], 'L_UNMARK_ALL' => $user->lang['Unmark_all'],
'S_FORM_NAME' => $form, 'S_FORM_NAME' => $form,
'S_FIELD_NAME' => $field, 'S_FIELD_NAME' => $field,
@ -462,13 +462,13 @@ function username_search()
$username = $row['username']; $username = $row['username'];
$user_id = $row['user_id']; $user_id = $row['user_id'];
$joined = $user->format_date($row['user_regdate'], $lang['DATE_FORMAT']); $joined = $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']);
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0; $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
$active = ( !$row['user_lastvisit'] ) ? $lang['Never'] : $user->format_date($row['user_lastvisit'], $lang['DATE_FORMAT']); $active = ( !$row['user_lastvisit'] ) ? $user->lang['Never'] : $user->format_date($row['user_lastvisit'], $user->lang['DATE_FORMAT']);
$temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id"; $temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$user_id";
$profile_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_profile'], $lang['Read_profile']) . '</a>'; $profile_img = '<a href="' . $temp_url . '">' . $user->img('icon_profile', $user->lang['Read_profile']) . '</a>';
$profile = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>'; $profile = '<a href="' . $temp_url . '">' . $user->lang['Read_profile'] . '</a>';
$template->assign_block_vars('memberrow', array( $template->assign_block_vars('memberrow', array(
'ROW_NUMBER' => $i + ( $start + 1 ), 'ROW_NUMBER' => $i + ( $start + 1 ),

View file

@ -76,15 +76,13 @@ if ( isset($_POST['cancel']) )
$redirect = "index.$phpEx$SID"; $redirect = "index.$phpEx$SID";
} }
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect($redirect);
header($header_location . $redirect);
exit;
} }
// Start session management // Start session management
$userdata = $session->start(); $user->start();
$auth->acl($userdata, $forum_id); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management

View file

@ -24,49 +24,34 @@ $phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx); include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
// Grab all data
extract($_GET); extract($_GET);
extract($_POST); extract($_POST);
// Check and impose var types? // Some vars need their names changing and type imposing
$vars = array( $int_vars = array(
'intval' => array( 'f' => 'forum_id',
'forum_id' => 'f', 'p' => 'post_id',
'post_id' => 'p', 't' => 'topic_id',
'topic_id' => 't',
)
); );
foreach ( $vars as $vartype => $varcheck) foreach ( $int_vars as $in_var => $out_var)
{ {
foreach ( $varcheck as $varname => $varparse ) $$out_var = ( isset($$in_var) ) ? intval($$in_var) : false;
{
$$varname = ( isset($_POST[$varparse]) ) ? $vartype($_POST[$varparse]) : ( ( isset($_GET[$varparse]) ) ? $vartype($_GET[$varparse]) : false );
} }
}
$refresh = $preview || $poll_add || $poll_edit || $poll_delete;
// ------------------------------------------------
// NOTE --> No data validation at present! <-- NOTE
// ------------------------------------------------
// Start session management // Start session management
$userdata = $session->start(); $user->start();
$auth->acl($userdata, $f, array('f_post', 'f_edit', 'f_delete', 'f_attach', 'f_poll', 'f_img', 'f_flash', 'f_bbcode', 'f_html', 'f_smilies', 'f_vote', 'f_sticky', 'f_announce')); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management
// Was cancel pressed? If so then redirect to the appropriate page
// Was cancel pressed? If so then redirect to the appropriate
// page, no point in continuing with any further checks
if ( !empty($cancel) ) if ( !empty($cancel) )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
$redirect = ( $p ) ? "viewtopic.$phpEx$SID&p=$p#$p" : ( ( $t ) ? "viewtopic.$phpEx$SID&t=$t" : ( ( $f ) ? "viewforum.$phpEx$SID&f=$f" : "index.$phpEx$SID" ) ); $redirect = ( $p ) ? "viewtopic.$phpEx$SID&p=$p#$p" : ( ( $t ) ? "viewtopic.$phpEx$SID&t=$t" : ( ( $f ) ? "viewforum.$phpEx$SID&f=$f" : "index.$phpEx$SID" ) );
header($header_location . $redirect); redirect($redirect);
exit;
} }
@ -81,12 +66,12 @@ if ( !empty($cancel) )
switch ( $mode ) switch ( $mode )
{ {
case 'topicreview': case 'topicreview':
require($phpbb_root_path . 'includes/topic_review.'.$phpEx); // require($phpbb_root_path . 'includes/topic_review.'.$phpEx);
topic_review($t, false); // topic_review($t, false);
break; break;
case 'smilies': case 'smilies':
generate_smilies('window', PAGE_POSTING); generate_smilies('window');
break; break;
} }
@ -104,7 +89,7 @@ if ( !$board_config['allow_html'] )
} }
else else
{ {
$html_on = ( $post || $refresh ) ? ( ( !empty($disable_html) ) ? 0 : TRUE ) : ( ( !$userdata['user_id'] ) ? $board_config['allow_html'] : $userdata['user_allowhtml'] ); $html_on = ( $post || $refresh ) ? ( ( !empty($disable_html) ) ? 0 : TRUE ) : ( ( !$user->data['user_id'] ) ? $board_config['allow_html'] : $user->data['user_allowhtml'] );
} }
if ( !$board_config['allow_bbcode'] ) if ( !$board_config['allow_bbcode'] )
@ -113,7 +98,7 @@ if ( !$board_config['allow_bbcode'] )
} }
else else
{ {
$bbcode_on = ( $post || $refresh ) ? ( ( !empty($disable_bbcode) ) ? 0 : TRUE ) : ( ( !$userdata['user_id'] ) ? $board_config['allow_bbcode'] : $userdata['user_allowbbcode'] ); $bbcode_on = ( $post || $refresh ) ? ( ( !empty($disable_bbcode) ) ? 0 : TRUE ) : ( ( !$user->data['user_id'] ) ? $board_config['allow_bbcode'] : $user->data['user_allowbbcode'] );
} }
$magic_urls_on = ( $post || $refresh ) ? ( ( !empty($disable_magic_url) ) ? 0 : TRUE ) : TRUE; $magic_urls_on = ( $post || $refresh ) ? ( ( !empty($disable_magic_url) ) ? 0 : TRUE ) : TRUE;
@ -124,10 +109,10 @@ if ( !$board_config['allow_smilies'] )
} }
else else
{ {
$smilies_on = ( $post || $refresh ) ? ( ( !empty($disable_smilies) ) ? 0 : TRUE ) : ( ( !$userdata['user_id'] ) ? $board_config['allow_smilies'] : $userdata['user_allowsmile'] ); $smilies_on = ( $post || $refresh ) ? ( ( !empty($disable_smilies) ) ? 0 : TRUE ) : ( ( !$user->data['user_id'] ) ? $board_config['allow_smilies'] : $user->data['user_allowsmile'] );
} }
$attach_sig = ( $post || $refresh ) ? ( ( !empty($attach_sig) ) ? TRUE : 0 ) : ( ( !$userdata['user_id'] ) ? 0 : $userdata['user_attachsig'] ); $attach_sig = ( $post || $refresh ) ? ( ( !empty($attach_sig) ) ? TRUE : 0 ) : ( ( !$user->data['user_id'] ) ? 0 : $user->data['user_attachsig'] );
@ -139,24 +124,24 @@ switch ( $mode )
case 'newtopic': case 'newtopic':
if ( empty($f) ) if ( empty($f) )
{ {
message_die(MESSAGE, $lang['Forum_not_exist']); trigger($user->lang['Forum_not_exist']);
} }
$sql = "SELECT * $sql = "SELECT *
FROM " . FORUMS_TABLE . " FROM " . FORUMS_TABLE . "
WHERE forum_id = $f"; WHERE forum_id = $forum_id";
break; break;
case 'reply': case 'reply':
case 'vote': case 'vote':
if ( empty( $t) ) if ( empty( $t) )
{ {
message_die(MESSAGE, $lang['No_topic_id']); trigger($user->lang['No_topic_id']);
} }
$sql = "SELECT f.*, t.* $sql = "SELECT f.*, t.*
FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t
WHERE t.topic_id = $t WHERE t.topic_id = $topic_id
AND f.forum_id = t.forum_id"; AND f.forum_id = t.forum_id";
break; break;
@ -166,7 +151,7 @@ switch ( $mode )
case 'poll_delete': case 'poll_delete':
if ( empty($p) ) if ( empty($p) )
{ {
message_die(MESSAGE, $lang['No_post_id']); trigger($user->lang['No_post_id']);
} }
$select_sql = ( !$submit ) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig' : ', pt.post_subject, pt.post_text'; $select_sql = ( !$submit ) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig' : ', pt.post_subject, pt.post_text';
@ -182,20 +167,18 @@ switch ( $mode )
break; break;
default: default:
message_die(MESSAGE, $lang['No_valid_mode']); message_die(MESSAGE, $user->lang['No_valid_mode']);
} }
if ( $result = $db->sql_query($sql) ) $result = $db->sql_query($sql);
{
$post_info = $db->sql_fetchrow($result);
if ( $post_info = $db->sql_fetchrow($result) )
{
$forum_id = $post_info['forum_id']; $forum_id = $post_info['forum_id'];
$forum_name = $post_info['forum_name']; $forum_name = $post_info['forum_name'];
$topic_title = $post_info['topic_title']; $topic_title = $post_info['topic_title'];
$topic_id = $post_info['topic_id']; $topic_id = $post_info['topic_id'];
} }
@ -234,7 +217,8 @@ if ( isset($post) )
print_r($message); print_r($message);
echo "<br /><hr /><br />\n\n"; echo "<br /><hr /><br />\n\n";
$result = $search->add($p, $message, $post_subject, $post_info['post_text'], $post_info['post_subject']); // Fulltext parser
// $result = $search->add($p, $message, $post_subject, $post_info['post_text'], $post_info['post_subject']);
} }
exit; exit;
@ -251,16 +235,14 @@ $message = $post_info['post_text'];
// Remove encoded bbcode, urls, etc. // Remove encoded bbcode, urls, etc.
$match = array( $match = array(
'#<!\-\- b \-\-><b>(.*?)</b><!\-\- b \-\->#s', '#<!\-\- b \-\-><b>(.*?)</b><!\-\- b \-\->#s',
'#<!\-\- b \-\-><u>(.*?)</u><!\-\- b \-\->#s', '#<!\-\- u \-\-><u>(.*?)</u><!\-\- u \-\->#s',
'#\[b:([0-9a-z]+)\](.*?)\[/b:\1\]#s', '#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
'#<!\-\- b \-\-><a href="mailto:(.*?)">.*?</a><!\-\- b \-\->#', '#<!\-\- u \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- u \-\->#',
'#<!\-\- b \-\-><a href="(.*?)" target="_blank">.*?</a><!\-\- b \-\->#',
); );
$replace = array( $replace = array(
'[b]\1[/b]', '[b]\1[/b]',
'[u]\1[/u]', '[u]\1[/u]',
'[b]\2[/b]',
'\1', '\1',
'\1', '\1',
); );
@ -282,19 +264,19 @@ if ( $post || $refresh )
} }
else else
{ {
if ( $mode != 'newtopic' && $userdata['user_id'] ) if ( $mode != 'newtopic' && $user->data['user_id'] )
{ {
$sql = "SELECT topic_id $sql = "SELECT topic_id
FROM " . TOPICS_WATCH_TABLE . " FROM " . TOPICS_WATCH_TABLE . "
WHERE topic_id = $topic_id WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id']; AND user_id = " . $user->data['user_id'];
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$notify_user = ( $db->sql_fetchrow($result) ) ? TRUE : $userdata['user_notify']; $notify_user = ( $db->sql_fetchrow($result) ) ? TRUE : $user->data['user_notify'];
} }
else else
{ {
$notify_user = ( $user_id['user_id'] ) ? $userdata['user_notify'] : 0; $notify_user = ( $user_id['user_id'] ) ? $user->data['user_notify'] : 0;
} }
} }
@ -335,7 +317,7 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
{ {
$topic_type_toggle .= ' checked="checked"'; $topic_type_toggle .= ' checked="checked"';
} }
$topic_type_toggle .= ' /> ' . $lang['Post_Sticky'] . '&nbsp;&nbsp;'; $topic_type_toggle .= ' /> ' . $user->lang['Post_Sticky'] . '&nbsp;&nbsp;';
} }
if ( $auth->acl_get('f_announce', $forum_id) ) if ( $auth->acl_get('f_announce', $forum_id) )
@ -345,21 +327,21 @@ if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] )
{ {
$topic_type_toggle .= ' checked="checked"'; $topic_type_toggle .= ' checked="checked"';
} }
$topic_type_toggle .= ' /> ' . $lang['Post_Announcement'] . '&nbsp;&nbsp;'; $topic_type_toggle .= ' /> ' . $user->lang['Post_Announcement'] . '&nbsp;&nbsp;';
} }
if ( $topic_type_toggle != '' ) if ( $topic_type_toggle != '' )
{ {
$topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . '&nbsp;&nbsp;' . $topic_type_toggle; $topic_type_toggle = $user->lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $user->lang['Post_Normal'] . '&nbsp;&nbsp;' . $topic_type_toggle;
} }
} }
// HTML, BBCode, Smilies, Images and Flash status // HTML, BBCode, Smilies, Images and Flash status
$html_status = ( $board_config['allow_html'] && $auth->acl_get('f_html', $f) ) ? true : false; $html_status = ( $board_config['allow_html'] && $auth->acl_get('f_html', $forum_id) ) ? true : false;
$bbcode_status = ( $board_config['allow_bbcode'] && $auth->acl_get('f_bbcode', $f) ) ? true : false; $bbcode_status = ( $board_config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id) ) ? true : false;
$smilies_status = ( $board_config['allow_smilies'] && $auth->acl_get('f_smilies', $f) ) ? true : false; $smilies_status = ( $board_config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id) ) ? true : false;
$img_status = ( $board_config['allow_img'] && $auth->acl_get('f_img', $f) ) ? true : false; $img_status = ( $board_config['allow_img'] && $auth->acl_get('f_img', $forum_id) ) ? true : false;
$flash_status = ( $board_config['allow_flash'] && $auth->acl_get('f_flash', $f) ) ? true : false; $flash_status = ( $board_config['allow_flash'] && $auth->acl_get('f_flash', $forum_id) ) ? true : false;
// Page title/hidden fields // Page title/hidden fields
$s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />'; $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
@ -367,18 +349,18 @@ $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />';
switch( $mode ) switch( $mode )
{ {
case 'newtopic': case 'newtopic':
$page_title = $lang['Post_a_new_topic']; $page_title = $user->lang['Post_a_new_topic'];
$s_hidden_fields .= '<input type="hidden" name="f" value="' . $f . '" />'; $s_hidden_fields .= '<input type="hidden" name="f" value="' . $forum_id . '" />';
break; break;
case 'reply': case 'reply':
$page_title = $lang['Post_a_reply']; $page_title = $user->lang['Post_a_reply'];
$s_hidden_fields .= '<input type="hidden" name="t" value="' . $t . '" />'; $s_hidden_fields .= '<input type="hidden" name="t" value="' . $topic_id . '" />';
break; break;
case 'editpost': case 'editpost':
$page_title = $lang['Edit_Post']; $page_title = $user->lang['Edit_Post'];
$s_hidden_fields .= '<input type="hidden" name="p" value="' . $p . '" />'; $s_hidden_fields .= '<input type="hidden" name="p" value="' . $post_id . '" />';
break; break;
} }
@ -389,55 +371,55 @@ $template->assign_vars(array(
'USERNAME' => $username, 'USERNAME' => $username,
'SUBJECT' => $subject, 'SUBJECT' => $subject,
'MESSAGE' => $message, 'MESSAGE' => $message,
'HTML_STATUS' => ( $html_status ) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF'], 'HTML_STATUS' => ( $html_status ) ? $user->lang['HTML_is_ON'] : $user->lang['HTML_is_OFF'],
'BBCODE_STATUS' => ( $bbcode_status ) ? sprintf($lang['BBCode_is_ON'], '<a href="' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>') : sprintf($lang['BBCode_is_OFF'], '<a href="' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>'), 'BBCODE_STATUS' => ( $bbcode_status ) ? sprintf($user->lang['BBCode_is_ON'], '<a href="' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>') : sprintf($user->lang['BBCode_is_OFF'], '<a href="' . "faq.$phpEx$SID&amp;mode=bbcode" . '" target="_phpbbcode">', '</a>'),
'SMILIES_STATUS' => ( $smilies_status ) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'], 'SMILIES_STATUS' => ( $smilies_status ) ? $user->lang['Smilies_are_ON'] : $user->lang['Smilies_are_OFF'],
'IMG_STATUS' => ( $img_status ) ? $lang['Images_are_ON'] : $lang['Images_are_OFF'], 'IMG_STATUS' => ( $img_status ) ? $user->lang['Images_are_ON'] : $user->lang['Images_are_OFF'],
'FLASH_STATUS' => ( $flash_status ) ? $lang['Flash_is_ON'] : $lang['Flash_is_OFF'], 'FLASH_STATUS' => ( $flash_status ) ? $user->lang['Flash_is_ON'] : $user->lang['Flash_is_OFF'],
'L_POST_A' => $page_title, 'L_POST_A' => $page_title,
'L_POST_SUBJECT' => $lang['Post_subject'], 'L_POST_SUBJECT' => $user->lang['Post_subject'],
'L_VIEW_MODERATORS' => $lang['View_moderators'], 'L_VIEW_MODERATORS' => $user->lang['View_moderators'],
'L_TOPIC_ICON' => $lang['Topic_icon'], 'L_TOPIC_ICON' => $user->lang['Topic_icon'],
'L_SUBJECT' => $lang['Subject'], 'L_SUBJECT' => $user->lang['Subject'],
'L_MESSAGE_BODY' => $lang['Message_body'], 'L_MESSAGE_BODY' => $user->lang['Message_body'],
'L_OPTIONS' => $lang['Options'], 'L_OPTIONS' => $user->lang['Options'],
'L_PREVIEW' => $lang['Preview'], 'L_PREVIEW' => $user->lang['Preview'],
'L_SPELLCHECK' => $lang['Spellcheck'], 'L_SPELLCHECK' => $user->lang['Spellcheck'],
'L_SUBMIT' => $lang['Submit'], 'L_SUBMIT' => $user->lang['Submit'],
'L_SAVE' => $lang['Save'], 'L_SAVE' => $user->lang['Save'],
'L_CANCEL' => $lang['Cancel'], 'L_CANCEL' => $user->lang['Cancel'],
'L_CONFIRM_DELETE' => $lang['Confirm_delete'], 'L_CONFIRM_DELETE' => $user->lang['Confirm_delete'],
'L_DISABLE_HTML' => $lang['Disable_HTML_post'], 'L_DISABLE_HTML' => $user->lang['Disable_HTML_post'],
'L_DISABLE_BBCODE' => $lang['Disable_BBCode_post'], 'L_DISABLE_BBCODE' => $user->lang['Disable_BBCode_post'],
'L_DISABLE_SMILIES' => $lang['Disable_Smilies_post'], 'L_DISABLE_SMILIES' => $user->lang['Disable_Smilies_post'],
'L_DISABLE_MAGIC_URL' => $lang['Disable_magic_url'], 'L_DISABLE_MAGIC_URL' => $user->lang['Disable_magic_url'],
'L_ATTACH_SIGNATURE' => $lang['Attach_signature'], 'L_ATTACH_SIGNATURE' => $user->lang['Attach_signature'],
'L_NOTIFY_ON_REPLY' => $lang['Notify'], 'L_NOTIFY_ON_REPLY' => $user->lang['Notify'],
'L_DELETE_POST' => $lang['Delete_post'], 'L_DELETE_POST' => $user->lang['Delete_post'],
'L_NONE' => $lang['None'], 'L_NONE' => $user->lang['None'],
'L_EMPTY_MESSAGE' => $lang['Empty_message'], 'L_EMPTY_MESSAGE' => $user->lang['Empty_message'],
'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], 'L_BBCODE_CLOSE_TAGS' => $user->lang['Close_Tags'],
'L_STYLES_TIP' => $lang['Styles_tip'], 'L_STYLES_TIP' => $user->lang['Styles_tip'],
'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], 'L_BBCODE_B_HELP' => $user->lang['bbcode_b_help'],
'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], 'L_BBCODE_I_HELP' => $user->lang['bbcode_i_help'],
'L_BBCODE_U_HELP' => $lang['bbcode_u_help'], 'L_BBCODE_U_HELP' => $user->lang['bbcode_u_help'],
'L_BBCODE_Q_HELP' => $lang['bbcode_q_help'], 'L_BBCODE_Q_HELP' => $user->lang['bbcode_q_help'],
'L_BBCODE_C_HELP' => $lang['bbcode_c_help'], 'L_BBCODE_C_HELP' => $user->lang['bbcode_c_help'],
'L_BBCODE_L_HELP' => $lang['bbcode_l_help'], 'L_BBCODE_L_HELP' => $user->lang['bbcode_l_help'],
'L_BBCODE_O_HELP' => $lang['bbcode_o_help'], 'L_BBCODE_O_HELP' => $user->lang['bbcode_o_help'],
'L_BBCODE_P_HELP' => $lang['bbcode_p_help'], 'L_BBCODE_P_HELP' => $user->lang['bbcode_p_help'],
'L_BBCODE_W_HELP' => $lang['bbcode_w_help'], 'L_BBCODE_W_HELP' => $user->lang['bbcode_w_help'],
'L_BBCODE_A_HELP' => $lang['bbcode_a_help'], 'L_BBCODE_A_HELP' => $user->lang['bbcode_a_help'],
'L_BBCODE_S_HELP' => $lang['bbcode_s_help'], 'L_BBCODE_S_HELP' => $user->lang['bbcode_s_help'],
'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], 'L_BBCODE_F_HELP' => $user->lang['bbcode_f_help'],
'L_FONT_COLOR' => $lang['Font_color'], 'L_FONT_COLOR' => $user->lang['Font_color'],
'L_FONT_SIZE' => $lang['Font_size'], 'L_FONT_SIZE' => $user->lang['Font_size'],
'L_FONT_TINY' => $lang['font_tiny'], 'L_FONT_TINY' => $user->lang['font_tiny'],
'L_FONT_SMALL' => $lang['font_small'], 'L_FONT_SMALL' => $user->lang['font_small'],
'L_FONT_NORMAL' => $lang['font_normal'], 'L_FONT_NORMAL' => $user->lang['font_normal'],
'L_FONT_LARGE' => $lang['font_large'], 'L_FONT_LARGE' => $user->lang['font_large'],
'L_FONT_HUGE' => $lang['font_huge'], 'L_FONT_HUGE' => $user->lang['font_huge'],
'U_VIEW_FORUM' => "viewforum.$phpEx$SID&amp;f=$forum_id", 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&amp;f=$forum_id",
'U_VIEWTOPIC' => ( $mode != 'newtopic' ) ? "viewtopic.$phpEx$SID&amp;t=$topic_id" : '', 'U_VIEWTOPIC' => ( $mode != 'newtopic' ) ? "viewtopic.$phpEx$SID&amp;t=$topic_id" : '',
@ -451,15 +433,15 @@ $template->assign_vars(array(
'S_MAGIC_URL_CHECKED' => ( !$magic_urls_on ) ? 'checked="checked"' : '', 'S_MAGIC_URL_CHECKED' => ( !$magic_urls_on ) ? 'checked="checked"' : '',
'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '', 'S_SIGNATURE_CHECKED' => ( $attach_sig ) ? 'checked="checked"' : '',
'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '', 'S_NOTIFY_CHECKED' => ( $notify_user ) ? 'checked="checked"' : '',
'S_DISPLAY_USERNAME' => ( !$userdata['user_id'] || ( $mode == 'editpost' && $post_info['post_username'] ) ) ? true : false, 'S_DISPLAY_USERNAME' => ( !$user->data['user_id'] || ( $mode == 'editpost' && $post_info['post_username'] ) ) ? true : false,
'S_SAVE_ALLOWED' => ( $auth->acl_get('f_save', $f) ) ? true : false, 'S_SAVE_ALLOWED' => ( $auth->acl_get('f_save', $forum_id) ) ? true : false,
'S_HTML_ALLOWED' => $html_status, 'S_HTML_ALLOWED' => $html_status,
'S_BBCODE_ALLOWED' => $bbcode_status, 'S_BBCODE_ALLOWED' => $bbcode_status,
'S_SMILIES_ALLOWED' => $smilies_status, 'S_SMILIES_ALLOWED' => $smilies_status,
'S_SIG_ALLOWED' => ( $auth->acl_get('f_sigs', $f) ) ? true : false, 'S_SIG_ALLOWED' => ( $auth->acl_get('f_sigs', $forum_id) ) ? true : false,
'S_NOTIFY_ALLOWED' => ( $userdata['user_id'] ) ? true : false, 'S_NOTIFY_ALLOWED' => ( $user->data['user_id'] ) ? true : false,
'S_DELETE_ALLOWED' => ( $mode == 'editpost' && ( ( $auth->acl_get('f_delete', $f) && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $auth->acl_is_mod($f) ) ) ? true : false, 'S_DELETE_ALLOWED' => ( $mode == 'editpost' && ( ( $auth->acl_get('f_delete', $forum_id) && $post_data['last_post'] && ( !$post_data['has_poll'] || $post_data['edit_poll'] ) ) || $auth->acl_get('m_', $forum_id) ) ) ? true : false,
'S_TYPE_TOGGLE' => $topic_type_toggle, 'S_TYPE_TOGGLE' => $topic_type_toggle,
'S_TOPIC_ID' => $t, 'S_TOPIC_ID' => $t,
@ -467,26 +449,24 @@ $template->assign_vars(array(
'S_HIDDEN_FIELDS' => $s_hidden_fields) 'S_HIDDEN_FIELDS' => $s_hidden_fields)
); );
//
// Poll entry // Poll entry
// if ( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) ) && $auth->acl_get('f_poll', $forum_id) )
if ( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) ) && $auth->acl_get('f_poll', $f) )
{ {
$template->assign_vars(array( $template->assign_vars(array(
'S_SHOW_POLL_BOX' => true, 'S_SHOW_POLL_BOX' => true,
'S_POLL_DELETE' => ( $mode == 'editpost' && $post_data['edit_poll'] ) ? true : false, 'S_POLL_DELETE' => ( $mode == 'editpost' && $post_data['edit_poll'] ) ? true : false,
'L_ADD_A_POLL' => $lang['Add_poll'], 'L_ADD_A_POLL' => $user->lang['Add_poll'],
'L_ADD_POLL_EXPLAIN' => $lang['Add_poll_explain'], 'L_ADD_POLL_EXPLAIN' => $user->lang['Add_poll_explain'],
'L_POLL_QUESTION' => $lang['Poll_question'], 'L_POLL_QUESTION' => $user->lang['Poll_question'],
'L_POLL_OPTION' => $lang['Poll_option'], 'L_POLL_OPTION' => $user->lang['Poll_option'],
'L_ADD_OPTION' => $lang['Add_option'], 'L_ADD_OPTION' => $user->lang['Add_option'],
'L_UPDATE_OPTION' => $lang['Update'], 'L_UPDATE_OPTION' => $user->lang['Update'],
'L_DELETE_OPTION' => $lang['Delete'], 'L_DELETE_OPTION' => $user->lang['Delete'],
'L_POLL_LENGTH' => $lang['Poll_for'], 'L_POLL_LENGTH' => $user->lang['Poll_for'],
'L_DAYS' => $lang['Days'], 'L_DAYS' => $user->lang['Days'],
'L_POLL_LENGTH_EXPLAIN' => $lang['Poll_for_explain'], 'L_POLL_LENGTH_EXPLAIN' => $user->lang['Poll_for_explain'],
'L_POLL_DELETE' => $lang['Delete_poll'], 'L_POLL_DELETE' => $user->lang['Delete_poll'],
'POLL_TITLE' => $poll_title, 'POLL_TITLE' => $poll_title,
'POLL_LENGTH' => $poll_length) 'POLL_LENGTH' => $poll_length)
@ -506,16 +486,16 @@ if ( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post']
} }
// Attachment entry // Attachment entry
if ( $auth->acl_get('f_attach', $f) ) if ( $auth->acl_get('f_attach', $forum_id) )
{ {
$template->assign_vars(array( $template->assign_vars(array(
'S_SHOW_ATTACH_BOX' => true, 'S_SHOW_ATTACH_BOX' => true,
'L_ADD_ATTACHMENT' => $lang['Add_attach'], 'L_ADD_ATTACHMENT' => $user->lang['Add_attach'],
'L_ADD_ATTACHMENT_EXPLAIN' => $lang['Add_attach_explain'], 'L_ADD_ATTACHMENT_EXPLAIN' => $user->lang['Add_attach_explain'],
'L_ADD_FILE' => $lang['Add_file'], 'L_ADD_FILE' => $user->lang['Add_file'],
'L_FILE_NAME' => $lang['Filename'], 'L_FILE_NAME' => $user->lang['Filename'],
'L_FILE_COMMENT' => $lang['File_comment'],) 'L_FILE_COMMENT' => $user->lang['File_comment'],)
); );
} }

View file

@ -73,15 +73,13 @@ else
// //
if ( $cancel ) if ( $cancel )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect("privmsg.$phpEx$SIDfolder=$folder");
header($header_location . "privmsg.$phpEx$SIDfolder=$folder");
exit;
} }
// Start session management // Start session management
$userdata = $session->start(); $user->start();
$auth->acl($userdata); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management
// //

View file

@ -26,9 +26,9 @@ include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
// Start session management // Start session management
$userdata = $session->start(); $user->start();
$auth->acl($userdata); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management
// Set default email variables // Set default email variables
@ -76,17 +76,13 @@ if ( isset($_GET['mode']) || isset($_POST['mode']) )
} }
else if ( $mode == 'editprofile' || $mode == 'register' ) else if ( $mode == 'editprofile' || $mode == 'register' )
{ {
if ( !$userdata['user_id'] && $mode == 'editprofile' ) if ( !$user->data['user_id'] && $mode == 'editprofile' )
{ {
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; redirect("login.$phpEx$SID&redirect=profile.$phpEx&mode=editprofile");
header($header_location . "login.$phpEx$SID&redirect=profile.$phpEx&mode=editprofile");
exit;
} }
else if ( $userdata['user_id'] && $mode == 'register' ) else if ( $user->data['user_id'] && $mode == 'register' )
{ {
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; redirect("index.$phpEx$SID");
header($header_location . "index.$phpEx$SID");
exit;
} }
include($phpbb_root_path . 'includes/usercp_register.'.$phpEx); include($phpbb_root_path . 'includes/usercp_register.'.$phpEx);
@ -110,9 +106,7 @@ if ( isset($_GET['mode']) || isset($_POST['mode']) )
} }
else else
{ {
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; redirect("index.$phpEx$SID");
header($header_location . "index.$phpEx$SID");
exit;
} }
?> ?>

View file

@ -27,9 +27,9 @@ include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx); include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
// Start session management // Start session management
$userdata = $session->start(); $user->start();
$auth->acl($userdata); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management
// Define initial vars // Define initial vars
@ -109,7 +109,7 @@ else
$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0; $start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;
$sort_by_types = array($lang['Sort_Time'], $lang['Sort_Post_Subject'], $lang['Sort_Topic_Title'], $lang['Sort_Author'], $lang['Sort_Forum']); $sort_by_types = array($user->lang['Sort_Time'], $user->lang['Sort_Post_Subject'], $user->lang['Sort_Topic_Title'], $user->lang['Sort_Author'], $user->lang['Sort_Forum']);
// //
// Begin core code // Begin core code
@ -127,11 +127,11 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
{ {
if ( $search_id == 'newposts' ) if ( $search_id == 'newposts' )
{ {
if ( $userdata['user_id'] ) if ( $user->data['user_id'] )
{ {
$sql = "SELECT post_id $sql = "SELECT post_id
FROM " . POSTS_TABLE . " FROM " . POSTS_TABLE . "
WHERE post_time >= " . $userdata['session_last_visit']; WHERE post_time >= " . $user->data['session_last_visit'];
} }
else else
{ {
@ -145,11 +145,11 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
} }
else if ( $search_id == 'egosearch' ) else if ( $search_id == 'egosearch' )
{ {
if ( $userdata['session_logged_in'] ) if ( $user->data['session_logged_in'] )
{ {
$sql = "SELECT post_id $sql = "SELECT post_id
FROM " . POSTS_TABLE . " FROM " . POSTS_TABLE . "
WHERE poster_id = " . $userdata['user_id'];; WHERE poster_id = " . $user->data['user_id'];;
} }
else else
{ {
@ -181,7 +181,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
} }
else else
{ {
message_die(MESSAGE, $lang['No_search_match']); message_die(MESSAGE, $user->lang['No_search_match']);
} }
$sql = "SELECT post_id $sql = "SELECT post_id
@ -319,7 +319,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
{ {
if ( !$auth->acl_get($search_forum, 'forum', 'read') ) if ( !$auth->acl_get($search_forum, 'forum', 'read') )
{ {
message_die(MESSAGE, $lang['No_searchable_forums']); message_die(MESSAGE, $user->lang['No_searchable_forums']);
} }
// $auth_sql = "f.forum_id = $search_forum"; // $auth_sql = "f.forum_id = $search_forum";
@ -494,7 +494,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
} }
else else
{ {
message_die(MESSAGE, $lang['No_search_match']); message_die(MESSAGE, $user->lang['No_search_match']);
} }
// //
@ -546,11 +546,11 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
$sql = "UPDATE " . SEARCH_TABLE . " $sql = "UPDATE " . SEARCH_TABLE . "
SET search_id = $search_id, search_array = '$result_array' SET search_id = $search_id, search_array = '$result_array'
WHERE session_id = '" . $userdata['session_id'] . "'"; WHERE session_id = '" . $user->data['session_id'] . "'";
if ( !($result = $db->sql_query($sql)) || !$db->sql_affectedrows() ) if ( !($result = $db->sql_query($sql)) || !$db->sql_affectedrows() )
{ {
$sql = "INSERT INTO " . SEARCH_TABLE . " (search_id, session_id, search_array) $sql = "INSERT INTO " . SEARCH_TABLE . " (search_id, session_id, search_array)
VALUES($search_id, '" . $userdata['session_id'] . "', '" . str_replace("\'", "''", $result_array) . "')"; VALUES($search_id, '" . $user->data['session_id'] . "', '" . str_replace("\'", "''", $result_array) . "')";
if ( !($result = $db->sql_query($sql)) ) if ( !($result = $db->sql_query($sql)) )
{ {
message_die(ERROR, 'Could not insert search results', '', __LINE__, __FILE__, $sql); message_die(ERROR, 'Could not insert search results', '', __LINE__, __FILE__, $sql);
@ -564,7 +564,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
$sql = "SELECT search_array $sql = "SELECT search_array
FROM " . SEARCH_TABLE . " FROM " . SEARCH_TABLE . "
WHERE search_id = $search_id WHERE search_id = $search_id
AND session_id = '". $userdata['session_id'] . "'"; AND session_id = '". $user->data['session_id'] . "'";
if ( !($result = $db->sql_query($sql)) ) if ( !($result = $db->sql_query($sql)) )
{ {
message_die(ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql); message_die(ERROR, 'Could not obtain search results', '', __LINE__, __FILE__, $sql);
@ -655,11 +655,11 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
// Output header // Output header
// //
$l_search_matches = ( $total_match_count == 1 ) ? sprintf($lang['Found_search_match'], $total_match_count) : sprintf($lang['Found_search_matches'], $total_match_count); $l_search_matches = ( $total_match_count == 1 ) ? sprintf($user->lang['Found_search_match'], $total_match_count) : sprintf($user->lang['Found_search_matches'], $total_match_count);
$template->assign_vars(array( $template->assign_vars(array(
'L_SEARCH_MATCHES' => $l_search_matches, 'L_SEARCH_MATCHES' => $l_search_matches,
'L_TOPIC' => $lang['Topic']) 'L_TOPIC' => $user->lang['Topic'])
); );
$highlight_active = ''; $highlight_active = '';
@ -688,8 +688,8 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
$highlight_active = urlencode(trim($highlight_active)); $highlight_active = urlencode(trim($highlight_active));
$tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array(); $tracking_topics = ( isset($_COOKIE[$board_config['cookie_name'] . '_t']) ) ? unserialize($_COOKIE[$board_config['cookie_name'] . '_t']) : array();
$tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array(); $tracking_forums = ( isset($_COOKIE[$board_config['cookie_name'] . '_f']) ) ? unserialize($_COOKIE[$board_config['cookie_name'] . '_f']) : array();
for($i = 0; $i < count($searchset); $i++) for($i = 0; $i < count($searchset); $i++)
{ {
@ -697,7 +697,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
$topic_url = "viewtopic.$phpEx$SID&amp;t=" . $searchset[$i]['topic_id'] . "&amp;highlight=$highlight_active"; $topic_url = "viewtopic.$phpEx$SID&amp;t=" . $searchset[$i]['topic_id'] . "&amp;highlight=$highlight_active";
$post_url = "viewtopic.$phpEx$SID&amp;p=" . $searchset[$i]['post_id'] . "&amp;highlight=$highlight_active" . '#' . $searchset[$i]['post_id']; $post_url = "viewtopic.$phpEx$SID&amp;p=" . $searchset[$i]['post_id'] . "&amp;highlight=$highlight_active" . '#' . $searchset[$i]['post_id'];
$post_date = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']); $post_date = $user->format_date($searchset[$i]['post_time']);
$message = $searchset[$i]['post_text']; $message = $searchset[$i]['post_text'];
$topic_title = $searchset[$i]['topic_title']; $topic_title = $searchset[$i]['topic_title'];
@ -842,10 +842,10 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
} }
$poster = ( !$searchset[$i]['user_id'] ) ? '<a href="' . "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $searchset[$i]['user_id'] . '">' : ''; $poster = ( !$searchset[$i]['user_id'] ) ? '<a href="' . "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $searchset[$i]['user_id'] . '">' : '';
$poster .= ( $searchset[$i]['user_id'] ) ? $searchset[$i]['username'] : ( ( $searchset[$i]['post_username'] != "" ) ? $searchset[$i]['post_username'] : $lang['Guest'] ); $poster .= ( $searchset[$i]['user_id'] ) ? $searchset[$i]['username'] : ( ( $searchset[$i]['post_username'] != "" ) ? $searchset[$i]['post_username'] : $user->lang['Guest'] );
$poster .= ( $searchset[$i]['user_id'] ) ? '</a>' : ''; $poster .= ( $searchset[$i]['user_id'] ) ? '</a>' : '';
if ( $userdata['session_logged_in'] && $searchset[$i]['post_time'] > $userdata['session_last_visit'] ) if ( $user->data['session_logged_in'] && $searchset[$i]['post_time'] > $user->data['session_last_visit'] )
{ {
if ( !empty($tracking_topics[$topic_id]) && !empty($tracking_forums[$forum_id]) ) if ( !empty($tracking_topics[$topic_id]) && !empty($tracking_forums[$forum_id]) )
{ {
@ -858,19 +858,19 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
if ( $searchset[$i]['post_time'] > $topic_last_read ) if ( $searchset[$i]['post_time'] > $topic_last_read )
{ {
$mini_post_img = $images['icon_minipost_new']; $mini_post_img = 'goto_post_newest';
$mini_post_alt = $lang['New_post']; $mini_post_alt = $user->lang['New_post'];
} }
else else
{ {
$mini_post_img = $images['icon_minipost']; $mini_post_img = 'goto_post';
$mini_post_alt = $lang['Post']; $mini_post_alt = $user->lang['Post'];
} }
} }
else else
{ {
$mini_post_img = $images['icon_minipost']; $mini_post_img = 'goto_post';
$mini_post_alt = $lang['Post']; $mini_post_alt = $user->lang['Post'];
} }
$template->assign_block_vars("searchresults", array( $template->assign_block_vars("searchresults", array(
@ -882,9 +882,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
'TOPIC_REPLIES' => $searchset[$i]['topic_replies'], 'TOPIC_REPLIES' => $searchset[$i]['topic_replies'],
'TOPIC_VIEWS' => $searchset[$i]['topic_views'], 'TOPIC_VIEWS' => $searchset[$i]['topic_views'],
'MESSAGE' => $message, 'MESSAGE' => $message,
'MINI_POST_IMG' => $mini_post_img, 'MINI_POST_IMG' => $user->img($mini_post_img, $mini_post_alt),
'L_MINI_POST_ALT' => $mini_post_alt,
'U_POST' => $post_url, 'U_POST' => $post_url,
'U_TOPIC' => $topic_url, 'U_TOPIC' => $topic_url,
@ -904,11 +902,11 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
if ($topic_type == POST_ANNOUNCE) if ($topic_type == POST_ANNOUNCE)
{ {
$topic_type = $lang['Topic_Announcement'] . ' '; $topic_type = $user->lang['Topic_Announcement'] . ' ';
} }
else if ($topic_type == POST_STICKY) else if ($topic_type == POST_STICKY)
{ {
$topic_type = $lang['Topic_Sticky'] . ' '; $topic_type = $user->lang['Topic_Sticky'] . ' ';
} }
else else
{ {
@ -917,7 +915,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
if ( $searchset[$i]['topic_vote'] ) if ( $searchset[$i]['topic_vote'] )
{ {
$topic_type .= $lang['Topic_Poll'] . ' '; $topic_type .= $user->lang['Topic_Poll'] . ' ';
} }
$views = $searchset[$i]['topic_views']; $views = $searchset[$i]['topic_views'];
@ -926,7 +924,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
if ( ( $replies + 1 ) > $board_config['posts_per_page'] ) if ( ( $replies + 1 ) > $board_config['posts_per_page'] )
{ {
$total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] ); $total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] );
$goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': '; $goto_page = ' [ ' . $user->img('icon_gotopost', $user->lang['Goto_page']) . $user->lang['Goto_page'] . ': ';
$times = 1; $times = 1;
for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page']) for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
@ -953,48 +951,49 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
if ( $searchset[$i]['topic_status'] == TOPIC_MOVED ) if ( $searchset[$i]['topic_status'] == TOPIC_MOVED )
{ {
$topic_type = $lang['Topic_Moved'] . ' '; $topic_type = $user->lang['Topic_Moved'] . ' ';
$topic_id = $searchset[$i]['topic_moved_id']; $topic_id = $searchset[$i]['topic_moved_id'];
$folder_image = '<img src="' . $images['folder'] . '" alt="' . $lang['No_new_posts'] . '" />'; $folder_image = 'folder';
$folder_alt = $user->lang['No_new_posts'];
$newest_post_img = ''; $newest_post_img = '';
} }
else else
{ {
if ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) if ( $searchset[$i]['topic_status'] == TOPIC_LOCKED )
{ {
$folder = $images['folder_locked']; $folder = 'folder_locked';
$folder_new = $images['folder_locked_new']; $folder_new = 'folder_locked_new';
} }
else if ( $searchset[$i]['topic_type'] == POST_ANNOUNCE ) else if ( $searchset[$i]['topic_type'] == POST_ANNOUNCE )
{ {
$folder = $images['folder_announce']; $folder = 'folder_announce';
$folder_new = $images['folder_announce_new']; $folder_new = 'folder_announce_new';
} }
else if ( $searchset[$i]['topic_type'] == POST_STICKY ) else if ( $searchset[$i]['topic_type'] == POST_STICKY )
{ {
$folder = $images['folder_sticky']; $folder = 'folder_sticky';
$folder_new = $images['folder_sticky_new']; $folder_new = 'folder_sticky_new';
} }
else else
{ {
if ( $replies >= $board_config['hot_threshold'] ) if ( $replies >= $board_config['hot_threshold'] )
{ {
$folder = $images['folder_hot']; $folder = 'folder_hot';
$folder_new = $images['folder_hot_new']; $folder_new ='folder_hot_new';
} }
else else
{ {
$folder = $images['folder']; $folder = 'folder';
$folder_new = $images['folder_new']; $folder_new = 'folder_new';
} }
} }
if ( $userdata['session_logged_in'] ) if ( $user->data['session_logged_in'] )
{ {
if ( $searchset[$i]['post_time'] > $userdata['session_last_visit'] ) if ( $searchset[$i]['post_time'] > $user->data['session_last_visit'] )
{ {
if ( !empty($tracking_topics) || !empty($tracking_forums) || isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) ) if ( !empty($tracking_topics) || !empty($tracking_forums) || isset($_COOKIE[$board_config['cookie_name'] . '_f_all']) )
{ {
$unread_topics = true; $unread_topics = true;
@ -1015,9 +1014,9 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
} }
} }
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all']) ) if ( isset($_COOKIE[$board_config['cookie_name'] . '_f_all']) )
{ {
if ( $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f_all'] > $searchset[$i]['post_time'] ) if ( $_COOKIE[$board_config['cookie_name'] . '_f_all'] > $searchset[$i]['post_time'] )
{ {
$unread_topics = false; $unread_topics = false;
} }
@ -1026,13 +1025,13 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
if ( $unread_topics ) if ( $unread_topics )
{ {
$folder_image = $folder_new; $folder_image = $folder_new;
$folder_alt = $lang['New_posts']; $folder_alt = $user->lang['New_posts'];
$newest_post_img = '<a href="' . "viewtopic.$phpEx$SID&amp;t=$topic_id&amp;view=newest" . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> '; $newest_post_img = '<a href="' . "viewtopic.$phpEx$SID&amp;t=$topic_id&amp;view=newest" . '">' . $user->img('icon_newest_reply', $user->lang['View_newest_post']) . '</a> ';
} }
else else
{ {
$folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts']; $folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $user->lang['Topic_locked'] : $user->lang['No_new_posts'];
$folder_image = $folder; $folder_image = $folder;
$folder_alt = $folder_alt; $folder_alt = $folder_alt;
@ -1040,54 +1039,54 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
} }
} }
else if ( $searchset[$i]['post_time'] > $userdata['session_last_visit'] ) else if ( $searchset[$i]['post_time'] > $user->data['session_last_visit'] )
{ {
$folder_image = $folder_new; $folder_image = $folder_new;
$folder_alt = $lang['New_posts']; $folder_alt = $user->lang['New_posts'];
$newest_post_img = '<a href="' . "viewtopic.$phpEx$SID&amp;t=$topic_id&amp;view=newest" . '"><img src="' . $images['icon_newest_reply'] . '" alt="' . $lang['View_newest_post'] . '" title="' . $lang['View_newest_post'] . '" border="0" /></a> '; $newest_post_img = '<a href="' . "viewtopic.$phpEx$SID&amp;t=$topic_id&amp;view=newest" . '">' . $user->img('icon_newest_reply', $user->lang['View_newest_post']) . '</a> ';
} }
else else
{ {
$folder_image = $folder; $folder_image = $folder;
$folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts']; $folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $user->lang['Topic_locked'] : $user->lang['No_new_posts'];
$newest_post_img = ''; $newest_post_img = '';
} }
} }
else else
{ {
$folder_image = $folder; $folder_image = $folder;
$folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts']; $folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $user->lang['Topic_locked'] : $user->lang['No_new_posts'];
$newest_post_img = ''; $newest_post_img = '';
} }
} }
else else
{ {
$folder_image = $folder; $folder_image = $folder;
$folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts']; $folder_alt = ( $searchset[$i]['topic_status'] == TOPIC_LOCKED ) ? $user->lang['Topic_locked'] : $user->lang['No_new_posts'];
$newest_post_img = ''; $newest_post_img = '';
} }
} }
$topic_author = ( $searchset[$i]['user_id'] ) ? '<a href="' . "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $searchset[$i]['user_id'] . '">' : ''; $topic_author = ( $searchset[$i]['user_id'] ) ? '<a href="' . "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $searchset[$i]['user_id'] . '">' : '';
$topic_author .= ( $searchset[$i]['user_id'] ) ? $searchset[$i]['username'] : ( ( $searchset[$i]['post_username'] != '' ) ? $searchset[$i]['post_username'] : $lang['Guest'] ); $topic_author .= ( $searchset[$i]['user_id'] ) ? $searchset[$i]['username'] : ( ( $searchset[$i]['post_username'] != '' ) ? $searchset[$i]['post_username'] : $user->lang['Guest'] );
$topic_author .= ( $searchset[$i]['user_id'] ) ? '</a>' : ''; $topic_author .= ( $searchset[$i]['user_id'] ) ? '</a>' : '';
$first_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['topic_time'], $board_config['board_timezone']); $first_post_time = $user->format_date($searchset[$i]['topic_time']);
$last_post_time = create_date($board_config['default_dateformat'], $searchset[$i]['post_time'], $board_config['board_timezone']); $last_post_time = $user->format_date($searchset[$i]['post_time']);
$last_post_author = ( $searchset[$i]['id2'] ) ? ( ($searchset[$i]['post_username2'] != '' ) ? $searchset[$i]['post_username2'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $searchset[$i]['id2'] . '">' . $searchset[$i]['user2'] . '</a>'; $last_post_author = ( $searchset[$i]['id2'] ) ? ( ($searchset[$i]['post_username2'] != '' ) ? $searchset[$i]['post_username2'] . ' ' : $user->lang['Guest'] . ' ' ) : '<a href="' . "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=" . $searchset[$i]['id2'] . '">' . $searchset[$i]['user2'] . '</a>';
$last_post_url = '<a href="' . "viewtopic.$phpEx$SID&amp;p=" . $searchset[$i]['topic_last_post_id'] . '#' . $searchset[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" border="0" /></a>'; $last_post_url = '<a href="' . "viewtopic.$phpEx$SID&amp;p=" . $searchset[$i]['topic_last_post_id'] . '#' . $searchset[$i]['topic_last_post_id'] . '">' . $user->img('icon_latest_reply', $user->lang['View_latest_post']) . '</a>';
$template->assign_block_vars('searchresults', array( $template->assign_block_vars('searchresults', array(
'FORUM_NAME' => $searchset[$i]['forum_name'], 'FORUM_NAME' => $searchset[$i]['forum_name'],
'FORUM_ID' => $forum_id, 'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id, 'TOPIC_ID' => $topic_id,
'FOLDER' => $folder_image, 'FOLDER' => $user->img($folder_image, $folder_alt),
'NEWEST_POST_IMG' => $newest_post_img, 'NEWEST_POST_IMG' => $newest_post_img,
'TOPIC_FOLDER_IMG' => $folder_image, 'TOPIC_FOLDER_IMG' => $folder_image,
'GOTO_PAGE' => $goto_page, 'GOTO_PAGE' => $goto_page,
@ -1113,23 +1112,23 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
$template->assign_vars(array( $template->assign_vars(array(
'PAGINATION' => generate_pagination($base_url, $total_match_count, $per_page, $start), 'PAGINATION' => generate_pagination($base_url, $total_match_count, $per_page, $start),
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $per_page ) + 1 ), ceil( $total_match_count / $per_page )), 'PAGE_NUMBER' => sprintf($user->lang['Page_of'], ( floor( $start / $per_page ) + 1 ), ceil( $total_match_count / $per_page )),
'L_AUTHOR' => $lang['Author'], 'L_AUTHOR' => $user->lang['Author'],
'L_MESSAGE' => $lang['Message'], 'L_MESSAGE' => $user->lang['Message'],
'L_FORUM' => $lang['Forum'], 'L_FORUM' => $user->lang['Forum'],
'L_TOPICS' => $lang['Topics'], 'L_TOPICS' => $user->lang['Topics'],
'L_REPLIES' => $lang['Replies'], 'L_REPLIES' => $user->lang['Replies'],
'L_VIEWS' => $lang['Views'], 'L_VIEWS' => $user->lang['Views'],
'L_POSTS' => $lang['Posts'], 'L_POSTS' => $user->lang['Posts'],
'L_LASTPOST' => $lang['Last_Post'], 'L_LASTPOST' => $user->lang['Last_Post'],
'L_POSTED' => $lang['Posted'], 'L_POSTED' => $user->lang['Posted'],
'L_SUBJECT' => $lang['Subject'], 'L_SUBJECT' => $user->lang['Subject'],
'L_GOTO_PAGE' => $lang['Goto_page']) 'L_GOTO_PAGE' => $user->lang['Goto_page'])
); );
$page_title = $lang['Search']; $page_title = $user->lang['Search'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array( $template->set_filenames(array(
@ -1141,7 +1140,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
} }
else else
{ {
message_die(MESSAGE, $lang['No_search_match']); message_die(MESSAGE, $user->lang['No_search_match']);
} }
} }
@ -1169,12 +1168,12 @@ while( $row = $db->sql_fetchrow($result) )
if ( $s_forums != '' ) if ( $s_forums != '' )
{ {
$s_forums = '<option value="-1">' . $lang['All_available'] . '</option>' . $s_forums; $s_forums = '<option value="-1">' . $user->lang['All_available'] . '</option>' . $s_forums;
// //
// Category to search // Category to search
// //
$s_categories = '<option value="-1">' . $lang['All_available'] . '</option>'; $s_categories = '<option value="-1">' . $user->lang['All_available'] . '</option>';
while( list($cat_id, $cat_title) = @each($list_cat)) while( list($cat_id, $cat_title) = @each($list_cat))
{ {
$s_categories .= '<option value="' . $cat_id . '">' . $cat_title . '</option>'; $s_categories .= '<option value="' . $cat_id . '">' . $cat_title . '</option>';
@ -1182,13 +1181,13 @@ if ( $s_forums != '' )
} }
else else
{ {
message_die(MESSAGE, $lang['No_searchable_forums']); message_die(MESSAGE, $user->lang['No_searchable_forums']);
} }
// //
// Number of chars returned // Number of chars returned
// //
$s_characters = '<option value="-1">' . $lang['All_available'] . '</option>'; $s_characters = '<option value="-1">' . $user->lang['All_available'] . '</option>';
$s_characters .= '<option value="0">0</option>'; $s_characters .= '<option value="0">0</option>';
$s_characters .= '<option value="25">25</option>'; $s_characters .= '<option value="25">25</option>';
$s_characters .= '<option value="50">50</option>'; $s_characters .= '<option value="50">50</option>';
@ -1212,7 +1211,7 @@ for($i = 0; $i < count($sort_by_types); $i++)
// Search time // Search time
// //
$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364); $previous_days = array(0, 1, 7, 14, 30, 90, 180, 364);
$previous_days_text = array($lang['All_Posts'], $lang['1_Day'], $lang['7_Days'], $lang['2_Weeks'], $lang['1_Month'], $lang['3_Months'], $lang['6_Months'], $lang['1_Year']); $previous_days_text = array($user->lang['All_Posts'], $user->lang['1_Day'], $user->lang['7_Days'], $user->lang['2_Weeks'], $user->lang['1_Month'], $user->lang['3_Months'], $user->lang['6_Months'], $user->lang['1_Year']);
$s_time = ''; $s_time = '';
for($i = 0; $i < count($previous_days); $i++) for($i = 0; $i < count($previous_days); $i++)
@ -1222,27 +1221,27 @@ for($i = 0; $i < count($previous_days); $i++)
} }
$template->assign_vars(array( $template->assign_vars(array(
'L_SEARCH_QUERY' => $lang['Search_query'], 'L_SEARCH_QUERY' => $user->lang['Search_query'],
'L_SEARCH_OPTIONS' => $lang['Search_options'], 'L_SEARCH_OPTIONS' => $user->lang['Search_options'],
'L_SEARCH_KEYWORDS' => $lang['Search_keywords'], 'L_SEARCH_KEYWORDS' => $user->lang['Search_keywords'],
'L_SEARCH_KEYWORDS_EXPLAIN' => $lang['Search_keywords_explain'], 'L_SEARCH_KEYWORDS_EXPLAIN' => $user->lang['Search_keywords_explain'],
'L_SEARCH_AUTHOR' => $lang['Search_author'], 'L_SEARCH_AUTHOR' => $user->lang['Search_author'],
'L_SEARCH_AUTHOR_EXPLAIN' => $lang['Search_author_explain'], 'L_SEARCH_AUTHOR_EXPLAIN' => $user->lang['Search_author_explain'],
'L_SEARCH_ANY_TERMS' => $lang['Search_for_any'], 'L_SEARCH_ANY_TERMS' => $user->lang['Search_for_any'],
'L_SEARCH_ALL_TERMS' => $lang['Search_for_all'], 'L_SEARCH_ALL_TERMS' => $user->lang['Search_for_all'],
'L_SEARCH_MESSAGE_ONLY' => $lang['Search_msg_only'], 'L_SEARCH_MESSAGE_ONLY' => $user->lang['Search_msg_only'],
'L_SEARCH_MESSAGE_TITLE' => $lang['Search_title_msg'], 'L_SEARCH_MESSAGE_TITLE' => $user->lang['Search_title_msg'],
'L_CATEGORY' => $lang['Category'], 'L_CATEGORY' => $user->lang['Category'],
'L_RETURN_FIRST' => $lang['Return_first'], 'L_RETURN_FIRST' => $user->lang['Return_first'],
'L_CHARACTERS' => $lang['characters_posts'], 'L_CHARACTERS' => $user->lang['characters_posts'],
'L_SORT_BY' => $lang['Sort_by'], 'L_SORT_BY' => $user->lang['Sort_by'],
'L_SORT_ASCENDING' => $lang['Sort_Ascending'], 'L_SORT_ASCENDING' => $user->lang['Sort_Ascending'],
'L_SORT_DESCENDING' => $lang['Sort_Descending'], 'L_SORT_DESCENDING' => $user->lang['Sort_Descending'],
'L_SEARCH_PREVIOUS' => $lang['Search_previous'], 'L_SEARCH_PREVIOUS' => $user->lang['Search_previous'],
'L_DISPLAY_RESULTS' => $lang['Display_results'], 'L_DISPLAY_RESULTS' => $user->lang['Display_results'],
'L_FORUM' => $lang['Forum'], 'L_FORUM' => $user->lang['Forum'],
'L_TOPICS' => $lang['Topics'], 'L_TOPICS' => $user->lang['Topics'],
'L_POSTS' => $lang['Posts'], 'L_POSTS' => $user->lang['Posts'],
'S_SEARCH_ACTION' => "search.$phpEx$SID&amp;mode=results", 'S_SEARCH_ACTION' => "search.$phpEx$SID&amp;mode=results",
'S_CHARACTER_OPTIONS' => $s_characters, 'S_CHARACTER_OPTIONS' => $s_characters,
@ -1256,7 +1255,7 @@ $template->assign_vars(array(
// //
// Output the basic page // Output the basic page
// //
$page_title = $lang['Search']; $page_title = $user->lang['Search'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array( $template->set_filenames(array(

View file

@ -19,7 +19,7 @@
</tr> </tr>
<!-- BEGIN searchresults --> <!-- BEGIN searchresults -->
<tr> <tr>
<td class="catHead" colspan="2" height="28"><span class="topictitle"><img src="templates/subSilver/images/folder.gif" align="absmiddle">&nbsp; {L_TOPIC}:&nbsp;<a href="{searchresults.U_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a></span></td> <td class="catHead" colspan="2" height="28"><span class="topictitle">{L_TOPIC}:&nbsp;<a href="{searchresults.U_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a></span></td>
</tr> </tr>
<tr> <tr>
<td width="150" align="left" valign="top" class="row1" rowspan="2"><span class="name"><b>{searchresults.POSTER_NAME}</b></span><br /> <td width="150" align="left" valign="top" class="row1" rowspan="2"><span class="name"><b>{searchresults.POSTER_NAME}</b></span><br />
@ -27,7 +27,7 @@
<span class="postdetails">{L_REPLIES}: <b>{searchresults.TOPIC_REPLIES}</b><br /> <span class="postdetails">{L_REPLIES}: <b>{searchresults.TOPIC_REPLIES}</b><br />
{L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br /> {L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br />
</td> </td>
<td width="100%" valign="top" class="row1"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}:&nbsp;<b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b>&nbsp; &nbsp;{L_POSTED}: {searchresults.POST_DATE}&nbsp; &nbsp;{L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> <td width="100%" valign="top" class="row1">{searchresults.MINI_POST_IMG}<span class="postdetails">{L_FORUM}:&nbsp;<b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b>&nbsp; &nbsp;{L_POSTED}: {searchresults.POST_DATE}&nbsp; &nbsp;{L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td>
</tr> </tr>
<tr> <tr>
<td valign="top" class="row1"><span class="postbody">{searchresults.MESSAGE}</span></td> <td valign="top" class="row1"><span class="postbody">{searchresults.MESSAGE}</span></td>

View file

@ -32,9 +32,7 @@ if (preg_match('/^c([0-9]+)$/', $_POST['f'], $m))
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
//
// Start initial var setup // Start initial var setup
//
if ( isset($_GET['f']) || isset($_POST['f']) ) if ( isset($_GET['f']) || isset($_POST['f']) )
{ {
$forum_id = ( isset($_GET['f']) ) ? intval($_GET['f']) : intval($_POST['f']); $forum_id = ( isset($_GET['f']) ) ? intval($_GET['f']) : intval($_POST['f']);
@ -54,13 +52,10 @@ else
} }
$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0; $start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;
//
// End initial var setup // End initial var setup
//
// Start session management // Start session
$userdata = $session->start(); $user->start();
// End session management
// Check if the user has actually sent a forum ID with his/her request // Check if the user has actually sent a forum ID with his/her request
// If not give them a nice error page. // If not give them a nice error page.
@ -75,20 +70,18 @@ if (!$forum_branch = get_forum_branch($forum_id))
} }
// Configure style, language, etc. // Configure style, language, etc.
$user = new user($userdata, false, $forum_branch['forum_style']); $user->setup(false, $forum_branch['forum_style']);
$auth->acl($userdata, $forum_id, array('m_', 'f_read', 'f_post', 'f_attach', 'f_reply', 'f_edit', 'f_delete')); $auth->acl($user->data, $forum_id);
//
// Auth check // Auth check
if (!$auth->acl_get('f_read', $forum_id)) if (!$auth->acl_get('f_read', $forum_id))
{ {
if ( !$userdata['user_id'] ) if ( !$user->data['user_id'] )
{ {
redirect("login.$phpEx$SID&redirect=viewforum.$phpEx&f=$forum_id" . ((isset($start)) ? "&start=$start" : '')); redirect("login.$phpEx$SID&redirect=viewforum.$phpEx&f=$forum_id" . ((isset($start)) ? "&start=$start" : ''));
} }
// The user is not authed to read this forum ... trigger_error( $user->lang['Sorry_auth_read']);
message_die(MESSAGE, $lang['Sorry_auth_read']);
} }
// End of auth check // End of auth check
@ -161,18 +154,14 @@ foreach ($forum_branch as $row)
} }
} }
//
// Topic read tracking cookie info // Topic read tracking cookie info
//
$mark_topics = ( isset($_COOKIE[$board_config['cookie_name'] . '_t']) ) ? unserialize(stripslashes($_COOKIE[$board_config['cookie_name'] . '_t'])) : array(); $mark_topics = ( isset($_COOKIE[$board_config['cookie_name'] . '_t']) ) ? unserialize(stripslashes($_COOKIE[$board_config['cookie_name'] . '_t'])) : array();
$mark_forums = ( isset($_COOKIE[$board_config['cookie_name'] . '_f']) ) ? unserialize(stripslashes($_COOKIE[$board_config['cookie_name'] . '_f'])) : array(); $mark_forums = ( isset($_COOKIE[$board_config['cookie_name'] . '_f']) ) ? unserialize(stripslashes($_COOKIE[$board_config['cookie_name'] . '_f'])) : array();
//
// Handle marking posts // Handle marking posts
//
if ( $mark_read == 'topics' ) if ( $mark_read == 'topics' )
{ {
if ( $userdata['user_id'] ) if ( $user->data['user_id'] )
{ {
$mark_forums[$forum_id] = time(); $mark_forums[$forum_id] = time();
@ -183,16 +172,12 @@ if ( $mark_read == 'topics' )
); );
} }
$message = $lang['Topics_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . "viewforum.$phpEx$SID&amp;f=$forum_id" . '">', '</a> '); $message = $user->lang['Topics_marked_read'] . '<br /><br />' . sprintf($user->lang['Click_return_forum'], '<a href="' . "viewforum.$phpEx$SID&amp;f=$forum_id" . '">', '</a> ');
message_die(MESSAGE, $message); trigger_error($message);
} }
//
// End handle marking posts // End handle marking posts
//
//
// Do the forum Prune // Do the forum Prune
//
if ( $auth->acl_get('m_prune', $forum_id) && $board_config['prune_enable'] ) if ( $auth->acl_get('m_prune', $forum_id) && $board_config['prune_enable'] )
{ {
if ( $forum_data['prune_next'] < time() && $forum_data['prune_enable'] ) if ( $forum_data['prune_next'] < time() && $forum_data['prune_enable'] )
@ -201,16 +186,12 @@ if ( $auth->acl_get('m_prune', $forum_id) && $board_config['prune_enable'] )
auto_prune($forum_id); auto_prune($forum_id);
} }
} }
//
// End of forum prune // End of forum prune
//
//
// Forum rules, subscription info and word censors // Forum rules, subscription info and word censors
//
$s_watching_forum = ''; $s_watching_forum = '';
$s_watching_forum_img = ''; $s_watching_forum_img = '';
watch_topic_forum('forum', $s_watching_forum, $s_watching_forum_img, $userdata['user_id'], $forum_id); watch_topic_forum('forum', $s_watching_forum, $s_watching_forum_img, $user->data['user_id'], $forum_id);
$s_forum_rules = ''; $s_forum_rules = '';
get_forum_rules('forum', $s_forum_rules, $forum_id); get_forum_rules('forum', $s_forum_rules, $forum_id);
@ -219,14 +200,9 @@ $orig_word = array();
$replacement_word = array(); $replacement_word = array();
obtain_word_list($orig_word, $replacement_word); obtain_word_list($orig_word, $replacement_word);
//
// Topic ordering options // Topic ordering options
// $previous_days = array(0 => $user->lang['All_Topics'], 1 => $user->lang['1_Day'], 7 => $user->lang['7_Days'], 14 => $user->lang['2_Weeks'], 30 => $user->lang['1_Month'], 90 => $user->lang['3_Months'], 180 => $user->lang['6_Months'], 364 => $user->lang['1_Year']);
$previous_days = array(0 => $lang['All_Topics'], 1 => $lang['1_Day'], 7 => $lang['7_Days'], 14 => $lang['2_Weeks'], 30 => $lang['1_Month'], 90 => $lang['3_Months'], 180 => $lang['6_Months'], 364 => $lang['1_Year']); $sort_by_text = array('a' => $user->lang['Author'], 't' => $user->lang['Post_time'], 'r' => $user->lang['Replies'], 's' => $user->lang['Subject'], 'v' => $user->lang['Views']);
$sort_by_text = array('a' => $lang['Author'], 't' => $lang['Post_time'], 'r' => $lang['Replies'], 's' => $lang['Subject'], 'v' => $lang['Views']);
$sort_by = array('a' => 'u.username', 't' => 't.topic_last_post_id', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views'); $sort_by = array('a' => 'u.username', 't' => 't.topic_last_post_id', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views');
if ( isset($_POST['sort']) ) if ( isset($_POST['sort']) )
@ -286,51 +262,53 @@ foreach ( $sort_by_text as $key => $text )
$select_sort .= '</select>'; $select_sort .= '</select>';
$select_sort_dir = '<select name="sort_dir">'; $select_sort_dir = '<select name="sort_dir">';
$select_sort_dir .= ( $sort_dir == 'a' ) ? '<option value="a" selected="selected">' . $lang['Ascending'] . '</option><option value="d">' . $lang['Descending'] . '</option>' : '<option value="a">' . $lang['Ascending'] . '</option><option value="d" selected="selected">' . $lang['Descending'] . '</option>'; $select_sort_dir .= ( $sort_dir == 'a' ) ? '<option value="a" selected="selected">' . $user->lang['Ascending'] . '</option><option value="d">' . $user->lang['Descending'] . '</option>' : '<option value="a">' . $user->lang['Ascending'] . '</option><option value="d" selected="selected">' . $user->lang['Descending'] . '</option>';
$select_sort_dir .= '</select>'; $select_sort_dir .= '</select>';
$post_alt = ( $forum_data['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['Post_new_topic']; $post_alt = ( $forum_data['forum_status'] == FORUM_LOCKED ) ? 'Forum_locked' : 'Post_new_topic';
// Basic pagewide vars
$template->assign_vars(array( $template->assign_vars(array(
'FORUM_ID' => $forum_id, 'FORUM_ID' => $forum_id,
'POST_IMG' => '<img src=' . (( $forum_data['forum_status'] == FORUM_LOCKED ) ? $theme['post_locked'] : $theme['post_new'] ) . ' border="0" alt="' . $post_alt . '" title="' . $post_alt . '" />', 'FORUM_NAME' => $forum_data['forum_name'],
'POST_IMG' => ( $forum_data['forum_status'] == FORUM_LOCKED ) ? $user->img('post_locked', $post_alt) : $user->img('post_new', $post_alt),
'PAGINATION' => generate_pagination("viewforum.$phpEx$SID&amp;f=$forum_id&amp;topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start), 'PAGINATION' => generate_pagination("viewforum.$phpEx$SID&amp;f=$forum_id&amp;topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start),
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $topics_count / $board_config['topics_per_page'] )), 'PAGE_NUMBER' => sprintf($user->lang['Page_of'], ( floor( $start / $board_config['topics_per_page'] ) + 1 ), ceil( $topics_count / $board_config['topics_per_page'] )),
'FOLDER_IMG' => create_img($theme['folder'], $lang['No_new_posts']), 'FOLDER_IMG' => $user->img('folder', 'No_new_posts'),
'FOLDER_NEW_IMG' => create_img($theme['folder_new'], $lang['New_posts']), 'FOLDER_NEW_IMG' => $user->img('folder_new', 'New_posts'),
'FOLDER_HOT_IMG' => create_img($theme['folder_hot'], $lang['No_new_posts_hot']), 'FOLDER_HOT_IMG' => $user->img('folder_hot', 'No_new_posts_hot'),
'FOLDER_HOT_NEW_IMG' => create_img($theme['folder_hot_new'], $lang['New_posts_hot']), 'FOLDER_HOT_NEW_IMG' => $user->img('folder_hot_new', 'New_posts_hot'),
'FOLDER_LOCKED_IMG' => create_img($theme['folder_locked'], $lang['No_new_posts_locked']), 'FOLDER_LOCKED_IMG' => $user->img('folder_locked', 'No_new_posts_locked'),
'FOLDER_LOCKED_NEW_IMG' => create_img($theme['folder_locked_new'], $lang['New_posts_locked']), 'FOLDER_LOCKED_NEW_IMG' => $user->img('folder_locked_new', 'New_posts_locked'),
'FOLDER_STICKY_IMG' => create_img($theme['folder_sticky'], $lang['Post_Sticky']), 'FOLDER_STICKY_IMG' => $user->img('folder_sticky', 'Post_Sticky'),
'FOLDER_STICKY_NEW_IMG' => create_img($theme['folder_sticky_new'], $lang['Post_Sticky']), 'FOLDER_STICKY_NEW_IMG' => $user->img('folder_sticky_new', 'Post_Sticky'),
'FOLDER_ANNOUNCE_IMG' => create_img($theme['folder_announce'], $lang['Post_Announcement']), 'FOLDER_ANNOUNCE_IMG' => $user->img('folder_announce', 'Post_Announcement'),
'FOLDER_ANNOUNCE_NEW_IMG' => create_img($theme['folder_announce_new'], $lang['Post_Announcement']), 'FOLDER_ANNOUNCE_NEW_IMG' => $user->img('folder_announce_new', 'Post_Announcement'),
'L_TOPICS' => $lang['Topics'], 'L_TOPICS' => $user->lang['Topics'],
'L_REPLIES' => $lang['Replies'], 'L_REPLIES' => $user->lang['Replies'],
'L_VIEWS' => $lang['Views'], 'L_VIEWS' => $user->lang['Views'],
'L_POSTS' => $lang['Posts'], 'L_POSTS' => $user->lang['Posts'],
'L_LASTPOST' => $lang['Last_Post'], 'L_LASTPOST' => $user->lang['Last_Post'],
'L_RATING' => $lang['Rating'], 'L_RATING' => $user->lang['Rating'],
'L_VIEW_MODERATORS' => $lang['View_moderators'], 'L_VIEW_MODERATORS' => $user->lang['View_moderators'],
'L_DISPLAY_TOPICS' => $lang['Display_topics'], 'L_DISPLAY_TOPICS' => $user->lang['Display_topics'],
'L_SORT_BY' => $lang['Sort_by'], 'L_SORT_BY' => $user->lang['Sort_by'],
'L_MARK_TOPICS_READ' => $lang['Mark_all_topics'], 'L_MARK_TOPICS_READ' => $user->lang['Mark_all_topics'],
'L_NO_NEW_POSTS' => $lang['No_new_posts'], 'L_NO_NEW_POSTS' => $user->lang['No_new_posts'],
'L_NEW_POSTS' => $lang['New_posts'], 'L_NEW_POSTS' => $user->lang['New_posts'],
'L_NO_NEW_POSTS_LOCKED' => $lang['No_new_posts_locked'], 'L_NO_NEW_POSTS_LOCKED' => $user->lang['No_new_posts_locked'],
'L_NEW_POSTS_LOCKED' => $lang['New_posts_locked'], 'L_NEW_POSTS_LOCKED' => $user->lang['New_posts_locked'],
'L_NO_NEW_POSTS_HOT' => $lang['No_new_posts_hot'], 'L_NO_NEW_POSTS_HOT' => $user->lang['No_new_posts_hot'],
'L_NEW_POSTS_HOT' => $lang['New_posts_hot'], 'L_NEW_POSTS_HOT' => $user->lang['New_posts_hot'],
'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_ANNOUNCEMENT' => $user->lang['Post_Announcement'],
'L_STICKY' => $lang['Post_Sticky'], 'L_STICKY' => $user->lang['Post_Sticky'],
'L_POSTED' => $lang['Posted'], 'L_POSTED' => $user->lang['Posted'],
'L_JOINED' => $lang['Joined'], 'L_JOINED' => $user->lang['Joined'],
'L_AUTHOR' => $lang['Author'], 'L_AUTHOR' => $user->lang['Author'],
'L_NO_TOPICS' => ( $forum_data['forum_status'] == FORUM_LOCKED ) ? $lang['Forum_locked'] : $lang['No_topics_post_one'], 'L_NO_TOPICS' => ( $forum_data['forum_status'] == FORUM_LOCKED ) ? $user->lang['Forum_locked'] : $user->lang['No_topics_post_one'],
'L_GOTO_PAGE' => $lang['Goto_page'], 'L_GOTO_PAGE' => $user->lang['Goto_page'],
'S_SELECT_SORT_DIR' => $select_sort_dir, 'S_SELECT_SORT_DIR' => $select_sort_dir,
'S_SELECT_SORT_KEY' => $select_sort, 'S_SELECT_SORT_KEY' => $select_sort,
@ -344,24 +322,20 @@ $template->assign_vars(array(
'U_MARK_READ' => 'viewforum.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;mark=topics') 'U_MARK_READ' => 'viewforum.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;mark=topics')
); );
//
// Do we have subforums? if so, let's include this harmless file // Do we have subforums? if so, let's include this harmless file
//
if ($s_has_subforums) if ($s_has_subforums)
{ {
$template->assign_vars(array( $template->assign_vars(array(
'S_HAS_SUBFORUM' => TRUE, 'S_HAS_SUBFORUM' => TRUE,
'L_SUBFORUM' => (count($forum_rows) == 1) ? $lang['Subforum'] : $lang['Subforums'] 'L_SUBFORUM' => (count($forum_rows) == 1) ? $user->lang['Subforum'] : $user->lang['Subforums']
)); ));
$root_id = $forum_id; $root_id = $forum_id;
include($phpbb_root_path . 'includes/forums_display.' . $phpEx); include($phpbb_root_path . 'includes/forums_display.' . $phpEx);
} }
//
// Grab all the basic data. If we're not on page 1 we also grab any // Grab all the basic data. If we're not on page 1 we also grab any
// announcements that may exist. // announcements that may exist.
//
$total_topics = 0; $total_topics = 0;
$topic_rowset = array(); $topic_rowset = array();
@ -387,7 +361,7 @@ if ( $start )
} }
// topic icon join requires full table scan ... not good ... order by is a killer too // topic icon join requires full table scan ... not good ... order by is a killer too
$sql = "SELECT t.*, i.icons_url, i.icons_width, i.icons_height, u.username, u.user_id, u2.username as user2, u2.user_id as id2 /*$sql = "SELECT t.*, i.icons_url, i.icons_width, i.icons_height, u.username, u.user_id, u2.username as user2, u2.user_id as id2
FROM " . TOPICS_TABLE . " t, " . ICONS_TABLE . " i, " . USERS_TABLE . " u, " . USERS_TABLE . " u2 FROM " . TOPICS_TABLE . " t, " . ICONS_TABLE . " i, " . USERS_TABLE . " u, " . USERS_TABLE . " u2
WHERE t.forum_id = $forum_id WHERE t.forum_id = $forum_id
AND i.icons_id = t.topic_icon AND i.icons_id = t.topic_icon
@ -395,6 +369,14 @@ $sql = "SELECT t.*, i.icons_url, i.icons_width, i.icons_height, u.username, u.us
AND u2.user_id = t.topic_last_poster_id AND u2.user_id = t.topic_last_poster_id
$limit_topics_time $limit_topics_time
ORDER BY t.topic_type DESC, $sort_order ORDER BY t.topic_type DESC, $sort_order
LIMIT $start, " . $board_config['topics_per_page'];*/
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . USERS_TABLE . " u2
WHERE t.forum_id = $forum_id
AND u.user_id = t.topic_poster
AND u2.user_id = t.topic_last_poster_id
$limit_topics_time
ORDER BY t.topic_type DESC, $sort_order
LIMIT $start, " . $board_config['topics_per_page']; LIMIT $start, " . $board_config['topics_per_page'];
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -405,26 +387,22 @@ while( $row = $db->sql_fetchrow($result) )
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
//
// Okay, lets dump out the page ... // Okay, lets dump out the page ...
//
if ( $total_topics ) if ( $total_topics )
{ {
for($i = 0; $i < $total_topics; $i++) for($i = 0; $i < $total_topics; $i++)
{ {
$topic_id = $topic_rowset[$i]['topic_id']; $topic_id = $topic_rowset[$i]['topic_id'];
//
// Type and folder // Type and folder
//
$topic_type = ''; $topic_type = '';
if ( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED ) if ( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
{ {
$topic_type = $lang['Topic_Moved'] . ' '; $topic_type = $user->lang['Topic_Moved'] . ' ';
$topic_id = $topic_rowset[$i]['topic_moved_id']; $topic_id = $topic_rowset[$i]['topic_moved_id'];
$folder_image = $theme['folder']; $folder_image = 'folder';
$folder_alt = $lang['Topic_Moved']; $folder_alt = 'Topic_Moved';
$newest_post_img = ''; $newest_post_img = '';
} }
else else
@ -432,77 +410,55 @@ if ( $total_topics )
switch ( $topic_rowset[$i]['topic_type'] ) switch ( $topic_rowset[$i]['topic_type'] )
{ {
case POST_ANNOUNCE: case POST_ANNOUNCE:
$topic_type = $lang['Topic_Announcement'] . ' '; $topic_type = $user->lang['Topic_Announcement'] . ' ';
$folder = $theme['folder_announce']; $folder = 'folder_announce';
$folder_new = $theme['folder_announce_new']; $folder_new = 'folder_announce_new';
break; break;
case POST_STICKY: case POST_STICKY:
$topic_type = $lang['Topic_Sticky'] . ' '; $topic_type = $user->lang['Topic_Sticky'] . ' ';
$folder = $theme['folder_sticky']; $folder = 'folder_sticky';
$folder_new = $theme['folder_sticky_new']; $folder_new = 'folder_sticky_new';
break; break;
case TOPIC_LOCKED: case TOPIC_LOCKED:
$folder = $theme['folder_locked']; $folder = 'folder_locked';
$folder_new = $theme['folder_locked_new']; $folder_new = 'folder_locked_new';
break; break;
default: default:
if ( $replies >= $board_config['hot_threshold'] ) if ( $replies >= $board_config['hot_threshold'] )
{ {
$folder = $theme['folder_hot']; $folder = 'folder_hot';
$folder_new = $theme['folder_hot_new']; $folder_new = 'folder_hot_new';
} }
else else
{ {
$folder = $theme['folder']; $folder = 'folder';
$folder_new = $theme['folder_new']; $folder_new = 'folder_new';
} }
break; break;
} }
$unread_topic = false; $unread_topic = false;
if ( $userdata['user_id'] && $topic_rowset[$i]['topic_last_post_time'] > $userdata['user_lastvisit'] ) if ( $user->data['user_id'] && $topic_rowset[$i]['topic_last_post_time'] > $user->data['user_lastvisit'] )
{ {
$unread_topic = true; $unread_topic = true;
if ( isset($_COOKIE[$board_config['cookie_name'] . '_f_all']) )
{
if ( $_COOKIE[$board_config['cookie_name'] . '_f_all'] > $topic_rowset[$i]['topic_last_post_time'] )
{
$unread_topic = false;
}
} }
if ( isset($mark_topics[$forum_id]) || isset($mark_forums[$forum_id][$topic_id]) ) $newest_post_img = ( $unread_topic ) ? '<a href="viewtopic.' . $phpEx . $SID . '&amp;t=' . $topic_id . '&amp;view=newest">' . $user->img('goto_post_newest', 'View_newest_post') . '</a> ' : '';
{
if ( $mark_forums[$forum_id] > $topic_rowset[$i]['topic_last_post_time'] || !$mark_topics[$forum_id][$topic_id] )
{
$unread_topic = false;
}
}
if ( !isset($mark_topics[$forum_id][$topic_id]) )
{
$mark_topics[$forum_id][$topic_id] = $topic_rowset[$i]['topic_last_post_time'];
}
}
$newest_post_img = ( $unread_topic ) ? '<a href="viewtopic.' . $phpEx . $SID . '&amp;t=' . $topic_id . '&amp;view=newest">' . create_img($theme['goto_post_newest'], $lang['View_newest_post']) . '</a> ' : '';
$folder_img = ( $unread_topic ) ? $folder_new : $folder; $folder_img = ( $unread_topic ) ? $folder_new : $folder;
$folder_alt = ( $unread_topic ) ? $lang['New_posts'] : ( ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? $lang['Topic_locked'] : $lang['No_new_posts'] ); $folder_alt = ( $unread_topic ) ? 'New_posts' : ( ( $topic_rowset[$i]['topic_status'] == TOPIC_LOCKED ) ? 'Topic_locked' : 'No_new_posts' );
} }
if ( $topic_rowset[$i]['topic_vote'] ) if ( $topic_rowset[$i]['topic_vote'] )
{ {
$topic_type .= $lang['Topic_Poll'] . ' '; $topic_type .= $user->lang['Topic_Poll'] . ' ';
} }
//
// Goto message // Goto message
//
if ( ( $replies + 1 ) > $board_config['posts_per_page'] ) if ( ( $replies + 1 ) > $board_config['posts_per_page'] )
{ {
$total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] ); $total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] );
$goto_page = ' [ <img src=' . $theme['goto_post'] . ' alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': '; $goto_page = ' [ <img src=' . $theme['goto_post'] . ' alt="' . $user->lang['Goto_page'] . '" title="' . $user->lang['Goto_page'] . '" />' . $user->lang['Goto_page'] . ': ';
$times = 1; $times = 1;
for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page']) for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
@ -527,13 +483,11 @@ if ( $total_topics )
$goto_page = ''; $goto_page = '';
} }
//
// Generate all the URIs ... // Generate all the URIs ...
//
$view_topic_url = 'viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id; $view_topic_url = 'viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id;
$topic_author = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $topic_rowset[$i]['user_id'] . '">' : ''; $topic_author = ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $topic_rowset[$i]['user_id'] . '">' : '';
$topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? $topic_rowset[$i]['username'] : ( ( $topic_rowset[$i]['topic_first_poster_name'] != '' ) ? $topic_rowset[$i]['topic_first_poster_name'] : $lang['Guest'] ); $topic_author .= ( $topic_rowset[$i]['user_id'] != ANONYMOUS ) ? $topic_rowset[$i]['username'] : ( ( $topic_rowset[$i]['topic_first_poster_name'] != '' ) ? $topic_rowset[$i]['topic_first_poster_name'] : $user->lang['Guest'] );
$topic_author .= ( $topic_rowset[$i]['user_id'] ) ? '</a>' : ''; $topic_author .= ( $topic_rowset[$i]['user_id'] ) ? '</a>' : '';
@ -541,9 +495,9 @@ if ( $total_topics )
$last_post_time = $user->format_date($topic_rowset[$i]['topic_last_post_time']); $last_post_time = $user->format_date($topic_rowset[$i]['topic_last_post_time']);
$last_post_author = ( !$topic_rowset[$i]['id2'] ) ? ( ( $topic_rowset[$i]['topic_last_poster_name'] != '' ) ? $topic_rowset[$i]['topic_last_poster_name'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $topic_rowset[$i]['topic_last_poster_id'] . '">' . $topic_rowset[$i]['user2'] . '</a>'; $last_post_author = ( !$topic_rowset[$i]['id2'] ) ? ( ( $topic_rowset[$i]['topic_last_poster_name'] != '' ) ? $topic_rowset[$i]['topic_last_poster_name'] . ' ' : $user->lang['Guest'] . ' ' ) : '<a href="profile.' . $phpEx . $SID . '&amp;mode=viewprofile&amp;u=' . $topic_rowset[$i]['topic_last_poster_id'] . '">' . $topic_rowset[$i]['user2'] . '</a>';
$last_post_url = '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;p=' . $topic_rowset[$i]['topic_last_post_id'] . '#' . $topic_rowset[$i]['topic_last_post_id'] . '">' . create_img($theme['goto_post_latest'], $lang['View_latest_post']) . '</a>'; $last_post_url = '<a href="viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;p=' . $topic_rowset[$i]['topic_last_post_id'] . '#' . $topic_rowset[$i]['topic_last_post_id'] . '">' . $user->img('goto_post_latest', 'View_latest_post') . '</a>';
// //
// Send vars to template // Send vars to template
@ -551,7 +505,7 @@ if ( $total_topics )
$template->assign_block_vars('topicrow', array( $template->assign_block_vars('topicrow', array(
'FORUM_ID' => $forum_id, 'FORUM_ID' => $forum_id,
'TOPIC_ID' => $topic_id, 'TOPIC_ID' => $topic_id,
'TOPIC_FOLDER_IMG' => create_img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
'TOPIC_AUTHOR' => $topic_author, 'TOPIC_AUTHOR' => $topic_author,
'NEWEST_POST_IMG' => $newest_post_img, 'NEWEST_POST_IMG' => $newest_post_img,
'FIRST_POST_TIME' => $first_post_time, 'FIRST_POST_TIME' => $first_post_time,
@ -573,19 +527,17 @@ if ( $total_topics )
} }
} }
if ( $userdata['user_id'] ) if ($user->data['user_id'] != ANONYMOUS)
{ {
setcookie($board_config['cookie_name'] . '_t', serialize($mark_topics), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); setcookie($board_config['cookie_name'] . '_t', serialize($mark_topics), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
} }
//
// Dump out the page header and load viewforum template // Dump out the page header and load viewforum template
// $page_title = $user->lang['View_forum'] . ' - ' . $forum_data['forum_name'];
$page_title = $lang['View_forum'] . ' - ' . $forum_data['forum_name'];
$nav_links['up'] = array( $nav_links['up'] = array(
'url' => 'index.' . $phpEx . $SID, 'url' => 'index.' . $phpEx . $SID,
'title' => sprintf($lang['Forum_Index'], $board_config['sitename']) 'title' => sprintf($user->lang['Forum_Index'], $board_config['sitename'])
); );
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);

View file

@ -25,9 +25,9 @@ include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx); include($phpbb_root_path . 'common.'.$phpEx);
// Start session management // Start session management
$userdata = $session->start(); $user->start();
$auth->acl($userdata); $user->setup();
$user = new user($userdata); $auth->acl($user->data);
// End session management // End session management
// //
@ -100,7 +100,7 @@ while ( $row = $db->sql_fetchrow($result) )
{ {
if ( $row['session_ip'] != $prev_ip ) if ( $row['session_ip'] != $prev_ip )
{ {
$username = $lang['Guest']; $username = $user->lang['Guest'];
$view_online = true; $view_online = true;
$guest_users++; $guest_users++;
@ -118,7 +118,7 @@ while ( $row = $db->sql_fetchrow($result) )
switch ( $on_page[1] ) switch ( $on_page[1] )
{ {
case 'index': case 'index':
$location = $lang['Forum_index']; $location = $user->lang['Forum_index'];
$location_url = "index.$phpEx$SID"; $location_url = "index.$phpEx$SID";
break; break;
@ -134,10 +134,10 @@ while ( $row = $db->sql_fetchrow($result) )
switch ( $on_page[1] ) switch ( $on_page[1] )
{ {
case 'posting': case 'posting':
$location = sprintf($lang['Posting_message'], $forum_data[$forum_id]); $location = sprintf($user->lang['Posting_message'], $forum_data[$forum_id]);
break; break;
case 'viewtopic': case 'viewtopic':
$location = sprintf($lang['Reading_topic'], $forum_data[$forum_id]); $location = sprintf($user->lang['Reading_topic'], $forum_data[$forum_id]);
break; break;
case 'viewforum': case 'viewforum':
$location .= $forum_data[$forum_id]; $location .= $forum_data[$forum_id];
@ -147,38 +147,38 @@ while ( $row = $db->sql_fetchrow($result) )
} }
else else
{ {
$location = $lang['Forum_index']; $location = $user->lang['Forum_index'];
$location_url = "index.$phpEx$SID"; $location_url = "index.$phpEx$SID";
} }
break; break;
case 'search': case 'search':
$location = $lang['Searching_forums']; $location = $user->lang['Searching_forums'];
$location_url = "search.$phpEx$SID"; $location_url = "search.$phpEx$SID";
break; break;
case 'profile': case 'profile':
$location = $lang['Viewing_profile']; $location = $user->lang['Viewing_profile'];
$location_url = "index.$phpEx$SID"; $location_url = "index.$phpEx$SID";
break; break;
case 'faq': case 'faq':
$location = $lang['Viewing_FAQ']; $location = $user->lang['Viewing_FAQ'];
$location_url = "faq.$phpEx$SID"; $location_url = "faq.$phpEx$SID";
break; break;
case 'viewonline': case 'viewonline':
$location = $lang['Viewing_online']; $location = $user->lang['Viewing_online'];
$location_url = "viewonline.$phpEx$SID"; $location_url = "viewonline.$phpEx$SID";
break; break;
case 'memberslist': case 'memberslist':
$location = $lang['Viewing_member_list']; $location = $user->lang['Viewing_member_list'];
$location_url = "memberlist.$phpEx$SID"; $location_url = "memberlist.$phpEx$SID";
break; break;
default: default:
$location = $lang['Forum_index']; $location = $user->lang['Forum_index'];
$location_url = "index.$phpEx$SID"; $location_url = "index.$phpEx$SID";
break; break;
} }
@ -200,57 +200,59 @@ while ( $row = $db->sql_fetchrow($result) )
if( $registered_users == 0 ) if( $registered_users == 0 )
{ {
$l_r_user_s = $lang['Reg_users_zero_online']; $l_r_user_s = $user->lang['Reg_users_zero_online'];
} }
else if( $registered_users == 1 ) else if( $registered_users == 1 )
{ {
$l_r_user_s = $lang['Reg_user_online']; $l_r_user_s = $user->lang['Reg_user_online'];
} }
else else
{ {
$l_r_user_s = $lang['Reg_users_online']; $l_r_user_s = $user->lang['Reg_users_online'];
} }
if( $hidden_users == 0 ) if( $hidden_users == 0 )
{ {
$l_h_user_s = $lang['Hidden_users_zero_online']; $l_h_user_s = $user->lang['Hidden_users_zero_online'];
} }
else if( $hidden_users == 1 ) else if( $hidden_users == 1 )
{ {
$l_h_user_s = $lang['Hidden_user_online']; $l_h_user_s = $user->lang['Hidden_user_online'];
} }
else else
{ {
$l_h_user_s = $lang['Hidden_users_online']; $l_h_user_s = $user->lang['Hidden_users_online'];
} }
if( $guest_users == 0 ) if( $guest_users == 0 )
{ {
$l_g_user_s = $lang['Guest_users_zero_online']; $l_g_user_s = $user->lang['Guest_users_zero_online'];
} }
else if( $guest_users == 1 ) else if( $guest_users == 1 )
{ {
$l_g_user_s = $lang['Guest_user_online']; $l_g_user_s = $user->lang['Guest_user_online'];
} }
else else
{ {
$l_g_user_s = $lang['Guest_users_online']; $l_g_user_s = $user->lang['Guest_users_online'];
} }
$template->assign_vars(array( $template->assign_vars(array(
'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $registered_users) . sprintf($l_h_user_s, $hidden_users), 'TOTAL_REGISTERED_USERS_ONLINE' => sprintf($l_r_user_s, $registered_users) . sprintf($l_h_user_s, $hidden_users),
'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_users), 'TOTAL_GUEST_USERS_ONLINE' => sprintf($l_g_user_s, $guest_users),
'L_WHOSONLINE' => $lang['Who_is_online'], 'META' => '<meta http-equiv="refresh" content="60; url=viewonline.' . $phpEx . $SID . '">',
'L_ONLINE_EXPLAIN' => $lang['Online_explain'],
'L_USERNAME' => $lang['Username'], 'L_WHOSONLINE' => $user->lang['Who_is_online'],
'L_FORUM_LOCATION' => $lang['Forum_Location'], 'L_ONLINE_EXPLAIN' => $user->lang['Online_explain'],
'L_LAST_UPDATE' => $lang['Last_updated'], 'L_USERNAME' => $user->lang['Username'],
'L_NO_GUESTS_BROWSING' => $lang['No_users_browsing'], 'L_FORUM_LOCATION' => $user->lang['Forum_Location'],
'L_NO_REGISTERED_USERS_BROWSING' => $lang['No_users_browsing']) 'L_LAST_UPDATE' => $user->lang['Last_updated'],
'L_NO_GUESTS_BROWSING' => $user->lang['No_users_browsing'],
'L_NO_REGISTERED_USERS_BROWSING' => $user->lang['No_users_browsing'])
); );
$page_title = $lang['Who_is_online']; $page_title = $user->lang['Who_is_online'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array( $template->set_filenames(array(

View file

@ -100,20 +100,16 @@ if (isset($_GET['view']) && empty($post_id))
} }
} }
//
// Start session management // Start session management
// $user->start();
$userdata = $session->start();
//
// End session management // End session management
//
if ( $userdata['user_id'] && isset($_POST['rating']) ) if ( $user->data['user_id'] && isset($_POST['rating']) )
{ {
$sql = "SELECT rating $sql = "SELECT rating
FROM " . TOPICS_RATINGS_TABLE . " FROM " . TOPICS_RATINGS_TABLE . "
WHERE topic_id = $topic_id WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id']; AND user_id = " . $user->data['user_id'];
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$rating = ( $row = $db->sql_fetchrow($result) ) ? $row['rating'] : ''; $rating = ( $row = $db->sql_fetchrow($result) ) ? $row['rating'] : '';
@ -125,7 +121,7 @@ if ( $userdata['user_id'] && isset($_POST['rating']) )
{ {
$new_rating = intval($_POST['rating']); $new_rating = intval($_POST['rating']);
$sql = ( $rating != '' ) ? "UPDATE " . TOPICS_RATING_TABLE . " SET rating = $new_rating WHERE user_id = " . $userdata['user_id'] . " AND topic_id = $topic_id" : "INSERT INTO " . TOPICS_RATING_TABLE . " (topic_id, user_id, rating) VALUES ($topic_id, " . $userdata['user_id'] . ", $new_rating)"; $sql = ( $rating != '' ) ? "UPDATE " . TOPICS_RATING_TABLE . " SET rating = $new_rating WHERE user_id = " . $user->data['user_id'] . " AND topic_id = $topic_id" : "INSERT INTO " . TOPICS_RATING_TABLE . " (topic_id, user_id, rating) VALUES ($topic_id, " . $user->data['user_id'] . ", $new_rating)";
} }
} }
@ -152,8 +148,8 @@ if ( !(extract($db->sql_fetchrow($result))) )
} }
// Configure style, language, etc. // Configure style, language, etc.
$user = new user($userdata, false, $forum_style); $user->setup(false, $forum_style);
$auth->acl($userdata, $forum_id, array('f_read', 'f_post', 'f_reply', 'f_attach')); $auth->acl($user->data, $forum_id);
// End configure // End configure
// //
@ -161,14 +157,14 @@ $auth->acl($userdata, $forum_id, array('f_read', 'f_post', 'f_reply', 'f_attach'
// //
if ( !$auth->acl_get('f_read', $forum_id) ) if ( !$auth->acl_get('f_read', $forum_id) )
{ {
if ( $userdata['user_id'] ) if ( $user->data['user_id'] )
{ {
$redirect = ( isset($post_id) ) ? "p=$post_id" : "t=$topic_id"; $redirect = ( isset($post_id) ) ? "p=$post_id" : "t=$topic_id";
$redirect .= ( isset($start) ) ? "&start=$start" : ''; $redirect .= ( isset($start) ) ? "&start=$start" : '';
redirect('login.' . $phpEx . $SID . '&redirect=viewtopic.' . $phpEx . '&' . $redirect); redirect('login.' . $phpEx . $SID . '&redirect=viewtopic.' . $phpEx . '&' . $redirect);
} }
message_die(MESSAGE, $lang['Sorry_auth_read']); message_die(MESSAGE, $user->lang['Sorry_auth_read']);
} }
// //
// End auth check // End auth check
@ -181,13 +177,13 @@ if ( !empty($post_id) )
$s_watching_topic = ''; $s_watching_topic = '';
$s_watching_topic_img = ''; $s_watching_topic_img = '';
watch_topic_forum('topic', $s_watching_topic, $s_watching_topic_img, $userdata['user_id'], $topic_id); watch_topic_forum('topic', $s_watching_topic, $s_watching_topic_img, $user->data['user_id'], $topic_id);
// //
// Post ordering options // Post ordering options
// //
$previous_days = array(0 => $lang['All_Posts'], 1 => $lang['1_Day'], 7 => $lang['7_Days'], 14 => $lang['2_Weeks'], 30 => $lang['1_Month'], 90 => $lang['3_Months'], 180 => $lang['6_Months'], 364 => $lang['1_Year']); $previous_days = array(0 => $user->lang['All_Posts'], 1 => $user->lang['1_Day'], 7 => $user->lang['7_Days'], 14 => $user->lang['2_Weeks'], 30 => $user->lang['1_Month'], 90 => $user->lang['3_Months'], 180 => $user->lang['6_Months'], 364 => $user->lang['1_Year']);
$sort_by_text = array('a' => $lang['Author'], 't' => $lang['Post_time'], 's' => $lang['Subject']); $sort_by_text = array('a' => $user->lang['Author'], 't' => $user->lang['Post_time'], 's' => $user->lang['Subject']);
$sort_by = array('a' => 'u.username', 't' => 'p.post_id', 's' => 'pt.post_subject'); $sort_by = array('a' => 'u.username', 't' => 'p.post_id', 's' => 'pt.post_subject');
if ( isset($_POST['sort']) ) if ( isset($_POST['sort']) )
@ -245,7 +241,7 @@ foreach ( $sort_by_text as $key => $text )
$select_sort .= '</select>'; $select_sort .= '</select>';
$select_sort_dir = '<select name="sort_dir">'; $select_sort_dir = '<select name="sort_dir">';
$select_sort_dir .= ( $sort_dir == 'a' ) ? '<option value="a" selected="selected">' . $lang['Ascending'] . '</option><option value="d">' . $lang['Descending'] . '</option>' : '<option value="a">' . $lang['Ascending'] . '</option><option value="d" selected="selected">' . $lang['Descending'] . '</option>'; $select_sort_dir .= ( $sort_dir == 'a' ) ? '<option value="a" selected="selected">' . $user->lang['Ascending'] . '</option><option value="d">' . $user->lang['Descending'] . '</option>' : '<option value="a">' . $user->lang['Ascending'] . '</option><option value="d" selected="selected">' . $user->lang['Descending'] . '</option>';
$select_sort_dir .= '</select>'; $select_sort_dir .= '</select>';
$select_post_days = '<select name="postdays">'; $select_post_days = '<select name="postdays">';
@ -268,14 +264,14 @@ while ( $row = $db->sql_fetchrow($result) )
$db->sql_freeresult($result); $db->sql_freeresult($result);
$rating = ''; $rating = '';
if ( $userdata['user_id'] ) if ( $user->data['user_id'] )
{ {
$rating_text = array(-5 => $lang['Very_poor'], -2 => $lang['Quite_poor'], 0 => $lang['Unrated'], 2 => $lang['Quite_good'], 5 => $lang['Very_good']); $rating_text = array(-5 => $user->lang['Very_poor'], -2 => $user->lang['Quite_poor'], 0 => $user->lang['Unrated'], 2 => $user->lang['Quite_good'], 5 => $user->lang['Very_good']);
$sql = "SELECT rating $sql = "SELECT rating
FROM " . TOPICS_RATINGS_TABLE . " FROM " . TOPICS_RATINGS_TABLE . "
WHERE topic_id = $topic_id WHERE topic_id = $topic_id
AND user_id = " . $userdata['user_id']; AND user_id = " . $user->data['user_id'];
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$user_rating = ( $row = $db->sql_fetchrow($result) ) ? $row['rating'] : 0; $user_rating = ( $row = $db->sql_fetchrow($result) ) ? $row['rating'] : 0;
@ -332,11 +328,11 @@ $s_forum_rules = '';
get_forum_rules('topic', $s_forum_rules, $forum_id); get_forum_rules('topic', $s_forum_rules, $forum_id);
$topic_mod = ''; $topic_mod = '';
$topic_mod .= ( $auth->acl_get('m_lock', $forum_id) ) ? ( ( $topic_status == TOPIC_UNLOCKED ) ? '<option value="lock">' . $lang['Lock_topic'] . '</option>' : '<option value="unlock">' . $lang['Unlock_topic'] . '</option>' ) : ''; $topic_mod .= ( $auth->acl_get('m_lock', $forum_id) ) ? ( ( $topic_status == TOPIC_UNLOCKED ) ? '<option value="lock">' . $user->lang['Lock_topic'] . '</option>' : '<option value="unlock">' . $user->lang['Unlock_topic'] . '</option>' ) : '';
$topic_mod .= ( $auth->acl_get('m_delete', $forum_id) ) ? '<option value="delete">' . $lang['Delete_topic'] . '</option>' : ''; $topic_mod .= ( $auth->acl_get('m_delete', $forum_id) ) ? '<option value="delete">' . $user->lang['Delete_topic'] . '</option>' : '';
$topic_mod .= ( $auth->acl_get('m_move', $forum_id) ) ? '<option value="move">' . $lang['Move_topic'] . '</option>' : ''; $topic_mod .= ( $auth->acl_get('m_move', $forum_id) ) ? '<option value="move">' . $user->lang['Move_topic'] . '</option>' : '';
$topic_mod .= ( $auth->acl_get('m_split', $forum_id) ) ? '<option value="split">' . $lang['Split_topic'] . '</option>' : ''; $topic_mod .= ( $auth->acl_get('m_split', $forum_id) ) ? '<option value="split">' . $user->lang['Split_topic'] . '</option>' : '';
$topic_mod .= ( $auth->acl_get('m_merge', $forum_id) ) ? '<option value="merge">' . $lang['Merge_topic'] . '</option>' : ''; $topic_mod .= ( $auth->acl_get('m_merge', $forum_id) ) ? '<option value="merge">' . $user->lang['Merge_topic'] . '</option>' : '';
// //
// If we've got a hightlight set pass it on to pagination. // If we've got a hightlight set pass it on to pagination.
@ -353,13 +349,13 @@ $view_forum_url = 'viewforum.' . $phpEx . $SID . '&amp;f=' . $forum_id;
$view_prev_topic_url = 'viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id . '&amp;view=previous'; $view_prev_topic_url = 'viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id . '&amp;view=previous';
$view_next_topic_url = 'viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id . '&amp;view=next'; $view_next_topic_url = 'viewtopic.' . $phpEx . $SID . '&amp;f=' . $forum_id . '&amp;t=' . $topic_id . '&amp;view=next';
$reply_img = ( $forum_status == FORUM_LOCKED || $topic_status == TOPIC_LOCKED ) ? create_img($theme['reply_locked'], $lang['Topic_locked']) : create_img($theme['reply_new'], $lang['Reply_to_topic']); $reply_img = ( $forum_status == FORUM_LOCKED || $topic_status == TOPIC_LOCKED ) ? $user->img('reply_locked', $user->lang['Topic_locked']) : $user->img('reply_new', $user->lang['Reply_to_topic']);
$post_img = ( $forum_status == FORUM_LOCKED ) ? create_img($theme['post_locked'], $lang['Forum_locked']) : create_img($theme['post_new'], $lang['Post_new_topic']); $post_img = ( $forum_status == FORUM_LOCKED ) ? $user->img('post_locked', $user->lang['Forum_locked']) : $user->img('post_new', $user->lang['Post_new_topic']);
// //
// Set a cookie for this topic // Set a cookie for this topic
// //
if ( $userdata['user_id'] ) if ( $user->data['user_id'] )
{ {
$mark_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t'])) : array(); $mark_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t'])) : array();
@ -376,10 +372,8 @@ $template->set_filenames(array(
); );
make_jumpbox('viewforum.'.$phpEx, $forum_id); make_jumpbox('viewforum.'.$phpEx, $forum_id);
//
// Output page header // Output page header
// $page_title = $user->lang['View_topic'] .' - ' . $topic_title;
$page_title = $lang['View_topic'] .' - ' . $topic_title;
include($phpbb_root_path . 'includes/page_header.'.$phpEx); include($phpbb_root_path . 'includes/page_header.'.$phpEx);
if ( count($orig_word) ) if ( count($orig_word) )
@ -387,37 +381,35 @@ if ( count($orig_word) )
$topic_title = preg_replace($orig_word, $replacement_word, $topic_title); // Censor topic title $topic_title = preg_replace($orig_word, $replacement_word, $topic_title); // Censor topic title
} }
//
// Send vars to template // Send vars to template
//
$template->assign_vars(array( $template->assign_vars(array(
'FORUM_ID' => $forum_id, 'FORUM_ID' => $forum_id,
'FORUM_NAME' => $forum_name, 'FORUM_NAME' => $forum_name,
'TOPIC_ID' => $topic_id, 'TOPIC_ID' => $topic_id,
'TOPIC_TITLE' => $topic_title, 'TOPIC_TITLE' => $topic_title,
'PAGINATION' => $pagination, 'PAGINATION' => $pagination,
'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $board_config['posts_per_page'] ) + 1 ), ceil( $topic_replies / $board_config['posts_per_page'] )), 'PAGE_NUMBER' => sprintf($user->lang['Page_of'], ( floor( $start / $board_config['posts_per_page'] ) + 1 ), ceil( $topic_replies / $board_config['posts_per_page'] )),
'POST_IMG' => $post_img, 'POST_IMG' => $post_img,
'REPLY_IMG' => $reply_img, 'REPLY_IMG' => $reply_img,
'L_AUTHOR' => $lang['Author'], 'L_AUTHOR' => $user->lang['Author'],
'L_MESSAGE' => $lang['Message'], 'L_MESSAGE' => $user->lang['Message'],
'L_POSTED' => $lang['Posted'], 'L_POSTED' => $user->lang['Posted'],
'L_POST_SUBJECT' => $lang['Post_subject'], 'L_POST_SUBJECT' => $user->lang['Post_subject'],
'L_VIEW_NEXT_TOPIC' => $lang['View_next_topic'], 'L_VIEW_NEXT_TOPIC' => $user->lang['View_next_topic'],
'L_VIEW_PREVIOUS_TOPIC' => $lang['View_previous_topic'], 'L_VIEW_PREVIOUS_TOPIC' => $user->lang['View_previous_topic'],
'L_BACK_TO_TOP' => $lang['Back_to_top'], 'L_BACK_TO_TOP' => $user->lang['Back_to_top'],
'L_DISPLAY_POSTS' => $lang['Display_posts'], 'L_DISPLAY_POSTS' => $user->lang['Display_posts'],
'L_LOCK_TOPIC' => $lang['Lock_topic'], 'L_LOCK_TOPIC' => $user->lang['Lock_topic'],
'L_UNLOCK_TOPIC' => $lang['Unlock_topic'], 'L_UNLOCK_TOPIC' => $user->lang['Unlock_topic'],
'L_MOVE_TOPIC' => $lang['Move_topic'], 'L_MOVE_TOPIC' => $user->lang['Move_topic'],
'L_SPLIT_TOPIC' => $lang['Split_topic'], 'L_SPLIT_TOPIC' => $user->lang['Split_topic'],
'L_DELETE_TOPIC' => $lang['Delete_topic'], 'L_DELETE_TOPIC' => $user->lang['Delete_topic'],
'L_GOTO_PAGE' => $lang['Goto_page'], 'L_GOTO_PAGE' => $user->lang['Goto_page'],
'L_SORT_BY' => $lang['Sort_by'], 'L_SORT_BY' => $user->lang['Sort_by'],
'L_RATE_TOPIC' => $lang['Rate_topic'], 'L_RATE_TOPIC' => $user->lang['Rate_topic'],
'L_QUICK_MOD' => $lang['Quick_mod'], 'L_QUICK_MOD' => $user->lang['Quick_mod'],
'S_TOPIC_LINK' => 't', 'S_TOPIC_LINK' => 't',
'S_SELECT_SORT_DIR' => $select_sort_dir, 'S_SELECT_SORT_DIR' => $select_sort_dir,
@ -443,11 +435,11 @@ $template->assign_vars(array(
// //
$nav_links['prev'] = array( $nav_links['prev'] = array(
'url' => $view_prev_topic_url, 'url' => $view_prev_topic_url,
'title' => $lang['View_previous_topic'] 'title' => $user->lang['View_previous_topic']
); );
$nav_links['next'] = array( $nav_links['next'] = array(
'url' => $view_next_topic_url, 'url' => $view_next_topic_url,
'title' => $lang['View_next_topic'] 'title' => $user->lang['View_next_topic']
); );
$nav_links['up'] = array( $nav_links['up'] = array(
'url' => $view_forum_url, 'url' => $view_forum_url,
@ -477,7 +469,7 @@ if ( !empty($poll_start) )
$sql = "SELECT vote_id $sql = "SELECT vote_id
FROM " . VOTE_USERS_TABLE . " FROM " . VOTE_USERS_TABLE . "
WHERE vote_id = $vote_id WHERE vote_id = $vote_id
AND vote_user_id = " . $userdata['user_id']; AND vote_user_id = " . $user->data['user_id'];
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$user_voted = ( $row = $db->sql_fetchrow($result) ) ? TRUE : 0; $user_voted = ( $row = $db->sql_fetchrow($result) ) ? TRUE : 0;
@ -507,7 +499,7 @@ if ( !empty($poll_start) )
$vote_percent = ( $vote_results_sum > 0 ) ? $vote_info[$i]['vote_result'] / $vote_results_sum : 0; $vote_percent = ( $vote_results_sum > 0 ) ? $vote_info[$i]['vote_result'] / $vote_results_sum : 0;
$poll_length = round($vote_percent * $board_config['vote_graphic_length']); $poll_length = round($vote_percent * $board_config['vote_graphic_length']);
$vote_percent = sprintf("%.1d%%", ($vote_percent * 100)); $vote_percent = sprintf("%.1d%%", ($vote_percent * 100));
$vote_graphic_img = create_img($theme['voting_graphic'] . ' width="' . $poll_length . '"', $vote_percent); $vote_graphic_img = $user->img($theme['voting_graphic'] . ' width="' . $poll_length . '"', $vote_percent);
if ( count($orig_word) ) if ( count($orig_word) )
{ {
@ -526,7 +518,7 @@ if ( !empty($poll_start) )
$template->assign_vars(array( $template->assign_vars(array(
'S_HAS_POLL_DISPLAY' => true, 'S_HAS_POLL_DISPLAY' => true,
'L_TOTAL_VOTES' => $lang['Total_votes'], 'L_TOTAL_VOTES' => $user->lang['Total_votes'],
'TOTAL_VOTES' => $vote_results_sum) 'TOTAL_VOTES' => $vote_results_sum)
); );
@ -549,8 +541,8 @@ if ( !empty($poll_start) )
$template->assign_vars(array( $template->assign_vars(array(
'S_HAS_POLL_OPTIONS' => true, 'S_HAS_POLL_OPTIONS' => true,
'L_SUBMIT_VOTE' => $lang['Submit_vote'], 'L_SUBMIT_VOTE' => $user->lang['Submit_vote'],
'L_VIEW_RESULTS' => $lang['View_results'], 'L_VIEW_RESULTS' => $user->lang['View_results'],
'U_VIEW_RESULTS' => "viewtopic.$phpEx$SID&amp;t=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order&amp;vote=viewresult") 'U_VIEW_RESULTS' => "viewtopic.$phpEx$SID&amp;t=$topic_id&amp;postdays=$post_days&amp;postorder=$post_order&amp;vote=viewresult")
); );
@ -600,15 +592,15 @@ if ( $row = $db->sql_fetchrow($result) )
do do
{ {
$poster_id = $row['user_id']; $poster_id = $row['user_id'];
$poster = ( !$poster_id ) ? $lang['Guest'] : $row['username']; $poster = ( !$poster_id ) ? $user->lang['Guest'] : $row['username'];
$poster_posts = ( $row['user_id'] ) ? $lang['Posts'] . ': ' . $row['user_posts'] : ''; $poster_posts = ( $row['user_id'] ) ? $user->lang['Posts'] . ': ' . $row['user_posts'] : '';
$poster_from = ( $row['user_from'] && $row['user_id'] ) ? $lang['Location'] . ': ' . $row['user_from'] : ''; $poster_from = ( $row['user_from'] && $row['user_id'] ) ? $user->lang['Location'] . ': ' . $row['user_from'] : '';
if ( !isset($poster_details[$poster_id]['joined']) ) if ( !isset($poster_details[$poster_id]['joined']) )
{ {
$poster_details[$poster_id]['joined'] = ( $row['user_id'] ) ? $lang['Joined'] . ': ' . $user->format_date($row['user_regdate'], $lang['DATE_FORMAT']) : ''; $poster_details[$poster_id]['joined'] = ( $row['user_id'] ) ? $user->lang['Joined'] . ': ' . $user->format_date($row['user_regdate'], $user->lang['DATE_FORMAT']) : '';
} }
if ( !isset($poster_details[$poster_id]['avatar']) ) if ( !isset($poster_details[$poster_id]['avatar']) )
@ -669,25 +661,25 @@ if ( $row = $db->sql_fetchrow($result) )
if ( !$poster_id && $row['post_username'] != '' ) if ( !$poster_id && $row['post_username'] != '' )
{ {
$poster = $row['post_username']; $poster = $row['post_username'];
$poster_rank = $lang['Guest']; $poster_rank = $user->lang['Guest'];
} }
if ( !isset($poster_details[$poster_id]['profile']) && $poster_id ) if ( !isset($poster_details[$poster_id]['profile']) && $poster_id )
{ {
$temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$poster_id"; $temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$poster_id";
$poster_details[$poster_id]['profile_img'] = '<a href="' . $temp_url . '">' . create_img($theme['icon_profile'], $lang['Read_profile']) . '</a>'; $poster_details[$poster_id]['profile_img'] = '<a href="' . $temp_url . '">' . $user->img('icon_profile', $user->lang['Read_profile']) . '</a>';
$poster_details[$poster_id]['profile'] = '<a href="' . $temp_url . '">' . $lang['Read_profile'] . '</a>'; $poster_details[$poster_id]['profile'] = '<a href="' . $temp_url . '">' . $user->lang['Read_profile'] . '</a>';
$temp_url = "privmsg.$phpEx$SID&amp;mode=post&amp;u=$poster_id"; $temp_url = "privmsg.$phpEx$SID&amp;mode=post&amp;u=$poster_id";
$poster_details[$poster_id]['pm_img'] = '<a href="' . $temp_url . '">' . create_img($theme['icon_pm'], $lang['Send_private_message']) . '</a>'; $poster_details[$poster_id]['pm_img'] = '<a href="' . $temp_url . '">' . $user->img('icon_pm', $user->lang['Send_private_message']) . '</a>';
$poster_details[$poster_id]['pm'] = '<a href="' . $temp_url . '">' . $lang['Send_private_message'] . '</a>'; $poster_details[$poster_id]['pm'] = '<a href="' . $temp_url . '">' . $user->lang['Send_private_message'] . '</a>';
if ( !empty($row['user_viewemail']) || $auth->acl_get('m_', $forum_id) ) if ( !empty($row['user_viewemail']) || $auth->acl_get('m_', $forum_id) )
{ {
$email_uri = ( $board_config['board_email_form'] ) ? "profile.$phpEx$SID&amp;mode=email&amp;u=" . $poster_id : 'mailto:' . $row['user_email']; $email_uri = ( $board_config['board_email_form'] ) ? "profile.$phpEx$SID&amp;mode=email&amp;u=" . $poster_id : 'mailto:' . $row['user_email'];
$poster_details[$poster_id]['email_img'] = '<a href="' . $email_uri . '">' . create_img($theme['icon_email'], $lang['Send_email']) . '</a>'; $poster_details[$poster_id]['email_img'] = '<a href="' . $email_uri . '">' . $user->img('icon_email', $user->lang['Send_email']) . '</a>';
$poster_details[$poster_id]['email'] = '<a href="' . $email_uri . '">' . $lang['Send_email'] . '</a>'; $poster_details[$poster_id]['email'] = '<a href="' . $email_uri . '">' . $user->lang['Send_email'] . '</a>';
} }
else else
{ {
@ -695,14 +687,14 @@ if ( $row = $db->sql_fetchrow($result) )
$poster_details[$poster_id]['email'] = ''; $poster_details[$poster_id]['email'] = '';
} }
$poster_details[$poster_id]['www_img'] = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . create_img($theme['icon_www'], $lang['Visit_website']) . '</a>' : ''; $poster_details[$poster_id]['www_img'] = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $user->img('icon_www', $user->lang['Visit_website']) . '</a>' : '';
$poster_details[$poster_id]['www'] = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $lang['Visit_website'] . '</a>' : ''; $poster_details[$poster_id]['www'] = ( $row['user_website'] ) ? '<a href="' . $row['user_website'] . '" target="_userwww">' . $user->lang['Visit_website'] . '</a>' : '';
if ( !empty($row['user_icq']) ) if ( !empty($row['user_icq']) )
{ {
$poster_details[$poster_id]['icq_status_img'] = '<a href="http://wwp.icq.com/' . $row['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>'; $poster_details[$poster_id]['icq_status_img'] = '<a href="http://wwp.icq.com/' . $row['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $row['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
$poster_details[$poster_id]['icq_img'] = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . create_img($theme['icon_icq'], $lang['ICQ']) . '</a>'; $poster_details[$poster_id]['icq_img'] = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $user->img('icon_icq', $user->lang['ICQ']) . '</a>';
$poster_details[$poster_id]['icq'] = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $lang['ICQ'] . '</a>'; $poster_details[$poster_id]['icq'] = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $row['user_icq'] . '">' . $user->lang['ICQ'] . '</a>';
} }
else else
{ {
@ -711,21 +703,21 @@ if ( $row = $db->sql_fetchrow($result) )
$poster_details[$poster_id]['icq'] = ''; $poster_details[$poster_id]['icq'] = '';
} }
$poster_details[$poster_id]['aim_img'] = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . create_img($theme['icon_aim'], $lang['AIM']) . '</a>' : ''; $poster_details[$poster_id]['aim_img'] = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $user->img('icon_aim', $user->lang['AIM']) . '</a>' : '';
$poster_details[$poster_id]['aim'] = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $lang['AIM'] . '</a>' : ''; $poster_details[$poster_id]['aim'] = ( $row['user_aim'] ) ? '<a href="aim:goim?screenname=' . $row['user_aim'] . '&amp;message=Hello+Are+you+there?">' . $user->lang['AIM'] . '</a>' : '';
$temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$poster_id"; $temp_url = "profile.$phpEx$SID&amp;mode=viewprofile&amp;u=$poster_id";
$poster_details[$poster_id]['msn_img'] = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . create_img($theme['icon_msnm'], $lang['MSNM']) . '</a>' : ''; $poster_details[$poster_id]['msn_img'] = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $user->img('icon_msnm', $user->lang['MSNM']) . '</a>' : '';
$poster_details[$poster_id]['msn'] = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $lang['MSNM'] . '</a>' : ''; $poster_details[$poster_id]['msn'] = ( $row['user_msnm'] ) ? '<a href="' . $temp_url . '">' . $user->lang['MSNM'] . '</a>' : '';
$poster_details[$poster_id]['yim_img'] = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . create_img($theme['icon_yim'], $lang['YIM']) . '</a>' : ''; $poster_details[$poster_id]['yim_img'] = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $user->img('icon_yim', $user->lang['YIM']) . '</a>' : '';
$poster_details[$poster_id]['yim'] = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $lang['YIM'] . '</a>' : ''; $poster_details[$poster_id]['yim'] = ( $row['user_yim'] ) ? '<a href="http://edit.yahoo.com/config/send_webmesg?.target=' . $row['user_yim'] . '&amp;.src=pg">' . $user->lang['YIM'] . '</a>' : '';
if ( $auth->acl_get('f_search', $forum_id) ) if ( $auth->acl_get('f_search', $forum_id) )
{ {
$temp_url = 'search.' . $phpEx . $SID . '&amp;search_author=' . urlencode($row['username']) .'"&amp;showresults=posts'; $temp_url = 'search.' . $phpEx . $SID . '&amp;search_author=' . urlencode($row['username']) .'"&amp;showresults=posts';
$search_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_search'], $lang['Search_user_posts']) . '</a>'; $search_img = '<a href="' . $temp_url . '">' . $user->img('icon_search', $user->lang['Search_user_posts']) . '</a>';
$search ='<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>'; $search ='<a href="' . $temp_url . '">' . $user->lang['Search_user_posts'] . '</a>';
} }
else else
{ {
@ -759,14 +751,14 @@ if ( $row = $db->sql_fetchrow($result) )
// Non-user specific images/text // Non-user specific images/text
// //
$temp_url = 'posting.' . $phpEx . $SID . '&amp;mode=quote&amp;p=' . $row['post_id']; $temp_url = 'posting.' . $phpEx . $SID . '&amp;mode=quote&amp;p=' . $row['post_id'];
$quote_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_quote'], $lang['Reply_with_quote']) . '</a>'; $quote_img = '<a href="' . $temp_url . '">' . $user->img('icon_quote', $user->lang['Reply_with_quote']) . '</a>';
$quote = '<a href="' . $temp_url . '">' . $lang['Reply_with_quote'] . '</a>'; $quote = '<a href="' . $temp_url . '">' . $user->lang['Reply_with_quote'] . '</a>';
if ( ( $userdata['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) ) || $auth->acl_get('m_edit', $forum_id) || $auth->acl_get('a_') ) if ( ( $user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) ) || $auth->acl_get('m_edit', $forum_id) || $auth->acl_get('a_') )
{ {
$temp_url = "posting.$phpEx$SID&amp;mode=editpost&amp;p=" . $row['post_id']; $temp_url = "posting.$phpEx$SID&amp;mode=editpost&amp;p=" . $row['post_id'];
$edit_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_edit'], $lang['Edit_delete_post']) . '</a>'; $edit_img = '<a href="' . $temp_url . '">' . $user->img('icon_edit', $user->lang['Edit_delete_post']) . '</a>';
$edit = '<a href="' . $temp_url . '">' . $lang['Edit_delete_post'] . '</a>'; $edit = '<a href="' . $temp_url . '">' . $user->lang['Edit_delete_post'] . '</a>';
} }
else else
{ {
@ -777,8 +769,8 @@ if ( $row = $db->sql_fetchrow($result) )
if ( $auth->acl_get('m_ip', $forum_id) ) if ( $auth->acl_get('m_ip', $forum_id) )
{ {
$temp_url = "modcp.$phpEx$SID&amp;mode=ip&amp;p=" . $row['post_id'] . "&amp;t=" . $topic_id; $temp_url = "modcp.$phpEx$SID&amp;mode=ip&amp;p=" . $row['post_id'] . "&amp;t=" . $topic_id;
$ip_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_ip'], $lang['View_IP']) . '</a>'; $ip_img = '<a href="' . $temp_url . '">' . $user->img('icon_ip', $user->lang['View_IP']) . '</a>';
$ip = '<a href="' . $temp_url . '">' . $lang['View_IP'] . '</a>'; $ip = '<a href="' . $temp_url . '">' . $user->lang['View_IP'] . '</a>';
} }
else else
{ {
@ -786,11 +778,11 @@ if ( $row = $db->sql_fetchrow($result) )
$ip = ''; $ip = '';
} }
if ( ( $userdata['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $forum_topic_data['topic_last_post_id'] == $row['post_id'] ) || $auth->acl_get('m_delete', $forum_id) ) if ( ( $user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $forum_topic_data['topic_last_post_id'] == $row['post_id'] ) || $auth->acl_get('m_delete', $forum_id) )
{ {
$temp_url = "posting.$phpEx$SID&amp;mode=delete&amp;p=" . $row['post_id']; $temp_url = "posting.$phpEx$SID&amp;mode=delete&amp;p=" . $row['post_id'];
$delpost_img = '<a href="' . $temp_url . '">' . create_img($theme['icon_delete'], $lang['Delete_post']) . '</a>'; $delpost_img = '<a href="' . $temp_url . '">' . $user->img('icon_delete', $user->lang['Delete_post']) . '</a>';
$delpost = '<a href="' . $temp_url . '">' . $lang['Delete_post'] . '</a>'; $delpost = '<a href="' . $temp_url . '">' . $user->lang['Delete_post'] . '</a>';
} }
else else
{ {
@ -932,7 +924,7 @@ if ( $row = $db->sql_fetchrow($result) )
// //
if ( $row['post_edit_count'] ) if ( $row['post_edit_count'] )
{ {
$l_edit_time_total = ( $row['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total']; $l_edit_time_total = ( $row['post_edit_count'] == 1 ) ? $user->lang['Edited_time_total'] : $user->lang['Edited_times_total'];
$l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, $poster, $user->format_date($row['post_edit_time']), $row['post_edit_count']); $l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, $poster, $user->format_date($row['post_edit_time']), $row['post_edit_count']);
} }
@ -951,7 +943,7 @@ if ( $row = $db->sql_fetchrow($result) )
if ( $user_sig != '' && $user_sig_bbcode_uid != '' && $auth->acl_get('f_sigs', $forum_id) ) if ( $user_sig != '' && $user_sig_bbcode_uid != '' && $auth->acl_get('f_sigs', $forum_id) )
{ {
if ( !$auth->acl_get('f_html', $forum_id) && $userdata['user_allowhtml'] ) if ( !$auth->acl_get('f_html', $forum_id) && $user->data['user_allowhtml'] )
{ {
$user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "&lt;\\2&gt;", $user_sig); $user_sig = preg_replace('#(<)([\/]?.*?)(>)#is', "&lt;\\2&gt;", $user_sig);
} }
@ -981,7 +973,7 @@ if ( $row = $db->sql_fetchrow($result) )
// //
// Define the little post icon // Define the little post icon
// //
$mini_post_img = ( $row['post_time'] > $userdata['user_lastvisit'] && $row['post_time'] > $topic_last_read ) ? create_img($theme['goto_post_new'], $lang['New_post']) : create_img($theme['goto_post'], $lang['Post']); $mini_post_img = ( $row['post_time'] > $user->data['user_lastvisit'] && $row['post_time'] > $topic_last_read ) ? $user->img('goto_post_new', $user->lang['New_post']) : $user->img('goto_post', $user->lang['Post']);
// //
// Again this will be handled by the templating // Again this will be handled by the templating
@ -1039,12 +1031,14 @@ if ( $row = $db->sql_fetchrow($result) )
'U_MINI_POST' => $mini_post_url, 'U_MINI_POST' => $mini_post_url,
'U_POST_ID' => $row['post_id']) 'U_POST_ID' => $row['post_id'])
); );
$i++;
} }
while ( $row = $db->sql_fetchrow($result) ); while ( $row = $db->sql_fetchrow($result) );
} }
else else
{ {
message_die(MESSAGE, $lang['No_posts_topic']); message_die(MESSAGE, $user->lang['No_posts_topic']);
} }
// //