Merge commit 'release-3.0-B4'

This commit is contained in:
Nils Adermann 2010-03-02 01:05:34 +01:00
commit 89b37954f9
237 changed files with 3504 additions and 2534 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 B

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 B

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 230 B

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 B

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 357 B

View file

@ -206,6 +206,7 @@ function adm_page_footer($copyright_html = true)
$template->assign_vars(array( $template->assign_vars(array(
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
'S_COPYRIGHT_HTML' => $copyright_html, 'S_COPYRIGHT_HTML' => $copyright_html,
'VERSION' => $config['version']) 'VERSION' => $config['version'])
); );

View file

@ -59,6 +59,7 @@
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset> </fieldset>
@ -80,10 +81,10 @@
<dt><label for="exclude">{L_IP_EXCLUDE}:</label><br /><span>{L_EXCLUDE_ENTERED_IP}</span></dt> <dt><label for="exclude">{L_IP_EXCLUDE}:</label><br /><span>{L_EXCLUDE_ENTERED_IP}</span></dt>
<dd><input type="radio" id="exclude" name="ipexclude" value="1" class="radio" /> {L_YES} &nbsp; <input type="radio" name="ipexclude" value="0" checked="checked" class="radio" /> {L_NO}</dd> <dd><input type="radio" id="exclude" name="ipexclude" value="1" class="radio" /> {L_YES} &nbsp; <input type="radio" name="ipexclude" value="0" checked="checked" class="radio" /> {L_NO}</dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" id="securesubmit" name="securesubmit" value="{L_SUBMIT}" /> <input class="button1" type="submit" id="securesubmit" name="securesubmit" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
<fieldset> <fieldset>
@ -94,10 +95,10 @@
<dt><label for="remove_ip_hostname">{L_IP_HOSTNAME}:</label></dt> <dt><label for="remove_ip_hostname">{L_IP_HOSTNAME}:</label></dt>
<dd><select name="unip[]" id="remove_ip_hostname" multiple="multiple" size="10">{DEFINED_IPS}</select></dd> <dd><select name="unip[]" id="remove_ip_hostname" multiple="multiple" size="10">{DEFINED_IPS}</select></dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" id="unsecuresubmit" name="unsecuresubmit" value="{L_SUBMIT}" /> <input class="button1" type="submit" id="unsecuresubmit" name="unsecuresubmit" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
<!-- ELSE --> <!-- ELSE -->
@ -207,16 +208,21 @@
<dd><input type="radio" id="allowed_forums" class="radio" name="forum_select" value="0"<!-- IF not S_FORUM_IDS --> checked="checked"<!-- ENDIF --> />&nbsp;{L_ALLOW_ALL_FORUMS}&nbsp;&nbsp;<input type="radio" class="radio" name="forum_select" value="1"<!-- IF S_FORUM_IDS --> checked="checked"<!-- ENDIF --> />&nbsp;{L_ALLOW_SELECTED_FORUMS}</dd> <dd><input type="radio" id="allowed_forums" class="radio" name="forum_select" value="0"<!-- IF not S_FORUM_IDS --> checked="checked"<!-- ENDIF --> />&nbsp;{L_ALLOW_ALL_FORUMS}&nbsp;&nbsp;<input type="radio" class="radio" name="forum_select" value="1"<!-- IF S_FORUM_IDS --> checked="checked"<!-- ENDIF --> />&nbsp;{L_ALLOW_SELECTED_FORUMS}</dd>
<dd><select name="allowed_forums[]" multiple="multiple" size="8">{S_FORUM_ID_OPTIONS}</select></dd> <dd><select name="allowed_forums[]" multiple="multiple" size="8">{S_FORUM_ID_OPTIONS}</select></dd>
</dl> </dl>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>
<!-- ELSE --> <!-- ELSE -->
<form id="extgroups" method="post" action="{U_ACTION}">
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
<table cellspacing="1"> <table cellspacing="1">
<col class="row1" /><col class="row1" /><col class="row2" /> <col class="row1" /><col class="row1" /><col class="row2" />
<thead> <thead>
@ -243,11 +249,10 @@
<!-- END groups --> <!-- END groups -->
</tbody> </tbody>
</table> </table>
<p class="quick">
<form id="extgroups" method="post" action="{U_ACTION}">
<fieldset class="quick">
{L_CREATE_GROUP}: <input type="text" name="group_name" maxlength="30" /> {L_CREATE_GROUP}: <input type="text" name="group_name" maxlength="30" />
<input class="button2" name="add" type="submit" value="{L_SUBMIT}" /> <input class="button2" name="add" type="submit" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -266,10 +271,10 @@
<dt><label for="extension_group">{L_EXTENSION_GROUP}</label></dt> <dt><label for="extension_group">{L_EXTENSION_GROUP}</label></dt>
<dd>{GROUP_SELECT_OPTIONS}</dd> <dd>{GROUP_SELECT_OPTIONS}</dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input type="submit" id="add_extension_check" name="add_extension_check" class="button2" value="{L_SUBMIT}" /> <input type="submit" id="add_extension_check" name="add_extension_check" class="button2" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -278,6 +283,9 @@
<form id="change_ext" method="post" action="{U_ACTION}"> <form id="change_ext" method="post" action="{U_ACTION}">
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
<table cellspacing="1"> <table cellspacing="1">
<col class="row1" /><col class="row1" /><col class="row2" /> <col class="row1" /><col class="row1" /><col class="row2" />
<thead> <thead>
@ -303,9 +311,10 @@
</tbody> </tbody>
</table> </table>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -314,6 +323,9 @@
<form id="orphan" method="post" action="{U_ACTION}"> <form id="orphan" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_TITLE}</legend>
<table cellspacing="1"> <table cellspacing="1">
<thead> <thead>
<tr> <tr>
@ -346,9 +358,11 @@
<br /> <br />
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -65,11 +65,11 @@
<dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt> <dt><label for="bangivereason">{L_BAN_GIVE_REASON}:</label></dt>
<dd><input name="bangivereason" type="text" id="bangivereason" class="medium" /></dd> <dd><input name="bangivereason" type="text" id="bangivereason" class="medium" /></dd>
</dl> </dl>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="bansubmit" name="bansubmit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="bansubmit" name="bansubmit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="banreset" name="banreset" value="{L_RESET}" /> <input class="button2" type="reset" id="banreset" name="banreset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
<br /><br /> <br /><br />
@ -98,11 +98,11 @@
<dt><label for="unbangivereason">{L_BAN_GIVE_REASON}:</label></dt> <dt><label for="unbangivereason">{L_BAN_GIVE_REASON}:</label></dt>
<dd><input style="border: 0px;" type="text" name="unbangivereason" id="unbangivereason" class="full" disabled="disabled" /></dd> <dd><input style="border: 0px;" type="text" name="unbangivereason" id="unbangivereason" class="full" disabled="disabled" /></dd>
</dl> </dl>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="unbansubmit" name="unbansubmit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="unbansubmit" name="unbansubmit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="unbanreset" name="unbanreset" value="{L_RESET}" /> <input class="button2" type="reset" id="unbanreset" name="unbanreset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
<!-- ELSE --> <!-- ELSE -->

View file

@ -48,6 +48,7 @@
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset> </fieldset>
@ -85,6 +86,10 @@
<p>{L_ACP_BBCODES_EXPLAIN}</p> <p>{L_ACP_BBCODES_EXPLAIN}</p>
<form id="acp_bbcodes" method="post" action="{U_ACTION}">
<fieldset class="tabulated">
<legend>{L_ACP_BBCODES}</legend>
<table cellspacing="1" id="down"> <table cellspacing="1" id="down">
<thead> <thead>
<tr> <tr>
@ -102,10 +107,9 @@
</tbody> </tbody>
</table> </table>
<form id="acp_bbcodes" method="post" action="{U_ACTION}"> <p class="quick">
<fieldset class="quick">
<input class="button2" name="submit" type="submit" value="{L_ADD_BBCODE}" /> <input class="button2" name="submit" type="submit" value="{L_ADD_BBCODE}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -40,6 +40,7 @@
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset> </fieldset>

View file

@ -45,11 +45,11 @@
<dt><label for="bot_ip">{L_BOT_IP}:</label><br /><span>{L_BOT_IP_EXPLAIN}</span></dt> <dt><label for="bot_ip">{L_BOT_IP}:</label><br /><span>{L_BOT_IP_EXPLAIN}</span></dt>
<dd><input name="bot_ip" type="text" id="bot_ip" value="{BOT_IP}" /></dd> <dd><input name="bot_ip" type="text" id="bot_ip" value="{BOT_IP}" /></dd>
</dl> </dl>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -28,11 +28,11 @@
<dd><input id="captcha_gd_noise" name="captcha_gd_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="captcha_gd_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd> <dd><input id="captcha_gd_noise" name="captcha_gd_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input name="captcha_gd_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_NOISE --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -15,16 +15,16 @@
<dt><label for="user">{L_SELECT_FILE}:</label></dt> <dt><label for="user">{L_SELECT_FILE}:</label></dt>
<dd><select id="file" name="file" size="10"><!-- BEGIN files --><option value="{files.FILE}"<!-- IF files.S_LAST_ROW --> selected="selected"<!-- ENDIF -->>{files.NAME}</option><!-- END files --></select></dd> <dd><select id="file" name="file" size="10"><!-- BEGIN files --><option value="{files.FILE}"<!-- IF files.S_LAST_ROW --> selected="selected"<!-- ENDIF -->>{files.NAME}</option><!-- END files --></select></dd>
</dl> </dl>
</fieldset>
<!-- IF EXISTS --> <!-- IF EXISTS -->
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_START_RESTORE}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_START_RESTORE}" />&nbsp;
<input class="button2" type="submit" id="delete" name="delete" value="{L_DELETE_BACKUP}" />&nbsp; <input class="button2" type="submit" id="delete" name="delete" value="{L_DELETE_BACKUP}" />&nbsp;
<input class="button2" type="submit" id="download" name="download" value="{L_DOWNLOAD_BACKUP}" /> <input class="button2" type="submit" id="download" name="download" value="{L_DOWNLOAD_BACKUP}" />
</fieldset> </p>
<!-- ENDIF --> <!-- ENDIF -->
</fieldset>
</form> </form>
<!-- ELSE --> <!-- ELSE -->
@ -74,11 +74,11 @@
<!-- END tables --> <!-- END tables -->
</select><br /><br /><div align="right"><a href="#" onclick="selector(true)">{L_SELECT_ALL}</a><br /><a href="#" onclick="selector(false)">{L_DESELECT_ALL}</a></div></dd> </select><br /><br /><div align="right"><a href="#" onclick="selector(true)">{L_SELECT_ALL}</a><br /><a href="#" onclick="selector(false)">{L_DESELECT_ALL}</a></div></dd>
</dl> </dl>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -14,10 +14,10 @@
<dt><label for="user">{L_USERNAME}:</label><br /><span>{L_ADD_DISALLOW_EXPLAIN}</span></dt> <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_ADD_DISALLOW_EXPLAIN}</span></dt>
<dd><input id="user" type="text" name="disallowed_user" class="medium" /></dd> <dd><input id="user" type="text" name="disallowed_user" class="medium" /></dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" name="disallow" value="{L_SUBMIT}" /> <input class="button1" type="submit" name="disallow" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
<h1>{L_DELETE_DISALLOW_TITLE}</h1> <h1>{L_DELETE_DISALLOW_TITLE}</h1>
@ -31,10 +31,10 @@
<dt><label for="disallowed">{L_USERNAME}:</label></dt> <dt><label for="disallowed">{L_USERNAME}:</label></dt>
<dd><select name="disallowed_id" id="disallowed">{S_DISALLOWED_NAMES}</select></dd> <dd><select name="disallowed_id" id="disallowed">{S_DISALLOWED_NAMES}</select></dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" name="allow" value="{L_SUBMIT}" /> <input class="button1" type="submit" name="allow" value="{L_SUBMIT}" />
</p>
<!-- ELSE --> <!-- ELSE -->
<p>{L_NO_DISALLOWED}</p> <p>{L_NO_DISALLOWED}</p>
<!-- ENDIF --> <!-- ENDIF -->

View file

@ -24,7 +24,7 @@
<dl> <dl>
<dt><label for="usernames">{L_SEND_TO_USERS}:</label><br /><span>{L_SEND_TO_USERS_EXPLAIN}</span></dt> <dt><label for="usernames">{L_SEND_TO_USERS}:</label><br /><span>{L_SEND_TO_USERS_EXPLAIN}</span></dt>
<dd><textarea name="usernames" id="usernames" rows="5" cols="40">{USERNAMES}</textarea></dd> <dd><textarea name="usernames" id="usernames" rows="5" cols="40">{USERNAMES}</textarea></dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false;">{L_FIND_USERNAME}</a> ]</dd>
</dl> </dl>
<dl> <dl>
<dt><label for="subject">{L_SUBJECT}:</label></dt> <dt><label for="subject">{L_SUBJECT}:</label></dt>
@ -42,11 +42,11 @@
<dt><label for="send">{L_SEND_IMMEDIATLY}:</label></dt> <dt><label for="send">{L_SEND_IMMEDIATLY}:</label></dt>
<dd><input id="send" type="checkbox" class="radio" name="send_immediatly" checked="checked" /></dd> <dd><input id="send" type="checkbox" class="radio" name="send_immediatly" checked="checked" /></dd>
</dl> </dl>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_EMAIL}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_EMAIL}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -7,6 +7,9 @@
<script type="text/javascript"> <script type="text/javascript">
<!-- <!--
/**
* Handle displaying/hiding several options based on the forum type
*/
function display_options(value) function display_options(value)
{ {
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST --> <!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST -->
@ -20,6 +23,17 @@
} }
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS -->
if (value == {FORUM_LINK})
{
dE('cat_to_link_actions', 1);
}
else
{
dE('cat_to_link_actions', -1);
}
<!-- ENDIF -->
if (value == {FORUM_POST}) if (value == {FORUM_POST})
{ {
dE('forum_post_options', 1); dE('forum_post_options', 1);
@ -43,6 +57,41 @@
} }
} }
/**
* Init the wanted display functionality if javascript is enabled.
* If javascript is not available, the user is still able to properly administrate.
*/
onload = function()
{
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST -->
<!-- IF S_FORUM_POST -->
dE('type_actions', -1);
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS -->
<!-- IF S_FORUM_CAT -->
dE('cat_to_link_actions', -1);
<!-- ENDIF -->
<!-- ENDIF -->
<!-- IF not S_FORUM_POST -->
dE('forum_post_options', -1);
<!-- ENDIF -->
<!-- IF not S_FORUM_CAT -->
dE('forum_cat_options', -1);
<!-- ENDIF -->
<!-- IF not S_FORUM_LINK -->
dE('forum_link_options', -1);
<!-- ENDIF -->
<!-- IF S_FORUM_LINK -->
dE('forum_rules_options', -1);
<!-- ENDIF -->
}
//--> //-->
</script> </script>
@ -68,7 +117,7 @@
<dd><select id="forum_type" name="forum_type" onchange="display_options(this.options[this.selectedIndex].value);">{S_FORUM_TYPE_OPTIONS}</select></dd> <dd><select id="forum_type" name="forum_type" onchange="display_options(this.options[this.selectedIndex].value);">{S_FORUM_TYPE_OPTIONS}</select></dd>
</dl> </dl>
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST --> <!-- IF not S_ADD_ACTION and S_FORUM_ORIG_POST -->
<div id="type_actions"<!-- IF S_FORUM_POST --> style="display: none;"<!-- ENDIF -->> <div id="type_actions">
<dl> <dl>
<dt><label for="type_action">{L_DECIDE_MOVE_DELETE_CONTENT}:</label></dt> <dt><label for="type_action">{L_DECIDE_MOVE_DELETE_CONTENT}:</label></dt>
<dd><input type="radio" class="radio" id="type_action" name="type_action" value="delete" checked="checked" /> {L_DELETE_ALL_POSTS}</dd> <dd><input type="radio" class="radio" id="type_action" name="type_action" value="delete" checked="checked" /> {L_DELETE_ALL_POSTS}</dd>
@ -76,6 +125,18 @@
</dl> </dl>
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF not S_ADD_ACTION and S_FORUM_ORIG_CAT and S_HAS_SUBFORUMS -->
<div id="cat_to_link_actions">
<dl>
<dt><label for="action_subforums">{L_DECIDE_MOVE_DELETE_SUBFORUMS}:</label></dt>
<!-- IF S_FORUMS_LIST -->
<dd><input type="radio" class="radio" name="action_subforums" value="move" checked="checked" /> {L_MOVE_SUBFORUMS_TO} <select name="subforums_to_id">{S_FORUMS_LIST}</select></dd>
<!-- ELSE -->
<dd><input type="radio" class="radio" id="action_subforums" name="action_subforums" value="delete" checked="checked" /> {L_DELETE_SUBFORUMS}</dd>
<!-- ENDIF -->
</dl>
</div>
<!-- ENDIF -->
<dl> <dl>
<dt><label for="parent">{L_FORUM_PARENT}:</label></dt> <dt><label for="parent">{L_FORUM_PARENT}:</label></dt>
<dd><select id="parent" name="forum_parent_id"><option value="0"<!-- IF not S_FORUM_PARENT_ID --> selected="selected"<!-- ENDIF -->>{L_NO_PARENT}</option>{S_PARENT_OPTIONS}</select></dd> <dd><select id="parent" name="forum_parent_id"><option value="0"<!-- IF not S_FORUM_PARENT_ID --> selected="selected"<!-- ENDIF -->>{L_NO_PARENT}</option>{S_PARENT_OPTIONS}</select></dd>
@ -114,7 +175,7 @@
</dl> </dl>
</fieldset> </fieldset>
<div id="forum_cat_options"<!-- IF not S_FORUM_CAT --> style="display: none;"<!-- ENDIF -->> <div id="forum_cat_options">
<fieldset> <fieldset>
<legend>{L_GENERAL_FORUM_SETTINGS}</legend> <legend>{L_GENERAL_FORUM_SETTINGS}</legend>
<dl> <dl>
@ -124,7 +185,7 @@
</fieldset> </fieldset>
</div> </div>
<div id="forum_post_options"<!-- IF not S_FORUM_POST --> style="display: none;"<!-- ENDIF -->> <div id="forum_post_options">
<fieldset> <fieldset>
<legend>{L_GENERAL_FORUM_SETTINGS}</legend> <legend>{L_GENERAL_FORUM_SETTINGS}</legend>
<dl> <dl>
@ -192,7 +253,7 @@
</fieldset> </fieldset>
</div> </div>
<div id="forum_link_options"<!-- IF not S_FORUM_LINK --> style="display: none;"<!-- ENDIF -->> <div id="forum_link_options">
<fieldset> <fieldset>
<legend>{L_GENERAL_FORUM_SETTINGS}</legend> <legend>{L_GENERAL_FORUM_SETTINGS}</legend>
<dl> <dl>
@ -206,7 +267,7 @@
</fieldset> </fieldset>
</div> </div>
<div id="forum_rules_options"<!-- IF S_FORUM_LINK --> style="display: none;"<!-- ENDIF -->> <div id="forum_rules_options">
<fieldset> <fieldset>
<legend>{L_FORUM_RULES}</legend> <legend>{L_FORUM_RULES}</legend>
<dl> <dl>
@ -228,6 +289,7 @@
</div> </div>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset> </fieldset>
@ -275,10 +337,10 @@
<!-- ENDIF --> <!-- ENDIF -->
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -329,7 +391,7 @@
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_RESYNCED --> <!-- IF S_RESYNCED -->
<script language="javascript" type="text/javascript"> <script type="text/javascript">
<!-- <!--
var close_waitscreen = 1; var close_waitscreen = 1;
//--> //-->
@ -351,7 +413,7 @@
<tr> <tr>
<td style="width: 5%;">{forums.FOLDER_IMAGE}</td> <td style="width: 5%;">{forums.FOLDER_IMAGE}</td>
<td> <td>
<!-- IF forums.FORUM_IMAGE --><div style="float: left;">{forums.FORUM_IMAGE}</div><!-- ENDIF --> <!-- IF forums.FORUM_IMAGE --><div style="float: left; margin-right: 5px;">{forums.FORUM_IMAGE}</div><!-- ENDIF -->
<strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong> <strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong>
<!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF --> <!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF -->
<!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <b>{forums.FORUM_TOPICS}</b> / {L_POSTS}: <b>{forums.FORUM_POSTS}</b></span><!-- ENDIF --> <!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <b>{forums.FORUM_TOPICS}</b> / {L_POSTS}: <b>{forums.FORUM_POSTS}</b></span><!-- ENDIF -->

View file

@ -54,6 +54,12 @@
<fieldset> <fieldset>
<legend>{L_GROUP_SETTINGS_SAVE}</legend> <legend>{L_GROUP_SETTINGS_SAVE}</legend>
<!-- IF S_USER_FOUNDER -->
<dl>
<dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}:</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt>
<dd><input name="group_founder_manage" type="checkbox" class="radio" id="group_founder_manage"{GROUP_FOUNDER_MANAGE} /></dd>
</dl>
<!-- ENDIF -->
<dl> <dl>
<dt><label for="group_legend">{L_GROUP_LEGEND}:</label></dt> <dt><label for="group_legend">{L_GROUP_LEGEND}:</label></dt>
<dd><input name="group_legend" type="checkbox" class="radio" id="group_legend"{GROUP_LEGEND} /></dd> <dd><input name="group_legend" type="checkbox" class="radio" id="group_legend"{GROUP_LEGEND} /></dd>
@ -143,6 +149,7 @@
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset> </fieldset>
@ -247,12 +254,12 @@
<dl> <dl>
<dt><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt> <dt><label for="usernames">{L_USERNAME}:</label><br /><span>{L_USERNAMES_EXPLAIN}</span></dt>
<dd><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea></dd> <dd><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea></dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false;">{L_FIND_USERNAME}</a> ]</dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button2" type="submit" name="addusers" value="{L_SUBMIT}" /> <input class="button2" type="submit" name="addusers" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -289,6 +296,11 @@
<tbody> <tbody>
<!-- BEGIN groups --> <!-- BEGIN groups -->
<!-- IF groups.S_SPECIAL --> <!-- IF groups.S_SPECIAL -->
<!-- IF groups.S_FIRST_ROW -->
<tr>
<td colspan="5" class="row3">{L_NO_GROUPS_CREATED}</td>
</tr>
<!-- ENDIF -->
</tbody> </tbody>
</table> </table>

View file

@ -12,6 +12,9 @@
<form id="acp_icons" method="post" action="{U_ACTION}"> <form id="acp_icons" method="post" action="{U_ACTION}">
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
<table cellspacing="1"> <table cellspacing="1">
<thead> <thead>
<tr> <tr>
@ -64,9 +67,10 @@
</tbody> </tbody>
</table> </table>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -86,7 +90,6 @@
<!-- IF not S_PAK_OPTIONS --> <!-- IF not S_PAK_OPTIONS -->
<p>{L_NO_PAK_OPTIONS}</p> <p>{L_NO_PAK_OPTIONS}</p>
</fieldset>
<!-- ELSE --> <!-- ELSE -->
<dl> <dl>
@ -96,12 +99,12 @@
<dt><label for="current">{L_CURRENT}</label><br /><span>{L_CURRENT_EXPLAIN}</span></dt> <dt><label for="current">{L_CURRENT}</label><br /><span>{L_CURRENT_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" id="current" name="current" value="keep" checked="checked" /> {L_KEEP_ALL}&nbsp; &nbsp;<input type="radio" class="radio" name="current" value="replace" /> {L_REPLACE_MATCHES}&nbsp; &nbsp;<input type="radio" class="radio" name="current" value="delete" /> {L_DELETE_ALL}&nbsp;</dd> <dd><input type="radio" class="radio" id="current" name="current" value="keep" checked="checked" /> {L_KEEP_ALL}&nbsp; &nbsp;<input type="radio" class="radio" name="current" value="replace" /> {L_REPLACE_MATCHES}&nbsp; &nbsp;<input type="radio" class="radio" name="current" value="delete" /> {L_DELETE_ALL}&nbsp;</dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" id="import" name="import" value="{L_IMPORT_SUBMIT}" /> <input class="button1" type="submit" id="import" name="import" value="{L_IMPORT_SUBMIT}" />
</fieldset> </p>
<!-- ENDIF --> <!-- ENDIF -->
</fieldset>
</form> </form>
@ -118,6 +121,10 @@
</div> </div>
<!-- ENDIF --> <!-- ENDIF -->
<form id="acp_icons" method="post" action="{U_ACTION}">
<fieldset class="tabular">
<legend>{L_TITLE}<legend>
<div style="text-align: right;"><a href="{U_IMPORT}">{L_IMPORT}</a> | <a href="{U_EXPORT}">{L_EXPORT}</a></div> <div style="text-align: right;"><a href="{U_IMPORT}">{L_IMPORT}</a> | <a href="{U_EXPORT}">{L_EXPORT}</a></div>
<table cellspacing="1"> <table cellspacing="1">
@ -163,10 +170,9 @@
</tbody> </tbody>
</table> </table>
<form id="acp_icons" method="post" action="{U_ACTION}"> <p class="quick">
<fieldset class="quick">
<input class="button2" name="add" type="submit" value="{L_ICON_ADD}" />&nbsp; &nbsp;<input class="button2" type="submit" name="edit" value="{L_ICON_EDIT}" /> <input class="button2" name="add" type="submit" value="{L_ICON_ADD}" />&nbsp; &nbsp;<input class="button2" type="submit" name="edit" value="{L_ICON_EDIT}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -45,11 +45,12 @@
<dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}:</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt> <dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}:</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt>
<dd><input type="text" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" /></dd> <dd><input type="text" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" /></dd>
</dl> </dl>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -16,10 +16,10 @@
<dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt> <dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt>
<dd>{RADIO_BUTTONS}</dd> <dd>{RADIO_BUTTONS}</dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input type="submit" class="button2" value="{L_DOWNLOAD}" name="download" /> <input type="submit" class="button2" value="{L_DOWNLOAD}" name="download" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -50,10 +50,10 @@
<dt><label for="lang_author">{L_LANG_AUTHOR}:</label></dt> <dt><label for="lang_author">{L_LANG_AUTHOR}:</label></dt>
<dd><input type="text" id="lang_author" name="lang_author" value="{LANG_AUTHOR}" /></dd> <dd><input type="text" id="lang_author" name="lang_author" value="{LANG_AUTHOR}" /></dd>
</dl> </dl>
</fieldset>
<fieldset class="quick" style="margin-top: -15px;"> <p class="quick" style="margin-top: -15px;">
<input type="submit" name="update_details" class="button2" value="{L_SUBMIT}" /> <input type="submit" name="update_details" class="button2" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -107,14 +107,14 @@
<dd><select name="module_mode" id="module_mode">{S_MODULE_MODES}</select></dd> <dd><select name="module_mode" id="module_mode">{S_MODULE_MODES}</select></dd>
</dl> </dl>
</div> </div>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input type="hidden" name="action" value="{ACTION}" /> <input type="hidden" name="action" value="{ACTION}" />
<input type="hidden" name="m" value="{MODULE_ID}" /> <input type="hidden" name="m" value="{MODULE_ID}" />
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -74,10 +74,10 @@
<dt><label for="role_description">{L_ROLE_DESCRIPTION}:</label><br /><span>{L_ROLE_DESCRIPTION_EXPLAIN}</span></dt> <dt><label for="role_description">{L_ROLE_DESCRIPTION}:</label><br /><span>{L_ROLE_DESCRIPTION_EXPLAIN}</span></dt>
<dd><textarea id="role_description" name="role_description" rows="3" cols="45">{ROLE_DESCRIPTION}</textarea></dd> <dd><textarea id="role_description" name="role_description" rows="3" cols="45">{ROLE_DESCRIPTION}</textarea></dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input type="submit" class="button1" name="submit" value="{L_SUBMIT}" /> <input type="submit" class="button1" name="submit" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
<!-- IF S_DISPLAY_ROLE_MASK --> <!-- IF S_DISPLAY_ROLE_MASK -->

View file

@ -61,23 +61,6 @@
</form> </form>
<form id="select_single_forum" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_LOOK_UP_FORUM}</legend>
<dl>
<dt><label for="forum">{L_LOOK_UP_FORUM}:</label></dt>
<dd><select id="forum" name="forum_id[]">{S_FORUM_OPTIONS}</select></dd>
</dl>
</fieldset>
<fieldset class="quick">
{S_HIDDEN_FIELDS}
<input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
</fieldset>
</form>
<!-- ENDIF --> <!-- ENDIF -->
<!-- ELSEIF S_SELECT_USER and S_CAN_SELECT_USER --> <!-- ELSEIF S_SELECT_USER and S_CAN_SELECT_USER -->
@ -89,7 +72,7 @@
<dl> <dl>
<dt><label for="username">{L_FIND_USERNAME}:</label></dt> <dt><label for="username">{L_FIND_USERNAME}:</label></dt>
<dd><input class="medium" type="text" id="username" name="username[]" /></dd> <dd><input class="medium" type="text" id="username" name="username[]" /></dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd> <dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl> </dl>
</fieldset> </fieldset>
@ -152,7 +135,7 @@
<p>{L_USERNAMES_EXPLAIN}</p> <p>{L_USERNAMES_EXPLAIN}</p>
<dl> <dl>
<dd class="full"><textarea id="username" name="usernames" rows="5" cols="5" style="width: 100%; height: 60px;"></textarea></dd> <dd class="full"><textarea id="username" name="usernames" rows="5" cols="5" style="width: 100%; height: 60px;"></textarea></dd>
<dd class="full" style="text-align: left;"><div style="float: right;">[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</div><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd> <dd class="full" style="text-align: left;"><div style="float: right;">[ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false;">{L_FIND_USERNAME}</a> ]</div><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl> </dl>
</fieldset> </fieldset>
@ -239,7 +222,7 @@
<dl> <dl>
<dt><label for="username">{L_FIND_USERNAME}:</label></dt> <dt><label for="username">{L_FIND_USERNAME}:</label></dt>
<dd><input type="text" id="username" name="username[]" /></dd> <dd><input type="text" id="username" name="username[]" /></dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd> <dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="user_id[]" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl> </dl>
</fieldset> </fieldset>

View file

@ -44,10 +44,10 @@
<dl> <dl>
<dd class="full"><select name="f[]" multiple="multiple" size="5">{S_FORUM_OPTIONS}</select></dd> <dd class="full"><select name="f[]" multiple="multiple" size="5">{S_FORUM_OPTIONS}</select></dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" value="{L_LOOK_UP_FORUM}" /> <input class="button1" type="submit" value="{L_LOOK_UP_FORUM}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -88,12 +88,12 @@
<dt><label for="sticky">{L_PRUNE_STICKY}:</label></dt> <dt><label for="sticky">{L_PRUNE_STICKY}:</label></dt>
<dd><input type="radio" class="radio" name="prune_sticky" value="1" /> {L_YES} &nbsp; <input type="radio" class="radio" id="sticky" name="prune_sticky" value="0" checked="checked" /> {L_NO}</dd> <dd><input type="radio" class="radio" name="prune_sticky" value="1" /> {L_YES} &nbsp; <input type="radio" class="radio" id="sticky" name="prune_sticky" value="0" checked="checked" /> {L_NO}</dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
{S_HIDDEN_FIELDS} {S_HIDDEN_FIELDS}
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /> <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -43,13 +43,13 @@
<dt><label for="deactivate">{L_DEACTIVATE_DELETE}:</label><br /><span>{L_DEACTIVATE_DELETE_EXPLAIN}</span></dt> <dt><label for="deactivate">{L_DEACTIVATE_DELETE}:</label><br /><span>{L_DEACTIVATE_DELETE_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" name="action" value="delete" /> {L_DELETE_USERS}&nbsp;&nbsp;<input type="radio" class="radio" id="deactivate" name="action" value="deactivate" checked="checked" /> {L_DEACTIVATE}</dd> <dd><input type="radio" class="radio" name="action" value="delete" /> {L_DELETE_USERS}&nbsp;&nbsp;<input type="radio" class="radio" id="deactivate" name="action" value="deactivate" checked="checked" /> {L_DEACTIVATE}</dd>
</dl> </dl>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input type="hidden" name="prune" value="1" /> <input type="hidden" name="prune" value="1" />
<input class="button1" type="submit" id="update" name="update" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="update" name="update" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -43,13 +43,13 @@
<dd><input name="min_posts" type="text" id="min_posts" maxlength="10" value="{MIN_POSTS}" /></dd> <dd><input name="min_posts" type="text" id="min_posts" maxlength="10" value="{MIN_POSTS}" /></dd>
</dl> </dl>
</div> </div>
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input type="hidden" name="action" value="save" /> <input type="hidden" name="action" value="save" />
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -60,6 +60,10 @@
<p>{L_ACP_RANKS_EXPLAIN}</p> <p>{L_ACP_RANKS_EXPLAIN}</p>
<form id="acp_ranks" method="post" action="{U_ACTION}">
<fieldset class="tabulated">
<legend>{L_ACP_MANAGE_RANKS}</legend>
<table cellspacing="1"> <table cellspacing="1">
<thead> <thead>
<tr> <tr>
@ -81,10 +85,9 @@
</tbody> </tbody>
</table> </table>
<form id="acp_ranks" method="post" action="{U_ACTION}"> <p class="quick">
<fieldset class="quick">
<input class="button2" name="add" type="submit" value="{L_ADD_RANK}" /> <input class="button2" name="add" type="submit" value="{L_ADD_RANK}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -48,11 +48,11 @@
<dd>{TRANSLATED_DESCRIPTION}</dd> <dd>{TRANSLATED_DESCRIPTION}</dd>
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -63,6 +63,10 @@
<p>{L_ACP_REASONS_EXPLAIN}</p> <p>{L_ACP_REASONS_EXPLAIN}</p>
<form id="reasons" method="post" action="{U_ACTION}">
<fieldset class="tabuled">
<legend>{L_ACP_REASONS}</legend>
<!-- IF .reasons --> <!-- IF .reasons -->
<table cellspacing="1"> <table cellspacing="1">
<col class="row1" /><col class="row1" /><col class="row2" /> <col class="row1" /><col class="row1" /><col class="row2" />
@ -107,13 +111,12 @@
<!-- ENDIF --> <!-- ENDIF -->
<form id="reasons" method="post" action="{U_ACTION}"> <p class="quick">
<fieldset class="quick">
<input type="hidden" name="action" value="add" /> <input type="hidden" name="action" value="add" />
<input type="text" name="reason_title" /> <input type="text" name="reason_title" />
<input class="button2" name="addreason" type="submit" value="{L_ADD_NEW_REASON}" /> <input class="button2" name="addreason" type="submit" value="{L_ADD_NEW_REASON}" />
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -13,7 +13,7 @@
<legend>{L_GENERAL_SEARCH_SETTINGS}</legend> <legend>{L_GENERAL_SEARCH_SETTINGS}</legend>
<dl> <dl>
<dt><label for="load_search">{L_YES_SEARCH}:</label><br /><span>{L_YES_SEARCH_EXPLAIN}</span></dt> <dt><label for="load_search">{L_YES_SEARCH}:</label><br /><span>{L_YES_SEARCH_EXPLAIN}</span></dt>
<dd><input type="radio" class="radio" id="load_search" name="config[load_search]" value="1"<!-- IF S_YES_SEARCH --> checked="checked"<!-- ENDIF --> class="radio" />&nbsp;{L_YES}&nbsp;&nbsp;<input type="radio" class="radio" name="config[load_search]" value="0"<!-- IF not S_YES_SEARCH --> checked="checked"<!-- ENDIF --> class="radio" />&nbsp;{L_NO}</dd> <dd><input type="radio" class="radio" id="load_search" name="config[load_search]" value="1"<!-- IF S_YES_SEARCH --> checked="checked"<!-- ENDIF --> />&nbsp;{L_YES}&nbsp;&nbsp;<input type="radio" class="radio" name="config[load_search]" value="0"<!-- IF not S_YES_SEARCH --> checked="checked"<!-- ENDIF --> />&nbsp;{L_NO}</dd>
</dl> </dl>
<dl> <dl>
<dt><label for="search_interval">{L_SEARCH_INTERVAL}:</label><br /><span>{L_SEARCH_INTERVAL_EXPLAIN}</span></dt> <dt><label for="search_interval">{L_SEARCH_INTERVAL}:</label><br /><span>{L_SEARCH_INTERVAL_EXPLAIN}</span></dt>
@ -55,6 +55,7 @@
<!-- END backend --> <!-- END backend -->
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</fieldset> </fieldset>
@ -91,8 +92,13 @@
<!-- IF backend.S_STATS --> <!-- IF backend.S_STATS -->
<form id="acp_search_index_{backend.NAME}" method="post" action="{U_ACTION}">
{backend.S_HIDDEN_FIELDS}
<fieldset class="tabular">
<legend>{L_INDEX_STATS}: {backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></legend>
<table cellspacing="1"> <table cellspacing="1">
<caption>&raquo; {L_INDEX_STATS}: {backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></caption> <caption>{backend.L_NAME} <!-- IF backend.S_ACTIVE -->({L_ACTIVE}) <!-- ENDIF --></caption>
<col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" /> <col class="col1" /><col class="col2" /><col class="col1" /><col class="col2" />
<thead> <thead>
<tr> <tr>
@ -116,15 +122,13 @@
<!-- ENDIF --> <!-- ENDIF -->
<form id="acp_search_index_{backend.NAME}" method="post" action="{U_ACTION}"> <p class="quick">
{backend.S_HIDDEN_FIELDS}
<fieldset class="quick">
<!-- IF backend.S_INDEXED --> <!-- IF backend.S_INDEXED -->
<input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="popup_progress_bar('delete');" /> <input class="button2" type="submit" name="action[delete]" value="{L_DELETE_INDEX}" onclick="popup_progress_bar('delete');" />
<!-- ELSE --> <!-- ELSE -->
<input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="popup_progress_bar('create');" /> <input class="button2" type="submit" name="action[create]" value="{L_CREATE_INDEX}" onclick="popup_progress_bar('create');" />
<!-- ENDIF --> <!-- ENDIF -->
</p>
</fieldset> </fieldset>
</form> </form>

View file

@ -22,10 +22,10 @@
<dt><label for="new_id">{L_REPLACE}:</label><br /><span>{L_REPLACE_EXPLAIN}</span></dt> <dt><label for="new_id">{L_REPLACE}:</label><br /><span>{L_REPLACE_EXPLAIN}</span></dt>
<dd><select name="new_id">{S_REPLACE_OPTIONS}</select></dd> <dd><select name="new_id">{S_REPLACE_OPTIONS}</select></dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" name="update" value="{L_DELETE}" /> <input class="button1" type="submit" name="update" value="{L_DELETE}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -37,64 +37,58 @@
<h1>{L_TITLE}</h1> <h1>{L_TITLE}</h1>
<p>{L_EXPLAIN}</p> <p>{L_EXPLAIN}</p>
<script language="javascript" type="text/javascript" defer="defer">
<!-- IF SUCCESS -->
<div class="successbox">
<p>{L_IMAGESET_UPDATED}</p>
</div>
<!-- ENDIF -->
<!-- IF ERROR -->
<div class="errorbox">
<p>{L_NO_IMAGE}</p>
</div>
<!-- ENDIF -->
<script type="text/javascript" defer="defer">
<!-- <!--
function update_image(newimage) function update_image(newimage)
{ {
document.newimg.src = (newimage) ? "../styles/{NAME}/imageset/" + newimage : "images/no_image.png"; document.getElementById('newimg').src = (newimage) ? "../styles/{NAME}/imageset/" + newimage : "images/no_image.png";
} }
//--> //-->
</script> </script>
<form method="post" action="{U_ACTION}"> <form method="post" action="{U_ACTION}">
<table width="95%" cellspacing="1" cellpadding="1" border="0" align="center"> <fieldset class="quick" style="text-align: left;">
<tr> <legend>{L_SELECT_IMAGE}</legend>
<td align="right">{L_SELECT_IMAGE}: <select name="imgname" onchange="this.form.submit(); "> {L_SELECT_IMAGE}: <select name="imgname" onchange="this.form.submit();">
<!-- BEGIN category --> <!-- BEGIN category -->
<option class="sep" value="">{category.NAME}</option> <option class="sep" value="">{category.NAME}</option>
<!-- BEGIN images --><option value="{category.images.VALUE}"<!-- IF category.images.SELECTED--> selected="selected"<!-- ENDIF -->>{category.images.TEXT}</option> <!-- BEGIN images --><option value="{category.images.VALUE}"<!-- IF category.images.SELECTED--> selected="selected"<!-- ENDIF -->>{category.images.TEXT}</option>
<!-- END images --> <!-- END images -->
<!-- END category --> <!-- END category -->
</select>&nbsp; <input class="btnlite" type="submit" value="{L_SELECT}" tabindex="100" /> </select>&nbsp; <input class="button1" type="submit" value="{L_SELECT}" tabindex="100" />
</td> </fieldset>
</tr>
<tr> <fieldset>
<td> <legend>{L_EDIT_IMAGESET}</legend>
<table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center"> <dl>
<tr> <dt><label>{L_CURRENT_IMAGE}:</label></dt>
<th colspan="2">{L_EDIT_IMAGESET}</th> <dd><img src="<!-- IF IMAGE_REQUEST -->{IMAGE_REQUEST}<!-- ELSE -->images/no_image.png<!-- ENDIF -->" alt="" /></dd>
</tr> </dl>
<!-- IF SUCCESS --> <dl>
<tr> <dt><label>{L_SELECTED_IMAGE}:</label></dt>
<td class="row1" colspan="2" align="center"><span style="color: green">{L_IMAGESET_UPDATED}</span><br /></td> <dd><img src="images/no_image.png" id="newimg" alt="" /></dd>
</tr> </dl>
<!-- ENDIF --> </fieldset>
<!-- IF ERROR -->
<tr> <fieldset>
<td class="row1" colspan="2" align="center"><span style="color: red">{L_NO_IMAGE}</span><br /></td> <legend>{L_IMAGE}</legend>
</tr> <dl>
<!-- ENDIF --> <dt><label for="imgpath">{L_IMAGE}:</label></dt>
<tr> <dd><select id="imgpath" name="imgpath" onchange="update_image(this.options[selectedIndex].value);"><option value=""<!-- IF not IMAGE_SELECT--> selected="selected"<!-- ENDIF -->>{L_NO_IMAGE}</option>
<td class="row1" colspan="2" align="center">
<table width="100%" cellspacing="2" cellpadding="2" border="0">
<tr>
<td width="50%" align="center"><img src="<!-- IF IMAGE_REQUEST -->{IMAGE_REQUEST}<!-- ELSE -->images/no_image.png<!-- ENDIF -->"/></td>
<td width="50%" align="center"><img src="images/no_image.png" name="newimg" /></td>
</tr>
<tr>
<td class="gensmall" align="center">{L_CURRENT_IMAGE}</td>
<td class="gensmall" align="center">{L_SELECTED_IMAGE}</td>
</tr>
</table>
</td>
</tr>
<tr>
<th width="40%">{L_IMAGE_PARAMETER}</th>
<th>{L_IMAGE_VALUE}</th>
</tr>
<tr>
<td class="row1" width="40%"><b>{L_IMAGE}: </b></td>
<td class="row2"><select name="imgpath" onchange="update_image(this.options[selectedIndex].value);"><option value=""<!-- IF not IMAGE_SELECT--> selected="selected"<!-- ENDIF -->>{L_NO_IMAGE}</option>
<!-- BEGIN imagesetlist --> <!-- BEGIN imagesetlist -->
<option class="sep" value=""><!-- IF imagesetlist.TYPE -->{L_LOCALISED_IMAGES}<!-- ELSE -->{L_GLOBAL_IMAGES}<!-- ENDIF --></option> <option class="sep" value=""><!-- IF imagesetlist.TYPE -->{L_LOCALISED_IMAGES}<!-- ELSE -->{L_GLOBAL_IMAGES}<!-- ENDIF --></option>
<!-- BEGIN images --> <!-- BEGIN images -->
@ -102,25 +96,24 @@
<!-- END images --> <!-- END images -->
<!-- END imagesetlist --> <!-- END imagesetlist -->
</select> </select>
</td> </dd>
</tr> </dl>
<tr> <dl>
<td class="row1" width="40%"><b>{L_INCLUDE_DIMENSIONS}: </b><br /><span class="gensmall">{L_DIMENSIONS_EXPLAIN}</span></td> <dt><label for="imgsize">{L_INCLUDE_DIMENSIONS}:</label><br /><span>{L_DIMENSIONS_EXPLAIN}</span></dt>
<td class="row2"><input type="radio" class="radio" name="imgsize" value="1"<!-- IF IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_YES}&nbsp;&nbsp;<input type="radio" class="radio" name="imgsize" value="0"<!-- IF not IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_NO}</td> <dd><input type="radio" class="radio" name="imgsize" id="imgsize" value="1"<!-- IF IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_YES}&nbsp;&nbsp;<input type="radio" class="radio" name="imgsize" value="0"<!-- IF not IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_NO}</dd>
</tr> </dl>
<tr> </fieldset>
<td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnmain" type="reset" value="{L_RESET}" /></td>
</tr> <fieldset class="submit-buttons">
</table> <legend>{L_SUBMIT}</legend>
</td> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="button2" type="reset" value="{L_RESET}" />
</tr> </fieldset>
</table>
</form> </form>
<!-- ELSEIF S_EDIT_TEMPLATE or S_EDIT_THEME --> <!-- ELSEIF S_EDIT_TEMPLATE or S_EDIT_THEME -->
<script language="javascript" type="text/javascript" defer="defer"> <script type="text/javascript" defer="defer">
<!-- <!--
function append_text_rows(form_name, value) function append_text_rows(form_name, value)
{ {
@ -163,14 +156,14 @@
<legend>{L_SELECT_TEMPLATE}</legend> <legend>{L_SELECT_TEMPLATE}</legend>
<dl> <dl>
<dt><label for="template_file">{L_TEMPLATE_FILE}:</label></dt> <dt><label for="template_file">{L_TEMPLATE_FILE}:</label></dt>
<dd><select id="template_file" name="template_file" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_TEMPLATES}</select> <input class="btnlite" type="submit" value="{L_SELECT}" /></dd> <dd><select id="template_file" name="template_file" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_TEMPLATES}</select> <input class="button2" type="submit" value="{L_SELECT}" /></dd>
</dl> </dl>
</fieldset> </fieldset>
</form> </form>
<!-- IF TEMPLATE_FILE --> <!-- IF TEMPLATE_FILE -->
<script language="javascript" type="text/javascript" defer="defer"> <script type="text/javascript" defer="defer">
<!-- <!--
function change_editor_height(height) function change_editor_height(height)
@ -217,12 +210,13 @@
</dl> </dl>
<dl> <dl>
<dt><label for="text_rows">{L_TEMPLATE_EDITOR_HEIGHT}:</label></dt> <dt><label for="text_rows">{L_TEMPLATE_EDITOR_HEIGHT}:</label></dt>
<dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="btnlite" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd> <dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="button2" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd>
</dl> </dl>
<textarea id="template_data" name="template_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{TEMPLATE_DATA}</textarea> <textarea id="template_data" name="template_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{TEMPLATE_DATA}</textarea>
</fieldset> </fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
{S_HIDDEN_FIELDS} {S_HIDDEN_FIELDS}
<input class="button1" id="save" type="submit" name="save" value="{L_SUBMIT}" /> <input class="button1" id="save" type="submit" name="save" value="{L_SUBMIT}" />
</fieldset> </fieldset>
@ -232,15 +226,9 @@
<!-- ELSEIF S_EDIT_THEME --> <!-- ELSEIF S_EDIT_THEME -->
<script language="javascript" type="text/javascript"> <script type="text/javascript">
<!-- <!--
function swatch(field)
{
window.open('{UA_SWATCH}' + field, '_swatch', 'height=150, resizable=yes, scrollbars=no, width=636');
return false;
}
function change_editor_height(height) function change_editor_height(height)
{ {
editor = document.getElementById('css_data'); editor = document.getElementById('css_data');
@ -260,20 +248,20 @@
<p>{L_EDIT_THEME_EXPLAIN}</p> <p>{L_EDIT_THEME_EXPLAIN}</p>
<p>{L_SELECTED_THEME}: <b>{SELECTED_THEME}</b></p> <p>{L_SELECTED_THEME}: <strong>{SELECTED_THEME}</strong></p>
<!-- IF S_SHOWCSS --> <!-- IF S_SHOWCSS -->
<h3>{L_SHOW_CSS_NOTE}</h3> <h3>{L_SHOW_CSS_NOTE}</h3>
<p>{L_SHOW_CSS_EXPLAIN}</p> <p>{L_SHOW_CSS_EXPLAIN}</p>
<!-- ENDIF --> <!-- ENDIF -->
<form id="acp_styles" method="post" action="{U_ACTION}"> <form id="acp_styles" method="post" action="{U_ACTION}">
<fieldset> <fieldset>
<legend>{L_SELECT_CLASS}</legend> <legend>{L_SELECT_CLASS}</legend>
<dl> <dl>
<dt><label for="css_class">{L_SELECT_CLASS}:</label></dt> <dt><label for="css_class">{L_SELECT_CLASS}:</label></dt>
<dd><select id="css_class" name="css_class" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_CLASSES}</select> <input class="btnlite" type="submit" id="select_class" name="select_class" value="{L_SELECT}" /></dd> <dd><select id="css_class" name="css_class" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();">{S_CLASSES}</select></dd>
<dd><input class="button1" type="submit" id="select_class" name="select_class" value="{L_SELECT}" /></dd>
</dl> </dl>
<!-- IF S_CLASS --> <!-- IF S_CLASS -->
<dl> <dl>
@ -295,7 +283,7 @@
<legend>{L_THEME_EDITOR}</legend> <legend>{L_THEME_EDITOR}</legend>
<dl> <dl>
<dt><label for="text_rows">{L_THEME_EDITOR_HEIGHT}:</label></dt> <dt><label for="text_rows">{L_THEME_EDITOR_HEIGHT}:</label></dt>
<dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="btnlite" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd> <dd><input id="text_rows" type="text" maxlength="3" value="{TEXT_ROWS}" /> <input class="button1" type="button" name="update" onclick="change_editor_height(this.form.text_rows.value);" value="{L_UPDATE}" /></dd>
</dl> </dl>
<textarea id="css_data" name="css_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{CSS_DATA}</textarea> <textarea id="css_data" name="css_data" style="font-family:'Courier New', monospace;font-size:9pt;line-height:125%;width:100%;" cols="80" rows="{TEXT_ROWS}">{CSS_DATA}</textarea>
</fieldset> </fieldset>
@ -309,7 +297,7 @@
<dd><input id="background_color" name="background_color" type="text" value="{BACKGROUND_COLOR}" size="6" />&nbsp;&nbsp;<span>[ <a href="#" onclick="swatch('background_color'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd> <dd><input id="background_color" name="background_color" type="text" value="{BACKGROUND_COLOR}" size="6" />&nbsp;&nbsp;<span>[ <a href="#" onclick="swatch('background_color'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="backround_image">{L_BACKGROUND_IMAGE}:</label></td> <dt><label for="backround_image">{L_BACKGROUND_IMAGE}:</label></dt>
<dd><select id="background_image" name="background_image">{S_BACKGROUND_IMAGE}</select></dd> <dd><select id="background_image" name="background_image">{S_BACKGROUND_IMAGE}</select></dd>
</dl> </dl>
<dl> <dl>
@ -353,6 +341,7 @@
<!-- ENDIF --> <!-- ENDIF -->
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
{S_HIDDEN_FIELDS} {S_HIDDEN_FIELDS}
<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
<!-- IF S_SHOWCSS --> <!-- IF S_SHOWCSS -->
@ -377,13 +366,13 @@
<fieldset> <fieldset>
<legend>{L_CUSTOM_CLASS}</legend> <legend>{L_CUSTOM_CLASS}</legend>
<dl> <dl>
<dt><label for="custom_class">{L_CSS_CLASS_NAME}:</label></dt></dt> <dt><label for="custom_class">{L_CSS_CLASS_NAME}:</label></dt>
<dd><input id="custom_class" name="custom_class" type="text" value="" maxlength="40" size="40" /></dd> <dd><input id="custom_class" name="custom_class" type="text" value="" maxlength="40" size="40" /></dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" id="add_custom" name="add_custom" value="{L_SUBMIT}" /> <input class="button1" type="submit" id="add_custom" name="add_custom" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -392,7 +381,7 @@
<!-- ELSEIF S_CACHE --> <!-- ELSEIF S_CACHE -->
<script language="Javascript" type="text/javascript"> <script type="text/javascript">
<!-- <!--
function viewsource(url) function viewsource(url)
@ -411,6 +400,8 @@
<p>{L_TEMPLATE_CACHE_EXPLAIN}</p> <p>{L_TEMPLATE_CACHE_EXPLAIN}</p>
<form name="acp_styles" method="post" action="{U_ACTION}"> <form name="acp_styles" method="post" action="{U_ACTION}">
<fieldset class="tabulated">
<legend>{L_TEMPLATE_CACHE}</legend>
<table cellspacing="1"> <table cellspacing="1">
<thead> <thead>
@ -439,10 +430,11 @@
</tbody> </tbody>
</table> </table>
<fieldset class="quick"> <p class="quick">
<span class="small"><a href="#" onclick="marklist('acp_styles', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('acp_styles', 'delete', false); return false;">{L_UNMARK_ALL}</a></span><br /> <span class="small"><a href="#" onclick="marklist('acp_styles', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('acp_styles', 'delete', false); return false;">{L_UNMARK_ALL}</a></span><br />
<input class="button1" type="submit" id="submit" name="submit" value="{L_DELETE_MARKED}" /> <input class="button1" type="submit" id="submit" name="submit" value="{L_DELETE_MARKED}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -492,10 +484,10 @@
<dt><label for="format">{L_ARCHIVE_FORMAT}:</label></dt> <dt><label for="format">{L_ARCHIVE_FORMAT}:</label></dt>
<dd>{FORMAT_BUTTONS}</dd> <dd>{FORMAT_BUTTONS}</dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -562,6 +554,7 @@
<form id="acp_styles" method="post" action="{U_ACTION}"> <form id="acp_styles" method="post" action="{U_ACTION}">
<fieldset class="quick"> <fieldset class="quick">
<legend>{L_CREATE}</legend>
{L_CREATE}: <input type="text" name="name" value="" /> {L_FROM} <select name="basis">{S_BASIS_OPTIONS}</select> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" /> {L_CREATE}: <input type="text" name="name" value="" /> {L_FROM} <select name="basis">{S_BASIS_OPTIONS}</select> <input class="button2" type="submit" name="add" value="{L_SUBMIT}" />
</fieldset> </fieldset>
@ -633,7 +626,8 @@
<!-- ENDIF --> <!-- ENDIF -->
</fieldset> </fieldset>
<fieldset class="quick"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" /> <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
</fieldset> </fieldset>

View file

@ -15,13 +15,13 @@
<dl> <dl>
<dt><label for="username">{L_FIND_USERNAME}:</label></dt> <dt><label for="username">{L_FIND_USERNAME}:</label></dt>
<dd><input class="medium" type="text" id="username" name="username" /></dd> <dd><input class="medium" type="text" id="username" name="username" /></dd>
<dd>[ <a href="{U_FIND_USERNAME}" onclick="window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); return false;">{L_FIND_USERNAME}</a> ]</dd> <dd>[ <a href="{U_FIND_USERNAME}" onclick="find_username(); return false;">{L_FIND_USERNAME}</a> ]</dd>
<dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd> <dd class="full" style="text-align: left;"><input type="checkbox" class="radio" id="anonymous" name="u" value="{ANONYMOUS_USER_ID}" /> &nbsp;{L_SELECT_ANONYMOUS}</dd>
</dl> </dl>
</fieldset>
<fieldset class="quick"> <p class="quick">
<input type="submit" name="submituser" value="{L_SUBMIT}" class="button1" /> <input type="submit" name="submituser" value="{L_SUBMIT}" class="button1" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -83,9 +83,15 @@
<legend>{L_ACP_USER_OVERVIEW}</legend> <legend>{L_ACP_USER_OVERVIEW}</legend>
<dl> <dl>
<dt><label for="user">{L_USERNAME}:</label><br /><span>{L_NAME_CHARS_EXPLAIN}</span></dt> <dt><label for="user">{L_USERNAME}:</label><br /><span>{L_NAME_CHARS_EXPLAIN}</span></dt>
<dd><input type="text" id="user" name="user" value="{USER}" /><!-- IF S_USER_INACTIVE --> [{L_USER_IS_INACTIVE}]<!-- ENDIF --></dd> <dd><input type="text" id="user" name="user" value="{USER}" /></dd>
<!-- IF U_SWITCH_PERMISSIONS --><dd>[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</dd><!-- ENDIF --> <!-- IF U_SWITCH_PERMISSIONS --><dd>[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</dd><!-- ENDIF -->
</dl> </dl>
<!-- IF S_USER_INACTIVE -->
<dl>
<dt><label>{L_USER_IS_INACTIVE}:</label></dt>
<dd><strong>{USER_INACTIVE_REASON}</strong></dd>
</dl>
<!-- ENDIF -->
<dl> <dl>
<dt><label>{L_REGISTERED}:</label></dt> <dt><label>{L_REGISTERED}:</label></dt>
<dd><strong>{USER_REGISTERED}</strong></dd> <dd><strong>{USER_REGISTERED}</strong></dd>
@ -94,7 +100,7 @@
<dl> <dl>
<dt><label>{L_REGISTERED_IP}:</label></dt> <dt><label>{L_REGISTERED_IP}:</label></dt>
<dd><a href="{U_SHOW_IP}">{REGISTERED_IP}</a></dd> <dd><a href="{U_SHOW_IP}">{REGISTERED_IP}</a></dd>
<dd>[ <a href="#" onclick="window.open('{U_WHOIS}', '_whois', 'height=500, resizable=yes, scrollbars=yes, width=700'); return false;">{L_WHOIS}</a> ]</strong></dd> <dd>[ <a href="#" onclick="window.open('{U_WHOIS}', '_whois', 'height=500, resizable=yes, scrollbars=yes, width=700'); return false;">{L_WHOIS}</a> ]</dd>
</dl> </dl>
<!-- ENDIF --> <!-- ENDIF -->
<dl> <dl>
@ -542,9 +548,9 @@
var text_name = 'signature'; var text_name = 'signature';
// Define the bbCode tags // Define the bbCode tags
bbcode = new Array(); bbcode = new Array();
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->); bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
imageTag = false; imageTag = false;
// Helpline messages // Helpline messages
var help_line = { var help_line = {
@ -557,11 +563,12 @@ var help_line = {
o: '{LA_BBCODE_O_HELP}', o: '{LA_BBCODE_O_HELP}',
p: '{LA_BBCODE_P_HELP}', p: '{LA_BBCODE_P_HELP}',
w: '{LA_BBCODE_W_HELP}', w: '{LA_BBCODE_W_HELP}',
a: '{LA_BBCODE_A_HELP}',
s: '{LA_BBCODE_S_HELP}', s: '{LA_BBCODE_S_HELP}',
f: '{LA_BBCODE_F_HELP}', f: '{LA_BBCODE_F_HELP}',
e: '{LA_BBCODE_E_HELP}', e: '{LA_BBCODE_E_HELP}',
d: '{LA_BBCODE_D_HELP}' d: '{LA_BBCODE_D_HELP}',
t: '{LA_BBCODE_T_HELP}',
tip: '{L_STYLES_TIP}'
<!-- BEGIN custom_tags --> <!-- BEGIN custom_tags -->
,cb_{custom_tags.BBCODE_ID}: '{custom_tags.BBCODE_HELPLINE}' ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.BBCODE_HELPLINE}'
<!-- END custom_tags --> <!-- END custom_tags -->
@ -584,31 +591,31 @@ var help_line = {
<legend>{L_SIGNATURE}</legend> <legend>{L_SIGNATURE}</legend>
<p>{L_SIGNATURE_EXPLAIN}</p> <p>{L_SIGNATURE_EXPLAIN}</p>
<div id="format-buttons"> <div id="format-buttons">
<input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" /> <input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" /> <input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" /> <input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /> <input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" /> <input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" /> <input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" /> <input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
<input type="button" class="button2" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
<!-- IF S_BBCODE_IMG --> <!-- IF S_BBCODE_IMG -->
<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" /> <input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_LINKS_ALLOWED --> <!-- IF S_LINKS_ALLOWED -->
<input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseover="helpline('d')" /> <input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseout="helpline('tip')" />
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_BBCODE_FLASH --> <!-- IF S_BBCODE_FLASH -->
<input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" /> <input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" onmouseout="helpline('tip')" />
<!-- ENDIF --> <!-- ENDIF -->
{L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')"> {L_FONT_SIZE}: <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')" onmouseout="helpline('tip')">
<option value="7">{L_FONT_TINY}</option> <option value="7">{L_FONT_TINY}</option>
<option value="9">{L_FONT_SMALL}</option> <option value="9">{L_FONT_SMALL}</option>
<option value="12" selected="selected">{L_FONT_NORMAL}</option> <option value="12" selected="selected">{L_FONT_NORMAL}</option>
<option value="18">{L_FONT_LARGE}</option> <option value="18">{L_FONT_LARGE}</option>
<option value="24">{L_FONT_HUGE}</option> <option value="24">{L_FONT_HUGE}</option>
</select> </select>
<a href="#" onclick="bbstyle(-1); return false;" onmouseover="helpline('a')">{L_CLOSE_TAGS}</a>
<!-- IF .custom_tags --> <!-- IF .custom_tags -->
<br /><br /> <br /><br />
<!-- BEGIN custom_tags --> <!-- BEGIN custom_tags -->
@ -618,14 +625,8 @@ var help_line = {
</div> </div>
<p><input type="text" name="helpbox" value="{L_STYLES_TIP}" class="full" style="border: 0; background: none;" /></p> <p><input type="text" name="helpbox" value="{L_STYLES_TIP}" class="full" style="border: 0; background: none;" /></p>
<dl> <div style="text-align: left;"><textarea name="signature" rows="10" cols="60" style="width: 80%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></div>
<dt style="width: 95px;"><script type="text/javascript"><!-- <div><!-- IF S_BBCODE_ALLOWED -->
colorPalette('v', 17, 13);
//--></script>
</dt>
<dd style="text-align: left; margin-left: 95px;"><textarea name="signature" rows="10" cols="60" style="width: 80%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd>
<dd style="text-align: left; margin-left: 95px;">
<!-- IF S_BBCODE_ALLOWED -->
<input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} />&nbsp; {L_DISABLE_BBCODE} &nbsp; <input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} />&nbsp; {L_DISABLE_BBCODE} &nbsp;
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_SMILIES_ALLOWED --> <!-- IF S_SMILIES_ALLOWED -->
@ -635,8 +636,7 @@ var help_line = {
<input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} />&nbsp; {L_DISABLE_MAGIC_URL} &nbsp; <input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} />&nbsp; {L_DISABLE_MAGIC_URL} &nbsp;
<!-- ENDIF --> <!-- ENDIF -->
<br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS} <br /><br /><strong>{L_OPTIONS}: </strong>{BBCODE_STATUS} :: {IMG_STATUS} :: {FLASH_STATUS} :: {URL_STATUS} :: {SMILIES_STATUS}
</dd> </div>
</dl>
</fieldset> </fieldset>
<fieldset class="quick"> <fieldset class="quick">

View file

@ -23,11 +23,11 @@
<dd><input id="replacement" type="text" name="replacement" value="{REPLACEMENT}" /></dd> <dd><input id="replacement" type="text" name="replacement" value="{REPLACEMENT}" /></dd>
</dl> </dl>
{S_HIDDEN_FIELDS} {S_HIDDEN_FIELDS}
</fieldset>
<fieldset class="submit-buttons"> <p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="save" value="{L_SUBMIT}" />&nbsp; <input class="button1" type="submit" id="submit" name="save" value="{L_SUBMIT}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
</p>
</fieldset> </fieldset>
</form> </form>
@ -40,12 +40,12 @@
<form id="acp_words" method="post" action="{U_ACTION}"> <form id="acp_words" method="post" action="{U_ACTION}">
<fieldset class="quick"> <fieldset class="tabulated">
<legend>{L_ACP_WORDS}</legend>
<p class="quick">
{S_HIDDEN_FIELDS} {S_HIDDEN_FIELDS}
<input class="button2" name="add" type="submit" value="{L_ADD_WORD}" /> <input class="button2" name="add" type="submit" value="{L_ADD_WORD}" />
</fieldset> </p>
</form>
<table cellspacing="1"> <table cellspacing="1">
<thead> <thead>
@ -67,6 +67,9 @@
</tbody> </tbody>
</table> </table>
</fieldset>
</form>
<!-- ENDIF --> <!-- ENDIF -->
<!-- INCLUDE overall_footer.html --> <!-- INCLUDE overall_footer.html -->

View file

@ -23,7 +23,7 @@ html {
body { body {
/* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */ /* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */
font-family: Verdana, Helvetica, Arial, sans-serif; font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
color: #536482; color: #536482;
background: #E4EDF0 url("../images/bg_header.gif") 0 0 repeat-x; background: #E4EDF0 url("../images/bg_header.gif") 0 0 repeat-x;
font-size: 62.5%; /* This sets the default font size to be equivalent to 10px */ font-size: 62.5%; /* This sets the default font size to be equivalent to 10px */
@ -35,13 +35,13 @@ img {
} }
h1 { h1 {
font: bold 1.8em 'Trebuchet MS', Verdana, sans-serif; font: bold 1.8em "Lucida Grande", 'Trebuchet MS', Verdana, sans-serif;
text-decoration: none; text-decoration: none;
color: #333333; color: #333333;
} }
h2, caption { h2, caption {
font: bold 1.2em Arial, Helvetica, sans-serif; font: bold 1.2em "Lucida Grande", Arial, Helvetica, sans-serif;
text-decoration: none; text-decoration: none;
line-height: 120%; line-height: 120%;
text-align: left; text-align: left;
@ -54,6 +54,12 @@ p {
font-size: 1.1em; font-size: 1.1em;
} }
ul {
list-style: disc;
margin-left: 2em;
margin-bottom: 1em;
}
hr { hr {
border: 0 none; border: 0 none;
border-top: 1px solid #999999; border-top: 1px solid #999999;
@ -93,7 +99,7 @@ a:hover {
} }
#page-header h1 { #page-header h1 {
font-family: Verdana, Arial, Helvetica, sans-serif; font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
font-size: 1.5em; font-size: 1.5em;
font-weight: normal; font-weight: normal;
padding-top: 15px; padding-top: 15px;
@ -237,6 +243,7 @@ span.corners-top span, span.corners-bottom span {
#menu ul { #menu ul {
list-style: none; list-style: none;
margin: 0;
} }
/* Default list state */ /* Default list state */
@ -274,7 +281,7 @@ span.corners-top span, span.corners-bottom span {
display: block; display: block;
padding: 5px; padding: 5px;
font-size: 0.9em; font-size: 0.9em;
font-family: Verdana; font-family: "Lucida Grande", Verdana;
color: #FFA34F; color: #FFA34F;
font-weight: bold; font-weight: bold;
background: #006699 url("../images/cellpic3.gif") 0 0 repeat-x; background: #006699 url("../images/cellpic3.gif") 0 0 repeat-x;
@ -304,7 +311,7 @@ table {
} }
th, td { th, td {
font-family: Verdana, Arial, Helvetica, sans-serif; font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
font-size: 1.1em; font-size: 1.1em;
text-align: left; text-align: left;
} }
@ -377,7 +384,7 @@ fieldset p {
legend { legend {
padding: 1px 0; padding: 1px 0;
font-family: arial,Verdana,Sans-serif; font-family: "Lucida Grande", Arial, Verdana,Sans-serif;
font-size: 1.1em; font-size: 1.1em;
font-weight: bold; font-weight: bold;
color: #006699; color: #006699;
@ -395,7 +402,7 @@ legend {
} }
input { input {
font-family: Verdana, Helvetica, Arial, sans-serif; font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
font-size: 100%; font-size: 100%;
font-weight: normal; font-weight: normal;
background-color: #FAFAFA; background-color: #FAFAFA;
@ -410,7 +417,7 @@ input {
} }
select { select {
font-family: Verdana, Helvetica, Arial, sans-serif; font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
font-size: 100%; font-size: 100%;
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
@ -436,7 +443,7 @@ option {
} }
textarea { textarea {
font-family: Verdana, Helvetica, Arial, sans-serif; font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
font-size: 100%; font-size: 100%;
width: 60%; width: 60%;
padding: 2px; padding: 2px;
@ -463,7 +470,7 @@ label img {
vertical-align: middle; vertical-align: middle;
} }
fieldset.quick { fieldset.quick, p.quick {
margin: 0 0 5px 0; margin: 0 0 5px 0;
padding: 5px 0 0 0; padding: 5px 0 0 0;
border: none; border: none;
@ -472,6 +479,14 @@ fieldset.quick {
font-size: 1.1em; font-size: 1.1em;
} }
fieldset.quick legend {
display: none;
}
fieldset.tabulated {
background-color: #DADFE4;
}
fieldset.nobg { fieldset.nobg {
margin: 15px 0 0 0; margin: 15px 0 0 0;
padding: 0; padding: 0;
@ -510,7 +525,7 @@ select#full_folder_action {
Other general def. list properties defined in prosilver_main.css Other general def. list properties defined in prosilver_main.css
---------------------------------------- */ ---------------------------------------- */
dl { dl {
font-family: Verdana, Helvetica, Arial, sans-serif; font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
} }
dt { dt {
@ -596,7 +611,7 @@ input:focus, textarea:focus {
} }
/* Submit button fieldset /* Submit button fieldset or paragraph
---------------------------------------- */ ---------------------------------------- */
fieldset.submit-buttons { fieldset.submit-buttons {
text-align: center; text-align: center;
@ -606,10 +621,21 @@ fieldset.submit-buttons {
margin-top: -1px; margin-top: -1px;
} }
fieldset.submit-buttons input { p.submit-buttons {
text-align: center;
margin: 0;
padding: 4px;
margin-top: 10px;
}
fieldset.submit-buttons input, p.submit-buttons input {
padding: 3px 2px; padding: 3px 2px;
} }
fieldset.submit-buttons legend {
display: none;
}
/* Input field styles /* Input field styles
---------------------------------------- */ ---------------------------------------- */
@ -712,7 +738,7 @@ a.button1, input.button1, input.button3,
a.button2, input.button2 { a.button2, input.button2 {
width: auto !important; width: auto !important;
padding: 1px 3px 0 3px; padding: 1px 3px 0 3px;
font-family: Verdana, Helvetica, Arial, sans-serif; font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
color: #000; color: #000;
background-color: #EFEFEF; background-color: #EFEFEF;
cursor: pointer; cursor: pointer;
@ -1012,7 +1038,7 @@ table.pmask td.name {
---------------------------------------- */ ---------------------------------------- */
.sourcenum { .sourcenum {
color: gray; color: gray;
font-family: 'Courier New', monospace; font-family: Monaco, 'Courier New', monospace;
font-size: 125%; font-size: 125%;
font-weight: bold; font-weight: bold;
line-height: 120%; line-height: 120%;
@ -1021,7 +1047,7 @@ table.pmask td.name {
} }
.source { .source {
font-family: 'Courier New', monospace; font-family: Monaco, 'Courier New', monospace;
font-size: 125%; font-size: 125%;
line-height: 120%; line-height: 120%;
padding: 0px; padding: 0px;

View file

@ -23,7 +23,7 @@ var is_mac = (clientPC.indexOf('mac') != -1);
*/ */
function helpline(help) function helpline(help)
{ {
document.forms[form_name].helpbox.value = eval(help + '_help'); document.forms[form_name].helpbox.value = help_line[help];
} }
/** /**
@ -64,30 +64,19 @@ function arraypop(thearray)
return retval; return retval;
} }
/** /**
* Insert emoticon * bbstyle
*/ */
function smiley(text) function bbstyle(bbnumber)
{ {
text = ' ' + text + ' '; if (bbnumber != -1)
if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos)
{ {
var caretPos = document.forms[form_name].elements[text_name].caretPos; bbfontstyle(bbtags[bbnumber], bbtags[bbnumber+1]);
} else {
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; insert_text('[*]');
document.forms[form_name].elements[text_name].focus(); document.forms[form_name].elements[text_name].focus();
} }
else
{
var selStart = document.forms[form_name].elements[text_name].selectionStart;
var selEnd = document.forms[form_name].elements[text_name].selectionEnd;
mozWrap(document.forms[form_name].elements[text_name], text, '')
document.forms[form_name].elements[text_name].focus();
document.forms[form_name].elements[text_name].selectionStart = selStart + text.length;
document.forms[form_name].elements[text_name].selectionEnd = selEnd + text.length;
}
} }
/** /**
@ -96,7 +85,9 @@ function smiley(text)
function bbfontstyle(bbopen, bbclose) function bbfontstyle(bbopen, bbclose)
{ {
theSelection = false; theSelection = false;
document.forms[form_name].elements[text_name].focus();
var textarea = document.forms[form_name].elements[text_name];
textarea.focus();
if ((clientVer >= 4) && is_ie && is_win) if ((clientVer >= 4) && is_ie && is_win)
{ {
@ -120,59 +111,81 @@ function bbfontstyle(bbopen, bbclose)
return; return;
} }
// Close image tag before adding //The new position for the cursor after adding the bbcode
if (imageTag) var new_pos = getCaretPosition(textarea).start + bbopen.length;
{
insert_text(bbtags[15]);
// Remove the close image tag from the list
lastValue = arraypop(bbcode) - 1;
// Return button back to normal state
document.forms[form_name].addbbcode14.value = 'Img';
imageTag = false;
}
// Open tag // Open tag
insert_text(bbopen + bbclose); insert_text(bbopen + bbclose);
document.forms[form_name].elements[text_name].focus(); // Center the cursor when we don't have a selection
// Gecko and proper browsers
if (!isNaN(textarea.selectionStart))
{
textarea.selectionStart = new_pos;
textarea.selectionEnd = new_pos;
}
// IE
else if (document.selection)
{
var range = textarea.createTextRange();
range.move("character", new_pos);
range.select();
storeCaret(document.forms[form_name].elements[text_name]); storeCaret(document.forms[form_name].elements[text_name]);
}
document.forms[form_name].elements[text_name].focus();
return; return;
} }
/** /**
* Insert text at position * Insert text at position
*/ */
function insert_text(text) function insert_text(text, spaces, popup)
{ {
if (document.forms[form_name].elements[text_name].createTextRange && document.forms[form_name].elements[text_name].caretPos) var textarea;
{
var caretPos = document.forms[form_name].elements[text_name].caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
}
else if (document.forms[form_name].elements[text_name].selectionStart)
{
var selStart = document.forms[form_name].elements[text_name].selectionStart;
var selEnd = document.forms[form_name].elements[text_name].selectionEnd;
mozWrap(document.forms[form_name].elements[text_name], text, '') if (!popup)
document.forms[form_name].elements[text_name].selectionStart = selStart + text.length; {
document.forms[form_name].elements[text_name].selectionEnd = selEnd + text.length; textarea = document.forms[form_name].elements[text_name];
} else
{
textarea = opener.document.forms[form_name].elements[text_name];
} }
if (spaces)
{
text = ' ' + text + ' ';
}
if (!isNaN(textarea.selectionStart))
{
var sel_start = textarea.selectionStart;
var sel_end = textarea.selectionEnd;
mozWrap(textarea, text, '')
textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
}
else if (textarea.createTextRange && textarea.caretPos)
{
var caret_pos = textarea.caretPos;
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
}
else else
{ {
document.forms[form_name].elements[text_name].value = document.forms[form_name].elements[text_name].value + text; textarea.value = textarea.value + text;
} }
document.forms[form_name].elements[text_name].focus();
} }
/** /**
* Add inline attachment at position * Add inline attachment at position
*/ */
function attach_inline() function attach_inline(index, filename)
{ {
insert_text('[attachment=' + document.forms[form_name].elements['attachments'].value + ']' + document.forms[form_name].elements['attachments'].options[document.forms[form_name].elements['attachments'].selectedIndex].text + '[/attachment]'); insert_text('[attachment=' + index + ']' + filename + '[/attachment]');
document.forms[form_name].elements[text_name].focus(); document.forms[form_name].elements[text_name].focus();
} }
@ -187,11 +200,11 @@ function addquote(post_id, username)
if (document.all) if (document.all)
{ {
eval('divarea = document.all.' + message_name + ';'); divarea = document.all[message_name];
} }
else else
{ {
eval("divarea = document.getElementById('" + message_name + "');"); divarea = document.getElementById(message_name);
} }
// Get text selection - not only the post content :( // Get text selection - not only the post content :(
@ -210,7 +223,15 @@ function addquote(post_id, username)
if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null) if (theSelection == '' || typeof theSelection == 'undefined' || theSelection == null)
{ {
if (document.all) if (divarea.innerHTML)
{
theSelection = divarea.innerHTML.replace(/<br>/ig, '\n');
theSelection = theSelection.replace(/<br\/>/ig, '\n');
theSelection = theSelection.replace(/&lt\;/ig, '<');
theSelection = theSelection.replace(/&gt\;/ig, '>');
theSelection = theSelection.replace(/&amp\;/ig, '&');
}
else if (document.all)
{ {
theSelection = divarea.innerText; theSelection = divarea.innerText;
} }
@ -232,185 +253,6 @@ function addquote(post_id, username)
return; return;
} }
/**
* bbstyle
*/
function bbstyle(bbnumber)
{
donotinsert = false;
theSelection = false;
bblast = 0;
document.forms[form_name].elements[text_name].focus();
// Close all open tags & default button names
if (bbnumber == -1)
{
while (bbcode[0])
{
butnumber = arraypop(bbcode) - 1;
document.forms[form_name].elements[text_name].value += bbtags[butnumber + 1];
buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value');
if (buttext != '[*]')
{
eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
}
}
document.forms[form_name].addbbcode10.value = 'List';
bbtags[10] = '[list]';
document.forms[form_name].addbbcode12.value = 'List=';
bbtags[12] = '[list=]';
// All tags are closed including image tags :D
imageTag = false;
document.forms[form_name].elements[text_name].focus();
return;
}
// [*] doesn't have an end tag
noEndTag = (bbtags[bbnumber] == '[*]')
if ((clientVer >= 4) && is_ie && is_win)
{
// Get text selection
theSelection = document.selection.createRange().text;
if (theSelection)
{
// Add tags around selection
document.selection.createRange().text = bbtags[bbnumber] + theSelection + ((!noEndTag) ? bbtags[bbnumber+1] : '');
document.forms[form_name].elements[text_name].focus();
theSelection = '';
return;
}
}
else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0))
{
mozWrap(document.forms[form_name].elements[text_name], bbtags[bbnumber], ((!noEndTag) ? bbtags[bbnumber+1] : ''));
document.forms[form_name].elements[text_name].focus();
theSelection = '';
return;
}
// Find last occurance of an open tag the same as the one just clicked
for (i = 0; i < bbcode.length; i++)
{
if (bbcode[i] == bbnumber+1)
{
bblast = i;
donotinsert = true;
}
}
if (bbnumber == 10 && bbtags[10] != '[*]')
{
if (donotinsert)
{
document.forms[form_name].addbbcode12.value = 'List=';
tmp_help = o_help;
o_help = e_help;
e_help = tmp_help;
bbtags[12] = '[list=]';
}
else
{
document.forms[form_name].addbbcode12.value = '[*]';
tmp_help = o_help;
o_help = e_help;
e_help = tmp_help;
bbtags[12] = '[*]';
}
}
if (bbnumber == 12 && bbtags[12] != '[*]')
{
if (donotinsert)
{
document.forms[form_name].addbbcode10.value = 'List';
tmp_help = l_help;
l_help = e_help;
e_help = tmp_help;
bbtags[10] = '[list]';
}
else
{
document.forms[form_name].addbbcode10.value = '[*]';
tmp_help = l_help;
l_help = e_help;
e_help = tmp_help;
bbtags[10] = '[*]';
}
}
// Close all open tags up to the one just clicked & default button names
if (donotinsert)
{
while (bbcode[bblast])
{
butnumber = arraypop(bbcode) - 1;
if (bbtags[butnumber] != '[*]')
{
insert_text(bbtags[butnumber + 1]);
}
else
{
insert_text(bbtags[butnumber]);
}
buttext = eval('document.forms[form_name].addbbcode' + butnumber + '.value');
if (bbtags[butnumber] != '[*]')
{
eval('document.forms[form_name].addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
}
imageTag = false;
}
document.forms[form_name].elements[text_name].focus();
return;
}
else
{
// Open tags
// Close image tag before adding another
if (imageTag && (bbnumber != 14))
{
insert_text(bbtags[15]);
// Remove the close image tag from the list
lastValue = arraypop(bbcode) - 1;
// Return button back to normal state
document.forms[form_name].addbbcode14.value = 'Img';
imageTag = false;
}
// Open tag
insert_text(bbtags[bbnumber]);
// Check to stop additional tags after an unclosed image tag
if (bbnumber == 14 && imageTag == false)
{
imageTag = 1;
}
if (bbtags[bbnumber] != '[*]')
{
arraypush(bbcode, bbnumber + 1);
eval('document.forms[form_name].addbbcode'+bbnumber+'.value += "*"');
}
document.forms[form_name].elements[text_name].focus();
return;
}
storeCaret(document.forms[form_name].elements[text_name]);
}
/** /**
* From http://www.massless.org/mozedit/ * From http://www.massless.org/mozedit/
*/ */
@ -440,7 +282,7 @@ function mozWrap(txtarea, open, close)
} }
/** /**
* Insert at Claret position. Code from * Insert at Caret position. Code from
* http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130 * http://www.faqts.com/knowledge_base/view.phtml/aid/1052/fid/130
*/ */
function storeCaret(textEl) function storeCaret(textEl)
@ -465,7 +307,7 @@ function colorPalette(dir, width, height)
numberList[3] = 'BF'; numberList[3] = 'BF';
numberList[4] = 'FF'; numberList[4] = 'FF';
document.write('<table cellspacing="1" cellpadding="0" border="0" class="type2">'); document.writeln('<table cellspacing="1" cellpadding="0" border="0">');
for (r = 0; r < 5; r++) for (r = 0; r < 5; r++)
{ {
@ -484,8 +326,8 @@ function colorPalette(dir, width, height)
for (b = 0; b < 5; b++) for (b = 0; b < 5; b++)
{ {
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
document.write('<td style="line-height: ' + height + 'px; background-color:#' + color + '; width: ' + width + 'px; height: ' + height + 'px;">'); document.write('<td bgcolor="#' + color + '">');
document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>'); document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');" onmouseout="helpline(\'tip\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.writeln('</td>'); document.writeln('</td>');
} }
@ -502,3 +344,54 @@ function colorPalette(dir, width, height)
} }
document.writeln('</table>'); document.writeln('</table>');
} }
/**
* Caret Position object
*/
function caretPosition()
{
var start = null;
var end = null;
}
/**
* Get the caret position in an textarea
*/
function getCaretPosition(txtarea)
{
var caretPos = new caretPosition();
// simple Gecko/Opera way
if(txtarea.selectionStart || txtarea.selectionStart == 0)
{
caretPos.start = txtarea.selectionStart;
caretPos.end = txtarea.selectionEnd;
}
// dirty and slow IE way
else if(document.selection)
{
// get current selection
var range = document.selection.createRange();
// a new selection of the whole textarea
var range_all = document.body.createTextRange();
range_all.moveToElementText(txtarea);
// calculate selection start point by moving beginning of range_all to beginning of range
var sel_start;
for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++)
{
range_all.moveStart('character', 1);
}
txtarea.sel_start = sel_start;
// we ignore the end value for IE, this is already dirty enough and we don't need it
caretPos.start = txtarea.sel_start;
caretPos.end = txtarea.sel_start;
}
return caretPos;
}

View file

@ -54,12 +54,11 @@
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF S_SHOW_DOWNLOAD --> <!-- IF S_SHOW_DOWNLOAD -->
<fieldset> <h2>{L_DL_CONFIG}</h2>
<legend>{L_DL_CONFIG}</legend>
<p>{L_DL_CONFIG_EXPLAIN}</p> <p>{L_DL_CONFIG_EXPLAIN}</p>
</fieldset>
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_DL_CONFIG}</legend>
{S_HIDDEN} {S_HIDDEN}
<input class="button1" type="submit" id="dlconfig" name="dlconfig" value="{L_DL_DOWNLOAD}" />&nbsp;<input class="button1" type="submit" id="dldone" name="dldone" value="{L_DL_DONE}" /> <input class="button1" type="submit" id="dlconfig" name="dlconfig" value="{L_DL_DOWNLOAD}" />&nbsp;<input class="button1" type="submit" id="dldone" name="dldone" value="{L_DL_DONE}" />
</fieldset> </fieldset>
@ -67,6 +66,7 @@
<!-- IF L_SUBMIT --> <!-- IF L_SUBMIT -->
<fieldset class="submit-buttons"> <fieldset class="submit-buttons">
<legend>{L_SUBMIT}</legend>
{S_HIDDEN} {S_HIDDEN}
<!-- IF L_SUBMIT --><input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /><!-- ENDIF --> <!-- IF L_SUBMIT --><input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /><!-- ENDIF -->
</fieldset> </fieldset>

View file

@ -1,5 +1,15 @@
<!-- INCLUDE install_header.html --> <!-- INCLUDE install_header.html -->
<script type="text/javascript">
<!--
function popup(url, width, height)
{
window.open(url.replace(/&amp;/g, '&'), '_popup', 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
return false;
}
//-->
</script>
<!-- IF S_ERROR --> <!-- IF S_ERROR -->
<h1>{L_NOTICE}</h1> <h1>{L_NOTICE}</h1>
<p style="color: red;">{ERROR_MSG}</p> <p style="color: red;">{ERROR_MSG}</p>
@ -82,9 +92,9 @@
<!-- ELSEIF S_FILE_CHECK --> <!-- ELSEIF S_FILE_CHECK -->
<h1>{L_COLLECTED_INFORMATIONS}</h1> <h1>{L_COLLECTED_INFORMATION}</h1>
<p>{L_COLLECTED_INFORMATIONS_EXPLAIN}</p> <p>{L_COLLECTED_INFORMATION_EXPLAIN}</p>
<!-- IF S_NO_UPDATE_FILES --> <!-- IF S_NO_UPDATE_FILES -->
<div class="errorbox"> <div class="errorbox">
@ -110,9 +120,6 @@
<p>{files.EXPLAIN}</p> <p>{files.EXPLAIN}</p>
<!--table cellspacing="1">
<col class="row1" /><col class="row2" /><col class="row2" />
<tbody -->
<fieldset> <fieldset>
<legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend> <legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
<!-- ELSE --> <!-- ELSE -->
@ -129,7 +136,7 @@
<br /><span>{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS}</span> <br /><span>{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS}</span>
<!-- ENDIF --> <!-- ENDIF -->
</dt> </dt>
<dd>[ <a href="{files.U_SHOW_DIFF}" onclick="popup({files.UA_SHOW_DIFF}, 700, 500);">{files.L_SHOW_DIFF}</a> ]</dd> <dd>[ <a href="{files.U_SHOW_DIFF}" onclick="popup('{files.U_SHOW_DIFF}', 700, 500); return false;">{files.L_SHOW_DIFF}</a> ]</dd>
<!-- IF files.S_CUSTOM --> <!-- IF files.S_CUSTOM -->
<dd><input type="checkbox" name="no_update[]" value="{files.FILENAME}" class="radio" />&nbsp; {L_DO_NOT_UPDATE}</dd> <dd><input type="checkbox" name="no_update[]" value="{files.FILENAME}" class="radio" />&nbsp; {L_DO_NOT_UPDATE}</dd>
<!-- ENDIF --> <!-- ENDIF -->
@ -185,6 +192,25 @@
<p>{L_DOWNLOAD_UPDATE_METHOD_EXPLAIN}</p> <p>{L_DOWNLOAD_UPDATE_METHOD_EXPLAIN}</p>
<form id="install_update" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_DOWNLOAD_AS}</legend>
<dl>
<dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt>
<dd>{RADIO_BUTTONS}</dd>
</dl>
</fieldset>
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
<input type="submit" class="button2" value="{L_CHECK_FILES_AGAIN}" name="check_again" />&nbsp; &nbsp;<input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" />
</fieldset>
</form>
<br /><br />
<p>{L_MAPPING_FILE_STRUCTURE}</p> <p>{L_MAPPING_FILE_STRUCTURE}</p>
<table cellspacing="1"> <table cellspacing="1">
@ -207,23 +233,6 @@
</tbody> </tbody>
</table> </table>
<form id="install_update" method="post" action="{U_ACTION}">
<fieldset>
<legend>{L_DOWNLOAD_AS}</legend>
<dl>
<dt><label for="use_method">{L_DOWNLOAD_AS}:</label></dt>
<dd>{RADIO_BUTTONS}</dd>
</dl>
</fieldset>
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
<input type="submit" class="button2" value="{L_CHECK_FILES_AGAIN}" name="check_again" />&nbsp; &nbsp;<input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" />
</fieldset>
</form>
<!-- ELSEIF S_FTP_UPLOAD --> <!-- ELSEIF S_FTP_UPLOAD -->
<h1>{L_SELECT_FTP_SETTINGS}</h1> <h1>{L_SELECT_FTP_SETTINGS}</h1>

View file

@ -19,7 +19,7 @@
<div id="page-footer"> <div id="page-footer">
<!-- IF S_COPYRIGHT_HTML --> <!-- IF S_COPYRIGHT_HTML -->
Powered by phpBB {VERSION} &copy; 2006 <a href="http://www.phpbb.com/">phpBB Group</a> Powered by phpBB {VERSION} &copy; 2006 <a href="http://www.phpbb.com/">phpBB Group</a>
{L_TRANSLATION_INFO} <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --> <!-- IF DEBUG_OUTPUT -->

View file

@ -83,20 +83,31 @@ function marklist(id, name, state)
*/ */
function trace(link) function trace(link)
{ {
window.open(link, '_trace', 'height=515, resizable=yes, scrollbars=yes, width=680'); window.open(link.replace(/&amp;/g, '&'), '_trace', 'height=515, resizable=yes, scrollbars=yes, width=680');
return false; return false;
} }
<!-- IF S_INCLUDE_SWATCH --> /**
/** * Find a member
* Color swatch */
*/ function find_username()
function swatch() {
{ <!-- IF UA_FIND_USERNAME -->
window.open('{UA_SWATCH}', '_swatch', 'height=150, resizable=yes, scrollbars=no, width=636'); window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740');
<!-- ENDIF -->
return false; return false;
} }
<!-- ENDIF -->
/**
* Color swatch
*/
function swatch(field)
{
<!-- IF UA_SWATCH -->
window.open('{UA_SWATCH}' + field, '_swatch', 'height=150, resizable=yes, scrollbars=no, width=636');
<!-- ENDIF -->
return false;
}
//--> //-->
</script> </script>

View file

@ -186,7 +186,7 @@
<!-- ELSE --> <!-- ELSE -->
<td class="preset preset_custom"> <td class="preset preset_custom">
<!-- ENDIF --> <!-- ENDIF -->
<a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}'); return false;"><span></span></a></td> <a href="#" onclick="swap_options('{p_mask.S_ROW_COUNT}', '{p_mask.f_mask.S_ROW_COUNT}', '{p_mask.f_mask.category.S_ROW_COUNT}'); return false;">&nbsp;</a></td>
<!-- END category --> <!-- END category -->
</tr> </tr>
<tr class="row3"> <tr class="row3">

View file

@ -17,7 +17,7 @@
<!-- IF S_COPYRIGHT_HTML --> <!-- IF S_COPYRIGHT_HTML -->
<br />Powered by phpBB {VERSION} &copy; 2006 <a href="http://www.phpbb.com/">phpBB Group</a> <br />Powered by phpBB {VERSION} &copy; 2006 <a href="http://www.phpbb.com/">phpBB Group</a>
{TRANSLATION_INFO} <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- ENDIF --> <!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --> <!-- IF DEBUG_OUTPUT -->

View file

@ -73,16 +73,27 @@ function marklist(id, name, state)
} }
} }
<!-- IF S_INCLUDE_SWATCH --> /**
/** * Find a member
* Color swatch */
*/ function find_username()
function swatch() {
{ <!-- IF UA_FIND_USERNAME -->
window.open('{UA_SWATCH}', '_swatch', 'height=150, resizable=yes, scrollbars=no, width=636'); window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740');
<!-- ENDIF -->
return false; return false;
} }
<!-- ENDIF -->
/**
* Color swatch
*/
function swatch(field)
{
<!-- IF UA_SWATCH -->
window.open('{UA_SWATCH}' + field, '_swatch', 'height=150, resizable=yes, scrollbars=no, width=636');
<!-- ENDIF -->
return false;
}
//--> //-->
</script> </script>

View file

@ -31,8 +31,14 @@ $template->set_filenames(array(
$template->assign_vars(array( $template->assign_vars(array(
'OPENER' => addslashes(request_var('form', '')), 'OPENER' => addslashes(request_var('form', '')),
'NAME' => request_var('name', ''), 'NAME' => request_var('name', ''),
'T_IMAGES_PATH' => "{$phpbb_root_path}images/",) 'T_IMAGES_PATH' => "{$phpbb_root_path}images/",
);
'S_USER_LANG' => $user->lang['USER_LANG'],
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
'S_CONTENT_ENCODING' => 'UTF-8',
'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'],
'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'],
));
$template->display('body'); $template->display('body');

View file

@ -199,11 +199,4 @@ unset($dbpasswd);
// Grab global variables, re-cache if necessary // Grab global variables, re-cache if necessary
$config = $cache->obtain_config(); $config = $cache->obtain_config();
// Disable board if the install/ directory is still present
if (file_exists($phpbb_root_path . 'install') && !defined('ADMIN_START'))
{
$message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
trigger_error($message);
}
?> ?>

View file

@ -889,7 +889,7 @@ function get_schema_struct()
'COLUMNS' => array( 'COLUMNS' => array(
'bbcode_id' => array('TINT:3', 0), 'bbcode_id' => array('TINT:3', 0),
'bbcode_tag' => array('VCHAR:16', ''), 'bbcode_tag' => array('VCHAR:16', ''),
'bbcode_helpline' => array('VCHAR', ''), 'bbcode_helpline' => array('VCHAR_UNI', ''),
'display_on_posting' => array('BOOL', 0), 'display_on_posting' => array('BOOL', 0),
'bbcode_match' => array('TEXT_UNI', ''), 'bbcode_match' => array('TEXT_UNI', ''),
'bbcode_tpl' => array('MTEXT_UNI', ''), 'bbcode_tpl' => array('MTEXT_UNI', ''),
@ -933,8 +933,8 @@ function get_schema_struct()
$schema_data['phpbb_config'] = array( $schema_data['phpbb_config'] = array(
'COLUMNS' => array( 'COLUMNS' => array(
'config_name' => array('VCHAR:255', ''), 'config_name' => array('VCHAR', ''),
'config_value' => array('VCHAR', ''), 'config_value' => array('VCHAR_UNI', ''),
'is_dynamic' => array('BOOL', 0), 'is_dynamic' => array('BOOL', 0),
), ),
'PRIMARY_KEY' => 'config_name', 'PRIMARY_KEY' => 'config_name',
@ -1089,6 +1089,7 @@ function get_schema_struct()
'COLUMNS' => array( 'COLUMNS' => array(
'group_id' => array('UINT', NULL, 'auto_increment'), 'group_id' => array('UINT', NULL, 'auto_increment'),
'group_type' => array('TINT:4', 1), 'group_type' => array('TINT:4', 1),
'group_founder_manage' => array('BOOL', 0),
'group_name' => array('VCHAR_CI', ''), 'group_name' => array('VCHAR_CI', ''),
'group_desc' => array('TEXT_UNI', ''), 'group_desc' => array('TEXT_UNI', ''),
'group_desc_bitfield' => array('VCHAR:255', ''), 'group_desc_bitfield' => array('VCHAR:255', ''),
@ -1833,6 +1834,7 @@ function get_schema_struct()
'username_clean' => array('VCHAR_CI', ''), 'username_clean' => array('VCHAR_CI', ''),
'user_password' => array('VCHAR_UNI:40', ''), 'user_password' => array('VCHAR_UNI:40', ''),
'user_passchg' => array('TIMESTAMP', 0), 'user_passchg' => array('TIMESTAMP', 0),
'user_pass_convert' => array('BOOL', 0),
'user_email' => array('VCHAR_UNI:100', ''), 'user_email' => array('VCHAR_UNI:100', ''),
'user_email_hash' => array('BINT', 0), 'user_email_hash' => array('BINT', 0),
'user_birthday' => array('VCHAR:10', ''), 'user_birthday' => array('VCHAR:10', ''),
@ -1889,7 +1891,7 @@ function get_schema_struct()
'user_msnm' => array('VCHAR_UNI', ''), 'user_msnm' => array('VCHAR_UNI', ''),
'user_jabber' => array('VCHAR_UNI', ''), 'user_jabber' => array('VCHAR_UNI', ''),
'user_website' => array('VCHAR_UNI:200', ''), 'user_website' => array('VCHAR_UNI:200', ''),
'user_occ' => array('VCHAR_UNI', ''), 'user_occ' => array('TEXT_UNI', ''),
'user_interests' => array('TEXT_UNI', ''), 'user_interests' => array('TEXT_UNI', ''),
'user_actkey' => array('VCHAR:32', ''), 'user_actkey' => array('VCHAR:32', ''),
'user_newpasswd' => array('VCHAR_UNI:32', ''), 'user_newpasswd' => array('VCHAR_UNI:32', ''),

View file

@ -774,6 +774,14 @@ $sql = 'SELECT *
WHERE username = '" . $db-&gt;sql_escape($username) . "'"; WHERE username = '" . $db-&gt;sql_escape($username) . "'";
</pre></blockquote> </pre></blockquote>
<h3>sql_query_limit():</h3>
<p>We do not add limit statements to the sql query, but instead use <code>$db-&gt;sql_query_limit()</code>. You basically pass the query, the total number of lines to retrieve and the offset.</p>
<p><strong>Note: </strong> Since Oracle handles limits differently and because of how we implemented this handling you need to take special care if you use <code>sql_query_limit</code> with an sql query retrieving data from more than one table.</p>
<p>Make sure when using something like "SELECT x.*, y.jars" that there is not a column named jars in x; make sure that there is no overlap between an implicit column and the explicit columns.</p>
<h3>sql_build_array():</h3> <h3>sql_build_array():</h3>
<p>If you need to UPDATE or INSERT data, make use of the <code>$db-&gt;sql_build_array()</code> function. This function already escapes strings and checks other types, so there is no need to do this here. The data to be inserted should go into an array - <code>$sql_ary</code> - or directly within the statement if one one or two variables needs to be inserted/updated. An example of an insert statement would be:</p> <p>If you need to UPDATE or INSERT data, make use of the <code>$db-&gt;sql_build_array()</code> function. This function already escapes strings and checks other types, so there is no need to do this here. The data to be inserted should go into an array - <code>$sql_ary</code> - or directly within the statement if one one or two variables needs to be inserted/updated. An example of an insert statement would be:</p>
@ -856,6 +864,7 @@ SELECT FROM phpbb_forums WHERE forum_id <strong>&lt;&gt;</strong> 1
<p>If the given array is empty, an error will be produced.</p> <p>If the given array is empty, an error will be produced.</p>
<h3>sql_build_query():</h3> <h3>sql_build_query():</h3>
<p>The <code>$db-&gt;sql_build_query()</code> function is responsible for building sql statements for select and select distinct queries if you need to JOIN on more than one table or retrieving data from more than one table while doing a JOIN. This needs to be used to make sure the resulting statement is working on all supported db's. Instead of explaining every possible combination, i will give a short example:</p> <p>The <code>$db-&gt;sql_build_query()</code> function is responsible for building sql statements for select and select distinct queries if you need to JOIN on more than one table or retrieving data from more than one table while doing a JOIN. This needs to be used to make sure the resulting statement is working on all supported db's. Instead of explaining every possible combination, i will give a short example:</p>
<blockquote><pre> <blockquote><pre>
@ -1518,6 +1527,12 @@ div
<a name="changes"></a><h1>5. Guidelines Changelog</h1> <a name="changes"></a><h1>5. Guidelines Changelog</h1>
<div class="paragraph"> <div class="paragraph">
<h2>Revision 1.9-1.10</h2>
<ul class="menu">
<li>Added sql_query_limit to <a href="#sql">2.iii. SQL/SQL Layout</a>.</li>
</ul>
<h2>Revision 1.8</h2> <h2>Revision 1.8</h2>
<ul class="menu"> <ul class="menu">

View file

@ -245,8 +245,19 @@ function send_file_to_browser($attachment, $upload_dir, $category)
header("Content-Length: $size"); header("Content-Length: $size");
} }
// Might not be ideal to store the contents, but file_get_contents is binary-safe as well as the recommended method // Try to deliver in chunks
echo @file_get_contents($filename); @set_time_limit(0);
$fp = @fopen($filename, 'rb');
if ($fp !== false)
{
while (!feof($fp))
{
echo fread($fp, 8192);
}
fclose($fp);
}
flush(); flush();
exit; exit;

View file

@ -126,7 +126,7 @@ class acp_ban
AND u.user_id = b.ban_userid AND u.user_id = b.ban_userid
AND b.ban_userid <> 0 AND b.ban_userid <> 0
AND u.user_id <> ' . ANONYMOUS . ' AND u.user_id <> ' . ANONYMOUS . '
ORDER BY u.username ASC'; ORDER BY u.username_clean ASC';
break; break;
case 'ip': case 'ip':

View file

@ -76,7 +76,7 @@ class acp_bbcodes
$bbcode_match = request_var('bbcode_match', ''); $bbcode_match = request_var('bbcode_match', '');
$bbcode_tpl = htmlspecialchars_decode(request_var('bbcode_tpl', '')); $bbcode_tpl = htmlspecialchars_decode(request_var('bbcode_tpl', ''));
$bbcode_helpline = request_var('bbcode_helpline', ''); $bbcode_helpline = request_var('bbcode_helpline', '', true);
break; break;
} }
@ -128,13 +128,17 @@ class acp_bbcodes
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Grab the end, interrogate the last closing tag // Grab the end, interrogate the last closing tag
preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs); if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || (preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs) && in_array(strtolower($regs[1]), $hard_coded)))
if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || in_array(strtolower($regs[1]), $hard_coded))
{ {
trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING); trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING);
} }
} }
if (!preg_match('#\[' . $data['bbcode_tag'] .'].*?\[/' . $data['bbcode_tag'] . ']#s', $bbcode_match))
{
trigger_error($user->lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($this->u_action), E_USER_WARNING);
}
$sql_ary = array( $sql_ary = array(
'bbcode_tag' => $data['bbcode_tag'], 'bbcode_tag' => $data['bbcode_tag'],
'bbcode_match' => $bbcode_match, 'bbcode_match' => $bbcode_match,
@ -238,7 +242,7 @@ class acp_bbcodes
$sql = 'SELECT * $sql = 'SELECT *
FROM ' . BBCODES_TABLE . ' FROM ' . BBCODES_TABLE . '
ORDER BY bbcode_id'; ORDER BY bbcode_tag';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))

View file

@ -47,7 +47,7 @@ class acp_board
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'legend2' => 'WARNINGS', 'legend2' => 'WARNINGS',
'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true), 'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
) )
); );
break; break;
@ -91,8 +91,8 @@ class acp_board
'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true), 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true), 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rwpath', 'type' => 'text:20:255', 'explain' => true), 'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rwpath', 'type' => 'text:20:255', 'explain' => true),
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true) 'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true)
) )
@ -144,7 +144,7 @@ class acp_board
'bump_type' => false, 'bump_type' => false,
'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true), 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true),
'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false), 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false), 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false),
@ -153,10 +153,10 @@ class acp_board
'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int', 'type' => 'text:4:6', 'explain' => true), 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int', 'type' => 'text:4:6', 'explain' => true),
'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true),
'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
) )
); );
break; break;
@ -176,10 +176,10 @@ class acp_board
'legend2' => 'GENERAL_SETTINGS', 'legend2' => 'GENERAL_SETTINGS',
'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true),
'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
) )
); );
break; break;
@ -197,7 +197,7 @@ class acp_board
'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'password_length', 'explain' => true),
'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true), 'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true),
'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true),
'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
'legend2' => 'GENERAL_OPTIONS', 'legend2' => 'GENERAL_OPTIONS',
'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
@ -346,11 +346,7 @@ class acp_board
} }
$this->new_config = $config; $this->new_config = $config;
$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => ''), true) : $this->new_config; $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
if (isset($_REQUEST['config']))
{
utf8_normalize_nfc(&$cfg_array);
}
$error = array(); $error = array();
// We validate the complete config if whished // We validate the complete config if whished

View file

@ -1427,7 +1427,12 @@ class acp_database
} }
$sql_data .= implode(",\n", $rows); $sql_data .= implode(",\n", $rows);
$sql_data .= "\n);\n\n"; $sql_data .= "\n)";
if ($db->sql_layer == 'mysql4' || $db->sql_layer == 'mysqli')
{
$sql_data .= ' CHARACTER SET `utf8` COLLATE `utf8_bin`';
}
$sql_data .= ";\n\n";
break; break;

View file

@ -43,7 +43,7 @@ class acp_disallow
$sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user)); $sql = 'INSERT INTO ' . DISALLOW_TABLE . ' ' . $db->sql_build_array('INSERT', array('disallow_username' => $disallowed_user));
$db->sql_query($sql); $db->sql_query($sql);
$cache->destroy('disallowed_usernames'); $cache->destroy('_disallowed_usernames');
$message = $user->lang['DISALLOW_SUCCESSFUL']; $message = $user->lang['DISALLOW_SUCCESSFUL'];
add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user)); add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
@ -63,7 +63,7 @@ class acp_disallow
WHERE disallow_id = ' . $disallowed_id; WHERE disallow_id = ' . $disallowed_id;
$db->sql_query($sql); $db->sql_query($sql);
$cache->destroy('disallowed_usernames'); $cache->destroy('_disallowed_usernames');
add_log('admin', 'LOG_DISALLOW_DELETE'); add_log('admin', 'LOG_DISALLOW_DELETE');

View file

@ -524,6 +524,39 @@ class acp_forums
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Subforum move options
if ($action == 'edit' && $forum_data['forum_type'] == FORUM_CAT)
{
$subforums_id = array();
$subforums = get_forum_branch($forum_id, 'children');
foreach ($subforums as $row)
{
$subforums_id[] = $row['forum_id'];
}
$forums_list = make_forum_select($forum_data['parent_id'], $subforums_id);
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
WHERE forum_type = ' . FORUM_POST . "
AND forum_id <> $forum_id";
$result = $db->sql_query($sql);
if ($db->sql_fetchrow($result))
{
$template->assign_vars(array(
'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id)) // , false, true, false???
);
}
$db->sql_freeresult($result);
$template->assign_vars(array(
'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false,
'S_FORUMS_LIST' => $forums_list)
);
}
$s_show_display_on_index = false; $s_show_display_on_index = false;
if ($forum_data['parent_id'] > 0) if ($forum_data['parent_id'] > 0)
@ -586,6 +619,8 @@ class acp_forums
'S_SHOW_DISPLAY_ON_INDEX' => $s_show_display_on_index, 'S_SHOW_DISPLAY_ON_INDEX' => $s_show_display_on_index,
'S_FORUM_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, 'S_FORUM_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
'S_FORUM_ORIG_POST' => (isset($old_forum_type) && $old_forum_type == FORUM_POST) ? true : false, 'S_FORUM_ORIG_POST' => (isset($old_forum_type) && $old_forum_type == FORUM_POST) ? true : false,
'S_FORUM_ORIG_CAT' => (isset($old_forum_type) && $old_forum_type == FORUM_CAT) ? true : false,
'S_FORUM_ORIG_LINK' => (isset($old_forum_type) && $old_forum_type == FORUM_LINK) ? true : false,
'S_FORUM_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false, 'S_FORUM_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
'S_FORUM_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false, 'S_FORUM_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false,
'S_ENABLE_INDEXING' => ($forum_data['enable_indexing']) ? true : false, 'S_ENABLE_INDEXING' => ($forum_data['enable_indexing']) ? true : false,
@ -615,8 +650,8 @@ class acp_forums
$forum_data = $this->get_forum_info($forum_id); $forum_data = $this->get_forum_info($forum_id);
$subforums_id = array(); $subforums_id = array();
$subforums = get_forum_branch($forum_id, 'children'); $subforums = get_forum_branch($forum_id, 'children');
foreach ($subforums as $row) foreach ($subforums as $row)
{ {
$subforums_id[] = $row['forum_id']; $subforums_id[] = $row['forum_id'];
@ -647,6 +682,7 @@ class acp_forums
'FORUM_NAME' => $forum_data['forum_name'], 'FORUM_NAME' => $forum_data['forum_name'],
'S_FORUM_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false, 'S_FORUM_POST' => ($forum_data['forum_type'] == FORUM_POST) ? true : false,
'S_FORUM_LINK' => ($forum_data['forum_type'] == FORUM_LINK) ? true : false,
'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false, 'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false,
'S_FORUMS_LIST' => $forums_list, 'S_FORUMS_LIST' => $forums_list,
'S_ERROR' => (sizeof($errors)) ? true : false, 'S_ERROR' => (sizeof($errors)) ? true : false,
@ -801,7 +837,7 @@ class acp_forums
*/ */
function update_forum_data(&$forum_data) function update_forum_data(&$forum_data)
{ {
global $db, $user; global $db, $user, $cache;
$errors = array(); $errors = array();
@ -942,6 +978,123 @@ class acp_forums
$forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = $forum_data_sql['forum_last_post_id'] = $forum_data_sql['forum_last_poster_id'] = $forum_data_sql['forum_last_post_time'] = 0; $forum_data_sql['forum_posts'] = $forum_data_sql['forum_topics'] = $forum_data_sql['forum_topics_real'] = $forum_data_sql['forum_last_post_id'] = $forum_data_sql['forum_last_poster_id'] = $forum_data_sql['forum_last_post_time'] = 0;
$forum_data_sql['forum_last_poster_name'] = $forum_data_sql['forum_last_poster_colour'] = ''; $forum_data_sql['forum_last_poster_name'] = $forum_data_sql['forum_last_poster_colour'] = '';
} }
else if ($row['forum_type'] == FORUM_CAT && $forum_data_sql['forum_type'] == FORUM_LINK)
{
// Has subforums?
if ($row['right_id'] - $row['left_id'] > 1)
{
// We are turning a category into a link - but need to decide what to do with the subforums.
$action_subforums = request_var('action_subforums', '');
$subforums_to_id = request_var('subforums_to_id', 0);
if ($action_subforums == 'delete')
{
$log_action_forums = 'FORUMS';
$rows = get_forum_branch($row['forum_id'], 'children', 'descending', false);
foreach ($rows as $_row)
{
// Do not remove the forum id we are about to change. ;)
if ($_row['forum_id'] == $row['forum_id'])
{
continue;
}
$forum_ids[] = $_row['forum_id'];
$errors = array_merge($errors, $this->delete_forum_content($_row['forum_id']));
}
if (sizeof($errors))
{
return $errors;
}
if (sizeof($forum_ids))
{
$sql = 'DELETE FROM ' . FORUMS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
$db->sql_query($sql);
$sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_ids);
$db->sql_query($sql);
// Delete forum ids from extension groups table
$sql = 'SELECT group_id, allowed_forums
FROM ' . EXTENSION_GROUPS_TABLE;
$result = $db->sql_query($sql);
while ($_row = $db->sql_fetchrow($result))
{
if (!$_row['allowed_forums'])
{
continue;
}
$allowed_forums = unserialize(trim($_row['allowed_forums']));
$allowed_forums = array_diff($allowed_forums, $forum_ids);
$sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . "
SET allowed_forums = '" . ((sizeof($allowed_forums)) ? serialize($allowed_forums) : '') . "'
WHERE group_id = {$_row['group_id']}";
$db->sql_query($sql);
}
$db->sql_freeresult($result);
$cache->destroy('_extensions');
}
}
else if ($action_subforums == 'move')
{
if (!$subforums_to_id)
{
return array($user->lang['NO_DESTINATION_FORUM']);
}
$log_action_forums = 'MOVE_FORUMS';
$sql = 'SELECT forum_name
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . $subforums_to_id;
$result = $db->sql_query($sql);
$_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if (!$_row)
{
return array($user->lang['NO_FORUM']);
}
$subforums_to_name = $_row['forum_name'];
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . "
WHERE parent_id = {$row['forum_id']}";
$result = $db->sql_query($sql);
while ($_row = $db->sql_fetchrow($result))
{
$this->move_forum($_row['forum_id'], $subforums_to_id);
}
$db->sql_freeresult($result);
$sql = 'UPDATE ' . FORUMS_TABLE . "
SET parent_id = $subforums_to_id
WHERE parent_id = {$row['forum_id']}";
$db->sql_query($sql);
}
// Adjust the left/right id
$sql = 'UPDATE ' . FORUMS_TABLE . '
SET right_id = left_id + 1
WHERE forum_id = ' . $row['forum_id'];
$db->sql_query($sql);
}
}
if (sizeof($errors)) if (sizeof($errors))
{ {
@ -1533,8 +1686,6 @@ class acp_forums
set_config('upload_dir_size', (int) $row['stat'], true); set_config('upload_dir_size', (int) $row['stat'], true);
add_log('admin', 'LOG_RESYNC_STATS');
return array(); return array();
} }

View file

@ -54,6 +54,12 @@ class acp_groups
{ {
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
} }
// Check if the user is allowed to manage this group if set to founder only.
if ($user->data['user_type'] != USER_FOUNDER && $group_row['group_founder_manage'])
{
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
} }
// Which page? // Which page?
@ -214,9 +220,10 @@ class acp_groups
} }
$name_ary = array_unique(explode("\n", $name_ary)); $name_ary = array_unique(explode("\n", $name_ary));
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
// Add user/s to group // Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_row['group_name'], $default, $leader, 0, $group_row)) if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row))
{ {
trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING); trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id), E_USER_WARNING);
} }
@ -266,9 +273,18 @@ class acp_groups
'rank' => request_var('group_rank', 0), 'rank' => request_var('group_rank', 0),
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0, 'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
'legend' => isset($_REQUEST['group_legend']) ? 1 : 0, 'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
'message_limit' => request_var('group_message_limit', 0) 'message_limit' => request_var('group_message_limit', 0),
); );
if ($user->data['user_type'] == USER_FOUNDER)
{
$submit_ary['founder_manage'] = isset($_REQUEST['group_founder_manage']) ? 1 : 0;
}
else
{
$submit_ary['founder_manage'] = 0;
}
if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink']) if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink'])
{ {
$data['width'] = request_var('width', ''); $data['width'] = request_var('width', '');
@ -328,7 +344,7 @@ class acp_groups
// were made. // were made.
$group_attributes = array(); $group_attributes = array();
$test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit'); $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'founder_manage');
foreach ($test_variables as $test) foreach ($test_variables as $test)
{ {
if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test])) if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
@ -434,6 +450,8 @@ class acp_groups
if (isset($group_row['group_avatar']) && $group_row['group_avatar']) if (isset($group_row['group_avatar']) && $group_row['group_avatar'])
{ {
$avatar_img = '';
switch ($group_row['group_avatar_type']) switch ($group_row['group_avatar_type'])
{ {
case AVATAR_UPLOAD: case AVATAR_UPLOAD:
@ -444,8 +462,8 @@ class acp_groups
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/'; $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break; break;
} }
$avatar_img .= $group_row['group_avatar'];
$avatar_img .= $group_row['group_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $group_row['group_avatar_width'] . '" height="' . $group_row['group_avatar_height'] . '" alt="" />'; $avatar_img = '<img src="' . $avatar_img . '" width="' . $group_row['group_avatar_width'] . '" height="' . $group_row['group_avatar_height'] . '" alt="" />';
} }
else else
@ -482,16 +500,19 @@ class acp_groups
'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false, 'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false,
'S_DISPLAY_GALLERY' => ($config['allow_avatar_local'] && !$display_gallery) ? true : false, 'S_DISPLAY_GALLERY' => ($config['allow_avatar_local'] && !$display_gallery) ? true : false,
'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false, 'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false,
'S_USER_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name, 'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name,
'GROUP_INTERNAL_NAME' => $group_name, 'GROUP_INTERNAL_NAME' => $group_name,
'GROUP_DESC' => $group_desc_data['text'], 'GROUP_DESC' => $group_desc_data['text'],
'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '', 'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '',
'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '', 'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '',
'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '', 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'],
'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'], 'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'],
'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'], 'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'],

View file

@ -132,7 +132,7 @@ class acp_inactive
// Sorting // Sorting
$limit_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'], 365 => $user->lang['1_YEAR']); $limit_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'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME']); $sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME']);
$sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username'); $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username_clean');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);

View file

@ -148,7 +148,7 @@ class acp_jabber
$template->assign_vars(array( $template->assign_vars(array(
'U_ACTION' => $this->u_action, 'U_ACTION' => $this->u_action,
'JAB_ENABLE' => $new['jab_enable'], 'JAB_ENABLE' => $new['jab_enable'],
'L_JAB_SERVER_EXPLAIN' => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '<a href="http://www.xmpp.net/" rel="external">', '</a>'), 'L_JAB_SERVER_EXPLAIN' => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '<a href="http://www.jabber.org/">', '</a>'),
'JAB_HOST' => $new['jab_host'], 'JAB_HOST' => $new['jab_host'],
'JAB_PORT' => $new['jab_port'], 'JAB_PORT' => $new['jab_port'],
'JAB_USERNAME' => $new['jab_username'], 'JAB_USERNAME' => $new['jab_username'],

View file

@ -107,11 +107,11 @@ class acp_language
$hidden_data = build_hidden_fields(array( $hidden_data = build_hidden_fields(array(
'file' => $this->language_file, 'file' => $this->language_file,
'dir' => $this->language_directory, 'dir' => $this->language_directory,
'method' => $method, 'method' => $method)
'entry' => $_POST['entry']),
true
); );
$hidden_data .= build_hidden_fields(array('entry' => $_POST['entry']), true, STRIP);
$template->assign_vars(array( $template->assign_vars(array(
'S_UPLOAD' => true, 'S_UPLOAD' => true,
'NAME' => $method, 'NAME' => $method,

View file

@ -68,7 +68,7 @@ class acp_logs
// Sorting // Sorting
$limit_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'], 365 => $user->lang['1_YEAR']); $limit_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'], 365 => $user->lang['1_YEAR']);
$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_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
$sort_by_sql = array('u' => 'u.username', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
@ -127,8 +127,8 @@ class acp_logs
} }
$template->assign_block_vars('log', array( $template->assign_block_vars('log', array(
'USERNAME' => $row['username'], 'USERNAME' => $row['username_full'],
'REPORTEE_USERNAME' => ($row['reportee_username'] && $row['user_id'] != $row['reportee_id']) ? $row['reportee_username'] : '', 'REPORTEE_USERNAME' => ($row['reportee_username'] && $row['user_id'] != $row['reportee_id']) ? $row['reportee_username_full'] : '',
'IP' => $row['ip'], 'IP' => $row['ip'],
'DATE' => $user->format_date($row['time']), 'DATE' => $user->format_date($row['time']),

View file

@ -324,7 +324,7 @@ class acp_main
foreach ($log_data as $row) foreach ($log_data as $row)
{ {
$template->assign_block_vars('log', array( $template->assign_block_vars('log', array(
'USERNAME' => $row['username'], 'USERNAME' => $row['username_full'],
'IP' => $row['ip'], 'IP' => $row['ip'],
'DATE' => $user->format_date($row['time']), 'DATE' => $user->format_date($row['time']),
'ACTION' => $row['action']) 'ACTION' => $row['action'])

View file

@ -265,7 +265,7 @@ class acp_modules
// Category/not category? // Category/not category?
$is_cat = (!$module_data['module_basename']) ? true : false; $is_cat = (!$module_data['module_basename']) ? true : false;
// Get module informations // Get module information
$module_infos = $this->get_module_infos(); $module_infos = $this->get_module_infos();
// Build name options // Build name options
@ -488,7 +488,7 @@ class acp_modules
} }
/** /**
* Get available module informations from module files * Get available module information from module files
*/ */
function get_module_infos($module = '', $module_class = false) function get_module_infos($module = '', $module_class = false)
{ {
@ -580,14 +580,10 @@ class acp_modules
$right = $row['right_id']; $right = $row['right_id'];
/**
* @todo think about using module class here
*/
if (!$ignore_acl && $row['module_auth']) if (!$ignore_acl && $row['module_auth'])
{ {
$is_auth = false; // We use zero as the forum id to check - global setting.
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get("\\1"\\2)', 'true', '(int) $auth->acl_getf_global("\\1")', '(int) $config["\\1"]'), $row['module_auth']) . ');'); if (!p_master::module_auth($row['module_auth'], 0))
if (!$is_auth)
{ {
continue; continue;
} }

View file

@ -936,7 +936,7 @@ class acp_profile
$field_id = request_var('field_id', 0); $field_id = request_var('field_id', 0);
// Collect all informations, if something is going wrong, abort the operation // Collect all information, if something is going wrong, abort the operation
$profile_sql = $profile_lang = $empty_lang = $profile_lang_fields = array(); $profile_sql = $profile_lang = $empty_lang = $profile_lang_fields = array();
$default_lang_id = $lang_defs['iso'][$config['default_lang']]; $default_lang_id = $lang_defs['iso'][$config['default_lang']];

View file

@ -457,7 +457,7 @@ class acp_search
/** /**
* @todo remove Javascript * @todo remove Javascript
*/ */
return '<script language="javascript" type="text/javascript"> return '<script type="text/javascript">
<!-- <!--
close_waitscreen = 1; close_waitscreen = 1;
//--> //-->

View file

@ -978,7 +978,7 @@ pagination_sep = \'{PAGINATION_SEP}\'
foreach ($classes as $class) foreach ($classes as $class)
{ {
$selected = ($class == $edit_class) ? ' selected="selected"' : ''; $selected = ($class == $edit_class) ? ' selected="selected"' : '';
$s_classes .= '<option value="' . $class . '"' . $selected . '>' . $class . '</option>'; $s_classes .= '<option value="' . $class . '" title="' . $class . '"' . $selected . '>' . truncate_string($class, 40, false, '...') . '</option>';
} }
$template->assign_vars(array( $template->assign_vars(array(

View file

@ -140,7 +140,7 @@ class acp_users
// Prevent normal users/admins change/view founders if they are not a founder by themselves // Prevent normal users/admins change/view founders if they are not a founder by themselves
if ($user->data['user_type'] != USER_FOUNDER && $user_row['user_type'] == USER_FOUNDER) if ($user->data['user_type'] != USER_FOUNDER && $user_row['user_type'] == USER_FOUNDER)
{ {
trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING); trigger_error($user->lang['NOT_MANAGE_FOUNDER'] . adm_back_link($this->u_action), E_USER_WARNING);
} }
switch ($mode) switch ($mode)
@ -620,8 +620,8 @@ class acp_users
$data = array( $data = array(
'username' => request_var('user', $user_row['username'], true), 'username' => request_var('user', $user_row['username'], true),
'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0), 'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
'email' => request_var('user_email', $user_row['user_email']), 'email' => strtolower(request_var('user_email', $user_row['user_email'])),
'email_confirm' => request_var('email_confirm', ''), 'email_confirm' => strtolower(request_var('email_confirm', '')),
'user_password' => request_var('user_password', '', true), 'user_password' => request_var('user_password', '', true),
'password_confirm' => request_var('password_confirm', '', true), 'password_confirm' => request_var('password_confirm', '', true),
'warnings' => request_var('warnings', $user_row['user_warnings']), 'warnings' => request_var('warnings', $user_row['user_warnings']),
@ -841,6 +841,31 @@ class acp_users
$last_visit = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit']; $last_visit = (!empty($user_row['session_time'])) ? $user_row['session_time'] : $user_row['user_lastvisit'];
$inactive_reason = '';
if ($user_row['user_type'] == USER_INACTIVE)
{
$inactive_reason = $user->lang['INACTIVE_REASON_UNKNOWN'];
switch ($user_row['user_inactive_reason'])
{
case INACTIVE_REGISTER:
$inactive_reason = $user->lang['INACTIVE_REASON_REGISTER'];
break;
case INACTIVE_PROFILE:
$inactive_reason = $user->lang['INACTIVE_REASON_PROFILE'];
break;
case INACTIVE_MANUAL:
$inactive_reason = $user->lang['INACTIVE_REASON_MANUAL'];
break;
case INACTIVE_REMIND:
$inactive_reason = $user->lang['INACTIVE_REASON_REMIND'];
break;
}
}
$template->assign_vars(array( $template->assign_vars(array(
'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), 'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
@ -865,6 +890,7 @@ class acp_users
'USER_EMAIL' => $user_row['user_email'], 'USER_EMAIL' => $user_row['user_email'],
'USER_WARNINGS' => $user_row['user_warnings'], 'USER_WARNINGS' => $user_row['user_warnings'],
'USER_POSTS' => $user_row['user_posts'], 'USER_POSTS' => $user_row['user_posts'],
'USER_INACTIVE_REASON' => $inactive_reason,
) )
); );
@ -923,7 +949,7 @@ class acp_users
// Sorting // Sorting
$limit_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'], 365 => $user->lang['1_YEAR']); $limit_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'], 365 => $user->lang['1_YEAR']);
$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_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
$sort_by_sql = array('u' => 'l.username', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
@ -951,7 +977,7 @@ class acp_users
foreach ($log_data as $row) foreach ($log_data as $row)
{ {
$template->assign_block_vars('log', array( $template->assign_block_vars('log', array(
'USERNAME' => $row['username'], 'USERNAME' => $row['username_full'],
'IP' => $row['ip'], 'IP' => $row['ip'],
'DATE' => $user->format_date($row['time']), 'DATE' => $user->format_date($row['time']),
'ACTION' => nl2br($row['action']), 'ACTION' => nl2br($row['action']),
@ -983,16 +1009,14 @@ class acp_users
'yim' => request_var('yim', $user_row['user_yim']), 'yim' => request_var('yim', $user_row['user_yim']),
'jabber' => request_var('jabber', $user_row['user_jabber']), 'jabber' => request_var('jabber', $user_row['user_jabber']),
'website' => request_var('website', $user_row['user_website']), 'website' => request_var('website', $user_row['user_website']),
'location' => request_var('location', $user_row['user_from'], true), 'location' => utf8_normalize_nfc(request_var('location', $user_row['user_from'], true)),
'occupation' => request_var('occupation', $user_row['user_occ'], true), 'occupation' => utf8_normalize_nfc(request_var('occupation', $user_row['user_occ'], true)),
'interests' => request_var('interests', $user_row['user_interests'], true), 'interests' => utf8_normalize_nfc(request_var('interests', $user_row['user_interests'], true)),
'bday_day' => 0, 'bday_day' => 0,
'bday_month' => 0, 'bday_month' => 0,
'bday_year' => 0, 'bday_year' => 0,
); );
utf8_normalize_nfc(array(&$data['location'], &$data['occupation'], &$data['interests']));
if ($user_row['user_birthday']) if ($user_row['user_birthday'])
{ {
list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']); list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']);
@ -1161,7 +1185,7 @@ class acp_users
case 'prefs': case 'prefs':
$data = array( $data = array(
'dateformat' => request_var('dateformat', $user_row['user_dateformat']), 'dateformat' => request_var('dateformat', $user_row['user_dateformat'], true),
'lang' => request_var('lang', $user_row['user_lang']), 'lang' => request_var('lang', $user_row['user_lang']),
'tz' => request_var('tz', (float) $user_row['user_timezone']), 'tz' => request_var('tz', (float) $user_row['user_timezone']),
'style' => request_var('style', $user_row['user_style']), 'style' => request_var('style', $user_row['user_style']),
@ -1551,9 +1575,7 @@ class acp_users
$enable_bbcode = ($config['allow_sig_bbcode']) ? request_var('enable_bbcode', $this->optionget($user_row, 'bbcode')) : false; $enable_bbcode = ($config['allow_sig_bbcode']) ? request_var('enable_bbcode', $this->optionget($user_row, 'bbcode')) : false;
$enable_smilies = ($config['allow_sig_smilies']) ? request_var('enable_smilies', $this->optionget($user_row, 'smilies')) : false; $enable_smilies = ($config['allow_sig_smilies']) ? request_var('enable_smilies', $this->optionget($user_row, 'smilies')) : false;
$enable_urls = request_var('enable_urls', true); $enable_urls = request_var('enable_urls', true);
$signature = request_var('signature', $user_row['user_sig'], true); $signature = utf8_normalize_nfc(request_var('signature', $user_row['user_sig'], true));
utf8_normalize_nfc(&$signature);
$preview = (isset($_POST['preview'])) ? true : false; $preview = (isset($_POST['preview'])) ? true : false;
@ -1821,6 +1843,19 @@ class acp_users
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING); trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
} }
// Check the founder only entry for this group to make sure everything is well
$sql = 'SELECT group_founder_manage
FROM ' . GROUPS_TABLE . '
WHERE group_id = ' . $group_id;
$result = $db->sql_query($sql);
$founder_manage = (int) $db->sql_fetchfield('group_founder_manage');
$db->sql_freeresult($result);
if ($user->data['user_type'] != USER_FOUNDER && $founder_manage)
{
trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
// Add user/s to group // Add user/s to group
if ($error = group_user_add($group_id, $user_id)) if ($error = group_user_add($group_id, $user_id))
{ {
@ -1855,7 +1890,7 @@ class acp_users
$db->sql_freeresult($result); $db->sql_freeresult($result);
// Select box for other groups // Select box for other groups
$sql = 'SELECT group_id, group_name, group_type $sql = 'SELECT group_id, group_name, group_type, group_founder_manage
FROM ' . GROUPS_TABLE . ' FROM ' . GROUPS_TABLE . '
' . ((sizeof($id_ary)) ? 'WHERE ' . $db->sql_in_set('group_id', $id_ary, true) : '') . ' ' . ((sizeof($id_ary)) ? 'WHERE ' . $db->sql_in_set('group_id', $id_ary, true) : '') . '
ORDER BY group_type DESC, group_name ASC'; ORDER BY group_type DESC, group_name ASC';
@ -1869,6 +1904,12 @@ class acp_users
continue; continue;
} }
// Do not display those groups not allowed to be managed
if ($user->data['user_type'] != USER_FOUNDER && $row['group_founder_manage'])
{
continue;
}
$s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; $s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -1925,7 +1966,7 @@ class acp_users
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')
{ {
$sql .= " ESCAPE '\\'"; $sql .= " ESCAPE '\\' ";
} }
$sql .= 'AND is_global = 1 $sql .= 'AND is_global = 1
@ -1945,7 +1986,7 @@ class acp_users
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')
{ {
$sql .= " ESCAPE '\\'"; $sql .= " ESCAPE '\\' ";
} }
$sql .= 'AND is_local = 1 $sql .= 'AND is_local = 1

View file

@ -69,10 +69,8 @@ class acp_words
case 'save': case 'save':
$word_id = request_var('id', 0); $word_id = request_var('id', 0);
$word = request_var('word', '', true); $word = utf8_normalize_nfc(request_var('word', '', true));
$replacement = request_var('replacement', '', true); $replacement = utf8_normalize_nfc(request_var('replacement', '', true));
utf8_normalize_nfc(array(&$word, &$replacement));
if (!$word || !$replacement) if (!$word || !$replacement)
{ {

View file

@ -293,7 +293,7 @@ class auth_admin extends auth
$sql = 'SELECT user_id as ug_id, username as ug_name $sql = 'SELECT user_id as ug_id, username as ug_name
FROM ' . USERS_TABLE . ' FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', array_keys($hold_ary)) . ' WHERE ' . $db->sql_in_set('user_id', array_keys($hold_ary)) . '
ORDER BY username ASC'; ORDER BY username_clean ASC';
} }
else else
{ {
@ -606,7 +606,7 @@ class auth_admin extends auth
$sql = 'SELECT user_id, username $sql = 'SELECT user_id, username
FROM ' . USERS_TABLE . ' FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $auth_ary['users']) . ' WHERE ' . $db->sql_in_set('user_id', $auth_ary['users']) . '
ORDER BY username'; ORDER BY username_clean ASC';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
@ -1068,6 +1068,7 @@ class auth_admin extends auth
'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']', 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']',
'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '', 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&amp;mode=trace&amp;u=$ug_id&amp;f=$forum_id&amp;auth=$permission") : '',
'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '',
'PERMISSION' => $user->lang['acl_' . $permission]['lang']) 'PERMISSION' => $user->lang['acl_' . $permission]['lang'])
); );

View file

@ -478,11 +478,11 @@ class auth
$sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : $db->sql_in_set('user_id', $user_id)) : ''; $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : $db->sql_in_set('user_id', $user_id)) : '';
$sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : ''; $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : '';
$sql_opts = $sql_escape = ''; $sql_opts = '';
if ($opts !== false) if ($opts !== false)
{ {
$this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts, $sql_escape); $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts);
} }
$hold_ary = array(); $hold_ary = array();
@ -512,7 +512,7 @@ class auth
'ORDER_BY' => 'a.forum_id, ao.auth_option' 'ORDER_BY' => 'a.forum_id, ao.auth_option'
)); ));
$result = $db->sql_query($sql . $sql_escape); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
@ -588,11 +588,11 @@ class auth
$sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : $db->sql_in_set('user_id', $user_id)) : ''; $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? "user_id = $user_id" : $db->sql_in_set('user_id', $user_id)) : '';
$sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : ''; $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : '';
$sql_opts = $sql_escape = ''; $sql_opts = '';
if ($opts !== false) if ($opts !== false)
{ {
$this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts, $sql_escape); $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts);
} }
$hold_ary = array(); $hold_ary = array();
@ -620,7 +620,7 @@ class auth
'ORDER_BY' => 'a.forum_id, ao.auth_option' 'ORDER_BY' => 'a.forum_id, ao.auth_option'
)); ));
$result = $db->sql_query($sql . $sql_escape); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
@ -642,11 +642,11 @@ class auth
$sql_group = ($group_id !== false) ? ((!is_array($group_id)) ? "group_id = $group_id" : $db->sql_in_set('group_id', $group_id)) : ''; $sql_group = ($group_id !== false) ? ((!is_array($group_id)) ? "group_id = $group_id" : $db->sql_in_set('group_id', $group_id)) : '';
$sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : ''; $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? "AND a.forum_id = $forum_id" : 'AND ' . $db->sql_in_set('a.forum_id', $forum_id)) : '';
$sql_opts = $sql_escape = ''; $sql_opts = '';
if ($opts !== false) if ($opts !== false)
{ {
$this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts, $sql_escape); $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts);
} }
$hold_ary = array(); $hold_ary = array();
@ -674,7 +674,7 @@ class auth
'ORDER_BY' => 'a.forum_id, ao.auth_option' 'ORDER_BY' => 'a.forum_id, ao.auth_option'
)); ));
$result = $db->sql_query($sql . $sql_escape); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
@ -791,7 +791,7 @@ class auth
/** /**
* Fill auth_option statement for later querying based on the supplied options * Fill auth_option statement for later querying based on the supplied options
*/ */
function build_auth_option_statement($key, $auth_options, &$sql_opts, &$sql_escape) function build_auth_option_statement($key, $auth_options, &$sql_opts)
{ {
global $db; global $db;
@ -802,7 +802,7 @@ class auth
if (strpos($auth_options, '_') !== false) if (strpos($auth_options, '_') !== false)
{ {
$sql_opts = "AND $key LIKE '" . $db->sql_escape(str_replace('_', "\_", $auth_options)) . "'"; $sql_opts = "AND $key LIKE '" . $db->sql_escape(str_replace('_', "\_", $auth_options)) . "'";
$sql_escape = ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : ''; $sql_opts .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\' " : '';
} }
else else
{ {
@ -816,7 +816,7 @@ class auth
} }
else else
{ {
$is_like_expression = $is_underline = false; $is_like_expression = false;
foreach ($auth_options as $option) foreach ($auth_options as $option)
{ {
@ -824,11 +824,6 @@ class auth
{ {
$is_like_expression = true; $is_like_expression = true;
} }
if (strpos($option, '_') !== false)
{
$is_underline = true;
}
} }
if (!$is_like_expression) if (!$is_like_expression)
@ -841,15 +836,26 @@ class auth
foreach ($auth_options as $option) foreach ($auth_options as $option)
{ {
$sql[] = $key . " LIKE '" . $db->sql_escape(str_replace('_', "\_", $option)) . "'"; if (strpos($option, '%') !== false)
{
if (strpos($option, '_') !== false)
{
$_sql = $key . " LIKE '" . $db->sql_escape(str_replace('_', "\_", $option)) . "'";
$_sql .= ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : '';
$sql[] = $_sql;
}
else
{
$sql[] = $key . " LIKE '" . $db->sql_escape($option) . "'";
}
}
else
{
$sql[] = $key . " = '" . $db->sql_escape($option) . "'";
}
} }
$sql_opts = 'AND (' . implode(' OR ', $sql) . ')'; $sql_opts = 'AND (' . implode(' OR ', $sql) . ')';
if ($is_underline)
{
$sql_escape = ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') ? " ESCAPE '\\'" : '';
}
} }
} }
} }

View file

@ -20,7 +20,7 @@ function login_db(&$username, &$password)
{ {
global $db, $config; global $db, $config;
$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_login_attempts $sql = 'SELECT user_id, username, user_password, user_passchg, user_pass_convert, user_email, user_type, user_login_attempts
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . "
WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; WHERE username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -95,8 +95,32 @@ function login_db(&$username, &$password)
} }
} }
// Password correct... // If the password convert flag is set we need to convert it
if (md5($password) == $row['user_password']) if ($row['user_pass_convert'])
{
// in phpBB2 passwords were used exactly as they were sent
$password_old_format = isset($_REQUEST['password']) ? (string) $_REQUEST['password'] : '';
$password_old_format = (STRIP) ? stripslashes($password_old_format) : $password_old_format;
$password_new_format = '';
set_var($password_new_format, $password_old_format, 'string');
if ($password == $password_new_format && md5($password_old_format) == $row['user_password'])
{
// Update the password in the users table to the new format and remove user_pass_convert flag
$sql = 'UPDATE ' . USERS_TABLE . '
SET user_password = \'' . $db->sql_escape(md5($password_new_format)) . '\',
user_pass_convert = 0
WHERE user_id = ' . $row['user_id'];
$db->sql_query($sql);
$row['user_pass_convert'] = 0;
$row['user_password'] = md5($password_new_format);
}
}
// Check password ...
if (!$row['user_pass_convert'] && md5($password) == $row['user_password'])
{ {
// Successful, reset login attempts (the user passed all stages) // Successful, reset login attempts (the user passed all stages)
$sql = 'UPDATE ' . USERS_TABLE . ' $sql = 'UPDATE ' . USERS_TABLE . '

View file

@ -230,8 +230,8 @@ function acp_ldap(&$new)
<dd><input type="text" id="ldap_uid" size="40" name="config[ldap_uid]" value="' . $new['ldap_uid'] . '" /></dd> <dd><input type="text" id="ldap_uid" size="40" name="config[ldap_uid]" value="' . $new['ldap_uid'] . '" /></dd>
</dl> </dl>
<dl> <dl>
<dt><label for="ldap_uid">' . $user->lang['LDAP_EMAIL'] . ':</label><br /><span>' . $user->lang['LDAP_EMAIL_EXPLAIN'] . '</span></dt> <dt><label for="ldap_email">' . $user->lang['LDAP_EMAIL'] . ':</label><br /><span>' . $user->lang['LDAP_EMAIL_EXPLAIN'] . '</span></dt>
<dd><input type="text" id="ldap_uid" size="40" name="config[ldap_email]" value="' . $new['ldap_email'] . '" /></dd> <dd><input type="text" id="ldap_email" size="40" name="config[ldap_email]" value="' . $new['ldap_email'] . '" /></dd>
</dl> </dl>
'; ';

View file

@ -221,7 +221,7 @@ class bbcode
{ {
$this->bbcode_cache[$bbcode_id] = array( $this->bbcode_cache[$bbcode_id] = array(
'preg' => array( 'preg' => array(
'#\[img:$uid\](.*?)\[/img:$uid\]#s' => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id)), '#\[img:$uid\](.*?)\[/img:$uid\]#s' => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
) )
); );
} }
@ -300,7 +300,7 @@ class bbcode
{ {
$this->bbcode_cache[$bbcode_id] = array( $this->bbcode_cache[$bbcode_id] = array(
'preg' => array( 'preg' => array(
'#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id))) '#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id, true)))
) )
); );
} }
@ -381,7 +381,7 @@ class bbcode
/** /**
* Return bbcode template * Return bbcode template
*/ */
function bbcode_tpl($tpl_name, $bbcode_id = -1) function bbcode_tpl($tpl_name, $bbcode_id = -1, $skip_bitfield_check = false)
{ {
if (empty($bbcode_hardtpl)) if (empty($bbcode_hardtpl))
{ {
@ -403,7 +403,7 @@ class bbcode
$template_bitfield = new bitfield($this->template_bitfield); $template_bitfield = new bitfield($this->template_bitfield);
} }
if ($bbcode_id != -1 && !$template_bitfield->get($bbcode_id)) if ($bbcode_id != -1 && !$template_bitfield->get($bbcode_id) && !$skip_bitfield_check)
{ {
return (isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false; return (isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false;
} }

View file

@ -16,33 +16,18 @@
*/ */
class captcha class captcha
{ {
var $width = 360;
var $height = 96;
function execute($code) function execute($code)
{ {
global $config; global $config;
$stats = gd_info(); $stats = gd_info();
if (substr($stats['GD Version'], 0, 7) === 'bundled') $bundled = (substr($stats['GD Version'], 0, 7) === 'bundled') ? true : false;
{
$bundled = true;
}
else
{
$bundled = false;
}
preg_match('/[\\d.]+/', $stats['GD Version'], $version); preg_match('/[\\d.]+/', $stats['GD Version'], $version);
if (version_compare($version[0], '2.0.1', '>=')) $gd_version = (version_compare($version[0], '2.0.1', '>=')) ? 2 : 1;
{
$gd_version = 2;
}
else
{
$gd_version = 1;
}
// set dimension of image
$lx = 360;
$ly = 96;
// create the image, stay compat with older versions of GD // create the image, stay compat with older versions of GD
if ($gd_version === 2) if ($gd_version === 2)
@ -56,7 +41,7 @@ class captcha
$func2 = 'imagecolorclosest'; $func2 = 'imagecolorclosest';
} }
$image = $func1($lx, $ly); $image = $func1($this->width, $this->height);
if ($bundled) if ($bundled)
{ {
@ -65,7 +50,7 @@ class captcha
// set background color // set background color
$back = imagecolorallocate($image, mt_rand(224, 255), mt_rand(224, 255), mt_rand(224, 255)); $back = imagecolorallocate($image, mt_rand(224, 255), mt_rand(224, 255), mt_rand(224, 255));
imagefilledrectangle($image, 0, 0, $lx, $ly, $back); imagefilledrectangle($image, 0, 0, $this->width, $this->height, $back);
// allocates the 216 websafe color palette to the image // allocates the 216 websafe color palette to the image
if ($gd_version === 1) if ($gd_version === 1)
@ -82,7 +67,6 @@ class captcha
} }
} }
// fill with noise or grid // fill with noise or grid
if ($config['captcha_gd_noise']) if ($config['captcha_gd_noise'])
{ {
@ -92,7 +76,7 @@ class captcha
$size = mt_rand(8, 23); $size = mt_rand(8, 23);
$angle = mt_rand(0, 360); $angle = mt_rand(0, 360);
$x = mt_rand(0, 360); $x = mt_rand(0, 360);
$y = mt_rand(0, (int)($ly - ($size / 5))); $y = mt_rand(0, (int)($this->height - ($size / 5)));
$color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224)); $color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224));
$text = chr(mt_rand(45, 250)); $text = chr(mt_rand(45, 250));
imagettftext($image, $size, $angle, $x, $y, $color, $this->get_font(), $text); imagettftext($image, $size, $angle, $x, $y, $color, $this->get_font(), $text);
@ -101,15 +85,16 @@ class captcha
else else
{ {
// generate grid // generate grid
for ($i = 0; $i < $lx; $i += 13) for ($i = 0; $i < $this->width; $i += 13)
{ {
$color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224)); $color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224));
imageline($image, $i, 0, $i, $ly, $color); imageline($image, $i, 0, $i, $this->height, $color);
} }
for ($i = 0; $i < $ly; $i += 11)
for ($i = 0; $i < $this->height; $i += 11)
{ {
$color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224)); $color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224));
imageline($image, 0, $i, $lx, $i, $color); imageline($image, 0, $i, $this->width, $i, $color);
} }
} }
@ -120,7 +105,7 @@ class captcha
$text = strtoupper($code[$i]); $text = strtoupper($code[$i]);
$angle = mt_rand(-30, 30); $angle = mt_rand(-30, 30);
$size = mt_rand(20, 40); $size = mt_rand(20, 40);
$y = mt_rand((int)($size * 1.5), (int)($ly - ($size / 7))); $y = mt_rand((int)($size * 1.5), (int)($this->height - ($size / 7)));
$color = $func2($image, mt_rand(0, 127), mt_rand(0, 127), mt_rand(0, 127)); $color = $func2($image, mt_rand(0, 127), mt_rand(0, 127), mt_rand(0, 127));
$shadow = $func2($image, mt_rand(127, 254), mt_rand(127, 254), mt_rand(127, 254)); $shadow = $func2($image, mt_rand(127, 254), mt_rand(127, 254), mt_rand(127, 254));

View file

@ -17,6 +17,8 @@
class captcha class captcha
{ {
var $filtered_pngs; var $filtered_pngs;
var $width = 320;
var $height = 50;
/** /**
* Define filtered pngs on init * Define filtered pngs on init
@ -32,9 +34,7 @@ class captcha
*/ */
function execute($code) function execute($code)
{ {
$total_width = 320; $img_height = $this->height - 10;
$total_height = 50;
$img_height = 40;
$img_width = 0; $img_width = 0;
list($usec, $sec) = explode(' ', microtime()); list($usec, $sec) = explode(' ', microtime());
@ -45,7 +45,7 @@ class captcha
for ($i = 0; $i < $code_len; $i++) for ($i = 0; $i < $code_len; $i++)
{ {
$char = $code{$i}; $char = $code[$i];
$width = mt_rand(0, 4); $width = mt_rand(0, 4);
$raw_width = $this->filtered_pngs[$char]['width']; $raw_width = $this->filtered_pngs[$char]['width'];
@ -59,11 +59,11 @@ class captcha
} }
} }
$offset_x = mt_rand(0, $total_width - $img_width); $offset_x = mt_rand(0, $this->width - $img_width);
$offset_y = mt_rand(0, $total_height - $img_height); $offset_y = mt_rand(0, $this->height - $img_height);
$image = ''; $image = '';
for ($i = 0; $i < $total_height; $i++) for ($i = 0; $i < $this->height; $i++)
{ {
$image .= chr(0); $image .= chr(0);
@ -79,14 +79,14 @@ class captcha
$image .= $this->randomise(substr($hold_chars[$code{$j}][$i - $offset_y - 1], 1), $char_widths[$j]); $image .= $this->randomise(substr($hold_chars[$code{$j}][$i - $offset_y - 1], 1), $char_widths[$j]);
} }
for ($j = $offset_x + $img_width; $j < $total_width; $j++) for ($j = $offset_x + $img_width; $j < $this->width; $j++)
{ {
$image .= chr(mt_rand(140, 255)); $image .= chr(mt_rand(140, 255));
} }
} }
else else
{ {
for ($j = 0; $j < $total_width; $j++) for ($j = 0; $j < $this->width; $j++)
{ {
$image .= chr(mt_rand(140, 255)); $image .= chr(mt_rand(140, 255));
} }
@ -94,7 +94,7 @@ class captcha
} }
unset($hold_chars); unset($hold_chars);
$image = $this->create_png($image, $total_width, $total_height); $image = $this->create_png($image, $this->width, $this->height);
// Output image // Output image
header('Content-Type: image/png'); header('Content-Type: image/png');

View file

@ -307,15 +307,15 @@ class dbal
} }
else else
{ {
return $field . ($negate ? ' NOT IN ' : ' IN ' ) . '(' . implode(', ', array_map(array($this, '_sql_validate_value'), $array)) . ')'; return $field . ($negate ? ' NOT IN ' : ' IN ') . '(' . implode(', ', array_map(array($this, '_sql_validate_value'), $array)) . ')';
} }
} }
/** /**
* Run more than one insert statement. * Run more than one insert statement.
* *
* @param $sql_ary array multi-dimensional array holding the statement data. * @param string $table table name to run the statements on
* @param $table string table name to run the statements on * @param array &$sql_ary multi-dimensional array holding the statement data.
* *
* @return bool false if no statements were executed. * @return bool false if no statements were executed.
* @access public * @access public
@ -332,7 +332,6 @@ class dbal
case 'mysql': case 'mysql':
case 'mysql4': case 'mysql4':
case 'mysqli': case 'mysqli':
case 'sqlite':
$this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('MULTI_INSERT', $sql_ary)); $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('MULTI_INSERT', $sql_ary));
break; break;

View file

@ -116,9 +116,6 @@ class dbal_mssql extends dbal
$this->sql_report('start', $query); $this->sql_report('start', $query);
} }
// For now, MSSQL has no real UTF-8 support
$query = utf8_decode($query);
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result); $this->sql_add_num_queries($this->query_result);

View file

@ -114,9 +114,6 @@ class dbal_mssql_odbc extends dbal
$this->sql_report('start', $query); $this->sql_report('start', $query);
} }
// For now, MSSQL has no real UTF-8 support
$query = utf8_decode($query);
$this->last_query_text = $query; $this->last_query_text = $query;
$this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false;
$this->sql_add_num_queries($this->query_result); $this->sql_add_num_queries($this->query_result);

View file

@ -219,52 +219,6 @@ class dbal_oracle extends dbal
{ {
$this->query_result = false; $this->query_result = false;
// Any implicit columns exist?
if (strpos($query, '.*') !== false)
{
// This sucker does a few things for us. It grabs all the explicitly named columns and what tables are being used
preg_match('/SELECT (?:DISTINCT )?(.*?)FROM(.*?)(?:WHERE|(ORDER|GROUP) BY|$)/s', $query, $tables);
// The prefixes of the explicit columns don't matter, they simply get in the way
preg_match_all('/\.(\w+)/', trim($tables[1]), $columns);
// Flip lets us do an easy isset() call
$columns = array_flip($columns[1]);
$table_data = trim($tables[2]);
// Grab the implicitly named columns, they need expanding...
preg_match_all('/(\w)\.\*/', $query, $info);
$cols = array();
foreach ($info[1] as $table_alias)
{
// We need to get the name of the aliased table
preg_match('/(\w+) ' . $table_alias . '/', $table_data, $table_name);
$table_name = $table_name[1];
$sql = "SELECT column_name
FROM all_tab_cols
WHERE table_name = '" . strtoupper($table_name) . "'";
$result = $this->sql_query($sql);
while ($row = $this->sql_fetchrow($result))
{
if (!isset($columns[strtolower($row['column_name'])]))
{
$cols[] = $table_alias . '.' . strtolower($row['column_name']);
}
}
$this->sql_freeresult($result);
// Remove the implicity .* with it's full expansion
$query = str_replace($table_alias . '.*', implode(', ', $cols), $query);
unset($cols);
}
}
$query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset; $query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset;
return $this->sql_query($query, $cache_ttl); return $this->sql_query($query, $cache_ttl);

View file

@ -23,17 +23,12 @@ include_once($phpbb_root_path . 'includes/diff/renderer.' . $phpEx);
* Code from pear.php.net, Text_Diff-0.2.1 (beta) package * Code from pear.php.net, Text_Diff-0.2.1 (beta) package
* http://pear.php.net/package/Text_Diff/ * http://pear.php.net/package/Text_Diff/
* *
* Modified by Acyd Burn to meet our coding standards * Modified by phpBB Group to meet our coding standards
* and being able to integrate into phpBB * and being able to integrate into phpBB
*/ *
/**
* General API for generating and formatting diffs - the differences between * General API for generating and formatting diffs - the differences between
* two sequences of strings. * two sequences of strings.
* *
* The PHP diff code used in this package was originally written by Geoffrey
* T. Dairiki and is used with his permission.
*
* @package phpBB3 * @package phpBB3
* @author Geoffrey T. Dairiki <dairiki@dairiki.org> * @author Geoffrey T. Dairiki <dairiki@dairiki.org>
*/ */
@ -182,7 +177,7 @@ class diff
/** /**
* Removes trailing newlines from a line of text. This is meant to be used with array_walk(). * Removes trailing newlines from a line of text. This is meant to be used with array_walk().
* *
* @param string $line The line to trim. * @param string &$line The line to trim.
* @param integer $key The index of the line in the array. Not used. * @param integer $key The index of the line in the array. Not used.
*/ */
function trim_newlines(&$line, $key) function trim_newlines(&$line, $key)

View file

@ -19,11 +19,9 @@ if (!defined('IN_PHPBB'))
* Code from pear.php.net, Text_Diff-0.2.1 (beta) package * Code from pear.php.net, Text_Diff-0.2.1 (beta) package
* http://pear.php.net/package/Text_Diff/ * http://pear.php.net/package/Text_Diff/
* *
* Modified by Acyd Burn to meet our coding standards * Modified by phpBB Group to meet our coding standards
* and being able to integrate into phpBB * and being able to integrate into phpBB
*/ *
/**
* Class used internally by Diff to actually compute the diffs. This class is * Class used internally by Diff to actually compute the diffs. This class is
* implemented using native PHP code. * implemented using native PHP code.
* *

View file

@ -19,11 +19,9 @@ if (!defined('IN_PHPBB'))
* Code from pear.php.net, Text_Diff-0.2.1 (beta) package * Code from pear.php.net, Text_Diff-0.2.1 (beta) package
* http://pear.php.net/package/Text_Diff/ * http://pear.php.net/package/Text_Diff/
* *
* Modified by Acyd Burn to meet our coding standards * Modified by phpBB Group to meet our coding standards
* and being able to integrate into phpBB * and being able to integrate into phpBB
*/ *
/**
* A class to render Diffs in different formats. * A class to render Diffs in different formats.
* *
* This class renders the diff in classic diff format. It is intended that * This class renders the diff in classic diff format. It is intended that
@ -86,7 +84,7 @@ class diff_renderer
/** /**
* Renders a diff. * Renders a diff.
* *
* @param diff $diff A diff object. * @param diff &$diff A diff object.
* *
* @return string The formatted output. * @return string The formatted output.
*/ */

View file

@ -153,7 +153,7 @@ function gen_rand_string($num_chars = 8)
/** /**
* Return unique id * Return unique id
* @param $extra additional entropy * @param string $extra additional entropy
*/ */
function unique_id($extra = 'c') function unique_id($extra = 'c')
{ {
@ -237,7 +237,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
*/ */
function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false) function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list = false)
{ {
global $config, $auth, $template, $user, $db, $phpEx; global $config, $auth, $template, $user, $db;
if (!$config['load_jumpbox']) if (!$config['load_jumpbox'])
{ {
@ -401,9 +401,9 @@ if (!function_exists('stripos'))
* Find position of first occurrence of a case-insensitive string * Find position of first occurrence of a case-insensitive string
* *
* @param string $haystack is the string to search in * @param string $haystack is the string to search in
* @param string needle is the string to search for * @param string $needle is the string to search for
* *
* @return Returns the numeric position of the first occurrence of needle in the haystack string. Unlike strpos(), stripos() is case-insensitive. * @return mixed Returns the numeric position of the first occurrence of needle in the haystack string. Unlike strpos(), stripos() is case-insensitive.
* Note that the needle may be a string of one or more characters. * Note that the needle may be a string of one or more characters.
* If needle is not found, stripos() will return boolean FALSE. * If needle is not found, stripos() will return boolean FALSE.
*/ */
@ -502,7 +502,7 @@ if (!function_exists('realpath'))
else if (isset($_SERVER['SCRIPT_FILENAME']) && !empty($_SERVER['SCRIPT_FILENAME'])) else if (isset($_SERVER['SCRIPT_FILENAME']) && !empty($_SERVER['SCRIPT_FILENAME']))
{ {
// Warning: If chdir() has been used this will lie! // Warning: If chdir() has been used this will lie!
// @todo This has some problems sometime (CLI can create them easily) // Warning: This has some problems sometime (CLI can create them easily)
$path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($_SERVER['SCRIPT_FILENAME'])) . '/' . $path; $path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($_SERVER['SCRIPT_FILENAME'])) . '/' . $path;
$absolute = true; $absolute = true;
$path_prefix = ''; $path_prefix = '';
@ -614,6 +614,10 @@ else
if (!function_exists('htmlspecialchars_decode')) if (!function_exists('htmlspecialchars_decode'))
{ {
/**
* A wrapper for htmlspecialchars_decode
* @ignore
*/
function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT) function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT)
{ {
return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style))); return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style)));
@ -675,20 +679,24 @@ function style_select($default = '', $all = false)
*/ */
function tz_select($default = '', $truncate = false) function tz_select($default = '', $truncate = false)
{ {
global $sys_timezone, $user; global $user;
$tz_select = ''; $tz_select = '';
foreach ($user->lang['tz_zones'] as $offset => $zone) foreach ($user->lang['tz_zones'] as $offset => $zone)
{ {
if ($truncate) if ($truncate)
{ {
$zone = (utf8_strlen($zone) > 70) ? utf8_substr($zone, 0, 70) . '...' : $zone; $zone_trunc = truncate_string($zone, 50, false, '...');
}
else
{
$zone_trunc = $zone;
} }
if (is_numeric($offset)) if (is_numeric($offset))
{ {
$selected = ($offset == $default) ? ' selected="selected"' : ''; $selected = ($offset == $default) ? ' selected="selected"' : '';
$tz_select .= '<option value="' . $offset . '"' . $selected . '>' . $zone . '</option>'; $tz_select .= '<option title="'.$zone.'" value="' . $offset . '"' . $selected . '>' . $zone_trunc . '</option>';
} }
} }
@ -1861,7 +1869,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
} }
} }
// The result parameter is always an array, holding the relevant informations... // The result parameter is always an array, holding the relevant information...
if ($result['status'] == LOGIN_SUCCESS) if ($result['status'] == LOGIN_SUCCESS)
{ {
$redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx"); $redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");
@ -2093,7 +2101,7 @@ function bump_topic_allowed($forum_id, $topic_bumped, $last_post_time, $topic_po
function get_context($text, $words, $length = 400) function get_context($text, $words, $length = 400)
{ {
// first replace all whitespaces with single spaces // first replace all whitespaces with single spaces
$text = preg_replace('/\s+/', ' ', $text); $text = preg_replace('/\s+/u', ' ', $text);
$word_indizes = array(); $word_indizes = array();
if (sizeof($words)) if (sizeof($words))
@ -2358,19 +2366,19 @@ function make_clickable($text, $server_url = false)
// Be sure to not let the matches cross over. ;) // Be sure to not let the matches cross over. ;)
// relative urls for this board // relative urls for this board
$magic_url_match[] = '#(^|[\n ]|\()(' . preg_quote($server_url, '#') . ')/(([^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie'; $magic_url_match[] = '#(^|[\n\t (])(' . preg_quote($server_url, '#') . ')/(([^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie';
$magic_url_replace[] = "'\$1<!-- l --><a href=\"\$2/' . preg_replace('/(&amp;|\?)sid=[0-9a-f]{32}/', '\\1', '\$3') . '\">' . preg_replace('/(&amp;|\?)sid=[0-9a-f]{32}/', '\\1', '\$3') . '</a><!-- l -->'"; $magic_url_replace[] = "'\$1<!-- l --><a href=\"\$2/' . preg_replace('/(&amp;|\?)sid=[0-9a-f]{32}/', '\\1', '\$3') . '\">' . preg_replace('/(&amp;|\?)sid=[0-9a-f]{32}/', '\\1', '\$3') . '</a><!-- l -->'";
// matches a xxxx://aaaaa.bbb.cccc. ... // matches a xxxx://aaaaa.bbb.cccc. ...
$magic_url_match[] = '#(^|[\n ]|\()([\w]+:/{2}.*?([^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie'; $magic_url_match[] = '#(^|[\n\t (])([\w]+:/{2}.*?([^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie';
$magic_url_replace[] = "'\$1<!-- m --><a href=\"\$2\">' . ((strlen('\$2') > 55) ? substr(str_replace('&amp;', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&amp;', '&', '\$2'), -10) : '\$2') . '</a><!-- m -->'"; $magic_url_replace[] = "'\$1<!-- m --><a href=\"\$2\">' . ((strlen('\$2') > 55) ? substr(str_replace('&amp;', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&amp;', '&', '\$2'), -10) : '\$2') . '</a><!-- m -->'";
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
$magic_url_match[] = '#(^|[\n ]|\()(w{3}\.[\w\-]+\.[\w\-.\~]+(?:[^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie'; $magic_url_match[] = '#(^|[\n\t (])(w{3}\.[\w\-]+\.[\w\-.\~]+(?:[^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie';
$magic_url_replace[] = "'\$1<!-- w --><a href=\"http://\$2\">' . ((strlen('\$2') > 55) ? substr(str_replace('&amp;', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&amp;', '&', '\$2'), -10) : '\$2') . '</a><!-- w -->'"; $magic_url_replace[] = "'\$1<!-- w --><a href=\"http://\$2\">' . ((strlen('\$2') > 55) ? substr(str_replace('&amp;', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&amp;', '&', '\$2'), -10) : '\$2') . '</a><!-- w -->'";
// matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode.
$magic_url_match[] = '/(^|[\n ]|\()(' . get_preg_expression('email') . ')/ie'; $magic_url_match[] = '/(^|[\n\t )])(' . get_preg_expression('email') . ')/ie';
$magic_url_replace[] = "'\$1<!-- e --><a href=\"mailto:\$2\">' . ((strlen('\$2') > 55) ? substr('\$2', 0, 39) . ' ... ' . substr('\$2', -10) : '\$2') . '</a><!-- e -->'"; $magic_url_replace[] = "'\$1<!-- e --><a href=\"mailto:\$2\">' . ((strlen('\$2') > 55) ? substr('\$2', 0, 39) . ' ... ' . substr('\$2', -10) : '\$2') . '</a><!-- e -->'";
} }
@ -2493,14 +2501,14 @@ function extension_allowed($forum_id, $extension, &$extensions)
/** /**
* Little helper for the build_hidden_fields function * Little helper for the build_hidden_fields function
*/ */
function _build_hidden_fields($key, $value, $specialchar) function _build_hidden_fields($key, $value, $specialchar, $stripslashes)
{ {
$hidden_fields = ''; $hidden_fields = '';
if (!is_array($value)) if (!is_array($value))
{ {
$key = ($specialchar) ? htmlspecialchars($key) : $key; $value = ($stripslashes) ? stripslashes($value) : $value;
$value = ($specialchar) ? htmlspecialchars($value) : $value; $value = ($specialchar) ? htmlspecialchars($value, ENT_COMPAT, 'UTF-8') : $value;
$hidden_fields .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n"; $hidden_fields .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n";
} }
@ -2508,7 +2516,10 @@ function _build_hidden_fields($key, $value, $specialchar)
{ {
foreach ($value as $_key => $_value) foreach ($value as $_key => $_value)
{ {
$hidden_fields .= _build_hidden_fields($key . '[' . $_key . ']', $_value, $specialchar); $_key = ($stripslashes) ? stripslashes($_key) : $_key;
$_key = ($specialchar) ? htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') : $_key;
$hidden_fields .= _build_hidden_fields($key . '[' . $_key . ']', $_value, $specialchar, $stripslashes);
} }
} }
@ -2517,14 +2528,23 @@ function _build_hidden_fields($key, $value, $specialchar)
/** /**
* Build simple hidden fields from array * Build simple hidden fields from array
*
* @param array $field_ary an array of values to build the hidden field from
* @param bool $specialchar if true, keys and values get specialchared
* @param bool $stripslashes if true, keys and values get stripslashed
*
* @return string the hidden fields
*/ */
function build_hidden_fields($field_ary, $specialchar = false) function build_hidden_fields($field_ary, $specialchar = false, $stripslashes = false)
{ {
$s_hidden_fields = ''; $s_hidden_fields = '';
foreach ($field_ary as $name => $vars) foreach ($field_ary as $name => $vars)
{ {
$s_hidden_fields .= _build_hidden_fields($name, $vars, $specialchar); $name = ($stripslashes) ? stripslashes($name) : $name;
$name = ($specialchar) ? htmlspecialchars($name, ENT_COMPAT, 'UTF-8') : $name;
$s_hidden_fields .= _build_hidden_fields($name, $vars, $specialchar, $stripslashes);
} }
return $s_hidden_fields; return $s_hidden_fields;
@ -2660,7 +2680,7 @@ function get_backtrace()
$trace['file'] = substr($trace['file'], 1); $trace['file'] = substr($trace['file'], 1);
$args = array(); $args = array();
// If include/require/include_once is not called, do not show arguments - they may contain sensible informations // If include/require/include_once is not called, do not show arguments - they may contain sensible information
if (!in_array($trace['function'], array('include', 'require', 'include_once'))) if (!in_array($trace['function'], array('include', 'require', 'include_once')))
{ {
unset($trace['args']); unset($trace['args']);
@ -2721,11 +2741,12 @@ function get_preg_expression($mode)
* Truncates string while retaining special characters if going over the max length * Truncates string while retaining special characters if going over the max length
* The default max length is 60 at the moment * The default max length is 60 at the moment
*/ */
function truncate_string($string, $max_length = 60, $allow_reply = true) function truncate_string($string, $max_length = 60, $allow_reply = true, $append = '')
{ {
$chars = array(); $chars = array();
$strip_reply = false; $strip_reply = false;
$stripped = false;
if ($allow_reply && strpos($string, 'Re: ') === 0) if ($allow_reply && strpos($string, 'Re: ') === 0)
{ {
$strip_reply = true; $strip_reply = true;
@ -2740,6 +2761,7 @@ function truncate_string($string, $max_length = 60, $allow_reply = true)
{ {
// Cut off the last elements from the array // Cut off the last elements from the array
$string = implode('', array_slice($chars, 0, $max_length)); $string = implode('', array_slice($chars, 0, $max_length));
$stripped = true;
} }
if ($strip_reply) if ($strip_reply)
@ -2747,9 +2769,92 @@ function truncate_string($string, $max_length = 60, $allow_reply = true)
$string = 'Re: ' . $string; $string = 'Re: ' . $string;
} }
if ($append != '' && $stripped)
{
$string = $string . $append;
}
return $string; return $string;
} }
/**
* Get username details for placing into templates.
*
* @param string $mode Can be profile (for getting an url to the profile), username (for obtaining the username), colour (for obtaining the user colour) or full (for obtaining a html string representing a coloured link to the users profile).
* @param int $user_id The users id
* @param string $username The users name
* @param string $username_colour The users colour
* @param string $guest_username optional parameter to specify the guest username. It will be used in favor of the GUEST language variable then.
* @param string $custom_profile_url optional parameter to specify a profile url. The user id get appended to this url as &amp;u={user_id}
*
* @return string A string consisting of what is wanted based on $mode.
*/
function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false)
{
global $phpbb_root_path, $phpEx, $user;
$full_string = $profile_url = '';
$username_colour = ($username_colour) ? '#' . $username_colour : '';
if ($guest_username === false)
{
$username = ($username) ? $username : $user->lang['GUEST'];
}
else
{
$username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $user->lang['GUEST']);
}
// Only show the link if not anonymous
if ($user_id && $user_id != ANONYMOUS)
{
$profile_url = ($custom_profile_url !== false) ? $custom_profile_url : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile');
$profile_url .= '&amp;u=' . (int) $user_id;
}
else
{
$profile_url = '';
}
switch ($mode)
{
case 'profile':
return $profile_url;
break;
case 'username':
return $username;
break;
case 'colour':
return $username_colour;
break;
case 'full':
default:
$tpl = '';
if (!$profile_url && !$username_colour)
{
$tpl = '{USERNAME}';
}
else if (!$profile_url && $username_colour)
{
$tpl = '<span style="color: {USERNAME_COLOUR}; font-weight: bold;">{USERNAME}</span>';
}
else if ($profile_url && !$username_colour)
{
$tpl = '<a href="{PROFILE_URL}">{USERNAME}</a>';
}
else if ($profile_url && $username_colour)
{
$tpl = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR}; font-weight: bold;">{USERNAME}</a>';
}
return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl);
break;
}
}
/** /**
* Wrapper for php's checkdnsrr function. * Wrapper for php's checkdnsrr function.
@ -2773,6 +2878,12 @@ function phpbb_checkdnsrr($host, $type = '')
@exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output); @exec('nslookup -type=' . escapeshellarg($type) . ' ' . escapeshellarg($host), $output);
// If output is empty, the nslookup failed
if (empty($output))
{
return NULL;
}
foreach ($output as $line) foreach ($output as $line)
{ {
if (!trim($line)) if (!trim($line))
@ -2820,17 +2931,12 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
// Check the error reporting level and return if the error level does not match // Check the error reporting level and return if the error level does not match
// Additionally do not display notices if we suppress them via @ // Additionally do not display notices if we suppress them via @
// If DEBUG_EXTRA is defined the default level is E_ALL // If DEBUG is defined the default level is E_ALL
if (($errno & ((defined('DEBUG_EXTRA') && error_reporting()) ? E_ALL : error_reporting())) == 0) if (($errno & ((defined('DEBUG') && error_reporting()) ? E_ALL : error_reporting())) == 0)
{ {
return; return;
} }
/**
* @todo Think about removing the if-condition within the final product, since we no longer enable DEBUG by default and we will maybe adjust the error reporting level
*/
if (defined('DEBUG'))
{
if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false)
{ {
// remove complete path to installation, with the risk of changing backslashes meant to be there // remove complete path to installation, with the risk of changing backslashes meant to be there
@ -2839,7 +2945,6 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n"; echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
} }
}
break; break;
@ -3004,7 +3109,7 @@ function page_header($page_title = '', $display_online_list = true)
// Specify escape character for MSSQL // Specify escape character for MSSQL
if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc')
{ {
$reading_sql .= " ESCAPE '\\'"; $reading_sql .= " ESCAPE '\\' ";
} }
} }
@ -3041,7 +3146,7 @@ function page_header($page_title = '', $display_online_list = true)
$reading_sql . $reading_sql .
((!$config['load_online_guests']) ? ' AND s.session_user_id <> ' . ANONYMOUS : '') . ' ((!$config['load_online_guests']) ? ' AND s.session_user_id <> ' . ANONYMOUS : '') . '
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_clean ASC, s.session_ip ASC';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
@ -3345,6 +3450,7 @@ function page_footer($run_cron = true)
$template->assign_vars(array( $template->assign_vars(array(
'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '', 'DEBUG_OUTPUT' => (defined('DEBUG')) ? $debug_output : '',
'TRANSLATION_INFO' => (!empty($user->lang['TRANSLATION_INFO'])) ? $user->lang['TRANSLATION_INFO'] : '',
'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", '', true, $user->session_id) : '') 'U_ACP' => ($auth->acl_get('a_') && $user->data['is_registered']) ? append_sid("{$phpbb_root_path}adm/index.$phpEx", '', true, $user->session_id) : '')
); );
@ -3385,7 +3491,7 @@ function page_footer($run_cron = true)
if ($cron_type) if ($cron_type)
{ {
$template->assign_var('RUN_CRON_TASK', '<img src="' . $phpbb_root_path . 'cron.' . $phpEx . '?cron_type=' . $cron_type . '" width="1" height="1" alt="cron" />'); $template->assign_var('RUN_CRON_TASK', '<img src="' . append_sid($phpbb_root_path . 'cron.' . $phpEx, 'cron_type=' . $cron_type) . '" width="1" height="1" alt="cron" />');
} }
} }

View file

@ -160,7 +160,7 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl =
if ($return_array) if ($return_array)
{ {
// Include some more informations... // Include some more information...
$selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? true : false) : (($row['forum_id'] == $select_id) ? true : false); $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? true : false) : (($row['forum_id'] == $select_id) ? true : false);
$forum_list[$row['forum_id']] = array_merge(array('padding' => $padding, 'selected' => $selected), $row); $forum_list[$row['forum_id']] = array_merge(array('padding' => $padding, 'selected' => $selected), $row);
} }
@ -471,7 +471,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
sync('forum', 'forum_id', $forum_ids, true); sync('forum', 'forum_id', $forum_ids, true);
} }
// Update posted informations // Update posted information
update_posted_info($topic_ids); update_posted_info($topic_ids);
} }
@ -482,6 +482,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
{ {
global $db, $config; global $db, $config;
$approved_topics = 0;
$forum_ids = $topic_ids = array(); $forum_ids = $topic_ids = array();
if (is_array($where_ids)) if (is_array($where_ids))
@ -502,7 +503,7 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
'posts' => delete_posts($where_type, $where_ids, false, true) 'posts' => delete_posts($where_type, $where_ids, false, true)
); );
$sql = 'SELECT topic_id, forum_id $sql = 'SELECT topic_id, forum_id, topic_approved
FROM ' . TOPICS_TABLE . ' FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set($where_type, $where_ids); WHERE ' . $db->sql_in_set($where_type, $where_ids);
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -511,6 +512,11 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
{ {
$forum_ids[] = $row['forum_id']; $forum_ids[] = $row['forum_id'];
$topic_ids[] = $row['topic_id']; $topic_ids[] = $row['topic_id'];
if ($row['topic_approved'])
{
$approved_topics++;
}
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -545,7 +551,10 @@ function delete_topics($where_type, $where_ids, $auto_sync = true)
sync('topic_reported', $where_type, $where_ids); sync('topic_reported', $where_type, $where_ids);
} }
set_config('num_topics', $config['num_topics'] - sizeof($return['topics']), true); if ($approved_topics)
{
set_config('num_topics', $config['num_topics'] - $approved_topics, true);
}
return $return; return $return;
} }
@ -571,9 +580,10 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
return false; return false;
} }
$approved_posts = 0;
$post_ids = $topic_ids = $forum_ids = $post_counts = array(); $post_ids = $topic_ids = $forum_ids = $post_counts = array();
$sql = 'SELECT post_id, poster_id, post_postcount, topic_id, forum_id $sql = 'SELECT post_id, poster_id, post_approved, post_postcount, topic_id, forum_id
FROM ' . POSTS_TABLE . ' FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set($where_type, array_map('intval', $where_ids)); WHERE ' . $db->sql_in_set($where_type, array_map('intval', $where_ids));
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -589,6 +599,11 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
{ {
$post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1; $post_counts[$row['poster_id']] = (!empty($post_counts[$row['poster_id']])) ? $post_counts[$row['poster_id']] + 1 : 1;
} }
if ($row['post_approved'])
{
$approved_posts++;
}
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -658,7 +673,10 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
sync('forum', 'forum_id', $forum_ids, true); sync('forum', 'forum_id', $forum_ids, true);
} }
set_config('num_posts', $config['num_posts'] - sizeof($post_ids), true); if ($approved_posts)
{
set_config('num_posts', $config['num_posts'] - $approved_posts, true);
}
return sizeof($post_ids); return sizeof($post_ids);
} }
@ -924,7 +942,7 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true)
} }
/** /**
* Update/Sync posted informations for topics * Update/Sync posted information for topics
*/ */
function update_posted_info(&$topic_ids) function update_posted_info(&$topic_ids)
{ {
@ -1928,8 +1946,6 @@ function split_sql_file($sql, $delimiter)
/** /**
* Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username * Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username
* and group names must be carried through for the moderators table * and group names must be carried through for the moderators table
*
* @todo let the admin define if he wants to display moderators (forum-based) - display_on_index already present and checked for...
*/ */
function cache_moderators() function cache_moderators()
{ {
@ -2128,7 +2144,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
case 'user': case 'user':
$log_type = LOG_USERS; $log_type = LOG_USERS;
$sql_forum = 'AND l.reportee_id = ' . intval($user_id); $sql_forum = 'AND l.reportee_id = ' . (int) $user_id;
break; break;
case 'users': case 'users':
@ -2145,7 +2161,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
return; return;
} }
$sql = "SELECT l.*, u.username $sql = "SELECT l.*, u.username, u.user_colour
FROM " . LOG_TABLE . " l, " . USERS_TABLE . " u FROM " . LOG_TABLE . " l, " . USERS_TABLE . " u
WHERE l.log_type = $log_type WHERE l.log_type = $log_type
AND u.user_id = l.user_id AND u.user_id = l.user_id
@ -2170,10 +2186,15 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
$log[$i] = array( $log[$i] = array(
'id' => $row['log_id'], 'id' => $row['log_id'],
'reportee_id' => $row['reportee_id'], 'reportee_id' => $row['reportee_id'],
'reportee_username' => '', 'reportee_username' => '',
'reportee_username_full'=> '',
'user_id' => $row['user_id'], 'user_id' => $row['user_id'],
'username' => '<a href="' . $profile_url . '&amp;u=' . $row['user_id'] . '">' . $row['username'] . '</a>', 'username' => $row['username'],
'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, $profile_url),
'ip' => $row['log_ip'], 'ip' => $row['log_ip'],
'time' => $row['log_time'], 'time' => $row['log_time'],
'forum_id' => $row['forum_id'], 'forum_id' => $row['forum_id'],
@ -2256,21 +2277,31 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id
} }
} }
if ($reportee_id_list) if (sizeof($reportee_id_list))
{ {
$reportee_id_list = array_unique($reportee_id_list); $reportee_id_list = array_unique($reportee_id_list);
$reportee_names_list = array(); $reportee_names_list = array();
if (!function_exists('user_get_id_name')) $sql = 'SELECT user_id, username, user_colour
{ FROM ' . USERS_TABLE . '
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); WHERE ' . $db->sql_in_set('user_id', $reportee_id_list);
} $result = $db->sql_query($sql);
user_get_id_name($reportee_id_list, $reportee_names_list); while ($row = $db->sql_fetchrow($result))
{
$reportee_names_list[$row['user_id']] = $row;
}
$db->sql_freeresult($result);
foreach ($log as $key => $row) foreach ($log as $key => $row)
{ {
$log[$key]['reportee_username'] = (isset($reportee_names_list[$row['reportee_id']])) ? '<a href="' . $profile_url . '&amp;u=' . $row['reportee_id'] . '">' . $reportee_names_list[$row['reportee_id']] . '</a>' : false; if (!isset($reportee_names_list[$row['reportee_id']]))
{
continue;
}
$log[$key]['reportee_username'] = $reportee_names_list[$row['reportee_id']]['username'];
$log[$key]['reportee_username_full'] = get_username_string('full', $row['reportee_id'], $reportee_names_list[$row['reportee_id']]['username'], $reportee_names_list[$row['reportee_id']]['user_colour'], false, $profile_url);
} }
} }
@ -2369,7 +2400,7 @@ function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $limi
{ {
global $db; global $db;
$sql = 'SELECT user_id, username, user_warnings, user_last_warning $sql = 'SELECT user_id, username, user_colour, user_warnings, user_last_warning
FROM ' . USERS_TABLE . ' FROM ' . USERS_TABLE . '
WHERE user_warnings > 0 WHERE user_warnings > 0
' . (($limit_days) ? "AND user_last_warning >= $limit_days" : '') . " ' . (($limit_days) ? "AND user_last_warning >= $limit_days" : '') . "

View file

@ -309,16 +309,11 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
{ {
$last_post_subject = $row['forum_last_post_subject']; $last_post_subject = $row['forum_last_post_subject'];
$last_post_time = $user->format_date($row['forum_last_post_time']); $last_post_time = $user->format_date($row['forum_last_post_time']);
$last_poster = ($row['forum_last_poster_name'] != '') ? $row['forum_last_poster_name'] : $user->lang['GUEST'];
$last_poster_colour = ($row['forum_last_poster_colour']) ? '#' . $row['forum_last_poster_colour'] : '';
$last_poster_url = ($row['forum_last_poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['forum_last_poster_id']);
$last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&amp;p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id']; $last_post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id_last_post'] . '&amp;p=' . $row['forum_last_post_id']) . '#p' . $row['forum_last_post_id'];
} }
else else
{ {
$last_post_subject = $last_post_time = $last_poster = $last_poster_colour = $last_poster_url = $last_post_url = ''; $last_post_subject = $last_post_time = $last_post_url = '';
} }
// Output moderator listing ... if applicable // Output moderator listing ... if applicable
@ -350,8 +345,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'SUBFORUMS' => $subforums_list, 'SUBFORUMS' => $subforums_list,
'LAST_POST_SUBJECT' => censor_text($last_post_subject), 'LAST_POST_SUBJECT' => censor_text($last_post_subject),
'LAST_POST_TIME' => $last_post_time, 'LAST_POST_TIME' => $last_post_time,
'LAST_POSTER' => $last_poster, 'LAST_POSTER' => get_username_string('username', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_COLOUR' => $last_poster_colour, 'LAST_POSTER_COLOUR' => get_username_string('colour', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'LAST_POSTER_FULL' => get_username_string('full', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'MODERATORS' => $moderators_list, 'MODERATORS' => $moderators_list,
'L_SUBFORUM_STR' => $l_subforums, 'L_SUBFORUM_STR' => $l_subforums,
@ -359,7 +355,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'L_MODERATOR_STR' => $l_moderator, 'L_MODERATOR_STR' => $l_moderator,
'U_VIEWFORUM' => ($row['forum_type'] != FORUM_LINK || ($row['forum_flags'] & FORUM_FLAG_LINK_TRACK)) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : $row['forum_link'], 'U_VIEWFORUM' => ($row['forum_type'] != FORUM_LINK || ($row['forum_flags'] & FORUM_FLAG_LINK_TRACK)) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : $row['forum_link'],
'U_LAST_POSTER' => $last_poster_url, 'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
'U_LAST_POST' => $last_post_url) 'U_LAST_POST' => $last_post_url)
); );
} }
@ -587,6 +583,10 @@ function get_moderators(&$forum_moderators, $forum_id = false)
/** /**
* User authorisation levels output * User authorisation levels output
*
* @param string $mode Can be forum or topic. Not in use at the moment.
* @param int $forum_id The current forum the user is in.
* @param int $forum_status The forums status bit.
*/ */
function gen_forum_auth_level($mode, $forum_id, $forum_status) function gen_forum_auth_level($mode, $forum_id, $forum_status)
{ {
@ -597,8 +597,8 @@ function gen_forum_auth_level($mode, $forum_id, $forum_status)
$rules = array( $rules = array(
($auth->acl_get('f_post', $forum_id) && !$locked) ? $user->lang['RULES_POST_CAN'] : $user->lang['RULES_POST_CANNOT'], ($auth->acl_get('f_post', $forum_id) && !$locked) ? $user->lang['RULES_POST_CAN'] : $user->lang['RULES_POST_CANNOT'],
($auth->acl_get('f_reply', $forum_id) && !$locked) ? $user->lang['RULES_REPLY_CAN'] : $user->lang['RULES_REPLY_CANNOT'], ($auth->acl_get('f_reply', $forum_id) && !$locked) ? $user->lang['RULES_REPLY_CAN'] : $user->lang['RULES_REPLY_CANNOT'],
($auth->acl_gets('f_edit', 'm_edit', $forum_id) && !$locked) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'], ($user->data['is_registered'] && $auth->acl_gets('f_edit', 'm_edit', $forum_id) && !$locked) ? $user->lang['RULES_EDIT_CAN'] : $user->lang['RULES_EDIT_CANNOT'],
($auth->acl_gets('f_delete', 'm_delete', $forum_id) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'], ($user->data['is_registered'] && $auth->acl_gets('f_delete', 'm_delete', $forum_id) && !$locked) ? $user->lang['RULES_DELETE_CAN'] : $user->lang['RULES_DELETE_CANNOT'],
); );
if ($config['allow_attachments']) if ($config['allow_attachments'])
@ -712,7 +712,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
$extensions = $cache->obtain_attach_extensions(); $extensions = $cache->obtain_attach_extensions();
} }
// Look for missing attachment informations... // Look for missing attachment information...
$attach_ids = array(); $attach_ids = array();
foreach ($attachment_data as $pos => $attachment) foreach ($attachment_data as $pos => $attachment)
{ {
@ -744,7 +744,17 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_
$attachment_data[$attach_ids[$row['attach_id']]] = $row; $attachment_data[$attach_ids[$row['attach_id']]] = $row;
} }
$db->sql_freeresult($result); $db->sql_freeresult($result);
}
// Sort correctly (please note that the attachment_data array itself get changed by this
if ($config['display_order'])
{
// Ascending sort
krsort($attachment_data);
}
else
{
// Descending sort
ksort($attachment_data); ksort($attachment_data);
} }
@ -959,12 +969,10 @@ function display_custom_bbcodes()
// Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing) // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
$num_predefined_bbcodes = 22; $num_predefined_bbcodes = 22;
/*
* @todo while adjusting custom bbcodes, think about caching this query as well as correct ordering
*/
$sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline $sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline
FROM ' . BBCODES_TABLE . ' FROM ' . BBCODES_TABLE . '
WHERE display_on_posting = 1'; WHERE display_on_posting = 1
ORDER BY bbcode_tag';
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$i = 0; $i = 0;
@ -974,7 +982,7 @@ function display_custom_bbcodes()
'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2), 'BBCODE_ID' => $num_predefined_bbcodes + ($i * 2),
'BBCODE_TAG' => $row['bbcode_tag'], 'BBCODE_TAG' => $row['bbcode_tag'],
'BBCODE_HELPLINE' => str_replace(array('&amp;', '&quot;', '&#039;', '&lt;', '&gt;'), array('\&', '\"', '\\\'', '<', '>'), $row['bbcode_helpline'])) 'BBCODE_HELPLINE' => str_replace(array('&amp;', '&quot;', "'", '&lt;', '&gt;'), array('\&', '\"', '\\\'', '<', '>'), $row['bbcode_helpline']))
); );
$i++; $i++;
@ -1051,7 +1059,7 @@ function display_user_activity(&$userdata)
$forum_sql $forum_sql
GROUP BY forum_id GROUP BY forum_id
ORDER BY num_posts DESC"; ORDER BY num_posts DESC";
$result = $db->sql_query_limit($sql, 1, 0, 3600); $result = $db->sql_query_limit($sql, 1);
$active_f_row = $db->sql_fetchrow($result); $active_f_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -1073,7 +1081,7 @@ function display_user_activity(&$userdata)
$forum_sql $forum_sql
GROUP BY topic_id GROUP BY topic_id
ORDER BY num_posts DESC"; ORDER BY num_posts DESC";
$result = $db->sql_query_limit($sql, 1, 0, 3600); $result = $db->sql_query_limit($sql, 1);
$active_t_row = $db->sql_fetchrow($result); $active_t_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);

View file

@ -962,7 +962,7 @@ class smtp_class
function smtp_class() function smtp_class()
{ {
if (defined('DEBUG_EXTRA')) if (defined('DEBUG'))
{ {
$this->backtrace = true; $this->backtrace = true;
$this->backtrace_log = array(); $this->backtrace_log = array();
@ -987,7 +987,7 @@ class smtp_class
{ {
fputs($this->socket, $command . "\r\n"); fputs($this->socket, $command . "\r\n");
(!$private_info) ? $this->add_backtrace("# $command") : $this->add_backtrace('# Ommitting sensitive Informations'); (!$private_info) ? $this->add_backtrace("# $command") : $this->add_backtrace('# Ommitting sensitive information');
// We could put additional code here // We could put additional code here
} }
@ -1368,33 +1368,53 @@ class smtp_class
} }
/** /**
* Encodes the given string for proper display in UTF-8 ... nabbed * Encodes the given string for proper display in UTF-8.
* from php.net and modified. There is an alternative encoding method which
* may produce less output but it's questionable as to its worth in this
* scenario.
* *
* This version is using base64 encoded data. The downside of this * This version is using base64 encoded data. The downside of this
* is if the mail client does not understand this encoding the user * is if the mail client does not understand this encoding the user
* is basically doomed with an unreadable subject. * is basically doomed with an unreadable subject.
*
* Please note that this version fully supports RFC 2045 section 6.8.
*/ */
function mail_encode($str) function mail_encode($str)
{ {
// define start delimimter, end delimiter and spacer // define start delimimter, end delimiter and spacer
$end = '?='; $start = "=?UTF-8?B?";
$start = '=?UTF-8?B?'; $end = "?=";
$spacer = "$end $start"; $spacer = $end . ' ' . $start;
$split_length = 64;
// determine length of encoded text within chunks and ensure length is even $encoded_str = base64_encode($str);
$length = 76 - strlen($start) - strlen($end);
$length = floor($length / 2) * 2;
// encode the string and split it into chunks with spacers after each chunk // If encoded string meets the limits, we just return with the correct data.
$str = chunk_split(base64_encode($str), $length, $spacer); if (strlen($encoded_str) <= $split_length)
{
return $start . $encoded_str . $end;
}
// remove trailing spacer and add start and end delimiters // If there is only ASCII data, we just return what we want, correctly splitting the lines.
$str = preg_replace('#' . preg_quote($spacer, '#') . '$#', '', $str); if (strlen($str) === utf8_strlen($str))
{
return $start . implode($spacer, str_split($encoded_str, $split_length)) . $end;
}
return $start . $str . $end; // UTF-8 data, compose encoded lines
$array = utf8_str_split($str);
$str = '';
while (sizeof($array))
{
$text = '';
while (sizeof($array) && strlen(base64_encode($text . $array[0])) <= $split_length)
{
$text .= array_shift($array);
}
$str .= $start . base64_encode($text) . $end . ' ';
}
return substr($str, 0, -1);
} }
?> ?>

View file

@ -213,9 +213,8 @@ class p_master
/** /**
* Check module authorisation * Check module authorisation
* @todo Have a look at the eval statement and replace with other code...
*/ */
function module_auth($module_auth) function module_auth($module_auth, $forum_id = false)
{ {
global $auth, $config; global $auth, $config;
@ -227,8 +226,45 @@ class p_master
return true; return true;
} }
// With the code below we make sure only those elements get eval'd we really want to be checked
preg_match_all('/(?:
"[^"\\\\]*(?:\\\\.[^"\\\\]*)*" |
\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\' |
[(),] |
[^\s(),]+)/x', $module_auth, $match);
$tokens = $match[0];
for ($i = 0, $size = sizeof($tokens); $i < $size; $i++)
{
$token = &$tokens[$i];
switch ($token)
{
case ')':
case '(':
case '&&':
case '||':
case ',':
break;
default:
if (!preg_match('#(?:acl_([a-z_]+)(,\$id)?)|(?:\$id)|(?:aclf_([a-z_]+))|(?:cfg_([a-z_]+))#', $token))
{
$token = '';
}
break;
}
}
$module_auth = implode(' ', $tokens);
// Make sure $id seperation is working fine
$module_auth = str_replace(' , ', ',', $module_auth);
$forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
$is_auth = false; $is_auth = false;
eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get("\\1"\\2)', '(int) $this->acl_forum_id', '(int) $auth->acl_getf_global("\\1")', '(int) $config["\\1"]'), $module_auth) . ');'); eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']'), $module_auth) . ');');
return $is_auth; return $is_auth;
} }

View file

@ -96,8 +96,8 @@ function generate_smilies($mode, $forum_id)
} }
/** /**
* Update Post Informations (First/Last Post in topic/forum) * Update Post Information (First/Last Post in topic/forum)
* Should be used instead of sync() if only the last post informations are out of sync... faster * Should be used instead of sync() if only the last post information are out of sync... faster
* *
* @param string $type Can be forum|topic * @param string $type Can be forum|topic
* @param mixed $ids topic/forum ids * @param mixed $ids topic/forum ids
@ -561,6 +561,12 @@ function create_thumbnail($source, $destination, $mimetype)
list($new_width, $new_height) = get_img_size_format($width, $height); list($new_width, $new_height) = get_img_size_format($width, $height);
// Do not create a thumbnail if the resulting width/height is bigger than the original one
if ($new_width > $width && $new_height > $height)
{
return false;
}
$used_imagick = false; $used_imagick = false;
// Only use imagemagick if defined and the passthru function not disabled // Only use imagemagick if defined and the passthru function not disabled
@ -686,7 +692,7 @@ function posting_gen_inline_attachments(&$attachment_data)
/** /**
* Generate inline attachment entry * Generate inline attachment entry
*/ */
function posting_gen_attachment_entry(&$attachment_data, &$filename_data) function posting_gen_attachment_entry($attachment_data, &$filename_data)
{ {
global $template, $config, $phpbb_root_path, $phpEx, $user; global $template, $config, $phpbb_root_path, $phpEx, $user;
@ -700,8 +706,10 @@ function posting_gen_attachment_entry(&$attachment_data, &$filename_data)
'S_HAS_ATTACHMENTS' => true) 'S_HAS_ATTACHMENTS' => true)
); );
$count = 0; // We display the posted attachments within the desired order.
foreach ($attachment_data as $attach_row) ($config['display_order']) ? krsort($attachment_data) : ksort($attachment_data);
foreach ($attachment_data as $count => $attach_row)
{ {
$hidden = ''; $hidden = '';
$attach_row['real_filename'] = basename($attach_row['real_filename']); $attach_row['real_filename'] = basename($attach_row['real_filename']);
@ -723,8 +731,6 @@ function posting_gen_attachment_entry(&$attachment_data, &$filename_data)
'U_VIEW_ATTACHMENT' => $download_link, 'U_VIEW_ATTACHMENT' => $download_link,
'S_HIDDEN' => $hidden) 'S_HIDDEN' => $hidden)
); );
$count++;
} }
} }
@ -857,7 +863,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
global $config, $phpbb_root_path, $phpEx; global $config, $phpbb_root_path, $phpEx;
// Go ahead and pull all data for this topic // Go ahead and pull all data for this topic
$sql = 'SELECT u.username, u.user_id, p.* $sql = 'SELECT u.username, u.user_id, u.user_colour, p.*
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
WHERE p.topic_id = $topic_id WHERE p.topic_id = $topic_id
AND p.poster_id = u.user_id AND p.poster_id = u.user_id
@ -891,19 +897,10 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
foreach ($rowset as $i => $row) foreach ($rowset as $i => $row)
{ {
$poster_id = $row['user_id']; $poster_id = $row['user_id'];
$poster = $row['username'];
// Handle anon users posting with usernames
if ($poster_id == ANONYMOUS)
{
$poster = ($row['post_username']) ? $row['post_username'] : $user->lang['GUEST'];
$poster_rank = ($row['post_username']) ? $user->lang['GUEST'] : '';
}
$post_subject = $row['post_subject']; $post_subject = $row['post_subject'];
$message = $row['post_text']; $message = censor_text($row['post_text']);
$message = censor_text($message);
$message = str_replace("\n", '<br />', $message); $message = str_replace("\n", '<br />', $message);
$decoded_message = false; $decoded_message = false;
if ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) if ($show_quote_button && $auth->acl_get('f_reply', $forum_id))
@ -925,7 +922,11 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
$post_subject = censor_text($post_subject); $post_subject = censor_text($post_subject);
$template->assign_block_vars($mode . '_row', array( $template->assign_block_vars($mode . '_row', array(
'POSTER_NAME' => $poster, 'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'U_POST_AUTHOR' => get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_SUBJECT' => $post_subject, 'POST_SUBJECT' => $post_subject,
'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']),
'POST_DATE' => $user->format_date($row['post_time']), 'POST_DATE' => $user->format_date($row['post_time']),
@ -934,7 +935,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'U_POST_ID' => $row['post_id'], 'U_POST_ID' => $row['post_id'],
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'], 'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=post_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '', 'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=post_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes($poster) : '') 'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '')
); );
unset($rowset[$i]); unset($rowset[$i]);
} }
@ -1123,7 +1124,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id
)); ));
$messenger->send($addr['method']); $messenger->send($addr['method']);
$messenger->reset();
} }
} }
unset($msg_list_ary); unset($msg_list_ary);
@ -1241,7 +1241,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data)
$sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1'; $sql_data[FORUMS_TABLE] = 'forum_posts = forum_posts - 1';
} }
$sql_data[TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_colour = '" . $db->sql_escape($row['user_colour']) . ", topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'"; $sql_data[TOPICS_TABLE] = 'topic_first_post_id = ' . intval($row['post_id']) . ", topic_first_poster_colour = '" . $db->sql_escape($row['user_colour']) . "', topic_first_poster_name = '" . (($row['poster_id'] == ANONYMOUS) ? $db->sql_escape($row['post_username']) : $db->sql_escape($row['username'])) . "'";
$sql_data[TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : ''); $sql_data[TOPICS_TABLE] .= ', topic_replies_real = topic_replies_real - 1' . (($data['post_approved']) ? ', topic_replies = topic_replies - 1' : '');
$next_post_id = (int) $row['post_id']; $next_post_id = (int) $row['post_id'];
@ -1387,11 +1387,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$subject = truncate_string($subject); $subject = truncate_string($subject);
$data['topic_title'] = truncate_string($data['topic_title']); $data['topic_title'] = truncate_string($data['topic_title']);
// Collect some basic informations about which tables and which rows to update/insert // Collect some basic information about which tables and which rows to update/insert
$sql_data = array(); $sql_data = array();
$poster_id = ($mode == 'edit') ? $data['poster_id'] : (int) $user->data['user_id']; $poster_id = ($mode == 'edit') ? $data['poster_id'] : (int) $user->data['user_id'];
// Collect Informations // Collect Information
switch ($post_mode) switch ($post_mode)
{ {
case 'post': case 'post':

View file

@ -120,7 +120,7 @@ function get_folder($user_id, $folder_id = false)
$folder = array(); $folder = array();
// Get folder informations // Get folder information
$sql = 'SELECT folder_id, COUNT(msg_id) as num_messages, SUM(pm_unread) as num_unread $sql = 'SELECT folder_id, COUNT(msg_id) as num_messages, SUM(pm_unread) as num_unread
FROM ' . PRIVMSGS_TO_TABLE . " FROM ' . PRIVMSGS_TO_TABLE . "
WHERE user_id = $user_id WHERE user_id = $user_id
@ -242,7 +242,7 @@ function clean_sentbox($num_sentbox_messages)
} }
/** /**
* Check Rule against Message Informations * Check Rule against Message Information
*/ */
function check_rule(&$rules, &$rule_row, &$message_row, $user_id) function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
{ {
@ -297,7 +297,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
$auth2 = new auth(); $auth2 = new auth();
$auth2->acl($userdata); $auth2->acl($userdata);
if (!$auth2->acl_get('a_') && !$auth->acl_get('m_') && !$auth2->acl_getf_global('m_')) if (!$auth2->acl_get('a_') && !$auth2->acl_get('m_') && !$auth2->acl_getf_global('m_'))
{ {
return array('action' => $rule_row['rule_action'], 'pm_unread' => $message_row['pm_unread'], 'pm_marked' => $message_row['pm_marked']); return array('action' => $rule_row['rule_action'], 'pm_unread' => $message_row['pm_unread'], 'pm_marked' => $message_row['pm_marked']);
} }
@ -429,7 +429,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
$row['author_in_group'] = $memberships[$row['user_id']]; $row['author_in_group'] = $memberships[$row['user_id']];
} }
// Check Rule - this should be very quick since we have all informations we need // Check Rule - this should be very quick since we have all information we need
$is_match = false; $is_match = false;
foreach ($user_rules as $rule_row) foreach ($user_rules as $rule_row)
{ {
@ -515,11 +515,12 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
// Do not change the order of processing // Do not change the order of processing
// The number of queries needed to be executed here highly depends on the defined rules and are // The number of queries needed to be executed here highly depends on the defined rules and are
// only gone through if new messages arrive. // only gone through if new messages arrive.
$num_not_moved = 0; $num_not_moved = $num_removed = 0;
// Delete messages // Delete messages
if (sizeof($delete_ids)) if (sizeof($delete_ids))
{ {
$num_removed = sizeof($delete_ids);
delete_pm($user_id, $delete_ids, PRIVMSGS_NO_BOX); delete_pm($user_id, $delete_ids, PRIVMSGS_NO_BOX);
} }
@ -694,7 +695,10 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false)
$user->data['user_unread_privmsg'] -= $num_unread; $user->data['user_unread_privmsg'] -= $num_unread;
} }
return $num_not_moved; return array(
'not_moved' => $num_not_moved,
'deleted' => $num_removed,
);
} }
/** /**
@ -911,7 +915,7 @@ function delete_pm($user_id, $msg_ids, $folder_id)
return false; return false;
} }
// Get PM Informations for later deleting // Get PM Information for later deleting
$sql = 'SELECT msg_id, pm_unread, pm_new $sql = 'SELECT msg_id, pm_unread, pm_new
FROM ' . PRIVMSGS_TO_TABLE . ' FROM ' . PRIVMSGS_TO_TABLE . '
WHERE ' . $db->sql_in_set('msg_id', array_map('intval', $msg_ids)) . " WHERE ' . $db->sql_in_set('msg_id', array_map('intval', $msg_ids)) . "
@ -952,7 +956,7 @@ function delete_pm($user_id, $msg_ids, $folder_id)
$db->sql_query($sql); $db->sql_query($sql);
// Set delete flag for those intended to receive the PM // Set delete flag for those intended to receive the PM
// We do not remove the message actually, to retain some basic informations (sent time for example) // We do not remove the message actually, to retain some basic information (sent time for example)
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . '
SET pm_deleted = 1 SET pm_deleted = 1
WHERE ' . $db->sql_in_set('msg_id', array_keys($delete_rows)); WHERE ' . $db->sql_in_set('msg_id', array_keys($delete_rows));
@ -962,7 +966,7 @@ function delete_pm($user_id, $msg_ids, $folder_id)
} }
else else
{ {
// Delete Private Message Informations // Delete private message data
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . " $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . "
WHERE user_id = $user_id WHERE user_id = $user_id
AND folder_id = $folder_id AND folder_id = $folder_id
@ -1058,7 +1062,7 @@ function rebuild_header($check_ary)
} }
/** /**
* Print out/assign recipient informations * Print out/assign recipient information
*/ */
function write_pm_addresses($check_ary, $author_id, $plaintext = false) function write_pm_addresses($check_ary, $author_id, $plaintext = false)
{ {
@ -1166,15 +1170,30 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false)
{ {
foreach ($adr_ary as $id => $row) foreach ($adr_ary as $id => $row)
{ {
$template->assign_block_vars($check_type . '_recipient', array( $tpl_ary = array(
'NAME' => $row['name'], 'IS_GROUP' => ($type == 'group') ? true : false,
'IS_GROUP' => ($type == 'group'), 'IS_USER' => ($type == 'user') ? true : false,
'IS_USER' => ($type == 'user'),
'COLOUR' => ($row['colour']) ? $row['colour'] : '',
'UG_ID' => $id, 'UG_ID' => $id,
'U_VIEW' => ($type == 'user') ? (($id != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $id) : '') : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $id), 'NAME' => $row['name'],
'TYPE' => $type) 'COLOUR' => ($row['colour']) ? '#' . $row['colour'] : '',
'TYPE' => $type,
); );
if ($type == 'user')
{
$tpl_ary = array_merge($tpl_ary, array(
'U_VIEW' => get_username_string('profile', $id, $row['name'], $row['colour']),
'NAME_FULL' => get_username_string('full', $id, $row['name'], $row['colour']),
));
}
else
{
$tpl_ary = array_merge($tpl_ary, array(
'U_VIEW' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $id),
));
}
$template->assign_block_vars($check_type . '_recipient', $tpl_ary);
} }
} }
} }
@ -1233,11 +1252,11 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr
$current_time = time(); $current_time = time();
// Collect some basic informations about which tables and which rows to update/insert // Collect some basic information about which tables and which rows to update/insert
$sql_data = array(); $sql_data = array();
$root_level = 0; $root_level = 0;
// Recipient Informations // Recipient Information
$recipients = $to = $bcc = array(); $recipients = $to = $bcc = array();
if ($mode != 'edit') if ($mode != 'edit')
@ -1604,7 +1623,6 @@ function pm_notification($mode, $author, $recipients, $subject, $message)
); );
$messenger->send($addr['method']); $messenger->send($addr['method']);
$messenger->reset();
} }
unset($msg_list_ary); unset($msg_list_ary);

View file

@ -579,7 +579,7 @@ class custom_profile
if (gettype($value) == 'string') if (gettype($value) == 'string')
{ {
utf8_normalize_nfc(&$value); $value = utf8_normalize_nfc($value);
} }
} }
@ -865,8 +865,7 @@ class custom_profile
case FIELD_STRING: case FIELD_STRING:
case FIELD_TEXT: case FIELD_TEXT:
$var = request_var($var_name, $profile_row['field_default_value'], true); $var = utf8_normalize_nfc(request_var($var_name, $profile_row['field_default_value'], true));
utf8_normalize_nfc(&$var);
break; break;
case FIELD_INT: case FIELD_INT:

View file

@ -9,7 +9,7 @@
*/ */
/** /**
* Responsible for holding all file relevant informations, as well as doing file-specific operations. * Responsible for holding all file relevant information, as well as doing file-specific operations.
* The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on. * The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on.
* @package phpBB3 * @package phpBB3
*/ */

View file

@ -142,7 +142,8 @@ function user_add($user_row, $cp_data = false)
'username' => $user_row['username'], 'username' => $user_row['username'],
'username_clean' => utf8_clean_string($user_row['username']), 'username_clean' => utf8_clean_string($user_row['username']),
'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '', 'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '',
'user_email' => $user_row['user_email'], 'user_pass_convert' => 0,
'user_email' => strtolower($user_row['user_email']),
'user_email_hash' => (int) crc32(strtolower($user_row['user_email'])) . strlen($user_row['user_email']), 'user_email_hash' => (int) crc32(strtolower($user_row['user_email'])) . strlen($user_row['user_email']),
'group_id' => $user_row['group_id'], 'group_id' => $user_row['group_id'],
'user_type' => $user_row['user_type'], 'user_type' => $user_row['user_type'],
@ -170,6 +171,7 @@ function user_add($user_row, $cp_data = false)
'user_posts' => 0, 'user_posts' => 0,
'user_dst' => 0, 'user_dst' => 0,
'user_colour' => '', 'user_colour' => '',
'user_occ' => '',
'user_interests' => '', 'user_interests' => '',
'user_avatar' => '', 'user_avatar' => '',
'user_avatar_type' => 0, 'user_avatar_type' => 0,
@ -408,7 +410,7 @@ function user_delete($mode, $user_id, $post_username = false)
AND folder_id = ' . PRIVMSGS_NO_BOX; AND folder_id = ' . PRIVMSGS_NO_BOX;
$db->sql_query($sql); $db->sql_query($sql);
// Delete all to-informations // Delete all to-information
$sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . '
WHERE user_id = ' . $user_id; WHERE user_id = ' . $user_id;
$db->sql_query($sql); $db->sql_query($sql);
@ -1115,8 +1117,7 @@ function validate_match($string, $optional = false, $match)
* Also checks if it includes the " character, which we don't allow in usernames. * Also checks if it includes the " character, which we don't allow in usernames.
* Used for registering, changing names, and posting anonymously with a username * Used for registering, changing names, and posting anonymously with a username
* *
* @todo do we really check and disallow the " character in usernames as written above. Has it only be forgotten to include the check? * @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
* @return boolean|string Either false if validation succeeded or a string which will be used as the error message (with the variable name appended)
*/ */
function validate_username($username) function validate_username($username)
{ {
@ -1218,7 +1219,9 @@ function validate_email($email)
{ {
global $config, $db, $user; global $config, $db, $user;
if (strtolower($user->data['user_email']) == strtolower($email)) $email = strtolower($email);
if (strtolower($user->data['user_email']) == $email)
{ {
return false; return false;
} }
@ -1249,7 +1252,7 @@ function validate_email($email)
{ {
$sql = 'SELECT user_email_hash $sql = 'SELECT user_email_hash
FROM ' . USERS_TABLE . " FROM ' . USERS_TABLE . "
WHERE user_email_hash = " . crc32(strtolower($email)) . strlen($email); WHERE user_email_hash = " . crc32($email) . strlen($email);
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result); $row = $db->sql_fetchrow($result);
$db->sql_freeresult($result); $db->sql_freeresult($result);
@ -1528,10 +1531,12 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
'group_receive_pm' => 'int', 'group_receive_pm' => 'int',
'group_legend' => 'int', 'group_legend' => 'int',
'group_message_limit' => 'int', 'group_message_limit' => 'int',
'group_founder_manage' => 'int',
); );
// Those are group-only attributes // Those are group-only attributes
$group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit'); $group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit', 'group_founder_manage');
// Check data // Check data
if (!utf8_strlen($name) || utf8_strlen($name) > 40) if (!utf8_strlen($name) || utf8_strlen($name) > 40)
@ -1718,7 +1723,7 @@ function group_delete($group_id, $group_name = false)
/** /**
* Add user(s) to group * Add user(s) to group
* *
* @return false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER' * @return mixed false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER'
*/ */
function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false) function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false)
{ {
@ -2014,7 +2019,6 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
); );
$messenger->send($row['user_notify_type']); $messenger->send($row['user_notify_type']);
$messenger->reset();
} }
$messenger->save_queue(); $messenger->save_queue();
@ -2264,6 +2268,7 @@ function group_update_listings($group_id)
{ {
if (!function_exists('cache_moderators')) if (!function_exists('cache_moderators'))
{ {
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
} }
cache_moderators(); cache_moderators();

View file

@ -67,7 +67,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'), 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
'S_CAN_REPORT' => $auth->acl_get('m_report', $forum_id),
'S_CAN_DELETE' => $auth->acl_get('m_delete', $forum_id), 'S_CAN_DELETE' => $auth->acl_get('m_delete', $forum_id),
'S_CAN_MOVE' => $auth->acl_get('m_move', $forum_id), 'S_CAN_MOVE' => $auth->acl_get('m_move', $forum_id),
'S_CAN_FORK' => $auth->acl_get('m_', $forum_id), 'S_CAN_FORK' => $auth->acl_get('m_', $forum_id),
@ -79,7 +82,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&amp;mode=forum_logs&amp;f=' . $forum_id) : '', 'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&amp;mode=forum_logs&amp;f=' . $forum_id) : '',
'S_MCP_ACTION' => $url . "&amp;i=$id&amp;action=$action&amp;mode=$mode&amp;start=$start" . (($action == 'merge_select') ? $selected_ids : ''), 'S_MCP_ACTION' => $url . "&amp;i=$id&amp;mode=$mode&amp;start=$start" . (($action == 'merge_select') ? $selected_ids : ''),
'PAGINATION' => generate_pagination($url . "&amp;i=$id&amp;action=$action&amp;mode=$mode" . (($action == 'merge_select') ? $selected_ids : ''), $forum_topics, $topics_per_page, $start), 'PAGINATION' => generate_pagination($url . "&amp;i=$id&amp;action=$action&amp;mode=$mode" . (($action == 'merge_select') ? $selected_ids : ''), $forum_topics, $topics_per_page, $start),
'PAGE_NUMBER' => on_page($forum_topics, $topics_per_page, $start), 'PAGE_NUMBER' => on_page($forum_topics, $topics_per_page, $start),
@ -111,7 +114,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies']; $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
// Get folder img, topic status/type related informations // Get folder img, topic status/type related information
$folder_img = $folder_alt = $topic_type = ''; $folder_img = $folder_alt = $topic_type = '';
topic_status($row, $replies, false, $folder_img, $folder_alt, $topic_type); topic_status($row, $replies, false, $folder_img, $folder_alt, $topic_type);
@ -127,7 +130,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false, 'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false,
'U_SELECT_TOPIC' => $url . "&amp;i=$id&amp;mode=topic_view&amp;action=merge&amp;to_topic_id=" . $row['topic_id'] . $selected_ids, 'U_SELECT_TOPIC' => $url . "&amp;i=$id&amp;mode=topic_view&amp;action=merge&amp;to_topic_id=" . $row['topic_id'] . $selected_ids,
'U_MCP_QUEUE' => $u_mcp_queue, 'U_MCP_QUEUE' => $u_mcp_queue,
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=topic_view&amp;t=' . $row['topic_id'] . '&amp;action=reports'), 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=topic_view&amp;t=' . $row['topic_id'] . '&amp;action=reports') : '',
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt),
@ -137,12 +140,25 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '', 'TOPIC_ICON_IMG_HEIGHT' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['height'] : '',
'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '', 'UNAPPROVED_IMG' => ($topic_unapproved || $posts_unapproved) ? $user->img('icon_topic_unapproved', ($topic_unapproved) ? 'TOPIC_UNAPPROVED' : 'POSTS_UNAPPROVED') : '',
'TOPIC_AUTHOR' => get_username_string('username', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'TOPIC_AUTHOR_FULL' => get_username_string('full', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
'LAST_POST_AUTHOR' => get_username_string('username', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_COLOUR' => get_username_string('colour', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'LAST_POST_AUTHOR_FULL' => get_username_string('full', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
'TOPIC_TYPE' => $topic_type, 'TOPIC_TYPE' => $topic_type,
'TOPIC_TITLE' => $topic_title, 'TOPIC_TITLE' => $topic_title,
'REPLIES' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'], 'REPLIES' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'],
'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']),
'TOPIC_ID' => $row['topic_id'], 'TOPIC_ID' => $row['topic_id'],
'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? 'checked="checked" ' : '', 'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? 'checked="checked" ' : '',
'FIRST_POST_TIME' => $user->format_date($row['topic_time']),
'LAST_POST_SUBJECT' => $row['topic_last_post_subject'],
'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']),
'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false, 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false,
'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_TOPIC_UNAPPROVED' => $topic_unapproved,
@ -159,14 +175,13 @@ function mcp_resync_topics($topic_ids)
{ {
global $auth, $db, $template, $phpEx, $user, $phpbb_root_path; global $auth, $db, $template, $phpEx, $user, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_')))
{
return;
}
if (!sizeof($topic_ids)) if (!sizeof($topic_ids))
{ {
trigger_error($user->lang['NO_TOPIC_SELECTED']); trigger_error($user->lang['NO_TOPIC_SELECTED']);
}
if (check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{
return; return;
} }

View file

@ -134,7 +134,7 @@ function mcp_front_view($id, $mode, $action)
$global_id = $forum_list[0]; $global_id = $forum_list[0];
$sql = $db->sql_build_query('SELECT', array( $sql = $db->sql_build_query('SELECT', array(
'SELECT' => 'r.*, p.post_id, p.post_subject, u.username, t.topic_id, t.topic_title, f.forum_id, f.forum_name', 'SELECT' => 'r.report_time, p.post_id, p.post_subject, u.username, u.user_colour, u.user_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name',
'FROM' => array( 'FROM' => array(
REPORTS_TABLE => 'r', REPORTS_TABLE => 'r',
@ -176,11 +176,14 @@ function mcp_front_view($id, $mode, $action)
'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'] . "&amp;i=$id&amp;mode=topic_view"), 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id'] . "&amp;i=$id&amp;mode=topic_view"),
'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']), 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;t=' . $row['topic_id']),
'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
'REPORTER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
'FORUM_NAME' => (!$global_topic) ? $row['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'FORUM_NAME' => (!$global_topic) ? $row['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'],
'TOPIC_TITLE' => $row['topic_title'], 'TOPIC_TITLE' => $row['topic_title'],
'REPORTER' => ($row['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $row['username'],
'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'],
'REPORT_TIME' => $user->format_date($row['report_time'])) 'REPORT_TIME' => $user->format_date($row['report_time']))
); );
@ -218,11 +221,11 @@ function mcp_front_view($id, $mode, $action)
foreach ($log as $row) foreach ($log as $row)
{ {
$template->assign_block_vars('log', array( $template->assign_block_vars('log', array(
'USERNAME' => $row['username'], 'USERNAME' => $row['username_full'],
'IP' => $row['ip'], 'IP' => $row['ip'],
'TIME' => $user->format_date($row['time']), 'TIME' => $user->format_date($row['time']),
'ACTION' => $row['action'], 'ACTION' => $row['action'],
'U_VIEWTOPIC' => (!empty($row['viewtopic'])) ? $row['viewtopic'] : '', 'U_VIEW_TOPIC' => (!empty($row['viewtopic'])) ? $row['viewtopic'] : '',
'U_VIEWLOGS' => (!empty($row['viewlogs'])) ? $row['viewlogs'] : '') 'U_VIEWLOGS' => (!empty($row['viewlogs'])) ? $row['viewlogs'] : '')
); );
} }

View file

@ -102,7 +102,7 @@ class mcp_logs
// Sorting // Sorting
$limit_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'], 365 => $user->lang['1_YEAR']); $limit_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'], 365 => $user->lang['1_YEAR']);
$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_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']);
$sort_by_sql = array('u' => 'u.username', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
@ -146,7 +146,7 @@ class mcp_logs
} }
$template->assign_block_vars('log', array( $template->assign_block_vars('log', array(
'USERNAME' => $row['username'], 'USERNAME' => $row['username_full'],
'IP' => $row['ip'], 'IP' => $row['ip'],
'DATE' => $user->format_date($row['time']), 'DATE' => $user->format_date($row['time']),
'ACTION' => $row['action'], 'ACTION' => $row['action'],

View file

@ -207,7 +207,9 @@ function lock_unlock($action, $ids)
$l_prefix = 'POST'; $l_prefix = 'POST';
} }
if (!($forum_id = check_ids($ids, $table, $sql_id, array('m_lock')))) $orig_ids = $ids;
if (!check_ids($ids, $table, $sql_id, array('m_lock')))
{ {
// Make sure that for f_user_lock only the lock action is triggered. // Make sure that for f_user_lock only the lock action is triggered.
if ($action != 'lock') if ($action != 'lock')
@ -215,13 +217,16 @@ function lock_unlock($action, $ids)
return; return;
} }
if (!($forum_id = check_ids($ids, $table, $sql_id, array('f_user_lock')))) $ids = $orig_ids;
if (!check_ids($ids, $table, $sql_id, array('f_user_lock')))
{ {
return; return;
} }
} }
unset($orig_ids);
$redirect = request_var('redirect', $user->data['session_page']); $redirect = request_var('redirect', build_url(array('_f_', 'action')));
$s_hidden_fields = build_hidden_fields(array( $s_hidden_fields = build_hidden_fields(array(
$sql_id . '_list' => $ids, $sql_id . '_list' => $ids,
@ -241,7 +246,7 @@ function lock_unlock($action, $ids)
foreach ($data as $id => $row) foreach ($data as $id => $row)
{ {
add_log('mod', $forum_id, $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']); add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']);
} }
$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS'; $success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';
@ -272,7 +277,10 @@ function change_topic_type($action, $topic_ids)
{ {
global $auth, $user, $db, $phpEx, $phpbb_root_path; global $auth, $user, $db, $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_')))) // For changing topic types, we only allow operations in one forum.
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('f_announce', 'f_sticky', 'm_'), true);
if ($forum_id === false)
{ {
return; return;
} }
@ -420,7 +428,10 @@ function mcp_move_topic($topic_ids)
global $auth, $user, $db, $template; global $auth, $user, $db, $template;
global $phpEx, $phpbb_root_path; global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_move'))) // Here we limit the operation to one forum only
$forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_move'), true);
if ($forum_id === false)
{ {
return; return;
} }
@ -575,12 +586,13 @@ function mcp_delete_topic($topic_ids)
{ {
global $auth, $user, $db, $phpEx, $phpbb_root_path; global $auth, $user, $db, $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_delete'))) if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_delete')))
{ {
return; return;
} }
$redirect = request_var('redirect', $user->data['session_page']); $redirect = request_var('redirect', build_url(array('_f_', 'action')));
$forum_id = request_var('f', 0);
$s_hidden_fields = build_hidden_fields(array( $s_hidden_fields = build_hidden_fields(array(
'topic_id_list' => $topic_ids, 'topic_id_list' => $topic_ids,
@ -598,7 +610,7 @@ function mcp_delete_topic($topic_ids)
foreach ($data as $topic_id => $row) foreach ($data as $topic_id => $row)
{ {
add_log('mod', $forum_id, 0, 'LOG_TOPIC_DELETED', $row['topic_title']); add_log('mod', $row['forum_id'], 0, 'LOG_TOPIC_DELETED', $row['topic_title']);
} }
$return = delete_topics('topic_id', $topic_ids); $return = delete_topics('topic_id', $topic_ids);
@ -630,12 +642,13 @@ function mcp_delete_post($post_ids)
{ {
global $auth, $user, $db, $phpEx, $phpbb_root_path; global $auth, $user, $db, $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($post_ids, POSTS_TABLE, 'post_id', 'm_delete'))) if (!check_ids($post_ids, POSTS_TABLE, 'post_id', array('m_delete')))
{ {
return; return;
} }
$redirect = request_var('redirect', $user->data['session_page']); $redirect = request_var('redirect', build_url(array('_f_', 'action')));
$forum_id = request_var('f', 0);
$s_hidden_fields = build_hidden_fields(array( $s_hidden_fields = build_hidden_fields(array(
'post_id_list' => $post_ids, 'post_id_list' => $post_ids,
@ -649,7 +662,7 @@ function mcp_delete_post($post_ids)
{ {
if (!function_exists('delete_posts')) if (!function_exists('delete_posts'))
{ {
include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
} }
// Count the number of topics that are affected // Count the number of topics that are affected
@ -750,13 +763,14 @@ function mcp_fork_topic($topic_ids)
global $auth, $user, $db, $template, $config; global $auth, $user, $db, $template, $config;
global $phpEx, $phpbb_root_path; global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($topic_ids, TOPICS_TABLE, 'topic_id', 'm_'))) if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{ {
return; return;
} }
$to_forum_id = request_var('to_forum_id', 0); $to_forum_id = request_var('to_forum_id', 0);
$redirect = request_var('redirect', $user->data['session_page']); $forum_id = request_var('forum_id', 0);
$redirect = request_var('redirect', build_url(array('_f_', 'action')));
$additional_msg = $success_msg = ''; $additional_msg = $success_msg = '';
$s_hidden_fields = build_hidden_fields(array( $s_hidden_fields = build_hidden_fields(array(
@ -835,11 +849,6 @@ function mcp_fork_topic($topic_ids)
$new_topic_id = $db->sql_nextid(); $new_topic_id = $db->sql_nextid();
$new_topic_id_list[$topic_id] = $new_topic_id; $new_topic_id_list[$topic_id] = $new_topic_id;
/**
* @todo enable? (is this still needed?)
* markread('topic', $to_forum_id, $new_topic_id);
*/
if ($topic_row['poll_start']) if ($topic_row['poll_start'])
{ {
$poll_rows = array(); $poll_rows = array();

View file

@ -142,6 +142,7 @@ class mcp_notes
// get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img); // get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img);
$avatar_img = ''; $avatar_img = '';
if (!empty($userrow['user_avatar'])) if (!empty($userrow['user_avatar']))
{ {
switch ($userrow['user_avatar_type']) switch ($userrow['user_avatar_type'])
@ -154,14 +155,14 @@ class mcp_notes
$avatar_img = $config['avatar_gallery_path'] . '/'; $avatar_img = $config['avatar_gallery_path'] . '/';
break; break;
} }
$avatar_img .= $userrow['user_avatar'];
$avatar_img .= $userrow['user_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />'; $avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />';
} }
$limit_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'], 365 => $user->lang['1_YEAR']); $limit_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'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']); $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']);
$sort_by_sql = array('a' => 'u.username', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation'); $sort_by_sql = array('a' => 'u.username_clean', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
@ -181,7 +182,7 @@ class mcp_notes
foreach ($log_data as $row) foreach ($log_data as $row)
{ {
$template->assign_block_vars('usernotes', array( $template->assign_block_vars('usernotes', array(
'REPORT_BY' => $row['username'], 'REPORT_BY' => $row['username_full'],
'REPORT_AT' => $user->format_date($row['time']), 'REPORT_AT' => $user->format_date($row['time']),
'ACTION' => $row['action'], 'ACTION' => $row['action'],
'IP' => $row['ip'], 'IP' => $row['ip'],

View file

@ -91,7 +91,6 @@ function mcp_post_details($id, $mode, $action)
// Set some vars // Set some vars
$users_ary = $usernames_ary = array(); $users_ary = $usernames_ary = array();
$post_id = $post_info['post_id']; $post_id = $post_info['post_id'];
$poster = ($post_info['user_colour']) ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
// Process message, leave it uncensored // Process message, leave it uncensored
$message = $post_info['post_text']; $message = $post_info['post_text'];
@ -126,7 +125,6 @@ function mcp_post_details($id, $mode, $action)
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '', 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']), 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_info['forum_id']}&amp;p=$post_id") . "#p$post_id\">", '</a>'), 'RETURN_TOPIC' => sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f={$post_info['forum_id']}&amp;p=$post_id") . "#p$post_id\">", '</a>'),
@ -136,7 +134,11 @@ function mcp_post_details($id, $mode, $action)
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']), 'SEARCH_IMG' => $user->img('icon_user_search', $user->lang['SEARCH']),
'POSTER_NAME' => $poster, 'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_PREVIEW' => $message, 'POST_PREVIEW' => $message,
'POST_SUBJECT' => $post_info['post_subject'], 'POST_SUBJECT' => $post_info['post_subject'],
'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_DATE' => $user->format_date($post_info['post_time']),
@ -157,7 +159,7 @@ function mcp_post_details($id, $mode, $action)
foreach ($log_data as $row) foreach ($log_data as $row)
{ {
$template->assign_block_vars('usernotes', array( $template->assign_block_vars('usernotes', array(
'REPORT_BY' => $row['username'], 'REPORT_BY' => $row['username_full'],
'REPORT_AT' => $user->format_date($row['time']), 'REPORT_AT' => $user->format_date($row['time']),
'ACTION' => $row['action'], 'ACTION' => $row['action'],
'ID' => $row['id']) 'ID' => $row['id'])
@ -383,6 +385,23 @@ function change_poster(&$post_info, $userdata)
$db->sql_query($sql); $db->sql_query($sql);
} }
// refresh search cache of this post
$search_type = basename($config['search_type']);
if (file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx))
{
require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
// We do some additional checks in the module to ensure it can actually be utilised
$error = false;
$search = new $search_type($error);
if (!$error && method_exists($search, 'destroy_cache'))
{
$search->destroy_cache(array(), array($post_info['user_id'], $userdata['user_id']));
}
}
$from_username = $post_info['username']; $from_username = $post_info['username'];
$to_username = $userdata['username']; $to_username = $userdata['username'];

View file

@ -99,14 +99,6 @@ class mcp_queue
); );
} }
// Set some vars
if ($post_info['user_id'] == ANONYMOUS)
{
$poster = ($post_info['post_username']) ? $post_info['post_username'] : $user->lang['GUEST'];
}
$poster = ($post_info['user_colour']) ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
// Process message, leave it uncensored // Process message, leave it uncensored
$message = $post_info['post_text']; $message = $post_info['post_text'];
$message = str_replace("\n", '<br />', $message); $message = str_replace("\n", '<br />', $message);
@ -133,7 +125,6 @@ class mcp_queue
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $post_info['user_id']),
'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '', 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']), 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . "&amp;start=$start\">", '</a>'), 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . "&amp;start=$start\">", '</a>'),
@ -141,7 +132,11 @@ class mcp_queue
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'POSTER_NAME' => $poster, 'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_PREVIEW' => $message, 'POST_PREVIEW' => $message,
'POST_SUBJECT' => $post_info['post_subject'], 'POST_SUBJECT' => $post_info['post_subject'],
'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_DATE' => $user->format_date($post_info['post_time']),
@ -253,7 +248,7 @@ class mcp_queue
if (sizeof($post_ids)) if (sizeof($post_ids))
{ {
$sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username $sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.user_colour
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u
WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . '
AND t.topic_id = p.topic_id AND t.topic_id = p.topic_id
@ -284,7 +279,7 @@ class mcp_queue
} }
else else
{ {
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_first_poster_name AS username $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour
FROM ' . TOPICS_TABLE . " t FROM ' . TOPICS_TABLE . " t
WHERE forum_id IN (0, $forum_list) WHERE forum_id IN (0, $forum_list)
AND topic_approved = 0 AND topic_approved = 0
@ -322,31 +317,30 @@ class mcp_queue
foreach ($rowset as $row) foreach ($rowset as $row)
{ {
if ($row['poster_id'] == ANONYMOUS)
{
$poster = (!empty($row['post_username'])) ? $row['post_username'] : $user->lang['GUEST'];
}
else
{
$poster = $row['username'];
}
$global_topic = ($row['forum_id']) ? false : true; $global_topic = ($row['forum_id']) ? false : true;
if ($global_topic) if ($global_topic)
{ {
$row['forum_id'] = $global_id; $row['forum_id'] = $global_id;
} }
if (empty($row['post_username']))
{
$row['post_username'] = $user->lang['GUEST'];
}
$template->assign_block_vars('postrow', array( $template->assign_block_vars('postrow', array(
'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''), 'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . (($mode == 'unapproved_posts') ? '#p' . $row['post_id'] : ''),
'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$row['forum_id']}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')), 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;start=$start&amp;mode=approve_details&amp;f={$row['forum_id']}&amp;p={$row['post_id']}" . (($mode == 'unapproved_topics') ? "&amp;t={$row['topic_id']}" : '')),
'U_VIEWPROFILE' => ($row['poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['poster_id']) : '',
'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_ID' => $row['post_id'], 'POST_ID' => $row['post_id'],
'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'],
'POST_SUBJECT' => $row['post_subject'], 'POST_SUBJECT' => $row['post_subject'],
'POSTER' => $poster,
'POST_TIME' => $user->format_date($row['post_time'])) 'POST_TIME' => $user->format_date($row['post_time']))
); );
} }
@ -383,19 +377,18 @@ function approve_post($post_id_list, $mode)
global $db, $template, $user, $config; global $db, $template, $user, $config;
global $phpEx, $phpbb_root_path; global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve'))) if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{ {
trigger_error('NOT_AUTHORIZED'); trigger_error('NOT_AUTHORIZED');
} }
$redirect = request_var('redirect', $user->data['session_page']); $redirect = request_var('redirect', build_url(array('_f_')));
$success_msg = ''; $success_msg = '';
$s_hidden_fields = build_hidden_fields(array( $s_hidden_fields = build_hidden_fields(array(
'i' => 'queue', 'i' => 'queue',
'mode' => $mode, 'mode' => $mode,
'post_id_list' => $post_id_list, 'post_id_list' => $post_id_list,
'f' => $forum_id,
'action' => 'approve', 'action' => 'approve',
'redirect' => $redirect) 'redirect' => $redirect)
); );
@ -409,8 +402,8 @@ function approve_post($post_id_list, $mode)
// If Topic -> total_topics = total_topics+1, total_posts = total_posts+1, forum_topics = forum_topics+1, forum_posts = forum_posts+1 // If Topic -> total_topics = total_topics+1, total_posts = total_posts+1, forum_topics = forum_topics+1, forum_posts = forum_posts+1
// If Post -> total_posts = total_posts+1, forum_posts = forum_posts+1, topic_replies = topic_replies+1 // If Post -> total_posts = total_posts+1, forum_posts = forum_posts+1, topic_replies = topic_replies+1
$total_topics = $total_posts = $forum_topics = $forum_posts = 0; $total_topics = $total_posts = 0;
$topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = array(); $forum_topics_posts = $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = $forum_id_list = array();
$update_forum_information = false; $update_forum_information = false;
@ -418,13 +411,26 @@ function approve_post($post_id_list, $mode)
{ {
$topic_id_list[$post_data['topic_id']] = 1; $topic_id_list[$post_data['topic_id']] = 1;
if ($post_data['forum_id'])
{
$forum_id_list[$post_data['forum_id']] = 1;
}
// Topic or Post. ;) // Topic or Post. ;)
if ($post_data['topic_first_post_id'] == $post_id) if ($post_data['topic_first_post_id'] == $post_id)
{ {
if ($post_data['forum_id']) if ($post_data['forum_id'])
{ {
if (!isset($forum_topics_posts[$post_data['forum_id']]))
{
$forum_topics_posts[$post_data['forum_id']] = array(
'forum_posts' => 0,
'forum_topics' => 0
);
}
$total_topics++; $total_topics++;
$forum_topics++; $forum_topics_posts[$post_data['forum_id']]['forum_topics']++;
} }
$topic_approve_sql[] = $post_data['topic_id']; $topic_approve_sql[] = $post_data['topic_id'];
@ -433,18 +439,23 @@ function approve_post($post_id_list, $mode)
{ {
if (!isset($topic_replies_sql[$post_data['topic_id']])) if (!isset($topic_replies_sql[$post_data['topic_id']]))
{ {
$topic_replies_sql[$post_data['topic_id']] = 1; $topic_replies_sql[$post_data['topic_id']] = 0;
} }
else
{
$topic_replies_sql[$post_data['topic_id']]++; $topic_replies_sql[$post_data['topic_id']]++;
} }
}
if ($post_data['forum_id']) if ($post_data['forum_id'])
{ {
if (!isset($forum_topics_posts[$post_data['forum_id']]))
{
$forum_topics_posts[$post_data['forum_id']] = array(
'forum_posts' => 0,
'forum_topics' => 0
);
}
$total_posts++; $total_posts++;
$forum_posts++; $forum_topics_posts[$post_data['forum_id']]['forum_posts']++;
} }
$post_approve_sql[] = $post_id; $post_approve_sql[] = $post_id;
@ -483,17 +494,20 @@ function approve_post($post_id_list, $mode)
} }
} }
if ($forum_topics || $forum_posts) if (sizeof($forum_topics_posts))
{
foreach ($forum_topics_posts as $forum_id => $row)
{ {
$sql = 'UPDATE ' . FORUMS_TABLE . ' $sql = 'UPDATE ' . FORUMS_TABLE . '
SET '; SET ';
$sql .= ($forum_topics) ? "forum_topics = forum_topics + $forum_topics" : ''; $sql .= ($row['forum_topics']) ? "forum_topics = forum_topics + {$row['forum_topics']}" : '';
$sql .= ($forum_topics && $forum_posts) ? ', ' : ''; $sql .= ($row['forum_topics'] && $row['forum_posts']) ? ', ' : '';
$sql .= ($forum_posts) ? "forum_posts = forum_posts + $forum_posts" : ''; $sql .= ($row['forum_posts']) ? "forum_posts = forum_posts + {$row['forum_posts']}" : '';
$sql .= " WHERE forum_id = $forum_id"; $sql .= " WHERE forum_id = $forum_id";
$db->sql_query($sql); $db->sql_query($sql);
} }
}
if ($total_topics) if ($total_topics)
{ {
@ -510,9 +524,9 @@ function approve_post($post_id_list, $mode)
if ($update_forum_information) if ($update_forum_information)
{ {
update_post_information('forum', $forum_id); update_post_information('forum', array_keys($forum_id_list));
} }
unset($topic_id_list); unset($topic_id_list, $forum_id_list);
$messenger = new messenger(); $messenger = new messenger();
@ -539,16 +553,15 @@ function approve_post($post_id_list, $mode)
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])), 'POST_SUBJECT' => htmlspecialchars_decode(censor_text($post_data['post_subject'])),
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])), 'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($post_data['topic_title'])),
'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t={$post_data['topic_id']}&e=0", 'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&e=0",
'U_VIEW_POST' => generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&t={$post_data['topic_id']}&p=$post_id&e=$post_id") 'U_VIEW_POST' => generate_board_url() . "/viewtopic.$phpEx?f={$post_data['forum_id']}&t={$post_data['topic_id']}&p=$post_id&e=$post_id")
); );
$messenger->send($post_data['user_notify_type']); $messenger->send($post_data['user_notify_type']);
$messenger->reset(); }
} }
$messenger->save_queue(); $messenger->save_queue();
}
// Send out normal user notifications // Send out normal user notifications
$email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']); $email_sig = str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']);
@ -558,19 +571,19 @@ function approve_post($post_id_list, $mode)
if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id']) if ($post_id == $post_data['topic_first_post_id'] && $post_id == $post_data['topic_last_post_id'])
{ {
// Forum Notifications // Forum Notifications
user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $forum_id, $post_data['topic_id'], $post_id); user_notification('post', $post_data['topic_title'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id);
} }
else else
{ {
// Topic Notifications // Topic Notifications
user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $forum_id, $post_data['topic_id'], $post_id); user_notification('reply', $post_data['post_subject'], $post_data['topic_title'], $post_data['forum_name'], $post_data['forum_id'], $post_data['topic_id'], $post_id);
} }
} }
unset($post_info); unset($post_info);
if ($forum_topics) if ($total_topics)
{ {
$success_msg = ($forum_topics == 1) ? 'TOPIC_APPROVED_SUCCESS' : 'TOPICS_APPROVED_SUCCESS'; $success_msg = ($total_topics == 1) ? 'TOPIC_APPROVED_SUCCESS' : 'TOPICS_APPROVED_SUCCESS';
} }
else else
{ {
@ -609,12 +622,12 @@ function disapprove_post($post_id_list, $mode)
global $db, $template, $user, $config; global $db, $template, $user, $config;
global $phpEx, $phpbb_root_path; global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_approve'))) if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{ {
trigger_error('NOT_AUTHORIZED'); trigger_error('NOT_AUTHORIZED');
} }
$redirect = request_var('redirect', build_url(array('t', 'mode')) . '&amp;mode=unapproved_topics'); $redirect = request_var('redirect', build_url(array('t', 'mode', '_f_')) . '&amp;mode=unapproved_topics');
$reason = request_var('reason', '', true); $reason = request_var('reason', '', true);
$reason_id = request_var('reason_id', 0); $reason_id = request_var('reason_id', 0);
$success_msg = $additional_msg = ''; $success_msg = $additional_msg = '';
@ -623,7 +636,6 @@ function disapprove_post($post_id_list, $mode)
'i' => 'queue', 'i' => 'queue',
'mode' => $mode, 'mode' => $mode,
'post_id_list' => $post_id_list, 'post_id_list' => $post_id_list,
'f' => $forum_id,
'action' => 'disapprove', 'action' => 'disapprove',
'redirect' => $redirect) 'redirect' => $redirect)
); );
@ -660,43 +672,53 @@ function disapprove_post($post_id_list, $mode)
// If Topic -> forum_topics_real -= 1 // If Topic -> forum_topics_real -= 1
// If Post -> topic_replies_real -= 1 // If Post -> topic_replies_real -= 1
$forum_topics_real = 0; $num_disapproved = 0;
$topic_replies_real_sql = $post_disapprove_sql = $topic_id_list = array(); $forum_topics_real = $topic_id_list = $forum_id_list = $topic_replies_real_sql = $post_disapprove_sql = array();
foreach ($post_info as $post_id => $post_data) foreach ($post_info as $post_id => $post_data)
{ {
$topic_id_list[$post_data['topic_id']] = 1; $topic_id_list[$post_data['topic_id']] = 1;
if ($post_data['forum_id'])
{
$forum_id_list[$post_data['forum_id']] = 1;
}
// Topic or Post. ;) // Topic or Post. ;)
if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_last_post_id'] == $post_id) if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_last_post_id'] == $post_id)
{ {
if ($post_data['forum_id']) if ($post_data['forum_id'])
{ {
$forum_topics_real++; if (!isset($forum_topics_real[$post_data['forum_id']]))
{
$forum_topics_real[$post_data['forum_id']] = 0;
}
$forum_topics_real[$post_data['forum_id']]++;
$num_disapproved++;
} }
} }
else else
{ {
if (!isset($topic_replies_real_sql[$post_data['topic_id']])) if (!isset($topic_replies_real_sql[$post_data['topic_id']]))
{ {
$topic_replies_real_sql[$post_data['topic_id']] = 1; $topic_replies_real_sql[$post_data['topic_id']] = 0;
} }
else
{
$topic_replies_real_sql[$post_data['topic_id']]++; $topic_replies_real_sql[$post_data['topic_id']]++;
} }
}
$post_disapprove_sql[] = $post_id; $post_disapprove_sql[] = $post_id;
} }
if ($forum_topics_real) if (sizeof($forum_topics_real))
{
foreach ($forum_topics_real as $forum_id => $topics_real)
{ {
$sql = 'UPDATE ' . FORUMS_TABLE . " $sql = 'UPDATE ' . FORUMS_TABLE . "
SET forum_topics_real = forum_topics_real - $forum_topics_real SET forum_topics_real = forum_topics_real - $topics_real
WHERE forum_id = $forum_id"; WHERE forum_id = $forum_id";
$db->sql_query($sql); $db->sql_query($sql);
} }
}
if (sizeof($topic_replies_real_sql)) if (sizeof($topic_replies_real_sql))
{ {
@ -722,8 +744,12 @@ function disapprove_post($post_id_list, $mode)
unset($post_disapprove_sql, $topic_replies_real_sql); unset($post_disapprove_sql, $topic_replies_real_sql);
update_post_information('topic', array_keys($topic_id_list)); update_post_information('topic', array_keys($topic_id_list));
update_post_information('forum', $forum_id);
unset($topic_id_list); if (sizeof($forum_id_list))
{
update_post_information('forum', array_keys($forum_id_list));
}
unset($topic_id_list, $forum_id_list);
$messenger = new messenger(); $messenger = new messenger();
@ -753,16 +779,15 @@ function disapprove_post($post_id_list, $mode)
); );
$messenger->send($post_data['user_notify_type']); $messenger->send($post_data['user_notify_type']);
$messenger->reset();
} }
$messenger->save_queue();
} }
unset($post_info, $disapprove_reason); unset($post_info, $disapprove_reason);
if ($forum_topics_real) $messenger->save_queue();
if (sizeof($forum_topics_real))
{ {
$success_msg = ($forum_topics_real == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS'; $success_msg = ($num_disapproved == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS';
} }
else else
{ {

View file

@ -64,7 +64,7 @@ class mcp_reports
// closed reports are accessed by report id // closed reports are accessed by report id
$report_id = request_var('r', 0); $report_id = request_var('r', 0);
$sql = 'SELECT r.post_id, r.user_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username $sql = 'SELECT r.post_id, r.user_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.user_colour
FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id AND r.report_closed = 0") . ' WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id AND r.report_closed = 0") . '
AND rr.reason_id = r.reason_id AND rr.reason_id = r.reason_id
@ -107,14 +107,6 @@ class mcp_reports
); );
} }
// Set some vars
if ($post_info['user_id'] == ANONYMOUS)
{
$poster = ($post_info['post_username']) ? $post_info['post_username'] : $user->lang['GUEST'];
}
$poster = ($post_info['user_colour']) ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
// Process message, leave it uncensored // Process message, leave it uncensored
$message = $post_info['post_text']; $message = $post_info['post_text'];
$message = str_replace("\n", '<br />', $message); $message = str_replace("\n", '<br />', $message);
@ -129,7 +121,7 @@ class mcp_reports
$template->assign_vars(array( $template->assign_vars(array(
'S_MCP_REPORT' => true, 'S_MCP_REPORT' => true,
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&amp;p=$post_id&amp;f=$forum_id"), 'S_CLOSE_ACTION' => $this->u_action . '&amp;p=' . $post_id . 'f=' . $forum_id,
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_REPORTED' => $post_info['post_reported'],
'S_POST_UNAPPROVED' => !$post_info['post_approved'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'],
@ -144,22 +136,28 @@ class mcp_reports
'U_MCP_WARN_REPORTER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '', 'U_MCP_WARN_REPORTER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '', 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;p=' . $post_info['post_id'] . '#p' . $post_info['post_id']),
'U_VIEW_PROFILE' => ($post_info['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $post_info['user_id']) : '',
'U_VIEW_REPORTER_PROFILE' => ($report['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $report['user_id']) : '',
'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']), 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']),
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']),
'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports' . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start) . '">', '</a>'), 'RETURN_REPORTS' => sprintf($user->lang['RETURN_REPORTS'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports' . (($post_info['post_reported']) ? '&amp;mode=reports' : '&amp;mode=reports_closed') . '&amp;start=' . $start . '&amp;f=' . $post_info['forum_id']) . '">', '</a>'),
'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']),
'REPORT_REASON_TITLE' => $reason['title'], 'REPORT_REASON_TITLE' => $reason['title'],
'REPORT_REASON_DESCRIPTION' => $reason['description'], 'REPORT_REASON_DESCRIPTION' => $reason['description'],
'REPORTER_NAME' => ($report['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $report['username'],
'REPORT_DATE' => $user->format_date($report['report_time']), 'REPORT_DATE' => $user->format_date($report['report_time']),
'REPORT_TEXT' => $report['report_text'], 'REPORT_TEXT' => $report['report_text'],
'POSTER_NAME' => $poster, 'POST_AUTHOR_FULL' => get_username_string('full', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']),
'REPORTER_FULL' => get_username_string('full', $report['user_id'], $report['username'], $report['user_colour']),
'REPORTER_COLOUR' => get_username_string('colour', $report['user_id'], $report['username'], $report['user_colour']),
'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']),
'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']),
'POST_PREVIEW' => $message, 'POST_PREVIEW' => $message,
'POST_SUBJECT' => $post_info['post_subject'], 'POST_SUBJECT' => $post_info['post_subject'],
'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_DATE' => $user->format_date($post_info['post_time']),
@ -281,7 +279,7 @@ class mcp_reports
if (sizeof($report_ids)) if (sizeof($report_ids))
{ {
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, r.user_id as reporter_id, ru.username as reporter_name, r.report_time, r.report_id $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id
FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru
WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . ' WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . '
AND t.topic_id = p.topic_id AND t.topic_id = p.topic_id
@ -293,15 +291,6 @@ class mcp_reports
$report_data = $rowset = array(); $report_data = $rowset = array();
while ($row = $db->sql_fetchrow($result)) while ($row = $db->sql_fetchrow($result))
{ {
if ($row['poster_id'] == ANONYMOUS)
{
$poster = (!empty($row['post_username'])) ? $row['post_username'] : $user->lang['GUEST'];
}
else
{
$poster = $row['username'];
}
$global_topic = ($row['forum_id']) ? false : true; $global_topic = ($row['forum_id']) ? false : true;
if ($global_topic) if ($global_topic)
{ {
@ -312,15 +301,21 @@ class mcp_reports
'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', 'U_VIEWFORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '',
'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . '#p' . $row['post_id'], 'U_VIEWPOST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&amp;p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&amp;start=$start&amp;mode=report_details&amp;f={$row['forum_id']}&amp;r={$row['report_id']}"), 'U_VIEW_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=reports&amp;start=$start&amp;mode=report_details&amp;f={$row['forum_id']}&amp;r={$row['report_id']}"),
'U_VIEW_POSTER_PROFILE' => ($row['poster_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['poster_id']) : '',
'U_VIEW_REPORTER_PROFILE' => ($row['reporter_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['reporter_id']) : '', 'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'REPORTER_FULL' => get_username_string('full', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
'REPORTER_COLOUR' => get_username_string('colour', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
'REPORTER' => get_username_string('username', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
'U_REPORTER' => get_username_string('profile', $row['reporter_id'], $row['reporter_name'], $row['reporter_colour']),
'FORUM_NAME' => (!$global_topic) ? $forum_data[$row['forum_id']]['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'FORUM_NAME' => (!$global_topic) ? $forum_data[$row['forum_id']]['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'],
'POSTER' => $poster,
'POST_ID' => $row['post_id'], 'POST_ID' => $row['post_id'],
'POST_SUBJECT' => $row['post_subject'], 'POST_SUBJECT' => $row['post_subject'],
'POST_TIME' => $user->format_date($row['post_time']), 'POST_TIME' => $user->format_date($row['post_time']),
'REPORTER' => ($row['reporter_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $row['reporter_name'],
'REPORT_TIME' => $user->format_date($row['report_time']), 'REPORT_TIME' => $user->format_date($row['report_time']),
'TOPIC_TITLE' => $row['topic_title']) 'TOPIC_TITLE' => $row['topic_title'])
); );
@ -335,7 +330,7 @@ class mcp_reports
'L_TITLE' => ($mode == 'reports') ? $user->lang['MCP_REPORTS_OPEN'] : $user->lang['MCP_REPORTS_CLOSED'], 'L_TITLE' => ($mode == 'reports') ? $user->lang['MCP_REPORTS_OPEN'] : $user->lang['MCP_REPORTS_CLOSED'],
'L_ONLY_TOPIC' => ($topic_id) ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '', 'L_ONLY_TOPIC' => ($topic_id) ? sprintf($user->lang['ONLY_TOPIC'], $topic_info['topic_title']) : '',
'S_MCP_ACTION' => build_url(array('t', 'f', 'sd', 'st', 'sk')), 'S_MCP_ACTION' => $this->u_action,
'S_FORUM_OPTIONS' => $forum_options, 'S_FORUM_OPTIONS' => $forum_options,
'S_CLOSED' => ($mode == 'reports_closed') ? true : false, 'S_CLOSED' => ($mode == 'reports_closed') ? true : false,
@ -359,18 +354,22 @@ function close_report($post_id_list, $mode, $action)
global $db, $template, $user, $config; global $db, $template, $user, $config;
global $phpEx, $phpbb_root_path; global $phpEx, $phpbb_root_path;
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_report'))) if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report')))
{ {
trigger_error('NOT_AUTHORIZED'); trigger_error('NOT_AUTHORIZED');
} }
if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false) if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false)
{ {
$redirect = request_var('redirect', build_url(array('mode')) . '&amp;mode=reports'); $redirect = request_var('redirect', build_url(array('mode', '_f_', 'r')) . '&amp;mode=reports');
}
else if ($action == 'close' && !request_var('r', 0))
{
$redirect = request_var('redirect', build_url(array('mode', '_f_', 'p')) . '&amp;mode=reports');
} }
else else
{ {
$redirect = request_var('redirect', $user->data['session_page']); $redirect = request_var('redirect', build_url(array('_f_')));
} }
$success_msg = ''; $success_msg = '';
@ -378,7 +377,6 @@ function close_report($post_id_list, $mode, $action)
'i' => 'reports', 'i' => 'reports',
'mode' => $mode, 'mode' => $mode,
'post_id_list' => $post_id_list, 'post_id_list' => $post_id_list,
'f' => $forum_id,
'action' => $action, 'action' => $action,
'redirect' => $redirect) 'redirect' => $redirect)
); );
@ -496,13 +494,12 @@ function close_report($post_id_list, $mode, $action)
); );
$messenger->send($reporter['user_notify_type']); $messenger->send($reporter['user_notify_type']);
$messenger->reset();
} }
$messenger->save_queue();
} }
unset($notify_reporters, $post_info); unset($notify_reporters, $post_info);
$messenger->save_queue();
$success_msg = (sizeof($post_id_list) == 1) ? 'REPORT_' . strtoupper($action) . 'D_SUCCESS' : 'REPORTS_' . strtoupper($action) . 'D_SUCCESS'; $success_msg = (sizeof($post_id_list) == 1) ? 'REPORT_' . strtoupper($action) . 'D_SUCCESS' : 'REPORTS_' . strtoupper($action) . 'D_SUCCESS';
} }
else else

View file

@ -32,14 +32,12 @@ function mcp_topic_view($id, $mode, $action)
// Set up some vars // Set up some vars
$icon_id = request_var('icon', 0); $icon_id = request_var('icon', 0);
$subject = request_var('subject', '', true); $subject = utf8_normalize_nfc(request_var('subject', '', true));
$start = request_var('start', 0); $start = request_var('start', 0);
$to_topic_id = request_var('to_topic_id', 0); $to_topic_id = request_var('to_topic_id', 0);
$to_forum_id = request_var('to_forum_id', 0); $to_forum_id = request_var('to_forum_id', 0);
$post_id_list = request_var('post_id_list', array(0)); $post_id_list = request_var('post_id_list', array(0));
utf8_normalize_nfc(&$subject);
// Split Topic? // Split Topic?
if ($action == 'split_all' || $action == 'split_beyond') if ($action == 'split_all' || $action == 'split_beyond')
{ {
@ -83,10 +81,11 @@ function mcp_topic_view($id, $mode, $action)
$sql = 'SELECT u.username, u.user_colour, p.* $sql = 'SELECT u.username, u.user_colour, p.*
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . " WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . '
p.topic_id = {$topic_id} p.topic_id = ' . $topic_id . ' ' .
((!$auth->acl_get('m_approve', $topic_info['forum_id'])) ? ' AND p.post_approved = 1 ' : '') . '
AND p.poster_id = u.user_id AND p.poster_id = u.user_id
ORDER BY $sort_order_sql"; ORDER BY ' . $sort_order_sql;
$result = $db->sql_query_limit($sql, $posts_per_page, $start); $result = $db->sql_query_limit($sql, $posts_per_page, $start);
$rowset = array(); $rowset = array();
@ -107,8 +106,6 @@ function mcp_topic_view($id, $mode, $action)
foreach ($rowset as $i => $row) foreach ($rowset as $i => $row)
{ {
$has_unapproved_posts = false; $has_unapproved_posts = false;
$poster = ($row['poster_id'] != ANONYMOUS) ? $row['username'] : ((!$row['post_username']) ? $user->lang['GUEST'] : $row['post_username']);
$poster = ($row['user_colour']) ? '<span style="color:#' . $row['user_colour'] . '">' . $poster . '</span>' : $poster;
$message = $row['post_text']; $message = $row['post_text'];
$post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : $topic_info['topic_title']; $post_subject = ($row['post_subject'] != '') ? $row['post_subject'] : $topic_info['topic_title'];
@ -127,7 +124,11 @@ function mcp_topic_view($id, $mode, $action)
} }
$template->assign_block_vars('postrow', array( $template->assign_block_vars('postrow', array(
'POSTER_NAME' => $poster, 'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'U_POST_AUTHOR' => get_username_string('profile', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_DATE' => $user->format_date($row['post_time']), 'POST_DATE' => $user->format_date($row['post_time']),
'POST_SUBJECT' => $post_subject, 'POST_SUBJECT' => $post_subject,
'MESSAGE' => $message, 'MESSAGE' => $message,
@ -141,8 +142,8 @@ function mcp_topic_view($id, $mode, $action)
'S_CHECKED' => ($post_id_list && in_array(intval($row['post_id']), $post_id_list)) ? true : false, 'S_CHECKED' => ($post_id_list && in_array(intval($row['post_id']), $post_id_list)) ? true : false,
'U_POST_DETAILS' => "$url&amp;i=$id&amp;p={$row['post_id']}&amp;mode=post_details", 'U_POST_DETAILS' => "$url&amp;i=$id&amp;p={$row['post_id']}&amp;mode=post_details",
'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']), 'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id'])) 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '')
); );
unset($rowset[$i]); unset($rowset[$i]);
@ -179,7 +180,7 @@ function mcp_topic_view($id, $mode, $action)
$template->assign_vars(array( $template->assign_vars(array(
'TOPIC_TITLE' => $topic_info['topic_title'], 'TOPIC_TITLE' => $topic_info['topic_title'],
'U_VIEWTOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']), 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_info['forum_id'] . '&amp;t=' . $topic_info['topic_id']),
'TO_TOPIC_ID' => $to_topic_id, 'TO_TOPIC_ID' => $to_topic_id,
'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '', 'TO_TOPIC_INFO' => ($to_topic_id) ? sprintf($user->lang['YOU_SELECTED_TOPIC'], $to_topic_id, '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_topic_info['forum_id'] . '&amp;t=' . $to_topic_id) . '">' . $to_topic_info['topic_title'] . '</a>') : '',
@ -198,6 +199,7 @@ function mcp_topic_view($id, $mode, $action)
'S_CAN_DELETE' => ($auth->acl_get('m_delete', $topic_info['forum_id'])) ? true : false, 'S_CAN_DELETE' => ($auth->acl_get('m_delete', $topic_info['forum_id'])) ? true : false,
'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false, 'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false,
'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false, 'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false,
'S_CAN_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? true : false,
'S_REPORT_VIEW' => ($action == 'reports') ? true : false, 'S_REPORT_VIEW' => ($action == 'reports') ? true : false,
'S_MERGE_VIEW' => ($action == 'merge') ? true : false, 'S_MERGE_VIEW' => ($action == 'merge') ? true : false,
@ -223,6 +225,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
global $db, $template, $user, $phpEx, $phpbb_root_path, $auth; global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
$post_id_list = request_var('post_id_list', array(0)); $post_id_list = request_var('post_id_list', array(0));
$forum_id = request_var('forum_id', 0);
$start = request_var('start', 0); $start = request_var('start', 0);
if (!sizeof($post_id_list)) if (!sizeof($post_id_list))
@ -231,7 +234,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
return; return;
} }
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_split'))) if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_split')))
{ {
return; return;
} }
@ -430,7 +433,7 @@ function merge_posts($topic_id, $to_topic_id)
return; return;
} }
if (!($forum_id = check_ids($post_id_list, POSTS_TABLE, 'post_id', 'm_merge'))) if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_merge')))
{ {
return; return;
} }
@ -445,7 +448,6 @@ function merge_posts($topic_id, $to_topic_id)
'action' => 'merge_posts', 'action' => 'merge_posts',
'start' => $start, 'start' => $start,
'redirect' => $redirect, 'redirect' => $redirect,
'f' => $forum_id,
't' => $topic_id) 't' => $topic_id)
); );
$success_msg = $return_link = ''; $success_msg = $return_link = '';
@ -465,7 +467,7 @@ function merge_posts($topic_id, $to_topic_id)
if (sizeof($topic_data)) if (sizeof($topic_data))
{ {
$return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id . '&amp;t=' . $topic_id) . '">', '</a>'); $return_link .= sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $topic_data['forum_id'] . '&amp;t=' . $topic_id) . '">', '</a>');
} }
// Link to the new topic // Link to the new topic

View file

@ -88,9 +88,12 @@ function mcp_warn_front_view($id, $mode)
{ {
$template->assign_block_vars('highest', array( $template->assign_block_vars('highest', array(
'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']), 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']), 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'USERNAME' => $row['username'],
'WARNING_TIME' => $user->format_date($row['user_last_warning']), 'WARNING_TIME' => $user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'], 'WARNINGS' => $row['user_warnings'],
) )
@ -99,7 +102,7 @@ function mcp_warn_front_view($id, $mode)
// And now the 5 most recent users to get in trouble // And now the 5 most recent users to get in trouble
$sql = 'SELECT u.user_id, u.username, u.user_warnings, w.warning_time $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_warnings, w.warning_time
FROM ' . USERS_TABLE . ' u, ' . WARNINGS_TABLE . ' w FROM ' . USERS_TABLE . ' u, ' . WARNINGS_TABLE . ' w
WHERE u.user_id = w.user_id WHERE u.user_id = w.user_id
ORDER BY w.warning_time DESC'; ORDER BY w.warning_time DESC';
@ -109,9 +112,12 @@ function mcp_warn_front_view($id, $mode)
{ {
$template->assign_block_vars('latest', array( $template->assign_block_vars('latest', array(
'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']), 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']), 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'USERNAME' => $row['username'],
'WARNING_TIME' => $user->format_date($row['warning_time']), 'WARNING_TIME' => $user->format_date($row['warning_time']),
'WARNINGS' => $row['user_warnings'], 'WARNINGS' => $row['user_warnings'],
) )
@ -137,7 +143,7 @@ function mcp_warn_list_view($id, $mode, $action)
$limit_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'], 365 => $user->lang['1_YEAR']); $limit_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'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']); $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']);
$sort_by_sql = array('a' => 'username', 'b' => 'user_last_warning', 'c' => 'user_warnings'); $sort_by_sql = array('a' => 'username_clean', 'b' => 'user_last_warning', 'c' => 'user_warnings');
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
@ -155,9 +161,12 @@ function mcp_warn_list_view($id, $mode, $action)
{ {
$template->assign_block_vars('user', array( $template->assign_block_vars('user', array(
'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']), 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $row['user_id']),
'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
'USERNAME' => $row['username'],
'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '',
'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']), 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u=' . $row['user_id']),
'USERNAME' => $row['username'],
'WARNING_TIME' => $user->format_date($row['user_last_warning']), 'WARNING_TIME' => $user->format_date($row['user_last_warning']),
'WARNINGS' => $row['user_warnings'], 'WARNINGS' => $row['user_warnings'],
) )
@ -266,6 +275,7 @@ function mcp_warn_post_view($id, $mode, $action)
// get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img); // get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img);
$avatar_img = ''; $avatar_img = '';
if (!empty($userrow['user_avatar'])) if (!empty($userrow['user_avatar']))
{ {
switch ($userrow['user_avatar_type']) switch ($userrow['user_avatar_type'])
@ -278,8 +288,8 @@ function mcp_warn_post_view($id, $mode, $action)
$avatar_img = $config['avatar_gallery_path'] . '/'; $avatar_img = $config['avatar_gallery_path'] . '/';
break; break;
} }
$avatar_img .= $userrow['user_avatar'];
$avatar_img .= $userrow['user_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />'; $avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />';
} }
@ -350,6 +360,7 @@ function mcp_warn_user_view($id, $mode, $action)
// get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img); // get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img);
$avatar_img = ''; $avatar_img = '';
if (!empty($userrow['user_avatar'])) if (!empty($userrow['user_avatar']))
{ {
switch ($userrow['user_avatar_type']) switch ($userrow['user_avatar_type'])
@ -362,8 +373,8 @@ function mcp_warn_user_view($id, $mode, $action)
$avatar_img = $config['avatar_gallery_path'] . '/'; $avatar_img = $config['avatar_gallery_path'] . '/';
break; break;
} }
$avatar_img .= $userrow['user_avatar'];
$avatar_img .= $userrow['user_avatar'];
$avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />'; $avatar_img = '<img src="' . $avatar_img . '" width="' . $userrow['user_avatar_width'] . '" height="' . $userrow['user_avatar_height'] . '" alt="" />';
} }

View file

@ -86,10 +86,13 @@ class bbcode_firstpass extends bbcode
// Add newline at the end and in front of each quote block to prevent parsing errors (urls, smilies, etc.) // Add newline at the end and in front of each quote block to prevent parsing errors (urls, smilies, etc.)
if (strpos($this->message, '[quote') !== false) if (strpos($this->message, '[quote') !== false)
{ {
$in = str_replace("\r\n", "\n", $this->message); $this->message = str_replace("\r\n", "\n", $this->message);
$this->message = preg_replace(array('#\[quote(=&quot;.*?&quot;)?\]([^\n])#is', '#([^\n])\[\/quote\]#is'), array("[quote\\1]\n\\2", "\\1\n[/quote]"), $this->message); // We strip newlines and spaces after and before quotes in quotes (trimming)
$this->message = preg_replace(array('#\[quote(=&quot;.*?&quot;)?\]([^\n])#is', '#([^\n])\[\/quote\]#is'), array("[quote\\1]\n\\2", "\\1\n[/quote]"), $this->message); $this->message = preg_replace(array('#\[quote(=&quot;.*?&quot;)?\]([\s|\n]+)#ius', '#([\s|\n]+)\[\/quote\]#ius'), array("[quote\\1]", "[/quote]"), $this->message);
// Now we add exactly one newline
$this->message = preg_replace(array('#\[quote(=&quot;.*?&quot;)?\]#is', '#\[\/quote\]#is'), array("[quote\\1]\n", "\n[/quote]"), $this->message);
} }
// Add other checks which needs to be placed before actually parsing anything (be it bbcodes, smilies, urls...) // Add other checks which needs to be placed before actually parsing anything (be it bbcodes, smilies, urls...)
@ -442,7 +445,7 @@ class bbcode_firstpass extends bbcode
} }
$code = preg_replace('#^<span class="[a-z]+"><span class="([a-z]+)">(.*)</span></span>#s', '<span class="$1">$2</span>', $code); $code = preg_replace('#^<span class="[a-z]+"><span class="([a-z]+)">(.*)</span></span>#s', '<span class="$1">$2</span>', $code);
$code = preg_replace('#(?:[\n\r\s\t]|&nbsp;)*</span>$#', '</span>', $code); $code = preg_replace('#(?:[\n\r\s\t]|&nbsp;)*</span>$#u', '</span>', $code);
// remove newline at the end // remove newline at the end
if (!empty($code) && $code{strlen($code)-1} == "\n") if (!empty($code) && $code{strlen($code)-1} == "\n")
@ -600,7 +603,7 @@ class bbcode_firstpass extends bbcode
$pos = strlen($in); $pos = strlen($in);
for ($i = 0, $tok_len = strlen($tok); $i < $tok_len; ++$i) for ($i = 0, $tok_len = strlen($tok); $i < $tok_len; ++$i)
{ {
$tmp_pos = strpos($in, $tok{$i}); $tmp_pos = strpos($in, $tok[$i]);
if ($tmp_pos !== false && $tmp_pos < $pos) if ($tmp_pos !== false && $tmp_pos < $pos)
{ {
$pos = $tmp_pos; $pos = $tmp_pos;
@ -608,7 +611,7 @@ class bbcode_firstpass extends bbcode
} }
$buffer .= substr($in, 0, $pos); $buffer .= substr($in, 0, $pos);
$tok = $in{$pos}; $tok = $in[$pos];
$in = substr($in, $pos + 1); $in = substr($in, $pos + 1);
if ($tok == ']') if ($tok == ']')
@ -616,10 +619,15 @@ class bbcode_firstpass extends bbcode
if ($buffer == '/quote' && sizeof($close_tags)) if ($buffer == '/quote' && sizeof($close_tags))
{ {
// we have found a closing tag // we have found a closing tag
// Add space at the end of the closing tag to allow following urls/smilies to be parsed correctly $out .= array_pop($close_tags) . ']';
$out .= array_pop($close_tags) . '] ';
$tok = '['; $tok = '[';
$buffer = ''; $buffer = '';
// Add space at the end of the closing tag if not happened before to allow following urls/smilies to be parsed correctly
if (!$in || $in[0] !== ' ')
{
$out .= ' ';
}
} }
else if (preg_match('#^quote(?:=&quot;(.*?)&quot;)?$#is', $buffer, $m)) else if (preg_match('#^quote(?:=&quot;(.*?)&quot;)?$#is', $buffer, $m))
{ {
@ -656,14 +664,7 @@ class bbcode_firstpass extends bbcode
else else
{ {
$end_tag = array_pop($end_tags); $end_tag = array_pop($end_tags);
if ($end_tag != $tag) $error = ($end_tag != $tag) ? true : false;
{
$error = true;
}
else
{
$error = false;
}
} }
} }
@ -696,9 +697,35 @@ class bbcode_firstpass extends bbcode
} }
else else
{ {
/**
* Old quote code working fine, but having errors listed in bug #3572
*
* $out .= $buffer . $tok;
* $tok = ($tok == '[') ? ']' : '[]';
* $buffer = '';
*/
$out .= $buffer . $tok; $out .= $buffer . $tok;
// $tok = ($tok == '[') ? ']' : '[]';
if ($tok == '[')
{
// Search the text for the next tok... if an ending quote comes first, then change tok to []
$pos1 = strpos($in, '[/quote');
$pos2 = strpos($in, ']');
if ($pos1 !== false && ($pos2 === false || $pos1 < $pos2))
{
$tok = '[]'; $tok = '[]';
}
else
{
$tok = ']';
}
}
else
{
$tok = '[]';
}
$buffer = ''; $buffer = '';
} }
} }
@ -906,14 +933,14 @@ class parse_message extends bbcode_firstpass
// Do some general 'cleanup' first before processing message, // Do some general 'cleanup' first before processing message,
// e.g. remove excessive newlines(?), smilies(?) // e.g. remove excessive newlines(?), smilies(?)
// Transform \r\n and \r into \n // Transform \r\n and \r into \n
$match = array('#\r\n?#', "#([\n][\s]+){3,}#", '#(script|about|applet|activex|chrome):#i'); $match = array('#\r\n?#', "#([\n][\s]+){3,}#u", '#(script|about|applet|activex|chrome):#i');
$replace = array("\n", "\n\n", "\\1&#058;"); $replace = array("\n", "\n\n", "\\1&#058;");
$this->message = preg_replace($match, $replace, trim($this->message)); $this->message = preg_replace($match, $replace, trim($this->message));
// Message length check. -1 disables this check completely. // Message length check. -1 disables this check completely.
if ($config['max_' . $mode . '_chars'] != -1) if ($config['max_' . $mode . '_chars'] != -1)
{ {
$msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#is', ' ', $this->message)); $msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars']) if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars'])
{ {
@ -1138,8 +1165,7 @@ class parse_message extends bbcode_firstpass
$error = array(); $error = array();
$num_attachments = sizeof($this->attachment_data); $num_attachments = sizeof($this->attachment_data);
$this->filename_data['filecomment'] = request_var('filecomment', '', true); $this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
utf8_normalize_nfc(&$this->filename_data['filecomment']);
$upload_file = (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none' && trim($_FILES[$form_name]['name'])) ? true : false; $upload_file = (isset($_FILES[$form_name]) && $_FILES[$form_name]['name'] != 'none' && trim($_FILES[$form_name]['name'])) ? true : false;
$add_file = (isset($_POST['add_file'])) ? true : false; $add_file = (isset($_POST['add_file'])) ? true : false;
@ -1256,8 +1282,7 @@ class parse_message extends bbcode_firstpass
{ {
if ($edit_comment) if ($edit_comment)
{ {
$actual_comment_list = request_var('comment_list', array(''), true); $actual_comment_list = utf8_normalize_nfc(request_var('comment_list', array(''), true));
utf8_normalize_nfc(&$actual_comment_list);
$edit_comment = request_var('edit_comment', array(0 => '')); $edit_comment = request_var('edit_comment', array(0 => ''));
$edit_comment = key($edit_comment); $edit_comment = key($edit_comment);
@ -1322,8 +1347,7 @@ class parse_message extends bbcode_firstpass
{ {
global $user, $db, $phpbb_root_path, $phpEx, $config; global $user, $db, $phpbb_root_path, $phpEx, $config;
$this->filename_data['filecomment'] = request_var('filecomment', '', true); $this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
utf8_normalize_nfc(&$this->filename_data['filecomment']);
$attachment_data = (isset($_POST['attachment_data'])) ? $_POST['attachment_data'] : array(); $attachment_data = (isset($_POST['attachment_data'])) ? $_POST['attachment_data'] : array();
$this->attachment_data = array(); $this->attachment_data = array();

View file

@ -103,9 +103,9 @@ class fulltext_mysql extends search_backend
* Splits keywords entered by a user into an array of words stored in $this->split_words * Splits keywords entered by a user into an array of words stored in $this->split_words
* Stores the tidied search query in $this->search_query * Stores the tidied search query in $this->search_query
* *
* @param string $keywords Contains the keyword as entered by the user * @param string &$keywords Contains the keyword as entered by the user
* @param string $terms is either 'all' or 'any' * @param string $terms is either 'all' or 'any'
* @return false if no valid keywords were found and otherwise true * @return bool false if no valid keywords were found and otherwise true
*/ */
function split_keywords(&$keywords, $terms) function split_keywords(&$keywords, $terms)
{ {
@ -116,7 +116,7 @@ class fulltext_mysql extends search_backend
if ($terms == 'all') if ($terms == 'all')
{ {
$match = array('#\sand\s#i', '#\sor\s#i', '#\snot\s#i', '#\+#', '#-#', '#\|#'); $match = array('#\sand\s#iu', '#\sor\s#iu', '#\snot\s#iu', '#\+#', '#-#', '#\|#');
$replace = array(' +', ' |', ' -', ' +', ' -', ' |'); $replace = array(' +', ' |', ' -', ' +', ' -', ' |');
$keywords = preg_replace($match, $replace, $keywords); $keywords = preg_replace($match, $replace, $keywords);
@ -215,7 +215,7 @@ class fulltext_mysql extends search_backend
/** /**
* Performs a search on keywords depending on display specific params. * Performs a search on keywords depending on display specific params.
* *
* @param array $id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
* @param int $start indicates the first index of the page * @param int $start indicates the first index of the page
* @param int $per_page number of ids each page is supposed to contain * @param int $per_page number of ids each page is supposed to contain
* @return total number of results * @return total number of results
@ -412,7 +412,7 @@ class fulltext_mysql extends search_backend
/** /**
* Performs a search on an author's posts without caring about message contents. Depends on display specific params * Performs a search on an author's posts without caring about message contents. Depends on display specific params
* *
* @param array $id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
* @param int $start indicates the first index of the page * @param int $start indicates the first index of the page
* @param int $per_page number of ids each page is supposed to contain * @param int $per_page number of ids each page is supposed to contain
* @return total number of results * @return total number of results

Some files were not shown because too many files have changed in this diff Show more