Changeset 702


Ignore:
Timestamp:
Mar 31, 2010, 6:32:40 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Aktualizace fóra.
Location:
trunk
Files:
2 deleted
289 edited

Legend:

Unmodified
Added
Removed
  • trunk/forum/.htaccess

    r400 r702  
     1#
     2# Uncomment the statement below if you want to make use of
     3# HTTP authentication and it does not already work.
     4# This could be required if you are for example using PHP via Apache CGI.
     5#
     6#<IfModule mod_rewrite.c>
     7#RewriteEngine on
     8#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
     9#</IfModule>
     10
    111<Files "config.php">
    212Order Allow,Deny
  • trunk/forum/adm/index.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: index.php 8591 2008-06-04 11:40:53Z Kellanved $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    132132                'ICON_MOVE_UP_DISABLED'         => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />',
    133133                'ICON_MOVE_DOWN'                        => '<img src="' . $phpbb_admin_path . 'images/icon_down.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
    134                 'ICON_MOVE_DOWN_DISABLED'       => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',             
     134                'ICON_MOVE_DOWN_DISABLED'       => '<img src="' . $phpbb_admin_path . 'images/icon_down_disabled.gif" alt="' . $user->lang['MOVE_DOWN'] . '" title="' . $user->lang['MOVE_DOWN'] . '" />',
    135135                'ICON_EDIT'                                     => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
    136136                'ICON_EDIT_DISABLED'            => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />',
     
    264264        $name = 'config[' . $config_key . ']';
    265265
     266        // Make sure there is no notice printed out for non-existent config options (we simply set them)
     267        if (!isset($new[$config_key]))
     268        {
     269                $new[$config_key] = '';
     270        }
     271
    266272        switch ($tpl_type[0])
    267273        {
     
    303309                case 'select':
    304310                case 'custom':
    305                        
     311
    306312                        $return = '';
    307313
     
    342348                                $args = array($new[$config_key], $key);
    343349                        }
    344                        
     350
    345351                        $return = call_user_func_array($call, $args);
    346352
     
    378384        $min    = 1;
    379385        $max    = 2;
    380        
     386
    381387        foreach ($config_vars as $config_name => $config_definition)
    382388        {
     
    385391                        continue;
    386392                }
    387        
     393
    388394                if (!isset($config_definition['validate']))
    389395                {
    390396                        continue;
    391397                }
    392                
     398
    393399                $validator = explode(':', $config_definition['validate']);
    394400
     
    549555{
    550556        global $user;
    551        
     557
    552558        $column_types = array(
    553559                'BOOL'  => array('php_type' => 'int',           'min' => 0,                             'max' => 1),
     
    556562                'INT'   => array('php_type' => 'int',           'min' => (int) 0x80000000,      'max' => (int) 0x7fffffff),
    557563                'TINT'  => array('php_type' => 'int',           'min' => -128,                          'max' => 127),
    558                
     564
    559565                'VCHAR' => array('php_type' => 'string',        'min' => 0,                             'max' => 255),
    560566        );
     
    583589                        break;
    584590
    585                         case 'int': 
     591                        case 'int':
    586592                                $min = (isset($column[1])) ? max($column[1],$type['min']) : $type['min'];
    587593                                $max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max'];
  • trunk/forum/adm/style/acp_ban.html

    r400 r702  
    9494        <dl>
    9595                <dt><label for="unbanlength">{L_BAN_LENGTH}:</label></dt>
    96                 <dd><input style="border: 0;" type="text" class="text full" disabled="disabled" name="unbanlength" id="unbanlength" /></dd>
     96                <dd><input style="border: 0;" type="text" class="text full" readonly="readonly" name="unbanlength" id="unbanlength" /></dd>
    9797        </dl>
    9898        <dl>
    9999                <dt><label for="unbanreason">{L_BAN_REASON}:</label></dt>
    100                 <dd><textarea style="border: 0;" class="text full" disabled="disabled" name="unbanreason" id="unbanreason" rows="5" cols="80">&nbsp;</textarea></dd>
     100                <dd><textarea style="border: 0;" class="text full" readonly="readonly" name="unbanreason" id="unbanreason" rows="5" cols="80">&nbsp;</textarea></dd>
    101101        </dl>
    102102        <dl>
    103103                <dt><label for="unbangivereason">{L_BAN_GIVE_REASON}:</label></dt>
    104                 <dd><textarea style="border: 0;" class="text full" disabled="disabled" name="unbangivereason" id="unbangivereason" rows="5" cols="80">&nbsp;</textarea></dd>
     104                <dd><textarea style="border: 0;" class="text full" readonly="readonly" name="unbangivereason" id="unbangivereason" rows="5" cols="80">&nbsp;</textarea></dd>
    105105        </dl>
    106106
  • trunk/forum/adm/style/acp_captcha.html

    r400 r702  
    1919</dl>
    2020<dl>
     21        <dt><label for="max_reg_attempts">{L_REG_LIMIT}:</label><br /><span>{L_REG_LIMIT_EXPLAIN}</span></dt>
     22        <dd><input id="max_reg_attempts" type="text" size="4" maxlength="4" name="max_reg_attempts" value="{REG_LIMIT}" /></dd>
     23</dl>
     24<dl>
     25        <dt><label for="max_login_attempts">{L_MAX_LOGIN_ATTEMPTS}:</label><br /><span>{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}</span></dt>
     26        <dd><input id="max_login_attempts" type="text" size="4" maxlength="4" name="max_login_attempts" value="{MAX_LOGIN_ATTEMPTS}" /></dd>
     27</dl>
     28<dl>
    2129        <dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt>
    2230        <dd><label><input type="radio" class="radio" id="enable_post_confirm" name="enable_post_confirm" value="1"<!-- IF POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
    2331                <label><input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
    2432</dl>
    25 <!-- IF GD -->
    2633<dl>
    27         <dt><label for="captcha_gd">{L_CAPTCHA_GD}:</label><br /><span>{L_CAPTCHA_GD_EXPLAIN}</span></dt>
    28         <dd><label><input id="captcha_gd" name="captcha_gd" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
    29                 <label><input name="captcha_gd" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
    30 </dl>
    31 <dl>
    32         <dt><label for="captcha_gd_foreground_noise">{L_CAPTCHA_GD_FOREGROUND_NOISE}:</label><br /><span>{L_CAPTCHA_GD_FOREGROUND_NOISE_EXPLAIN}</span></dt>
    33         <dd><label><input id="captcha_gd_foreground_noise" name="captcha_gd_foreground_noise" value="1" class="radio" type="radio"<!-- IF CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
    34                 <label><input name="captcha_gd_foreground_noise" value="0" class="radio" type="radio"<!-- IF not CAPTCHA_GD_FOREGROUND_NOISE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
    35 </dl>
    36 <dl>
    37         <dt><label for="captcha_gd_x_grid">{L_CAPTCHA_GD_X_GRID}:</label><br /><span>{L_CAPTCHA_GD_X_GRID_EXPLAIN}</span></dt>
    38         <dd><input id="captcha_gd_x_grid" name="captcha_gd_x_grid" value="{CAPTCHA_GD_X_GRID}" type="text" /></dd>
    39 </dl>
    40 <dl>
    41         <dt><label for="captcha_gd_y_grid">{L_CAPTCHA_GD_Y_GRID}:</label><br /><span>{L_CAPTCHA_GD_Y_GRID_EXPLAIN}</span></dt>
    42         <dd><input id="captcha_gd_y_grid" name="captcha_gd_y_grid" value="{CAPTCHA_GD_Y_GRID}" type="text" /></dd>
    43 </dl>
    44 <!-- ENDIF -->
    45 
    46 </fieldset>
    47 <fieldset>
    48         <legend>{L_PREVIEW}</legend>
    49 <!-- IF PREVIEW -->
    50         <div class="successbox">
    51                 <h3>{L_WARNING}</h3>
    52                 <p>{L_CAPTCHA_PREVIEW_MSG}</p>
    53         </div>
    54 <!-- ENDIF -->
    55 <dl>
    56         <dt><label for="captcha_preview">{L_PREVIEW}:</label><br /><span>{L_CAPTCHA_PREVIEW_EXPLAIN}</span></dt>
    57         <dd><img src="{CAPTCHA_PREVIEW}" alt="{L_PREVIEW}" <!-- IF CAPTCHA_GD_PREVIEWED -->width="360" height="96"<!-- ELSE --> width="320" height="50"<!-- ENDIF --> id="captcha_preview" /></dd>
     34        <dt><label for="confirm_refresh">{L_VISUAL_CONFIRM_REFRESH}:</label><br /><span>{L_VISUAL_CONFIRM_REFRESH_EXPLAIN}</span></dt>
     35        <dd><label><input type="radio" class="radio" id="confirm_refresh" name="confirm_refresh" value="1"<!-- IF CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_ENABLED}</label>
     36                <label><input type="radio" class="radio" name="confirm_refresh" value="0"<!-- IF not CONFIRM_REFRESH --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd>
    5837</dl>
    5938</fieldset>
    6039
    61 <fieldset class="submit-buttons">
    62         <legend>{L_SUBMIT}</legend>
    63         <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
    64         <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />&nbsp;
    65         <input class="button2" type="submit" id="preview" name="preview" value="{L_PREVIEW}" />
     40<fieldset>
     41<legend>{L_AVAILABLE_CAPTCHAS}</legend>
     42<dl>
     43        <dt><label for="captcha_select">{L_CAPTCHA_SELECT}:</label><br /><span>{L_CAPTCHA_SELECT_EXPLAIN}</span></dt>
     44        <dd><select id="captcha_select" name="select_captcha" onchange="(document.getElementById('acp_captcha')).submit()" >{CAPTCHA_SELECT}</select></dd>
     45</dl>
     46 <!-- IF S_CAPTCHA_HAS_CONFIG -->
     47<dl>
     48        <dt><label for="configure">{L_CAPTCHA_CONFIGURE}:</label><br /><span>{L_CAPTCHA_CONFIGURE_EXPLAIN}</span></dt>
     49        <dd><input class="button2" type="submit" id="configure" name="configure" value="{L_CONFIGURE}" /></dd>
     50</dl>
     51<!-- ENDIF -->
     52</fieldset>
     53
     54<!-- IF CAPTCHA_PREVIEW_TPL -->
     55<fieldset>
     56        <legend>{L_PREVIEW}</legend>
     57<!-- INCLUDE {CAPTCHA_PREVIEW_TPL} -->
     58</fieldset>
     59<!-- ENDIF -->
     60
     61<fieldset>
     62        <legend>{L_ACP_SUBMIT_CHANGES}</legend>
     63        <p class="submit-buttons">
     64                <input class="button1" type="submit" id="main_submit" name="main_submit" value="{L_SUBMIT}" />&nbsp;
     65                <input class="button2" type="reset" id="form_reset" name="reset" value="{L_RESET}" />&nbsp;
     66        </p>
    6667        {S_FORM_TOKEN}
    6768</fieldset>
  • trunk/forum/adm/style/acp_database.html

    r400 r702  
    7171        <dl>
    7272                <dt><label for="where">{L_ACTION}:</label></dt>
    73                 <dd><label><input type="radio" class="radio" name="where" value="store_and_download" id="where" checked="checked" /> {L_STORE_AND_DOWNLOAD}</label>
    74                         <label><input type="radio" class="radio" name="where" value="store" /> {L_STORE_LOCAL}</label>
    75                         <label><input type="radio" class="radio" name="where" value="download" /> {L_DOWNLOAD}</label></dd>
     73                <dd>
     74                        <label><input id="where" type="radio" class="radio" name="where" value="store" checked="checked" /> {L_STORE_LOCAL}</label>
     75                        <label><input type="radio" class="radio" name="where" value="download" /> {L_DOWNLOAD}</label>
     76                </dd>
    7677        </dl>
    7778        <dl>
  • trunk/forum/adm/style/acp_email.html

    r400 r702  
    4545
    4646<p class="submit-buttons">
    47         <input class="button1" type="submit" id="submit" name="submit" value="{L_EMAIL}" />&nbsp;
     47        <input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_EMAIL}" />&nbsp;
    4848        <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
    4949</p>
  • trunk/forum/adm/style/acp_forums.html

    r400 r702  
    219219                </dl>
    220220                <dl>
     221                        <dt><label for="enable_quick_reply">{L_ENABLE_QUICK_REPLY}:</label><br /><span>{L_ENABLE_QUICK_REPLY_EXPLAIN}</span></dt>
     222                        <dd><label><input type="radio" class="radio" name="enable_quick_reply" value="1"<!-- IF S_ENABLE_QUICK_REPLY --> id="enable_quick_reply" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
     223                                <label><input type="radio" class="radio" name="enable_quick_reply" value="0"<!-- IF not S_ENABLE_QUICK_REPLY --> id="enable_quick_reply" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
     224                </dl>
     225                <dl>
    221226                        <dt><label for="enable_indexing">{L_ENABLE_INDEXING}:</label><br /><span>{L_ENABLE_INDEXING_EXPLAIN}</span></dt>
    222227                        <dd><label><input type="radio" class="radio" name="enable_indexing" value="1"<!-- IF S_ENABLE_INDEXING --> id="enable_indexing" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
     
    445450                                        <strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong>
    446451                                        <!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF -->
    447                                         <!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <strong>{forums.FORUM_TOPICS}</strong> / {L_POSTS}: <b>{forums.FORUM_POSTS}</b></span><!-- ENDIF -->
     452                                        <!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <strong>{forums.FORUM_TOPICS}</strong> / {L_POSTS}: <strong>{forums.FORUM_POSTS}</strong></span><!-- ENDIF -->
    448453                                </td>
    449454                                <td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;">
  • trunk/forum/adm/style/acp_groups.html

    r400 r702  
    5656
    5757        <fieldset>
     58                <legend>{L_GROUP_OPTIONS_SAVE}</legend>
     59        <!-- IF S_USER_FOUNDER -->
     60        <dl>
     61                <dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}:</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt>
     62                <dd><input name="group_founder_manage" type="checkbox" value="1" class="radio" id="group_founder_manage"{GROUP_FOUNDER_MANAGE} /></dd>
     63        </dl>
     64        <!-- ENDIF -->
     65        <dl>
     66                <dt><label for="group_skip_auth">{L_GROUP_SKIP_AUTH}:</label><br /><span>{L_GROUP_SKIP_AUTH_EXPLAIN}</span></dt>
     67                <dd><input name="group_skip_auth" type="checkbox" value="1" class="radio" id="group_skip_auth"{GROUP_SKIP_AUTH} /></dd>
     68        </dl>
     69        <dl>
     70                <dt><label for="group_legend">{L_GROUP_LEGEND}:</label></dt>
     71                <dd><input name="group_legend" type="checkbox" value="1" class="radio" id="group_legend"{GROUP_LEGEND} /></dd>
     72        </dl>
     73        <dl>
     74                <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}:</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt>
     75                <dd><input name="group_receive_pm" type="checkbox" value="1" class="radio" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd>
     76        </dl>
     77        </fieldset>
     78
     79        <fieldset>
    5880                <legend>{L_GROUP_SETTINGS_SAVE}</legend>
    59         <!-- IF S_USER_FOUNDER -->
    60         <dl>
    61                 <dt><label for="group_founder_manage">{L_GROUP_FOUNDER_MANAGE}:</label><br /><span>{L_GROUP_FOUNDER_MANAGE_EXPLAIN}</span></dt>
    62                 <dd><input name="group_founder_manage" type="checkbox" class="radio" id="group_founder_manage"{GROUP_FOUNDER_MANAGE} /></dd>
    63         </dl>
    64         <!-- ENDIF -->
    65         <dl>
    66                 <dt><label for="group_legend">{L_GROUP_LEGEND}:</label></dt>
    67                 <dd><input name="group_legend" type="checkbox" class="radio" id="group_legend"{GROUP_LEGEND} /></dd>
    68         </dl>
    69         <dl>
    70                 <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}:</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt>
    71                 <dd><input name="group_receive_pm" type="checkbox" class="radio" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd>
    72         </dl>
    7381        <dl>
    7482                <dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}:</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt>
     
    8189        <dl>
    8290                <dt><label for="group_colour">{L_GROUP_COLOR}:</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
    83                 <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" />&nbsp;&nbsp;<span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
     91                <dd><input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" /><!-- IF GROUP_COLOUR -->&nbsp;<span style="background-color: #{GROUP_COLOUR}">&nbsp; &nbsp;</span><!-- ENDIF -->&nbsp;&nbsp;<span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd>
    8492        </dl>
    8593        <dl>
     
    98106        <!-- IF not S_IN_AVATAR_GALLERY -->
    99107                <!-- IF S_CAN_UPLOAD -->
    100                         <dl> 
     108                        <dl>
    101109                                <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt>
    102110                                <dd><input type="file" id="uploadfile" name="uploadfile" /></dd>
     
    113121                <dl>
    114122                        <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
    115                         <dd><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>px</span></dd>
     123                        <dd><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>{L_PIXEL} &times; </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd>
    116124                </dl>
    117125                <!-- IF S_DISPLAY_GALLERY -->
    118                         <dl> 
     126                        <dl>
    119127                                <dt><label>{L_AVATAR_GALLERY}:</label></dt>
    120128                                <dd><input class="button2" type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" /></dd>
     
    133141                        <table cellspacing="1">
    134142                        <!-- BEGIN avatar_row -->
    135                         <tr> 
     143                        <tr>
    136144                                <!-- BEGIN avatar_column -->
    137145                                        <td class="row1" style="text-align: center;"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td>
     
    147155                </dl>
    148156                </fieldset>
    149                
     157
    150158                <fieldset class="quick" style="margin-top: -15px;">
    151159                        <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" />
    152160                </fieldset>
    153        
     161
    154162        <!-- ENDIF -->
    155163        </fieldset>
     
    193201        <!-- BEGIN leader -->
    194202                <!-- IF leader.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
    195                         <td><a href="{leader.U_USER_EDIT}">{leader.USERNAME}</a></td>
     203                        <td><!-- IF leader.USERNAME_COLOUR --><a href="{leader.U_USER_EDIT}" style="color: #{leader.USERNAME_COLOUR};" class="username-coloured">{leader.USERNAME}</a><!-- ELSE --><a href="{leader.U_USER_EDIT}">{leader.USERNAME}</a><!-- ENDIF --></td>
    196204                        <td style="text-align: center;"><!-- IF leader.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
    197205                        <td style="text-align: center;">{leader.JOINED}</td>
     
    214222                <!-- ELSE -->
    215223                        <!-- IF member.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
    216                         <td><a href="{member.U_USER_EDIT}">{member.USERNAME}</a></td>
     224                        <td><!-- IF member.USERNAME_COLOUR --><a href="{member.U_USER_EDIT}" style="color: #{member.USERNAME_COLOUR};" class="username-coloured">{member.USERNAME}</a><!-- ELSE --><a href="{member.U_USER_EDIT}">{member.USERNAME}</a><!-- ENDIF --></td>
    217225                        <td style="text-align: center;"><!-- IF member.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
    218226                        <td style="text-align: center;">{member.JOINED}</td>
     
    232240                        <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
    233241        </div>
    234         <!-- ENDIF --> 
     242        <!-- ENDIF -->
    235243
    236244        <fieldset class="quick">
    237245                <select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select>
    238246                <input class="button2" type="submit" name="update" value="{L_SUBMIT}" />
    239                 <p class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>               
     247                <p class="small"><a href="#" onclick="marklist('list', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>
    240248        </fieldset>
    241249
  • trunk/forum/adm/style/acp_icons.html

    r400 r702  
    140140                <td><input class="text post" type="text" size="3" name="add_height" id="add_height" value="{HEIGHT}" /></td>
    141141                <td><input type="checkbox" class="radio" name="add_display_on_posting" checked="checked" onclick="toggle_select('add', this.checked, 'add_order');"/></td>
    142                 <td><select id="add_order" name="add_order">
    143                                 <optgroup id="order_disp[add]" label="{L_DISPLAY_POSTING}">{S_ADD_ORDER_LIST_DISPLAY}</optgroup>
    144                                 <optgroup id="order_no_disp[add]" label="{L_DISPLAY_POSTING_NO}" disabled="disabled" class="disabled-options" >{S_ADD_ORDER_LIST_UNDISPLAY}</optgroup>
     142                <td><select id="order_add_order" name="add_order">
     143                                <optgroup id="order_disp_add_order" label="{L_DISPLAY_POSTING}">{S_ADD_ORDER_LIST_DISPLAY}</optgroup>
     144                                <optgroup id="order_no_disp_add_order" label="{L_DISPLAY_POSTING_NO}" disabled="disabled" class="disabled-options" >{S_ADD_ORDER_LIST_UNDISPLAY}</optgroup>
    145145                </select></td>
    146146                <td><input type="checkbox" class="radio" name="add_additional_code" value="1" /></td>
     
    244244                        <!-- ENDIF -->
    245245                        <td style="text-align: right; white-space: nowrap;">
    246                                 <!-- IF items.S_FIRST_ROW -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->&nbsp;
    247                                 <!-- IF items.S_LAST_ROW -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
     246                                <!-- IF items.S_FIRST_ROW and not PREVIOUS_PAGE -->{ICON_MOVE_UP_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_UP}">{ICON_MOVE_UP}</a><!-- ENDIF -->&nbsp;
     247                                <!-- IF items.S_LAST_ROW and not NEXT_PAGE -->{ICON_MOVE_DOWN_DISABLED}<!-- ELSE --><a href="{items.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a><!-- ENDIF -->
    248248                                &nbsp;<a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}">{ICON_DELETE}</a>
    249249                        </td>
     
    256256        </tbody>
    257257        </table>
    258 
     258        <div>{PAGINATION}</div>
    259259        <p class="quick">
    260260                <input class="button2" name="add" type="submit" value="{L_ICON_ADD}" />&nbsp; &nbsp;<input class="button2" type="submit" name="edit" value="{L_ICON_EDIT}" />
  • trunk/forum/adm/style/acp_inactive.html

    r400 r702  
    1313<!-- IF PAGINATION -->
    1414<div class="pagination">
    15                 <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
     15        <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
    1616</div>
    1717<!-- ENDIF -->
     
    2323        <th>{L_JOINED}</th>
    2424        <th>{L_INACTIVE_DATE}</th>
     25        <th>{L_LAST_VISIT}</th>
    2526        <th>{L_INACTIVE_REASON}</th>
    26         <th>{L_LAST_VISIT}</th>
    2727        <th>{L_MARK}</th>
    2828</tr>
     
    3232        <!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
    3333
    34                 <td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
    35                 <td>{inactive.JOINED}</td>
    36                 <td>{inactive.INACTIVE_DATE}</td>
    37                 <td>{inactive.REASON}</td>
    38                 <td>{inactive.LAST_VISIT}</td>
     34                <td style="vertical-align: top;">
     35                        {inactive.USERNAME_FULL}
     36                        <!-- IF inactive.POSTS --><br />{L_POSTS}: <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF -->
     37                </td>
     38                <td style="vertical-align: top;">{inactive.JOINED}</td>
     39                <td style="vertical-align: top;">{inactive.INACTIVE_DATE}</td>
     40                <td style="vertical-align: top;">{inactive.LAST_VISIT}</td>
     41                <td style="vertical-align: top;">
     42                        {inactive.REASON}
     43                        <!-- IF inactive.REMINDED --><br />{inactive.REMINDED_EXPLAIN}<!-- ENDIF -->
     44                </td>
    3945                <td>&nbsp;<input type="checkbox" class="radio" name="mark[]" value="{inactive.USER_ID}" />&nbsp;</td>
    4046        </tr>
     
    4753</table>
    4854
    49         <fieldset class="display-options">
    50                 {L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}
    51                 <input class="button2" type="submit" value="{L_GO}" name="sort" />
    52         </fieldset>
    53         <hr />
    54         <!-- IF PAGINATION -->
     55<fieldset class="display-options">
     56        {L_DISPLAY_LOG}: &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}<!-- IF PAGINATION -->&nbsp;Users per page: <input class="inputbox autowidth" type="text" name="users_per_page" id="users_per_page" size="3" value="{USERS_PER_PAGE}" /><!-- ENDIF -->
     57        <input class="button2" type="submit" value="{L_GO}" name="sort" />
     58</fieldset>
     59
     60<hr />
     61
     62<!-- IF PAGINATION -->
    5563        <div class="pagination">
    56                         <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
     64                <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
    5765        </div>
    58         <!-- ENDIF -->
     66<!-- ENDIF -->
    5967
    60         <fieldset class="quick">
    61                 <select name="action">{S_INACTIVE_OPTIONS}</select>
    62                 <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
    63                 <p class="small"><a href="#" onclick="marklist('inactive', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('inactive', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>               
    64                 {S_FORM_TOKEN}
    65         </fieldset>
    66 
    67 
     68<fieldset class="quick">
     69        <select name="action">{S_INACTIVE_OPTIONS}</select>
     70        <input class="button2" type="submit" name="submit" value="{L_SUBMIT}" />
     71        <p class="small"><a href="#" onclick="marklist('inactive', 'mark', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('inactive', 'mark', false); return false;">{L_UNMARK_ALL}</a></p>
     72        {S_FORM_TOKEN}
     73</fieldset>
    6874
    6975</form>
  • trunk/forum/adm/style/acp_jabber.html

    r400 r702  
    3939</dl>
    4040<dl>
    41         <dt><label for="jab_password">{L_JAB_PASSWORD}:</label></dt>
     41        <dt><label for="jab_password">{L_JAB_PASSWORD}:</label><br /><span>{L_JAB_PASSWORD_EXPLAIN}</span></dt>
    4242        <dd><input type="password" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" /></dd>
    4343</dl>
  • trunk/forum/adm/style/acp_logs.html

    r400 r702  
    99<form id="list" method="post" action="{U_ACTION}">
    1010
     11<fieldset class="display-options" style="float: left">
     12        {L_SEARCH_KEYWORDS}: <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
     13</fieldset>
     14
    1115<!-- IF PAGINATION -->
    12 <div class="pagination">
    13                 <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
     16<div class="pagination" style="float: right; margin: 15px 0 2px 0">
     17        <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
    1418</div>
    1519<!-- ENDIF -->
     20
     21<div class="clearfix">&nbsp;</div>
     22<div><br style="clear: both;" /></div>
    1623
    1724<!-- IF .log -->
     
    2330                <th>{L_TIME}</th>
    2431                <th>{L_ACTION}</th>
    25                 <th>{L_MARK}</th>
     32                <!-- IF S_CLEARLOGS -->
     33                        <th>{L_MARK}</th>
     34                <!-- ENDIF -->
    2635        </tr>
    2736        </thead>
     
    2938        <!-- BEGIN log -->
    3039                <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
    31 
    3240                        <td>
    3341                                {log.USERNAME}
     
    3947                        <td style="text-align: center;">{log.DATE}</td>
    4048                        <td>{log.ACTION}<!-- IF log.DATA --><br /><span>{log.DATA}</span><!-- ENDIF --></td>
    41                         <td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{log.ID}" /></td>
     49                        <!-- IF S_CLEARLOGS -->
     50                                <td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{log.ID}" /></td>
     51                        <!-- ENDIF -->
    4252                </tr>
    4353        <!-- END log -->
     
    4555        </table>
    4656
     57<!-- IF PAGINATION -->
     58        <div class="pagination">
     59                <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
     60        </div>
     61<!-- ENDIF -->
     62
    4763<!-- ELSE -->
    48 
    4964        <div class="errorbox">
    5065                <p>{L_NO_ENTRIES}</p>
    5166        </div>
    52 
    5367<!-- ENDIF -->
    54 
    5568
    5669<fieldset class="display-options">
     
    6073</fieldset>
    6174<hr />
    62 <!-- IF PAGINATION -->
    63 <div class="pagination">
    64         <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> &bull; <span>{PAGINATION}</span>
    65 </div>
    66 <!-- ENDIF -->
     75
    6776<!-- IF S_SHOW_FORUMS -->
    6877        <fieldset class="quick">
     
    7281<!-- ENDIF -->
    7382
    74 <!-- IF S_CLEARLOGS -->
     83<!-- IF .log and S_CLEARLOGS -->
    7584        <fieldset class="quick">
    7685                <input class="button2" type="submit" name="delall" value="{L_DELETE_ALL}" />&nbsp;
     
    8089<!-- ENDIF -->
    8190
    82 
    8391</form>
    8492
  • trunk/forum/adm/style/acp_main.html

    r400 r702  
    1414
    1515        <p>{L_ADMIN_INTRO}</p>
     16
     17        <!-- IF S_VERSIONCHECK_FAIL -->
     18                <div class="errorbox notice">
     19                        <p>{L_VERSIONCHECK_FAIL}</p>
     20                        <p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> &middot; <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
     21                </div>
     22        <!-- ELSEIF not S_VERSION_UP_TO_DATE -->
     23                <div class="errorbox">
     24                        <p>{L_VERSION_NOT_UP_TO_DATE_TITLE}</p>
     25                        <p><a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> &middot; <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p>
     26                </div>
     27        <!-- ENDIF -->
     28
    1629
    1730        <!-- IF S_REMOVE_INSTALL -->
     
    2841        <!-- ENDIF -->
    2942
     43        <!-- IF S_PHP_VERSION_OLD -->
     44                <div class="errorbox notice">
     45                        <p>{L_PHP_VERSION_OLD}</p>
     46                </div>
     47        <!-- ENDIF -->
     48
    3049        <table cellspacing="1">
    3150                <caption>{L_FORUM_STATS}</caption>
     
    86105        <tr>
    87106                <td>{L_BOARD_VERSION}: </td>
    88                 <td><strong>{BOARD_VERSION}</strong></td>
     107                <td>
     108                        <strong><a href="{U_VERSIONCHECK}" <!-- IF S_VERSION_UP_TO_DATE -->style="color: #228822;"<!-- ELSE -->style="color: #BC2A4D;"<!-- ENDIF --> title="{L_MORE_INFORMATION}">{BOARD_VERSION}</a></strong> [&nbsp;<a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a>&nbsp;]
     109                </td>
    89110        <!-- IF S_TOTAL_ORPHAN -->
    90111                <td>{L_NUMBER_ORPHAN}: </td>
     
    138159
    139160                        <!-- IF S_FOUNDER -->
     161                        <form id="action_purge_sessions_form" method="post" action="{U_ACTION}">
     162                                <dl>
     163                                        <dt><label for="action_purge_sessions">{L_PURGE_SESSIONS}</label><br /><span>{L_PURGE_SESSIONS_EXPLAIN}</span></dt>
     164                                        <dd><input type="hidden" name="action" value="purge_sessions" /><input class="button2" type="submit" id="action_purge_sessions" name="action_purge_sessions" value="{L_RUN}" /></dd>
     165                                </dl>
     166                        </form>
    140167                        <form id="action_purge_cache_form" method="post" action="{U_ACTION}">
    141168                                <dl>
     
    194221                        <th>{L_JOINED}</th>
    195222                        <th>{L_INACTIVE_DATE}</th>
     223                        <th>{L_LAST_VISIT}</th>
    196224                        <th>{L_INACTIVE_REASON}</th>
    197                         <th>{L_LAST_VISIT}</th>
    198225                </tr>
    199226                </thead>
     
    202229                        <!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
    203230
    204                                 <td><a href="{inactive.U_USER_ADMIN}">{inactive.USERNAME}</a></td>
    205                                 <td>{inactive.JOINED}</td>
    206                                 <td>{inactive.INACTIVE_DATE}</td>
    207                                 <td>{inactive.REASON}</td>
    208                                 <td>{inactive.LAST_VISIT}</td>
     231                                <td style="vertical-align: top;">
     232                                        {inactive.USERNAME_FULL}
     233                                        <!-- IF inactive.POSTS --><br />{L_POSTS}: <strong>{inactive.POSTS}</strong> [<a href="{inactive.U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a>]<!-- ENDIF -->
     234                                </td>
     235                                <td style="vertical-align: top;">{inactive.JOINED}</td>
     236                                <td style="vertical-align: top;">{inactive.INACTIVE_DATE}</td>
     237                                <td style="vertical-align: top;">{inactive.LAST_VISIT}</td>
     238                                <td style="vertical-align: top;">
     239                                        {inactive.REASON}
     240                                        <!-- IF inactive.REMINDED --><br />{inactive.REMINDED_EXPLAIN}<!-- ENDIF -->
     241                                </td>
    209242                        </tr>
    210243                <!-- BEGINELSE -->
  • trunk/forum/adm/style/acp_permissions.html

    r400 r702  
    44
    55<!-- IF S_INTRO -->
    6        
     6
    77        <h1>{L_ACP_PERMISSIONS}</h1>
    88
     
    1313<!-- IF S_SELECT_VICTIM -->
    1414
     15        <!-- IF U_BACK --><a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">&laquo; {L_BACK}</a><!-- ENDIF -->
     16
    1517        <h1>{L_TITLE}</h1>
    1618
    1719        <p>{L_EXPLAIN}</p>
    18        
     20
    1921        <!-- IF S_FORUM_NAMES -->
    2022                <p><strong>{L_FORUMS}:</strong> {FORUM_NAMES}</p>
     
    6365                        </fieldset>
    6466                        </form>
    65                        
     67
    6668                <!-- ENDIF -->
    6769
     
    124126                        </dl>
    125127                        </fieldset>
    126                        
     128
    127129                        <fieldset class="quick">
    128130                                {S_HIDDEN_FIELDS}
     
    155157
    156158                <div style="float: {S_CONTENT_FLOW_END}; width: 48%">
    157                        
     159
    158160                <!-- IF S_CAN_SELECT_GROUP -->
    159161
     
    169171                        </dl>
    170172                        </fieldset>
    171                        
     173
    172174                        <fieldset class="quick">
    173175                                {S_HIDDEN_FIELDS}
     
    178180
    179181                        <form id="add_groups" method="post" action="{U_ACTION}">
    180                        
     182
    181183                        <fieldset>
    182184                                <legend>{L_ADD_GROUPS}</legend>
     
    200202
    201203                <div style="float: {S_CONTENT_FLOW_BEGIN}; width: 48%;">
    202                
     204
    203205                        <h1>{L_USERS}</h1>
    204206
     
    211213                        </dl>
    212214                        </fieldset>
    213                        
     215
    214216                        <fieldset class="quick">
    215217                                {S_HIDDEN_FIELDS}
     
    241243
    242244                <div style="float: {S_CONTENT_FLOW_END}; width: 48%">
    243                        
     245
    244246                        <h1>{L_USERGROUPS}</h1>
    245247
     
    252254                        </dl>
    253255                        </fieldset>
    254                        
     256
    255257                        <fieldset class="quick">
    256258                                {S_HIDDEN_FIELDS}
     
    312314        <!-- IF S_PERMISSION_DROPDOWN -->
    313315                <form id="pselect" method="post" action="{U_ACTION}">
    314        
     316
    315317                <fieldset class="quick" style="float: {S_CONTENT_FLOW_BEGIN};">
    316318                        {S_HIDDEN_FIELDS}
    317319                        {S_FORM_TOKEN}
    318                         {L_SELECT_TYPE}: <select name="type">{S_PERMISSION_DROPDOWN}</select> 
     320                        {L_SELECT_TYPE}: <select name="type">{S_PERMISSION_DROPDOWN}</select>
    319321
    320322                        <input class="button2" type="submit" name="submit" value="{L_GO}" />
     
    348350
    349351        <br /><br />
    350        
     352
    351353        </form>
    352354
  • trunk/forum/adm/style/acp_profile.html

    r400 r702  
    5555                        <dt><label for="field_show_on_reg">{L_DISPLAY_AT_REGISTER}:</label><br /><span>{L_DISPLAY_AT_REGISTER_EXPLAIN}</span></dt>
    5656                        <dd><input type="checkbox" class="radio" id="field_show_on_reg" name="field_show_on_reg" value="1"<!-- IF S_SHOW_ON_REG --> checked="checked"<!-- ENDIF --> /></dd>
     57                </dl>
     58                <dl>
     59                        <dt><label for="field_show_on_vt">{L_DISPLAY_ON_VT}:</label><br /><span>{L_DISPLAY_ON_VT_EXPLAIN}</span></dt>
     60                        <dd><input type="checkbox" class="radio" id="field_show_on_vt" name="field_show_on_vt" value="1"<!-- IF S_SHOW_ON_VT --> checked="checked"<!-- ENDIF --> /></dd>
    5761                </dl>
    5862                <dl>
     
    128132                        <input class="button1" type="submit" name="prev" value="{L_PROFILE_BASIC_OPTIONS}" />
    129133                </fieldset>
    130                
     134
    131135                <fieldset class="quick" style="float: {S_CONTENT_FLOW_END};">
    132136                        {S_HIDDEN_FIELDS}
     
    152156                        <input class="button1" type="submit" name="prev" value="{L_PROFILE_TYPE_OPTIONS}" />
    153157                </fieldset>
    154                
     158
    155159                <fieldset class="quick" style="float: {S_CONTENT_FLOW_END};">
    156160                        {S_HIDDEN_FIELDS}
     
    158162                        {S_FORM_TOKEN}
    159163                </fieldset>
    160        
     164
    161165        <!-- ENDIF -->
    162        
     166
    163167        </form>
    164168
     
    195199                                <a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
    196200                        <!-- ELSEIF not fields.S_FIRST_ROW && not fields.S_LAST_ROW-->
    197                                 <a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a> 
    198                                 <a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> 
     201                                <a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
     202                                <a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a>
    199203                        <!-- ELSEIF fields.S_LAST_ROW && not fields.S_FIRST_ROW -->
    200204                                <a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a>
    201                                 {ICON_MOVE_DOWN_DISABLED}       
     205                                {ICON_MOVE_DOWN_DISABLED}
    202206                        <!-- ENDIF -->
    203207                        <!-- IF not fields.S_NEED_EDIT -->
    204                                 <a href="{fields.U_EDIT}">{ICON_EDIT}</a> 
     208                                <a href="{fields.U_EDIT}">{ICON_EDIT}</a>
    205209                        <!-- ELSE -->
    206210                                {ICON_EDIT_DISABLED}
     
    210214
    211215        </tr>
     216        <!-- BEGINELSE -->
     217        <tr class="row3">
     218                <td colspan="4">{L_ACP_NO_ITEMS}</td>
     219        </tr>
    212220        <!-- END fields -->
    213221        </tbody>
     
    215223
    216224        <form id="profile_fields" method="post" action="{U_ACTION}">
    217        
     225
    218226        <fieldset class="quick">
    219227                <input class="text small" type="text" name="field_ident" /> <select name="field_type">{S_TYPE_OPTIONS}</select>
  • trunk/forum/adm/style/acp_search.html

    r400 r702  
    3232                <dt><label for="min_search_author_chars">{L_MIN_SEARCH_AUTHOR_CHARS}:</label><br /><span>{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}</span></dt>
    3333                <dd><input id="min_search_author_chars" type="text" size="4" maxlength="4" name="config[min_search_author_chars]" value="{MIN_SEARCH_AUTHOR_CHARS}" /></dd>
     34        </dl>
     35        <dl>
     36                <dt><label for="max_num_search_keywords">{L_MAX_NUM_SEARCH_KEYWORDS}:</label><br /><span>{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}</span></dt>
     37                <dd><input id="max_num_search_keywords" type="text" size="4" maxlength="4" name="config[max_num_search_keywords]" value="{MAX_NUM_SEARCH_KEYWORDS}" /></dd>
    3438        </dl>
    3539        <dl>
     
    131135                                </tbody>
    132136                                </table>
    133                        
     137
    134138                        <!-- ENDIF -->
    135                        
     139
    136140                        <p class="quick">
    137141                        <!-- IF backend.S_INDEXED -->
     
    143147                        {S_FORM_TOKEN}
    144148                        </fieldset>
    145                        
     149
    146150                        </form>
    147151                <!-- END backend -->
  • trunk/forum/adm/style/acp_styles.html

    r400 r702  
    2121        <dl>
    2222                <dt><label for="new_id">{L_REPLACE}:</label><br /><span>{L_REPLACE_EXPLAIN}</span></dt>
    23                 <dd><select name="new_id">{S_REPLACE_OPTIONS}</select></dd>
     23                <dd><select id="new_id" name="new_id">{S_REPLACE_OPTIONS}</select></dd>
    2424        </dl>
    2525
     
    5555                function update_image(newimage)
    5656                {
    57                         document.getElementById('newimg').src = (newimage) ? '../styles/{A_NAME}/imageset/' + encodeURI(newimage) : 'images/no_image.png';
     57                        document.getElementById('newimg').src = (newimage) ? '../styles/{A_PATH}/imageset/' + encodeURI(newimage) : 'images/no_image.png';
    5858                }
    5959        // ]]>
     
    136136                <dl>
    137137                        <dt><label for="imgwidth">{L_IMAGE_WIDTH}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt>
    138                         <dd><input type="text" name="imgwidth" value="{IMAGE_SIZE}" /></dd>
     138                        <dd><input id="imgwidth" type="text" name="imgwidth" value="{IMAGE_SIZE}" /></dd>
    139139                </dl>
    140140                <dl>
    141141                        <dt><label for="imgheight">{L_IMAGE_HEIGHT}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt>
    142                         <dd><input type="text" name="imgheight" value="{IMAGE_HEIGHT}" /></dd>
     142                        <dd><input id="imgheight" type="text" name="imgheight" value="{IMAGE_HEIGHT}" /></dd>
    143143                </dl>
    144144        </div>
     
    267267        <p>{L_TEMPLATE_CACHE_EXPLAIN}</p>
    268268
    269         <form name="acp_styles" method="post" action="{U_ACTION}">
     269        <form id="acp_styles" method="post" action="{U_ACTION}">
    270270        <fieldset class="tabulated">
    271271        <legend>{L_TEMPLATE_CACHE}</legend>
     
    456456        <dl>
    457457                <dt><label for="name">{L_NAME}:</label></dt>
    458                 <dd><!-- IF S_INSTALL --><b id="name">{NAME}</b><!-- ELSE --><input type="text" id="name" name="name" value="{NAME}" /><!-- ENDIF --></dd>
     458                <dd><!-- IF S_INSTALL --><strong id="name">{NAME}</strong><!-- ELSE --><input type="text" id="name" name="name" value="{NAME}" /><!-- ENDIF --></dd>
    459459        </dl>
    460460        <dl>
    461461                <dt><label for="copyright">{L_COPYRIGHT}:</label></dt>
    462                 <dd><!-- IF S_INSTALL --><b id="copyright">{COPYRIGHT}</b><!-- ELSE --><input type="text" id="copyright" name="copyright" value="{COPYRIGHT}" /><!-- ENDIF --></dd>
     462                <dd><!-- IF S_INSTALL --><strong id="copyright">{COPYRIGHT}</strong><!-- ELSE --><input type="text" id="copyright" name="copyright" value="{COPYRIGHT}" /><!-- ENDIF --></dd>
    463463        </dl>
    464464        <!-- IF S_SUPERTEMPLATE -->
    465465        <dl>
    466466                <dt><label for="inheriting">{L_INHERITING_FROM}:</label></dt>
    467                 <dd><b id="inheriting">{S_SUPERTEMPLATE}</b></dd>
     467                <dd><strong id="inheriting">{S_SUPERTEMPLATE}</strong></dd>
    468468        </dl>
    469469        <!-- ENDIF -->
     
    471471                <dl>
    472472                        <dt><label for="template_id">{L_STYLE_TEMPLATE}:</label></dt>
    473                         <dd><!-- IF S_INSTALL --><b id="template_id">{TEMPLATE_NAME}</b><!-- ELSE --><select id="template_id" name="template_id">{S_TEMPLATE_OPTIONS}</select><!-- ENDIF --></dd>
     473                        <dd><!-- IF S_INSTALL --><strong id="template_id">{TEMPLATE_NAME}</strong><!-- ELSE --><select id="template_id" name="template_id">{S_TEMPLATE_OPTIONS}</select><!-- ENDIF --></dd>
    474474                </dl>
    475475                <dl>
    476476                        <dt><label for="theme_id">{L_STYLE_THEME}:</label></dt>
    477                         <dd><!-- IF S_INSTALL --><b id="theme_id">{THEME_NAME}</b><!-- ELSE --><select id="theme_id" name="theme_id">{S_THEME_OPTIONS}</select><!-- ENDIF --></dd>
     477                        <dd><!-- IF S_INSTALL --><strong id="theme_id">{THEME_NAME}</strong><!-- ELSE --><select id="theme_id" name="theme_id">{S_THEME_OPTIONS}</select><!-- ENDIF --></dd>
    478478                </dl>
    479479                <dl>
    480480                        <dt><label for="imageset_id">{L_STYLE_IMAGESET}:</label></dt>
    481                         <dd><!-- IF S_INSTALL --><b id="imageset_id">{IMAGESET_NAME}</b><!-- ELSE --><select id="imageset_id" name="imageset_id">{S_IMAGESET_OPTIONS}</select><!-- ENDIF --></dd>
     481                        <dd><!-- IF S_INSTALL --><strong id="imageset_id">{IMAGESET_NAME}</strong><!-- ELSE --><select id="imageset_id" name="imageset_id">{S_IMAGESET_OPTIONS}</select><!-- ENDIF --></dd>
    482482                </dl>
    483483        <!-- ENDIF -->
  • trunk/forum/adm/style/acp_update.html

    r400 r702  
    1111        <!-- IF S_UP_TO_DATE and S_UP_TO_DATE_AUTO -->
    1212                <div class="successbox">
    13                         <p>{L_VERSION_UP_TO_DATE_ACP}</p>
     13                        <p>{L_VERSION_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
    1414                </div>
    1515        <!-- ELSE -->
    1616                <div class="errorbox">
    17                         <p>{L_VERSION_NOT_UP_TO_DATE_ACP}</p>
     17                        <p>{L_VERSION_NOT_UP_TO_DATE_ACP} - <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a></p>
    1818                </div>
    1919        <!-- ENDIF -->
  • trunk/forum/adm/style/acp_users.html

    r400 r702  
    8383
    8484<!-- INCLUDE acp_users_feedback.html -->
     85
     86<!-- ELSEIF S_WARNINGS -->
     87
     88<!-- INCLUDE acp_users_warnings.html -->
    8589
    8690<!-- ELSEIF S_PROFILE -->
     
    132136                        <!-- IF group.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
    133137                                <td><a href="{group.U_EDIT_GROUP}">{group.GROUP_NAME}</a></td>
    134                                 <td><!-- IF group.S_NO_DEFAULT --><a href="{group.U_DEFAULT}">{L_GROUP_DEFAULT}</a><!-- ELSE --><strong>{L_GROUP_DEFAULT}</strong><!-- ENDIF --></td>
    135                                 <td><!-- IF not group.S_SPECIAL_GROUP --><a href="{group.U_DEMOTE_PROMOTE}">{group.L_DEMOTE_PROMOTE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
     138                                <td><!-- IF group.S_IS_MEMBER --><!-- IF group.S_NO_DEFAULT --><a href="{group.U_DEFAULT}">{L_GROUP_DEFAULT}</a><!-- ELSE --><strong>{L_GROUP_DEFAULT}</strong><!-- ENDIF --><!-- ELSEIF not group.S_IS_MEMBER and group.U_APPROVE --><a href="{group.U_APPROVE}">{L_GROUP_APPROVE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
     139                                <td><!-- IF group.S_IS_MEMBER and not group.S_SPECIAL_GROUP --><a href="{group.U_DEMOTE_PROMOTE}">{group.L_DEMOTE_PROMOTE}</a><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
    136140                                <td><a href="{group.U_DELETE}">{L_GROUP_DELETE}</a></td>
    137141                        </tr>
  • trunk/forum/adm/style/acp_users_avatar.html

    r400 r702  
    99        </dl>
    1010        <!-- IF not S_IN_AVATAR_GALLERY -->
    11                 <!-- IF S_CAN_UPLOAD -->
     11                <!-- IF S_UPLOAD_FILE -->
    1212                        <dl>
    1313                                <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt>
    1414                                <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></dd>
    1515                        </dl>
     16                <!-- ENDIF -->
     17                <!-- IF S_REMOTE_UPLOAD -->
    1618                        <dl>
    1719                                <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt>
     
    2628                        <dl>
    2729                                <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
    28                                 <dd><input name="width" type="text" id="width" size="3" value="{USER_AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{USER_AVATAR_HEIGHT}" /> <span>px</span></dd>
     30                                <dd><input name="width" type="text" id="width" size="3" value="{USER_AVATAR_WIDTH}" /> <span>{L_PIXEL} &times; </span> <input type="text" name="height" size="3" value="{USER_AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd>
    2931                        </dl>
    3032                <!-- ENDIF -->
  • trunk/forum/adm/style/acp_users_overview.html

    r400 r702  
    125125                </dl>
    126126        </div>
    127                 <!-- IF not S_OWN_ACCOUNT -->
    128                         <dl>
    129                                 <dt><label for="delete_user">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
    130                                 <dd><input type="checkbox" class="radio" name="delete" value="1" /></dd>
    131                                 <dd><select id="delete_user" name="delete_type"><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
    132                         </dl>
    133                 <!-- ENDIF -->
    134127
    135128        <p class="quick">
     
    142135        </form>
    143136
     137        <!-- IF not S_OWN_ACCOUNT -->
     138        <form id="user_delete" method="post" action="{U_ACTION}">
     139        <fieldset>
     140                <legend>{L_DELETE_USER}</legend>
     141                <dl>
     142                        <dt><label for="delete_type">{L_DELETE_USER}:</label><br /><span>{L_DELETE_USER_EXPLAIN}</span></dt>
     143                        <dd><select id="delete_type" name="delete_type"><option value="retain">{L_RETAIN_POSTS}</option><option value="remove">{L_DELETE_POSTS}</option></select></dd>
     144                </dl>
     145                <p class="quick">
     146                        <input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
     147                        <input type="hidden" name="delete" value="1" />
     148                        {S_FORM_TOKEN}
     149                </p>
     150        </fieldset>
     151        <!-- ENDIF -->
     152        </form>
    144153<!-- ENDIF -->
  • trunk/forum/adm/style/acp_users_signature.html

    r400 r702  
    9494                                </script>
    9595                        </dt>
    96                         <dd style="margin-left: 90px;"><textarea name="signature" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></dd>
     96                        <dd style="margin-left: 90px;"><textarea name="signature" rows="10" cols="60" style="width: 95%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{SIGNATURE}</textarea></dd>
    9797                        <dd style="margin-left: 90px; margin-top: 5px;">
    9898                        <!-- IF S_BBCODE_ALLOWED -->
  • trunk/forum/adm/style/admin.css

    r400 r702  
    7070        font-family: "Trebuchet MS", Helvetica, sans-serif;
    7171        font-size: 1.20em;
    72         text-decoration: none; 
    73         line-height: 1.20em; 
     72        text-decoration: none;
     73        line-height: 1.20em;
    7474        margin-top: 25px;
    7575}
     
    9898}
    9999
    100 .small { 
    101         font-size: 0.85em; 
     100.small {
     101        font-size: 0.85em;
    102102}
    103103
     
    120120.install-body p a {
    121121        font-weight: bold;
     122}
     123
     124/* List items */
     125ul, ol {
     126        list-style-position: inside;
     127        margin-left: 1em;
     128}
     129
     130li {
     131        display: list-item;
     132        list-style-type: inherit;
    122133}
    123134
     
    192203}
    193204
    194 * html #main { 
    195         height: 350px; 
     205* html #main {
     206        height: 350px;
    196207}
    197208
     
    305316}
    306317
    307 span.corners-top, span.corners-bottom, 
     318span.corners-top, span.corners-bottom,
    308319span.corners-top span, span.corners-bottom span {
    309320        font-size: 1px;
     
    784795fieldset.quick, p.quick {
    785796        margin: 0 0 5px;
    786         padding: 5px 0 0; 
     797        padding: 5px 0 0;
    787798        border: none;
    788799        background-color: transparent;
     
    837848
    838849/* Special case inputs */
    839 select#board_timezone, 
     850select#board_timezone,
    840851select#full_folder_action {
    841852        width: 95%;
     
    12341245
    12351246/* Nice method for clearing floated blocks without having to insert any extra markup
    1236         From http://www.positioniseverything.net/easyclearing.html 
     1247        From http://www.positioniseverything.net/easyclearing.html
    12371248.clearfix:after, #tabs:after, .row:after, #content:after, fieldset dl:after, #page-body:after {
    1238         content: "."; 
    1239         display: block; 
    1240         height: 0; 
    1241         clear: both; 
     1249        content: ".";
     1250        display: block;
     1251        height: 0;
     1252        clear: both;
    12421253        visibility: hidden;
    12431254}*/
     
    13061317}
    13071318
    1308 /* Permission sections */ 
     1319/* Permission sections */
    13091320fieldset.permissions .permissions-simple {
    13101321        text-align: left;
     
    15171528}
    15181529
    1519 .permissions-panel span.corners-top, .permissions-panel span.corners-bottom, 
     1530.permissions-panel span.corners-top, .permissions-panel span.corners-bottom,
    15201531.permissions-panel span.corners-top span, .permissions-panel span.corners-bottom span {
    15211532        font-size: 1px;
     
    15951606
    15961607.permissions-panel th.row4 {
    1597         background-image: none; 
     1608        background-image: none;
    15981609        background-color: #E4E8EB;
    15991610        color: #536482;
     
    16031614.permissions-panel th a:link, .permissions-panel th a:hover, .permissions-panel th a:visited {
    16041615        display: block;
    1605         color: #FFFFFF; 
    1606         text-decoration: underline; 
     1616        color: #FFFFFF;
     1617        text-decoration: underline;
    16071618}
    16081619
  • trunk/forum/adm/style/editor.js

    r400 r702  
    1717
    1818var baseHeight;
    19 window.onload = initInsertions;
    2019
    2120/**
     
    260259function mozWrap(txtarea, open, close)
    261260{
    262         var selLength = txtarea.textLength;
     261        var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
    263262        var selStart = txtarea.selectionStart;
    264263        var selEnd = txtarea.selectionEnd;
  • trunk/forum/adm/style/install_footer.html

    r400 r702  
    33                                </div>
    44                        <span class="corners-bottom"><span></span></span>
     5                        <div class="clear"></div>
    56                </div>
    67                </div>
  • trunk/forum/adm/style/install_update.html

    r400 r702  
    193193                <form id="install_update" method="post" action="{U_UPDATE_ACTION}">
    194194
    195                 <!-- IF .files -->
    196                         <!-- BEGIN files -->
    197                                 <!-- IF files.S_STATUS -->
    198                                         <!-- IF not files.S_FIRST_ROW -->
    199                                                 </fieldset></div>
     195                <!-- IF .up_to_date -->
     196                        <h2>{L_FILES_UP_TO_DATE}</h2>
     197                        <p>{L_FILES_UP_TO_DATE_EXPLAIN}</p>
     198
     199                        <fieldset>
     200                                <legend><img src="{T_IMAGE_PATH}file_up_to_date.gif" alt="{L_STATUS_UP_TO_DATE}" /></legend>
     201                        <!-- BEGIN up_to_date -->
     202                                <dl>
     203                                        <dd class="full" style="text-align: left;"><strong>{up_to_date.FILENAME}</strong></dd>
     204                                </dl>
     205                        <!-- END up_to_date -->
     206                        </fieldset>
     207
     208                <!-- ENDIF -->
     209
     210                <!-- IF .new -->
     211                        <h2>{L_FILES_NEW}</h2>
     212                        <p>{L_FILES_NEW_EXPLAIN}</p>
     213
     214                        <fieldset>
     215                                <legend><img src="{T_IMAGE_PATH}file_new.gif" alt="{L_STATUS_NEW}" /></legend>
     216                        <!-- BEGIN new -->
     217                                <dl>
     218                                        <dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong>
     219                                        <!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
     220                                </dt>
     221                                <dd style="margin-left: 60%;">
     222                                        <!-- IF not new.S_BINARY -->[<a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
     223                                </dd>
     224                                <!-- IF new.S_CUSTOM -->
     225                                        <dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
     226                                <!-- ENDIF -->
     227                                </dl>
     228                        <!-- END new -->
     229                        </fieldset>
     230
     231                <!-- ENDIF -->
     232
     233                <!-- IF .not_modified -->
     234                        <h2>{L_FILES_NOT_MODIFIED}</h2>
     235                        <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="dE('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
     236                        <p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p>
     237
     238                        <fieldset id="not_modified" style="display: none;">
     239                                <legend><img src="{T_IMAGE_PATH}file_not_modified.gif" alt="{L_STATUS_NOT_MODIFIED}" /></legend>
     240                        <!-- BEGIN not_modified -->
     241                                <dl>
     242                                        <dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong>
     243                                                <!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
     244                                        </dt>
     245                                        <dd style="margin-left: 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
     246                                        <!-- IF not_modified.S_CUSTOM -->
     247                                                <dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
    200248                                        <!-- ENDIF -->
    201 
    202                                         <h2>{files.TITLE}</h2>
    203 
    204                                         <!-- IF files.STATUS eq 'not_modified' --><div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="dE('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div><!-- ENDIF -->
    205                                         <p>{files.EXPLAIN}</p>
    206 
    207                                         <div style="display: <!-- IF files.STATUS neq 'not_modified' -->block<!-- ELSE -->none<!-- ENDIF -->;" id="{files.STATUS}">
    208 
    209                                         <fieldset>
    210                                                 <legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
     249                                </dl>
     250                        <!-- END not_modified -->
     251                        </fieldset>
     252
     253                <!-- ENDIF -->
     254
     255                <!-- IF .modified -->
     256                        <h2>{L_FILES_MODIFIED}</h2>
     257                        <p>{L_FILES_MODIFIED_EXPLAIN}</p>
     258
     259                        <!-- BEGIN modified -->
     260                        <fieldset>
     261                                <legend><img src="{T_IMAGE_PATH}file_modified.gif" alt="{L_STATUS_MODIFIED}" /></legend>
     262                                <dl>
     263                                        <dt style="width: 60%;"><strong><!-- IF modified.DIR_PART -->{modified.DIR_PART}<br /><!-- ENDIF -->{modified.FILE_PART}</strong>
     264                                        <!-- IF modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
     265                                </dt>
     266                                <dd style="margin-left: 60%;">&nbsp;</dd>
     267                                <!-- IF modified.S_CUSTOM -->
     268                                        <dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
     269                                <!-- ENDIF -->
     270                                </dl>
     271                                <dl>
     272                                        <dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="0" checked="checked" /> {L_MERGE_MODIFICATIONS_OPTION}</label></dt>
     273                                        <dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
     274                                </dl>
     275                                <dl>
     276                                        <dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
     277                                        <dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE -->&nbsp;<!-- ENDIF --></dd>
     278                                </dl>
     279                                <dl>
     280                                        <dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{modified.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
     281                                        <dd style="margin-left: 60%;"><!-- IF not modified.S_BINARY -->[<a href="{modified.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE -->&nbsp;<!-- ENDIF --></dd>
     282                                </dl>
     283                        </fieldset>
     284                        <!-- END modified -->
     285
     286                <!-- ENDIF -->
     287
     288                <!-- IF .new_conflict -->
     289                        <h2>{L_FILES_NEW_CONFLICT}</h2>
     290                        <p>{L_FILES_NEW_CONFLICT_EXPLAIN}</p>
     291
     292                        <fieldset>
     293                                <legend><img src="{T_IMAGE_PATH}file_new_conflict.gif" alt="{L_STATUS_NEW_CONFLICT}" /></legend>
     294                        <!-- BEGIN new_conflict -->
     295                                <dl>
     296                                        <dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong>
     297                                        <!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
     298                                </dt>
     299                                <dd style="margin-left: 60%;">
     300                                        <!-- IF not new_conflict.S_BINARY -->[<a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
     301                                </dd>
     302                                <!-- IF new_conflict.S_CUSTOM -->
     303                                        <dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
     304                                <!-- ENDIF -->
     305                                </dl>
     306                        <!-- END new_conflict -->
     307                        </fieldset>
     308
     309                <!-- ENDIF -->
     310
     311                <!-- IF .conflict -->
     312                        <h2>{L_FILES_CONFLICT}</h2>
     313                        <p>{L_FILES_CONFLICT_EXPLAIN}</p>
     314
     315                        <!-- BEGIN conflict -->
     316                        <fieldset>
     317                                <legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend>
     318                                <dl>
     319                                        <dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong>
     320                                                <!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}: </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
     321                                                <!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}: {conflict.NUM_CONFLICTS}</span><!-- ENDIF -->
     322                                        </dt>
     323                                        <dd style="margin-left: 60%;">
     324                                                <!-- IF not conflict.S_BINARY -->[<a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a>]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN}
     325                                                <!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
     326                                        </dd>
     327                                        <!-- IF conflict.S_CUSTOM -->
     328                                                <dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
     329                                        <!-- ENDIF -->
     330                                </dl>
     331                                <!-- IF conflict.S_BINARY -->
     332                                        <dl>
     333                                                <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
     334                                                <dd style="margin-left: 60%;">&nbsp;</dd>
     335                                        </dl>
    211336                                <!-- ELSE -->
    212337                                        <dl>
    213                                                 <!-- IF files.STATUS eq 'up_to_date' -->
    214                                                         <dd class="full" style="text-align: left;"><strong>{files.FILENAME}</strong></dd>
    215                                                 <!-- ELSE -->
    216                                                         <dt style="width: 60%;">
    217                                                                 <strong><!-- IF files.DIR_PART -->{files.DIR_PART}<br /><!-- ENDIF -->{files.FILE_PART}</strong>
    218                                                                 <!-- IF files.S_CUSTOM -->
    219                                                                 <br /><span><em>{L_FILE_USED}: </em>{files.CUSTOM_ORIGINAL}</span>
    220                                                                 <!-- ENDIF -->
    221                                                                 <!-- IF files.NUM_CONFLICTS -->
    222                                                                 <br /><span>{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS}</span>
    223                                                                 <!-- ENDIF -->
    224                                                         </dt>
    225                                                         <dd style="margin-left: 60%;"><!-- IF files.STATUS eq 'modified' -->&nbsp;<!-- ELSE --><!-- IF not files.S_BINARY -->[ <a href="{files.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{files.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --><!-- ENDIF --></dd>
    226                                                         <!-- IF files.S_CUSTOM -->
    227                                                                 <dd style="margin-left: 60%;"><label><input type="checkbox" name="no_update[]" value="{files.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
    228                                                         <!-- ENDIF -->
    229 
    230                                                         <!-- IF files.STATUS eq 'modified' -->
    231                                                         </dl>
    232                                                         <dl>
    233                                                                 <dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{files.FILENAME}]" value="0" checked="checked" /> {L_MERGE_MODIFICATIONS_OPTION}</label></dt>
    234                                                                 <dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[ <a href="{files.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{files.L_SHOW_DIFF}</a> ]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
    235                                                         </dl>
    236                                                         <dl>
    237                                                                 <dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{files.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
    238                                                                 <dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[<a href="{files.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE -->&nbsp;<!-- ENDIF --></dd>
    239                                                         </dl>
    240                                                         <dl>
    241                                                                 <dt style="width: 60%"><label><input type="radio" class="radio" name="modified[{files.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
    242                                                                 <dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[<a href="{files.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE -->&nbsp;<!-- ENDIF --></dd>
    243                                                         </dl>
    244                                                         <!-- IF not files.S_LAST_ROW -->
    245                                                         </fieldset>
    246 
    247                                                         <fieldset>
    248                                                                 <legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
    249                                                         <!-- ENDIF -->
    250 
    251                                                         <!-- ENDIF -->
    252 
    253                                                         <!-- IF files.STATUS eq 'conflict' -->
    254                                                         </dl>
    255                                                         <dl>
    256                                                                 <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
    257                                                                 <dd style="margin-left: 60%;"><!-- IF not files.S_BINARY -->[<a href="{files.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]<!-- ELSE -->&nbsp;<!-- ENDIF --></dd>
    258                                                         </dl>
    259                                                                 <!-- IF not files.S_BINARY -->
    260                                                                         <dl>
    261                                                                                 <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="3" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
    262                                                                                 <dd style="margin-left: 60%;">[<a href="{files.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
    263                                                                         </dl>
    264                                                                         <dl>
    265                                                                                 <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{files.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
    266                                                                                 <dd style="margin-left: 60%;">[<a href="{files.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
    267                                                                         </dl>
    268                                                                 <!-- ENDIF -->
    269                                                         <!-- IF not files.S_LAST_ROW -->
    270                                                         </fieldset>
    271 
    272                                                         <fieldset>
    273                                                                 <legend><img src="{T_IMAGE_PATH}file_{files.STATUS}.gif" alt="{files.L_STATUS}" /></legend>
    274                                                         <!-- ENDIF -->
    275 
    276                                                         <!-- ENDIF -->
    277                                                 <!-- ENDIF -->
    278                                         <!-- IF files.STATUS neq 'conflict' and files.STATUS neq 'modified' --></dl><!-- ENDIF -->
     338                                                <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
     339                                                <dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
     340                                        </dl>
     341                                        <dl>
     342                                                <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
     343                                                <dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
     344                                        </dl>
     345                                        <dl>
     346                                                <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
     347                                                <dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
     348                                        </dl>
     349                                        <dl>
     350                                                <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
     351                                                <dd style="margin-left: 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
     352                                        </dl>
    279353                                <!-- ENDIF -->
    280                         <!-- END files -->
    281 
    282                         </fieldset></div>
     354                        </fieldset>
     355                        <!-- END conflict -->
     356
    283357                <!-- ENDIF -->
    284358
     
    321395        <fieldset class="submit-buttons">
    322396                {S_HIDDEN_FIELDS}
    323                 <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" />
     397                <input type="submit" class="button2" value="{L_CONTINUE_UPDATE}" name="check_again" />&nbsp; &nbsp;<input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" />
    324398        </fieldset>
    325399
     
    372446                        <p>{L_CONNECTION_FAILED}<br />{ERROR_MSG}</p>
    373447                </div>
    374 
    375448        <!-- ENDIF -->
    376449
  • trunk/forum/adm/style/install_update_diff.html

    r400 r702  
    1616function resize_panel()
    1717{
    18         var block = document.getElementById('codepanel');       
     18        var block = document.getElementById('codepanel');
    1919        var height;
    20        
     20
    2121        if (window.innerHeight)
    2222        {
     
    2727        {
    2828                //whatever IE needs to do this
    29         }       
    30 }
     29        }
     30}
     31
     32window.onresize = resize_panel;
     33
    3134// ]]>
    3235</script>
     
    4952<!-- IF DIFF_MODE neq 'side_by_side' and DIFF_MODE neq 'raw' -->
    5053div#codepanel {
    51         overflow: auto;
    5254        width: 100%;
    53         height: 350px;
    54         display: inline-block;
    5555}
    5656<!-- ELSE -->
    57 div#codepanel { 
     57div#codepanel {
    5858        background-color: #eee;
     59}
     60<!-- ENDIF -->
     61
     62<!-- IF DIFF_MODE neq 'unified' and DIFF_MODE neq 'side_by_side'  -->
     63div#diff_content pre {
     64        overflow: auto;
     65        height: 414px;
     66        width: 100% !important;
    5967}
    6068<!-- ENDIF -->
     
    6674.file {
    6775        line-height: .7em;
     76        overflow: auto;
     77        height: 414px;
    6878}
    6979
     
    140150table.hrdiff tbody td.old {
    141151        border-left: 1px solid #999;
    142         border-right: 1px solid #999;   
     152        border-right: 1px solid #999;
    143153}
    144154table.hrdiff tbody td.new {
    145         border-right: 1px solid #999;   
     155        border-right: 1px solid #999;
    146156}
    147157
     
    204214</head>
    205215
    206 
    207216<!-- IF DIFF_MODE neq 'side_by_side' and DIFF_MODE neq 'raw' -->
    208 <body onresize="resize_panel();" onload="resize_panel();">
     217<body onload="resize_panel();">
    209218<!-- ELSE -->
    210219<body>
     
    221230<!-- IF not S_DIFF_NEW_FILE -->
    222231                <p id="skip"><a href="#acp">{L_SKIP}</a></p>
    223                 <form method="post">
     232                <form method="post" action="">
    224233                <fieldset class="quick">
    225234                        <label for="diff_mode">{L_SELECT_DIFF_MODE}:</label>
     
    230239                </form>
    231240<!-- ENDIF -->
     241<!-- IF S_DIFF_CONFLICT_FILE -->
     242                <div style="float: {S_CONTENT_FLOW_BEGIN};"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div>
     243                <br style="clear: both;" />
     244<!-- ENDIF -->
    232245        </div>
    233        
     246
    234247        <div id="page-body">
    235248                <div id="acp">
     
    238251                                <div id="diff_content">
    239252                                        <div id="main">
    240 
    241 <!-- IF S_DIFF_CONFLICT_FILE -->
    242                 <div style="float: {S_CONTENT_FLOW_END};"><strong>{L_NUM_CONFLICTS}: {NUM_CONFLICTS}</strong></div>
    243 <!-- ENDIF -->
    244253                                                {DIFF_CONTENT}
    245254                                        </div>
     
    249258                </div>
    250259        </div>
    251        
     260
    252261
    253262<!-- INCLUDE simple_footer.html -->
  • trunk/forum/adm/style/overall_footer.html

    r400 r702  
    33                                </div>
    44                        <span class="corners-bottom"><span></span></span>
     5                        <div class="clear"></div>
    56                </div>
    67                </div>
  • trunk/forum/adm/style/overall_header.html

    r400 r702  
    2929        var page = prompt(jump_page, on_page);
    3030
    31         if (page !== null && !isNaN(page) && page > 0) 
    32         {
    33                 document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
     31        if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
     32        {
     33                if (base_url.indexOf('?') == -1)
     34                {
     35                        document.location.href = base_url + '?start=' + ((page - 1) * per_page);
     36                }
     37                else
     38                {
     39                        document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
     40                }
    3441        }
    3542}
     
    188195                                                <p>{L_LOGGED_IN_AS}<br /><strong>{USERNAME}</strong> [&nbsp;<a href="{U_LOGOUT}">{L_LOGOUT}</a>&nbsp;][&nbsp;<a href="{U_ADM_LOGOUT}">{L_ADM_LOGOUT}</a>&nbsp;]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
    189196                                                <ul>
     197                                                <!-- DEFINE $LI_USED = 0 -->
    190198                                                <!-- BEGIN l_block1 -->
    191199                                                        <!-- IF l_block1.S_SELECTED -->
     
    194202                                                        <!-- IF .l_block1.l_block2.l_block3 -->
    195203                                                        <li class="header">{l_block1.l_block2.L_TITLE}</li>
     204                                                        <!-- DEFINE $LI_USED = 1 -->
    196205                                                        <!-- ENDIF -->
    197206       
    198207                                                        <!-- BEGIN l_block3 -->
    199208                                                                <li<!-- IF l_block1.l_block2.l_block3.S_SELECTED --> id="activemenu"<!-- ENDIF -->><a href="{l_block1.l_block2.l_block3.U_TITLE}"><span>{l_block1.l_block2.l_block3.L_TITLE}</span></a></li>
     209                                                                <!-- DEFINE $LI_USED = 1 -->
    200210                                                        <!-- END l_block3 -->
    201211                                                <!-- END l_block2 -->
     
    203213                                                        <!-- ENDIF -->
    204214                                                <!-- END l_block1 -->
     215                                                <!-- IF not $LI_USED -->
     216                                                        <li></li>
     217                                                <!-- ENDIF -->
    205218                                                </ul>
    206219                                        </div>
  • trunk/forum/adm/style/simple_header.html

    r400 r702  
    4040        var page = prompt(jump_page, on_page);
    4141
    42         if (page !== null && !isNaN(page) && page > 0) 
     42        if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
    4343        {
    44                 document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
     44                if (base_url.indexOf('?') == -1)
     45                {
     46                        document.location.href = base_url + '?start=' + ((page - 1) * per_page);
     47                }
     48                else
     49                {
     50                        document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
     51                }
    4552        }
    4653}
  • trunk/forum/common.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: common.php 8760 2008-08-15 19:46:51Z aptx $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2020$starttime = $starttime[1] + $starttime[0];
    2121
    22 // Report all errors, except notices
    23 error_reporting(E_ALL ^ E_NOTICE);
     22// Report all errors, except notices and deprecation messages
     23if (!defined('E_DEPRECATED'))
     24{
     25        define('E_DEPRECATED', 8192);
     26}
     27error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
    2428
    2529/*
     
    173177
    174178// Load Extensions
    175 if (!empty($load_extensions))
     179// dl() is deprecated and disabled by default as of PHP 5.3.
     180if (!empty($load_extensions) && function_exists('dl'))
    176181{
    177182        $load_extensions = explode(',', $load_extensions);
  • trunk/forum/docs/AUTHORS

    r400 r702  
    2121involved in phpBB.
    2222
    23 phpBB Lead Developer  : Acyd Burn (Meik Sievertsen)
     23phpBB Lead Developer:  naderman (Nils Adermann)
    2424
    25 phpBB Developers      : APTX (Marek A. R.)
    26                         DavidMJ (David M.)
    27                         dhn (Dominik Dröscher)
    28                         kellanved (Henry Sudhof)
    29                         naderman (Nils Adermann)
    30                         ToonArmy (Chris Smith)
    31                         Vic D'Elfant (Vic D'Elfant)
     25phpBB Developers:      A_Jelly_Doughnut (Josh Woody)
     26                       Acyd Burn (Meik Sievertsen) [Lead 09/2005 - 01/2010]
     27                       APTX (Marek A. R.)
     28                       bantu (Andreas Fischer)
     29                       DavidMJ (David M.)
     30                       dhn (Dominik Dröscher)
     31                       kellanved (Henry Sudhof)
     32                       Terrafrost (Jim Wigginton)
     33                       ToonArmy (Chris Smith)
     34
     35Contributions by:      Brainy (Cullen Walsh)
     36                       leviatan21 (Gabriel Vazquez)
     37                       nickvergessen (Joas Schilling)
     38                       Raimon (Raimon Meuldijk)
     39                       rxu (Ruslan Uzdenov)
     40                       Xore (Robert Hetzler)
    3241
    3342
    34 -- Previous Contributors --
     43-- Former Contributors --
    3544
    36 phpBB Project Manager : theFinn (James Atkinson) [Founder - 04/2007]
    37                         SHS` (Jonathan Stanley)
     45phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007]
     46                       SHS` (Jonathan Stanley)
    3847
    39 phpBB Lead Developer  : psoTFX (Paul S. Owen) [2001 - 09/2005]
     48phpBB Lead Developer: psoTFX (Paul S. Owen) [2001 - 09/2005]
    4049
    41 phpBB Developers      : Ashe (Ludovic Arnaud)   [10/2002 - 11/2003, 06/2006 - 10/2006]
    42                         BartVB (Bart van Bragt) [11/2000 - 03/2006]
    43                         GrahamJE (Graham Eames) [09/2005 - 11/2006]
    44 
     50phpBB Developers:      Ashe (Ludovic Arnaud)       [10/2002 - 11/2003, 06/2006 - 10/2006]
     51                       BartVB (Bart van Bragt)    [11/2000 - 03/2006]
     52                       GrahamJE (Graham Eames)    [09/2005 - 11/2006]
     53                       Vic D'Elfant (Vic D'Elfant) [04/2007 - 04/2009]
    4554
    4655-- Copyrights --
    4756
    48 Visual Confirmation   : Xore (Robert Hetzler)
     57Visual Confirmation Xore (Robert Hetzler)
    4958
    5059Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group
  • trunk/forum/docs/CHANGELOG.html

    r400 r702  
    5454        <li><a href="#changelog">Changelog</a>
    5555        <ol style="list-style-type: lower-roman;">
     56                <li><a href="#v307">Changes since 3.0.7</a></li>
     57                <li><a href="#v306">Changes since 3.0.6</a></li>
     58                <li><a href="#v305">Changes since 3.0.5</a></li>
     59                <li><a href="#v304">Changes since 3.0.4</a></li>
    5660                <li><a href="#v303">Changes since 3.0.3</a></li>
    5761                <li><a href="#v302">Changes since 3.0.2</a></li>
     
    8488
    8589                <div class="content">
    86         <a name="v303"></a><h3>1.i. Changes since 3.0.3</h3>
     90
     91        <a name="v307"></a><h3>1.i. Changes since 3.0.7</h3>
     92
     93        <ul>
     94                <li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li>
     95        </ul>
     96
     97        <a name="v306"></a><h3>1.ii. Changes since 3.0.6</h3>
     98
     99        <ul>
     100                <li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li>
     101                <li>[Fix] Force full date for board online record date.</li>
     102                <li>[Fix] Correctly reset login keys if passed value is the current user. (Bug #54125)</li>
     103                <li>[Fix] Correctly set last modified headers. (Bug #54245, thanks Paul.J.Murphy)</li>
     104                <li>[Fix] Show correct HTML title when reporting private messages. (Bug #54375)</li>
     105                <li>[Fix] Correctly exclude subforums from ATOM Feeds. (Bug #54285)</li>
     106                <li>[Fix] Do not link to user profile in ATOM feed entry if post has been made by the guest user. (Bug #54275)</li>
     107                <li>[Fix] Make word censoring case insensitive. (Bug #54265)</li>
     108                <li>[Fix] Fulltext-MySQL search for keywords and username at the same time. (Bug #54325)</li>
     109                <li>[Fix] Various XHTML and CSS mistakes in prosilver and subsilver2. (Bugs #54705, #55895, #57505, #57875 - Patch by HardStyle)</li>
     110                <li>[Fix] Correctly show topic ATOM feed link when only post id is specified. (Bug #53025)</li>
     111                <li>[Fix] Cleanly handle forum/topic not found in ATOM Feeds. (Bug #54295)</li>
     112                <li>[Fix] PHP 5.3 compatibility: Check if function dl() exists before calling it. (Bug #54665)</li>
     113                <li>[Fix] PHP 5.3 compatibility: Disable E_DEPRECATED on startup to keep set_magic_quotes_runtime(0) quiet. (Bug #54495)</li>
     114                <li>[Fix] Correctly replace table prefix before inserting schema data into the database. (Bug #54815)</li>
     115                <li>[Fix] Correctly take post time instead of topic time for the overall forum feed statistics row. (Bug #55005)</li>
     116                <li>[Fix] Posting errors with CAPTCHAs using user::add_lang(). (Bug #55245)</li>
     117                <li>[Fix] Use memcache::replace() instead of memcache::set() for existing keys to prevent problems.</li>
     118                <li>[Fix] Check for required functions in eAccelerator. (Bug #54465)</li>
     119                <li>[Fix] Use correct RFC 3339 date format in ATOM feed. (Bug #55005)</li>
     120                <li>[Fix] Do not deliver topics from unreadable or passworded forums in the news feed. (Bug #54345)</li>
     121                <li>[Fix] Restore user language choice to compiled stylesheets. (Bug #54035)</li>
     122                <li>[Fix] Add missing language entries. (Bug #55095)</li>
     123                <li>[Fix] Do not permit unauthorised users to delete private messages from folder listing. (Bug #54355)</li>
     124                <li>[Fix] Correctly check for empty strings in custom profile fields. (Bug #55335)</li>
     125                <li>[Fix] Use correct options to parse BBCodes in signatures when previewing PMs.</li>
     126                <li>[Fix] Correct rendering of prosilver quick reply under IE6. (Bug #54115 - Patch by Raimon)</li>
     127                <li>[Fix] Correct wording for &quot;How do I show an image below my username&quot; question answer in FAQ. (Bug #23935)</li>
     128                <li>[Fix] Handle export of private messages where all recipients were deleted. (Bug #50985)</li>
     129                <li>[Fix] Correctly get unread status information for global announcements in search results.</li>
     130                <li>[Fix] Correctly handle global announcements in ATOM feeds.</li>
     131                <li>[Fix] Use correct limit config parameter in the News feed.</li>
     132                <li>[Fix] Restrict search for styles/../style.cfg to folders. (Bug #55665)</li>
     133                <li>[Fix] Add ability to disable overall (aka board-wide) feed.</li>
     134                <li>[Fix] Do not pass new_link parameter when creating a persistent connection with mysql. (Bug #55785)</li>
     135                <li>[Fix] Improved search query performance through sorting words by their occurance. (Bug #21555)</li>
     136                <li>[Fix] Correctly move sql_row_pointer forward when calling sql_fetchfield() on cached queries. (Bug #55865)</li>
     137                <li>[Fix] Remove item limit from &quot;All forums&quot; feed.</li>
     138                <li>[Fix] Do not use group colours for usernames on print view. (Bug #30315 - Patch by Pasqualle)</li>
     139                <li>[Fix] Pagination of User Notes in MCP uses two different config values. (Bug #56025)</li>
     140                <li>[Fix] List hidden groups on viewprofile where the viewing user is also a member. (Bug #31845)</li>
     141                <li>[Fix] Sort viewprofile group list by group name.</li>
     142                <li>[Fix] Strictly check whether a moderator can post in the destination forum when moving topic. (Bug #56255)</li>
     143                <li>[Fix] Added some error handling to the compress class.</li>
     144                <li>[Fix] Correctly determine permissions to show quick reply button. (Bug #56555)</li>
     145                <li>[Fix] Do not unsubscribe users from topics replying with quickreply. (Bug #56235)</li>
     146                <li>[Fix] Don't submit when pressing enter on preview button. (Bug #54395)</li>
     147                <li>[Fix] Load reCAPTCHA over https when using a secure connection to the board. (Bug #55755)</li>
     148                <li>[Fix] Clarify explanation of bump feature setting. (Bug #56075)</li>
     149                <li>[Fix] Properly paginate unapproved posts in the MCP. (Bug #56285)</li>
     150                <li>[Fix] Do not duplicate previous/next links in pagination text of moderator logs and user notes in MCP for subsilver2. (Bug #55045)</li>
     151                <li>[Fix] Do not automatically unsubscribe users from topics, when email and jabber is disabled.</li>
     152                <li>[Fix] Don't send activation email when user tries to change email without permission. (Bug #56335 - Fix by nrohler)</li>
     153                <li>[Fix] Replace hard coded &quot;px&quot; with translated language-string. (Bug #52495)</li>
     154                <li>[Fix] Correctly hover list menu in UCP and MCP for RTL languages. (Bug #49945)</li>
     155                <li>[Fix] Correctly orientate quoted text image on RTL languages. (Bug #33745)</li>
     156                <li>[Fix] Deprecate $allow_reply parameter to truncate_string() (Bug #56675)</li>
     157                <li>[Fix] Fall back to default language email template if specified file does not exist. (Bug #35595)</li>
     158                <li>[Fix] Update users last visit field correctly when changing activation status. (Bug #56185)</li>
     159                <li>[Fix] Database updater now separates ADD COLUMN from SET NOT NULL and SET DEFAULT, when using PostgreSQL &lt;= 7.4 (Bug #54435)</li>
     160                <li>[Fix] Styles adjustment to correctly display an order of rtl/ltr mixed content. (Bugs #55485, #55545)</li>
     161                <li>[Fix] Fix language string for PM-Reports refering to post-data. (Bug #54745)</li>
     162                <li>[Fix] Do not store email templates in database. (Bug #54505)</li>
     163                <li>[Fix] Fix javascript bug in the smilies ACP. (Bug #55725)</li>
     164                <li>[Fix] Unify BBCode Selection across browsers. (Bug #38765)</li>
     165                <li>[Fix] Allow convertors to read in configuration from files. (Bug #57265 - Patch by Dicky)</li>
     166                <li>[Fix] Fix problems with firebird by no longer using 'count' as a column alias. (Bug #57455)</li>
     167                <li>[Fix] Small language correction for the FAQ page. (Bug #57825)</li>
     168                <li>[Fix] Restrict search for language/../iso.txt to folders. (Bug #57795)</li>
     169                <li>[Fix] Make user_email_hash() function independent from system's architecture. (Bug #57755)</li>
     170                <li>[Fix] Correct behavior of &quot;force_approved_state&quot; when value is false. (Bug #57715)</li>
     171                <li>[Fix] Global announcements could not be accessed on a board using Firebird as the database server. (Bug #57525)</li>
     172                <li>[Fix] BBCode parser now uses the user object for all settings rather than taking some from the template object (Bug #57365)</li>
     173                <li>[Fix] Ensure a database connection is available before logging general errors. (Bug #57975)</li>
     174                <li>[Fix] Do not delete unrelated attachments when deleting empty forums. (Bug #57375)</li>
     175                <li>[Fix] Update: Store expected resulting file contents in cache and do not suggest further merges if the contents match, also fixes infinite merge loop (Bug #54075)</li>
     176                <li>[Change] Move redirect into a hidden field to avoid issues with mod_security. (Bug #54145)</li>
     177                <li>[Change] Log activation through inactive users ACP. (Bug #30145)</li>
     178                <li>[Change] Send time of last item instead of current time in ATOM Feeds. (Bug #53305)</li>
     179                <li>[Change] Use em dash instead of hyphen/minus as separator in ATOM Feeds item statistics. (Bug #53565)</li>
     180                <li>[Change] Alter ACP user quick tools interface to reduce confusion with the delete operation.</li>
     181                <li>[Change] Send statistics now check for IPv6 and send private network status as a boolean.</li>
     182                <li>[Change] Split &quot;All topics&quot; feed into &quot;New Topics&quot; and &quot;Active Topics&quot; feeds.</li>
     183                <li>[Change] Forum feed no longer includes posts of subforums.</li>
     184                <li>[Change] Show login attempt CAPTCHA option in the captcha plugin module.</li>
     185                <li>[Change] It is no longer possible to persist a solution for the login CAPTCHA.</li>
     186                <li>[Change] SQLite is no longer autoloaded by the installer. (Bug #56105)</li>
     187                <li>[Change] Friends and foes will not show up as private message rule options if their respective UCP modules are disabled. (Bug #51155)</li>
     188                <li>[Change] Offer for guests to log in for egosearch and unreadposts search before the search permissions check. (Bug #51585)</li>
     189                <li>[Change] Show warning box for users of PHP &lt; 5.2.0 about phpBB ending support.</li>
     190                <li>[Change] Disallow deleting the last question of the Q&amp;A CAPTCHA.</li>
     191                <li>[Change] Tweak Q&amp;A CAPTCHA garbage collection.</li>
     192                <li>[Change] Show a proper preview for the Q&amp;A CAPTCHA. (Bug #56365)</li>
     193                <li>[Change] Speed up topic move operation by adding an index for topic_id on the topics track table. (Bug #56545)</li>
     194                <li>[Change] Warn users about potentially dangerous BBcodes.</li>
     195                <li>[Feature] Ability to use HTTP authentication in ATOM feeds by passing the GET parameter &quot;auth=http&quot;.</li>
     196                <li>[Feature] Add INTTEXT token type to custom bbcodes to allow non-ASCII letters in html attributes.</li>
     197                <li>[Feature] Add ability to enable quick reply in all forums.</li>
     198
     199        </ul>
     200
     201        <a name="v305"></a><h3>1.ii. Changes since 3.0.5</h3>
     202
     203        <ul>
     204                <li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
     205                <li>[Fix] Sorting by author or subject on viewtopic now preserves the order. (Bug #44875)</li>
     206                <li>[Fix] Correctly determine writable status of files on Windows operating systems. (Bug #39035)</li>
     207                <li>[Fix] Show report button in prosilver for guests who are allowed to report posts. (Bug #45695)</li>
     208                <li>[Fix] Correctly show private message history. (Bug #46065)</li>
     209                <li>[Fix] Various XHTML mistakes in prosilver, subsilver2 and the ACP. (Bugs #25545, #26315, #38555, #45505 - Patch by Raimon, #45785, #45865, #47085 - Patch by Raimon)</li>
     210                <li>[Fix] Fix some ACP style issues. (Bug #16109 - Patch by prototech)</li>
     211                <li>[Fix] Move post bump information markup to the template. (Bug #34295)</li>
     212                <li>[Fix] Show error in the ACP when template folder is not readable. (Bug #45705)</li>
     213                <li>[Fix] Adjust viewonline filename regular expression to be less strict. (Bug #46215)</li>
     214                <li>[Fix] Correctly apply the &quot;can change vote&quot; permission again. Regression introduced in r9470. (Bug #45895)</li>
     215                <li>[Fix] Remove data from friend/foe table when deleting user. (Bug #45345)</li>
     216                <li>[Fix] Correctly hide skiplink in prosilver right-to-left mode. (Bug #45765 - Patch by prototech and bantu)</li>
     217                <li>[Fix] Fix dynamic config update routine error if firebird is used. (Bug #46315)</li>
     218                <li>[Fix] Allow friends/foes to be added and removed at the same time. (Bug #46255)</li>
     219                <li>[Fix] Only change topic/post icon on edit if icons are enabled and user is allowed to use icons. (Bug #46355)</li>
     220                <li>[Fix] Fix saving custom profile fields in ACP if Oracle is used. (Bug #46015)</li>
     221                <li>[Fix] Make view_log() more resilient to corrupt serialized data. (Bug #46545)</li>
     222                <li>[Fix] Show error if hostname lookup doesn't return a valid IP address when banning. (Bug #45585)</li>
     223                <li>[Fix] Fix incorrect layout when loading private message draft. (Bug #38435 - Patch by nickvergessen)</li>
     224                <li>[Fix] Show proper error message when trying to add bots to friends/foes list. (Bug #40205)</li>
     225                <li>[Fix] Fixed database backup and restore with Oracle DBMS. (Bug #46715)</li>
     226                <li>[Fix] Update attachments table when deleting user and retaining his posts. (Bug #40245)</li>
     227                <li>[Fix] Correctly detect files in subfolders when viewing cached template files. (Bug #46145)</li>
     228                <li>[Fix] Display user's jabber address in popup if jabber functionality is disabled. (Bug #20775)</li>
     229                <li>[Fix] Correctly exclude forums from active topics list. (Bug #19135)</li>
     230                <li>[Fix] Do not display banned users in birthday list. (Bug #20625)</li>
     231                <li>[Fix] Fix function to recalculate nested sets. (Bug #41555 - Patch by EXreaction)</li>
     232                <li>[Fix] Display but also highlight already used rank images while assigning new ranks. (Bug #22665)</li>
     233                <li>[Fix] Correctly orientate quoted text image on RTL languages. (Bug #33745)</li>
     234                <li>[Fix] Do not display &quot;View user notes&quot; and &quot;Warn user&quot; links in user profile if corresponding MCP modules are disabled. (Bug #10519)</li>
     235                <li>[Fix] Show proper error message when trying to create a private messages folder with an empty name. (Bug #39875)</li>
     236                <li>[Fix] No longer state that it is possible to manage group leaders from the UCP. (Bug #19945)</li>
     237                <li>[Fix] Do not throw an error when PDO is a shared module and not loaded preventing SQLite from being loaded.</li>
     238                <li>[Fix] Fix censoring of unicode words. (Bug #16555)</li>
     239                <li>[Fix] Display coloured usernames in ACP groups management screens.</li>
     240                <li>[Fix] Correctly describe founder permissions on trace-information. (Bug #37235)</li>
     241                <li>[Fix] Correct the width value for poll_center.gif omitted in imageset.cfg for subsilver2. (Bug #43005)</li>
     242                <li>[Fix] Correctly load complex language variable using acp_language. (Bug #45735 - Patch by leviatan21)</li>
     243                <li>[Fix] Fix reapply_sid() to correctly strip session id in certain circumstances. (Bug #43125 - Patch by leviatan21)</li>
     244                <li>[Fix] Correctly state why one language pack is marked with an asterisk in the ACP. (Bug #37565)</li>
     245                <li>[Fix] Correctly check if install directory is still present. (Bug #46965)</li>
     246                <li>[Fix] Correct banned user behaviour when &quot;force password change&quot; is enabled. (Bug #47145 - Patch by nickvergessen and leviatan21)</li>
     247                <li>[Fix] Correctly display ACP logs options, without permission to clear logs. (Bug #24155 - Patch by leviatan21)</li>
     248                <li>[Fix] Display topic icons in MCP forum view again (only prosilver).</li>
     249                <li>[Fix] Properly display post status messages in topic when post is reported and unapproved (Bug #44455 - Patch by leviatan21)</li>
     250                <li>[Fix] Do not remove recipients when loading private message draft. (Bug #38395)</li>
     251                <li>[Fix] Add author name to moderator log when deleting post/topic. (Bug #46225)</li>
     252                <li>[Fix] Fix broken &quot;Report details&quot; link in the MCP. (Bug #46975)</li>
     253                <li>[Fix] Resolve accesskey conflicts in prosilver. (Bug #44685)</li>
     254                <li>[Fix] Check if template file is empty before trying to read from it. (Bug #47345)</li>
     255                <li>[Fix] More descriptive descriptions for permissions to use BBCode, smilies, images and flash. (Bug #36065)</li>
     256                <li>[Fix] Fix style issues in print mode. (Bug #26375 - Patch by leviatan21)</li>
     257                <li>[Fix] Fix minor issue with L_QUOTE language string missing in several PM composing modes. (Bug #39625)</li>
     258                <li>[Fix] Also fetch posts of guests and deleted or deactivated users while searching for author names. (Bug #36565, #47765)</li>
     259                <li>[Fix] Show end of ban in MCP and ACP when user is banned by duration. (Bug #47815 - Patch by Pyramide)</li>
     260                <li>[Fix] Correctly count posts awaiting approval in the MCP. (Bug #47685)</li>
     261                <li>[Fix] Display user's posts count in private message when it is equal to 0 (prosilver). (Bug #40155)</li>
     262                <li>[Fix] Only allow users to disable word censor if globally allowed. (Bug #47575 - Patch by 00mohgta7)</li>
     263                <li>[Fix] Fix database updater and db tools to support multiple column changes/additions/removals with SQLite.</li>
     264                <li>[Fix] Correctly detect GZIP status in debug mode. (Bug #24075)</li>
     265                <li>[Fix] Posting smilies in view more smilies screen now works again in IE. (Bug #46025 - Patch by leviatan21)</li>
     266                <li>[Fix] Properly convert and show filesize information. (Bug #47775)</li>
     267                <li>[Fix] Add ability to prune users who never logged in. (Bug #44295)</li>
     268                <li>[Fix] Show smilies and images in topic print view. (Bug #47265)</li>
     269                <li>[Fix] Force full date in private message print view.</li>
     270                <li>[Fix] Fix &quot;Always show a scrollbar for short pages&quot; for IE8 and Firefox 3.5. (Bug #47865 - Patch by stokerpiller)</li>
     271                <li>[Fix] Do not allow setting group as default group for pending users. (Bug #45675)</li>
     272                <li>[Fix] Fail gracefully if store folder is not writable during update. (Bugs #46615, #46945)</li>
     273                <li>[Fix] Hide profile-icon from viewtopic page if user has no permissions (subsilver2 only). (Bug #37635 - Patch by leviatan21)</li>
     274                <li>[Fix] Correct escaping/unescaping in the LDAP authentication plugin. (Bug #48175)</li>
     275                <li>[Fix] Add hard limit for smilies.</li>
     276                <li>[Fix] Remove redundant SQL query from ucp.php. (Bug #40305)</li>
     277                <li>[Fix] Reorder frame order of animated subsilver2 topic icons to be useful when animations are disabled. (Bug #29385 - Patch by prototech)</li>
     278                <li>[Fix] Ensure user errors are displayed regardless of PHP settings. (Bug #47505)</li>
     279                <li>[Fix] Permit null values for non-required integer custom profile fields and ensure zero complies with the range limits. (Bug #40925)</li>
     280                <li>[Fix] Allow changing forum from select box under certain circumstances. (Bug #37525)</li>
     281                <li>[Fix] Display required fields notice on registration above the custom profile fields. (Bug #39665)</li>
     282                <li>[Fix] Copy poll options properly when copying topic. (Bug #39065)</li>
     283                <li>[Fix] Fix error with disapproval of topics having several queued posts only. (Bug #47705)</li>
     284                <li>[Fix] Preserve newlines in template files (one newline had been always dropped after a template variable due to PHP's handling of closing tags).</li>
     285                <li>[Fix] Be less strict with FTP daemons for getting directory filelists. (Bug #46295)</li>
     286                <li>[Fix] Fix set_custom_template for database-stored styles. (Bug #40515)</li>
     287                <li>[Fix] Banning an already banned user states to be successful, but has no effect. (Bug #47825 - Patch by Pyramide)</li>
     288                <li>[Fix] Do not add style parameter again to URL after admin re-authentification. (Bug #18005 - Patch by leviatan21)</li>
     289                <li>[Fix] Do not cut post-message in between HTML-Entities on search.php. (Bug #31505 - Patch by leviatan21)</li>
     290                <li>[Fix] Correctly set attachment flag for topics, posts and pms after deleting attachments. (Bug #48265 - Patch by MarcoDM and nickvergessen)</li>
     291                <li>[Fix] Display &quot;Locked&quot; button instead of &quot;Reply&quot; one for locked forum in viewtopic (prosilver). (Bug #38055 - Patch by Raimon)</li>
     292                <li>[Fix] Correctly propagate umlauts over search result pages. (Bug #33755)</li>
     293                <li>[Fix] Preserve post options when refusing to save the post as a draft. (Bug #39115)</li>
     294                <li>[Fix] Do not send private message back to sender if sender is in the same group the private message was sent to.</li>
     295                <li>[Fix] Correctly add user to a group making it a default one. (Bug #48345)</li>
     296                <li>[Fix] Add log entry when copying forum permissions.</li>
     297                <li>[Fix] Min/max characters per posts no longer affects poll options. (Bug #47295)</li>
     298                <li>[Fix] Correctly log action when users request to join a group. (Bug #37585)</li>
     299                <li>[Fix] Do not try to create thumbnails for images we cannot open properly. (Bug #48695)</li>
     300                <li>[Fix] Apply locale-independent basename() to attachment filenames. New function added: utf8_basename(). (Bug #43335 - Patch by ocean=Yohsuke)</li>
     301                <li>[Fix] Adjust build_url() to not prepend $phpbb_root_path if path returned from redirect() is an URL. This fixes redirect issues with some installations and bridges. (Bug #47535)</li>
     302                <li>[Fix] Do not mark global announcements as read if all topics in a forum become read (Bug #15729).</li>
     303                <li>[Fix] Fix general error in registration, caused by an undefined $config variable in validate_referer(). (Bug #49035 - Patch by wjvriend)</li>
     304                <li>[Fix] Correctly extract column default value when exporting PostgreSQL tables. (Bug #48955)</li>
     305                <li>[Fix] Allow updater to work correctly with PHP filename extensions other than &quot;.php&quot;. (Bugs #15809, #49215)</li>
     306                <li>[Fix] Update search index if only post subject changed. (Bug #49435)</li>
     307                <li>[Fix] Fix who is online displaying incorrect data. (Bug #49485, thanks Brainy)</li>
     308                <li>[Fix] Fixed incorrect &quot;topic does not exist&quot; if unapproved posts were visited without global moderator permissions. (Bug #47795)</li>
     309                <li>[Fix] Prevent style switcher from blocking the tab key. (Bug #49335)</li>
     310                <li>[Fix] Correctly redirect back to MCP main page after posts approval/disapproval from it. (Bug #49625)</li>
     311                <li>[Fix] Do not display topic approval status image for shadow topic if a user is not a moderator in the forum the topic has been moved to. (Bug #43295)</li>
     312                <li>[Fix] Fix email problems on servers with PHP installations not accepting RFC-compliant subject string passed to the mail()-function. (Bug #46725)</li>
     313                <li>[Fix] Correctly orientate control panel navigation background-image on RTL languages. (Bug #49945)</li>
     314                <li>[Fix] Sort private messages by message time and not message id. (Bug #50015)</li>
     315                <li>[Fix] Make sure only logs for existing users are displayed and user-specific logs removed on user deletion. (Bug #49855)</li>
     316                <li>[Fix] Only show &quot;Add friend&quot; and &quot;Add foe&quot; links if the specific module is enabled. (Bug #50475)</li>
     317                <li>[Fix] Correctly display list items in forum description in prosilver and administration. (Bug #48055 - Patch by leviatan21)</li>
     318                <li>[Fix] Only embed cron.php if there is no cron lock present to reduce overhead. (Bug #45725 - Patch by TerryE)</li>
     319                <li>[Fix] Add header gradient back into subsilver2 but keep site logo easily replaceable with smaller and bigger ones. (Bug #11142 - Patch by dark/Rain and Raimon)</li>
     320                <li>[Fix] Send activation email when activating user from user settings. (Bug #43145)</li>
     321                <li>[Fix] Do not show resend activation email link when using admin activation. (Bug #44375 - Patch by bbrunnrman)</li>
     322                <li>[Fix] Do not display links to user/post search if search is disabled. (Bug #50685 - Patch by HardStyle)</li>
     323                <li>[Fix] Fix icon alignment for forums with large descriptions in subsilver2. (Bug #50445)</li>
     324                <li>[Fix] Correctly display underlined links placed in last line in viewtopic. (Bug #14811 - Patch by primehalo)</li>
     325                <li>[Fix] Only check whether forum image exists if forum image is specified. (Bug #51905)</li>
     326                <li>[Fix] Fixed database updater for changes to columns having default value in MSSQL (adding/dropping constraints).</li>
     327                <li>[Fix] Jabber SASL PLAIN authentication failures. (Bug #52995)</li>
     328                <li>[Fix] Check sort options on memberlist to avoid a general error. (Bug #53655)</li>
     329                <li>[Fix] Fix sql error in cache_moderators() if using postgresql. (Bug #53765)</li>
     330                <li>[Change] Database updater now supports checking for existing/missing indexes.</li>
     331                <li>[Change] submit_post() now accepts force_approved_state key passed to $data to indicate new posts being approved (true) or unapproved (false).</li>
     332                <li>[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.</li>
     333                <li>[Change] Template engine now permits variable includes to a limited extent.</li>
     334                <li>[Change] Quote BBCode no longer requires the f_reply permission. (Bug #16079)</li>
     335                <li>[Change] Banning/unbanning users now generates an entry in their user notes. (Bug #21825)</li>
     336                <li>[Change] Smilies no longer require the f_bbcode permission. (Bug #26545)</li>
     337                <li>[Change] Ability to define column split in FAQ/BBCode help. (Bug #31405)</li>
     338                <li>[Change] Changed behaviour of group_create() function to support specifying additional group columns.</li>
     339                <li>[Change] Hide avatar when avatar-type is not allowed. (Bug #46785 - Patch by cYbercOsmOnauT and nickvergessen)</li>
     340                <li>[Change] INCLUDEPHP paths are now relative to $phpbb_root_path. (Bug #45805)</li>
     341                <li>[Change] Ability to fetch moderators with get_moderators() even if load_moderators setting is off. (Bug #35955)</li>
     342                <li>[Change] &quot;Post details&quot; links with image in MCP. (Bug #39845 - Patch by leviatan21)</li>
     343                <li>[Change] PM history now only shows PMs of users you currently reply to. (Bug #39505)</li>
     344                <li>[Change] Show quote button for own PMs in PM history. (Bug #37285)</li>
     345                <li>[Change] Fetch requested cookie variables directly from cookie super global. (Bug #47785)</li>
     346                <li>[Change] Add confirmation for deactivating styles. (Bug #14304 - Patch by leviatan21)</li>
     347                <li>[Change] Add confirmation for deactivating language packs. (Patch by leviatan21)</li>
     348                <li>[Change] Add confirmation for deleting permissions. (Bug #13673)</li>
     349                <li>[Change] Add pagination for icons and smilies in the ACP and smilies in the smiley popup.</li>
     350                <li>[Change] Cache get_username_string() function calls on viewtopic.</li>
     351                <li>[Change] Cache version check.</li>
     352                <li>[Change] When creating a new forum without copying permissions, ask again.</li>
     353                <li>[Change] Introduce new parameter to page_header() for forum specific who is online listings.</li>
     354                <li>[Change] Changed minimum requirement for Firebird DBMS from 2.0+ to 2.1+.</li>
     355                <li>[Change] Unapproved topics can no longer be replied to. (Bug #44005, #47675, #23605)</li>
     356                <li>[Change] Require user to be registered and logged in to search for unread posts if topic read tracking is disabled for guests. (Bug #49525)</li>
     357                <li>[Change] Allow three-digit hex notation in color BBcode. (Bug #39965 - Patch by m0rpha)</li>
     358                <li>[Change] Simplified login_box() and redirection after login. S_LOGIN_ACTION can now be used on every page. (Bug #50285)</li>
     359                <li>[Change] Do not take edit post time into account for determining permission to delete last post in topic. (Bug #48615)</li>
     360                <li>[Change] Resize oversized topic icons. (Bug #44415)</li>
     361                <li>[Change] Banned IPs are now sorted. (Bug #43045 - Patch by DavidIQ)</li>
     362                <li>[Change] phpBB updater now skips sole whitespace/tab changes while computing differences. This reduces the chance of conflicts tremendously.</li>
     363                <li>[Change] phpBB updater now solves common conflicts on its own. This further reduces the chance of conflicts.</li>
     364                <li>[Feature] Add language selection to the registration terms page. (Bug #15085 - Patch by leviatan21)</li>
     365                <li>[Feature] Backported 3.2 captcha plugins:
     366                        <ul>
     367                                <li>Classic and GD CAPTCHA</li>
     368                                <li>reCaptcha (based on API from recaptcha.net by Mike Crawford and Ben Maurer)</li>
     369                                <li>Q&amp;A CAPTCHA</li>
     370                                <li>3D Wave (by Robert &quot;Xore&quot; Hetzler)</li>
     371                        </ul>
     372                </li>
     373                <li>[Feature] Introduced new ACM (Cache) plugins:
     374                        <ul>
     375                                <li>null (to disable caching completely)</li>
     376                                <li><a href="http://pecl.php.net/package/memcache">memcache</a></li>
     377                                <li><a href="http://pecl.php.net/package/APC">APC</a></li>
     378                                <li><a href="http://xcache.lighttpd.net/">XCache</a></li>
     379                                <li><a href="http://eaccelerator.net/">eAccelerator</a></li>
     380                        </ul>
     381                </li>
     382                <li>[Feature] ATOM Feeds (Idea from RSS Feed 2.0 MOD (Version 1.0.8/9) by leviatan21)</li>
     383                <li>[Feature] New groups option to excempt group leaders from group permissions.</li>
     384                <li>[Feature] New &quot;Newly Registered Users&quot; group for assigning permissions to newly registered users. They will be removed from this group once they reach a defineable amount of posts.</li>
     385                <li>[Feature] Ability to define if the &quot;Newly Registered Users&quot; group will be assigned as the default group to newly registered users.</li>
     386                <li>[Feature] Add new option to disable avatars board-wide. (Bug #46785 - Patch by cYbercOsmOnauT and nickvergessen)</li>
     387                <li>[Feature] Enhance obtain_users_online_string to be able to return user-lists for other session items. (Bug #31975)</li>
     388                <li>[Feature] Add unapproved topic icon for moderators on forum list. (Bug #46865)</li>
     389                <li>[Feature] Ability to define minimum number of characters for posts/pms.</li>
     390                <li>[Feature] Store signature configuration options in database. (Bug #45115)</li>
     391                <li>[Feature] Add bare-bones quick-reply editor to viewtopic.</li>
     392                <li>[Feature] Detect if a post has been altered by someone else while editing.</li>
     393                <li>[Feature] Add unread posts quick search option. (Bug #46765)</li>
     394                <li>[Feature] Add option to disable avatar uploads from remote locations. (Bug #45375)</li>
     395                <li>[Feature] Ability to delete warnings and keep warnings permanently. (Bug #43375)</li>
     396                <li>[Feature] Ability to empty a user's outbox from the user ACP quick tools.</li>
     397                <li>[Feature] Ability to search ACP/MCP logs.</li>
     398                <li>[Feature] Users can report PMs to moderators which are then visible in a new MCP module.</li>
     399                <li>[Feature] Parse email text files with the template engine.</li>
     400                <li>[Feature] Use email-style quoting when bbcodes are disabled.</li>
     401                <li>[Feature] Added new functionality to inactive users module:
     402                        <ul>
     403                                <li>Ability to set users per page.</li>
     404                                <li>Ability to sort by posts/number of reminders/last reminded date.</li>
     405                                <li>Show number of posts and ability to search posts.</li>
     406                                <li>Show number of reminders sent to user.</li>
     407                                <li>Show date of last reminder sent to user.</li>
     408                        </ul>
     409                </li>
     410                <li>[Feature] Display version check on ACP main page.</li>
     411                <li>[Feature] Ability to copy permissions from one forum to several other forums.</li>
     412                <li>[Feature] Ability to control the display of custom profile fields on viewtopic. (Bug #48985)</li>
     413                <li>[Feature] Fallback options for missing language files. (Bug #38575 - Patch by EXreaction)</li>
     414                <li>[Feature] Separate &quot;PM Reply&quot; and &quot;PM Reply to all&quot; in prosilver.</li>
     415                <li>[Feature] Place debug notices during captcha rendering in the error log - useful for debugging output already started errors.</li>
     416                <li>[Feature] Ability to define constant PHPBB_USE_BOARD_URL_PATH to use board url for images/avatars/ranks/imageset (useful for bridges and applications using phpBB).</li>
     417                <li>[Feature] Added function to generate email hash. (Bug #49195)</li>
     418                <li>[Feature] Style authors are now able to define the default submit button used for form submission on ENTER keypress on forms using more than one submit button. Prosilver uses this for the posting page(s) and registration screen.</li>
     419                <li>[Feature] Ability to specify amount of time user is able to delete his last post in topic.</li>
     420                <li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
     421        </ul>
     422
     423        <a name="v304"></a><h3>1.iii. Changes since 3.0.4</h3>
     424
     425        <ul>
     426                <li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
     427                <li>[Fix] Posts incremented for multiple approval of the same topic (Bug #40495 - Patch by TerraFrost)</li>
     428                <li>[Fix] Missing end &quot; in quote bb tag deletes text (Bug #40565 - Patch by TerraFrost)</li>
     429                <li>[Fix] Friend/foe system displays posts made by foes while composing (Bug #40325 - Patch by TerraFrost and Highway of Life)</li>
     430                <li>[Fix] Check forum_image whether it exists (Bug #39005 - Patch by TerraFrost)</li>
     431                <li>[Fix] The sql query in acp_users.php lacks a condition (Bug #40275 - Patch by grimskies)</li>
     432                <li>[Fix] Added missing read permission information for some phpbb_chmod() calls</li>
     433                <li>[Fix] Correctly display future dates (Bug #38755)</li>
     434                <li>[Fix] Fix guest/bot session problems with apache authentication plugin (Bug #41085)</li>
     435                <li>[Fix] Whois now works reliably for RIRs other than APNIC and RIPE. (Bug #40085)</li>
     436                <li>[Fix] Correctly convert Niels' Birthday MOD to the date format used in phpBB3. (Bug #32895)</li>
     437                <li>[Fix] Changed the success message when requesting a new password to be more accurate. (Bug #41405)</li>
     438                <li>[Fix] Add missing anti-abuse email headers to acp_inactive.php and ucp_resend.php.</li>
     439                <li>[Fix] Only remind users in the correct inactive states depending on the board account activation level.</li>
     440                <li>[Fix] Various XHTML mistakes in prosilver, subsilver2 and the ACP. (Bugs #41745, #42265 - Patch by nickvergessen, #38465, #43015, #46585 - Patch by Raimon)</li>
     441                <li>[Fix] Log password changes via password reset function. (Bug #41365)</li>
     442                <li>[Fix] Poll, negative durations generate error (Bug #41295 - Patch by TerraFrost)</li>
     443                <li>[Fix] Visibility of custom field on registration is incorrectly controlled by setting &quot;display&quot; (Bug #41385 - Patch by Eelke and fade2gray)</li>
     444                <li>[Fix] Smilies in username are misparsed on [quote=&quot;&quot;] (Bug #41955 - Patch by TerraFrost)</li>
     445                <li>[Fix] Deleting all posts in a topic - bad redirect (Bug #41705 - Patch by TerraFrost)</li>
     446                <li>[Fix] Deleted users still appear logged in (Bug #41985 - Patch by TerraFrost)</li>
     447                <li>[Fix] Removed redundant code and unnecessary queries in forum management. (Bug #42265 - Patch by nickvergessen)</li>
     448                <li>[Fix] Correct mbstring regular expression for the allowable username characters, only affects <code>USERNAME_LETTER_NUM_SPACERS</code>. (Bug #42325)</li>
     449                <li>[Fix] Fix infinite loop in message handler if cache directory is not writable. (Bug #38675)</li>
     450                <li>[Fix] While post is awaiting approval it can still be edited even though it can not be seen (Bug #41435 - Patch by TerraFrost)</li>
     451                <li>[Fix] Fix imageset editing for retaining and correctly setting dimensions for images, as well as displaying correct settings for first page load.</li>
     452                <li>[Fix] Use OS-specific line endings for mail headers. (related to Bug #42755)</li>
     453                <li>[Fix] Hide font size options which are bigger than the allowed size in the editor. (Bug #42615 - Patch by nickvergessen)</li>
     454                <li>[Fix] Better thumbnail quality with imagemagick. (Bug #42565)</li>
     455                <li>[Fix] Fix download count increments for image attachments without corresponding thumbnails. (Bug #42505)</li>
     456                <li>[Fix] Fix wrong bot ip check if bot ip was wrongly entered by admin. (Bug #42485)</li>
     457                <li>[Fix] Fix javascript errors in simple header (prosilver) by adding forum_fn.js and the corresponding variables. (Bug #42135)</li>
     458                <li>[Fix] Set connection encoding for MySQL versions 4.1.0 to 4.1.2. This may fix some conversion issues with special characters. (Bug #41805)</li>
     459                <li>[Fix] Deleting private message attachments could delete post attachments. (Bug #42815)</li>
     460                <li>[Fix] Do not suppress PHP notices/errors in language packs if DEBUG_EXTRA mode enabled. (Bug #41485)</li>
     461                <li>[Fix] Flash files do not display anymore after update to flash player 10 (Bug #41315)</li>
     462                <li>[Fix] Use FQDN for SMTP EHLO/HELO command. (Bug #41025)</li>
     463                <li>[Fix] Mass Email works again for users with empty jabber address but notification set to 'both'. (Bug #39755)</li>
     464                <li>[Fix] Fix race condition for updating post/topic/etc. counter. (Reported by BartVB)</li>
     465                <li>[Fix] Fix duplicate creation of acl options in acl_add_options() under certain conditions. (Bug #38385, #40225)</li>
     466                <li>[Fix] Cancel when replying to global announcement redirects to first forum - not to the current forum (Bug #41225 - Patch by TerraFrost)</li>
     467                <li>[Fix] Cursor Jumps on New Topic in IE (Bug #42455 - Patch by TerraFrost)</li>
     468                <li>[Fix] Add indicator to be used in code if session was created (user visits the site for the first time).</li>
     469                <li>[Fix] Correctly count topic views for guests visiting the website the first time by entering the topic directly (Bug #43445)</li>
     470                <li>[Fix] Fix bug in postgresql db layer for LIMIT ALL clauses (Reported by JRSweets)</li>
     471                <li>[Fix] Sort backups by date, newest first (Bug #14818)</li>
     472                <li>[Fix] Prevent incomplete backups stored if option &quot;store and download&quot; is selected and admin cancel download by removing the option. (Bug #20325)</li>
     473                <li>[Fix] Enforce correct case for template variables</li>
     474                <li>[Fix] Set topic_last_view_time on post/reply/edit to circumvent race conditions in auto prune and false removal of topics for manual forum prune (Bug #18055, #43515)</li>
     475                <li>[Fix] Correctly split long subject lines according to the used RFC. This fixes extra spaces within long subjects. (Bug #43715)</li>
     476                <li>[Fix] Fix skipping messages if using next/prev PM in history links. (Bug #22205)</li>
     477                <li>[Fix] Messenger now also able to use a custom language path. (Bug #36545)</li>
     478                <li>[Fix] PM Export uses ISO 8601 date now. (Bug #32645)</li>
     479                <li>[Fix] Apply append_sid() to newest/latest post links in viewforum/search and UCP main module. (Bug #26815)</li>
     480                <li>[Fix] Do not create thumbnail if thumbnail would've the same size as the original image. (Bug #30725)</li>
     481                <li>[Fix] Ability to vote in poll is now required for the ability to change existing vote. (Bug #38925)</li>
     482                <li>[Fix] Search for 'topic title only' and 'first post' should work again for non-mysql dbms. (Bug #40605)</li>
     483                <li>[Fix] Make sure additional information for accessibility is always exposed to screen readers (Bug #44335 - Patch by MarcoZ)</li>
     484                <li>[Fix] Approving a topic when some of the posts within that topic have already been approved (Bug #42585 - Patch by TerraFrost)</li>
     485                <li>[Fix] Online status shown when post hidden (Bug #35505 - Patch by Raimon)</li>
     486                <li>[Fix] memberlist.php display formating can be distorted by posting long URL for website (Bug #36675 - Patch by TerraFrost)</li>
     487                <li>[Fix] Display the online status of hidden users to users with the u_viewonline permission when viewing PMs.</li>
     488                <li>[Fix] &quot;Select all&quot; selects much too much in Opera (Bug #42885 - Patch by TerraFrost and ToonArmy)</li>
     489                <li>[Fix] Correct calculation of source/target forum statistics if mass moving topics with global announcements (Bug #44545)</li>
     490                <li>[Fix] Fix column handling in db updater, custom profile fields an db tools for firebird DBMS (Bug #44555)</li>
     491                <li>[Fix] IE8 textarea issues (Bug #43305)</li>
     492                <li>[Fix] Prevent accounts from being activated by users when admin activation is turned on and the correct activation key is known.</li>
     493                <li>[Fix] Allow the installer to operate under PHP 5.3. (Bug #45255)</li>
     494                <li>[Change] Default difference view is now 'inline' instead of 'side by side'</li>
     495                <li>[Change] Added new option for merging differences to conflicting files in automatic updater</li>
     496                <li>[Change] Add link to user profile in the MCP for user notes and warn user.</li>
     497                <li>[Change] Add IN_PHPBB check to generated cache files. (Reported by bantu)</li>
     498                <li>[Change] Add topic icons to prosilver UCP main and subscribed templates (Bug #42735 - Patch by Raimon)</li>
     499                <li>[Change] Add unique key to ACL options table to prevent duplicate permission options. (Bug #41835)</li>
     500                <li>[Change] Redirect to relevant MCP page of multi-page topic if accessing quickmod tools (Split option for example)</li>
     501                <li>[Change] Performance improvements for native fulltext search (Patch by Paul)</li>
     502                <li>[Change] Changed jumpto() JS function to be more fail-safe. (But #27635 - Patch by peterkclee)</li>
     503                <li>[Feature] Added new options for visual confirmation.</li>
     504                <li>[Feature] Allow download of conflicting file for later reference in automatic updater</li>
     505                <li>[Feature] Allow translation of custom BBCode help messages. (Patch by bantu)</li>
     506                <li>[Feature] db_tools now support create table and drop table.</li>
     507                <li>[Feature] Database updater checks for incompatible db schema (MySQL 3.x/4.x against MySQL 4.1.x/5.x/6.x)</li>
     508                <li>[Feature] New search option: Maximum number of words allowed to search for.</li>
     509                <li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
     510        </ul>
     511
     512        <a name="v303"></a><h3>1.iv. Changes since 3.0.3</h3>
    87513
    88514        <ul>
     
    116542        </ul>
    117543
    118         <a name="v302"></a><h3>1.ii. Changes since 3.0.2</h3>
     544        <a name="v302"></a><h3>1.v. Changes since 3.0.2</h3>
    119545
    120546        <ul>
     
    215641        </ul>
    216642
    217         <a name="v301"></a><h3>1.iii. Changes since 3.0.1</h3>
     643        <a name="v301"></a><h3>1.vi. Changes since 3.0.1</h3>
    218644
    219645        <ul>
     
    263689        </ul>
    264690
    265         <a name="v300"></a><h3>1.iv. Changes since 3.0.0</h3>
     691        <a name="v300"></a><h3>1.vii Changes since 3.0.0</h3>
    266692
    267693        <ul>
     
    334760        </ul>
    335761
    336         <a name="v30rc8"></a><h3>1.v. Changes since 3.0.RC8</h3>
     762        <a name="v30rc8"></a><h3>1.viii. Changes since 3.0.RC8</h3>
    337763
    338764        <ul>
     
    343769        </ul>
    344770
    345         <a name="v30rc7"></a><h3>1.vi. Changes since 3.0.RC7</h3>
     771        <a name="v30rc7"></a><h3>1.ix. Changes since 3.0.RC7</h3>
    346772
    347773        <ul>
     
    378804        </ul>
    379805
    380         <a name="v30rc6"></a><h3>1.vii. Changes since 3.0.RC6</h3>
     806        <a name="v30rc6"></a><h3>1.x. Changes since 3.0.RC6</h3>
    381807
    382808        <ul>
     
    388814        </ul>
    389815
    390         <a name="v30rc5"></a><h3>1.viii. Changes since 3.0.RC5</h3>
     816        <a name="v30rc5"></a><h3>1.xi. Changes since 3.0.RC5</h3>
    391817
    392818        <ul>
     
    451877        </ul>
    452878
    453         <a name="v30rc4"></a><h3>1.ix. Changes since 3.0.RC4</h3>
     879        <a name="v30rc4"></a><h3>1.xii. Changes since 3.0.RC4</h3>
    454880
    455881        <ul>
     
    502928        </ul>
    503929
    504         <a name="v30rc3"></a><h3>1.x. Changes since 3.0.RC3</h3>
     930        <a name="v30rc3"></a><h3>1.xiii. Changes since 3.0.RC3</h3>
    505931
    506932        <ul>
     
    6111037        </ul>
    6121038
    613         <a name="v30rc2"></a><h3>1.xi. Changes since 3.0.RC2</h3>
     1039        <a name="v30rc2"></a><h3>1.xiv. Changes since 3.0.RC2</h3>
    6141040
    6151041        <ul>
     
    6571083        </ul>
    6581084
    659         <a name="v30rc1"></a><h3>1.xii. Changes since 3.0.RC1</h3>
     1085        <a name="v30rc1"></a><h3>1.xv. Changes since 3.0.RC1</h3>
    6601086
    6611087        <ul>
  • trunk/forum/docs/FAQ.html

    r400 r702  
    5454<!-- add entry about common UTF8 problems (for example wrong uploading, editing) -->
    5555<ul>
    56         <li><a href="#install">I cannot install this it is too difficult! Will you do it?</a></li>
     56        <li><a href="#install">I am finding phpBB too difficult to install. Will you do it for me?</a></li>
    5757        <li><a href="#legal">I am having problems with the admin at a certain board, help!</a></li>
    5858        <li><a href="#legal">A board has ripped off my graphics/software/etc., stop them!</a></li>
     
    6363        <li><a href="#mail_language">My users are complaining that emails are not in their selected language!</a></li>
    6464        <li><a href="#aol_browser">My AOL based users keep getting logged out!</a></li>
    65         <li><a href="#avatars">No matter what I set the uploadable avatars to I cannot upload one from my computer!</a></li>
     65        <li><a href="#avatars">I am unable to upload avatars from my computer, regardless of the settings.</a></li>
    6666        <li><a href="#gallery_avatars">I just cannot get gallery avatars to appear!</a></li>
    6767        <li><a href="#permissions">How do I use/set permissions?</a></li>
     
    7979        <hr />
    8080
    81         <a name="install"></a><h2>I cannot install this it is too difficult! Will you do it?</h2>
     81        <a name="install"></a><h2>I am finding phpBB too difficult to install. Will you do it for me?</h2>
    8282
    8383        <div class="paragraph">
     
    206206        <hr />
    207207
    208 <a name="avatars"></a><h2>No matter what I set the uploadable avatars to I cannot upload one from my computer!</h2>
     208<a name="avatars"></a><h2>I am unable to upload avatars from my computer, regardless of the settings.</h2>
    209209
    210210        <div class="paragraph">
  • trunk/forum/docs/INSTALL.html

    r400 r702  
    140140                        <li>PostgreSQL 7.3+</li>
    141141                        <li>SQLite 2.8.2+</li>
    142                         <li>Firebird 2.0+</li>
     142                        <li>Firebird 2.1+</li>
    143143                        <li>MS SQL Server 2000 or above (directly or via ODBC)</li>
    144144                        <li>Oracle</li>
     
    274274        <p>This package is meant for those wanting to only replace changed files from a previous version to the latest version. This package normally contains the changed files from up to five previous versions.</p>
    275275
    276         <p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.3</samp> you should select the phpBB-3.0.3_to_3.0.4.zip/tar.gz file.</p>
     276        <p>This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have <samp>3.0.6</samp> you should select the phpBB-3.0.6_to_3.0.7-PL1.zip/tar.gz file.</p>
    277277
    278278        <p>The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any MODs these files will overwrite the originals possibly destroying them in the process. You will need to re-add MODs to any affected file before uploading.</p>
     
    284284        <p>The patch file package is for those wanting to update through the patch application, and being comfortable with it.</p>
    285285
    286         <p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the preferred update method.</p>
    287 
    288         <p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.3 you need the phpBB-3.0.3_to_3.0.4.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
     286        <p>The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. To use this you will need command line access to a standard UNIX type <strong>patch</strong> application. If you do not have access to such an application but still want to use this update approach, we strongly recommend the <a href="#update_auto">Automatic update package</a> explained below. It is also the recommended update method.</p>
     287
     288        <p>A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.5 you need the phpBB-3.0.6_to_3.0.7-PL1.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: <strong>patch -cl -d [PHPBB DIRECTORY] -p1 &lt; [PATCH NAME]</strong> (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.</p>
    289289
    290290        <p>If you do get failures you should look at using the <a href="#update_files">Changed files only</a> package to replace the files which failed to patch, please note that you will need to manually re-add any Modifications (MODs) to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.</p>
     
    294294<a name="update_auto"></a><h3>4.iv. Automatic update package</h3>
    295295
    296         <p>This update method is the preferred method for updating. This package allows detecting changed files automatically and merges changes if needed.</p>
     296        <p>This update method is the recommended method for updating. This package allows detecting changed files automatically and merges changes if needed.</p>
    297297
    298298        <p>The automatic update package contains - contrary to the others - only the information required to update the previous release version to the latest available version. These packages are meant for use with the automatic update tool.</p>
  • trunk/forum/docs/auth_api.html

    r400 r702  
    242242
    243243        <div id="page-footer">
    244                 <div class="version"> $Id: auth_api.html 8479 2008-03-29 00:22:48Z naderman $ </div>
     244                <div class="version"> $Id$ </div>
    245245        </div>
    246246</div></div>
  • trunk/forum/docs/coding-guidelines.html

    r400 r702  
    5858                <li><a href="#fileheader">File Header</a></li>
    5959                <li><a href="#locations">File Locations</a></li>
     60                <li><a href="#constants">Special Constants</a></li>
    6061        </ol>
    6162        </li>
     
    6970        </ol>
    7071        </li>
    71         <li><a href="#styling">Styling</a></li>
     72        <li><a href="#styling">Styling</a>
    7273        <ol style="list-style-type: lower-roman;">
    7374                <li><a href="#cfgfiles">Style Config Files</a></li>
     
    8788        </ol>
    8889        </li>
     90        <li><a href="#vcs">VCS Guidelines</a>
     91        <ol style="list-style-type: lower-roman;">
     92                <li><a href="#repostruct">Repository structure</a></li>
     93                <li><a href="#commitmessage">Commit messages</a></li>
     94        </ol>
     95        </li>
    8996        <li><a href="#changes">Guidelines Changelog</a></li>
    9097        <li><a href="#disclaimer">Copyright and disclaimer</a></li>
     
    119126
    120127        <h3>Linefeeds:</h3>
    121         <p>Ensure that your editor is saving files in the UNIX (LF) line ending format. This means that lines are terminated with a newline, not with Windows Line endings (CR/LF combo) as they are on Win32 or Classic Mac (CR) Line endings. Any decent editor should be able to do this, but it might not always be the default setting. Know your editor. If you want advice for an editor for your Operating System, just ask one of the developers. Some of them do their editing on Win32.
     128        <p>Ensure that your editor is saving files in the UNIX (LF) line ending format. This means that lines are terminated with a newline, not with Windows Line endings (CR/LF combo) as they are on Win32 or Classic Mac (CR) Line endings. Any decent editor should be able to do this, but it might not always be the default setting. Know your editor. If you want advice for an editor for your Operating System, just ask one of the developers. Some of them do their editing on Win32.</p>
    122129
    123130        <a name="fileheader"></a><h3>1.ii. File Header</h3>
     
    197204                                <li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li>
    198205                                <li><code>/includes/db/mssql_odbc.php</code><br />MSSQL ODBC Database Abstraction Layer for MSSQL</li>
    199                                 <li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x/4.1.x/5.x
     206                                <li><code>/includes/db/mysql.php</code><br />MySQL Database Abstraction Layer for MySQL 3.x/4.0.x/4.1.x/5.x</li>
    200207                                <li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li>
    201208                                <li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li>
     
    218225        </ul>
    219226
     227        <a name="constants"></a><h3>1.iv. Special Constants</h3>
     228
     229        <p>There are some special constants application developers are able to utilize to bend some of phpBB's internal functionality to suit their needs.</p>
     230
     231        <div class="codebox"><pre>
     232PHPBB_MSG_HANDLER          (overwrite message handler)
     233PHPBB_DB_NEW_LINK          (overwrite new_link parameter for sql_connect)
     234PHPBB_ROOT_PATH            (overwrite $phpbb_root_path)
     235PHPBB_ADMIN_PATH           (overwrite $phpbb_admin_path)
     236PHPBB_USE_BOARD_URL_PATH   (use generate_board_url() for image paths instead of $phpbb_root_path)
     237PHPBB_DISABLE_ACP_EDITOR   (disable ACP style editor for templates)
     238PHPBB_DISABLE_CONFIG_CHECK (disable ACP config.php writeable check)
     239
     240PHPBB_ACM_MEMCACHE_PORT     (overwrite memcached port, default is 11211)
     241PHPBB_ACM_MEMCACHE_COMPRESS (overwrite memcached compress setting, default is disabled)
     242PHPBB_ACM_MEMCACHE_HOST     (overwrite memcached host name, default is localhost)
     243
     244PHPBB_QA                   (Set board to QA-Mode, which means the updater also checks for RC-releases)
     245</pre></div>
     246
     247<h4>PHPBB_USE_BOARD_URL_PATH</h4>
     248
     249<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
     250
     251<ul>
     252        <li>/includes/session.php - user::img()</li>
     253        <li>/includes/functions_content.php - smiley_text()</li>
     254</ul>
     255
     256<p>Path locations for the following template variables are affected by this too:</p>
     257
     258<ul>
     259        <li>{T_THEME_PATH} - styles/xxx/theme</li>
     260        <li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
     261        <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>
     262        <li>{T_IMAGESET_PATH} - styles/xxx/imageset</li>
     263        <li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li>
     264        <li>{T_IMAGES_PATH} - images/</li>
     265        <li>{T_SMILIES_PATH} - $config['smilies_path']/</li>
     266        <li>{T_AVATAR_PATH} - $config['avatar_path']/</li>
     267        <li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li>
     268        <li>{T_ICONS_PATH} - $config['icons_path']/</li>
     269        <li>{T_RANKS_PATH} - $config['ranks_path']/</li>
     270        <li>{T_UPLOAD_PATH} - $config['upload_path']/</li>
     271        <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li>
     272        <li>New template variable {BOARD_URL} for the board url + script path.</li>
     273</ul>
     274
    220275                </div>
    221276
     
    11101165
    11111166<p>You will note in the 3.0 templates the major sources start with <code>&lt;!-- INCLUDE overall_header.html --&gt;</code> or <code>&lt;!-- INCLUDE simple_header.html --&gt;</code>, etc. In 2.0.x control of &quot;which&quot; header to use was defined entirely within the code. In 3.0.x the template designer can output what they like. Note that you can introduce new templates (i.e. other than those in the default set) using this system and include them as you wish ... perhaps useful for a common &quot;menu&quot; bar or some such. No need to modify loads of files as with 2.0.x.</p>
     1167
     1168<p>Added in <strong>3.0.6</strong> is the ability to include a file using a template variable to specify the file, this functionality only works for root variables (i.e. not block variables).</p>
     1169<div class="codebox"><pre>
     1170<span class="comment">&lt;!-- INCLUDE {FILE_VAR} --&gt;</span>
     1171</pre></div>
     1172
     1173<p>Template defined variables can also be utilised.</p>
     1174
     1175<div class="codebox"><pre>
     1176<span class="comment">&lt;!-- DEFINE $SOME_VAR = 'my_file.html' --&gt;</span>
     1177<span class="comment">&lt;!-- INCLUDE {$SOME_VAR} --&gt;</span>
     1178</pre></div>
    11121179
    11131180<h4>PHP</h4>
     
    14641531
    14651532        &lt;fieldset class="submit-buttons"&gt;
    1466                 &lt;input type=&quot;reset&quot; value=&quot;{L_RESET}&quot; name=&quot;reset&quot; class=&quot;button2&quot; /&gt&nbsp;
    1467                 &lt;input type=&quot;submit&quot; name=&quot;action[add_warning]&quot; value=&quot;{L_SUBMIT}&quot; class=&quot;button1&quot; /&gt
     1533                &lt;input type=&quot;reset&quot; value=&quot;{L_RESET}&quot; name=&quot;reset&quot; class=&quot;button2&quot; /&gt;&nbsp;
     1534                &lt;input type=&quot;submit&quot; name=&quot;action[add_warning]&quot; value=&quot;{L_SUBMIT}&quot; class=&quot;button1&quot; /&gt;
    14681535                {S_FORM_TOKEN}
    1469         &lt;/fieldset&gt
    1470 &lt;/form&gt
     1536        &lt;/fieldset&gt;
     1537&lt;/form&gt;
    14711538                </pre></div><br />
    14721539
     
    22532320        <hr />
    22542321
    2255 <a name="changes"></a><h2>7. Guidelines Changelog</h2>
     2322<a name="vcs"></a><h2>7. VCS Guidelines</h2>
     2323
    22562324        <div class="paragraph">
    22572325                <div class="inner"><span class="corners-top"><span></span></span>
     
    22592327                <div class="content">
    22602328
     2329        <p>The version control system for phpBB3 is subversion. The repository is available at <a href="http://code.phpbb.com/svn/phpbb" title="repository">http://code.phpbb.com/svn/phpbb</a>.</p>
     2330
     2331        <a name="repostruct"></a><h3>7.i. Repository Structure</h3>
     2332
     2333        <ul>
     2334                <li><strong>trunk</strong><br />The latest unstable development version with new features etc. Contains the actual board in <code>/trunk/phpBB</code></li>
     2335                <li><strong>branches</strong><br />Development branches of stable phpBB releases. Copied from <code>/trunk</code> at the time of release.
     2336                        <ul>
     2337                                <li><strong>phpBB3.0</strong><code>/branches/phpBB-3_0_0/phpBB</code><br />Development branch of the stable 3.0 line. Bug fixes are applied here.</li>
     2338                                <li><strong>phpBB2</strong><code>/branches/phpBB-2_0_0/phpBB</code><br />Old phpBB2 development branch.</li>
     2339                        </ul>
     2340                </li>
     2341                <li><strong>tags</strong><br />Released versions. Copies of trunk or the respective branch, made at the time of release.
     2342                        <ul>
     2343                                <li><code>/tags/release_3_0_BX</code><br />Beta release X of the 3.0 line.</li>
     2344                                <li><code>/tags/release_3_0_RCX</code><br />Release candidate X of the 3.0 line.</li>
     2345                                <li><code>/tags/release_3_0_X-RCY</code><br />Release candidate Y of the stable 3.0.X release.</li>
     2346                                <li><code>/tags/release_3_0_X</code><br />Stable <strong>3.0.X</strong> release.</li>
     2347                                <li><code>/tags/release_2_0_X</code><br />Old stable 2.0.X release.</li>
     2348                        </ul>
     2349                </li>
     2350        </ul>
     2351
     2352        <a name="commitmessage"></a><h3>7.ii. Commit Messages</h3>
     2353
     2354        <p>The commit message should contain a brief explanation of all changes made within the commit. Often identical to the changelog entry. A bug ticket can be referenced by specifying the ticket ID with a hash, e.g. #12345. A reference to another revision should simply be prefixed with r, e.g. r12345.</p>
     2355
     2356        <p>Junior Developers need to have their patches approved by a development team member first. The commit message must end in a line with the following format:</p>
     2357
     2358        <div class="codebox"><pre>
     2359Authorised by: developer1[, developer2[, ...]]
     2360        </pre></div>
     2361
     2362                </div>
     2363
     2364                <div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
     2365
     2366                <span class="corners-bottom"><span></span></span></div>
     2367        </div>
     2368
     2369        <hr />
     2370
     2371<a name="changes"></a><h2>8. Guidelines Changelog</h2>
     2372        <div class="paragraph">
     2373                <div class="inner"><span class="corners-top"><span></span></span>
     2374
     2375                <div class="content">
     2376<h3>Revision 10007</h3>
     2377
     2378<ul>
     2379        <li>Added <a href="#constants">Special Constants</a> section.</li>
     2380</ul>
     2381
     2382<h3>Revision 9817</h3>
     2383
     2384<ul>
     2385        <li>Added VCS section.</li>
     2386</ul>
    22612387
    22622388<h3>Revision 8732</h3>
     
    23312457        <hr />
    23322458
    2333 <a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2>
     2459<a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2>
    23342460
    23352461        <div class="paragraph">
     
    23502476
    23512477        <div id="page-footer">
    2352                 <div class="version"> $Id: coding-guidelines.html 9036 2008-10-25 14:16:17Z acydburn $ </div>
     2478                <div class="version"> $Id$ </div>
    23532479        </div>
    23542480</div></div>
  • trunk/forum/docs/hook_system.html

    r400 r702  
    105105}
    106106
    107 code { 
    108         color: #006600; 
    109         font-weight: normal; 
    110         font-family: 'Courier New', monospace; 
    111         border-color: #D1D7DC; 
    112         border-width: 1px; 
    113         border-style: solid; 
    114         background-color: #FAFAFA; 
     107code {
     108        color: #006600;
     109        font-weight: normal;
     110        font-family: 'Courier New', monospace;
     111        border-color: #D1D7DC;
     112        border-width: 1px;
     113        border-style: solid;
     114        background-color: #FAFAFA;
    115115}
    116116
     
    388388PHPBB_ROOT_PATH   (overwrite $phpbb_root_path)
    389389PHPBB_ADMIN_PATH  (overwrite $phpbb_admin_path)
    390 </pre></div>
     390PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $phpbb_root_path)
     391</pre></div>
     392
     393<p>If the <code>PHPBB_USE_BOARD_URL_PATH</code> constant is set to true, phpBB uses generate_board_url() (this will return the boards url with the script path included) on all instances where web-accessible images are loaded. The exact locations are:</p>
     394
     395<ul>
     396        <li>/includes/session.php - user::img()</li>
     397        <li>/includes/functions_content.php - smiley_text()</li>
     398</ul>
     399
     400<p>Path locations for the following template variables are affected by this too:</p>
     401
     402<ul>
     403        <li>{T_THEME_PATH} - styles/xxx/theme</li>
     404        <li>{T_TEMPLATE_PATH} - styles/xxx/template</li>
     405        <li>{T_SUPER_TEMPLATE_PATH} - styles/xxx/template</li>
     406        <li>{T_IMAGESET_PATH} - styles/xxx/imageset</li>
     407        <li>{T_IMAGESET_LANG_PATH} - styles/xxx/imageset/yy</li>
     408        <li>{T_IMAGES_PATH} - images/</li>
     409        <li>{T_SMILIES_PATH} - $config['smilies_path']/</li>
     410        <li>{T_AVATAR_PATH} - $config['avatar_path']/</li>
     411        <li>{T_AVATAR_GALLERY_PATH} - $config['avatar_gallery_path']/</li>
     412        <li>{T_ICONS_PATH} - $config['icons_path']/</li>
     413        <li>{T_RANKS_PATH} - $config['ranks_path']/</li>
     414        <li>{T_UPLOAD_PATH} - $config['upload_path']/</li>
     415        <li>{T_STYLESHEET_LINK} - styles/xxx/theme/stylesheet.css (or link to style.php if css is parsed dynamically)</li>
     416        <li>New template variable {BOARD_URL} for the board url + script path.</li>
     417</ul>
     418
    391419
    392420                </div>
     
    617645<div class="codebox"><pre>
    618646not hooked
    619 hooked 
     647hooked
    620648</pre></div>
    621649
     
    671699                <div class="codebox"><pre>
    672700not hooked
    673 hooked 
     701hooked
    674702                </pre></div>
    675703
     
    848876
    849877        <div id="page-footer">
    850                 <div class="version">$Id: hook_system.html 8479 2008-03-29 00:22:48Z naderman $</div>
     878                <div class="version">$Id$</div>
    851879        </div>
    852880</div></div>
  • trunk/forum/download/file.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: file.php 8792 2008-08-28 13:10:05Z Kellanved $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    1717
    1818
    19 // Thank you sun. 
     19// Thank you sun.
    2020if (isset($_SERVER['CONTENT_TYPE']))
    2121{
     
    6161        $avatar_group = false;
    6262        $exit = false;
    63        
     63
    6464        if ($filename[0] === 'g')
    6565        {
     
    8888                $exit = true;
    8989        }
    90        
    91        
     90
     91
    9292        if (!$exit)
    9393        {
     
    250250}
    251251
    252 $attachment['physical_filename'] = basename($attachment['physical_filename']);
     252$attachment['physical_filename'] = utf8_basename($attachment['physical_filename']);
    253253$display_cat = $extensions[$attachment['extension']]['display_cat'];
    254254
     
    267267        $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename'];
    268268}
    269 else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT_CATEGORY_IMAGE) && !$attachment['is_orphan'])
     269else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHMENT_CATEGORY_IMAGE*/) && !$attachment['is_orphan'])
    270270{
    271271        // Update download count
     
    279279{
    280280        wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
     281        file_gc();
    281282}
    282283else
     
    376377        else
    377378        {
    378                 header('HTTP/1.0 404 not found');
     379                header('HTTP/1.0 404 Not Found');
    379380        }
    380381}
     
    464465        // Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
    465466        $is_ie8 = (strpos(strtolower($user->browser), 'msie 8.0') !== false);
    466         header('Content-Type: ' . $attachment['mimetype'] . (($is_ie8) ? '; authoritative=true;' : ''));
    467 
    468         if (empty($user->browser) || (!$is_ie8 && (strpos(strtolower($user->browser), 'msie') !== false)))
    469         {
    470                 header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
    471                 if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
    472                 {
    473                         header('expires: -1');
    474                 }
     467        header('Content-Type: ' . $attachment['mimetype']);
     468
     469        if ($is_ie8)
     470        {
     471                header('X-Content-Type-Options: nosniff');
     472        }
     473
     474        if ($category == ATTACHMENT_CATEGORY_FLASH && request_var('view', 0) === 1)
     475        {
     476                // We use content-disposition: inline for flash files and view=1 to let it correctly play with flash player 10 - any other disposition will fail to play inline
     477                header('Content-Disposition: inline');
    475478        }
    476479        else
    477480        {
    478                 header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
    479                 if ($is_ie8 && (strpos($attachment['mimetype'], 'image') !== 0))
    480                 {
    481                         header('X-Download-Options: noopen');
     481                if (empty($user->browser) || (!$is_ie8 && (strpos(strtolower($user->browser), 'msie') !== false)))
     482                {
     483                        header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
     484                        if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
     485                        {
     486                                header('expires: -1');
     487                        }
     488                }
     489                else
     490                {
     491                        header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
     492                        if ($is_ie8 && (strpos($attachment['mimetype'], 'image') !== 0))
     493                        {
     494                                header('X-Download-Options: noopen');
     495                        }
    482496                }
    483497        }
     
    655669        if ((strpos(strtolower($browser), 'msie 6.0') === false) && (strpos(strtolower($browser), 'msie 8.0') === false))
    656670        {
    657                 if ($last_load !== false && $last_load <= $stamp)
    658                 {
    659                         if (@php_sapi_name() === 'CGI')
    660                         {
     671                if ($last_load !== false && $last_load >= $stamp)
     672                {
     673                        if (substr(strtolower(@php_sapi_name()),0,3) === 'cgi')
     674                        {
     675                                // in theory, we shouldn't need that due to php doing it. Reality offers a differing opinion, though
    661676                                header('Status: 304 Not Modified', true, 304);
    662677                        }
  • trunk/forum/faq.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: faq.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3939
    4040// Pull the array data from the lang pack
     41$switch_column = $found_switch = false;
    4142$help_blocks = array();
    4243foreach ($user->help as $help_ary)
     
    4445        if ($help_ary[0] == '--')
    4546        {
     47                if ($help_ary[1] == '--')
     48                {
     49                        $switch_column = true;
     50                        $found_switch = true;
     51                        continue;
     52                }
     53
    4654                $template->assign_block_vars('faq_block', array(
    47                         'BLOCK_TITLE'           => $help_ary[1])
    48                 );
     55                        'BLOCK_TITLE'           => $help_ary[1],
     56                        'SWITCH_COLUMN'         => $switch_column,
     57                ));
    4958
     59                if ($switch_column)
     60                {
     61                        $switch_column = false;
     62                }
    5063                continue;
    5164        }
     
    5972// Lets build a page ...
    6073$template->assign_vars(array(
    61         'L_FAQ_TITLE'   => $l_title,
    62         'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'])
    63 );
     74        'L_FAQ_TITLE'                           => $l_title,
     75        'L_BACK_TO_TOP'                         => $user->lang['BACK_TO_TOP'],
    6476
    65 page_header($l_title);
     77        'SWITCH_COLUMN_MANUALLY'        => (!$found_switch) ? true : false,
     78));
     79
     80page_header($l_title, false);
    6681
    6782$template->set_filenames(array(
  • trunk/forum/includes/acm/acm_file.php

    r400 r702  
    33*
    44* @package acm
    5 * @version $Id: acm_file.php 9076 2008-11-22 19:06:42Z acydburn $
    6 * @copyright (c) 2005 phpBB Group
     5* @version $Id$
     6* @copyright (c) 2005, 2009 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
    88*
     
    4545        function load()
    4646        {
    47                 global $phpEx;
    48                 if (file_exists($this->cache_dir . 'data_global.' . $phpEx))
    49                 {
    50                         @include($this->cache_dir . 'data_global.' . $phpEx);
    51                 }
    52                 else
    53                 {
    54                         return false;
    55                 }
    56 
    57                 return true;
     47                return $this->_read('data_global');
    5848        }
    5949
     
    8777                global $phpEx;
    8878
    89                 if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb'))
    90                 {
    91                         @flock($fp, LOCK_EX);
    92                         fwrite($fp, "<?php\n\$this->vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>");
    93                         @flock($fp, LOCK_UN);
    94                         fclose($fp);
    95 
    96                         if (!function_exists('phpbb_chmod'))
    97                         {
    98                                 global $phpbb_root_path;
    99                                 include($phpbb_root_path . 'includes/functions.' . $phpEx);
    100                         }
    101 
    102                         phpbb_chmod($this->cache_dir . 'data_global.' . $phpEx, CHMOD_WRITE);
    103                 }
    104                 else
     79                if (!$this->_write('data_global'))
    10580                {
    10681                        // Now, this occurred how often? ... phew, just tell the user then...
    10782                        if (!@is_writable($this->cache_dir))
    10883                        {
    109                                 trigger_error($this->cache_dir . ' is NOT writable.', E_USER_ERROR);
    110                         }
    111 
    112                         trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR);
     84                                // We need to use die() here, because else we may encounter an infinite loop (the message handler calls $cache->unload())
     85                                die($this->cache_dir . ' is NOT writable.');
     86                                exit;
     87                        }
     88
     89                        die('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx);
     90                        exit;
    11391                }
    11492
     
    130108                }
    131109
     110                $time = time();
     111
    132112                while (($entry = readdir($dir)) !== false)
    133113                {
     
    137117                        }
    138118
    139                         $expired = true;
    140                         @include($this->cache_dir . $entry);
    141                         if ($expired)
     119                        if (!($handle = @fopen($this->cache_dir . $entry, 'rb')))
     120                        {
     121                                continue;
     122                        }
     123
     124                        // Skip the PHP header
     125                        fgets($handle);
     126
     127                        // Skip expiration
     128                        $expires = (int) fgets($handle);
     129
     130                        fclose($handle);
     131
     132                        if ($time >= $expires)
    142133                        {
    143134                                $this->remove_file($this->cache_dir . $entry);
     
    155146                        foreach ($this->var_expires as $var_name => $expires)
    156147                        {
    157                                 if (time() > $expires)
     148                                if ($time >= $expires)
    158149                                {
    159150                                        $this->destroy($var_name);
     
    179170                        }
    180171
    181                         @include($this->cache_dir . "data{$var_name}.$phpEx");
    182                         return (isset($data)) ? $data : false;
     172                        return $this->_read('data' . $var_name);
    183173                }
    184174                else
     
    195185                if ($var_name[0] == '_')
    196186                {
    197                         global $phpEx;
    198 
    199                         if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb'))
    200                         {
    201                                 @flock($fp, LOCK_EX);
    202                                 fwrite($fp, "<?php\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data =  " . (sizeof($var) ? "unserialize(" . var_export(serialize($var), true) . ");" : 'array();') . "\n\n?>");
    203                                 @flock($fp, LOCK_UN);
    204                                 fclose($fp);
    205 
    206                                 if (!function_exists('phpbb_chmod'))
    207                                 {
    208                                         global $phpbb_root_path;
    209                                         include($phpbb_root_path . 'includes/functions.' . $phpEx);
    210                                 }
    211 
    212                                 phpbb_chmod($this->cache_dir . "data{$var_name}.$phpEx", CHMOD_WRITE);
    213                         }
     187                        $this->_write('data' . $var_name, $var, time() + $ttl);
    214188                }
    215189                else
     
    286260                                }
    287261
    288                                 // The following method is more failproof than simply assuming the query is on line 3 (which it should be)
    289                                 $check_line = @file_get_contents($this->cache_dir . $entry);
    290 
    291                                 if (empty($check_line))
     262                                if (!($handle = @fopen($this->cache_dir . $entry, 'rb')))
    292263                                {
    293264                                        continue;
    294265                                }
    295266
    296                                 // Now get the contents between /* and */
    297                                 $check_line = substr($check_line, strpos($check_line, '/* ') + 3, strpos($check_line, ' */') - strpos($check_line, '/* ') - 3);
    298 
    299                                 $found = false;
     267                                // Skip the PHP header
     268                                fgets($handle);
     269
     270                                // Skip expiration
     271                                fgets($handle);
     272
     273                                // Grab the query, remove the LF
     274                                $query = substr(fgets($handle), 0, -1);
     275
     276                                fclose($handle);
     277
    300278                                foreach ($table as $check_table)
    301279                                {
    302280                                        // Better catch partial table names than no table names. ;)
    303                                         if (strpos($check_line, $check_table) !== false)
     281                                        if (strpos($query, $check_table) !== false)
    304282                                        {
    305                                                 $found = true;
     283                                                $this->remove_file($this->cache_dir . $entry);
    306284                                                break;
    307285                                        }
    308                                 }
    309 
    310                                 if ($found)
    311                                 {
    312                                         $this->remove_file($this->cache_dir . $entry);
    313286                                }
    314287                        }
     
    369342        function sql_load($query)
    370343        {
    371                 global $phpEx;
    372 
    373344                // Remove extra spaces and tabs
    374345                $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
     346
     347                if (($rowset = $this->_read('sql_' . md5($query))) === false)
     348                {
     349                        return false;
     350                }
     351
    375352                $query_id = sizeof($this->sql_rowset);
    376 
    377                 if (!file_exists($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"))
    378                 {
    379                         return false;
    380                 }
    381 
    382                 @include($this->cache_dir . 'sql_' . md5($query) . ".$phpEx");
    383 
    384                 if (!isset($expired))
    385                 {
    386                         return false;
    387                 }
    388                 else if ($expired)
    389                 {
    390                         $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx", true);
    391                         return false;
    392                 }
    393 
     353                $this->sql_rowset[$query_id] = $rowset;
    394354                $this->sql_row_pointer[$query_id] = 0;
    395355
     
    402362        function sql_save($query, &$query_result, $ttl)
    403363        {
    404                 global $db, $phpEx;
     364                global $db;
    405365
    406366                // Remove extra spaces and tabs
    407367                $query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
    408                 $filename = $this->cache_dir . 'sql_' . md5($query) . '.' . $phpEx;
    409 
    410                 if ($fp = @fopen($filename, 'wb'))
    411                 {
    412                         @flock($fp, LOCK_EX);
    413 
    414                         $query_id = sizeof($this->sql_rowset);
    415                         $this->sql_rowset[$query_id] = array();
    416                         $this->sql_row_pointer[$query_id] = 0;
    417 
    418                         while ($row = $db->sql_fetchrow($query_result))
    419                         {
    420                                 $this->sql_rowset[$query_id][] = $row;
    421                         }
    422                         $db->sql_freeresult($query_result);
    423 
    424                         $file = "<?php\n\n/* " . str_replace('*/', '*\/', $query) . " */\n";
    425                         $file .= "\n\$expired = (time() > " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n";
    426 
    427                         fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . (sizeof($this->sql_rowset[$query_id]) ? "unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");" : 'array();') . "\n\n?>");
    428                         @flock($fp, LOCK_UN);
    429                         fclose($fp);
     368
     369                $query_id = sizeof($this->sql_rowset);
     370                $this->sql_rowset[$query_id] = array();
     371                $this->sql_row_pointer[$query_id] = 0;
     372
     373                while ($row = $db->sql_fetchrow($query_result))
     374                {
     375                        $this->sql_rowset[$query_id][] = $row;
     376                }
     377                $db->sql_freeresult($query_result);
     378
     379                if ($this->_write('sql_' . md5($query), $this->sql_rowset[$query_id], $ttl + time(), $query))
     380                {
     381                        $query_result = $query_id;
     382                }
     383        }
     384
     385        /**
     386        * Ceck if a given sql query exist in cache
     387        */
     388        function sql_exists($query_id)
     389        {
     390                return isset($this->sql_rowset[$query_id]);
     391        }
     392
     393        /**
     394        * Fetch row from cache (database)
     395        */
     396        function sql_fetchrow($query_id)
     397        {
     398                if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
     399                {
     400                        return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
     401                }
     402
     403                return false;
     404        }
     405
     406        /**
     407        * Fetch a field from the current row of a cached database result (database)
     408        */
     409        function sql_fetchfield($query_id, $field)
     410        {
     411                if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
     412                {
     413                        return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++][$field] : false;
     414                }
     415
     416                return false;
     417        }
     418
     419        /**
     420        * Seek a specific row in an a cached database result (database)
     421        */
     422        function sql_rowseek($rownum, $query_id)
     423        {
     424                if ($rownum >= sizeof($this->sql_rowset[$query_id]))
     425                {
     426                        return false;
     427                }
     428
     429                $this->sql_row_pointer[$query_id] = $rownum;
     430                return true;
     431        }
     432
     433        /**
     434        * Free memory used for a cached database result (database)
     435        */
     436        function sql_freeresult($query_id)
     437        {
     438                if (!isset($this->sql_rowset[$query_id]))
     439                {
     440                        return false;
     441                }
     442
     443                unset($this->sql_rowset[$query_id]);
     444                unset($this->sql_row_pointer[$query_id]);
     445
     446                return true;
     447        }
     448
     449        /**
     450        * Read cached data from a specified file
     451        *
     452        * @access private
     453        * @param string $filename Filename to write
     454        * @return mixed False if an error was encountered, otherwise the data type of the cached data
     455        */
     456        function _read($filename)
     457        {
     458                global $phpEx;
     459
     460                $file = "{$this->cache_dir}$filename.$phpEx";
     461
     462                $type = substr($filename, 0, strpos($filename, '_'));
     463
     464                if (!file_exists($file))
     465                {
     466                        return false;
     467                }
     468
     469                if (!($handle = @fopen($file, 'rb')))
     470                {
     471                        return false;
     472                }
     473
     474                // Skip the PHP header
     475                fgets($handle);
     476
     477                if ($filename == 'data_global')
     478                {
     479                        $this->vars = $this->var_expires = array();
     480
     481                        $time = time();
     482
     483                        while (($expires = (int) fgets($handle)) && !feof($handle))
     484                        {
     485                                // Number of bytes of data
     486                                $bytes = substr(fgets($handle), 0, -1);
     487
     488                                if (!is_numeric($bytes) || ($bytes = (int) $bytes) === 0)
     489                                {
     490                                        // We cannot process the file without a valid number of bytes
     491                                        // so we discard it
     492                                        fclose($handle);
     493
     494                                        $this->vars = $this->var_expires = array();
     495                                        $this->is_modified = false;
     496
     497                                        $this->remove_file($file);
     498
     499                                        return false;
     500                                }
     501
     502                                if ($time >= $expires)
     503                                {
     504                                        fseek($handle, $bytes, SEEK_CUR);
     505
     506                                        continue;
     507                                }
     508
     509                                $var_name = substr(fgets($handle), 0, -1);
     510
     511                                // Read the length of bytes that consists of data.
     512                                $data = fread($handle, $bytes - strlen($var_name));
     513                                $data = @unserialize($data);
     514
     515                                // Don't use the data if it was invalid
     516                                if ($data !== false)
     517                                {
     518                                        $this->vars[$var_name] = $data;
     519                                        $this->var_expires[$var_name] = $expires;
     520                                }
     521
     522                                // Absorb the LF
     523                                fgets($handle);
     524                        }
     525
     526                        fclose($handle);
     527
     528                        $this->is_modified = false;
     529
     530                        return true;
     531                }
     532                else
     533                {
     534                        $data = false;
     535                        $line = 0;
     536
     537                        while (($buffer = fgets($handle)) && !feof($handle))
     538                        {
     539                                $buffer = substr($buffer, 0, -1); // Remove the LF
     540
     541                                // $buffer is only used to read integers
     542                                // if it is non numeric we have an invalid
     543                                // cache file, which we will now remove.
     544                                if (!is_numeric($buffer))
     545                                {
     546                                        break;
     547                                }
     548
     549                                if ($line == 0)
     550                                {
     551                                        $expires = (int) $buffer;
     552
     553                                        if (time() >= $expires)
     554                                        {
     555                                                break;
     556                                        }
     557
     558                                        if ($type == 'sql')
     559                                        {
     560                                                // Skip the query
     561                                                fgets($handle);
     562                                        }
     563                                }
     564                                else if ($line == 1)
     565                                {
     566                                        $bytes = (int) $buffer;
     567
     568                                        // Never should have 0 bytes
     569                                        if (!$bytes)
     570                                        {
     571                                                break;
     572                                        }
     573
     574                                        // Grab the serialized data
     575                                        $data = fread($handle, $bytes);
     576
     577                                        // Read 1 byte, to trigger EOF
     578                                        fread($handle, 1);
     579
     580                                        if (!feof($handle))
     581                                        {
     582                                                // Somebody tampered with our data
     583                                                $data = false;
     584                                        }
     585                                        break;
     586                                }
     587                                else
     588                                {
     589                                        // Something went wrong
     590                                        break;
     591                                }
     592                                $line++;
     593                        }
     594                        fclose($handle);
     595
     596                        // unserialize if we got some data
     597                        $data = ($data !== false) ? @unserialize($data) : $data;
     598
     599                        if ($data === false)
     600                        {
     601                                $this->remove_file($file);
     602                                return false;
     603                        }
     604
     605                        return $data;
     606                }
     607        }
     608
     609        /**
     610        * Write cache data to a specified file
     611        *
     612        * 'data_global' is a special case and the generated format is different for this file:
     613        * <code>
     614        * <?php exit; ?>
     615        * (expiration)
     616        * (length of var and serialised data)
     617        * (var)
     618        * (serialised data)
     619        * ... (repeat)
     620        * </code>
     621        *
     622        * The other files have a similar format:
     623        * <code>
     624        * <?php exit; ?>
     625        * (expiration)
     626        * (query) [SQL files only]
     627        * (length of serialised data)
     628        * (serialised data)
     629        * </code>
     630        *
     631        * @access private
     632        * @param string $filename Filename to write
     633        * @param mixed $data Data to store
     634        * @param int $expires Timestamp when the data expires
     635        * @param string $query Query when caching SQL queries
     636        * @return bool True if the file was successfully created, otherwise false
     637        */
     638        function _write($filename, $data = null, $expires = 0, $query = '')
     639        {
     640                global $phpEx;
     641
     642                $file = "{$this->cache_dir}$filename.$phpEx";
     643
     644                if ($handle = @fopen($file, 'wb'))
     645                {
     646                        @flock($handle, LOCK_EX);
     647
     648                        // File header
     649                        fwrite($handle, '<' . '?php exit; ?' . '>');
     650
     651                        if ($filename == 'data_global')
     652                        {
     653                                // Global data is a different format
     654                                foreach ($this->vars as $var => $data)
     655                                {
     656                                        if (strpos($var, "\r") !== false || strpos($var, "\n") !== false)
     657                                        {
     658                                                // CR/LF would cause fgets() to read the cache file incorrectly
     659                                                // do not cache test entries, they probably won't be read back
     660                                                // the cache keys should really be alphanumeric with a few symbols.
     661                                                continue;
     662                                        }
     663                                        $data = serialize($data);
     664
     665                                        // Write out the expiration time
     666                                        fwrite($handle, "\n" . $this->var_expires[$var] . "\n");
     667
     668                                        // Length of the remaining data for this var (ignoring two LF's)
     669                                        fwrite($handle, strlen($data . $var) . "\n");
     670                                        fwrite($handle, $var . "\n");
     671                                        fwrite($handle, $data);
     672                                }
     673                        }
     674                        else
     675                        {
     676                                fwrite($handle, "\n" . $expires . "\n");
     677
     678                                if (strpos($filename, 'sql_') === 0)
     679                                {
     680                                        fwrite($handle, $query . "\n");
     681                                }
     682                                $data = serialize($data);
     683
     684                                fwrite($handle, strlen($data) . "\n");
     685                                fwrite($handle, $data);
     686                        }
     687
     688                        @flock($handle, LOCK_UN);
     689                        fclose($handle);
    430690
    431691                        if (!function_exists('phpbb_chmod'))
     
    435695                        }
    436696
    437                         phpbb_chmod($filename, CHMOD_WRITE);
    438 
    439                         $query_result = $query_id;
    440                 }
    441         }
    442 
    443         /**
    444         * Ceck if a given sql query exist in cache
    445         */
    446         function sql_exists($query_id)
    447         {
    448                 return isset($this->sql_rowset[$query_id]);
    449         }
    450 
    451         /**
    452         * Fetch row from cache (database)
    453         */
    454         function sql_fetchrow($query_id)
    455         {
    456                 if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
    457                 {
    458                         return $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]++];
     697                        phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE);
     698
     699                        return true;
    459700                }
    460701
    461702                return false;
    462         }
    463 
    464         /**
    465         * Fetch a field from the current row of a cached database result (database)
    466         */
    467         function sql_fetchfield($query_id, $field)
    468         {
    469                 if ($this->sql_row_pointer[$query_id] < sizeof($this->sql_rowset[$query_id]))
    470                 {
    471                         return (isset($this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field])) ? $this->sql_rowset[$query_id][$this->sql_row_pointer[$query_id]][$field] : false;
    472                 }
    473 
    474                 return false;
    475         }
    476 
    477         /**
    478         * Seek a specific row in an a cached database result (database)
    479         */
    480         function sql_rowseek($rownum, $query_id)
    481         {
    482                 if ($rownum >= sizeof($this->sql_rowset[$query_id]))
    483                 {
    484                         return false;
    485                 }
    486 
    487                 $this->sql_row_pointer[$query_id] = $rownum;
    488                 return true;
    489         }
    490 
    491         /**
    492         * Free memory used for a cached database result (database)
    493         */
    494         function sql_freeresult($query_id)
    495         {
    496                 if (!isset($this->sql_rowset[$query_id]))
    497                 {
    498                         return false;
    499                 }
    500 
    501                 unset($this->sql_rowset[$query_id]);
    502                 unset($this->sql_row_pointer[$query_id]);
    503 
    504                 return true;
    505703        }
    506704
  • trunk/forum/includes/acp/acp_attachments.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_attachments.php 9041 2008-11-02 11:19:12Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    125125                                                'img_display_inlined'           => array('lang' => 'DISPLAY_INLINED',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    126126                                                'img_create_thumbnail'          => array('lang' => 'CREATE_THUMBNAIL',          'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    127                                                 'img_max_thumb_width'           => array('lang' => 'MAX_THUMB_WIDTH',           'validate' => 'int',    'type' => 'text:7:15', 'explain' => true, 'append' => ' px'),
     127                                                'img_max_thumb_width'           => array('lang' => 'MAX_THUMB_WIDTH',           'validate' => 'int',    'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
    128128                                                'img_min_thumb_filesize'        => array('lang' => 'MIN_THUMB_FILESIZE',        'validate' => 'int',    'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
    129129                                                'img_imagick'                           => array('lang' => 'IMAGICK_PATH',                      'validate' => 'string', 'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
    130                                                 'img_max'                                       => array('lang' => 'MAX_IMAGE_SIZE',            'validate' => 'int',    'type' => 'dimension:3:4', 'explain' => true, 'append' => ' px'),
    131                                                 'img_link'                                      => array('lang' => 'IMAGE_LINK_SIZE',           'validate' => 'int',    'type' => 'dimension:3:4', 'explain' => true, 'append' => ' px'),
     130                                                'img_max'                                       => array('lang' => 'MAX_IMAGE_SIZE',            'validate' => 'int',    'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
     131                                                'img_link'                                      => array('lang' => 'IMAGE_LINK_SIZE',           'validate' => 'int',    'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
    132132                                        )
    133133                                );
     
    685685                                                }
    686686
    687                                                 $size_format = ($ext_group_row['max_filesize'] >= 1048576) ? 'mb' : (($ext_group_row['max_filesize'] >= 1024) ? 'kb' : 'b');
    688                                                 $ext_group_row['max_filesize'] = get_formatted_filesize($ext_group_row['max_filesize'], false);
     687                                                $max_filesize = get_formatted_filesize($ext_group_row['max_filesize'], false, array('mb', 'kb', 'b'));
     688                                                $size_format = $max_filesize['si_identifier'];
     689                                                $ext_group_row['max_filesize'] = $max_filesize['value'];
    689690
    690691                                                $img_path = $config['upload_icons_path'];
     
    695696                                                $imglist = filelist($phpbb_root_path . $img_path);
    696697
    697                                                 if (sizeof($imglist))
     698                                                if (!empty($imglist['']))
    698699                                                {
    699700                                                        $imglist = array_values($imglist);
     
    10041005                                                if ($files_added)
    10051006                                                {
    1006                                                         set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true);
    1007                                                         set_config('num_files', $config['num_files'] + $files_added, true);
     1007                                                        set_config_count('upload_dir_size', $space_taken, true);
     1008                                                        set_config_count('num_files', $files_added, true);
    10081009                                                }
    10091010                                        }
     
    10271028                                                'FILESIZE'                      => get_formatted_filesize($row['filesize']),
    10281029                                                'FILETIME'                      => $user->format_date($row['filetime']),
    1029                                                 'REAL_FILENAME'         => basename($row['real_filename']),
    1030                                                 'PHYSICAL_FILENAME'     => basename($row['physical_filename']),
     1030                                                'REAL_FILENAME'         => utf8_basename($row['real_filename']),
     1031                                                'PHYSICAL_FILENAME'     => utf8_basename($row['physical_filename']),
    10311032                                                'ATTACH_ID'                     => $row['attach_id'],
    10321033                                                'POST_IDS'                      => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
     
    14301431        {
    14311432                // Determine size var and adjust the value accordingly
    1432                 $size_var = ($value >= 1048576) ? 'mb' : (($value >= 1024) ? 'kb' : 'b');
    1433                 $value = get_formatted_filesize($value, false);
     1433                $filesize = get_formatted_filesize($value, false, array('mb', 'kb', 'b'));
     1434                $size_var = $filesize['si_identifier'];
     1435                $value = $filesize['value'];
    14341436
    14351437                return '<input type="text" id="' . $key . '" size="8" maxlength="15" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>';
  • trunk/forum/includes/acp/acp_ban.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_ban.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    157157                                        WHERE (ban_end >= ' . time() . "
    158158                                                        OR ban_end = 0)
    159                                                 AND ban_ip <> ''";
     159                                                AND ban_ip <> ''
     160                                        ORDER BY ban_ip";
    160161                        break;
    161162
     
    169170                                        WHERE (ban_end >= ' . time() . "
    170171                                                        OR ban_end = 0)
    171                                                 AND ban_email <> ''";
     172                                                AND ban_email <> ''
     173                                        ORDER BY ban_email";
    172174                        break;
    173175                }
     
    182184
    183185                        $time_length = ($row['ban_end']) ? ($row['ban_end'] - $row['ban_start']) / 60 : 0;
    184                         $ban_length[$row['ban_id']] = (isset($ban_end_text[$time_length])) ? $ban_end_text[$time_length] : $user->lang['UNTIL'] . ' -> ' . $user->format_date($row['ban_end']);
     186
     187                        if ($time_length == 0)
     188                        {
     189                                // Banned permanently
     190                                $ban_length[$row['ban_id']] = $user->lang['PERMANENT'];
     191                        }
     192                        else if (isset($ban_end_text[$time_length]))
     193                        {
     194                                // Banned for a given duration
     195                                $ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DURATION'], $ban_end_text[$time_length], $user->format_date($row['ban_end'], false, true));
     196                        }
     197                        else
     198                        {
     199                                // Banned until given date
     200                                $ban_length[$row['ban_id']] = sprintf($user->lang['BANNED_UNTIL_DATE'], $user->format_date($row['ban_end'], false, true));
     201                        }
    185202
    186203                        $ban_reasons[$row['ban_id']] = $row['ban_reason'];
  • trunk/forum/includes/acp/acp_bbcodes.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_bbcodes.php 8743 2008-08-12 16:03:18Z Kellanved $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    125125                        case 'create':
    126126
    127                                 $data = $this->build_regexp($bbcode_match, $bbcode_tpl);
    128 
    129                                 // Make sure the user didn't pick a "bad" name for the BBCode tag.
    130                                 $hard_coded = array('code', 'quote', 'quote=', 'attachment', 'attachment=', 'b', 'i', 'url', 'url=', 'img', 'size', 'size=', 'color', 'color=', 'u', 'list', 'list=', 'email', 'email=', 'flash', 'flash=');
    131 
    132                                 if (($action == 'modify' && strtolower($data['bbcode_tag']) !== strtolower($row['bbcode_tag'])) || ($action == 'create'))
    133                                 {
    134                                         $sql = 'SELECT 1 as test
    135                                                 FROM ' . BBCODES_TABLE . "
    136                                                 WHERE LOWER(bbcode_tag) = '" . $db->sql_escape(strtolower($data['bbcode_tag'])) . "'";
    137                                         $result = $db->sql_query($sql);
    138                                         $info = $db->sql_fetchrow($result);
    139                                         $db->sql_freeresult($result);
    140 
    141                                         // Grab the end, interrogate the last closing tag
    142                                         if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || (preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs) && in_array(strtolower($regs[1]), $hard_coded)))
    143                                         {
    144                                                 trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING);
    145                                         }
    146                                 }
    147 
    148                                 if (substr($data['bbcode_tag'], -1) === '=')
    149                                 {
    150                                         $test = substr($data['bbcode_tag'], 0, -1);
    151                                 }
    152                                 else
    153                                 {
    154                                         $test = $data['bbcode_tag'];
    155                                 }
    156 
    157                                 if (!preg_match('%\\[' . $test . '[^]]*].*?\\[/' . $test . ']%s', $bbcode_match))
    158                                 {
    159                                         trigger_error($user->lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($this->u_action), E_USER_WARNING);
    160                                 }
    161 
    162                                 if (strlen($data['bbcode_tag']) > 16)
    163                                 {
    164                                         trigger_error($user->lang['BBCODE_TAG_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
    165                                 }
    166 
    167                                 if (strlen($bbcode_match) > 4000)
    168                                 {
    169                                         trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
    170                                 }
    171                                
    172                                
    173                                 if (strlen($bbcode_helpline) > 255)
    174                                 {
    175                                         trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
    176                                 }
    177 
    178                                 $sql_ary = array(
    179                                         'bbcode_tag'                            => $data['bbcode_tag'],
    180                                         'bbcode_match'                          => $bbcode_match,
    181                                         'bbcode_tpl'                            => $bbcode_tpl,
    182                                         'display_on_posting'            => $display_on_posting,
    183                                         'bbcode_helpline'                       => $bbcode_helpline,
    184                                         'first_pass_match'                      => $data['first_pass_match'],
    185                                         'first_pass_replace'            => $data['first_pass_replace'],
    186                                         'second_pass_match'                     => $data['second_pass_match'],
    187                                         'second_pass_replace'           => $data['second_pass_replace']
    188                                 );
    189 
    190                                 if ($action == 'create')
    191                                 {
    192                                         $sql = 'SELECT MAX(bbcode_id) as max_bbcode_id
    193                                                 FROM ' . BBCODES_TABLE;
    194                                         $result = $db->sql_query($sql);
    195                                         $row = $db->sql_fetchrow($result);
    196                                         $db->sql_freeresult($result);
    197 
    198                                         if ($row)
    199                                         {
    200                                                 $bbcode_id = $row['max_bbcode_id'] + 1;
    201 
    202                                                 // Make sure it is greater than the core bbcode ids...
    203                                                 if ($bbcode_id <= NUM_CORE_BBCODES)
     127                                $warn_text = preg_match('%<[^>]*\{text[\d]*\}[^>]*>%i', $bbcode_tpl);
     128                                if (!$warn_text || confirm_box(true))
     129                                {
     130                                        $data = $this->build_regexp($bbcode_match, $bbcode_tpl);
     131
     132                                        // Make sure the user didn't pick a "bad" name for the BBCode tag.
     133                                        $hard_coded = array('code', 'quote', 'quote=', 'attachment', 'attachment=', 'b', 'i', 'url', 'url=', 'img', 'size', 'size=', 'color', 'color=', 'u', 'list', 'list=', 'email', 'email=', 'flash', 'flash=');
     134
     135                                        if (($action == 'modify' && strtolower($data['bbcode_tag']) !== strtolower($row['bbcode_tag'])) || ($action == 'create'))
     136                                        {
     137                                                $sql = 'SELECT 1 as test
     138                                                        FROM ' . BBCODES_TABLE . "
     139                                                        WHERE LOWER(bbcode_tag) = '" . $db->sql_escape(strtolower($data['bbcode_tag'])) . "'";
     140                                                $result = $db->sql_query($sql);
     141                                                $info = $db->sql_fetchrow($result);
     142                                                $db->sql_freeresult($result);
     143
     144                                                // Grab the end, interrogate the last closing tag
     145                                                if ($info['test'] === '1' || in_array(strtolower($data['bbcode_tag']), $hard_coded) || (preg_match('#\[/([^[]*)]$#', $bbcode_match, $regs) && in_array(strtolower($regs[1]), $hard_coded)))
     146                                                {
     147                                                        trigger_error($user->lang['BBCODE_INVALID_TAG_NAME'] . adm_back_link($this->u_action), E_USER_WARNING);
     148                                                }
     149                                        }
     150
     151                                        if (substr($data['bbcode_tag'], -1) === '=')
     152                                        {
     153                                                $test = substr($data['bbcode_tag'], 0, -1);
     154                                        }
     155                                        else
     156                                        {
     157                                                $test = $data['bbcode_tag'];
     158                                        }
     159
     160                                        if (!preg_match('%\\[' . $test . '[^]]*].*?\\[/' . $test . ']%s', $bbcode_match))
     161                                        {
     162                                                trigger_error($user->lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($this->u_action), E_USER_WARNING);
     163                                        }
     164
     165                                        if (strlen($data['bbcode_tag']) > 16)
     166                                        {
     167                                                trigger_error($user->lang['BBCODE_TAG_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
     168                                        }
     169
     170                                        if (strlen($bbcode_match) > 4000)
     171                                        {
     172                                                trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
     173                                        }
     174
     175
     176                                        if (strlen($bbcode_helpline) > 255)
     177                                        {
     178                                                trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
     179                                        }
     180
     181                                        $sql_ary = array(
     182                                                'bbcode_tag'                            => $data['bbcode_tag'],
     183                                                'bbcode_match'                          => $bbcode_match,
     184                                                'bbcode_tpl'                            => $bbcode_tpl,
     185                                                'display_on_posting'            => $display_on_posting,
     186                                                'bbcode_helpline'                       => $bbcode_helpline,
     187                                                'first_pass_match'                      => $data['first_pass_match'],
     188                                                'first_pass_replace'            => $data['first_pass_replace'],
     189                                                'second_pass_match'                     => $data['second_pass_match'],
     190                                                'second_pass_replace'           => $data['second_pass_replace']
     191                                        );
     192
     193                                        if ($action == 'create')
     194                                        {
     195                                                $sql = 'SELECT MAX(bbcode_id) as max_bbcode_id
     196                                                        FROM ' . BBCODES_TABLE;
     197                                                $result = $db->sql_query($sql);
     198                                                $row = $db->sql_fetchrow($result);
     199                                                $db->sql_freeresult($result);
     200
     201                                                if ($row)
     202                                                {
     203                                                        $bbcode_id = $row['max_bbcode_id'] + 1;
     204
     205                                                        // Make sure it is greater than the core bbcode ids...
     206                                                        if ($bbcode_id <= NUM_CORE_BBCODES)
     207                                                        {
     208                                                                $bbcode_id = NUM_CORE_BBCODES + 1;
     209                                                        }
     210                                                }
     211                                                else
    204212                                                {
    205213                                                        $bbcode_id = NUM_CORE_BBCODES + 1;
    206214                                                }
     215
     216                                                if ($bbcode_id > 1511)
     217                                                {
     218                                                        trigger_error($user->lang['TOO_MANY_BBCODES'] . adm_back_link($this->u_action), E_USER_WARNING);
     219                                                }
     220
     221                                                $sql_ary['bbcode_id'] = (int) $bbcode_id;
     222
     223                                                $db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary));
     224                                                $cache->destroy('sql', BBCODES_TABLE);
     225
     226                                                $lang = 'BBCODE_ADDED';
     227                                                $log_action = 'LOG_BBCODE_ADD';
    207228                                        }
    208229                                        else
    209230                                        {
    210                                                 $bbcode_id = NUM_CORE_BBCODES + 1;
    211                                         }
    212 
    213                                         if ($bbcode_id > 1511)
    214                                         {
    215                                                 trigger_error($user->lang['TOO_MANY_BBCODES'] . adm_back_link($this->u_action), E_USER_WARNING);
    216                                         }
    217 
    218                                         $sql_ary['bbcode_id'] = (int) $bbcode_id;
    219 
    220                                         $db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary));
    221                                         $cache->destroy('sql', BBCODES_TABLE);
    222 
    223                                         $lang = 'BBCODE_ADDED';
    224                                         $log_action = 'LOG_BBCODE_ADD';
     231                                                $sql = 'UPDATE ' . BBCODES_TABLE . '
     232                                                        SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
     233                                                        WHERE bbcode_id = ' . $bbcode_id;
     234                                                $db->sql_query($sql);
     235                                                $cache->destroy('sql', BBCODES_TABLE);
     236
     237                                                $lang = 'BBCODE_EDITED';
     238                                                $log_action = 'LOG_BBCODE_EDIT';
     239                                        }
     240
     241                                        add_log('admin', $log_action, $data['bbcode_tag']);
     242
     243                                        trigger_error($user->lang[$lang] . adm_back_link($this->u_action));
    225244                                }
    226245                                else
    227246                                {
    228                                         $sql = 'UPDATE ' . BBCODES_TABLE . '
    229                                                 SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
    230                                                 WHERE bbcode_id = ' . $bbcode_id;
    231                                         $db->sql_query($sql);
    232                                         $cache->destroy('sql', BBCODES_TABLE);
    233 
    234                                         $lang = 'BBCODE_EDITED';
    235                                         $log_action = 'LOG_BBCODE_EDIT';
    236                                 }
    237 
    238                                 add_log('admin', $log_action, $data['bbcode_tag']);
    239 
    240                                 trigger_error($user->lang[$lang] . adm_back_link($this->u_action));
     247                                        confirm_box(false, $user->lang['BBCODE_DANGER'], build_hidden_fields(array(
     248                                                'action'                                => $action,
     249                                                'bbcode'                                => $bbcode_id,
     250                                                'bbcode_match'                  => $bbcode_match,
     251                                                'bbcode_tpl'                    => htmlspecialchars($bbcode_tpl),
     252                                                'bbcode_helpline'               => $bbcode_helpline,
     253                                                'display_on_posting'    => $display_on_posting,
     254                                                ))
     255                                        , 'confirm_bbcode.html');
     256                                }
    241257
    242258                        break;
     
    300316                $bbcode_match = trim($bbcode_match);
    301317                $bbcode_tpl = trim($bbcode_tpl);
     318                $utf8 = strpos($bbcode_match, 'INTTEXT') !== false;
     319
     320                // make sure we have utf8 support
     321                $utf8_pcre_properties = false;
     322                if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>=')))
     323                {
     324                        // While this is the proper range of PHP versions, PHP may not be linked with the bundled PCRE lib and instead with an older version
     325                        if (@preg_match('/\p{L}/u', 'a') !== false)
     326                        {
     327                                $utf8_pcre_properties = true;
     328                        }
     329                }
    302330
    303331                $fp_match = preg_quote($bbcode_match, '!');
     
    326354                        'SIMPLETEXT' => array(
    327355                                '!([a-zA-Z0-9-+.,_ ]+)!'         =>     "$1"
     356                        ),
     357                        'INTTEXT' => array(
     358                                ($utf8_pcre_properties) ? '!([\p{L}\p{N}\-+,_. ]+)!u' : '!([a-zA-Z0-9\-+,_. ]+)!u'       =>     "$1"
    328359                        ),
    329360                        'IDENTIFIER' => array(
     
    344375                        'TEXT' => '(.*?)',
    345376                        'SIMPLETEXT' => '([a-zA-Z0-9-+.,_ ]+)',
     377                        'INTTEXT' => ($utf8_pcre_properties) ? '([\p{L}\p{N}\-+,_. ]+)' : '([a-zA-Z0-9\-+,_. ]+)',
    346378                        'IDENTIFIER' => '([a-zA-Z0-9-_]+)',
    347379                        'COLOR' => '([a-zA-Z]+|#[0-9abcdefABCDEF]+)',
     
    351383                $pad = 0;
    352384                $modifiers = 'i';
     385                $modifiers .= ($utf8 && $utf8_pcre_properties) ? 'u' : '';
    353386
    354387                if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $bbcode_match, $m))
     
    399432
    400433                        $fp_match = '!' . $fp_match . '!' . $modifiers;
    401                         $sp_match = '!' . $sp_match . '!s';
     434                        $sp_match = '!' . $sp_match . '!s' . (($utf8) ? 'u' : '');
    402435
    403436                        if (strpos($fp_match, 'e') !== false)
  • trunk/forum/includes/acp/acp_board.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_board.php 8911 2008-09-23 13:03:33Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3030                global $db, $user, $auth, $template;
    3131                global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
     32                global $cache;
    3233
    3334                $user->add_lang('acp/board');
    3435
    3536                $action = request_var('action', '');
    36                 $submit = (isset($_POST['submit'])) ? true : false;
     37                $submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false;
    3738
    3839                $form_key = 'acp_board';
     
    6566                                                'legend2'                               => 'WARNINGS',
    6667                                                'warnings_expire_days'  => array('lang' => 'WARNINGS_EXPIRE',           'validate' => 'int',    'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
     68
     69                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    6770                                        )
    6871                                );
     
    8083                                                'allow_attachments'             => array('lang' => 'ALLOW_ATTACHMENTS',         'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    8184                                                'allow_pm_attach'               => array('lang' => 'ALLOW_PM_ATTACHMENTS',      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     85                                                'allow_pm_report'               => array('lang' => 'ALLOW_PM_REPORT',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    8286                                                'allow_bbcode'                  => array('lang' => 'ALLOW_BBCODE',                      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    8387                                                'allow_smilies'                 => array('lang' => 'ALLOW_SMILIES',                     'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     
    8690                                                'allow_bookmarks'               => array('lang' => 'ALLOW_BOOKMARKS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    8791                                                'allow_birthdays'               => array('lang' => 'ALLOW_BIRTHDAYS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
     92                                                'allow_quick_reply'             => array('lang' => 'ALLOW_QUICK_REPLY',         'validate' => 'bool',   'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
    8893
    8994                                                'legend2'                               => 'ACP_LOAD_SETTINGS',
     
    9499                                                'load_cpf_viewprofile'  => array('lang' => 'LOAD_CPF_VIEWPROFILE',      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    95100                                                'load_cpf_viewtopic'    => array('lang' => 'LOAD_CPF_VIEWTOPIC',        'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     101
     102                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    96103                                        )
    97104                                );
     
    109116                                                'avatar_max_height'             => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,),
    110117
     118                                                'allow_avatar'                  => array('lang' => 'ALLOW_AVATARS',                     'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    111119                                                'allow_avatar_local'    => array('lang' => 'ALLOW_LOCAL',                       'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    112120                                                'allow_avatar_remote'   => array('lang' => 'ALLOW_REMOTE',                      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    113121                                                'allow_avatar_upload'   => array('lang' => 'ALLOW_UPLOAD',                      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     122                                                'allow_avatar_remote_upload'=> array('lang' => 'ALLOW_REMOTE_UPLOAD', 'validate' => 'bool',     'type' => 'radio:yes_no', 'explain' => true),
    114123                                                'avatar_filesize'               => array('lang' => 'MAX_FILESIZE',                      'validate' => 'int:0',  'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
    115124                                                'avatar_min'                    => array('lang' => 'MIN_AVATAR_SIZE',           'validate' => 'int:0',  'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
     
    144153                                                'auth_img_pm'                   => array('lang' => 'ALLOW_IMG_PM',                      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    145154                                                'auth_flash_pm'                 => array('lang' => 'ALLOW_FLASH_PM',            'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    146                                                 'enable_pm_icons'               => array('lang' => 'ENABLE_PM_ICONS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false)
     155                                                'enable_pm_icons'               => array('lang' => 'ENABLE_PM_ICONS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     156
     157                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    147158                                        )
    148159                                );
     
    163174                                                'allow_bookmarks'               => array('lang' => 'ALLOW_BOOKMARKS',           'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
    164175                                                'enable_post_confirm'   => array('lang' => 'VISUAL_CONFIRM_POST',       'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => true),
     176                                                'allow_quick_reply'             => array('lang' => 'ALLOW_QUICK_REPLY',         'validate' => 'bool',   'type' => 'custom', 'method' => 'quick_reply', 'explain' => true),
    165177
    166178                                                'legend2'                               => 'POSTING',
    167                                                 'enable_queue_trigger'  => array('lang' => 'ENABLE_QUEUE_TRIGGER',      'validate' => 'bool',           'type' => 'radio:yes_no', 'explain' => true),
    168                                                 'queue_trigger_posts'   => array('lang' => 'QUEUE_TRIGGER_POSTS',       'validate' => 'int:0:250',      'type' => 'text:4:4', 'explain' => true),
    169179                                                'bump_type'                             => false,
    170180                                                'edit_time'                             => array('lang' => 'EDIT_TIME',                         'validate' => 'int:0',          'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
     181                                                'delete_time'                   => array('lang' => 'DELETE_TIME',                       'validate' => 'int:0',          'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']),
    171182                                                'display_last_edited'   => array('lang' => 'DISPLAY_LAST_EDITED',       'validate' => 'bool',           'type' => 'radio:yes_no', 'explain' => true),
    172183                                                'flood_interval'                => array('lang' => 'FLOOD_INTERVAL',            'validate' => 'int:0',          'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']),
     
    174185                                                'topics_per_page'               => array('lang' => 'TOPICS_PER_PAGE',           'validate' => 'int:1',          'type' => 'text:3:4', 'explain' => false),
    175186                                                'posts_per_page'                => array('lang' => 'POSTS_PER_PAGE',            'validate' => 'int:1',          'type' => 'text:3:4', 'explain' => false),
     187                                                'smilies_per_page'              => array('lang' => 'SMILIES_PER_PAGE',          'validate' => 'int:1',          'type' => 'text:3:4', 'explain' => false),
    176188                                                'hot_threshold'                 => array('lang' => 'HOT_THRESHOLD',                     'validate' => 'int:0',          'type' => 'text:3:4', 'explain' => true),
    177189                                                'max_poll_options'              => array('lang' => 'MAX_POLL_OPTIONS',          'validate' => 'int:2:127',      'type' => 'text:4:4', 'explain' => false),
    178190                                                'max_post_chars'                => array('lang' => 'CHAR_LIMIT',                        'validate' => 'int:0',          'type' => 'text:4:6', 'explain' => true),
     191                                                'min_post_chars'                => array('lang' => 'MIN_CHAR_LIMIT',            'validate' => 'int:0',          'type' => 'text:4:6', 'explain' => true),
    179192                                                'max_post_smilies'              => array('lang' => 'SMILIES_LIMIT',                     'validate' => 'int:0',          'type' => 'text:4:4', 'explain' => true),
    180193                                                'max_post_urls'                 => array('lang' => 'MAX_POST_URLS',                     'validate' => 'int:0',          'type' => 'text:5:4', 'explain' => true),
     
    183196                                                'max_post_img_width'    => array('lang' => 'MAX_POST_IMG_WIDTH',        'validate' => 'int:0',          'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
    184197                                                'max_post_img_height'   => array('lang' => 'MAX_POST_IMG_HEIGHT',       'validate' => 'int:0',          'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
     198
     199                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    185200                                        )
    186201                                );
     
    206221                                                'max_sig_img_width'             => array('lang' => 'MAX_SIG_IMG_WIDTH',         'validate' => 'int:0',  'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
    207222                                                'max_sig_img_height'    => array('lang' => 'MAX_SIG_IMG_HEIGHT',        'validate' => 'int:0',  'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
     223
     224                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    208225                                        )
    209226                                );
     
    219236
    220237                                                'require_activation'    => array('lang' => 'ACC_ACTIVATION',    'validate' => 'int',    'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true),
     238                                                'new_member_post_limit' => array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'text:4:4', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']),
     239                                                'new_member_group_default'=> array('lang' => 'NEW_MEMBER_GROUP_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
    221240                                                'min_name_chars'                => array('lang' => 'USERNAME_LENGTH',   'validate' => 'int:1',  'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true),
    222241                                                'min_pass_chars'                => array('lang' => 'PASSWORD_LENGTH',   'validate' => 'int:1',  'type' => 'custom', 'method' => 'password_length', 'explain' => true),
     
    236255                                                'coppa_mail'            => array('lang' => 'COPPA_MAIL',                'validate' => 'string', 'type' => 'textarea:5:40', 'explain' => true),
    237256                                                'coppa_fax'                     => array('lang' => 'COPPA_FAX',                 'validate' => 'string', 'type' => 'text:25:100', 'explain' => false),
     257
     258                                                'legend4'                       => 'ACP_SUBMIT_CHANGES',
     259                                        )
     260                                );
     261                        break;
     262
     263                        case 'feed':
     264                                $display_vars = array(
     265                                        'title' => 'ACP_FEED_MANAGEMENT',
     266                                        'vars'  => array(
     267                                                'legend1'                                       => 'ACP_FEED_GENERAL',
     268                                                'feed_enable'                           => array('lang' => 'ACP_FEED_ENABLE',                           'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     269                                                'feed_item_statistics'          => array('lang' => 'ACP_FEED_ITEM_STATISTICS',          'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true),
     270                                                'feed_http_auth'                        => array('lang' => 'ACP_FEED_HTTP_AUTH',                        'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true),
     271
     272                                                'legend2'                                       => 'ACP_FEED_POST_BASED',
     273                                                'feed_limit_post'                       => array('lang' => 'ACP_FEED_LIMIT',                            'validate' => 'int:5',  'type' => 'text:3:4',                           'explain' => true),
     274                                                'feed_overall'                          => array('lang' => 'ACP_FEED_OVERALL',                          'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     275                                                'feed_forum'                            => array('lang' => 'ACP_FEED_FORUM',                            'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     276                                                'feed_topic'                            => array('lang' => 'ACP_FEED_TOPIC',                            'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     277
     278                                                'legend3'                                       => 'ACP_FEED_TOPIC_BASED',
     279                                                'feed_limit_topic'                      => array('lang' => 'ACP_FEED_LIMIT',                            'validate' => 'int:5',  'type' => 'text:3:4',                           'explain' => true),
     280                                                'feed_topics_new'                       => array('lang' => 'ACP_FEED_TOPICS_NEW',                       'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     281                                                'feed_topics_active'            => array('lang' => 'ACP_FEED_TOPICS_ACTIVE',            'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     282                                                'feed_news_id'                          => array('lang' => 'ACP_FEED_NEWS',                                     'validate' => 'string', 'type' => 'custom', 'method' => 'select_news_forums', 'explain' => true),
     283
     284                                                'legend4'                                       => 'ACP_FEED_SETTINGS_OTHER',
     285                                                'feed_overall_forums'           => array('lang' => 'ACP_FEED_OVERALL_FORUMS',           'validate' => 'bool',   'type' => 'radio:enabled_disabled',     'explain' => true ),
     286                                                'feed_exclude_id'                       => array('lang' => 'ACP_FEED_EXCLUDE_ID',                       'validate' => 'string', 'type' => 'custom', 'method' => 'select_exclude_forums', 'explain' => true),
    238287                                        )
    239288                                );
     
    280329                                                'load_cpf_viewprofile'  => array('lang' => 'LOAD_CPF_VIEWPROFILE',      'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
    281330                                                'load_cpf_viewtopic'    => array('lang' => 'LOAD_CPF_VIEWTOPIC',        'validate' => 'bool',   'type' => 'radio:yes_no', 'explain' => false),
     331
     332                                                'legend4'                                       => 'ACP_SUBMIT_CHANGES',
    282333                                        )
    283334                                );
     
    313364                                                'server_port'                   => array('lang' => 'SERVER_PORT',               'validate' => 'int:0',                  'type' => 'text:5:5', 'explain' => true),
    314365                                                'script_path'                   => array('lang' => 'SCRIPT_PATH',               'validate' => 'script_path',    'type' => 'text::255', 'explain' => true),
     366
     367                                                'legend4'                                       => 'ACP_SUBMIT_CHANGES',
    315368                                        )
    316369                                );
     
    361414                                                'smtp_auth_method'              => array('lang' => 'SMTP_AUTH_METHOD',          'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true),
    362415                                                'smtp_username'                 => array('lang' => 'SMTP_USERNAME',                     'validate' => 'string', 'type' => 'text:25:255', 'explain' => true),
    363                                                 'smtp_password'                 => array('lang' => 'SMTP_PASSWORD',                     'validate' => 'string', 'type' => 'password:25:255', 'explain' => true)
     416                                                'smtp_password'                 => array('lang' => 'SMTP_PASSWORD',                     'validate' => 'string', 'type' => 'password:25:255', 'explain' => true),
     417
     418                                                'legend3'                                       => 'ACP_SUBMIT_CHANGES',
    364419                                        )
    365420                                );
     
    401456                        }
    402457
    403                         if ($config_name == 'auth_method')
     458                        if ($config_name == 'auth_method' || $config_name == 'feed_news_id' || $config_name == 'feed_exclude_id')
    404459                        {
    405460                                continue;
     
    418473                        {
    419474                                set_config($config_name, $config_value);
    420                         }
     475
     476                                if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
     477                                {
     478                                        enable_bitfield_column_flag(FORUMS_TABLE, 'forum_flags', log(FORUM_FLAG_QUICK_REPLY, 2));
     479                                }
     480                        }
     481                }
     482
     483                // Store news and exclude ids
     484                if ($mode == 'feed' && $submit)
     485                {
     486                        $cache->destroy('_feed_news_forum_ids');
     487                        $cache->destroy('_feed_excluded_forum_ids');
     488
     489                        $this->store_feed_forums(FORUM_OPTION_FEED_NEWS, 'feed_news_id');
     490                        $this->store_feed_forums(FORUM_OPTION_FEED_EXCLUDE, 'feed_exclude_id');
    421491                }
    422492
     
    795865
    796866        /**
     867        * Global quick reply enable/disable setting and button to enable in all forums
     868        */
     869        function quick_reply($value, $key)
     870        {
     871                global $user;
     872
     873                $radio_ary = array(1 => 'YES', 0 => 'NO');
     874
     875                return h_radio('config[allow_quick_reply]', $radio_ary, $value) .
     876                        '<br /><br /><input class="button2" type="submit" id="' . $key . '_enable" name="' . $key . '_enable" value="' . $user->lang['ALLOW_QUICK_REPLY_BUTTON'] . '" />';
     877        }
     878
     879
     880        /**
    797881        * Select default dateformat
    798882        */
     
    831915                <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />";
    832916        }
     917
     918        /**
     919        * Select multiple forums
     920        */
     921        function select_news_forums($value, $key)
     922        {
     923                global $user, $config;
     924
     925                $forum_list = make_forum_select(false, false, true, true, true, false, true);
     926
     927                // Build forum options
     928                $s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
     929                foreach ($forum_list as $f_id => $f_row)
     930                {
     931                        $f_row['selected'] = phpbb_optionget(FORUM_OPTION_FEED_NEWS, $f_row['forum_options']);
     932
     933                        $s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
     934                }
     935                $s_forum_options .= '</select>';
     936
     937                return $s_forum_options;
     938        }
     939
     940        function select_exclude_forums($value, $key)
     941        {
     942                global $user, $config;
     943
     944                $forum_list = make_forum_select(false, false, true, true, true, false, true);
     945
     946                // Build forum options
     947                $s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
     948                foreach ($forum_list as $f_id => $f_row)
     949                {
     950                        $f_row['selected'] = phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $f_row['forum_options']);
     951
     952                        $s_forum_options .= '<option value="' . $f_id . '"' . (($f_row['selected']) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
     953                }
     954                $s_forum_options .= '</select>';
     955
     956                return $s_forum_options;
     957        }
     958
     959        function store_feed_forums($option, $key)
     960        {
     961                global $db, $cache;
     962
     963                // Get key
     964                $values = request_var($key, array(0 => 0));
     965
     966                // Empty option bit for all forums
     967                $sql = 'UPDATE ' . FORUMS_TABLE . '
     968                        SET forum_options = forum_options - ' . (1 << $option) . '
     969                        WHERE ' . $db->sql_bit_and('forum_options', $option, '<> 0');
     970                $db->sql_query($sql);
     971
     972                // Already emptied for all...
     973                if (sizeof($values))
     974                {
     975                        // Set for selected forums
     976                        $sql = 'UPDATE ' . FORUMS_TABLE . '
     977                                SET forum_options = forum_options + ' . (1 << $option) . '
     978                                WHERE ' . $db->sql_in_set('forum_id', $values);
     979                        $db->sql_query($sql);
     980                }
     981
     982                // Empty sql cache for forums table because options changed
     983                $cache->destroy('sql', FORUMS_TABLE);
     984        }
     985
    833986}
    834987
  • trunk/forum/includes/acp/acp_captcha.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_captcha.php 8722 2008-07-29 15:13:13Z Kellanved $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3030                $user->add_lang('acp/board');
    3131
     32                include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
     33                $captchas = phpbb_captcha_factory::get_captcha_types();
    3234
    33                 $captcha_vars = array(
    34                         'captcha_gd_x_grid'                             => 'CAPTCHA_GD_X_GRID',
    35                         'captcha_gd_y_grid'                             => 'CAPTCHA_GD_Y_GRID',
    36                         'captcha_gd_foreground_noise'   => 'CAPTCHA_GD_FOREGROUND_NOISE',
    37                         'captcha_gd'                                    => 'CAPTCHA_GD_PREVIEWED'
    38                 );
     35                $selected = request_var('select_captcha', $config['captcha_plugin']);
     36                $selected = (isset($captchas['available'][$selected]) || isset($captchas['unavailable'][$selected])) ? $selected : $config['captcha_plugin'];
     37                $configure = request_var('configure', false);
    3938
    40                 if (isset($_GET['demo']))
     39
     40                // Oh, they are just here for the view
     41                if (isset($_GET['captcha_demo']))
    4142                {
    42                         $captcha_vars = array_keys($captcha_vars);
    43                         foreach ($captcha_vars as $captcha_var)
     43                        $this->deliver_demo($selected);
     44                }
     45
     46                // Delegate
     47                if ($configure)
     48                {
     49                        $config_captcha =& phpbb_captcha_factory::get_instance($selected);
     50                        $config_captcha->acp_page($id, $this);
     51                }
     52                else
     53                {
     54                        $config_vars = array(
     55                                'enable_confirm'                => array('tpl' => 'REG_ENABLE', 'default' => false),
     56                                'enable_post_confirm'   => array('tpl' => 'POST_ENABLE', 'default' => false),
     57                                'confirm_refresh'               => array('tpl' => 'CONFIRM_REFRESH', 'default' => false),
     58                                'max_reg_attempts'              => array('tpl' => 'REG_LIMIT', 'default' => 0),
     59                                'max_login_attempts'            => array('tpl' => 'MAX_LOGIN_ATTEMPTS', 'default' => 0),
     60                        );
     61
     62                        $this->tpl_name = 'acp_captcha';
     63                        $this->page_title = 'ACP_VC_SETTINGS';
     64                        $form_key = 'acp_captcha';
     65                        add_form_key($form_key);
     66
     67                        $submit = request_var('main_submit', false);
     68
     69                        if ($submit && check_form_key($form_key))
    4470                        {
    45                                 $config[$captcha_var] = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
     71                                foreach ($config_vars as $config_var => $options)
     72                                {
     73                                        set_config($config_var, request_var($config_var, $options['default']));
     74                                }
     75
     76                                if ($selected !== $config['captcha_plugin'])
     77                                {
     78                                        // sanity check
     79                                        if (isset($captchas['available'][$selected]))
     80                                        {
     81                                                $old_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
     82                                                $old_captcha->uninstall();
     83
     84                                                set_config('captcha_plugin', $selected);
     85                                                $new_captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
     86                                                $new_captcha->install();
     87
     88                                                add_log('admin', 'LOG_CONFIG_VISUAL');
     89                                        }
     90                                        else
     91                                        {
     92                                                trigger_error($user->lang['CAPTCHA_UNAVAILABLE'] . adm_back_link($this->u_action));
     93                                        }
     94                                }
     95                                trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
    4696                        }
    47                         if ($config['captcha_gd'])
     97                        else if ($submit)
    4898                        {
    49                                 include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
     99                                trigger_error($user->lang['FORM_INVALID'] . adm_back_link());
    50100                        }
    51101                        else
    52102                        {
    53                                 include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
     103                                $captcha_select = '';
     104                                foreach ($captchas['available'] as $value => $title)
     105                                {
     106                                        $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : '';
     107                                        $captcha_select .= '<option value="' . $value . '"' . $current . '>' . $user->lang[$title] . '</option>';
     108                                }
     109
     110                                foreach ($captchas['unavailable'] as $value => $title)
     111                                {
     112                                        $current = ($selected !== false && $value == $selected) ? ' selected="selected"' : '';
     113                                        $captcha_select .= '<option value="' . $value . '"' . $current . ' class="disabled-option">' . $user->lang[$title] . '</option>';
     114                                }
     115
     116                                $demo_captcha =& phpbb_captcha_factory::get_instance($selected);
     117
     118                                foreach ($config_vars as $config_var => $options)
     119                                {
     120                                        $template->assign_var($options['tpl'], (isset($_POST[$config_var])) ? request_var($config_var, $options['default']) : $config[$config_var]) ;
     121                                }
     122
     123                                $template->assign_vars(array(
     124                                        'CAPTCHA_PREVIEW_TPL'   => $demo_captcha->get_demo_template($id),
     125                                        'S_CAPTCHA_HAS_CONFIG'  => $demo_captcha->has_config(),
     126                                        'CAPTCHA_SELECT'                => $captcha_select,
     127                                ));
    54128                        }
    55                         $captcha = new captcha();
    56                         $captcha->execute(gen_rand_string(mt_rand(5, 8)), time());
    57                         exit;
    58129                }
     130        }
    59131
    60                 $config_vars = array(
    61                         'enable_confirm'                => 'REG_ENABLE',
    62                         'enable_post_confirm'   => 'POST_ENABLE',
    63                         'captcha_gd'                    => 'CAPTCHA_GD',
    64                 );
     132        /**
     133        * Entry point for delivering image CAPTCHAs in the ACP.
     134        */
     135        function deliver_demo($selected)
     136        {
     137                global $db, $user, $config;
    65138
    66                 $this->tpl_name = 'acp_captcha';
    67                 $this->page_title = 'ACP_VC_SETTINGS';
    68                 $form_key = 'acp_captcha';
    69                 add_form_key($form_key);
     139                $captcha =& phpbb_captcha_factory::get_instance($selected);
     140                $captcha->init(CONFIRM_REG);
     141                $captcha->execute_demo();
    70142
    71                 $submit = request_var('submit', '');
    72 
    73                 if ($submit && check_form_key($form_key))
    74                 {
    75                         $config_vars = array_keys($config_vars);
    76                         foreach ($config_vars as $config_var)
    77                         {
    78                                 set_config($config_var, request_var($config_var, ''));
    79                         }
    80                         $captcha_vars = array_keys($captcha_vars);
    81                         foreach ($captcha_vars as $captcha_var)
    82                         {
    83                                 $value = request_var($captcha_var, 0);
    84                                 if ($value >= 0)
    85                                 {
    86                                         set_config($captcha_var, $value);
    87                                 }
    88                         }
    89                         trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
    90                 }
    91                 else if ($submit)
    92                 {
    93                                 trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action));
    94                 }
    95                 else
    96                 {
    97 
    98                         $preview_image_src = append_sid(append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&amp;demo=demo"));
    99                         if (@extension_loaded('gd'))
    100                         {
    101                                 $template->assign_var('GD', true);
    102                         }
    103                         foreach ($config_vars as $config_var => $template_var)
    104                         {
    105                                 $template->assign_var($template_var, (isset($_REQUEST[$config_var])) ? request_var($config_var, '') : $config[$config_var]) ;
    106                         }
    107                         foreach ($captcha_vars as $captcha_var => $template_var)
    108                         {
    109                                 $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
    110                                 $template->assign_var($template_var, $var);
    111                                 $preview_image_src .= "&amp;$captcha_var=" . $var;
    112                         }
    113                         $template->assign_vars(array(
    114                                 'CAPTCHA_PREVIEW'       => $preview_image_src,
    115                                 'PREVIEW'                       => isset($_POST['preview']),
    116                         ));
    117 
    118                 }
     143                garbage_collection();
     144                exit_handler();
    119145        }
    120146}
  • trunk/forum/includes/acp/acp_database.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_database.php 8814 2008-09-04 12:01:47Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2828                global $cache, $db, $user, $auth, $template, $table_prefix;
    2929                global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
    30                
     30
    3131                $user->add_lang('acp/database');
    3232
     
    8383
    8484                                                @set_time_limit(1200);
     85                                                @set_time_limit(0);
    8586
    8687                                                $time = time();
     
    142143
    143144                                                                        case 'oracle':
    144                                                                                 $extractor->flush('TRUNCATE TABLE ' . $table_name . "\\\n");
     145                                                                                $extractor->flush('TRUNCATE TABLE ' . $table_name . "/\n");
    145146                                                                        break;
    146147
     
    188189                                                        'U_ACTION'      => $this->u_action . '&amp;action=download'
    189190                                                ));
    190                                                
     191
    191192                                                $available_methods = array('gzip' => 'zlib', 'bzip2' => 'bz2');
    192193
     
    425426                                                $dh = @opendir($dir);
    426427
     428                                                $backup_files = array();
     429
    427430                                                if ($dh)
    428431                                                {
     
    431434                                                                if (preg_match('#^backup_(\d{10,})_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches))
    432435                                                                {
    433                                                                         $supported = in_array($matches[2], $methods);
    434 
    435                                                                         if ($supported == 'true')
     436                                                                        if (in_array($matches[2], $methods))
    436437                                                                        {
    437                                                                                 $template->assign_block_vars('files', array(
    438                                                                                         'FILE'          => $file,
    439                                                                                         'NAME'          => gmdate("d-m-Y H:i:s", $matches[1]),
    440                                                                                         'SUPPORTED'     => $supported
    441                                                                                 ));
     438                                                                                $backup_files[gmdate("d-m-Y H:i:s", $matches[1])] = $file;
    442439                                                                        }
    443440                                                                }
    444441                                                        }
    445442                                                        closedir($dh);
     443                                                }
     444
     445                                                if (!empty($backup_files))
     446                                                {
     447                                                        krsort($backup_files);
     448
     449                                                        foreach ($backup_files as $name => $file)
     450                                                        {
     451                                                                $template->assign_block_vars('files', array(
     452                                                                        'FILE'          => $file,
     453                                                                        'NAME'          => $name,
     454                                                                        'SUPPORTED'     => true,
     455                                                                ));
     456                                                        }
    446457                                                }
    447458
     
    509520                        header("Content-Type: $mimetype; name=\"$name\"");
    510521                        header("Content-disposition: attachment; filename=$name");
    511        
     522
    512523                        switch ($format)
    513524                        {
     
    528539                        }
    529540                }
    530                
     541
    531542                if ($store == true)
    532543                {
    533544                        global $phpbb_root_path;
    534545                        $file = $phpbb_root_path . 'store/' . $filename . $ext;
    535        
     546
    536547                        $this->fp = $open($file, 'w');
    537        
     548
    538549                        if (!$this->fp)
    539550                        {
    540                                 trigger_error('Unable to write temporary file to storage folder', E_USER_ERROR);
     551                                trigger_error('FILE_WRITE_FAIL', E_USER_ERROR);
    541552                        }
    542553                }
     
    546557        {
    547558                static $close;
     559
    548560                if ($this->store)
    549561                {
     
    663675                {
    664676                        $fields_cnt = mysqli_num_fields($result);
    665                
     677
    666678                        // Get field information
    667679                        $field = mysqli_fetch_fields($result);
    668680                        $field_set = array();
    669                
     681
    670682                        for ($j = 0; $j < $fields_cnt; $j++)
    671683                        {
     
    680692                        $query_len              = 0;
    681693                        $max_len                = get_usable_memory();
    682                
     694
    683695                        while ($row = mysqli_fetch_row($result))
    684696                        {
     
    751763                        }
    752764                        $field_set = array();
    753                        
     765
    754766                        for ($j = 0; $j < $fields_cnt; $j++)
    755767                        {
     
    967979                }
    968980                $db->sql_freeresult($result);
    969                
     981
    970982                foreach ($ar as $value)
    971983                {
     
    11251137                }
    11261138                $db->sql_freeresult($result);
    1127        
     1139
    11281140                $field_query = "SELECT a.attnum, a.attname as field, t.typname as type, a.attlen as length, a.atttypmod as lengthvar, a.attnotnull as notnull
    11291141                        FROM pg_class c, pg_attribute a, pg_type t
     
    11461158                                        AND d.adnum = " . $row['attnum'];
    11471159                        $def_res = $db->sql_query($sql_get_default);
    1148 
    1149                         if (!$def_res)
     1160                        $def_row = $db->sql_fetchrow($def_res);
     1161                        $db->sql_freeresult($def_res);
     1162
     1163                        if (empty($def_row))
    11501164                        {
    11511165                                unset($row['rowdefault']);
     
    11531167                        else
    11541168                        {
    1155                                 $row['rowdefault'] = $db->sql_fetchfield('rowdefault', false, $def_res);
    1156                         }
    1157                         $db->sql_freeresult($def_res);
     1169                                $row['rowdefault'] = $def_row['rowdefault'];
     1170                        }
    11581171
    11591172                        if ($row['type'] == 'bpchar')
     
    11891202                                $line .= ' NOT NULL';
    11901203                        }
    1191                        
     1204
    11921205                        $lines[] = $line;
    11931206                }
     
    13891402                $sql_data .= "\nCREATE TABLE [$table_name] (\n";
    13901403                $rows = array();
    1391        
     1404
    13921405                $text_flag = false;
    1393        
     1406
    13941407                $sql = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') as IS_IDENTITY
    13951408                        FROM INFORMATION_SCHEMA.COLUMNS
    13961409                        WHERE TABLE_NAME = '$table_name'";
    13971410                $result = $db->sql_query($sql);
    1398        
     1411
    13991412                while ($row = $db->sql_fetchrow($result))
    14001413                {
    14011414                        $line = "\t[{$row['COLUMN_NAME']}] [{$row['DATA_TYPE']}]";
    1402        
     1415
    14031416                        if ($row['DATA_TYPE'] == 'text')
    14041417                        {
    14051418                                $text_flag = true;
    14061419                        }
    1407        
     1420
    14081421                        if ($row['IS_IDENTITY'])
    14091422                        {
    14101423                                $line .= ' IDENTITY (1 , 1)';
    14111424                        }
    1412        
     1425
    14131426                        if ($row['CHARACTER_MAXIMUM_LENGTH'] && $row['DATA_TYPE'] !== 'text')
    14141427                        {
    14151428                                $line .= ' (' . $row['CHARACTER_MAXIMUM_LENGTH'] . ')';
    14161429                        }
    1417        
     1430
    14181431                        if ($row['IS_NULLABLE'] == 'YES')
    14191432                        {
     
    14241437                                $line .= ' NOT NULL';
    14251438                        }
    1426        
     1439
    14271440                        if ($row['COLUMN_DEFAULT'])
    14281441                        {
    14291442                                $line .= ' DEFAULT ' . $row['COLUMN_DEFAULT'];
    14301443                        }
    1431        
     1444
    14321445                        $rows[] = $line;
    14331446                }
    14341447                $db->sql_freeresult($result);
    1435        
     1448
    14361449                $sql_data .= implode(",\n", $rows);
    14371450                $sql_data .= "\n) ON [PRIMARY]";
    1438        
     1451
    14391452                if ($text_flag)
    14401453                {
    14411454                        $sql_data .= " TEXTIMAGE_ON [PRIMARY]";
    14421455                }
    1443        
     1456
    14441457                $sql_data .= "\nGO\n\n";
    14451458                $rows = array();
    1446        
     1459
    14471460                $sql = "SELECT CONSTRAINT_NAME, COLUMN_NAME
    14481461                        FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
     
    14641477                }
    14651478                $db->sql_freeresult($result);
    1466        
     1479
    14671480                $index = array();
    14681481                $sql = "EXEC sp_statistics '$table_name'";
     
    14761489                }
    14771490                $db->sql_freeresult($result);
    1478        
     1491
    14791492                foreach ($index as $index_name => $column_name)
    14801493                {
    14811494                        $index[$index_name] = implode(', ', $column_name);
    14821495                }
    1483        
     1496
    14841497                foreach ($index as $index_name => $columns)
    14851498                {
     
    15091522                $ident_set = false;
    15101523                $sql_data = '';
    1511                
     1524
    15121525                // Grab all of the data from current table.
    15131526                $sql = "SELECT *
     
    16031616                $ident_set = false;
    16041617                $sql_data = '';
    1605                
     1618
    16061619                // Grab all of the data from current table.
    16071620                $sql = "SELECT *
     
    17041717                global $db;
    17051718                $sql_data = '-- Table: ' . $table_name . "\n";
    1706                 $sql_data .= "DROP TABLE $table_name;\n";
    1707                 $sql_data .= '\\' . "\n";
     1719                $sql_data .= "DROP TABLE $table_name\n/\n";
    17081720                $sql_data .= "\nCREATE TABLE $table_name (\n";
    17091721
     
    17201732                        if ($row['data_type'] !== 'CLOB')
    17211733                        {
    1722                                 if ($row['data_type'] !== 'VARCHAR2')
     1734                                if ($row['data_type'] !== 'VARCHAR2' && $row['data_type'] !== 'CHAR')
    17231735                                {
    17241736                                        $line .= '(' . $row['data_precision'] . ')';
     
    17501762                $result = $db->sql_query($sql);
    17511763
    1752                 while ($row = $db->sql_fetchrow($result))
    1753                 {
    1754                         $rows[] = "  CONSTRAINT {$row['constraint_name']} PRIMARY KEY ({$row['column_name']})";
    1755                 }
    1756                 $db->sql_freeresult($result);
     1764                $primary_key = array();
     1765                $contraint_name = '';
     1766                while ($row = $db->sql_fetchrow($result))
     1767                {
     1768                        $constraint_name = '"' . $row['constraint_name'] . '"';
     1769                        $primary_key[] = '"' . $row['column_name'] . '"';
     1770                }
     1771                $db->sql_freeresult($result);
     1772
     1773                if (sizeof($primary_key))
     1774                {
     1775                        $rows[] = "  CONSTRAINT {$constraint_name} PRIMARY KEY (" . implode(', ', $primary_key) . ')';
     1776                }
    17571777
    17581778                $sql = "SELECT A.CONSTRAINT_NAME, A.COLUMN_NAME
     
    17631783                $result = $db->sql_query($sql);
    17641784
    1765                 while ($row = $db->sql_fetchrow($result))
    1766                 {
    1767                         $rows[] = "  CONSTRAINT {$row['constraint_name']} UNIQUE ({$row['column_name']})";
    1768                 }
    1769                 $db->sql_freeresult($result);
     1785                $unique = array();
     1786                $contraint_name = '';
     1787                while ($row = $db->sql_fetchrow($result))
     1788                {
     1789                        $constraint_name = '"' . $row['constraint_name'] . '"';
     1790                        $unique[] = '"' . $row['column_name'] . '"';
     1791                }
     1792                $db->sql_freeresult($result);
     1793
     1794                if (sizeof($unique))
     1795                {
     1796                        $rows[] = "  CONSTRAINT {$constraint_name} UNIQUE (" . implode(', ', $unique) . ')';
     1797                }
    17701798
    17711799                $sql_data .= implode(",\n", $rows);
    1772                 $sql_data .= "\n)\n\\";
    1773 
    1774                 $sql = "SELECT A.REFERENCED_NAME
    1775                         FROM USER_DEPENDENCIES A, USER_TRIGGERS B
     1800                $sql_data .= "\n)\n/\n";
     1801
     1802                $sql = "SELECT A.REFERENCED_NAME, C.*
     1803                        FROM USER_DEPENDENCIES A, USER_TRIGGERS B, USER_SEQUENCES C
    17761804                        WHERE A.REFERENCED_TYPE = 'SEQUENCE'
    17771805                                AND A.NAME = B.TRIGGER_NAME
    1778                                 AND B. TABLE_NAME = '{$table_name}'";
     1806                                AND B.TABLE_NAME = '{$table_name}'
     1807                                AND C.SEQUENCE_NAME = A.REFERENCED_NAME";
    17791808                $result = $db->sql_query($sql);
    1780                 while ($row = $db->sql_fetchrow($result))
    1781                 {
    1782                         $sql_data .= "\nCREATE SEQUENCE {$row['referenced_name']}\\\n";
     1809
     1810                $type = request_var('type', '');
     1811
     1812                while ($row = $db->sql_fetchrow($result))
     1813                {
     1814                        $sql_data .= "\nDROP SEQUENCE \"{$row['referenced_name']}\"\n/\n";
     1815                        $sql_data .= "\nCREATE SEQUENCE \"{$row['referenced_name']}\"";
     1816
     1817                        if ($type == 'full')
     1818                        {
     1819                                $sql_data .= ' START WITH ' . $row['last_number'];
     1820                        }
     1821
     1822                        $sql_data .= "\n/\n";
    17831823                }
    17841824                $db->sql_freeresult($result);
     
    17901830                while ($row = $db->sql_fetchrow($result))
    17911831                {
    1792                         $sql_data .= "\nCREATE OR REPLACE TRIGGER {$row['description']}WHEN ({$row['when_clause']})\n{$row['trigger_body']}\\";
     1832                        $sql_data .= "\nCREATE OR REPLACE TRIGGER {$row['description']}WHEN ({$row['when_clause']})\n{$row['trigger_body']}\n/\n";
    17931833                }
    17941834                $db->sql_freeresult($result);
     
    18101850                foreach ($index as $index_name => $column_names)
    18111851                {
    1812                         $sql_data .= "\nCREATE INDEX $index_name ON $table_name(" . implode(', ', $column_names) . ")\n\\";
     1852                        $sql_data .= "\nCREATE INDEX $index_name ON $table_name(" . implode(', ', $column_names) . ")\n/\n";
    18131853                }
    18141854                $db->sql_freeresult($result);
     
    18201860                global $db;
    18211861                $ary_type = $ary_name = array();
    1822                
     1862
    18231863                // Grab all of the data from current table.
    18241864                $sql = "SELECT *
     
    18431883                        for ($i = 0; $i < $i_num_fields; $i++)
    18441884                        {
    1845                                 $str_val = $row[$ary_name[$i]];
    1846 
    1847                                 if (preg_match('#char|text|bool|raw#i', $ary_type[$i]))
     1885                                // Oracle uses uppercase - we use lowercase
     1886                                $str_val = $row[strtolower($ary_name[$i])];
     1887
     1888                                if (preg_match('#char|text|bool|raw|clob#i', $ary_type[$i]))
    18481889                                {
    18491890                                        $str_quote = '';
     
    18741915
    18751916                                $schema_vals[$i] = $str_quote . $str_val . $str_quote;
    1876                                 $schema_fields[$i] = '"' . $ary_name[$i] . "'";
     1917                                $schema_fields[$i] = '"' . $ary_name[$i] . '"';
    18771918                        }
    18781919
    18791920                        // Take the ordered fields and their associated data and build it
    18801921                        // into a valid sql statement to recreate that field in the data.
    1881                         $sql_data = "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\n";
     1922                        $sql_data = "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ")\n/\n";
    18821923
    18831924                        $this->flush($sql_data);
     
    19161957                global $db;
    19171958                $ary_type = $ary_name = array();
    1918                
     1959
    19191960                // Grab all of the data from current table.
    19201961                $sql = "SELECT *
     
    21982239function sanitize_data_oracle($text)
    21992240{
    2200         $data = preg_split('/[\0\n\t\r\b\f\'"\\\]/', $text);
    2201         preg_match_all('/[\0\n\t\r\b\f\'"\\\]/', $text, $matches);
     2241//      $data = preg_split('/[\0\n\t\r\b\f\'"\/\\\]/', $text);
     2242//      preg_match_all('/[\0\n\t\r\b\f\'"\/\\\]/', $text, $matches);
     2243        $data = preg_split('/[\0\b\f\'\/]/', $text);
     2244        preg_match_all('/[\0\r\b\f\'\/]/', $text, $matches);
    22022245
    22032246        $val = array();
     
    22452288        $record = '';
    22462289        $delim_len = strlen($delim);
    2247        
     2290
    22482291        while (!$eof($fp))
    22492292        {
  • trunk/forum/includes/acp/acp_email.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_email.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    109109                                        trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING);
    110110                                }
    111        
     111
    112112                                $i = $j = 0;
    113113
     
    122122                                        if (($row['user_notify_type'] == NOTIFY_EMAIL && $row['user_email']) ||
    123123                                                ($row['user_notify_type'] == NOTIFY_IM && $row['user_jabber']) ||
    124                                                 ($row['user_notify_type'] == NOTIFY_BOTH && $row['user_email'] && $row['user_jabber']))
     124                                                ($row['user_notify_type'] == NOTIFY_BOTH && ($row['user_email'] || $row['user_jabber'])))
    125125                                        {
    126126                                                if ($i == $max_chunk_size || $row['user_lang'] != $old_lang || $row['user_notify_type'] != $old_notify_type)
     
    174174                                        $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
    175175                                        $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
    176                        
     176
    177177                                        $messenger->subject(htmlspecialchars_decode($subject));
    178178                                        $messenger->set_mail_priority($priority);
     
    182182                                                'MESSAGE'               => htmlspecialchars_decode($message))
    183183                                        );
    184        
     184
    185185                                        if (!($messenger->send($used_method)))
    186186                                        {
     
    240240                $select_list = '<option value="0"' . ((!$group_id) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>';
    241241                $select_list .= group_select_options($group_id, $exclude);
    242                
     242
    243243                $s_priority_options = '<option value="' . MAIL_LOW_PRIORITY . '">' . $user->lang['MAIL_LOW_PRIORITY'] . '</option>';
    244244                $s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
  • trunk/forum/includes/acp/acp_forums.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_forums.php 8898 2008-09-19 17:07:13Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    140140                                                'enable_prune'                  => request_var('enable_prune', false),
    141141                                                'enable_post_review'    => request_var('enable_post_review', true),
     142                                                'enable_quick_reply'    => request_var('enable_quick_reply', false),
    142143                                                'prune_days'                    => request_var('prune_days', 7),
    143144                                                'prune_viewed'                  => request_var('prune_viewed', 7),
     
    151152                                        );
    152153
     154                                        // On add, add empty forum_options... else do not consider it (not updating it)
     155                                        if ($action == 'add')
     156                                        {
     157                                                $forum_data['forum_options'] = 0;
     158                                        }
     159
    153160                                        // Use link_display_on_index setting if forum type is link
    154161                                        if ($forum_data['forum_type'] == FORUM_LINK)
     
    163170                                        }
    164171
    165                                         $forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? request_var('display_recent', false) : request_var('display_active', false);
     172                                        $forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? request_var('display_recent', true) : request_var('display_active', true);
    166173
    167174                                        // Get data for forum rules if specified...
     
    182189                                        {
    183190                                                $forum_perm_from = request_var('forum_perm_from', 0);
     191                                                $cache->destroy('sql', FORUMS_TABLE);
    184192
    185193                                                // Copy permissions?
    186                                                 if ($forum_perm_from && !empty($forum_perm_from) && $forum_perm_from != $forum_data['forum_id'] &&
    187                                                         (($action != 'edit') || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))))
     194                                                if ($forum_perm_from && $forum_perm_from != $forum_data['forum_id'] &&
     195                                                        ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))))
    188196                                                {
    189                                                         // if we edit a forum delete current permissions first
    190                                                         if ($action == 'edit')
    191                                                         {
    192                                                                 $sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
    193                                                                         WHERE forum_id = ' . (int) $forum_data['forum_id'];
    194                                                                 $db->sql_query($sql);
    195 
    196                                                                 $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
    197                                                                         WHERE forum_id = ' . (int) $forum_data['forum_id'];
    198                                                                 $db->sql_query($sql);
    199                                                         }
    200 
    201                                                         // From the mysql documentation:
    202                                                         // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
    203                                                         // Due to this we stay on the safe side if we do the insertion "the manual way"
    204 
    205                                                         // Copy permisisons from/to the acl users table (only forum_id gets changed)
    206                                                         $sql = 'SELECT user_id, auth_option_id, auth_role_id, auth_setting
    207                                                                 FROM ' . ACL_USERS_TABLE . '
    208                                                                 WHERE forum_id = ' . $forum_perm_from;
    209                                                         $result = $db->sql_query($sql);
    210 
    211                                                         $users_sql_ary = array();
    212                                                         while ($row = $db->sql_fetchrow($result))
    213                                                         {
    214                                                                 $users_sql_ary[] = array(
    215                                                                         'user_id'                       => (int) $row['user_id'],
    216                                                                         'forum_id'                      => (int) $forum_data['forum_id'],
    217                                                                         'auth_option_id'        => (int) $row['auth_option_id'],
    218                                                                         'auth_role_id'          => (int) $row['auth_role_id'],
    219                                                                         'auth_setting'          => (int) $row['auth_setting']
    220                                                                 );
    221                                                         }
    222                                                         $db->sql_freeresult($result);
    223 
    224                                                         // Copy permisisons from/to the acl groups table (only forum_id gets changed)
    225                                                         $sql = 'SELECT group_id, auth_option_id, auth_role_id, auth_setting
    226                                                                 FROM ' . ACL_GROUPS_TABLE . '
    227                                                                 WHERE forum_id = ' . $forum_perm_from;
    228                                                         $result = $db->sql_query($sql);
    229 
    230                                                         $groups_sql_ary = array();
    231                                                         while ($row = $db->sql_fetchrow($result))
    232                                                         {
    233                                                                 $groups_sql_ary[] = array(
    234                                                                         'group_id'                      => (int) $row['group_id'],
    235                                                                         'forum_id'                      => (int) $forum_data['forum_id'],
    236                                                                         'auth_option_id'        => (int) $row['auth_option_id'],
    237                                                                         'auth_role_id'          => (int) $row['auth_role_id'],
    238                                                                         'auth_setting'          => (int) $row['auth_setting']
    239                                                                 );
    240                                                         }
    241                                                         $db->sql_freeresult($result);
    242 
    243                                                         // Now insert the data
    244                                                         $db->sql_multi_insert(ACL_USERS_TABLE, $users_sql_ary);
    245                                                         $db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
     197                                                        copy_forum_permissions($forum_perm_from, $forum_data['forum_id'], ($action == 'edit') ? true : false);
    246198                                                        cache_moderators();
    247199                                                }
    248 
     200/* Commented out because of questionable UI workflow - re-visit for 3.0.7
     201                                                else if (!$this->parent_id && $action != 'edit' && $auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))
     202                                                {
     203                                                        $this->copy_permission_page($forum_data);
     204                                                        return;
     205                                                }
     206*/
    249207                                                $auth->acl_clear_prefetch();
    250                                                 $cache->destroy('sql', FORUMS_TABLE);
    251208
    252209                                                $acl_url = '&amp;mode=setting_forum_local&amp;forum_id[]=' . $forum_data['forum_id'];
     
    424381                                        $forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0;
    425382                                        $forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? FORUM_FLAG_POST_REVIEW : 0;
     383                                        $forum_data['forum_flags'] += (request_var('enable_quick_reply', false)) ? FORUM_FLAG_QUICK_REPLY : 0;
    426384                                }
    427385
     
    485443                                                        'prune_viewed'                  => 7,
    486444                                                        'prune_freq'                    => 1,
    487                                                         'forum_flags'                   => FORUM_FLAG_POST_REVIEW,
     445                                                        'forum_flags'                   => FORUM_FLAG_POST_REVIEW + FORUM_FLAG_ACTIVE_TOPICS,
     446                                                        'forum_options'                 => 0,
    488447                                                        'forum_password'                => '',
    489448                                                        'forum_password_confirm'=> '',
     
    561520                                        WHERE forum_type = ' . FORUM_POST . "
    562521                                                AND forum_id <> $forum_id";
    563                                 $result = $db->sql_query($sql);
    564 
     522                                $result = $db->sql_query_limit($sql, 1);
     523
     524                                $postable_forum_exists = false;
    565525                                if ($db->sql_fetchrow($result))
    566526                                {
    567                                         $template->assign_vars(array(
    568                                                 'S_MOVE_FORUM_OPTIONS'          => make_forum_select($forum_data['parent_id'], $forum_id, false, true, false))
    569                                         );
     527                                        $postable_forum_exists = true;
    570528                                }
    571529                                $db->sql_freeresult($result);
     
    584542                                        $forums_list = make_forum_select($forum_data['parent_id'], $subforums_id);
    585543
    586                                         $sql = 'SELECT forum_id
    587                                                 FROM ' . FORUMS_TABLE . '
    588                                                 WHERE forum_type = ' . FORUM_POST . "
    589                                                         AND forum_id <> $forum_id";
    590                                         $result = $db->sql_query($sql);
    591 
    592                                         if ($db->sql_fetchrow($result))
     544                                        if ($postable_forum_exists)
    593545                                        {
    594546                                                $template->assign_vars(array(
     
    596548                                                );
    597549                                        }
    598                                         $db->sql_freeresult($result);
    599550
    600551                                        $template->assign_vars(array(
    601552                                                'S_HAS_SUBFORUMS'               => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false,
    602553                                                'S_FORUMS_LIST'                 => $forums_list)
     554                                        );
     555                                }
     556                                else if ($postable_forum_exists)
     557                                {
     558                                        $template->assign_vars(array(
     559                                                'S_MOVE_FORUM_OPTIONS'          => make_forum_select($forum_data['parent_id'], $forum_id, false, true, false))
    603560                                        );
    604561                                }
     
    685642                                        'S_DISPLAY_ACTIVE_TOPICS'       => ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) ? true : false,
    686643                                        'S_ENABLE_POST_REVIEW'          => ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false,
     644                                        'S_ENABLE_QUICK_REPLY'          => ($forum_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) ? true : false,
    687645                                        'S_CAN_COPY_PERMISSIONS'        => ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false,
    688646                                ));
     
    715673                                        WHERE forum_type = ' . FORUM_POST . "
    716674                                                AND forum_id <> $forum_id";
    717                                 $result = $db->sql_query($sql);
     675                                $result = $db->sql_query_limit($sql, 1);
    718676
    719677                                if ($db->sql_fetchrow($result))
     
    743701                                return;
    744702                        break;
     703
     704                        case 'copy_perm':
     705                                $forum_perm_from = request_var('forum_perm_from', 0);
     706
     707                                // Copy permissions?
     708                                if (!empty($forum_perm_from) && $forum_perm_from != $forum_id)
     709                                {
     710                                        copy_forum_permissions($forum_perm_from, $forum_id, true);
     711                                        cache_moderators();
     712                                        $auth->acl_clear_prefetch();
     713                                        $cache->destroy('sql', FORUMS_TABLE);
     714
     715                                        $acl_url = '&amp;mode=setting_forum_local&amp;forum_id[]=' . $forum_id;
     716
     717                                        $message = $user->lang['FORUM_UPDATED'];
     718
     719                                        // Redirect to permissions
     720                                        if ($auth->acl_get('a_fauth'))
     721                                        {
     722                                                $message .= '<br /><br />' . sprintf($user->lang['REDIRECT_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
     723                                        }
     724
     725                                        trigger_error($message . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
     726                                }
     727
     728                        break;
    745729                }
    746730
     
    807791
    808792                                $url = $this->u_action . "&amp;parent_id=$this->parent_id&amp;f={$row['forum_id']}";
    809 
    810                                 $forum_title = ($forum_type != FORUM_LINK) ? '<a href="' . $this->u_action . '&amp;parent_id=' . $row['forum_id'] . '">' : '';
    811                                 $forum_title .= $row['forum_name'];
    812                                 $forum_title .= ($forum_type != FORUM_LINK) ? '</a>' : '';
    813793
    814794                                $template->assign_block_vars('forums', array(
     
    889869        function update_forum_data(&$forum_data)
    890870        {
    891                 global $db, $user, $cache;
     871                global $db, $user, $cache, $phpbb_root_path;
    892872
    893873                $errors = array();
     
    926906                        array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data['forum_topics_per_page'], 'column_type' => 'TINT:0'),
    927907                );
     908
     909                if (!empty($forum_data['forum_image']) && !file_exists($phpbb_root_path . $forum_data['forum_image']))
     910                {
     911                        $errors[] = $user->lang['FORUM_IMAGE_NO_EXIST'];
     912                }
    928913
    929914                validate_range($range_test_ary, $errors);
     
    943928                $forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0;
    944929                $forum_data['forum_flags'] += ($forum_data['enable_post_review']) ? FORUM_FLAG_POST_REVIEW : 0;
     930                $forum_data['forum_flags'] += ($forum_data['enable_quick_reply']) ? FORUM_FLAG_QUICK_REPLY : 0;
    945931
    946932                // Unset data that are not database fields
     
    953939                unset($forum_data_sql['show_active']);
    954940                unset($forum_data_sql['enable_post_review']);
     941                unset($forum_data_sql['enable_quick_reply']);
    955942                unset($forum_data_sql['forum_password_confirm']);
    956943
     
    19291916                adm_page_footer();
    19301917        }
     1918
     1919        /**
     1920        * Display copy permission page
     1921        * Not used at the moment - we will have a look at it for 3.0.7
     1922        */
     1923        function copy_permission_page($forum_data)
     1924        {
     1925                global $phpEx, $phpbb_admin_path, $template, $user;
     1926
     1927                $acl_url = '&amp;mode=setting_forum_local&amp;forum_id[]=' . $forum_data['forum_id'];
     1928                $action = append_sid($this->u_action . "&amp;parent_id={$this->parent_id}&amp;f={$forum_data['forum_id']}&amp;action=copy_perm");
     1929
     1930                $l_acl = sprintf($user->lang['COPY_TO_ACL'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url) . '">', '</a>');
     1931
     1932                $this->tpl_name = 'acp_forums_copy_perm';
     1933
     1934                $template->assign_vars(array(
     1935                        'U_ACL'                         => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions' . $acl_url),
     1936                        'L_ACL_LINK'            => $l_acl,
     1937                        'L_BACK_LINK'           => adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id),
     1938                        'S_COPY_ACTION'         => $action,
     1939                        'S_FORUM_OPTIONS'       => make_forum_select($forum_data['parent_id'], $forum_data['forum_id'], false, false, false),
     1940                ));
     1941        }
     1942
    19311943}
    19321944
  • trunk/forum/includes/acp/acp_groups.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_groups.php 9053 2008-11-09 15:10:40Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    310310                                                'max_recipients'        => request_var('group_max_recipients', 0),
    311311                                                'founder_manage'        => 0,
     312                                                'skip_auth'                     => request_var('group_skip_auth', 0),
    312313                                        );
    313314
     
    401402
    402403                                                $group_attributes = array();
    403                                                 $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients', 'founder_manage');
    404                                                 foreach ($test_variables as $test)
     404                                                $test_variables = array(
     405                                                        'rank'                  => 'int',
     406                                                        'colour'                => 'string',
     407                                                        'avatar'                => 'string',
     408                                                        'avatar_type'   => 'int',
     409                                                        'avatar_width'  => 'int',
     410                                                        'avatar_height' => 'int',
     411                                                        'receive_pm'    => 'int',
     412                                                        'legend'                => 'int',
     413                                                        'message_limit' => 'int',
     414                                                        'max_recipients'=> 'int',
     415                                                        'founder_manage'=> 'int',
     416                                                        'skip_auth'             => 'int',
     417                                                );
     418
     419                                                foreach ($test_variables as $test => $type)
    405420                                                {
    406421                                                        if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
    407422                                                        {
     423                                                                settype($submit_ary[$test], $type);
    408424                                                                $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test];
    409425                                                        }
     
    563579                                        'GROUP_MAX_RECIPIENTS'  => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
    564580                                        'GROUP_COLOUR'                  => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
    565 
     581                                        'GROUP_SKIP_AUTH'               => (!empty($group_row['group_skip_auth'])) ? ' checked="checked"' : '',
    566582
    567583                                        'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'],
     
    592608                                        'U_ACTION'                      => "{$this->u_action}&amp;action=$action&amp;g=$group_id",
    593609                                        'L_AVATAR_EXPLAIN'      => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),
    594                                         )
    595                                 );
     610                                ));
    596611
    597612                                return;
     
    608623
    609624                                // Grab the leaders - always, on every page...
    610                                 $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
     625                                $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_colour, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
    611626                                        FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug
    612627                                        WHERE ug.group_id = $group_id
     
    622637
    623638                                                'USERNAME'                      => $row['username'],
     639                                                'USERNAME_COLOUR'       => $row['user_colour'],
    624640                                                'S_GROUP_DEFAULT'       => ($row['group_id'] == $group_id) ? true : false,
    625641                                                'JOINED'                        => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ',
    626642                                                'USER_POSTS'            => $row['user_posts'],
    627                                                 'USER_ID'                       => $row['user_id'])
    628                                         );
     643                                                'USER_ID'                       => $row['user_id'],
     644                                        ));
    629645                                }
    630646                                $db->sql_freeresult($result);
     
    663679
    664680                                // Grab the members
    665                                 $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
     681                                $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
    666682                                        FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug
    667683                                        WHERE ug.group_id = $group_id
     
    688704
    689705                                                'USERNAME'                      => $row['username'],
     706                                                'USERNAME_COLOUR'       => $row['user_colour'],
    690707                                                'S_GROUP_DEFAULT'       => ($row['group_id'] == $group_id) ? true : false,
    691708                                                'JOINED'                        => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ',
     
    764781                                        'GROUP_NAME'    => $group_name,
    765782                                        'TOTAL_MEMBERS' => $row['total_members'],
    766                                         )
    767                                 );
     783                                ));
    768784                        }
    769785                }
  • trunk/forum/includes/acp/acp_icons.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_icons.php 8974 2008-10-06 13:23:41Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    9090                                        }
    9191
     92                                        // adjust the width and height to be lower than 128px while perserving the aspect ratio (for icons)
     93                                        if ($mode == 'icons')
     94                                        {
     95                                                if ($img_size[0] > 127 && $img_size[0] > $img_size[1])
     96                                                {
     97                                                        $img_size[1] = (int) ($img_size[1] * (127 / $img_size[0]));
     98                                                        $img_size[0] = 127;
     99                                                }
     100                                                else if ($img_size[1] > 127)
     101                                                {
     102                                                        $img_size[0] = (int) ($img_size[0] * (127 / $img_size[1]));
     103                                                        $img_size[1] = 127;
     104                                                }
     105                                        }
     106
    92107                                        $_images[$path . $img]['file'] = $path . $img;
    93108                                        $_images[$path . $img]['width'] = $img_size[0];
     
    169184                                        }
    170185                                }
    171                                
     186
    172187                                $sql = "SELECT *
    173188                                        FROM $table
    174189                                        ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC');
    175190                                $result = $db->sql_query($sql);
    176                                
     191
    177192                                $data = array();
    178193                                $after = false;
     
    181196                                $add_order_lists = array('', '');
    182197                                $display_count = 0;
    183                                
     198
    184199                                while ($row = $db->sql_fetchrow($result))
    185200                                {
     
    232247                                }
    233248
    234                                 $colspan = (($mode == 'smilies') ? '7' : '5');
     249                                $colspan = (($mode == 'smilies') ? 7 : 5);
    235250                                $colspan += ($icon_id) ? 1 : 0;
    236251                                $colspan += ($action == 'add') ? 2 : 0;
    237                                
     252
    238253                                $template->assign_vars(array(
    239254                                        'S_EDIT'                => true,
    240255                                        'S_SMILIES'             => ($mode == 'smilies') ? true : false,
    241256                                        'S_ADD'                 => ($action == 'add') ? true : false,
    242                                        
     257
    243258                                        'S_ORDER_LIST_DISPLAY'          => $order_list . $order_lists[1],
    244259                                        'S_ORDER_LIST_UNDISPLAY'        => $order_list . $order_lists[0],
     
    287302
    288303                                                'S_IMG_OPTIONS'         => $smiley_options,
    289                                                
     304
    290305                                                'S_ADD_ORDER_LIST_DISPLAY'              => $add_order_list . $add_order_lists[1],
    291306                                                'S_ADD_ORDER_LIST_UNDISPLAY'    => $add_order_list . $add_order_lists[0],
    292                                                
     307
    293308                                                'IMG_SRC'                       => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'],
    294309                                                'IMG_PATH'                      => $img_path,
     
    304319
    305320                                return;
    306        
     321
    307322                        break;
    308323
     
    312327                                // Get items to create/modify
    313328                                $images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array();
    314                                
     329
    315330                                // Now really get the items
    316331                                $image_id               = (isset($_POST['id'])) ? request_var('id', array('' => 0)) : array();
     
    349364                                }
    350365
     366                                if ($mode == 'smilies' && $action == 'create')
     367                                {
     368                                        $smiley_count = $this->item_count($table);
     369
     370                                        $addable_smileys_count = sizeof($images);
     371                                        foreach ($images as $image)
     372                                        {
     373                                                if (!isset($image_add[$image]))
     374                                                {
     375                                                        --$addable_smileys_count;
     376                                                }
     377                                        }
     378
     379                                        if ($smiley_count + $addable_smileys_count > SMILEY_LIMIT)
     380                                        {
     381                                                trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING);
     382                                        }
     383                                }
     384
    351385                                $icons_updated = 0;
    352386                                $errors = array();
     
    368402                                                        $image_width[$image] = $img_size[0];
    369403                                                        $image_height[$image] = $img_size[1];
     404                                                }
     405
     406                                                // Adjust image width/height for icons
     407                                                if ($mode == 'icons')
     408                                                {
     409                                                        if ($image_width[$image] > 127 && $image_width[$image] > $image_height[$image])
     410                                                        {
     411                                                                $image_height[$image] = (int) ($image_height[$image] * (127 / $image_width[$image]));
     412                                                                $image_width[$image] = 127;
     413                                                        }
     414                                                        else if ($image_height[$image] > 127)
     415                                                        {
     416                                                                $image_width[$image] = (int) ($image_width[$image] * (127 / $image_height[$image]));
     417                                                                $image_height[$image] = 127;
     418                                                        }
    370419                                                }
    371420
     
    427476                                                        $icons_updated++;
    428477                                                }
    429                                                
     478
    430479                                        }
    431480                                }
    432                                
     481
    433482                                $cache->destroy('_icons');
    434483                                $cache->destroy('sql', $table);
    435                                
     484
    436485                                $level = E_USER_NOTICE;
    437486                                switch ($icons_updated)
     
    441490                                                $level = E_USER_WARNING;
    442491                                                break;
    443                                                
     492
    444493                                        case 1:
    445494                                                $suc_lang = "{$lang}_ONE";
    446495                                                break;
    447                                                
     496
    448497                                        default:
    449498                                                $suc_lang = $lang;
     
    496545                                        }
    497546
    498 
    499547                                        // The user has already selected a smilies_pak file
    500548                                        if ($current == 'delete')
     
    540588                                                }
    541589                                                $db->sql_freeresult($result);
     590                                        }
     591
     592                                        if ($mode == 'smilies')
     593                                        {
     594                                                $smiley_count = $this->item_count($table);
     595                                                if ($smiley_count + sizeof($pak_ary) > SMILEY_LIMIT)
     596                                                {
     597                                                        trigger_error(sprintf($user->lang['TOO_MANY_SMILIES'], SMILEY_LIMIT) . adm_back_link($this->u_action), E_USER_WARNING);
     598                                                }
    542599                                        }
    543600
     
    836893
    837894                $spacer = false;
     895                $pagination_start = request_var('start', 0);
     896
     897                $item_count = $this->item_count($table);
    838898
    839899                $sql = "SELECT *
    840900                        FROM $table
    841901                        ORDER BY {$fields}_order ASC";
    842                 $result = $db->sql_query($sql);
     902                $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $pagination_start);
    843903
    844904                while ($row = $db->sql_fetchrow($result))
     
    856916                                'U_EDIT'                => $this->u_action . '&amp;action=edit&amp;id=' . $row[$fields . '_id'],
    857917                                'U_DELETE'              => $this->u_action . '&amp;action=delete&amp;id=' . $row[$fields . '_id'],
    858                                 'U_MOVE_UP'             => $this->u_action . '&amp;action=move_up&amp;id=' . $row[$fields . '_id'],
    859                                 'U_MOVE_DOWN'   => $this->u_action . '&amp;action=move_down&amp;id=' . $row[$fields . '_id'])
    860                         );
     918                                'U_MOVE_UP'             => $this->u_action . '&amp;action=move_up&amp;id=' . $row[$fields . '_id'] . '&amp;start=' . $pagination_start,
     919                                'U_MOVE_DOWN'   => $this->u_action . '&amp;action=move_down&amp;id=' . $row[$fields . '_id'] . '&amp;start=' . $pagination_start,
     920                        ));
    861921
    862922                        if (!$spacer && !$row['display_on_posting'])
     
    866926                }
    867927                $db->sql_freeresult($result);
     928
     929                $template->assign_var('PAGINATION',
     930                        generate_pagination($this->u_action, $item_count, $config['smilies_per_page'], $pagination_start, true)
     931                );
     932        }
     933
     934        /**
     935         * Returns the count of smilies or icons in the database
     936         *
     937         * @param string $table The table of items to count.
     938         * @return int number of items
     939         */
     940        /* private */ function item_count($table)
     941        {
     942                global $db;
     943
     944                $sql = "SELECT COUNT(*) AS item_count
     945                        FROM $table";
     946                $result = $db->sql_query($sql);
     947                $item_count = (int) $db->sql_fetchfield('item_count');
     948                $db->sql_freeresult($result);
     949
     950                return $item_count;
    868951        }
    869952}
  • trunk/forum/includes/acp/acp_inactive.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_inactive.php 8598 2008-06-04 15:37:06Z naderman $
     5* @version $Id$
    66* @copyright (c) 2006 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    5252                add_form_key($form_key);
    5353
     54                // We build the sort key and per page settings here, because they may be needed later
     55
     56                // Number of entries to display
     57                $per_page = request_var('users_per_page', (int) $config['topics_per_page']);
     58
     59                // Sorting
     60                $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']);
     61                $sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'd' => $user->lang['SORT_LAST_REMINDER'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME'], 'p' => $user->lang['SORT_POSTS'], 'e' => $user->lang['SORT_REMINDER']);
     62                $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'd' => 'user_reminded_time', 'r' => 'user_inactive_reason', 'u' => 'username_clean', 'p' => 'user_posts', 'e' => 'user_reminded');
     63
     64                $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
     65                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);
     66
    5467                if ($submit && sizeof($mark))
    5568                {
     
    6881                                                WHERE ' . $db->sql_in_set('user_id', $mark);
    6982                                        $result = $db->sql_query($sql);
    70                                
     83
    7184                                        $user_affected = array();
    7285                                        while ($row = $db->sql_fetchrow($result))
     
    7891                                        if ($action == 'activate')
    7992                                        {
    80                                                 if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
    81                                                 {
    82                                                         // Get those 'being activated'...
    83                                                         $sql = 'SELECT user_id, username, user_email, user_lang
    84                                                                 FROM ' . USERS_TABLE . '
    85                                                                 WHERE ' . $db->sql_in_set('user_id', $mark) . '
    86                                                                         AND user_type = ' . USER_INACTIVE;
    87                                                         $result = $db->sql_query($sql);
    88 
    89                                                         $inactive_users = array();
    90                                                         while ($row = $db->sql_fetchrow($result))
    91                                                         {
    92                                                                 $inactive_users[] = $row;
    93                                                         }
    94                                                         $db->sql_freeresult($result);
    95                                                 }
     93                                                // Get those 'being activated'...
     94                                                $sql = 'SELECT user_id, username' . (($config['require_activation'] == USER_ACTIVATION_ADMIN) ? ', user_email, user_lang' : '') . '
     95                                                        FROM ' . USERS_TABLE . '
     96                                                        WHERE ' . $db->sql_in_set('user_id', $mark) . '
     97                                                                AND user_type = ' . USER_INACTIVE;
     98                                                $result = $db->sql_query($sql);
     99
     100                                                $inactive_users = array();
     101                                                while ($row = $db->sql_fetchrow($result))
     102                                                {
     103                                                        $inactive_users[] = $row;
     104                                                }
     105                                                $db->sql_freeresult($result);
    96106
    97107                                                user_active_flip('activate', $mark);
     
    101111                                                        include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
    102112
    103                                                         $messenger = new messenger();
     113                                                        $messenger = new messenger(false);
    104114
    105115                                                        foreach ($inactive_users as $row)
     
    112122                                                                $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
    113123                                                                $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
     124                                                                $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
    114125
    115126                                                                $messenger->assign_vars(array(
     
    122133                                                        $messenger->save_queue();
    123134                                                }
     135
     136                                                if (!empty($inactive_users))
     137                                                {
     138                                                        foreach ($inactive_users as $row)
     139                                                        {
     140                                                                add_log('admin', 'LOG_USER_ACTIVE', $row['username']);
     141                                                                add_log('user', $row['user_id'], 'LOG_USER_ACTIVE_USER');
     142                                                        }
     143                                                }
     144
     145                                                // For activate we really need to redirect, else a refresh can result in users being deactivated again
     146                                                $u_action = $this->u_action . "&amp;$u_sort_param&amp;start=$start";
     147                                                $u_action .= ($per_page != $config['topics_per_page']) ? "&amp;users_per_page=$per_page" : '';
     148
     149                                                redirect($u_action);
    124150                                        }
    125151                                        else if ($action == 'delete')
     
    162188                                        $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey
    163189                                                FROM ' . USERS_TABLE . '
    164                                                 WHERE ' . $db->sql_in_set('user_id', $mark);
     190                                                WHERE ' . $db->sql_in_set('user_id', $mark) . '
     191                                                        AND user_inactive_reason';
     192
     193                                        $sql .= ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? ' = ' . INACTIVE_REMIND : ' <> ' . INACTIVE_MANUAL;
     194
    165195                                        $result = $db->sql_query($sql);
    166196
     
    171201
    172202                                                $messenger = new messenger();
    173                                                 $usernames = array();
     203                                                $usernames = $user_ids = array();
    174204
    175205                                                do
     
    180210                                                        $messenger->im($row['user_jabber'], $row['username']);
    181211
     212                                                        $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
     213                                                        $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
     214                                                        $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
     215                                                        $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
     216
    182217                                                        $messenger->assign_vars(array(
    183218                                                                'USERNAME'              => htmlspecialchars_decode($row['username']),
    184                                                                 'REGISTER_DATE' => $user->format_date($row['user_regdate']),
     219                                                                'REGISTER_DATE' => $user->format_date($row['user_regdate'], false, true),
    185220                                                                'U_ACTIVATE'    => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey'])
    186221                                                        );
     
    189224
    190225                                                        $usernames[] = $row['username'];
     226                                                        $user_ids[] = (int) $row['user_id'];
    191227                                                }
    192228                                                while ($row = $db->sql_fetchrow($result));
    193229
    194230                                                $messenger->save_queue();
     231
     232                                                // Add the remind state to the database
     233                                                $sql = 'UPDATE ' . USERS_TABLE . '
     234                                                        SET user_reminded = user_reminded + 1,
     235                                                                user_reminded_time = ' . time() . '
     236                                                        WHERE ' . $db->sql_in_set('user_id', $user_ids);
     237                                                $db->sql_query($sql);
    195238
    196239                                                add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames));
     
    198241                                        }
    199242                                        $db->sql_freeresult($result);
    200                
     243
     244                                        // For remind we really need to redirect, else a refresh can result in more than one reminder
     245                                        $u_action = $this->u_action . "&amp;$u_sort_param&amp;start=$start";
     246                                        $u_action .= ($per_page != $config['topics_per_page']) ? "&amp;users_per_page=$per_page" : '';
     247
     248                                        redirect($u_action);
     249
    201250                                break;
    202251                        }
    203252                }
    204253
    205                 // Sorting
    206                 $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']);
    207                 $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']);
    208                 $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username_clean');
    209 
    210                 $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
    211                 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);
    212 
    213254                // Define where and sort sql for use in displaying logs
    214255                $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
     
    218259                $inactive_count = 0;
    219260
    220                 $start = view_inactive_users($inactive, $inactive_count, $config['topics_per_page'], $start, $sql_where, $sql_sort);
     261                $start = view_inactive_users($inactive, $inactive_count, $per_page, $start, $sql_where, $sql_sort);
    221262
    222263                foreach ($inactive as $row)
     
    224265                        $template->assign_block_vars('inactive', array(
    225266                                'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']),
     267                                'REMINDED_DATE' => $user->format_date($row['user_reminded_time']),
    226268                                'JOINED'                => $user->format_date($row['user_regdate']),
    227269                                'LAST_VISIT'    => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
     270
    228271                                'REASON'                => $row['inactive_reason'],
    229272                                'USER_ID'               => $row['user_id'],
    230                                 'USERNAME'              => $row['username'],
    231                                 'U_USER_ADMIN'  => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
    232                         );
     273                                'POSTS'                 => ($row['user_posts']) ? $row['user_posts'] : 0,
     274                                'REMINDED'              => $row['user_reminded'],
     275
     276                                'REMINDED_EXPLAIN'      => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])),
     277
     278                                'USERNAME_FULL'         => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview')),
     279                                'USERNAME'                      => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
     280                                'USER_COLOR'            => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
     281
     282                                'U_USER_ADMIN'  => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"),
     283                                'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&amp;sr=posts") : '',
     284                        ));
    233285                }
    234286
     
    246298                        'S_SORT_KEY'    => $s_sort_key,
    247299                        'S_SORT_DIR'    => $s_sort_dir,
    248                         'S_ON_PAGE'             => on_page($inactive_count, $config['topics_per_page'], $start),
    249                         'PAGINATION'    => generate_pagination($this->u_action . "&amp;$u_sort_param", $inactive_count, $config['topics_per_page'], $start, true),
    250                        
     300                        'S_ON_PAGE'             => on_page($inactive_count, $per_page, $start),
     301                        'PAGINATION'    => generate_pagination($this->u_action . "&amp;$u_sort_param&amp;users_per_page=$per_page", $inactive_count, $per_page, $start, true),
     302                        'USERS_PER_PAGE'        => $per_page,
     303
    251304                        'U_ACTION'              => $this->u_action . '&amp;start=' . $start,
    252305                ));
  • trunk/forum/includes/acp/acp_jabber.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_jabber.php 8990 2008-10-09 15:41:19Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4545                $this->page_title = 'ACP_JABBER_SETTINGS';
    4646
    47                 $jab_enable                     = request_var('jab_enable', $config['jab_enable']);
    48                 $jab_host                       = request_var('jab_host', $config['jab_host']);
    49                 $jab_port                       = request_var('jab_port', $config['jab_port']);
    50                 $jab_username           = request_var('jab_username', $config['jab_username']);
    51                 $jab_password           = request_var('jab_password', $config['jab_password']);
    52                 $jab_package_size       = request_var('jab_package_size', $config['jab_package_size']);
    53                 $jab_use_ssl            = request_var('jab_use_ssl', $config['jab_use_ssl']);
     47                $jab_enable                     = request_var('jab_enable',                     (bool)          $config['jab_enable']);
     48                $jab_host                       = request_var('jab_host',                       (string)        $config['jab_host']);
     49                $jab_port                       = request_var('jab_port',                       (int)           $config['jab_port']);
     50                $jab_username           = request_var('jab_username',           (string)        $config['jab_username']);
     51                $jab_password           = request_var('jab_password',           (string)        $config['jab_password']);
     52                $jab_package_size       = request_var('jab_package_size',       (int)           $config['jab_package_size']);
     53                $jab_use_ssl            = request_var('jab_use_ssl',            (bool)          $config['jab_use_ssl']);
    5454
    5555                $form_name = 'acp_jabber';
     
    8989                        {
    9090                                // This feature is disabled.
    91                                 // We update the user table to be sure all users that have IM as notify type are set to both  as notify type
     91                                // We update the user table to be sure all users that have IM as notify type are set to both as notify type
     92                                // We set this to both because users still have their jabber address entered and may want to receive jabber notifications again once it is re-enabled.
    9293                                $sql_ary = array(
    9394                                        'user_notify_type'              => NOTIFY_BOTH,
     
    117118                        'L_JAB_SERVER_EXPLAIN'  => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '<a href="http://www.jabber.org/">', '</a>'),
    118119                        'JAB_HOST'                              => $jab_host,
    119                         'JAB_PORT'                              => $jab_port,
     120                        'JAB_PORT'                              => ($jab_port) ? $jab_port : '',
    120121                        'JAB_USERNAME'                  => $jab_username,
    121122                        'JAB_PASSWORD'                  => $jab_password,
  • trunk/forum/includes/acp/acp_language.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_language.php 8780 2008-08-22 12:52:48Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    767767                                }
    768768
    769                                 $db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id);
    770 
    771                                 $sql = 'UPDATE ' . USERS_TABLE . "
    772                                         SET user_lang = '" . $db->sql_escape($config['default_lang']) . "'
    773                                         WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
    774                                 $db->sql_query($sql);
    775 
    776                                 // We also need to remove the translated entries for custom profile fields - we want clean tables, don't we?
    777                                 $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
    778                                 $db->sql_query($sql);
    779 
    780                                 $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
    781                                 $db->sql_query($sql);
    782 
    783                                 $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " WHERE image_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
    784                                 $result = $db->sql_query($sql);
    785 
    786                                 $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
    787 
    788                                 add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
    789 
    790                                 trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
     769                                if (confirm_box(true))
     770                                {
     771                                        $db->sql_query('DELETE FROM ' . LANG_TABLE . ' WHERE lang_id = ' . $lang_id);
     772
     773                                        $sql = 'UPDATE ' . USERS_TABLE . "
     774                                                SET user_lang = '" . $db->sql_escape($config['default_lang']) . "'
     775                                                WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
     776                                        $db->sql_query($sql);
     777
     778                                        // We also need to remove the translated entries for custom profile fields - we want clean tables, don't we?
     779                                        $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
     780                                        $db->sql_query($sql);
     781
     782                                        $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
     783                                        $db->sql_query($sql);
     784
     785                                        $sql = 'DELETE FROM ' . STYLES_IMAGESET_DATA_TABLE . " WHERE image_lang = '" . $db->sql_escape($row['lang_iso']) . "'";
     786                                        $result = $db->sql_query($sql);
     787
     788                                        $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
     789
     790                                        add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
     791
     792                                        trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
     793                                }
     794                                else
     795                                {
     796                                        $s_hidden_fields = array(
     797                                                'i'                     => $id,
     798                                                'mode'          => $mode,
     799                                                'action'        => $action,
     800                                                'id'            => $lang_id,
     801                                        );
     802                                        confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
     803                                }
    791804                        break;
    792805
     
    11081121                        while (($file = readdir($dp)) !== false)
    11091122                        {
     1123                                if (!is_dir($phpbb_root_path . 'language/' . $file))
     1124                                {
     1125                                        continue;
     1126                                }
     1127
    11101128                                if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt"))
    11111129                                {
     
    12551273
    12561274                $non_static             = array_shift($keys);
    1257                 $value                  = array_shift($keys);
     1275                $value                  = utf8_normalize_nfc(array_shift($keys));
    12581276
    12591277                if (!$non_static)
  • trunk/forum/includes/acp/acp_logs.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_logs.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3434                $action         = request_var('action', '');
    3535                $forum_id       = request_var('f', 0);
     36                $topic_id       = request_var('t', 0);
    3637                $start          = request_var('start', 0);
    3738                $deletemark = (!empty($_POST['delmarked'])) ? true : false;
     
    105106                $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
    106107
     108                $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
     109                $keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
     110
    107111                $l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS'];
    108112                $l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN'];
     
    124128                $log_data = array();
    125129                $log_count = 0;
    126                 view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort);
     130                view_log($mode, $log_data, $log_count, $config['topics_per_page'], $start, $forum_id, 0, 0, $sql_where, $sql_sort, $keywords);
    127131
    128132                $template->assign_vars(array(
     
    132136
    133137                        'S_ON_PAGE'             => on_page($log_count, $config['topics_per_page'], $start),
    134                         'PAGINATION'    => generate_pagination($this->u_action . "&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start, true),
     138                        'PAGINATION'    => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true),
    135139
    136140                        'S_LIMIT_DAYS'  => $s_limit_days,
     
    138142                        'S_SORT_DIR'    => $s_sort_dir,
    139143                        'S_CLEARLOGS'   => $auth->acl_get('a_clearlogs'),
     144                        'S_KEYWORDS'    => $keywords,
    140145                        )
    141146                );
  • trunk/forum/includes/acp/acp_main.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_main.php 9171 2008-12-04 14:53:04Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    9797                                                $confirm = true;
    9898                                                $confirm_lang = 'PURGE_CACHE_CONFIRM';
     99                                        break;
     100                                        case 'purge_sessions':
     101                                                $confirm = true;
     102                                                $confirm_lang = 'PURGE_SESSIONS_CONFIRM';
    99103                                        break;
    100104
     
    342346                                                add_log('admin', 'LOG_PURGE_CACHE');
    343347                                        break;
     348
     349                                        case 'purge_sessions':
     350                                                if ((int) $user->data['user_type'] !== USER_FOUNDER)
     351                                                {
     352                                                        trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
     353                                                }
     354
     355                                                $tables = array(CONFIRM_TABLE, SESSIONS_TABLE);
     356
     357                                                foreach ($tables as $table)
     358                                                {
     359                                                        switch ($db->sql_layer)
     360                                                        {
     361                                                                case 'sqlite':
     362                                                                case 'firebird':
     363                                                                        $db->sql_query("DELETE FROM $table");
     364                                                                break;
     365
     366                                                                default:
     367                                                                        $db->sql_query("TRUNCATE TABLE $table");
     368                                                                break;
     369                                                        }
     370                                                }
     371
     372                                                // let's restore the admin session
     373                                                $reinsert_ary = array(
     374                                                                'session_id'                    => (string) $user->session_id,
     375                                                                'session_page'                  => (string) substr($user->page['page'], 0, 199),
     376                                                                'session_forum_id'              => $user->page['forum'],
     377                                                                'session_user_id'               => (int) $user->data['user_id'],
     378                                                                'session_start'                 => (int) $user->data['session_start'],
     379                                                                'session_last_visit'    => (int) $user->data['session_last_visit'],
     380                                                                'session_time'                  => (int) $user->time_now,
     381                                                                'session_browser'               => (string) trim(substr($user->browser, 0, 149)),
     382                                                                'session_forwarded_for' => (string) $user->forwarded_for,
     383                                                                'session_ip'                    => (string) $user->ip,
     384                                                                'session_autologin'             => (int) $user->data['session_autologin'],
     385                                                                'session_admin'                 => 1,
     386                                                                'session_viewonline'    => (int) $user->data['session_viewonline'],
     387                                                );
     388
     389                                                $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary);
     390                                                $db->sql_query($sql);
     391
     392                                                add_log('admin', 'LOG_PURGE_SESSIONS');
     393                                        break;
    344394                                }
    345395                        }
     396                }
     397
     398                // Version check
     399                $user->add_lang('install');
     400
     401                if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.2.0', '<'))
     402                {
     403                        $template->assign_vars(array(
     404                                'S_PHP_VERSION_OLD'     => true,
     405                                'L_PHP_VERSION_OLD'     => sprintf($user->lang['PHP_VERSION_OLD'], '<a href="http://www.phpbb.com/community/viewtopic.php?f=14&amp;t=1958605">', '</a>'),
     406                        ));
     407                }
     408
     409                $latest_version_info = false;
     410                if (($latest_version_info = obtain_latest_version_info(request_var('versioncheck_force', false))) === false)
     411                {
     412                        $template->assign_var('S_VERSIONCHECK_FAIL', true);
     413                }
     414                else
     415                {
     416                        $latest_version_info = explode("\n", $latest_version_info);
     417
     418                        $latest_version = str_replace('rc', 'RC', strtolower(trim($latest_version_info[0])));
     419                        $current_version = str_replace('rc', 'RC', strtolower($config['version']));
     420
     421                        $template->assign_vars(array(
     422                                'S_VERSION_UP_TO_DATE'  => version_compare($current_version, $latest_version, '<') ? false : true,
     423                        ));
    346424                }
    347425
     
    436514                        'TOTAL_ORPHAN'          => $total_orphan,
    437515                        'S_TOTAL_ORPHAN'        => ($total_orphan === false) ? false : true,
    438                         'GZIP_COMPRESSION'      => ($config['gzip_compress']) ? $user->lang['ON'] : $user->lang['OFF'],
     516                        'GZIP_COMPRESSION'      => ($config['gzip_compress'] && @extension_loaded('zlib')) ? $user->lang['ON'] : $user->lang['OFF'],
    439517                        'DATABASE_INFO'         => $db->sql_server_info(),
    440518                        'BOARD_VERSION'         => $config['version'],
     
    443521                        'U_ADMIN_LOG'           => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&amp;mode=admin'),
    444522                        'U_INACTIVE_USERS'      => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&amp;mode=list'),
     523                        'U_VERSIONCHECK'        => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&amp;mode=version_check'),
     524                        'U_VERSIONCHECK_FORCE'  => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=1&amp;versioncheck_force=1'),
    445525
    446526                        'S_ACTION_OPTIONS'      => ($auth->acl_get('a_board')) ? true : false,
     
    469549                if ($auth->acl_get('a_user'))
    470550                {
     551                        $user->add_lang('memberlist');
     552
    471553                        $inactive = array();
    472554                        $inactive_count = 0;
     
    478560                                $template->assign_block_vars('inactive', array(
    479561                                        'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']),
     562                                        'REMINDED_DATE' => $user->format_date($row['user_reminded_time']),
    480563                                        'JOINED'                => $user->format_date($row['user_regdate']),
    481564                                        'LAST_VISIT'    => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']),
     565
    482566                                        'REASON'                => $row['inactive_reason'],
    483567                                        'USER_ID'               => $row['user_id'],
    484                                         'USERNAME'              => $row['username'],
    485                                         'U_USER_ADMIN'  => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"))
    486                                 );
     568                                        'POSTS'                 => ($row['user_posts']) ? $row['user_posts'] : 0,
     569                                        'REMINDED'              => $row['user_reminded'],
     570
     571                                        'REMINDED_EXPLAIN'      => $user->lang('USER_LAST_REMINDED', (int) $row['user_reminded'], $user->format_date($row['user_reminded_time'])),
     572
     573                                        'USERNAME_FULL'         => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=overview')),
     574                                        'USERNAME'                      => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
     575                                        'USER_COLOR'            => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
     576
     577                                        'U_USER_ADMIN'  => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&amp;mode=overview&amp;u={$row['user_id']}"),
     578                                        'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id={$row['user_id']}&amp;sr=posts") : '',
     579                                ));
    487580                        }
    488581
     
    500593
    501594                // Warn if install is still present
    502                 if (file_exists($phpbb_root_path . 'install'))
     595                if (file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
    503596                {
    504597                        $template->assign_var('S_REMOVE_INSTALL', true);
    505598                }
    506599
    507                 if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx))
     600                if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx))
    508601                {
    509602                        // World-Writable? (000x)
    510603                        $template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
     604                }
     605
     606                // Fill dbms version if not yet filled
     607                if (empty($config['dbms_version']))
     608                {
     609                        set_config('dbms_version', $db->sql_server_info(true));
    511610                }
    512611
  • trunk/forum/includes/acp/acp_permissions.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_permissions.php 8710 2008-07-29 13:35:49Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2424        var $u_action;
    2525        var $permission_dropdown;
    26        
     26
    2727        function main($id, $mode)
    2828        {
     
    5555                                return;
    5656                        }
     57                        trigger_error('NO_MODE', E_USER_ERROR);
     58                }
     59
     60                // Copy forum permissions
     61                if ($mode == 'setting_forum_copy')
     62                {
     63                        $this->tpl_name = 'permission_forum_copy';
     64
     65                        if ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))
     66                        {
     67                                $this->page_title = 'ACP_FORUM_PERMISSIONS_COPY';
     68                                $this->copy_forum_permissions();
     69                                return;
     70                        }
     71
    5772                        trigger_error('NO_MODE', E_USER_ERROR);
    5873                }
     
    95110                        $db->sql_freeresult($result);
    96111                }
    97                
     112
    98113                // Map usernames to ids and vice versa
    99114                if ($usernames)
     
    113128                }
    114129                unset($username);
    115                
     130
    116131                // Build forum ids (of all forums are checked or subforum listing used)
    117132                if ($all_forums)
     
    218233                }
    219234
    220 
    221235                // Handle actions
    222236                if (strpos($mode, 'setting_') === 0 && $action)
     
    225239                        {
    226240                                case 'delete':
    227 
    228                                         if (!check_form_key($form_name))
    229                                         {
    230                                                 trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
    231                                         }
    232                                         // All users/groups selected?
    233                                         $all_users = (isset($_POST['all_users'])) ? true : false;
    234                                         $all_groups = (isset($_POST['all_groups'])) ? true : false;
    235 
    236                                         if ($all_users || $all_groups)
    237                                         {
    238                                                 $items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
    239 
    240                                                 if ($all_users && sizeof($items['user_ids']))
     241                                        if (confirm_box(true))
     242                                        {
     243                                                // All users/groups selected?
     244                                                $all_users = (isset($_POST['all_users'])) ? true : false;
     245                                                $all_groups = (isset($_POST['all_groups'])) ? true : false;
     246
     247                                                if ($all_users || $all_groups)
    241248                                                {
    242                                                         $user_id = $items['user_ids'];
     249                                                        $items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
     250
     251                                                        if ($all_users && sizeof($items['user_ids']))
     252                                                        {
     253                                                                $user_id = $items['user_ids'];
     254                                                        }
     255                                                        else if ($all_groups && sizeof($items['group_ids']))
     256                                                        {
     257                                                                $group_id = $items['group_ids'];
     258                                                        }
    243259                                                }
    244                                                 else if ($all_groups && sizeof($items['group_ids']))
     260
     261                                                if (sizeof($user_id) || sizeof($group_id))
    245262                                                {
    246                                                         $group_id = $items['group_ids'];
     263                                                        $this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
    247264                                                }
    248                                         }
    249 
    250                                         if (sizeof($user_id) || sizeof($group_id))
    251                                         {
    252                                                 $this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
     265                                                else
     266                                                {
     267                                                        trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
     268                                                }
    253269                                        }
    254270                                        else
    255271                                        {
    256                                                 trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
     272                                                if (isset($_POST['cancel']))
     273                                                {
     274                                                        $u_redirect = $this->u_action . '&amp;type=' . $permission_type;
     275                                                        foreach ($forum_id as $fid)
     276                                                        {
     277                                                                $u_redirect .= '&amp;forum_id[]=' . $fid;
     278                                                        }
     279                                                        redirect($u_redirect);
     280                                                }
     281
     282                                                $s_hidden_fields = array(
     283                                                        'i'                             => $id,
     284                                                        'mode'                  => $mode,
     285                                                        'action'                => array($action => 1),
     286                                                        'user_id'               => $user_id,
     287                                                        'group_id'              => $group_id,
     288                                                        'forum_id'              => $forum_id,
     289                                                        'type'                  => $permission_type,
     290                                                );
     291                                                if (isset($_POST['all_users']))
     292                                                {
     293                                                        $s_hidden_fields['all_users'] = 1;
     294                                                }
     295                                                if (isset($_POST['all_groups']))
     296                                                {
     297                                                        $s_hidden_fields['all_groups'] = 1;
     298                                                }
     299                                                confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
    257300                                        }
    258301                                break;
     
    529572                                continue;
    530573                        }
    531                        
     574
    532575                        if ($branch_there)
    533576                        {
     
    540583                return $s_options;
    541584        }
    542        
     585
    543586        /**
    544587        * Build dropdown field for changing permission types
     
    547590        {
    548591                global $user, $auth;
    549                
     592
    550593                $s_dropdown_options = '';
    551594                foreach ($options as $setting)
     
    627670                        trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
    628671                }
    629                
     672
    630673                $ug_id = $forum_id = 0;
    631674
     
    763806                $this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids);
    764807
    765                 trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
     808                if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local')
     809                {
     810                        trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&amp;forum_id[]=' . implode('&amp;forum_id[]=', $forum_ids)));
     811                }
     812                else
     813                {
     814                        trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
     815                }
    766816        }
    767817
     
    810860        {
    811861                global $user, $db, $auth;
    812                        
     862
    813863                // User or group to be set?
    814864                $ug_type = (sizeof($user_id)) ? 'user' : 'group';
     
    830880                $this->log_action($mode, 'del', $permission_type, $ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : array(0 => 0)));
    831881
    832                 trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
     882                if ($mode == 'setting_forum_local' || $mode == 'setting_mod_local')
     883                {
     884                        trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&amp;forum_id[]=' . implode('&amp;forum_id[]=', $forum_id)));
     885                }
     886                else
     887                {
     888                        trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
     889                }
    833890        }
    834891
     
    9501007                        WHERE ug.user_id = ' . $user_id . '
    9511008                                AND ug.user_pending = 0
     1009                                AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
    9521010                        ORDER BY g.group_type DESC, g.group_id DESC';
    9531011                $result = $db->sql_query($sql);
     
    11111169
    11121170        /**
     1171        * Handles copying permissions from one forum to others
     1172        */
     1173        function copy_forum_permissions()
     1174        {
     1175                global $auth, $cache, $template, $user;
     1176
     1177                $user->add_lang('acp/forums');
     1178
     1179                $submit = isset($_POST['submit']) ? true : false;
     1180
     1181                if ($submit)
     1182                {
     1183                        $src = request_var('src_forum_id', 0);
     1184                        $dest = request_var('dest_forum_ids', array(0));
     1185
     1186                        if (confirm_box(true))
     1187                        {
     1188                                if (copy_forum_permissions($src, $dest))
     1189                                {
     1190                                        cache_moderators();
     1191
     1192                                        $auth->acl_clear_prefetch();
     1193                                        $cache->destroy('sql', FORUMS_TABLE);
     1194
     1195                                        trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action));
     1196                                }
     1197                                else
     1198                                {
     1199                                        trigger_error($user->lang['SELECTED_FORUM_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
     1200                                }
     1201                        }
     1202                        else
     1203                        {
     1204                                $s_hidden_fields = array(
     1205                                        'submit'                        => $submit,
     1206                                        'src_forum_id'          => $src,
     1207                                        'dest_forum_ids'        => $dest,
     1208                                );
     1209
     1210                                $s_hidden_fields = build_hidden_fields($s_hidden_fields);
     1211
     1212                                confirm_box(false, $user->lang['COPY_PERMISSIONS_CONFIRM'], $s_hidden_fields);
     1213                        }
     1214                }
     1215
     1216                $template->assign_vars(array(
     1217                        'S_FORUM_OPTIONS' => make_forum_select(false, false, false, false, false),
     1218                ));
     1219        }
     1220
     1221        /**
    11131222        * Get already assigned users/groups
    11141223        */
     
    11511260                        $sql_where = 'AND (' . $db->sql_in_set('a.auth_option_id', $option_ids) . ' OR ' . $db->sql_in_set('a.auth_role_id', $role_ids) . ')';
    11521261                }
    1153                 else
     1262                else if (sizeof($role_ids))
     1263                {
     1264                        $sql_where = 'AND ' . $db->sql_in_set('a.auth_role_id', $role_ids);
     1265                }
     1266                else if (sizeof($option_ids))
    11541267                {
    11551268                        $sql_where = 'AND ' . $db->sql_in_set('a.auth_option_id', $option_ids);
  • trunk/forum/includes/acp/acp_profile.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_profile.php 9127 2008-11-26 19:58:35Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    370370                                                'field_no_view'         => 0,
    371371                                                'field_show_on_reg'     => 0,
     372                                                'field_show_on_vt'      => 0,
    372373                                                'lang_name'                     => utf8_normalize_nfc(request_var('field_ident', '', true)),
    373374                                                'lang_explain'          => '',
     
    380381                                // $exclude contains the data we gather in each step
    381382                                $exclude = array(
    382                                         1       => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
     383                                        1       => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'),
    383384                                        2       => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'),
    384385                                        3       => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options')
     
    406407                                        'field_required',
    407408                                        'field_show_on_reg',
     409                                        'field_show_on_vt',
    408410                                        'field_show_profile',
    409411                                        'field_hide',
     
    508510                                                $var = request_var('field_default_value', 0);
    509511                                        }*/
     512                                        else if ($field_type == FIELD_INT && $key == 'field_default_value')
     513                                        {
     514                                                // Permit an empty string
     515                                                if (request_var('field_default_value', '') === '')
     516                                                {
     517                                                        $var = '';
     518                                                }
     519                                        }
    510520
    511521                                        $cp->vars[$key] = $var;
     
    722732                                                        'S_FIELD_REQUIRED'      => ($cp->vars['field_required']) ? true : false,
    723733                                                        'S_SHOW_ON_REG'         => ($cp->vars['field_show_on_reg']) ? true : false,
     734                                                        'S_SHOW_ON_VT'          => ($cp->vars['field_show_on_vt']) ? true : false,
    724735                                                        'S_FIELD_HIDE'          => ($cp->vars['field_hide']) ? true : false,
    725736                                                        'S_SHOW_PROFILE'        => ($cp->vars['field_show_profile']) ? true : false,
     
    923934                        case FIELD_TEXT:
    924935                        case FIELD_STRING:
    925                                 if ($cp->vars['lang_default_value'])
     936                                if (strlen($cp->vars['lang_default_value']))
    926937                                {
    927938                                        $options['lang_default_value'] = ($field_type == FIELD_STRING) ? 'string' : 'text';
     
    10371048                        'field_required'                => $cp->vars['field_required'],
    10381049                        'field_show_on_reg'             => $cp->vars['field_show_on_reg'],
     1050                        'field_show_on_vt'              => $cp->vars['field_show_on_vt'],
    10391051                        'field_hide'                    => $cp->vars['field_hide'],
    10401052                        'field_show_profile'    => $cp->vars['field_show_profile'],
     
    15401552
    15411553                                // We are defining the biggest common value, because of the possibility to edit the min/max values of each field.
    1542                                 $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " ADD \"$field_ident\" ";
     1554                                $sql = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' ADD "' . strtoupper($field_ident) . '" ';
    15431555
    15441556                                switch ($field_type)
  • trunk/forum/includes/acp/acp_prune.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_prune.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    407407                        $where_sql .= ($count !== '') ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
    408408
    409                         if (sizeof($active) && $active_select != 'lt')
     409                        // First handle pruning of users who never logged in, last active date is 0000-00-00
     410                        if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0)
     411                        {
     412                                $where_sql .= ' AND user_lastvisit = 0';
     413                        }                       
     414                        else if (sizeof($active) && $active_select != 'lt')
    410415                        {
    411416                                $where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]);
  • trunk/forum/includes/acp/acp_ranks.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_ranks.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4040                $this->page_title = 'ACP_MANAGE_RANKS';
    4141
    42                 $form_name = 'acp_prune';
     42                $form_name = 'acp_ranks';
    4343                add_form_key($form_name);
    4444
     
    169169                                                $img = $path . $img;
    170170
    171                                                 if (!in_array($img, $existing_imgs) || $action == 'edit')
     171                                                if ($ranks && $img == $ranks['rank_image'])
    172172                                                {
    173                                                         if ($ranks && $img == $ranks['rank_image'])
    174                                                         {
    175                                                                 $selected = ' selected="selected"';
    176                                                                 $edit_img = $img;
    177                                                         }
    178                                                         else
    179                                                         {
    180                                                                 $selected = '';
    181                                                         }
    182 
    183                                                         if (strlen($img) > 255)
    184                                                         {
    185                                                                 continue;
    186                                                         }
    187 
    188                                                         $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>';
     173                                                        $selected = ' selected="selected"';
     174                                                        $edit_img = $img;
    189175                                                }
     176                                                else
     177                                                {
     178                                                        $selected = '';
     179                                                }
     180
     181                                                if (strlen($img) > 255)
     182                                                {
     183                                                        continue;
     184                                                }
     185
     186                                                $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . ((in_array($img, $existing_imgs)) ? ' ' . $user->lang['RANK_IMAGE_IN_USE'] : '') . '</option>';
    190187                                        }
    191188                                }
  • trunk/forum/includes/acp/acp_search.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_search.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    6464                        'limit_search_load'                     => 'float',
    6565                        'min_search_author_chars'       => 'integer',
     66                        'max_num_search_keywords'       => 'integer',
    6667                        'search_store_results'          => 'integer',
    6768                );
     
    217218                        'SEARCH_GUEST_INTERVAL' => (float) $config['search_anonymous_interval'],
    218219                        'SEARCH_STORE_RESULTS'  => (int) $config['search_store_results'],
     220                        'MAX_NUM_SEARCH_KEYWORDS'       => (int) $config['max_num_search_keywords'],
    219221
    220222                        'S_SEARCH_TYPES'                => $search_options,
     
    592594                ksort($this->state);
    593595
    594                 set_config('search_indexing_state', implode(',', $this->state));
     596                set_config('search_indexing_state', implode(',', $this->state), true);
    595597        }
    596598
  • trunk/forum/includes/acp/acp_styles.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_styles.php 9152 2008-12-02 16:49:59Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3838                $bitfield = new bitfield();
    3939                $bitfield->set(0);
     40                $bitfield->set(1);
     41                $bitfield->set(2);
    4042                $bitfield->set(3);
     43                $bitfield->set(4);
    4144                $bitfield->set(8);
    4245                $bitfield->set(9);
     
    208211                                                }
    209212
    210                                                 $sql = 'UPDATE ' . STYLES_TABLE . '
    211                                                         SET style_active = ' . (($action == 'activate') ? 1 : 0) . '
    212                                                         WHERE style_id = ' . $style_id;
    213                                                 $db->sql_query($sql);
    214 
    215                                                 // Set style to default for any member using deactivated style
    216                                                 if ($action == 'deactivate')
     213                                                if (($action == 'deactivate' && confirm_box(true)) || $action == 'activate')
    217214                                                {
    218                                                         $sql = 'UPDATE ' . USERS_TABLE . '
    219                                                                 SET user_style = ' . $config['default_style'] . "
    220                                                                 WHERE user_style = $style_id";
     215                                                        $sql = 'UPDATE ' . STYLES_TABLE . '
     216                                                                SET style_active = ' . (($action == 'activate') ? 1 : 0) . '
     217                                                                WHERE style_id = ' . $style_id;
    221218                                                        $db->sql_query($sql);
    222219
    223                                                         $sql = 'UPDATE ' . FORUMS_TABLE . '
    224                                                                 SET forum_style = 0
    225                                                                 WHERE forum_style = ' . $style_id;
    226                                                         $db->sql_query($sql);
     220                                                        // Set style to default for any member using deactivated style
     221                                                        if ($action == 'deactivate')
     222                                                        {
     223                                                                $sql = 'UPDATE ' . USERS_TABLE . '
     224                                                                        SET user_style = ' . $config['default_style'] . "
     225                                                                        WHERE user_style = $style_id";
     226                                                                $db->sql_query($sql);
     227
     228                                                                $sql = 'UPDATE ' . FORUMS_TABLE . '
     229                                                                        SET forum_style = 0
     230                                                                        WHERE forum_style = ' . $style_id;
     231                                                                $db->sql_query($sql);
     232                                                        }
     233                                                }
     234                                                else if ($action == 'deactivate')
     235                                                {
     236                                                        $s_hidden_fields = array(
     237                                                                'i'                     => $id,
     238                                                                'mode'          => $mode,
     239                                                                'action'        => $action,
     240                                                                'style_id'      => $style_id,
     241                                                        );
     242                                                        confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
    227243                                                }
    228244                                        break;
     
    628644                        while (($file = readdir($dp)) !== false)
    629645                        {
     646                                if (!is_dir($phpbb_root_path . 'styles/' . $file))
     647                                {
     648                                        continue;
     649                                }
     650
    630651                                $subpath = ($mode != 'style') ? "$mode/" : '';
    631652                                if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg"))
     
    732753                                if (!($fp = @fopen($file, 'wb')))
    733754                                {
    734                                         trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
     755                                        // File exists and is writeable, but still not able to be written to
     756                                        trigger_error(sprintf($user->lang['TEMPLATE_FILE_NOT_WRITABLE'], htmlspecialchars($template_file)) . adm_back_link($this->u_action), E_USER_WARNING);
    735757                                }
    736758                                fwrite($fp, $template_data);
     
    744766                                if (!$template_info['template_storedb'])
    745767                                {
    746                                         if ($this->get_super('template', $template_id))
     768                                        if ($super = $this->get_super('template', $template_id))
    747769                                        {
    748770                                                $this->store_in_db('template', $super['template_id']);
     
    825847                }
    826848
     849                if (empty($filelist['']))
     850                {
     851                        trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING);
     852                }
     853
    827854                // Now create the categories
    828855                $filelist_cats[''] = array();
     
    10221049                foreach ($file_ary as $file)
    10231050                {
    1024                         $file           = str_replace('/', '.', $file);
     1051                        $file           = str_replace('/', '.', $file);
    10251052
    10261053                        // perform some dirty guessing to get the path right.
    10271054                        // We assume that three dots in a row were '../'
    1028                         $tpl_file       = str_replace('.', '/', $file);
    1029                         $tpl_file       = str_replace('///', '../', $tpl_file);
     1055                        $tpl_file       = str_replace('.', '/', $file);
     1056                        $tpl_file       = str_replace('///', '../', $tpl_file);
    10301057
    10311058                        $filename = "{$cache_prefix}_$file.html.$phpEx";
     
    10591086                        }
    10601087
     1088                        // Correct the filename if it is stored in database and the file is in a subfolder.
     1089                        if ($template_row['template_storedb'])
     1090                        {
     1091                                $file = str_replace('.', '/', $file);
     1092                        }
    10611093
    10621094                        $template->assign_block_vars('file', array(
     
    10661098                                'FILENAME'              => $file,
    10671099                                'FILENAME_PATH' => $file_tpl,
    1068                                 'FILESIZE'              => sprintf('%.1f ' . $user->lang['KIB'], filesize("{$phpbb_root_path}cache/$filename") / 1024),
     1100                                'FILESIZE'              => get_formatted_filesize(filesize("{$phpbb_root_path}cache/$filename")),
    10691101                                'MODIFIED'              => $user->format_date((!$template_row['template_storedb']) ? filemtime($file_tpl) : $filemtime[$file . '.html']))
    10701102                        );
     
    12641296        }
    12651297
    1266 
    12671298        /**
    12681299        * Edit imagesets
     
    12761307                $this->page_title = 'EDIT_IMAGESET';
    12771308
     1309                if (!$imageset_id)
     1310                {
     1311                        trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
     1312                }
     1313
    12781314                $update         = (isset($_POST['update'])) ? true : false;
    12791315
    1280                 $imgname        = request_var('imgname', '');
    1281                 $imgpath        = request_var('imgpath', '');
    1282                 $imgsize        = request_var('imgsize', false);
    1283                 $imgwidth       = request_var('imgwidth', 0);
    1284                 $imgheight      = request_var('imgheight', 0);
    1285 
     1316                $imgname        = request_var('imgname', 'site_logo');
    12861317                $imgname        = preg_replace('#[^a-z0-9\-+_]#i', '', $imgname);
    1287                 $imgpath        = str_replace('..', '.', $imgpath);
    1288 
    1289                 if ($imageset_id)
    1290                 {
    1291                         $sql = 'SELECT imageset_path, imageset_name
    1292                                 FROM ' . STYLES_IMAGESET_TABLE . "
    1293                                 WHERE imageset_id = $imageset_id";
    1294                         $result = $db->sql_query($sql);
    1295                         $imageset_row = $db->sql_fetchrow($result);
    1296                         $db->sql_freeresult($result);
    1297 
    1298                         $imageset_path          = $imageset_row['imageset_path'];
    1299                         $imageset_name          = $imageset_row['imageset_name'];
    1300 
    1301                         $sql_extra = '';
    1302                         if (strpos($imgname, '-') !== false)
    1303                         {
    1304                                 list($imgname, $imgnamelang) = explode('-', $imgname);
    1305                                 $sql_extra = " AND image_lang IN ('" . $db->sql_escape($imgnamelang) . "', '')";
    1306                         }
    1307 
    1308                         $sql = 'SELECT image_filename, image_width, image_height, image_lang, image_id
    1309                                 FROM ' . STYLES_IMAGESET_DATA_TABLE . "
    1310                                 WHERE imageset_id = $imageset_id
    1311                                         AND image_name = '" . $db->sql_escape($imgname) . "'$sql_extra";
    1312                         $result = $db->sql_query($sql);
    1313                         $imageset_data_row = $db->sql_fetchrow($result);
    1314                         $db->sql_freeresult($result);
    1315 
    1316                         $image_filename = $imageset_data_row['image_filename'];
    1317                         $image_width    = $imageset_data_row['image_width'];
    1318                         $image_height   = $imageset_data_row['image_height'];
    1319                         $image_lang             = $imageset_data_row['image_lang'];
    1320                         $image_id               = $imageset_data_row['image_id'];
    1321 
    1322                         if (!$imageset_row)
    1323                         {
    1324                                 trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
    1325                         }
    1326 
    1327                         // Check to see whether the selected image exists in the table
    1328                         $valid_name = ($update) ? false : true;
    1329 
    1330                         foreach ($this->imageset_keys as $category => $img_ary)
    1331                         {
    1332                                 if (in_array($imgname, $img_ary))
    1333                                 {
    1334                                         $valid_name = true;
    1335                                         break;
    1336                                 }
    1337                         }
    1338 
    1339                         if ($update && isset($_POST['imgpath']))
    1340                         {
    1341                                 if ($valid_name)
    1342                                 {
    1343                                         // If imgwidth and imgheight are non-zero grab the actual size
    1344                                         // from the image itself ... we ignore width settings for the poll center image
    1345                                         $imgwidth       = request_var('imgwidth', 0);
    1346                                         $imgheight      = request_var('imgheight', 0);
    1347                                         $imglang = '';
    1348 
    1349                                         if ($imgpath && !file_exists("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath"))
    1350                                         {
    1351                                                 trigger_error($user->lang['NO_IMAGE_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
    1352                                         }
    1353 
    1354                                         if ($imgsize && $imgpath)
    1355                                         {
    1356                                                 if (!$imgwidth || !$imgheight)
    1357                                                 {
    1358                                                         list($imgwidth_file, $imgheight_file) = getimagesize("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath");
    1359                                                         $imgwidth = ($imgwidth) ? $imgwidth : $imgwidth_file;
    1360                                                         $imgheight = ($imgheight) ? $imgheight : $imgheight_file;
    1361                                                 }
    1362                                                 $imgwidth       = ($imgname != 'poll_center') ? (int) $imgwidth : 0;
    1363                                                 $imgheight      = (int) $imgheight;
    1364                                         }
    1365 
    1366 
    1367                                         if (strpos($imgpath, '/') !== false)
    1368                                         {
    1369                                                 list($imglang, $imgfilename) = explode('/', $imgpath);
    1370                                         }
    1371                                         else
    1372                                         {
    1373                                                 $imgfilename = $imgpath;
    1374                                         }
    1375 
    1376                                         $sql_ary = array(
    1377                                                 'image_filename'        => (string) $imgfilename,
    1378                                                 'image_width'           => (int) $imgwidth,
    1379                                                 'image_height'          => (int) $imgheight,
    1380                                                 'image_lang'            => (string) $imglang,
    1381                                         );
    1382 
    1383                                         // already exists
    1384                                         if ($imageset_data_row)
    1385                                         {
    1386                                                 $sql = 'UPDATE ' . STYLES_IMAGESET_DATA_TABLE . '
    1387                                                         SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
    1388                                                         WHERE image_id = $image_id";
    1389                                                 $db->sql_query($sql);
    1390                                         }
    1391                                         // does not exist
    1392                                         else if (!$imageset_data_row)
    1393                                         {
    1394                                                 $sql_ary['image_name']  = $imgname;
    1395                                                 $sql_ary['imageset_id'] = (int) $imageset_id;
    1396                                                 $db->sql_query('INSERT INTO ' . STYLES_IMAGESET_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
    1397                                         }
    1398 
    1399                                         $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
    1400 
    1401                                         add_log('admin', 'LOG_IMAGESET_EDIT', $imageset_name);
    1402 
    1403                                         $template->assign_var('SUCCESS', true);
    1404 
    1405                                         $image_filename = $imgfilename;
    1406                                         $image_width    = $imgwidth;
    1407                                         $image_height   = $imgheight;
    1408                                         $image_lang             = $imglang;
    1409                                 }
    1410                         }
     1318                $sql_extra = $imgnamelang = '';
     1319
     1320                $sql = 'SELECT imageset_path, imageset_name
     1321                        FROM ' . STYLES_IMAGESET_TABLE . "
     1322                        WHERE imageset_id = $imageset_id";
     1323                $result = $db->sql_query($sql);
     1324                $imageset_row = $db->sql_fetchrow($result);
     1325                $db->sql_freeresult($result);
     1326
     1327                if (!$imageset_row)
     1328                {
     1329                        trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING);
     1330                }
     1331
     1332                $imageset_path          = $imageset_row['imageset_path'];
     1333                $imageset_name          = $imageset_row['imageset_name'];
     1334
     1335                if (strpos($imgname, '-') !== false)
     1336                {
     1337                        list($imgname, $imgnamelang) = explode('-', $imgname);
     1338                        $sql_extra = " AND image_lang IN ('" . $db->sql_escape($imgnamelang) . "', '')";
     1339                }
     1340
     1341                $sql = 'SELECT image_filename, image_width, image_height, image_lang, image_id
     1342                        FROM ' . STYLES_IMAGESET_DATA_TABLE . "
     1343                        WHERE imageset_id = $imageset_id
     1344                                AND image_name = '" . $db->sql_escape($imgname) . "'$sql_extra";
     1345                $result = $db->sql_query($sql);
     1346                $imageset_data_row = $db->sql_fetchrow($result);
     1347                $db->sql_freeresult($result);
     1348
     1349                $image_filename = $imageset_data_row['image_filename'];
     1350                $image_width    = $imageset_data_row['image_width'];
     1351                $image_height   = $imageset_data_row['image_height'];
     1352                $image_lang             = $imageset_data_row['image_lang'];
     1353                $image_id               = $imageset_data_row['image_id'];
     1354                $imgsize                = ($imageset_data_row['image_width'] && $imageset_data_row['image_height']) ? 1 : 0;
     1355
     1356                // Check to see whether the selected image exists in the table
     1357                $valid_name = ($update) ? false : true;
     1358
     1359                foreach ($this->imageset_keys as $category => $img_ary)
     1360                {
     1361                        if (in_array($imgname, $img_ary))
     1362                        {
     1363                                $valid_name = true;
     1364                                break;
     1365                        }
     1366                }
     1367
     1368                if ($update && isset($_POST['imgpath']) && $valid_name)
     1369                {
     1370                        // If imgwidth and imgheight are non-zero grab the actual size
     1371                        // from the image itself ... we ignore width settings for the poll center image
     1372                        $imgwidth       = request_var('imgwidth', 0);
     1373                        $imgheight      = request_var('imgheight', 0);
     1374                        $imgsize        = request_var('imgsize', 0);
     1375                        $imgpath        = request_var('imgpath', '');
     1376                        $imgpath        = str_replace('..', '.', $imgpath);
     1377
     1378                        // If no dimensions selected, we reset width and height to 0 ;)
     1379                        if (!$imgsize)
     1380                        {
     1381                                $imgwidth = $imgheight = 0;
     1382                        }
     1383
     1384                        $imglang = '';
     1385
     1386                        if ($imgpath && !file_exists("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath"))
     1387                        {
     1388                                trigger_error($user->lang['NO_IMAGE_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
     1389                        }
     1390
     1391                        // Determine width/height. If dimensions included and no width/height given, we detect them automatically...
     1392                        if ($imgsize && $imgpath)
     1393                        {
     1394                                if (!$imgwidth || !$imgheight)
     1395                                {
     1396                                        list($imgwidth_file, $imgheight_file) = getimagesize("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath");
     1397                                        $imgwidth = ($imgwidth) ? $imgwidth : $imgwidth_file;
     1398                                        $imgheight = ($imgheight) ? $imgheight : $imgheight_file;
     1399                                }
     1400                                $imgwidth       = ($imgname != 'poll_center') ? (int) $imgwidth : 0;
     1401                                $imgheight      = (int) $imgheight;
     1402                        }
     1403
     1404                        if (strpos($imgpath, '/') !== false)
     1405                        {
     1406                                list($imglang, $imgfilename) = explode('/', $imgpath);
     1407                        }
     1408                        else
     1409                        {
     1410                                $imgfilename = $imgpath;
     1411                        }
     1412
     1413                        $sql_ary = array(
     1414                                'image_filename'        => (string) $imgfilename,
     1415                                'image_width'           => (int) $imgwidth,
     1416                                'image_height'          => (int) $imgheight,
     1417                                'image_lang'            => (string) $imglang,
     1418                        );
     1419
     1420                        // already exists
     1421                        if ($imageset_data_row)
     1422                        {
     1423                                $sql = 'UPDATE ' . STYLES_IMAGESET_DATA_TABLE . '
     1424                                        SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
     1425                                        WHERE image_id = $image_id";
     1426                                $db->sql_query($sql);
     1427                        }
     1428                        // does not exist
     1429                        else if (!$imageset_data_row)
     1430                        {
     1431                                $sql_ary['image_name']  = $imgname;
     1432                                $sql_ary['imageset_id'] = (int) $imageset_id;
     1433                                $db->sql_query('INSERT INTO ' . STYLES_IMAGESET_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
     1434                        }
     1435
     1436                        $cache->destroy('sql', STYLES_IMAGESET_DATA_TABLE);
     1437
     1438                        add_log('admin', 'LOG_IMAGESET_EDIT', $imageset_name);
     1439
     1440                        $template->assign_var('SUCCESS', true);
     1441
     1442                        $image_filename = $imgfilename;
     1443                        $image_width    = $imgwidth;
     1444                        $image_height   = $imgheight;
     1445                        $image_lang             = $imglang;
    14111446                }
    14121447
     
    15301565                        'NAME'                          => $imageset_name,
    15311566                        'A_NAME'                        => addslashes($imageset_name),
     1567                        'PATH'                          => $imageset_path,
     1568                        'A_PATH'                        => addslashes($imageset_path),
    15321569                        'ERROR'                         => !$valid_name,
    15331570                        'IMG_SRC'                       => ($image_found) ? '../styles/' . $imageset_path . '/imageset/' . $img_val : 'images/no_image.png',
     
    23962433                }
    23972434
    2398 
    23992435                if ($mode == 'template')
    24002436                {
     
    25272563                                        trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR);
    25282564                                }
    2529                                 $template_data = fread($fp, filesize("{$phpbb_root_path}styles/$template_path$pathfile$file"));
     2565
     2566                                $filesize = filesize("{$phpbb_root_path}styles/$template_path$pathfile$file");
     2567
     2568                                if ($filesize)
     2569                                {
     2570                                        $template_data = fread($fp, $filesize);
     2571                                }
     2572
    25302573                                fclose($fp);
     2574
     2575                                if (!$filesize)
     2576                                {
     2577                                        // File is empty
     2578                                        continue;
     2579                                }
    25312580
    25322581                                if (preg_match_all('#<!-- INCLUDE (.*?\.html) -->#is', $template_data, $matches))
     
    31963245                $db->sql_freeresult($result);
    31973246
    3198 
    31993247                if ($row)
    32003248                {
     
    32113259                if (isset($cfg_data['inherit_from']) && $cfg_data['inherit_from'])
    32123260                {
    3213                         $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path, {$mode}_storedb
     3261                        if ($mode === 'template')
     3262                        {
     3263                                $select_bf = ', bbcode_bitfield';
     3264                        }
     3265                        else
     3266                        {
     3267                                $select_bf = '';
     3268                        }
     3269
     3270                        $sql = "SELECT {$mode}_id, {$mode}_name, {$mode}_path, {$mode}_storedb $select_bf
    32143271                                FROM $sql_from
    32153272                                WHERE {$mode}_name = '" . $db->sql_escape($cfg_data['inherit_from']) . "'
     
    32263283                                $inherit_id = $row["{$mode}_id"];
    32273284                                $inherit_path = $row["{$mode}_path"];
     3285                                $inherit_bf = ($mode === 'template') ? $row["bbcode_bitfield"] : false;
    32283286                                $cfg_data['store_db'] = $row["{$mode}_storedb"];
    32293287                                $store_db = $row["{$mode}_storedb"];
     
    32343292                        $inherit_id = 0;
    32353293                        $inherit_path = '';
    3236                 }
    3237 
     3294                        $inherit_bf = false;
     3295                }
    32383296
    32393297                if (sizeof($error))
     
    32553313                                {
    32563314                                        $sql_ary['bbcode_bitfield'] = $cfg_data['template_bitfield'];
     3315                                }
     3316                                else if ($inherit_bf)
     3317                                {
     3318                                        $sql_ary['bbcode_bitfield'] = $inherit_bf;
    32573319                                }
    32583320                                else
     
    35023564                }
    35033565
    3504 
    35053566                $sql = "SELECT {$mode}_inherits_id
    35063567                        FROM $sql_from
  • trunk/forum/includes/acp/acp_update.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_update.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3838                $errno = 0;
    3939
    40                 $info = get_remote_file('www.phpbb.com', '/updatecheck', ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
     40                $info = obtain_latest_version_info(request_var('versioncheck_force', false), true);
    4141
    4242                if ($info === false)
    4343                {
    44                         trigger_error($errstr, E_USER_WARNING);
     44                        trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING);
    4545                }
    4646
     
    4949
    5050                $announcement_url = trim($info[1]);
     51                $announcement_url = (strpos($announcement_url, '&amp;') === false) ? str_replace('&', '&amp;', $announcement_url) : $announcement_url;
    5152                $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update');
    5253
     
    6970                        'S_VERSION_CHECK'       => true,
    7071                        'U_ACTION'                      => $this->u_action,
     72                        'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&amp;versioncheck_force=1'),
    7173
    7274                        'LATEST_VERSION'        => $latest_version,
  • trunk/forum/includes/acp/acp_users.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_users.php 8831 2008-09-05 19:02:36Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    386386                                                        user_active_flip('flip', $user_id);
    387387
     388                                                        if ($user_row['user_type'] == USER_INACTIVE)
     389                                                        {
     390                                                                if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
     391                                                                {
     392                                                                        include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
     393
     394                                                                        $messenger = new messenger(false);
     395
     396                                                                        $messenger->template('admin_welcome_activated', $user_row['user_lang']);
     397
     398                                                                        $messenger->to($user_row['user_email'], $user_row['username']);
     399
     400                                                                        $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
     401                                                                        $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
     402                                                                        $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
     403                                                                        $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
     404
     405                                                                        $messenger->assign_vars(array(
     406                                                                                'USERNAME'      => htmlspecialchars_decode($user_row['username']))
     407                                                                        );
     408
     409                                                                        $messenger->send(NOTIFY_EMAIL);
     410                                                                }
     411                                                        }
     412
    388413                                                        $message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
    389414                                                        $log = ($user_row['user_type'] == USER_INACTIVE) ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';
     
    494519                                                        }
    495520
     521                                                break;
     522
     523                                                case 'deloutbox':
     524
     525                                                        if (confirm_box(true))
     526                                                        {
     527                                                                $msg_ids = array();
     528                                                                $lang = 'EMPTY';
     529
     530                                                                $sql = 'SELECT msg_id
     531                                                                        FROM ' . PRIVMSGS_TO_TABLE . "
     532                                                                        WHERE author_id = $user_id
     533                                                                                AND folder_id = " . PRIVMSGS_OUTBOX;
     534                                                                $result = $db->sql_query($sql);
     535
     536                                                                if ($row = $db->sql_fetchrow($result))
     537                                                                {
     538                                                                        if (!function_exists('delete_pm'))
     539                                                                        {
     540                                                                                include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
     541                                                                        }
     542
     543                                                                        do
     544                                                                        {
     545                                                                                $msg_ids[] = (int) $row['msg_id'];
     546                                                                        }
     547                                                                        while ($row = $db->sql_fetchrow($result));
     548
     549                                                                        $db->sql_freeresult($result);
     550
     551                                                                        delete_pm($user_id, $msg_ids, PRIVMSGS_OUTBOX);
     552
     553                                                                        add_log('admin', 'LOG_USER_DEL_OUTBOX', $user_row['username']);
     554
     555                                                                        $lang = 'EMPTIED';
     556                                                                }
     557                                                                $db->sql_freeresult($result);
     558
     559                                                                trigger_error($user->lang['USER_OUTBOX_' . $lang] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
     560                                                        }
     561                                                        else
     562                                                        {
     563                                                                confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
     564                                                                        'u'                             => $user_id,
     565                                                                        'i'                             => $id,
     566                                                                        'mode'                  => $mode,
     567                                                                        'action'                => $action,
     568                                                                        'update'                => true))
     569                                                                );
     570                                                        }
    496571                                                break;
    497572
     
    651726
    652727                                                break;
     728
     729                                                case 'leave_nr':
     730
     731                                                        if (confirm_box(true))
     732                                                        {
     733                                                                remove_newly_registered($user_id, $user_row);
     734
     735                                                                add_log('admin', 'LOG_USER_REMOVED_NR', $user_row['username']);
     736                                                                trigger_error($user->lang['USER_LIFTED_NR'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
     737                                                        }
     738                                                        else
     739                                                        {
     740                                                                confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
     741                                                                        'u'                             => $user_id,
     742                                                                        'i'                             => $id,
     743                                                                        'mode'                  => $mode,
     744                                                                        'action'                => $action,
     745                                                                        'update'                => true))
     746                                                                );
     747                                                        }
     748
     749                                                break;
    653750                                        }
    654751
     
    776873                                                        $sql_ary += array(
    777874                                                                'user_email'            => $update_email,
    778                                                                 'user_email_hash'       => crc32($update_email) . strlen($update_email)
     875                                                                'user_email_hash'       => phpbb_email_hash($update_email),
    779876                                                        );
    780877
     
    821918                                if ($user_id == $user->data['user_id'])
    822919                                {
    823                                         $quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
     920                                        $quick_tool_ary = array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX');
     921                                        if ($user_row['user_new'])
     922                                        {
     923                                                $quick_tool_ary['leave_nr'] = 'LEAVE_NR';
     924                                        }
    824925                                }
    825926                                else
     
    837938                                        }
    838939
    839                                         $quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
     940                                        $quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH', 'deloutbox' => 'DEL_OUTBOX');
    840941
    841942                                        if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE))
    842943                                        {
    843944                                                $quick_tool_ary['reactivate'] = 'FORCE';
     945                                        }
     946
     947                                        if ($user_row['user_new'])
     948                                        {
     949                                                $quick_tool_ary['leave_nr'] = 'LEAVE_NR';
    844950                                        }
    845951                                }
     
    9181024                                        'U_MCP_QUEUE'   => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
    9191025
    920                                         'U_SWITCH_PERMISSIONS'  => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_row['user_id']}") : '',
     1026                                        'U_SWITCH_PERMISSIONS'  => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_row['user_id']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_row['user_id']}&amp;hash=" . generate_link_hash('switchperm')) : '',
    9211027
    9221028                                        'POSTS_IN_QUEUE'        => $user_row['posts_in_queue'],
     
    9731079                                                $sql = 'DELETE FROM ' . LOG_TABLE . '
    9741080                                                        WHERE log_type = ' . LOG_USERS . "
     1081                                                        AND reportee_id = $user_id
    9751082                                                        $where_sql";
    9761083                                                $db->sql_query($sql);
     
    10321139                                        );
    10331140                                }
     1141
     1142                        break;
     1143
     1144                        case 'warnings':
     1145                                $user->add_lang('mcp');
     1146
     1147                                // Set up general vars
     1148                                $start          = request_var('start', 0);
     1149                                $deletemark     = (isset($_POST['delmarked'])) ? true : false;
     1150                                $deleteall      = (isset($_POST['delall'])) ? true : false;
     1151                                $confirm        = (isset($_POST['confirm'])) ? true : false;
     1152                                $marked         = request_var('mark', array(0));
     1153                                $message        = utf8_normalize_nfc(request_var('message', '', true));
     1154
     1155                                // Sort keys
     1156                                $sort_days      = request_var('st', 0);
     1157                                $sort_key       = request_var('sk', 't');
     1158                                $sort_dir       = request_var('sd', 'd');
     1159
     1160                                // Delete entries if requested and able
     1161                                if ($deletemark || $deleteall || $confirm)
     1162                                {
     1163                                        if (confirm_box(true))
     1164                                        {
     1165                                                $where_sql = '';
     1166                                                $deletemark = request_var('delmarked', 0);
     1167                                                $deleteall = request_var('delall', 0);
     1168                                                if ($deletemark && $marked)
     1169                                                {
     1170                                                        $where_sql = ' AND ' . $db->sql_in_set('warning_id', array_values($marked));
     1171                                                }
     1172
     1173                                                if ($where_sql || $deleteall)
     1174                                                {
     1175                                                        $sql = 'DELETE FROM ' . WARNINGS_TABLE . "
     1176                                                                WHERE user_id = $user_id
     1177                                                                        $where_sql";
     1178                                                        $db->sql_query($sql);
     1179
     1180                                                        if ($deleteall)
     1181                                                        {
     1182                                                                $log_warnings = $deleted_warnings = 0;
     1183                                                        }
     1184                                                        else
     1185                                                        {
     1186                                                                $num_warnings = (int) $db->sql_affectedrows();
     1187                                                                $deleted_warnings = ' user_warnings - ' . $num_warnings;
     1188                                                                $log_warnings = ($num_warnings > 2) ? 2 : $num_warnings;
     1189                                                        }
     1190
     1191                                                        $sql = 'UPDATE ' . USERS_TABLE . "
     1192                                                                SET user_warnings = $deleted_warnings
     1193                                                                WHERE user_id = $user_id";
     1194                                                        $db->sql_query($sql);
     1195
     1196                                                        switch ($log_warnings)
     1197                                                        {
     1198                                                                case 2:
     1199                                                                        add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings);
     1200                                                                break;
     1201                                                                case 1:
     1202                                                                        add_log('admin', 'LOG_WARNING_DELETED', $user_row['username']);
     1203                                                                break;
     1204                                                                default:
     1205                                                                        add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']);
     1206                                                                break;
     1207                                                        }
     1208                                                }
     1209                                        }
     1210                                        else
     1211                                        {
     1212                                                $s_hidden_fields = array(
     1213                                                        'i'                             => $id,
     1214                                                        'mode'                  => $mode,
     1215                                                        'u'                             => $user_id,
     1216                                                        'mark'                  => $marked,
     1217                                                );
     1218                                                if (isset($_POST['delmarked']))
     1219                                                {
     1220                                                        $s_hidden_fields['delmarked'] = 1;
     1221                                                }
     1222                                                if (isset($_POST['delall']))
     1223                                                {
     1224                                                        $s_hidden_fields['delall'] = 1;
     1225                                                }
     1226                                                if (isset($_POST['delall']) || (isset($_POST['delmarked']) && sizeof($marked)))
     1227                                                {
     1228                                                        confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($s_hidden_fields));
     1229                                                }
     1230                                        }
     1231                                }
     1232
     1233                                $sql = 'SELECT w.warning_id, w.warning_time, w.post_id, l.log_operation, l.log_data, l.user_id AS mod_user_id, m.username AS mod_username, m.user_colour AS mod_user_colour
     1234                                        FROM ' . WARNINGS_TABLE . ' w
     1235                                        LEFT JOIN ' . LOG_TABLE . ' l
     1236                                                ON (w.log_id = l.log_id)
     1237                                        LEFT JOIN ' . USERS_TABLE . ' m
     1238                                                ON (l.user_id = m.user_id)
     1239                                        WHERE w.user_id = ' . $user_id . '
     1240                                        ORDER BY w.warning_time DESC';
     1241                                $result = $db->sql_query($sql);
     1242
     1243                                while ($row = $db->sql_fetchrow($result))
     1244                                {
     1245                                        if (!$row['log_operation'])
     1246                                        {
     1247                                                // We do not have a log-entry anymore, so there is no data available
     1248                                                $row['action'] = $user->lang['USER_WARNING_LOG_DELETED'];
     1249                                        }
     1250                                        else
     1251                                        {
     1252                                                $row['action'] = (isset($user->lang[$row['log_operation']])) ? $user->lang[$row['log_operation']] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}';
     1253                                                if (!empty($row['log_data']))
     1254                                                {
     1255                                                        $log_data_ary = @unserialize($row['log_data']);
     1256                                                        $log_data_ary = ($log_data_ary === false) ? array() : $log_data_ary;
     1257
     1258                                                        if (isset($user->lang[$row['log_operation']]))
     1259                                                        {
     1260                                                                // Check if there are more occurrences of % than arguments, if there are we fill out the arguments array
     1261                                                                // It doesn't matter if we add more arguments than placeholders
     1262                                                                if ((substr_count($row['action'], '%') - sizeof($log_data_ary)) > 0)
     1263                                                                {
     1264                                                                        $log_data_ary = array_merge($log_data_ary, array_fill(0, substr_count($row['action'], '%') - sizeof($log_data_ary), ''));
     1265                                                                }
     1266                                                                $row['action'] = vsprintf($row['action'], $log_data_ary);
     1267                                                                $row['action'] = bbcode_nl2br(censor_text($row['action']));
     1268                                                        }
     1269                                                        else if (!empty($log_data_ary))
     1270                                                        {
     1271                                                                $row['action'] .= '<br />' . implode('', $log_data_ary);
     1272                                                        }
     1273                                                }
     1274                                        }
     1275
     1276
     1277                                        $template->assign_block_vars('warn', array(
     1278                                                'ID'            => $row['warning_id'],
     1279                                                'USERNAME'      => ($row['log_operation']) ? get_username_string('full', $row['mod_user_id'], $row['mod_username'], $row['mod_user_colour']) : '-',
     1280                                                'ACTION'        => make_clickable($row['action']),
     1281                                                'DATE'          => $user->format_date($row['warning_time']),
     1282                                        ));
     1283                                }
     1284                                $db->sql_freeresult($result);
     1285
     1286                                $template->assign_vars(array(
     1287                                        'S_WARNINGS'    => true,
     1288                                ));
    10341289
    10351290                        break;
     
    11361391
    11371392                                                // Update Custom Fields
    1138                                                 if (sizeof($cp_data))
    1139                                                 {
    1140                                                         switch ($db->sql_layer)
    1141                                                         {
    1142                                                                 case 'oracle':
    1143                                                                 case 'firebird':
    1144                                                                 case 'postgres':
    1145                                                                         $right_delim = $left_delim = '"';
    1146                                                                 break;
    1147 
    1148                                                                 case 'sqlite':
    1149                                                                 case 'mssql':
    1150                                                                 case 'mssql_odbc':
    1151                                                                         $right_delim = ']';
    1152                                                                         $left_delim = '[';
    1153                                                                 break;
    1154 
    1155                                                                 case 'mysql':
    1156                                                                 case 'mysql4':
    1157                                                                 case 'mysqli':
    1158                                                                         $right_delim = $left_delim = '`';
    1159                                                                 break;
    1160                                                         }
    1161 
    1162                                                         foreach ($cp_data as $key => $value)
    1163                                                         {
    1164                                                                 $cp_data[$left_delim . $key . $right_delim] = $value;
    1165                                                                 unset($cp_data[$key]);
    1166                                                         }
    1167 
    1168                                                         $sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
    1169                                                                 SET ' . $db->sql_build_array('UPDATE', $cp_data) . "
    1170                                                                 WHERE user_id = $user_id";
    1171                                                         $db->sql_query($sql);
    1172 
    1173                                                         if (!$db->sql_affectedrows())
    1174                                                         {
    1175                                                                 $cp_data['user_id'] = (int) $user_id;
    1176 
    1177                                                                 $db->sql_return_on_error(true);
    1178 
    1179                                                                 $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data);
    1180                                                                 $db->sql_query($sql);
    1181 
    1182                                                                 $db->sql_return_on_error(false);
    1183                                                         }
    1184                                                 }
     1393                                                $cp->update_profile_field_data($user_id, $cp_data);
    11851394
    11861395                                                trigger_error($user->lang['USER_PROFILE_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
     
    12081417                                $now = getdate();
    12091418                                $s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>';
    1210                                 for ($i = $now['year'] - 100; $i < $now['year']; $i++)
     1419                                for ($i = $now['year'] - 100; $i <= $now['year']; $i++)
    12111420                                {
    12121421                                        $selected = ($i == $data['bday_year']) ? ' selected="selected"' : '';
     
    14751684                                }
    14761685
     1686                                if (!$config['allow_avatar'] && $user_row['user_avatar_type'])
     1687                                {
     1688                                        $error[] = $user->lang['USER_AVATAR_NOT_ALLOWED'];
     1689                                }
     1690                                else if ((($user_row['user_avatar_type'] == AVATAR_UPLOAD) && !$config['allow_avatar_upload']) ||
     1691                                 (($user_row['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) ||
     1692                                 (($user_row['user_avatar_type'] == AVATAR_GALLERY) && !$config['allow_avatar_local']))
     1693                                {
     1694                                        $error[] = $user->lang['USER_AVATAR_TYPE_NOT_ALLOWED'];
     1695                                }
     1696
    14771697                                // Generate users avatar
    1478                                 $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height']) : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
     1698                                $avatar_img = ($user_row['user_avatar']) ? get_user_avatar($user_row['user_avatar'], $user_row['user_avatar_type'], $user_row['user_avatar_width'], $user_row['user_avatar_height'], 'USER_AVATAR', true) : '<img src="' . $phpbb_admin_path . 'images/no_avatar.gif" alt="" />';
    14791699
    14801700                                $display_gallery = (isset($_POST['display_gallery'])) ? true : false;
     
    14891709                                $template->assign_vars(array(
    14901710                                        'S_AVATAR'                      => true,
    1491                                         'S_CAN_UPLOAD'          => ($can_upload && $config['allow_avatar_upload']) ? true : false,
    1492                                         'S_ALLOW_REMOTE'        => ($config['allow_avatar_remote']) ? true : false,
    1493                                         'S_DISPLAY_GALLERY'     => ($config['allow_avatar_local'] && !$display_gallery) ? true : false,
    1494                                         'S_IN_GALLERY'          => ($config['allow_avatar_local'] && $display_gallery) ? true : false,
     1711                                        'S_CAN_UPLOAD'          => $can_upload,
     1712                                        'S_UPLOAD_FILE'         => ($config['allow_avatar'] && $can_upload && $config['allow_avatar_upload']) ? true : false,
     1713                                        'S_REMOTE_UPLOAD'       => ($config['allow_avatar'] && $can_upload && $config['allow_avatar_remote_upload']) ? true : false,
     1714                                        'S_ALLOW_REMOTE'        => ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false,
     1715                                        'S_DISPLAY_GALLERY'     => ($config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery) ? true : false,
     1716                                        'S_IN_GALLERY'          => ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery) ? true : false,
    14951717
    14961718                                        'AVATAR_IMAGE'                  => $avatar_img,
     
    15501772                                include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    15511773
    1552                                 $enable_bbcode  = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;
    1553                                 $enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;
    1554                                 $enable_urls    = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
     1774                                $enable_bbcode  = ($config['allow_sig_bbcode']) ? (bool) $this->optionget($user_row, 'sig_bbcode') : false;
     1775                                $enable_smilies = ($config['allow_sig_smilies']) ? (bool) $this->optionget($user_row, 'sig_smilies') : false;
     1776                                $enable_urls    = ($config['allow_sig_links']) ? (bool) $this->optionget($user_row, 'sig_links') : false;
    15551777                                $signature              = utf8_normalize_nfc(request_var('signature', (string) $user_row['user_sig'], true));
    15561778
     
    15601782                                {
    15611783                                        include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
     1784
     1785                                        $enable_bbcode  = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false;
     1786                                        $enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false;
     1787                                        $enable_urls    = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
    15621788
    15631789                                        $message_parser = new parse_message($signature);
     
    15781804                                        if (!sizeof($error) && $submit)
    15791805                                        {
     1806                                                $this->optionset($user_row, 'sig_bbcode', $enable_bbcode);
     1807                                                $this->optionset($user_row, 'sig_smilies', $enable_smilies);
     1808                                                $this->optionset($user_row, 'sig_links', $enable_urls);
     1809
    15801810                                                $sql_ary = array(
    15811811                                                        'user_sig'                                      => (string) $message_parser->message,
     1812                                                        'user_options'                          => $user_row['user_options'],
    15821813                                                        'user_sig_bbcode_uid'           => (string) $message_parser->bbcode_uid,
    15831814                                                        'user_sig_bbcode_bitfield'      => (string) $message_parser->bbcode_bitfield
     
    18472078
    18482079                                                        $error = array();
     2080
     2081                                                        // The delete action was successful - therefore update the user row...
     2082                                                        $sql = 'SELECT u.*, s.*
     2083                                                                FROM ' . USERS_TABLE . ' u
     2084                                                                        LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id)
     2085                                                                WHERE u.user_id = ' . $user_id . '
     2086                                                                ORDER BY s.session_time DESC';
     2087                                                        $result = $db->sql_query($sql);
     2088                                                        $user_row = $db->sql_fetchrow($result);
     2089                                                        $db->sql_freeresult($result);
    18492090                                                }
    18502091                                                else
     
    18602101
    18612102                                        break;
     2103
     2104                                        case 'approve':
     2105
     2106                                                if (confirm_box(true))
     2107                                                {
     2108                                                        if (!$group_id)
     2109                                                        {
     2110                                                                trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
     2111                                                        }
     2112                                                        group_user_attributes($action, $group_id, $user_id);
     2113                                                }
     2114                                                else
     2115                                                {
     2116                                                        confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
     2117                                                                'u'                             => $user_id,
     2118                                                                'i'                             => $id,
     2119                                                                'mode'                  => $mode,
     2120                                                                'action'                => $action,
     2121                                                                'g'                             => $group_id))
     2122                                                        );
     2123                                                }
     2124
     2125                                        break;
    18622126                                }
    18632127
     
    19522216                                                        'U_DEMOTE_PROMOTE'      => $this->u_action . '&amp;action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id'],
    19532217                                                        'U_DELETE'                      => $this->u_action . "&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id'],
     2218                                                        'U_APPROVE'                     => ($group_type == 'pending') ? $this->u_action . "&amp;action=approve&amp;u=$user_id&amp;g=" . $data['group_id'] : '',
    19542219
    19552220                                                        'GROUP_NAME'            => ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name'],
    19562221                                                        'L_DEMOTE_PROMOTE'      => ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'],
    19572222
     2223                                                        'S_IS_MEMBER'           => ($group_type != 'pending') ? true : false,
    19582224                                                        'S_NO_DEFAULT'          => ($user_row['group_id'] != $data['group_id']) ? true : false,
    19592225                                                        'S_SPECIAL_GROUP'       => ($group_type == 'special') ? true : false,
  • trunk/forum/includes/acp/acp_words.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_words.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2424{
    2525        var $u_action;
    26        
     26
    2727        function main($id, $mode)
    2828        {
     
    4848                {
    4949                        case 'edit':
     50
    5051                                $word_id = request_var('id', 0);
    51                                
     52
    5253                                if (!$word_id)
    5354                                {
     
    7475                                        'S_HIDDEN_FIELDS'       => $s_hidden_fields)
    7576                                );
    76                                
     77
    7778                                return;
    7879
     
    8586                                        trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
    8687                                }
     88
    8789                                $word_id                = request_var('id', 0);
    8890                                $word                   = utf8_normalize_nfc(request_var('word', '', true));
    8991                                $replacement    = utf8_normalize_nfc(request_var('replacement', '', true));
    90                                
    91                                 if (!$word || !$replacement)
     92
     93                                if ($word === '' || $replacement === '')
    9294                                {
    9395                                        trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING);
  • trunk/forum/includes/acp/auth.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: auth.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    5959                }
    6060        }
    61        
     61
    6262        /**
    6363        * Get permission mask
     
    141141                                }
    142142
    143                                
     143
    144144                                $hold_ary[$userdata['user_id']] = array();
    145145                                foreach ($forum_ids as $f_id)
     
    346346                // Build js roles array (role data assignments)
    347347                $s_role_js_array = '';
    348                
     348
    349349                if (sizeof($roles))
    350350                {
     
    697697                $cur_options = array();
    698698
     699                // Determine current options
    699700                $sql = 'SELECT auth_option, is_global, is_local
    700701                        FROM ' . ACL_OPTIONS_TABLE . '
     
    704705                while ($row = $db->sql_fetchrow($result))
    705706                {
    706                         if ($row['is_global'])
    707                         {
    708                                 $cur_options['global'][] = $row['auth_option'];
    709                         }
    710 
    711                         if ($row['is_local'])
    712                         {
    713                                 $cur_options['local'][] = $row['auth_option'];
    714                         }
     707                        $cur_options[$row['auth_option']] = ($row['is_global'] && $row['is_local']) ? 'both' : (($row['is_global']) ? 'global' : 'local');
    715708                }
    716709                $db->sql_freeresult($result);
     
    727720                        foreach ($option_ary as $option_value)
    728721                        {
    729                                 if (!in_array($option_value, $cur_options[$type]))
    730                                 {
    731                                         $new_options[$type][] = $option_value;
    732                                 }
     722                                $new_options[$type][] = $option_value;
    733723
    734724                                $flag = substr($option_value, 0, strpos($option_value, '_') + 1);
    735725
    736                                 if (!in_array($flag, $cur_options[$type]) && !in_array($flag, $new_options[$type]))
     726                                if (!in_array($flag, $new_options[$type]))
    737727                                {
    738728                                        $new_options[$type][] = $flag;
     
    745735                $options['local'] = array_diff($new_options['local'], $new_options['global']);
    746736                $options['global'] = array_diff($new_options['global'], $new_options['local']);
    747                 $options['local_global'] = array_intersect($new_options['local'], $new_options['global']);
    748 
    749                 $sql_ary = array();
    750 
     737                $options['both'] = array_intersect($new_options['local'], $new_options['global']);
     738
     739                // Now check which options to add/update
     740                $add_options = $update_options = array();
     741
     742                // First local ones...
    751743                foreach ($options as $type => $option_ary)
    752744                {
    753745                        foreach ($option_ary as $option)
    754746                        {
    755                                 $sql_ary[] = array(
    756                                         'auth_option'   => (string) $option,
    757                                         'is_global'             => ($type == 'global' || $type == 'local_global') ? 1 : 0,
    758                                         'is_local'              => ($type == 'local' || $type == 'local_global') ? 1 : 0
    759                                 );
    760                         }
    761                 }
    762 
    763                 $db->sql_multi_insert(ACL_OPTIONS_TABLE, $sql_ary);
     747                                if (!isset($cur_options[$option]))
     748                                {
     749                                        $add_options[] = array(
     750                                                'auth_option'   => (string) $option,
     751                                                'is_global'             => ($type == 'global' || $type == 'both') ? 1 : 0,
     752                                                'is_local'              => ($type == 'local' || $type == 'both') ? 1 : 0
     753                                        );
     754
     755                                        continue;
     756                                }
     757
     758                                // Else, update existing entry if it is changed...
     759                                if ($type === $cur_options[$option])
     760                                {
     761                                        continue;
     762                                }
     763
     764                                // New type is always both:
     765                                // If is now both, we set both.
     766                                // If it was global the new one is local and we need to set it to both
     767                                // If it was local the new one is global and we need to set it to both
     768                                $update_options[] = $option;
     769                        }
     770                }
     771
     772                if (!empty($add_options))
     773                {
     774                        $db->sql_multi_insert(ACL_OPTIONS_TABLE, $add_options);
     775                }
     776
     777                if (!empty($update_options))
     778                {
     779                        $sql = 'UPDATE ' . ACL_OPTIONS_TABLE . '
     780                                SET is_global = 1, is_local = 1
     781                                WHERE ' . $db->sql_in_set('auth_option', $update_options);
     782                        $db->sql_query($sql);
     783                }
    764784
    765785                $cache->destroy('_acl_options');
     
    803823                $flag = key($auth);
    804824                $flag = substr($flag, 0, strpos($flag, '_') + 1);
    805                
     825
    806826                // This ID (the any-flag) is set if one or more permissions are true...
    807827                $any_option_id = (int) $this->acl_options['id'][$flag];
     
    917937                $flag = key($auth);
    918938                $flag = substr($flag, 0, strpos($flag, '_') + 1);
    919                
     939
    920940                // Remove any-flag from auth ary
    921941                if (isset($auth[$flag]))
     
    10681088                        $where_sql[] = $db->sql_in_set('auth_option_id', array_map('intval', $option_id_ary));
    10691089                }
    1070                
     1090
    10711091                $sql = "DELETE FROM $table
    10721092                        WHERE " . implode(' AND ', $where_sql);
     
    10911111                                'S_NEVER'       => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false,
    10921112                                'S_NO'          => ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false,
    1093                                                        
     1113
    10941114                                'CAT_NAME'      => $user->lang['permission_cat'][$cat])
    10951115                        );
     
    11801200                                        );
    11811201                                }
    1182                        
     1202
    11831203                                $cat = $user->lang['acl_' . $permission]['cat'];
    1184                        
     1204
    11851205                                // Build our categories array
    11861206                                if (!isset($categories[$cat]))
  • trunk/forum/includes/acp/info/acp_board.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_board.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2727                                'post'                  => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
    2828                                'signature'             => array('title' => 'ACP_SIGNATURE_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
     29                                'feed'                  => array('title' => 'ACP_FEED_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
    2930                                'registration'  => array('title' => 'ACP_REGISTER_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
    3031
  • trunk/forum/includes/acp/info/acp_permissions.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_permissions.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2525
    2626                                'setting_forum_local'   => array('title' => 'ACP_FORUM_PERMISSIONS', 'auth' => 'acl_a_fauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')),
     27                                'setting_forum_copy'    => array('title' => 'ACP_FORUM_PERMISSIONS_COPY', 'auth' => 'acl_a_fauth && acl_a_authusers && acl_a_authgroups && acl_a_mauth', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')),
    2728                                'setting_mod_local'             => array('title' => 'ACP_FORUM_MODERATORS', 'auth' => 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')),
    2829                                'setting_user_global'   => array('title' => 'ACP_USERS_PERMISSIONS', 'auth' => 'acl_a_authusers && (acl_a_aauth || acl_a_mauth || acl_a_uauth)', 'cat' => array('ACP_GLOBAL_PERMISSIONS', 'ACP_CAT_USERS')),
  • trunk/forum/includes/acp/info/acp_users.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: acp_users.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2323                                'overview'              => array('title' => 'ACP_MANAGE_USERS', 'auth' => 'acl_a_user', 'cat' => array('ACP_CAT_USERS')),
    2424                                'feedback'              => array('title' => 'ACP_USER_FEEDBACK', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
     25                                'warnings'              => array('title' => 'ACP_USER_WARNINGS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
    2526                                'profile'               => array('title' => 'ACP_USER_PROFILE', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
    2627                                'prefs'                 => array('title' => 'ACP_USER_PREFS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
  • trunk/forum/includes/auth.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: auth.php 8985 2008-10-09 13:18:38Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    6565
    6666                        $cache->put('_acl_options', $this->acl_options);
    67                         $this->acl_cache($userdata);
    68                 }
    69                 else if (!trim($userdata['user_permissions']))
     67                }
     68
     69                if (!trim($userdata['user_permissions']))
    7070                {
    7171                        $this->acl_cache($userdata);
     
    609609                // Now grab group settings - non-role specific...
    610610                $sql_ary[] = 'SELECT ug.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . '
    611                         FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug' . $sql_opts_from . '
     611                        FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g' . $sql_opts_from . '
    612612                        WHERE a.auth_role_id = 0 ' .
    613613                                (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') . '
    614614                                AND a.group_id = ug.group_id
     615                                AND g.group_id = ug.group_id
    615616                                AND ug.user_pending = 0
     617                                AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
    616618                                ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . "
    617619                                $sql_forum
     
    620622                // Now grab group settings - role specific...
    621623                $sql_ary[] = 'SELECT ug.user_id, a.forum_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . '
    622                         FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . '
     624                        FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . '
    623625                        WHERE a.auth_role_id = r.role_id ' .
    624626                                (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') . '
    625627                                AND a.group_id = ug.group_id
     628                                AND g.group_id = ug.group_id
    626629                                AND ug.user_pending = 0
     630                                AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
    627631                                ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . "
    628632                                $sql_forum
     
    826830                // Now grab group-specific permission settings
    827831                $sql = 'SELECT a.forum_id, a.auth_option_id, a.auth_role_id, a.auth_setting
    828                         FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug
     832                        FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . GROUPS_TABLE . ' g
    829833                        WHERE a.group_id = ug.group_id
     834                                AND g.group_id = ug.group_id
    830835                                AND ug.user_pending = 0
     836                                AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
    831837                                AND ug.user_id = ' . $user_id;
    832838                $result = $db->sql_query($sql);
  • trunk/forum/includes/auth/auth_apache.php

    r400 r702  
    66*
    77* @package login
    8 * @version $Id: auth_apache.php 8602 2008-06-04 16:05:27Z naderman $
     8* @version $Id$
    99* @copyright (c) 2005 phpBB Group
    1010* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    105105                                );
    106106                        }
    107        
     107
    108108                        // Successful login...
    109109                        return array(
     
    218218                'user_type'             => USER_NORMAL,
    219219                'user_ip'               => $user->ip,
     220                'user_new'              => ($config['new_member_post_limit']) ? 1 : 0,
    220221        );
    221222}
     
    228229function validate_session_apache(&$user)
    229230{
    230         if (!isset($_SERVER['PHP_AUTH_USER']))
    231         {
    232                 return false;
    233         }
    234 
    235         $php_auth_user = '';
    236         set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
    237 
    238         return ($php_auth_user === $user['username']) ? true : false;
     231        // Check if PHP_AUTH_USER is set and handle this case
     232        if (isset($_SERVER['PHP_AUTH_USER']))
     233        {
     234                $php_auth_user = '';
     235                set_var($php_auth_user, $_SERVER['PHP_AUTH_USER'], 'string', true);
     236
     237                return ($php_auth_user === $user['username']) ? true : false;
     238        }
     239
     240        // PHP_AUTH_USER is not set. A valid session is now determined by the user type (anonymous/bot or not)
     241        if ($user['user_type'] == USER_IGNORE)
     242        {
     243                return true;
     244        }
     245
     246        return false;
    239247}
    240248
  • trunk/forum/includes/auth/auth_db.php

    r400 r702  
    88*
    99* @package login
    10 * @version $Id: auth_db.php 8479 2008-03-29 00:22:48Z naderman $
     10* @version $Id$
    1111* @copyright (c) 2005 phpBB Group
    1212* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    6363                );
    6464        }
     65        $show_captcha = $config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts'];
    6566
    6667        // If there are too much login attempts, we need to check for an confirm image
    6768        // Every auth module is able to define what to do by itself...
    68         if ($config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts'])
    69         {
    70                 $confirm_id = request_var('confirm_id', '');
    71                 $confirm_code = request_var('confirm_code', '');
    72 
     69        if ($show_captcha)
     70        {
    7371                // Visual Confirmation handling
    74                 if (!$confirm_id)
     72                if (!class_exists('phpbb_captcha_factory'))
     73                {
     74                        global $phpbb_root_path, $phpEx;
     75                        include ($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
     76                }
     77
     78                $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
     79                $captcha->init(CONFIRM_LOGIN);
     80                $vc_response = $captcha->validate($row);
     81                if ($vc_response)
    7582                {
    7683                        return array(
     
    8289                else
    8390                {
    84                         global $user;
    85 
    86                         $sql = 'SELECT code
    87                                 FROM ' . CONFIRM_TABLE . "
    88                                 WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
    89                                         AND session_id = '" . $db->sql_escape($user->session_id) . "'
    90                                         AND confirm_type = " . CONFIRM_LOGIN;
    91                         $result = $db->sql_query($sql);
    92                         $confirm_row = $db->sql_fetchrow($result);
    93                         $db->sql_freeresult($result);
    94 
    95                         if ($confirm_row)
    96                         {
    97                                 if (strcasecmp($confirm_row['code'], $confirm_code) === 0)
    98                                 {
    99                                         $sql = 'DELETE FROM ' . CONFIRM_TABLE . "
    100                                                 WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
    101                                                         AND session_id = '" . $db->sql_escape($user->session_id) . "'
    102                                                         AND confirm_type = " . CONFIRM_LOGIN;
    103                                         $db->sql_query($sql);
    104                                 }
    105                                 else
    106                                 {
    107                                         return array(
    108                                                 'status'                => LOGIN_ERROR_ATTEMPTS,
    109                                                 'error_msg'             => 'CONFIRM_CODE_WRONG',
    110                                                 'user_row'              => $row,
    111                                         );
    112                                 }
    113                         }
    114                         else
    115                         {
    116                                 return array(
    117                                         'status'                => LOGIN_ERROR_ATTEMPTS,
    118                                         'error_msg'             => 'CONFIRM_CODE_WRONG',
    119                                         'user_row'              => $row,
    120                                 );
    121                         }
    122                 }
     91                        $captcha->reset();
     92                }
     93               
    12394        }
    12495
     
    142113
    143114                        // cp1252 is phpBB2's default encoding, characters outside ASCII range might work when converted into that encoding
    144                         if (md5($password_old_format) == $row['user_password'] || md5(utf8_to_cp1252($password_old_format)) == $row['user_password'])
     115                        // plain md5 support left in for conversions from other systems.
     116                        if ((strlen($row['user_password']) == 34 && (phpbb_check_hash(md5($password_old_format), $row['user_password']) || phpbb_check_hash(md5(utf8_to_cp1252($password_old_format)), $row['user_password'])))
     117                                || (strlen($row['user_password']) == 32  && (md5($password_old_format) == $row['user_password'] || md5(utf8_to_cp1252($password_old_format)) == $row['user_password'])))
    145118                        {
    146119                                $hash = phpbb_hash($password_new_format);
     
    227200        // Give status about wrong password...
    228201        return array(
    229                 'status'                => LOGIN_ERROR_PASSWORD,
    230                 'error_msg'             => 'LOGIN_ERROR_PASSWORD',
     202                'status'                => ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD,
     203                'error_msg'             => ($show_captcha) ? 'LOGIN_ERROR_ATTEMPTS' : 'LOGIN_ERROR_PASSWORD',
    231204                'user_row'              => $row,
    232205        );
  • trunk/forum/includes/auth/auth_ldap.php

    r400 r702  
    77*
    88* @package login
    9 * @version $Id: auth_ldap.php 8479 2008-03-29 00:22:48Z naderman $
     9* @version $Id$
    1010* @copyright (c) 2005 phpBB Group
    1111* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    6464        $search = @ldap_search(
    6565                $ldap,
    66                 $config['ldap_base_dn'],
     66                htmlspecialchars_decode($config['ldap_base_dn']),
    6767                ldap_user_filter($user->data['username']),
    68                 (empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']),
     68                (empty($config['ldap_email'])) ?
     69                        array(htmlspecialchars_decode($config['ldap_uid'])) :
     70                        array(htmlspecialchars_decode($config['ldap_uid']), htmlspecialchars_decode($config['ldap_email'])),
    6971                0,
    7072                1
     
    8688        }
    8789
    88         if (!empty($config['ldap_email']) && !isset($result[0][$config['ldap_email']]))
     90        if (!empty($config['ldap_email']) && !isset($result[0][htmlspecialchars_decode($config['ldap_email'])]))
    8991        {
    9092                return $user->lang['LDAP_NO_EMAIL'];
     
    153155        if ($config['ldap_user'] || $config['ldap_password'])
    154156        {
    155                 if (!@ldap_bind($ldap, $config['ldap_user'], htmlspecialchars_decode($config['ldap_password'])))
     157                if (!@ldap_bind($ldap, htmlspecialchars_decode($config['ldap_user']), htmlspecialchars_decode($config['ldap_password'])))
    156158                {
    157159                        return $user->lang['LDAP_NO_SERVER_CONNECTION'];
     
    161163        $search = @ldap_search(
    162164                $ldap,
    163                 $config['ldap_base_dn'],
     165                htmlspecialchars_decode($config['ldap_base_dn']),
    164166                ldap_user_filter($username),
    165                 (empty($config['ldap_email'])) ? array($config['ldap_uid']) : array($config['ldap_uid'], $config['ldap_email']),
     167                (empty($config['ldap_email'])) ?
     168                        array(htmlspecialchars_decode($config['ldap_uid'])) :
     169                        array(htmlspecialchars_decode($config['ldap_uid']), htmlspecialchars_decode($config['ldap_email'])),
    166170                0,
    167171                1
     
    224228                                        'username'              => $username,
    225229                                        'user_password' => phpbb_hash($password),
    226                                         'user_email'    => (!empty($config['ldap_email'])) ? $ldap_result[0][$config['ldap_email']][0] : '',
     230                                        'user_email'    => (!empty($config['ldap_email'])) ? utf8_htmlspecialchars($ldap_result[0][htmlspecialchars_decode($config['ldap_email'])][0]) : '',
    227231                                        'group_id'              => (int) $row['group_id'],
    228232                                        'user_type'             => USER_NORMAL,
    229233                                        'user_ip'               => $user->ip,
     234                                        'user_new'              => ($config['new_member_post_limit']) ? 1 : 0,
    230235                                );
    231236
     
    277282        if ($config['ldap_user_filter'])
    278283        {
    279                 $filter = "(&$filter({$config['ldap_user_filter']}))";
     284                $_filter = ($config['ldap_user_filter'][0] == '(' && substr($config['ldap_user_filter'], -1) == ')') ? $config['ldap_user_filter'] : "({$config['ldap_user_filter']})";
     285                $filter = "(&{$filter}{$_filter})";
    280286        }
    281287        return $filter;
  • trunk/forum/includes/bbcode.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: bbcode.php 8953 2008-09-28 17:08:09Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    129129        function bbcode_cache_init()
    130130        {
    131                 global $user, $phpbb_root_path;
     131                global $phpbb_root_path, $template, $user;
    132132
    133133                if (empty($this->template_filename))
     
    135135                        $this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']);
    136136                        $this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html';
    137                        
     137
    138138                        if (!@file_exists($this->template_filename))
    139139                        {
     
    266266                                        $this->bbcode_cache[$bbcode_id] = array(
    267267                                                'preg' => array(
    268                                                         '!\[color=(#[0-9a-f]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!is'        => $this->bbcode_tpl('color', $bbcode_id),
     268                                                        '!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!is'   => $this->bbcode_tpl('color', $bbcode_id),
    269269                                                )
    270270                                        );
     
    361361                                                                // to replace all {VARS} to corresponding backreferences
    362362                                                                // Note that backreferences are numbered from bbcode_match
    363                                                                 if (preg_match_all('/\{(URL|LOCAL_URL|EMAIL|TEXT|SIMPLETEXT|IDENTIFIER|COLOR|NUMBER)[0-9]*\}/', $rowset[$bbcode_id]['bbcode_match'], $m))
     363                                                                if (preg_match_all('/\{(URL|LOCAL_URL|EMAIL|TEXT|SIMPLETEXT|INTTEXT|IDENTIFIER|COLOR|NUMBER)[0-9]*\}/', $rowset[$bbcode_id]['bbcode_match'], $m))
    364364                                                                {
    365365                                                                        foreach ($m[0] as $i => $tok)
     
    411411                {
    412412                        global $user;
    413                        
     413
    414414                        $bbcode_hardtpl = array(
    415415                                'b_open'        => '<span style="font-weight: bold">',
     
    529529                {
    530530                        $tpl = 'olist_open';
    531                         $type = 'arabic-numbers';
     531                        $type = 'decimal';
    532532                }
    533533                else
    534534                {
    535535                        $tpl = 'olist_open';
    536                         $type = 'arabic-numbers';
     536                        $type = 'decimal';
    537537                }
    538538
  • trunk/forum/includes/cache.php

    r400 r702  
    33*
    44* @package acm
    5 * @version $Id: cache.php 8691 2008-07-28 13:26:20Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    8585                        while ($row = $db->sql_fetchrow($result))
    8686                        {
    87                                 $censors['match'][] = '#(?<!\w)(' . str_replace('\*', '\w*?', preg_quote($row['word'], '#')) . ')(?!\w)#i';
     87                                if ((version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) && @preg_match('/\p{L}/u', 'a') !== false)
     88                                {
     89                                        $censors['match'][] = '#(?<![\p{Nd}\p{L}_])(' . str_replace('\*', '[\p{Nd}\p{L}_]*?', preg_quote($row['word'], '#')) . ')(?![\p{Nd}\p{L}_])#iu';
     90                                }
     91                                else
     92                                {
     93                                        $censors['match'][] = '#(?<!\S)(' . str_replace('\*', '\S*?', preg_quote($row['word'], '#')) . ')(?!\S)#iu';
     94                                }
     95
    8896                                $censors['replace'][] = $row['replacement'];
    8997                        }
  • trunk/forum/includes/captcha/captcha_gd.php

    r400 r702  
    33*
    44* @package VC
    5 * @version $Id: captcha_gd.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2006 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2828        var $height = 96;
    2929
     30
    3031        /**
    3132        * Create the image containing $code with a seed of $seed
     
    3435        {
    3536                global $config;
    36                 srand($seed);
     37               
    3738                mt_srand($seed);
    3839
     
    5354
    5455                // Generate code characters
    55                 $characters = $sizes = $bounding_boxes = array();
     56                $characters = $sizes = $bounding_boxes = $noise = array();
    5657                $width_avail = $this->width - 15;
    5758                $code_len = strlen($code);
    58 
    5959                $captcha_bitmaps = $this->captcha_bitmaps();
     60
    6061                for ($i = 0; $i < $code_len; ++$i)
    6162                {
     
    7071                }
    7172
     73 
    7274                // Redistribute leftover x-space
    7375                $offset = array();
     
    99101                        }
    100102                }
    101 
     103                if ($config['captcha_gd_wave'] && ($config['captcha_gd_y_grid'] || $config['captcha_gd_y_grid']))
     104                {
     105                        $this->wave($img);
     106                }
     107               
     108               
     109                if ($config['captcha_gd_3d_noise'])
     110                {
     111                        $xoffset = mt_rand(0,9);
     112                        $noise_bitmaps = $this->captcha_noise_bg_bitmaps();
     113                        for ($i = 0; $i < $code_len; ++$i)
     114                        {
     115                                $noise[$i] = new char_cube3d($noise_bitmaps, mt_rand(1, count($noise_bitmaps['data'])));
     116
     117                                list($min, $max) = $noise[$i]->range();
     118                                //$box = $noise[$i]->dimensions($sizes[$i]);
     119                        }
     120                        $xoffset = 0;
     121                        for ($i = 0; $i < $code_len; ++$i)
     122                        {
     123                                $dimm = $bounding_boxes[$i];
     124                                $xoffset += ($offset[$i] - $dimm[0]);
     125                                $yoffset = mt_rand(-$dimm[1], $this->height - $dimm[3]);
     126         
     127                                $noise[$i]->drawchar($sizes[$i], $xoffset, $yoffset, $img, $colour->get_resource('background'), $scheme);
     128                                $xoffset += $dimm[2];
     129                        }
     130                }
    102131                $xoffset = 5;
    103132                for ($i = 0; $i < $code_len; ++$i)
     
    110139                        $xoffset += $dimm[2];
    111140                }
    112                
     141                if ($config['captcha_gd_wave'])
     142                {
     143                        $this->wave($img);
     144                }
    113145                if ($config['captcha_gd_foreground_noise'])
    114146                {
    115147                        $this->noise_line($img, 0, 0, $this->width, $this->height, $colour->get_resource('background'), $scheme, $bg_colours);
    116148                }
    117 
    118149                // Send image
    119150                header('Content-Type: image/png');
     
    124155
    125156        /**
     157        * Sinus
     158        */
     159        function wave($img)
     160        {
     161                global $config;
     162               
     163                $period_x = mt_rand(12,18);
     164                $period_y = mt_rand(7,14);
     165                $amp_x = mt_rand(5,10);
     166                $amp_y = mt_rand(2,4);
     167                $socket = mt_rand(0,100);
     168               
     169                $dampen_x = mt_rand($this->width/5, $this->width/2);
     170                $dampen_y = mt_rand($this->height/5, $this->height/2);
     171                $direction_x = (mt_rand (0, 1));
     172                $direction_y = (mt_rand (0, 1));
     173
     174                for ($i = 0; $i < $this->width; $i++)
     175                {
     176                        $dir = ($direction_x) ? $i : ($this->width - $i);
     177                        imagecopy($img, $img, $i-1, sin($socket+ $i/($period_x + $dir/$dampen_x)) * $amp_x, $i, 0, 1, $this->height);
     178                }
     179                $socket = mt_rand(0,100);
     180                for ($i = 0; $i < $this->height; $i++)
     181                {
     182                        $dir = ($direction_y) ? $i : ($this->height - $i);
     183                        imagecopy($img, $img ,sin($socket + $i/($period_y + ($dir)/$dampen_y)) * $amp_y, $i-1, 0, $i, $this->width, 1);
     184                }
     185                return $img;
     186        }
     187       
     188        /**
    126189        * Noise line
    127190        */
     
    172235        }
    173236
     237
     238        function captcha_noise_bg_bitmaps()
     239        {               
     240                return array(
     241                        'width'         => 15,
     242                        'height'        => 5,
     243                        'data'          => array(
     244
     245                        1 => array(
     246                                array(1,0,0,0,1,0,0,0,0,0,0,0,0,0,0),
     247                                array(1,0,0,0,0,1,0,0,0,0,0,0,0,0,0),
     248                                array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     249                                array(1,0,0,0,0,1,0,0,0,0,0,0,1,0,0),
     250                                array(1,0,0,0,0,0,1,0,0,0,0,1,0,0,0),
     251                        ),
     252                        2 => array(
     253                                array(1,1,mt_rand(0,1),1,0,1,1,1,1,0,0,0,0,0,0),
     254                                array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
     255                                array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     256                                array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     257                                array(0,0,0,0,0,0,0,0,0,1,1,0,1,1,1),
     258                        ),
     259                        3 => array(
     260                                array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,1),
     261                                array(1,0,0,0,0,0,0,0,0,0,0,0,0,1,0),
     262                                array(0,0,0,0,1,0,0,0,0,0,0,0,0,0,1),
     263                                array(1,0,0,0,0,0,0,0,0,0,0,0,0,1,0),
     264                                array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,1),
     265                        ),
     266                        4 => array(
     267                                array(1,0,1,0,1,0,0,1,1,0,0,0,0,0,0),
     268                                array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
     269                                array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     270                                array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     271                                array(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0),
     272                        ),
     273                        5 => array(
     274                                array(1,1,1,1,0,0,0,1,1,1,0,0,1,0,1),
     275                                array(0,0,0,0,0,0,0,1,0,0,0,0,0,0,0),
     276                                array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     277                                array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     278                                array(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0),
     279                        ),
     280                        6 => array(
     281                                array(mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),mt_rand(0,1),0,mt_rand(0,1),mt_rand(0,1),mt_rand(0,1)),
     282                                array(0,0,0,0,0,0,0,mt_rand(0,1),0,0,0,0,0,0,0),
     283                                array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     284                                array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     285                                array(mt_rand(0,1),0,mt_rand(0,1),0,0,0,0,0,0,0,0,0,0,0,0),
     286                        ),
     287                        7 => array(
     288                                array(0,0,0,0,0,0,0,0,0,0,1,1,0,1,1),
     289                                array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     290                                array(0,0,1,1,0,0,0,1,0,0,0,0,0,0,0),
     291                                array(0,1,0,0,0,1,0,0,0,0,0,0,0,0,0),
     292                                array(1,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
     293                        ),
     294                ));
     295        }
     296       
    174297        /**
    175298        * Return bitmaps
     
    177300        function captcha_bitmaps()
    178301        {
     302                global $config;
     303               
     304                $chars = array(
     305                        'A'     =>      array(
     306                                                array(
     307                                                        array(0,0,0,0,1,0,0,0,0),
     308                                                        array(0,0,0,1,0,1,0,0,0),
     309                                                        array(0,0,0,1,0,1,0,0,0),
     310                                                        array(0,0,0,1,0,1,0,0,0),
     311                                                        array(0,0,1,0,0,0,1,0,0),
     312                                                        array(0,0,1,0,0,0,1,0,0),
     313                                                        array(0,0,1,0,0,0,1,0,0),
     314                                                        array(0,1,0,0,0,0,0,1,0),
     315                                                        array(0,1,0,0,0,0,0,1,0),
     316                                                        array(0,1,1,1,1,1,1,1,0),
     317                                                        array(0,1,0,0,0,0,0,1,0),
     318                                                        array(1,0,0,0,0,0,0,0,1),
     319                                                        array(1,0,0,0,0,0,0,0,1),
     320                                                        array(1,0,0,0,0,0,0,0,1),
     321                                                        array(1,0,0,0,0,0,0,0,1),
     322                                                ),
     323                                                array(
     324                                                        array(0,0,0,0,0,0,0,0,0),
     325                                                        array(0,0,0,0,0,0,0,0,0),
     326                                                        array(0,0,0,0,1,0,0,0,0),
     327                                                        array(0,0,0,1,0,1,0,0,0),
     328                                                        array(0,0,1,1,0,1,1,0,0),
     329                                                        array(0,0,1,0,0,0,1,0,0),
     330                                                        array(0,1,0,0,0,0,0,1,0),
     331                                                        array(0,1,0,0,0,0,0,1,0),
     332                                                        array(0,1,1,1,1,1,1,1,0),
     333                                                        array(0,1,0,0,0,0,0,1,0),
     334                                                        array(0,1,0,0,0,0,0,1,0),
     335                                                        array(0,1,0,0,0,0,0,1,0),
     336                                                        array(0,1,0,0,0,0,0,1,0),
     337                                                        array(0,1,0,0,0,0,0,1,0),
     338                                                        array(1,1,1,0,0,0,1,1,1),
     339                                                ),
     340                                                array(
     341                                                        array(0,0,0,0,0,0,0,0,0),
     342                                                        array(0,0,0,0,0,0,0,0,0),
     343                                                        array(0,0,0,0,0,0,0,0,0),
     344                                                        array(0,0,0,0,0,0,0,0,0),
     345                                                        array(0,0,1,1,1,1,1,0,0),
     346                                                        array(0,1,1,0,0,0,1,1,0),
     347                                                        array(1,1,0,0,0,0,0,1,1),
     348                                                        array(1,0,0,0,0,0,0,0,1),
     349                                                        array(0,0,0,0,0,0,0,1,1),
     350                                                        array(0,0,0,0,0,1,1,1,1),
     351                                                        array(0,0,0,1,1,1,0,0,1),
     352                                                        array(0,1,1,1,0,0,0,0,1),
     353                                                        array(1,0,0,0,0,0,0,0,1),
     354                                                        array(1,1,0,0,0,0,1,1,1),
     355                                                        array(0,1,1,1,1,1,1,0,1),
     356                                                ),
     357                                        ),
     358                'B'     =>              array(
     359                                                array(
     360                                                        array(1,1,1,1,1,1,1,0,0),
     361                                                        array(1,0,0,0,0,0,0,1,0),
     362                                                        array(1,0,0,0,0,0,0,0,1),
     363                                                        array(1,0,0,0,0,0,0,0,1),
     364                                                        array(1,0,0,0,0,0,0,0,1),
     365                                                        array(1,0,0,0,0,0,0,0,1),
     366                                                        array(1,0,0,0,0,0,0,1,0),
     367                                                        array(1,1,1,1,1,1,1,0,0),
     368                                                        array(1,0,0,0,0,0,0,1,0),
     369                                                        array(1,0,0,0,0,0,0,0,1),
     370                                                        array(1,0,0,0,0,0,0,0,1),
     371                                                        array(1,0,0,0,0,0,0,0,1),
     372                                                        array(1,0,0,0,0,0,0,0,1),
     373                                                        array(1,0,0,0,0,0,0,1,0),
     374                                                        array(1,1,1,1,1,1,1,0,0),
     375                                                ),
     376                                                array(
     377                                                        array(1,1,1,1,1,1,1,0,0),
     378                                                        array(0,1,0,0,0,0,0,1,0),
     379                                                        array(0,1,0,0,0,0,0,0,1),
     380                                                        array(0,1,0,0,0,0,0,0,1),
     381                                                        array(0,1,0,0,0,0,0,0,1),
     382                                                        array(0,1,0,0,0,0,0,0,1),
     383                                                        array(0,1,0,0,0,0,0,1,0),
     384                                                        array(0,1,1,1,1,1,1,0,0),
     385                                                        array(0,1,0,0,0,0,0,1,0),
     386                                                        array(0,1,0,0,0,0,0,0,1),
     387                                                        array(0,1,0,0,0,0,0,0,1),
     388                                                        array(0,1,0,0,0,0,0,0,1),
     389                                                        array(0,1,0,0,0,0,0,0,1),
     390                                                        array(0,1,0,0,0,0,0,1,0),
     391                                                        array(1,1,1,1,1,1,1,0,0),
     392                                                ),
     393                                                array(
     394                                                        array(0,1,0,0,0,0,0,0,0),
     395                                                        array(0,1,0,0,0,0,0,0,0),
     396                                                        array(0,1,0,0,0,0,0,0,0),
     397                                                        array(0,1,0,0,0,0,0,0,0),
     398                                                        array(0,1,0,0,0,0,0,0,0),
     399                                                        array(0,1,0,0,0,0,0,0,0),
     400                                                        array(0,1,0,0,0,0,0,0,0),
     401                                                        array(0,1,1,1,1,1,1,0,0),
     402                                                        array(0,1,0,0,0,0,0,1,0),
     403                                                        array(0,1,0,0,0,0,0,0,1),
     404                                                        array(0,1,0,0,0,0,0,0,1),
     405                                                        array(0,1,0,0,0,0,0,0,1),
     406                                                        array(0,1,0,0,0,0,0,0,1),
     407                                                        array(0,1,0,0,0,0,0,1,0),
     408                                                        array(0,1,1,1,1,1,1,0,0),
     409                                                ),
     410                                        ),
     411                'C'     =>              array(
     412                                                array(
     413                                                        array(0,0,1,1,1,1,1,0,0),
     414                                                        array(0,1,0,0,0,0,0,1,0),
     415                                                        array(1,0,0,0,0,0,0,0,1),
     416                                                        array(1,0,0,0,0,0,0,0,1),
     417                                                        array(1,0,0,0,0,0,0,0,0),
     418                                                        array(1,0,0,0,0,0,0,0,0),
     419                                                        array(1,0,0,0,0,0,0,0,0),
     420                                                        array(1,0,0,0,0,0,0,0,0),
     421                                                        array(1,0,0,0,0,0,0,0,0),
     422                                                        array(1,0,0,0,0,0,0,0,0),
     423                                                        array(1,0,0,0,0,0,0,0,0),
     424                                                        array(1,0,0,0,0,0,0,0,1),
     425                                                        array(1,0,0,0,0,0,0,0,1),
     426                                                        array(0,1,0,0,0,0,0,1,0),
     427                                                        array(0,0,1,1,1,1,1,0,0),
     428                                                ),
     429                                                array(
     430                                                        array(0,0,1,1,1,1,1,0,1),
     431                                                        array(0,1,0,0,0,0,0,1,1),
     432                                                        array(1,0,0,0,0,0,0,0,1),
     433                                                        array(1,0,0,0,0,0,0,0,1),
     434                                                        array(1,0,0,0,0,0,0,0,0),
     435                                                        array(1,0,0,0,0,0,0,0,0),
     436                                                        array(1,0,0,0,0,0,0,0,0),
     437                                                        array(1,0,0,0,0,0,0,0,0),
     438                                                        array(1,0,0,0,0,0,0,0,0),
     439                                                        array(1,0,0,0,0,0,0,0,0),
     440                                                        array(1,0,0,0,0,0,0,0,0),
     441                                                        array(1,0,0,0,0,0,0,0,1),
     442                                                        array(1,0,0,0,0,0,0,0,1),
     443                                                        array(0,1,0,0,0,0,0,1,1),
     444                                                        array(0,0,1,1,1,1,1,0,1),
     445                                                ),
     446                                        ),
     447                'D'     =>              array(
     448                                                array(
     449                                                        array(1,1,1,1,1,1,1,0,0),
     450                                                        array(1,0,0,0,0,0,0,1,0),
     451                                                        array(1,0,0,0,0,0,0,0,1),
     452                                                        array(1,0,0,0,0,0,0,0,1),
     453                                                        array(1,0,0,0,0,0,0,0,1),
     454                                                        array(1,0,0,0,0,0,0,0,1),
     455                                                        array(1,0,0,0,0,0,0,0,1),
     456                                                        array(1,0,0,0,0,0,0,0,1),
     457                                                        array(1,0,0,0,0,0,0,0,1),
     458                                                        array(1,0,0,0,0,0,0,0,1),
     459                                                        array(1,0,0,0,0,0,0,0,1),
     460                                                        array(1,0,0,0,0,0,0,0,1),
     461                                                        array(1,0,0,0,0,0,0,0,1),
     462                                                        array(1,0,0,0,0,0,0,1,0),
     463                                                        array(1,1,1,1,1,1,1,0,0),
     464                                                ),
     465                                                array(
     466                                                        array(1,1,1,1,1,1,1,0,0),
     467                                                        array(0,1,0,0,0,0,0,1,0),
     468                                                        array(0,1,0,0,0,0,0,0,1),
     469                                                        array(0,1,0,0,0,0,0,0,1),
     470                                                        array(0,1,0,0,0,0,0,0,1),
     471                                                        array(0,1,0,0,0,0,0,0,1),
     472                                                        array(0,1,0,0,0,0,0,0,1),
     473                                                        array(0,1,0,0,0,0,0,0,1),
     474                                                        array(0,1,0,0,0,0,0,0,1),
     475                                                        array(0,1,0,0,0,0,0,0,1),
     476                                                        array(0,1,0,0,0,0,0,0,1),
     477                                                        array(0,1,0,0,0,0,0,0,1),
     478                                                        array(0,1,0,0,0,0,0,0,1),
     479                                                        array(0,1,0,0,0,0,0,1,0),
     480                                                        array(1,1,1,1,1,1,1,0,0),
     481                                                ),
     482                                                array(
     483                                                        array(0,0,0,0,0,0,0,0,1),
     484                                                        array(0,0,0,0,0,0,0,0,1),
     485                                                        array(0,0,0,0,0,0,0,0,1),
     486                                                        array(0,0,0,0,0,0,0,0,1),
     487                                                        array(0,0,0,0,0,0,0,0,1),
     488                                                        array(0,0,0,0,0,0,0,0,1),
     489                                                        array(0,0,0,0,0,0,0,0,1),
     490                                                        array(0,0,1,1,1,1,1,0,1),
     491                                                        array(0,1,1,0,0,0,1,1,1),
     492                                                        array(0,1,0,0,0,0,0,0,1),
     493                                                        array(0,1,0,0,0,0,0,0,1),
     494                                                        array(0,1,0,0,0,0,0,0,1),
     495                                                        array(0,1,0,0,0,0,0,0,1),
     496                                                        array(0,1,1,0,0,0,1,1,1),
     497                                                        array(0,0,1,1,1,1,1,0,1),
     498                                                ),
     499                                        ),
     500                'E'     =>              array(
     501                                                array(
     502                                                        array(1,1,1,1,1,1,1,1,1),
     503                                                        array(1,0,0,0,0,0,0,0,0),
     504                                                        array(1,0,0,0,0,0,0,0,0),
     505                                                        array(1,0,0,0,0,0,0,0,0),
     506                                                        array(1,0,0,0,0,0,0,0,0),
     507                                                        array(1,0,0,0,0,0,0,0,0),
     508                                                        array(1,0,0,0,0,0,0,0,0),
     509                                                        array(1,1,1,1,1,1,1,1,0),
     510                                                        array(1,0,0,0,0,0,0,0,0),
     511                                                        array(1,0,0,0,0,0,0,0,0),
     512                                                        array(1,0,0,0,0,0,0,0,0),
     513                                                        array(1,0,0,0,0,0,0,0,0),
     514                                                        array(1,0,0,0,0,0,0,0,0),
     515                                                        array(1,0,0,0,0,0,0,0,0),
     516                                                        array(1,1,1,1,1,1,1,1,1),
     517                                                ),
     518                                                array(
     519                                                        array(1,1,1,1,1,1,1,1,1),
     520                                                        array(1,0,0,0,0,0,0,0,1),
     521                                                        array(1,0,0,0,0,0,0,0,0),
     522                                                        array(1,0,0,0,0,0,0,0,0),
     523                                                        array(1,0,0,0,0,0,0,0,0),
     524                                                        array(1,0,0,0,0,0,0,0,0),
     525                                                        array(1,0,0,0,0,0,0,0,0),
     526                                                        array(1,1,1,1,1,1,1,0,0),
     527                                                        array(1,0,0,0,0,0,0,0,0),
     528                                                        array(1,0,0,0,0,0,0,0,0),
     529                                                        array(1,0,0,0,0,0,0,0,0),
     530                                                        array(1,0,0,0,0,0,0,0,0),
     531                                                        array(1,0,0,0,0,0,0,0,0),
     532                                                        array(1,0,0,0,0,0,0,0,1),
     533                                                        array(1,1,1,1,1,1,1,1,1),
     534                                                ),
     535                                                array(
     536                                                        array(0,0,0,0,0,0,0,0,0),
     537                                                        array(0,0,0,0,0,0,0,0,0),
     538                                                        array(0,0,0,0,0,0,0,0,0),
     539                                                        array(0,0,0,0,0,0,0,0,0),
     540                                                        array(0,0,0,0,0,0,0,0,0),
     541                                                        array(0,0,0,0,0,0,0,0,0),
     542                                                        array(0,0,0,0,0,0,0,0,0),
     543                                                        array(0,0,1,1,1,1,1,0,0),
     544                                                        array(0,1,1,0,0,0,1,1,0),
     545                                                        array(1,1,0,0,0,0,0,1,1),
     546                                                        array(1,1,1,1,1,1,1,1,1),
     547                                                        array(1,0,0,0,0,0,0,0,0),
     548                                                        array(1,0,0,0,0,0,0,0,1),
     549                                                        array(1,1,0,0,0,0,0,1,1),
     550                                                        array(0,1,1,1,1,1,1,1,0),
     551                                                ),
     552                                        ),
     553                'F'     =>              array(
     554                                                array(
     555                                                        array(1,1,1,1,1,1,1,1,1),
     556                                                        array(1,0,0,0,0,0,0,0,0),
     557                                                        array(1,0,0,0,0,0,0,0,0),
     558                                                        array(1,0,0,0,0,0,0,0,0),
     559                                                        array(1,0,0,0,0,0,0,0,0),
     560                                                        array(1,0,0,0,0,0,0,0,0),
     561                                                        array(1,0,0,0,0,0,0,0,0),
     562                                                        array(1,1,1,1,1,1,1,0,0),
     563                                                        array(1,0,0,0,0,0,0,0,0),
     564                                                        array(1,0,0,0,0,0,0,0,0),
     565                                                        array(1,0,0,0,0,0,0,0,0),
     566                                                        array(1,0,0,0,0,0,0,0,0),
     567                                                        array(1,0,0,0,0,0,0,0,0),
     568                                                        array(1,0,0,0,0,0,0,0,0),
     569                                                        array(1,0,0,0,0,0,0,0,0),
     570                                                ),
     571                                                array(
     572                                                        array(0,1,1,1,1,1,1,1,1),
     573                                                        array(0,1,0,0,0,0,0,0,1),
     574                                                        array(0,1,0,0,0,0,0,0,0),
     575                                                        array(0,1,0,0,0,0,0,0,0),
     576                                                        array(0,1,0,0,0,0,0,0,0),
     577                                                        array(0,1,0,0,0,0,0,0,0),
     578                                                        array(0,1,0,0,0,0,0,0,0),
     579                                                        array(0,1,1,1,1,1,1,0,0),
     580                                                        array(0,1,0,0,0,0,0,0,0),
     581                                                        array(0,1,0,0,0,0,0,0,0),
     582                                                        array(0,1,0,0,0,0,0,0,0),
     583                                                        array(0,1,0,0,0,0,0,0,0),
     584                                                        array(0,1,0,0,0,0,0,0,0),
     585                                                        array(0,1,0,0,0,0,0,0,0),
     586                                                        array(1,1,1,0,0,0,0,0,0),
     587                                                ),
     588                                                array(
     589                                                        array(0,0,0,1,1,0,0,0,0),
     590                                                        array(0,0,1,1,0,0,0,0,0),
     591                                                        array(0,1,1,0,0,0,0,0,0),
     592                                                        array(0,1,0,0,0,0,0,0,0),
     593                                                        array(0,1,0,0,0,0,0,0,0),
     594                                                        array(1,1,1,1,0,0,0,0,0),
     595                                                        array(0,1,0,0,0,0,0,0,0),
     596                                                        array(0,1,0,0,0,0,0,0,0),
     597                                                        array(0,1,0,0,0,0,0,0,0),
     598                                                        array(0,1,0,0,0,0,0,0,0),
     599                                                        array(0,1,0,0,0,0,0,0,0),
     600                                                        array(0,1,0,0,0,0,0,0,0),
     601                                                        array(0,1,0,0,0,0,0,0,0),
     602                                                        array(0,1,0,0,0,0,0,0,0),
     603                                                        array(0,1,0,0,0,0,0,0,0),
     604                                                ),
     605                                        ),
     606                'G'     =>              array(
     607                                                array(
     608                                                        array(0,0,1,1,1,1,1,0,0),
     609                                                        array(0,1,0,0,0,0,0,1,0),
     610                                                        array(1,0,0,0,0,0,0,0,1),
     611                                                        array(1,0,0,0,0,0,0,0,0),
     612                                                        array(1,0,0,0,0,0,0,0,0),
     613                                                        array(1,0,0,0,0,0,0,0,0),
     614                                                        array(1,0,0,0,0,0,0,0,0),
     615                                                        array(1,0,0,0,0,0,0,0,0),
     616                                                        array(1,0,0,0,0,0,1,1,1),
     617                                                        array(1,0,0,0,0,0,0,0,1),
     618                                                        array(1,0,0,0,0,0,0,0,1),
     619                                                        array(1,0,0,0,0,0,0,0,1),
     620                                                        array(1,0,0,0,0,0,0,0,1),
     621                                                        array(0,1,0,0,0,0,0,1,0),
     622                                                        array(0,0,1,1,1,1,1,0,0),
     623                                                ),
     624                                                array(
     625                                                        array(0,0,1,1,1,1,1,0,1),
     626                                                        array(0,1,0,0,0,0,0,1,1),
     627                                                        array(1,0,0,0,0,0,0,0,1),
     628                                                        array(1,0,0,0,0,0,0,0,0),
     629                                                        array(1,0,0,0,0,0,0,0,0),
     630                                                        array(1,0,0,0,0,0,0,0,0),
     631                                                        array(1,0,0,0,0,0,0,0,0),
     632                                                        array(1,0,0,0,0,0,0,0,0),
     633                                                        array(1,0,0,0,1,1,1,1,1),
     634                                                        array(1,0,0,0,1,0,0,0,1),
     635                                                        array(1,0,0,0,1,0,0,0,1),
     636                                                        array(1,0,0,0,0,0,0,0,1),
     637                                                        array(1,0,0,0,0,0,0,0,1),
     638                                                        array(0,1,0,0,0,0,0,1,1),
     639                                                        array(0,0,1,1,1,1,1,0,1),
     640                                                ),
     641                                                array(
     642                                                        array(0,0,1,1,1,1,1,0,1),
     643                                                        array(0,1,1,0,0,0,0,1,1),
     644                                                        array(1,1,0,0,0,0,0,1,1),
     645                                                        array(1,0,0,0,0,0,0,0,1),
     646                                                        array(1,0,0,0,0,0,0,0,1),
     647                                                        array(1,1,1,0,0,0,0,0,1),
     648                                                        array(0,0,1,1,1,1,1,1,1),
     649                                                        array(0,0,0,0,0,0,0,0,1),
     650                                                        array(0,0,0,0,0,0,0,0,1),
     651                                                        array(0,0,0,0,0,0,0,0,1),
     652                                                        array(0,0,0,0,0,0,0,0,1),
     653                                                        array(0,0,0,0,0,0,0,1,1),
     654                                                        array(1,1,1,1,1,1,1,1,0),
     655                                                        array(0,0,0,0,0,0,0,0,0),
     656                                                        array(0,0,0,0,0,0,0,0,0),
     657                                                ),
     658                                        ),
     659                'H'     =>              array(
     660                                                array(
     661                                                        array(1,0,0,0,0,0,0,0,1),
     662                                                        array(1,0,0,0,0,0,0,0,1),
     663                                                        array(1,0,0,0,0,0,0,0,1),
     664                                                        array(1,0,0,0,0,0,0,0,1),
     665                                                        array(1,0,0,0,0,0,0,0,1),
     666                                                        array(1,0,0,0,0,0,0,0,1),
     667                                                        array(1,0,0,0,0,0,0,0,1),
     668                                                        array(1,1,1,1,1,1,1,1,1),
     669                                                        array(1,0,0,0,0,0,0,0,1),
     670                                                        array(1,0,0,0,0,0,0,0,1),
     671                                                        array(1,0,0,0,0,0,0,0,1),
     672                                                        array(1,0,0,0,0,0,0,0,1),
     673                                                        array(1,0,0,0,0,0,0,0,1),
     674                                                        array(1,0,0,0,0,0,0,0,1),
     675                                                        array(1,0,0,0,0,0,0,0,1),
     676                                                ),
     677                                                array(
     678                                                        array(1,1,1,0,0,0,1,1,1),
     679                                                        array(0,1,0,0,0,0,0,1,0),
     680                                                        array(0,1,0,0,0,0,0,1,0),
     681                                                        array(0,1,0,0,0,0,0,1,0),
     682                                                        array(0,1,0,0,0,0,0,1,0),
     683                                                        array(0,1,0,0,0,0,0,1,0),
     684                                                        array(0,1,0,0,0,0,0,1,0),
     685                                                        array(0,1,1,1,1,1,1,1,0),
     686                                                        array(0,1,0,0,0,0,0,1,0),
     687                                                        array(0,1,0,0,0,0,0,1,0),
     688                                                        array(0,1,0,0,0,0,0,1,0),
     689                                                        array(0,1,0,0,0,0,0,1,0),
     690                                                        array(0,1,0,0,0,0,0,1,0),
     691                                                        array(0,1,0,0,0,0,0,1,0),
     692                                                        array(1,1,1,0,0,0,1,1,1),
     693                                                ),
     694                                                array(
     695                                                        array(1,0,0,0,0,0,0,0,0),
     696                                                        array(1,0,0,0,0,0,0,0,0),
     697                                                        array(1,0,0,0,0,0,0,0,0),
     698                                                        array(1,0,0,0,0,0,0,0,0),
     699                                                        array(1,0,0,0,0,0,0,0,0),
     700                                                        array(1,0,0,0,0,0,0,0,0),
     701                                                        array(1,0,0,0,0,0,0,0,0),
     702                                                        array(1,0,0,1,1,1,0,0,0),
     703                                                        array(1,1,1,1,0,1,1,0,0),
     704                                                        array(1,0,0,0,0,0,1,0,0),
     705                                                        array(1,0,0,0,0,0,1,0,0),
     706                                                        array(1,0,0,0,0,0,1,0,0),
     707                                                        array(1,0,0,0,0,0,1,0,0),
     708                                                        array(1,0,0,0,0,0,1,0,0),
     709                                                        array(1,0,0,0,0,0,1,0,0),
     710                                                ),
     711                                        ),
     712                'I'     =>              array(
     713                                                array(
     714                                                        array(1,1,1,1,1,1,1,1,1),
     715                                                        array(0,0,0,0,1,0,0,0,0),
     716                                                        array(0,0,0,0,1,0,0,0,0),
     717                                                        array(0,0,0,0,1,0,0,0,0),
     718                                                        array(0,0,0,0,1,0,0,0,0),
     719                                                        array(0,0,0,0,1,0,0,0,0),
     720                                                        array(0,0,0,0,1,0,0,0,0),
     721                                                        array(0,0,0,0,1,0,0,0,0),
     722                                                        array(0,0,0,0,1,0,0,0,0),
     723                                                        array(0,0,0,0,1,0,0,0,0),
     724                                                        array(0,0,0,0,1,0,0,0,0),
     725                                                        array(0,0,0,0,1,0,0,0,0),
     726                                                        array(0,0,0,0,1,0,0,0,0),
     727                                                        array(0,0,0,0,1,0,0,0,0),
     728                                                        array(1,1,1,1,1,1,1,1,1),
     729                                                ),
     730                                                array(
     731                                                        array(0,0,0,1,1,1,0,0,0),
     732                                                        array(0,0,0,0,1,0,0,0,0),
     733                                                        array(0,0,0,0,1,0,0,0,0),
     734                                                        array(0,0,0,0,1,0,0,0,0),
     735                                                        array(0,0,0,0,1,0,0,0,0),
     736                                                        array(0,0,0,0,1,0,0,0,0),
     737                                                        array(0,0,0,0,1,0,0,0,0),
     738                                                        array(0,0,0,0,1,0,0,0,0),
     739                                                        array(0,0,0,0,1,0,0,0,0),
     740                                                        array(0,0,0,0,1,0,0,0,0),
     741                                                        array(0,0,0,0,1,0,0,0,0),
     742                                                        array(0,0,0,0,1,0,0,0,0),
     743                                                        array(0,0,0,0,1,0,0,0,0),
     744                                                        array(0,0,0,0,1,0,0,0,0),
     745                                                        array(0,0,0,1,1,1,0,0,0),
     746                                                ),
     747                                                array(
     748                                                        array(0,0,0,0,0,0,0,0,0),
     749                                                        array(0,0,0,0,0,0,0,0,0),
     750                                                        array(0,0,0,0,0,0,0,0,0),
     751                                                        array(0,0,0,0,1,0,0,0,0),
     752                                                        array(0,0,0,1,1,1,0,0,0),
     753                                                        array(0,0,0,0,1,0,0,0,0),
     754                                                        array(0,0,0,0,0,0,0,0,0),
     755                                                        array(0,0,0,0,1,0,0,0,0),
     756                                                        array(0,0,0,0,1,0,0,0,0),
     757                                                        array(0,0,0,0,1,0,0,0,0),
     758                                                        array(0,0,0,0,1,0,0,0,0),
     759                                                        array(0,0,0,0,1,0,0,0,0),
     760                                                        array(0,0,0,0,1,0,0,0,0),
     761                                                        array(0,0,0,0,1,0,0,0,0),
     762                                                        array(0,0,0,1,1,1,0,0,0),
     763                                                ),
     764                                        ),
     765                'J'     =>              array(
     766                                                array(
     767                                                        array(1,1,1,1,1,1,1,1,1),
     768                                                        array(0,0,0,0,0,1,0,0,0),
     769                                                        array(0,0,0,0,0,1,0,0,0),
     770                                                        array(0,0,0,0,0,1,0,0,0),
     771                                                        array(0,0,0,0,0,1,0,0,0),
     772                                                        array(0,0,0,0,0,1,0,0,0),
     773                                                        array(0,0,0,0,0,1,0,0,0),
     774                                                        array(0,0,0,0,0,1,0,0,0),
     775                                                        array(0,0,0,0,0,1,0,0,0),
     776                                                        array(0,0,0,0,0,1,0,0,0),
     777                                                        array(0,0,0,0,0,1,0,0,0),
     778                                                        array(1,0,0,0,0,1,0,0,0),
     779                                                        array(1,0,0,0,0,1,0,0,0),
     780                                                        array(0,1,0,0,1,0,0,0,0),
     781                                                        array(0,0,1,1,0,0,0,0,0),
     782                                                ),
     783                                                array(
     784                                                        array(1,1,1,1,1,1,1,1,1),
     785                                                        array(0,0,0,0,0,1,0,0,0),
     786                                                        array(0,0,0,0,0,1,0,0,0),
     787                                                        array(0,0,0,0,0,1,0,0,0),
     788                                                        array(0,0,0,0,0,1,0,0,0),
     789                                                        array(0,0,0,0,0,1,0,0,0),
     790                                                        array(0,0,0,0,0,1,0,0,0),
     791                                                        array(0,0,0,0,0,1,0,0,0),
     792                                                        array(0,0,0,0,0,1,0,0,0),
     793                                                        array(0,0,0,0,0,1,0,0,0),
     794                                                        array(0,0,0,0,0,1,0,0,0),
     795                                                        array(1,0,0,0,0,1,0,0,0),
     796                                                        array(1,0,0,0,0,1,0,0,0),
     797                                                        array(1,1,0,0,1,0,0,0,0),
     798                                                        array(1,0,1,1,0,0,0,0,0),
     799                                                ),
     800                                                array(
     801                                                        array(0,0,0,0,0,0,0,0,0),
     802                                                        array(0,0,0,0,0,0,0,0,0),
     803                                                        array(0,0,0,0,0,0,0,0,0),
     804                                                        array(0,0,0,0,0,0,0,0,0),
     805                                                        array(0,0,0,0,0,1,0,0,0),
     806                                                        array(0,0,0,0,0,0,0,0,0),
     807                                                        array(0,0,0,0,0,1,0,0,0),
     808                                                        array(0,0,0,0,0,1,0,0,0),
     809                                                        array(0,0,0,0,0,1,0,0,0),
     810                                                        array(0,0,0,0,0,1,0,0,0),
     811                                                        array(0,0,0,0,0,1,0,0,0),
     812                                                        array(1,0,0,0,0,1,0,0,0),
     813                                                        array(1,0,0,0,0,1,0,0,0),
     814                                                        array(0,1,0,0,1,0,0,0,0),
     815                                                        array(0,0,1,1,0,0,0,0,0),
     816                                                ),
     817                                        ),
     818                'K'     =>              array(
     819                                                array(    // New 'K', supplied by NeoThermic
     820                                                        array(1,0,0,0,0,0,0,0,1),
     821                                                        array(1,0,0,0,0,0,0,1,0),
     822                                                        array(1,0,0,0,0,0,1,0,0),
     823                                                        array(1,0,0,0,0,1,0,0,0),
     824                                                        array(1,0,0,0,1,0,0,0,0),
     825                                                        array(1,0,0,1,0,0,0,0,0),
     826                                                        array(1,0,1,0,0,0,0,0,0),
     827                                                        array(1,1,0,0,0,0,0,0,0),
     828                                                        array(1,0,1,0,0,0,0,0,0),
     829                                                        array(1,0,0,1,0,0,0,0,0),
     830                                                        array(1,0,0,0,1,0,0,0,0),
     831                                                        array(1,0,0,0,0,1,0,0,0),
     832                                                        array(1,0,0,0,0,0,1,0,0),
     833                                                        array(1,0,0,0,0,0,0,1,0),
     834                                                        array(1,0,0,0,0,0,0,0,1),
     835                                                ),
     836                                                array(
     837                                                        array(0,1,0,0,0,0,0,0,1),
     838                                                        array(0,1,0,0,0,0,0,1,0),
     839                                                        array(0,1,0,0,0,0,1,0,0),
     840                                                        array(0,1,0,0,0,1,0,0,0),
     841                                                        array(0,1,0,0,1,0,0,0,0),
     842                                                        array(0,1,0,1,0,0,0,0,0),
     843                                                        array(0,1,1,0,0,0,0,0,0),
     844                                                        array(0,1,0,0,0,0,0,0,0),
     845                                                        array(0,1,1,0,0,0,0,0,0),
     846                                                        array(0,1,0,1,0,0,0,0,0),
     847                                                        array(0,1,0,0,1,0,0,0,0),
     848                                                        array(0,1,0,0,0,1,0,0,0),
     849                                                        array(0,1,0,0,0,0,1,0,0),
     850                                                        array(0,1,0,0,0,0,0,1,0),
     851                                                        array(1,1,1,0,0,0,1,1,1),
     852                                                ),
     853                                                array(
     854                                                        array(0,0,0,0,0,0,0,0,0),
     855                                                        array(0,1,0,0,0,0,0,0,0),
     856                                                        array(0,1,0,0,0,0,0,0,0),
     857                                                        array(0,1,0,0,0,1,0,0,0),
     858                                                        array(0,1,0,0,1,0,0,0,0),
     859                                                        array(0,1,0,1,0,0,0,0,0),
     860                                                        array(0,1,1,0,0,0,0,0,0),
     861                                                        array(0,1,0,0,0,0,0,0,0),
     862                                                        array(0,1,1,0,0,0,0,0,0),
     863                                                        array(0,1,0,1,0,0,0,0,0),
     864                                                        array(0,1,0,0,1,0,0,0,0),
     865                                                        array(0,1,0,0,0,1,0,0,0),
     866                                                        array(0,1,0,0,0,0,1,0,0),
     867                                                        array(0,1,0,0,0,0,0,1,0),
     868                                                        array(0,1,0,0,0,0,0,1,0),
     869                                                ),
     870                                        ),
     871                'L'     =>              array(
     872                                                array(
     873                                                        array(0,0,0,0,0,0,0,0,0),
     874                                                        array(1,0,0,0,0,0,0,0,0),
     875                                                        array(1,0,0,0,0,0,0,0,0),
     876                                                        array(1,0,0,0,0,0,0,0,0),
     877                                                        array(1,0,0,0,0,0,0,0,0),
     878                                                        array(1,0,0,0,0,0,0,0,0),
     879                                                        array(1,0,0,0,0,0,0,0,0),
     880                                                        array(1,0,0,0,0,0,0,0,0),
     881                                                        array(1,0,0,0,0,0,0,0,0),
     882                                                        array(1,0,0,0,0,0,0,0,0),
     883                                                        array(1,0,0,0,0,0,0,0,0),
     884                                                        array(1,0,0,0,0,0,0,0,0),
     885                                                        array(1,0,0,0,0,0,0,0,0),
     886                                                        array(1,0,0,0,0,0,0,0,0),
     887                                                        array(1,1,1,1,1,1,1,1,1),
     888                                                ),
     889                                                array(
     890                                                        array(0,0,0,0,0,0,0,0,0),
     891                                                        array(0,1,0,0,0,0,0,0,0),
     892                                                        array(0,1,0,0,0,0,0,0,0),
     893                                                        array(0,1,0,0,0,0,0,0,0),
     894                                                        array(0,1,0,0,0,0,0,0,0),
     895                                                        array(0,1,0,0,0,0,0,0,0),
     896                                                        array(0,1,0,0,0,0,0,0,0),
     897                                                        array(0,1,0,0,0,0,0,0,0),
     898                                                        array(0,1,0,0,0,0,0,0,0),
     899                                                        array(0,1,0,0,0,0,0,0,0),
     900                                                        array(0,1,0,0,0,0,0,0,0),
     901                                                        array(0,1,0,0,0,0,0,0,0),
     902                                                        array(0,1,0,0,0,0,0,0,0),
     903                                                        array(0,1,0,0,0,0,0,0,1),
     904                                                        array(1,1,1,1,1,1,1,1,1),
     905                                                ),
     906                                                array(
     907                                                        array(0,0,0,0,0,0,0,0,0),
     908                                                        array(0,1,0,0,0,0,0,0,0),
     909                                                        array(0,1,0,0,0,0,0,0,0),
     910                                                        array(0,1,0,0,0,0,0,0,0),
     911                                                        array(0,1,0,0,0,0,0,0,0),
     912                                                        array(0,1,0,0,0,0,0,0,0),
     913                                                        array(0,1,0,0,0,0,0,0,0),
     914                                                        array(0,1,0,0,0,0,0,0,0),
     915                                                        array(0,1,0,0,0,0,0,0,0),
     916                                                        array(0,1,0,0,0,0,0,0,0),
     917                                                        array(0,1,0,0,0,0,0,0,0),
     918                                                        array(0,1,0,0,0,0,0,0,0),
     919                                                        array(0,1,0,0,0,0,0,0,0),
     920                                                        array(0,1,1,0,0,0,0,0,0),
     921                                                        array(0,0,1,1,1,0,0,0,0),
     922                                                ),
     923                                        ),
     924                'M'     =>              array(
     925                                                array(
     926                                                        array(1,1,0,0,0,0,0,1,1),
     927                                                        array(1,1,0,0,0,0,0,1,1),
     928                                                        array(1,0,1,0,0,0,1,0,1),
     929                                                        array(1,0,1,0,0,0,1,0,1),
     930                                                        array(1,0,1,0,0,0,1,0,1),
     931                                                        array(1,0,0,1,0,1,0,0,1),
     932                                                        array(1,0,0,1,0,1,0,0,1),
     933                                                        array(1,0,0,1,0,1,0,0,1),
     934                                                        array(1,0,0,0,1,0,0,0,1),
     935                                                        array(1,0,0,0,1,0,0,0,1),
     936                                                        array(1,0,0,0,0,0,0,0,1),
     937                                                        array(1,0,0,0,0,0,0,0,1),
     938                                                        array(1,0,0,0,0,0,0,0,1),
     939                                                        array(1,0,0,0,0,0,0,0,1),
     940                                                        array(1,0,0,0,0,0,0,0,1),
     941                                                ),
     942                                                array(
     943                                                        array(0,0,0,0,0,0,0,0,0),
     944                                                        array(0,1,0,0,0,0,0,1,0),
     945                                                        array(0,1,1,0,0,0,1,1,0),
     946                                                        array(0,1,1,0,0,0,1,1,0),
     947                                                        array(0,1,1,0,0,0,1,1,0),
     948                                                        array(0,1,0,1,0,1,0,1,0),
     949                                                        array(0,1,0,1,0,1,0,1,0),
     950                                                        array(0,1,0,1,0,1,0,1,0),
     951                                                        array(0,1,0,0,1,0,0,1,0),
     952                                                        array(0,1,0,0,1,0,0,1,0),
     953                                                        array(0,1,0,0,0,0,0,1,0),
     954                                                        array(0,1,0,0,0,0,0,1,0),
     955                                                        array(0,1,0,0,0,0,0,1,0),
     956                                                        array(0,1,0,0,0,0,0,1,0),
     957                                                        array(1,1,1,0,0,0,1,1,1),
     958                                                ),
     959                                                array(
     960                                                        array(0,0,0,0,0,0,0,0,0),
     961                                                        array(0,0,0,0,0,0,0,0,0),
     962                                                        array(0,0,0,0,0,0,0,0,0),
     963                                                        array(0,0,0,0,0,0,0,0,0),
     964                                                        array(0,0,0,0,0,0,0,0,0),
     965                                                        array(0,0,0,0,0,0,0,0,0),
     966                                                        array(0,1,1,1,0,1,1,1,0),
     967                                                        array(1,1,0,1,1,1,0,1,1),
     968                                                        array(1,0,0,0,1,0,0,0,1),
     969                                                        array(1,0,0,0,1,0,0,0,1),
     970                                                        array(1,0,0,0,1,0,0,0,1),
     971                                                        array(1,0,0,0,1,0,0,0,1),
     972                                                        array(1,0,0,0,1,0,0,0,1),
     973                                                        array(1,0,0,0,1,0,0,0,1),
     974                                                        array(1,0,0,0,1,0,0,0,1),
     975                                                ),
     976                                        ),
     977                'N'     =>              array(
     978                                                array(
     979                                                        array(1,1,0,0,0,0,0,0,1),
     980                                                        array(1,1,0,0,0,0,0,0,1),
     981                                                        array(1,0,1,0,0,0,0,0,1),
     982                                                        array(1,0,1,0,0,0,0,0,1),
     983                                                        array(1,0,0,1,0,0,0,0,1),
     984                                                        array(1,0,0,1,0,0,0,0,1),
     985                                                        array(1,0,0,0,1,0,0,0,1),
     986                                                        array(1,0,0,0,1,0,0,0,1),
     987                                                        array(1,0,0,0,1,0,0,0,1),
     988                                                        array(1,0,0,0,0,1,0,0,1),
     989                                                        array(1,0,0,0,0,1,0,0,1),
     990                                                        array(1,0,0,0,0,0,1,0,1),
     991                                                        array(1,0,0,0,0,0,1,0,1),
     992                                                        array(1,0,0,0,0,0,0,1,1),
     993                                                        array(1,0,0,0,0,0,0,1,1),
     994                                                ),
     995                                                array(
     996                                                        array(0,0,0,0,0,0,0,0,0),
     997                                                        array(0,1,0,0,0,0,0,1,0),
     998                                                        array(0,1,1,0,0,0,0,1,0),
     999                                                        array(0,1,1,0,0,0,0,1,0),
     1000                                                        array(0,1,1,0,0,0,0,1,0),
     1001                                                        array(0,1,0,1,0,0,0,1,0),
     1002                                                        array(0,1,0,1,0,0,0,1,0),
     1003                                                        array(0,1,0,1,0,0,0,1,0),
     1004                                                        array(0,1,0,0,1,0,0,1,0),
     1005                                                        array(0,1,0,0,1,1,0,1,0),
     1006                                                        array(0,1,0,0,0,1,0,1,0),
     1007                                                        array(0,1,0,0,0,1,1,1,0),
     1008                                                        array(0,1,0,0,0,0,1,1,0),
     1009                                                        array(0,1,0,0,0,0,0,1,0),
     1010                                                        array(1,1,1,0,0,0,1,1,1),
     1011                                                ),
     1012                                                array(
     1013                                                        array(0,0,0,0,0,0,0,0,0),
     1014                                                        array(0,0,0,0,0,0,0,0,0),
     1015                                                        array(0,0,0,0,0,0,0,0,0),
     1016                                                        array(0,0,0,0,0,0,0,0,0),
     1017                                                        array(0,0,0,0,0,0,0,0,0),
     1018                                                        array(0,0,0,0,0,0,0,0,0),
     1019                                                        array(0,0,0,0,0,0,0,0,0),
     1020                                                        array(1,0,1,1,1,1,0,0,0),
     1021                                                        array(1,1,1,0,0,1,1,0,0),
     1022                                                        array(1,0,0,0,0,0,1,0,0),
     1023                                                        array(1,0,0,0,0,0,1,0,0),
     1024                                                        array(1,0,0,0,0,0,1,0,0),
     1025                                                        array(1,0,0,0,0,0,1,0,0),
     1026                                                        array(1,0,0,0,0,0,1,0,0),
     1027                                                        array(1,0,0,0,0,0,1,0,0),
     1028                                                ),
     1029                                        ),
     1030                'O'     =>              array(
     1031                                                array(
     1032                                                        array(0,0,1,1,1,1,1,0,0),
     1033                                                        array(0,1,0,0,0,0,0,1,0),
     1034                                                        array(1,0,0,0,0,0,0,0,1),
     1035                                                        array(1,0,0,0,0,0,0,0,1),
     1036                                                        array(1,0,0,0,0,0,0,0,1),
     1037                                                        array(1,0,0,0,0,0,0,0,1),
     1038                                                        array(1,0,0,0,0,0,0,0,1),
     1039                                                        array(1,0,0,0,0,0,0,0,1),
     1040                                                        array(1,0,0,0,0,0,0,0,1),
     1041                                                        array(1,0,0,0,0,0,0,0,1),
     1042                                                        array(1,0,0,0,0,0,0,0,1),
     1043                                                        array(1,0,0,0,0,0,0,0,1),
     1044                                                        array(1,0,0,0,0,0,0,0,1),
     1045                                                        array(0,1,0,0,0,0,0,1,0),
     1046                                                        array(0,0,1,1,1,1,1,0,0),
     1047                                                ),
     1048                                                array(
     1049                                                        array(0,0,1,1,1,1,1,0,0),
     1050                                                        array(0,1,0,0,0,0,0,1,0),
     1051                                                        array(1,1,0,0,0,0,0,1,1),
     1052                                                        array(1,1,0,0,0,0,0,1,1),
     1053                                                        array(1,1,0,0,0,0,0,1,1),
     1054                                                        array(1,1,0,0,0,0,0,1,1),
     1055                                                        array(1,1,0,0,0,0,0,1,1),
     1056                                                        array(1,1,0,0,0,0,0,1,1),
     1057                                                        array(1,1,0,0,0,0,0,1,1),
     1058                                                        array(1,1,0,0,0,0,0,1,1),
     1059                                                        array(1,1,0,0,0,0,0,1,1),
     1060                                                        array(1,1,0,0,0,0,0,1,1),
     1061                                                        array(1,1,0,0,0,0,0,1,1),
     1062                                                        array(0,1,0,0,0,0,0,1,0),
     1063                                                        array(0,0,1,1,1,1,1,0,0),
     1064                                                ),
     1065                                                array(
     1066                                                        array(0,0,0,0,0,0,0,0,0),
     1067                                                        array(0,0,0,0,0,0,0,0,0),
     1068                                                        array(0,0,0,0,0,0,0,0,0),
     1069                                                        array(0,0,0,0,0,0,0,0,0),
     1070                                                        array(0,0,0,0,0,0,0,0,0),
     1071                                                        array(0,0,0,0,0,0,0,0,0),
     1072                                                        array(0,0,0,0,0,0,0,0,0),
     1073                                                        array(0,1,1,1,1,1,0,0,0),
     1074                                                        array(1,1,1,0,0,1,1,0,0),
     1075                                                        array(1,0,0,0,0,0,1,0,0),
     1076                                                        array(1,0,0,0,0,0,1,0,0),
     1077                                                        array(1,0,0,0,0,0,1,0,0),
     1078                                                        array(1,0,0,0,0,0,1,0,0),
     1079                                                        array(1,1,0,0,0,1,1,0,0),
     1080                                                        array(0,1,1,1,1,1,0,0,0),
     1081                                                ),
     1082                                        ),
     1083                'P'     =>              array(
     1084                                                array(
     1085                                                        array(1,1,1,1,1,1,1,0,0),
     1086                                                        array(1,0,0,0,0,0,0,1,0),
     1087                                                        array(1,0,0,0,0,0,0,0,1),
     1088                                                        array(1,0,0,0,0,0,0,0,1),
     1089                                                        array(1,0,0,0,0,0,0,0,1),
     1090                                                        array(1,0,0,0,0,0,0,0,1),
     1091                                                        array(1,0,0,0,0,0,0,1,0),
     1092                                                        array(1,1,1,1,1,1,1,0,0),
     1093                                                        array(1,0,0,0,0,0,0,0,0),
     1094                                                        array(1,0,0,0,0,0,0,0,0),
     1095                                                        array(1,0,0,0,0,0,0,0,0),
     1096                                                        array(1,0,0,0,0,0,0,0,0),
     1097                                                        array(1,0,0,0,0,0,0,0,0),
     1098                                                        array(1,0,0,0,0,0,0,0,0),
     1099                                                        array(1,0,0,0,0,0,0,0,0),
     1100                                                ),
     1101                                                array(
     1102                                                        array(1,1,1,1,1,1,1,0,0),
     1103                                                        array(0,1,0,0,0,0,0,1,0),
     1104                                                        array(0,1,0,0,0,0,0,0,1),
     1105                                                        array(0,1,0,0,0,0,0,0,1),
     1106                                                        array(0,1,0,0,0,0,0,0,1),
     1107                                                        array(0,1,0,0,0,0,0,0,1),
     1108                                                        array(0,1,0,0,0,0,0,1,0),
     1109                                                        array(1,1,1,1,1,1,1,0,0),
     1110                                                        array(0,1,0,0,0,0,0,0,0),
     1111                                                        array(0,1,0,0,0,0,0,0,0),
     1112                                                        array(0,1,0,0,0,0,0,0,0),
     1113                                                        array(0,1,0,0,0,0,0,0,0),
     1114                                                        array(0,1,0,0,0,0,0,0,0),
     1115                                                        array(0,1,0,0,0,0,0,0,0),
     1116                                                        array(1,1,1,0,0,0,0,0,0),
     1117                                                ),
     1118                                                array(
     1119                                                        array(0,0,0,0,0,0,0,0,0),
     1120                                                        array(0,0,0,0,0,0,0,0,0),
     1121                                                        array(1,0,0,0,0,0,0,0,0),
     1122                                                        array(1,0,1,1,0,0,0,0,0),
     1123                                                        array(1,1,0,1,1,0,0,0,0),
     1124                                                        array(1,0,0,0,1,0,0,0,0),
     1125                                                        array(1,0,0,0,1,0,0,0,0),
     1126                                                        array(1,0,0,1,1,0,0,0,0),
     1127                                                        array(1,1,1,1,0,0,0,0,0),
     1128                                                        array(1,0,0,0,0,0,0,0,0),
     1129                                                        array(1,0,0,0,0,0,0,0,0),
     1130                                                        array(1,0,0,0,0,0,0,0,0),
     1131                                                        array(1,0,0,0,0,0,0,0,0),
     1132                                                        array(1,0,0,0,0,0,0,0,0),
     1133                                                        array(1,0,0,0,0,0,0,0,0),
     1134                                                ),
     1135                                        ),
     1136                'Q'     =>              array(
     1137                                                array(
     1138                                                        array(0,0,1,1,1,1,1,0,0),
     1139                                                        array(0,1,0,0,0,0,0,1,0),
     1140                                                        array(1,0,0,0,0,0,0,0,1),
     1141                                                        array(1,0,0,0,0,0,0,0,1),
     1142                                                        array(1,0,0,0,0,0,0,0,1),
     1143                                                        array(1,0,0,0,0,0,0,0,1),
     1144                                                        array(1,0,0,0,0,0,0,0,1),
     1145                                                        array(1,0,0,0,0,0,0,0,1),
     1146                                                        array(1,0,0,0,0,0,0,0,1),
     1147                                                        array(1,0,0,0,0,0,0,0,1),
     1148                                                        array(1,0,0,0,0,0,0,0,1),
     1149                                                        array(1,0,0,0,0,1,0,0,1),
     1150                                                        array(1,0,0,0,0,0,1,0,1),
     1151                                                        array(0,1,0,0,0,0,0,1,0),
     1152                                                        array(0,0,1,1,1,1,1,0,1),
     1153                                                ),
     1154                                                array(
     1155                                                        array(0,0,1,1,1,1,1,0,0),
     1156                                                        array(0,1,0,0,0,0,0,1,0),
     1157                                                        array(1,0,0,0,0,0,0,0,1),
     1158                                                        array(1,0,0,0,0,0,0,0,1),
     1159                                                        array(1,0,0,0,0,0,0,0,1),
     1160                                                        array(1,0,0,0,0,0,0,0,1),
     1161                                                        array(1,0,0,0,0,0,0,0,1),
     1162                                                        array(1,0,0,0,0,0,0,0,1),
     1163                                                        array(1,0,0,0,0,0,0,0,1),
     1164                                                        array(1,0,0,0,1,0,0,0,1),
     1165                                                        array(1,1,0,0,1,1,0,1,1),
     1166                                                        array(0,1,1,1,1,1,1,1,0),
     1167                                                        array(0,0,0,0,0,0,1,1,0),
     1168                                                        array(0,0,0,0,0,0,0,1,1),
     1169                                                        array(0,0,0,0,0,0,0,0,1),
     1170                                                ),
     1171                                                array(
     1172                                                        array(0,0,0,0,0,0,0,0,0),
     1173                                                        array(0,0,0,0,0,0,0,0,0),
     1174                                                        array(0,0,0,0,0,0,0,0,0),
     1175                                                        array(0,0,0,0,0,1,1,1,1),
     1176                                                        array(0,0,0,0,1,1,0,0,1),
     1177                                                        array(0,0,0,0,1,0,0,0,1),
     1178                                                        array(0,0,0,0,1,0,0,0,1),
     1179                                                        array(0,0,0,0,1,1,0,1,1),
     1180                                                        array(0,0,0,0,0,1,1,0,1),
     1181                                                        array(0,0,0,0,0,0,0,0,1),
     1182                                                        array(0,0,0,0,0,0,0,0,1),
     1183                                                        array(0,0,0,0,0,0,0,0,1),
     1184                                                        array(0,0,0,0,0,0,0,0,1),
     1185                                                        array(0,0,0,0,0,0,0,0,1),
     1186                                                        array(0,0,0,0,0,0,0,0,1),
     1187                                                ),
     1188                                        ),
     1189                'R'     =>              array(
     1190                                                array(
     1191                                                        array(1,1,1,1,1,1,1,0,0),
     1192                                                        array(1,0,0,0,0,0,0,1,0),
     1193                                                        array(1,0,0,0,0,0,0,0,1),
     1194                                                        array(1,0,0,0,0,0,0,0,1),
     1195                                                        array(1,0,0,0,0,0,0,0,1),
     1196                                                        array(1,0,0,0,0,0,0,0,1),
     1197                                                        array(1,0,0,0,0,0,0,1,0),
     1198                                                        array(1,1,1,1,1,1,1,0,0),
     1199                                                        array(1,1,1,0,0,0,0,0,0),
     1200                                                        array(1,0,0,1,0,0,0,0,0),
     1201                                                        array(1,0,0,0,1,0,0,0,0),
     1202                                                        array(1,0,0,0,0,1,0,0,0),
     1203                                                        array(1,0,0,0,0,0,1,0,0),
     1204                                                        array(1,0,0,0,0,0,0,1,0),
     1205                                                        array(1,0,0,0,0,0,0,0,1),
     1206                                                ),
     1207                                                array(
     1208                                                        array(1,1,1,1,1,1,1,0,0),
     1209                                                        array(0,1,0,0,0,0,0,1,0),
     1210                                                        array(0,1,0,0,0,0,0,0,1),
     1211                                                        array(0,1,0,0,0,0,0,0,1),
     1212                                                        array(0,1,0,0,0,0,0,0,1),
     1213                                                        array(0,1,0,0,0,0,0,0,1),
     1214                                                        array(0,1,0,0,0,0,0,1,0),
     1215                                                        array(1,1,1,1,1,1,1,0,0),
     1216                                                        array(0,1,1,0,0,0,0,0,0),
     1217                                                        array(0,1,1,1,0,0,0,0,0),
     1218                                                        array(0,1,0,1,1,0,0,0,0),
     1219                                                        array(0,1,0,0,1,1,0,0,0),
     1220                                                        array(0,1,0,0,0,1,1,0,0),
     1221                                                        array(0,1,0,0,0,0,1,1,0),
     1222                                                        array(1,1,1,0,0,0,1,1,1),
     1223                                                ),
     1224                                                array(
     1225                                                        array(0,0,0,0,0,0,0,0,0),
     1226                                                        array(0,0,0,0,0,0,0,0,0),
     1227                                                        array(0,0,0,0,0,0,0,0,0),
     1228                                                        array(0,0,0,0,0,0,0,0,0),
     1229                                                        array(0,0,0,0,0,0,0,0,0),
     1230                                                        array(0,0,0,0,0,0,0,0,0),
     1231                                                        array(1,0,0,0,0,0,0,0,0),
     1232                                                        array(1,1,1,1,1,0,0,0,0),
     1233                                                        array(1,1,0,0,1,1,0,0,0),
     1234                                                        array(1,0,0,0,0,0,0,0,0),
     1235                                                        array(1,0,0,0,0,0,0,0,0),
     1236                                                        array(1,0,0,0,0,0,0,0,0),
     1237                                                        array(1,0,0,0,0,0,0,0,0),
     1238                                                        array(1,0,0,0,0,0,0,0,0),
     1239                                                        array(1,0,0,0,0,0,0,0,0),
     1240                                                ),
     1241                                        ),
     1242                'S'     =>              array(
     1243                                                array(
     1244                                                        array(0,0,1,1,1,1,1,0,0),
     1245                                                        array(0,1,0,0,0,0,0,1,0),
     1246                                                        array(1,0,0,0,0,0,0,0,1),
     1247                                                        array(1,0,0,0,0,0,0,0,0),
     1248                                                        array(1,0,0,0,0,0,0,0,0),
     1249                                                        array(1,0,0,0,0,0,0,0,0),
     1250                                                        array(0,1,0,0,0,0,0,0,0),
     1251                                                        array(0,0,1,1,1,1,1,0,0),
     1252                                                        array(0,0,0,0,0,0,0,1,0),
     1253                                                        array(0,0,0,0,0,0,0,0,1),
     1254                                                        array(0,0,0,0,0,0,0,0,1),
     1255                                                        array(0,0,0,0,0,0,0,0,1),
     1256                                                        array(1,0,0,0,0,0,0,0,1),
     1257                                                        array(0,1,0,0,0,0,0,1,0),
     1258                                                        array(0,0,1,1,1,1,1,0,0),
     1259                                                ),
     1260                                                array(
     1261                                                        array(0,0,1,1,1,1,1,0,1),
     1262                                                        array(0,1,0,0,0,0,0,1,1),
     1263                                                        array(1,0,0,0,0,0,0,0,1),
     1264                                                        array(1,0,0,0,0,0,0,0,1),
     1265                                                        array(1,0,0,0,0,0,0,0,0),
     1266                                                        array(1,0,0,0,0,0,0,0,0),
     1267                                                        array(0,1,0,0,0,0,0,0,0),
     1268                                                        array(0,0,1,1,1,1,1,0,0),
     1269                                                        array(0,0,0,0,0,0,0,1,0),
     1270                                                        array(0,0,0,0,0,0,0,0,1),
     1271                                                        array(1,0,0,0,0,0,0,0,1),
     1272                                                        array(1,0,0,0,0,0,0,0,1),
     1273                                                        array(1,0,0,0,0,0,0,0,1),
     1274                                                        array(1,1,0,0,0,0,0,1,0),
     1275                                                        array(1,0,1,1,1,1,1,0,0),
     1276                                                ),
     1277                                                array(
     1278                                                        array(0,0,0,0,0,0,0,0,0),
     1279                                                        array(0,0,0,0,0,0,0,0,0),
     1280                                                        array(0,0,0,0,0,0,0,0,0),
     1281                                                        array(0,0,0,0,0,0,0,0,0),
     1282                                                        array(0,0,0,0,0,0,0,0,0),
     1283                                                        array(0,0,0,0,0,0,0,0,0),
     1284                                                        array(0,0,0,0,0,0,0,0,0),
     1285                                                        array(0,1,1,1,1,0,0,0,0),
     1286                                                        array(1,0,0,0,0,1,0,0,0),
     1287                                                        array(1,0,0,0,0,0,0,0,0),
     1288                                                        array(1,1,0,0,0,0,0,0,0),
     1289                                                        array(0,1,1,1,1,0,0,0,0),
     1290                                                        array(0,0,0,0,0,1,0,0,0),
     1291                                                        array(1,0,0,0,1,1,0,0,0),
     1292                                                        array(0,1,1,1,1,0,0,0,0),
     1293                                                ),
     1294                                        ),
     1295                'T'     =>              array(
     1296                                                array(
     1297                                                        array(1,1,1,1,1,1,1,1,1),
     1298                                                        array(0,0,0,0,1,0,0,0,0),
     1299                                                        array(0,0,0,0,1,0,0,0,0),
     1300                                                        array(0,0,0,0,1,0,0,0,0),
     1301                                                        array(0,0,0,0,1,0,0,0,0),
     1302                                                        array(0,0,0,0,1,0,0,0,0),
     1303                                                        array(0,0,0,0,1,0,0,0,0),
     1304                                                        array(0,0,0,0,1,0,0,0,0),
     1305                                                        array(0,0,0,0,1,0,0,0,0),
     1306                                                        array(0,0,0,0,1,0,0,0,0),
     1307                                                        array(0,0,0,0,1,0,0,0,0),
     1308                                                        array(0,0,0,0,1,0,0,0,0),
     1309                                                        array(0,0,0,0,1,0,0,0,0),
     1310                                                        array(0,0,0,0,1,0,0,0,0),
     1311                                                        array(0,0,0,0,1,0,0,0,0),
     1312                                                ),
     1313                                                array(
     1314                                                        array(1,1,1,1,1,1,1,1,1),
     1315                                                        array(1,0,0,0,1,0,0,0,1),
     1316                                                        array(0,0,0,0,1,0,0,0,0),
     1317                                                        array(0,0,0,0,1,0,0,0,0),
     1318                                                        array(0,0,0,0,1,0,0,0,0),
     1319                                                        array(0,0,0,0,1,0,0,0,0),
     1320                                                        array(0,0,0,0,1,0,0,0,0),
     1321                                                        array(0,0,0,0,1,0,0,0,0),
     1322                                                        array(0,0,0,0,1,0,0,0,0),
     1323                                                        array(0,0,0,0,1,0,0,0,0),
     1324                                                        array(0,0,0,0,1,0,0,0,0),
     1325                                                        array(0,0,0,0,1,0,0,0,0),
     1326                                                        array(0,0,0,0,1,0,0,0,0),
     1327                                                        array(0,0,0,0,1,0,0,0,0),
     1328                                                        array(0,0,0,1,1,1,0,0,0),
     1329                                                ),
     1330                                                array(
     1331                                                        array(0,0,0,0,1,0,0,0,0),
     1332                                                        array(0,0,0,0,1,0,0,0,0),
     1333                                                        array(0,0,0,0,1,0,0,0,0),
     1334                                                        array(0,0,1,1,1,1,1,1,0),
     1335                                                        array(0,0,0,0,1,0,0,0,0),
     1336                                                        array(0,0,0,0,1,0,0,0,0),
     1337                                                        array(0,0,0,0,1,0,0,0,0),
     1338                                                        array(0,0,0,0,1,0,0,0,0),
     1339                                                        array(0,0,0,0,1,0,0,0,0),
     1340                                                        array(0,0,0,0,1,0,0,0,0),
     1341                                                        array(0,0,0,0,1,0,0,0,0),
     1342                                                        array(0,0,0,0,1,0,0,0,0),
     1343                                                        array(0,0,0,0,1,0,0,0,0),
     1344                                                        array(0,0,0,0,1,1,0,0,0),
     1345                                                        array(0,0,0,0,0,1,1,1,0),
     1346                                                ),
     1347                                        ),
     1348                'U'     =>              array(
     1349                                                array(
     1350                                                        array(1,0,0,0,0,0,0,0,1),
     1351                                                        array(1,0,0,0,0,0,0,0,1),
     1352                                                        array(1,0,0,0,0,0,0,0,1),
     1353                                                        array(1,0,0,0,0,0,0,0,1),
     1354                                                        array(1,0,0,0,0,0,0,0,1),
     1355                                                        array(1,0,0,0,0,0,0,0,1),
     1356                                                        array(1,0,0,0,0,0,0,0,1),
     1357                                                        array(1,0,0,0,0,0,0,0,1),
     1358                                                        array(1,0,0,0,0,0,0,0,1),
     1359                                                        array(1,0,0,0,0,0,0,0,1),
     1360                                                        array(1,0,0,0,0,0,0,0,1),
     1361                                                        array(1,0,0,0,0,0,0,0,1),
     1362                                                        array(1,0,0,0,0,0,0,0,1),
     1363                                                        array(0,1,0,0,0,0,0,1,0),
     1364                                                        array(0,0,1,1,1,1,1,0,0),
     1365                                                ),
     1366                                                array(
     1367                                                        array(1,0,0,0,0,0,0,0,0),
     1368                                                        array(1,1,1,0,0,0,1,1,1),
     1369                                                        array(0,1,0,0,0,0,0,1,0),
     1370                                                        array(0,1,0,0,0,0,0,1,0),
     1371                                                        array(0,1,0,0,0,0,0,1,0),
     1372                                                        array(0,1,0,0,0,0,0,1,0),
     1373                                                        array(0,1,0,0,0,0,0,1,0),
     1374                                                        array(0,1,0,0,0,0,0,1,0),
     1375                                                        array(0,1,0,0,0,0,0,1,0),
     1376                                                        array(0,1,0,0,0,0,0,1,0),
     1377                                                        array(0,1,0,0,0,0,0,1,0),
     1378                                                        array(0,1,0,0,0,0,0,1,0),
     1379                                                        array(0,1,0,0,0,0,0,1,0),
     1380                                                        array(0,1,1,0,0,0,1,1,0),
     1381                                                        array(0,0,1,1,1,1,1,0,0),
     1382                                                ),
     1383                                                array(
     1384                                                        array(0,0,0,0,0,0,0,0,0),
     1385                                                        array(0,0,0,0,0,0,0,0,0),
     1386                                                        array(0,0,0,0,0,0,0,0,0),
     1387                                                        array(0,0,0,0,0,0,0,0,0),
     1388                                                        array(0,0,0,0,0,0,0,0,0),
     1389                                                        array(0,0,0,0,0,0,0,0,0),
     1390                                                        array(0,0,0,0,0,0,0,0,0),
     1391                                                        array(0,0,1,0,0,0,0,0,1),
     1392                                                        array(0,0,1,0,0,0,0,0,1),
     1393                                                        array(0,0,1,0,0,0,0,0,1),
     1394                                                        array(0,0,1,0,0,0,0,0,1),
     1395                                                        array(0,0,1,0,0,0,0,0,1),
     1396                                                        array(0,0,1,0,0,0,0,1,1),
     1397                                                        array(0,0,1,1,0,0,1,1,1),
     1398                                                        array(0,0,0,1,1,1,1,0,1),
     1399                                                ),
     1400                                        ),
     1401                'V'     =>              array(
     1402                                                array(
     1403                                                        array(1,0,0,0,0,0,0,0,1),
     1404                                                        array(1,0,0,0,0,0,0,0,1),
     1405                                                        array(1,0,0,0,0,0,0,0,1),
     1406                                                        array(0,1,0,0,0,0,0,1,0),
     1407                                                        array(0,1,0,0,0,0,0,1,0),
     1408                                                        array(0,1,0,0,0,0,0,1,0),
     1409                                                        array(0,0,1,0,0,0,1,0,0),
     1410                                                        array(0,0,1,0,0,0,1,0,0),
     1411                                                        array(0,0,1,0,0,0,1,0,0),
     1412                                                        array(0,0,1,0,0,0,1,0,0),
     1413                                                        array(0,0,0,1,0,1,0,0,0),
     1414                                                        array(0,0,0,1,0,1,0,0,0),
     1415                                                        array(0,0,0,1,0,1,0,0,0),
     1416                                                        array(0,0,0,0,1,0,0,0,0),
     1417                                                        array(0,0,0,0,1,0,0,0,0),
     1418                                                ),
     1419                                                array(
     1420                                                        array(0,0,0,0,0,0,0,0,0),
     1421                                                        array(0,0,0,0,0,0,0,0,0),
     1422                                                        array(0,0,0,0,0,0,0,0,0),
     1423                                                        array(1,1,1,0,0,0,1,1,1),
     1424                                                        array(0,1,0,0,0,0,0,1,0),
     1425                                                        array(0,1,0,0,0,0,0,1,0),
     1426                                                        array(0,0,1,0,0,0,1,0,0),
     1427                                                        array(0,0,1,0,0,0,1,0,0),
     1428                                                        array(0,0,1,0,0,0,1,0,0),
     1429                                                        array(0,0,1,0,0,0,1,0,0),
     1430                                                        array(0,0,0,1,0,1,0,0,0),
     1431                                                        array(0,0,0,1,0,1,0,0,0),
     1432                                                        array(0,0,0,1,0,1,0,0,0),
     1433                                                        array(0,0,0,0,1,0,0,0,0),
     1434                                                        array(0,0,0,0,1,0,0,0,0),
     1435                                                ),
     1436                                                array(
     1437                                                        array(0,0,0,0,0,0,0,0,0),
     1438                                                        array(0,0,0,0,0,0,0,0,0),
     1439                                                        array(0,0,0,0,0,0,0,0,0),
     1440                                                        array(0,0,0,0,0,0,0,0,0),
     1441                                                        array(0,0,0,0,0,0,0,0,0),
     1442                                                        array(0,0,0,0,0,0,0,0,0),
     1443                                                        array(0,0,1,0,0,0,1,0,0),
     1444                                                        array(0,0,1,0,0,0,1,0,0),
     1445                                                        array(0,0,1,0,0,0,1,0,0),
     1446                                                        array(0,0,1,0,0,0,1,0,0),
     1447                                                        array(0,0,0,1,0,1,0,0,0),
     1448                                                        array(0,0,0,1,0,1,0,0,0),
     1449                                                        array(0,0,0,1,0,1,0,0,0),
     1450                                                        array(0,0,0,0,1,0,0,0,0),
     1451                                                        array(0,0,0,0,1,0,0,0,0),
     1452                                                ),
     1453                                        ),
     1454                'W'     =>              array(
     1455                                                array(
     1456                                                        array(1,0,0,0,0,0,0,0,1),
     1457                                                        array(1,0,0,0,0,0,0,0,1),
     1458                                                        array(1,0,0,0,0,0,0,0,1),
     1459                                                        array(1,0,0,0,0,0,0,0,1),
     1460                                                        array(1,0,0,0,0,0,0,0,1),
     1461                                                        array(1,0,0,0,1,0,0,0,1),
     1462                                                        array(1,0,0,0,1,0,0,0,1),
     1463                                                        array(1,0,0,1,0,1,0,0,1),
     1464                                                        array(1,0,0,1,0,1,0,0,1),
     1465                                                        array(1,0,0,1,0,1,0,0,1),
     1466                                                        array(1,0,1,0,0,0,1,0,1),
     1467                                                        array(1,0,1,0,0,0,1,0,1),
     1468                                                        array(1,0,1,0,0,0,1,0,1),
     1469                                                        array(1,1,0,0,0,0,0,1,1),
     1470                                                        array(1,1,0,0,0,0,0,1,1),
     1471                                                ),
     1472                                                array(
     1473                                                        array(0,0,0,0,0,0,0,0,0),
     1474                                                        array(0,0,0,0,0,0,0,0,0),
     1475                                                        array(1,1,1,0,0,0,1,1,1),
     1476                                                        array(0,1,0,0,0,0,0,1,0),
     1477                                                        array(0,1,0,0,0,0,0,1,0),
     1478                                                        array(0,1,0,0,0,0,0,1,0),
     1479                                                        array(0,1,0,0,0,0,0,1,0),
     1480                                                        array(0,1,0,0,1,0,0,1,0),
     1481                                                        array(0,1,0,0,1,0,0,1,0),
     1482                                                        array(0,1,0,1,1,1,0,1,0),
     1483                                                        array(0,1,0,1,0,1,0,1,0),
     1484                                                        array(0,1,1,1,0,1,1,1,0),
     1485                                                        array(0,1,1,0,0,0,1,1,0),
     1486                                                        array(0,1,0,0,0,0,0,1,0),
     1487                                                        array(0,0,0,0,0,0,0,0,0),
     1488                                                ),
     1489                                                array(
     1490                                                        array(0,0,0,0,0,0,0,0,0),
     1491                                                        array(0,0,0,0,0,0,0,0,0),
     1492                                                        array(0,0,0,0,0,0,0,0,0),
     1493                                                        array(0,0,0,0,0,0,0,0,0),
     1494                                                        array(0,0,0,0,0,0,0,0,0),
     1495                                                        array(0,0,0,0,0,0,0,0,0),
     1496                                                        array(0,1,0,0,0,0,0,1,0),
     1497                                                        array(0,1,0,0,1,0,0,1,0),
     1498                                                        array(0,1,0,0,1,0,0,1,0),
     1499                                                        array(0,1,0,1,1,1,0,1,0),
     1500                                                        array(0,1,0,1,0,1,0,1,0),
     1501                                                        array(0,1,1,1,0,1,1,1,0),
     1502                                                        array(0,1,1,0,0,0,1,1,0),
     1503                                                        array(0,1,0,0,0,0,0,1,0),
     1504                                                        array(0,0,0,0,0,0,0,0,0),
     1505                                                ),
     1506                                        ),
     1507                'X'     =>              array(
     1508                                                array(
     1509                                                        array(1,0,0,0,0,0,0,0,1),
     1510                                                        array(1,0,0,0,0,0,0,0,1),
     1511                                                        array(0,1,0,0,0,0,0,1,0),
     1512                                                        array(0,1,0,0,0,0,0,1,0),
     1513                                                        array(0,0,1,0,0,0,1,0,0),
     1514                                                        array(0,0,0,1,0,1,0,0,0),
     1515                                                        array(0,0,0,1,0,1,0,0,0),
     1516                                                        array(0,0,0,0,1,0,0,0,0),
     1517                                                        array(0,0,0,1,0,1,0,0,0),
     1518                                                        array(0,0,0,1,0,1,0,0,0),
     1519                                                        array(0,0,1,0,0,0,1,0,0),
     1520                                                        array(0,1,0,0,0,0,1,0,0),
     1521                                                        array(0,1,0,0,0,0,0,1,0),
     1522                                                        array(1,0,0,0,0,0,0,0,1),
     1523                                                        array(1,0,0,0,0,0,0,0,1),
     1524                                                ),
     1525                                                array(
     1526                                                        array(0,0,0,0,0,0,0,0,0),
     1527                                                        array(1,1,1,0,0,0,1,1,1),
     1528                                                        array(0,1,0,0,0,0,0,1,0),
     1529                                                        array(0,1,0,0,0,0,0,1,0),
     1530                                                        array(0,0,1,0,0,0,1,0,0),
     1531                                                        array(0,0,0,1,0,1,0,0,0),
     1532                                                        array(0,0,0,1,0,1,0,0,0),
     1533                                                        array(0,0,0,0,1,0,0,0,0),
     1534                                                        array(0,0,0,1,0,1,0,0,0),
     1535                                                        array(0,0,0,1,0,1,0,0,0),
     1536                                                        array(0,0,1,0,0,0,1,0,0),
     1537                                                        array(0,1,0,0,0,0,1,0,0),
     1538                                                        array(0,1,0,0,0,0,0,1,0),
     1539                                                        array(1,1,1,0,0,0,1,1,1),
     1540                                                        array(0,0,0,0,0,0,0,0,0),
     1541                                                ),
     1542                                                array(
     1543                                                        array(0,0,0,0,0,0,0,0,0),
     1544                                                        array(0,0,0,0,0,0,0,0,0),
     1545                                                        array(0,0,0,0,0,0,0,0,0),
     1546                                                        array(0,0,0,0,0,0,0,0,0),
     1547                                                        array(0,0,0,0,0,0,0,0,0),
     1548                                                        array(0,0,0,0,0,0,0,0,0),
     1549                                                        array(0,0,0,0,0,0,0,0,0),
     1550                                                        array(0,1,0,0,0,0,0,1,0),
     1551                                                        array(0,1,1,0,0,0,1,1,0),
     1552                                                        array(0,0,1,1,0,1,1,0,0),
     1553                                                        array(0,0,0,1,1,1,0,0,0),
     1554                                                        array(0,0,0,1,1,1,0,0,0),
     1555                                                        array(0,0,1,1,0,1,1,0,0),
     1556                                                        array(0,1,1,0,0,0,1,1,0),
     1557                                                        array(0,0,0,0,0,0,0,0,0),
     1558                                                ),
     1559                                        ),
     1560                'Y'     =>              array(
     1561                                                array(
     1562                                                        array(1,0,0,0,0,0,0,0,1),
     1563                                                        array(1,0,0,0,0,0,0,0,1),
     1564                                                        array(0,1,0,0,0,0,0,1,0),
     1565                                                        array(0,1,0,0,0,0,0,1,0),
     1566                                                        array(0,0,1,0,0,0,1,0,0),
     1567                                                        array(0,0,1,0,0,0,1,0,0),
     1568                                                        array(0,0,0,1,0,1,0,0,0),
     1569                                                        array(0,0,0,0,1,0,0,0,0),
     1570                                                        array(0,0,0,0,1,0,0,0,0),
     1571                                                        array(0,0,0,0,1,0,0,0,0),
     1572                                                        array(0,0,0,0,1,0,0,0,0),
     1573                                                        array(0,0,0,0,1,0,0,0,0),
     1574                                                        array(0,0,0,0,1,0,0,0,0),
     1575                                                        array(0,0,0,0,1,0,0,0,0),
     1576                                                        array(0,0,0,0,1,0,0,0,0),
     1577                                                ),
     1578                                                array(
     1579                                                        array(0,0,0,0,0,0,0,0,0),
     1580                                                        array(1,1,1,0,0,0,1,1,1),
     1581                                                        array(0,1,0,0,0,0,0,1,0),
     1582                                                        array(0,1,0,0,0,0,0,1,0),
     1583                                                        array(0,0,1,0,0,0,1,0,0),
     1584                                                        array(0,0,1,0,0,0,1,0,0),
     1585                                                        array(0,0,0,1,0,1,0,0,0),
     1586                                                        array(0,0,0,0,1,0,0,0,0),
     1587                                                        array(0,0,0,0,1,0,0,0,0),
     1588                                                        array(0,0,0,0,1,0,0,0,0),
     1589                                                        array(0,0,0,0,1,0,0,0,0),
     1590                                                        array(0,0,0,0,1,0,0,0,0),
     1591                                                        array(0,0,0,0,1,0,0,0,0),
     1592                                                        array(0,0,0,0,1,0,0,0,0),
     1593                                                        array(0,0,0,1,1,1,0,0,0),
     1594                                                ),
     1595                                                array(
     1596                                                        array(0,0,0,0,0,0,0,0,0),
     1597                                                        array(0,0,0,0,0,0,0,0,0),
     1598                                                        array(0,0,0,0,0,0,0,0,0),
     1599                                                        array(0,0,0,0,0,0,0,0,0),
     1600                                                        array(0,0,0,1,0,0,0,0,1),
     1601                                                        array(0,0,0,1,1,0,0,0,1),
     1602                                                        array(0,0,0,0,1,0,0,1,1),
     1603                                                        array(0,0,0,0,1,1,0,1,0),
     1604                                                        array(0,0,0,0,0,1,1,1,0),
     1605                                                        array(0,0,0,0,0,0,1,0,0),
     1606                                                        array(0,0,0,0,0,1,1,0,0),
     1607                                                        array(0,0,0,0,0,1,0,0,0),
     1608                                                        array(0,0,0,0,1,1,0,0,0),
     1609                                                        array(0,0,1,1,1,0,0,0,0),
     1610                                                        array(0,0,0,0,0,0,0,0,0),
     1611                                                ),
     1612                                        ),
     1613                'Z'     =>              array(
     1614                                                array(
     1615                                                        array(1,1,1,1,1,1,1,1,1),
     1616                                                        array(1,0,0,0,0,0,0,0,1),
     1617                                                        array(0,0,0,0,0,0,0,0,1),
     1618                                                        array(0,0,0,0,0,0,0,1,0),
     1619                                                        array(0,0,0,0,0,0,1,0,0),
     1620                                                        array(0,0,0,0,0,1,0,0,0),
     1621                                                        array(0,0,0,0,0,1,0,0,0),
     1622                                                        array(0,0,0,0,1,0,0,0,0),
     1623                                                        array(0,0,0,1,0,0,0,0,0),
     1624                                                        array(0,0,0,1,0,0,0,0,0),
     1625                                                        array(0,0,1,0,0,0,0,0,0),
     1626                                                        array(0,1,0,0,0,0,0,0,0),
     1627                                                        array(1,0,0,0,0,0,0,0,0),
     1628                                                        array(1,0,0,0,0,0,0,0,1),
     1629                                                        array(1,1,1,1,1,1,1,1,1),
     1630                                                ),
     1631                                                array(
     1632                                                        array(1,1,1,1,1,1,1,1,1),
     1633                                                        array(0,0,0,0,0,0,0,0,1),
     1634                                                        array(0,0,0,0,0,0,0,0,1),
     1635                                                        array(0,0,0,0,0,0,0,1,0),
     1636                                                        array(0,0,0,0,0,0,1,0,0),
     1637                                                        array(0,0,0,0,0,1,0,0,0),
     1638                                                        array(0,0,0,0,0,1,0,0,0),
     1639                                                        array(0,0,1,1,1,1,1,0,0),
     1640                                                        array(0,0,0,1,0,0,0,0,0),
     1641                                                        array(0,0,0,1,0,0,0,0,0),
     1642                                                        array(0,0,1,0,0,0,0,0,0),
     1643                                                        array(0,1,0,0,0,0,0,0,0),
     1644                                                        array(1,0,0,0,0,0,0,0,0),
     1645                                                        array(1,0,0,0,0,0,0,0,0),
     1646                                                        array(1,1,1,1,1,1,1,1,1),
     1647                                                ),
     1648                                                array(
     1649                                                        array(0,0,0,0,0,0,0,0,0),
     1650                                                        array(0,0,0,0,0,0,0,0,0),
     1651                                                        array(0,0,0,0,0,0,0,0,0),
     1652                                                        array(0,0,0,0,0,0,0,0,0),
     1653                                                        array(0,0,0,0,0,0,0,0,0),
     1654                                                        array(0,0,0,0,0,0,0,0,0),
     1655                                                        array(0,0,0,0,0,0,0,0,0),
     1656                                                        array(0,0,0,0,0,0,0,0,0),
     1657                                                        array(0,1,1,1,1,1,1,1,0),
     1658                                                        array(0,0,0,0,0,1,1,0,0),
     1659                                                        array(0,0,0,0,1,1,0,0,0),
     1660                                                        array(0,0,0,1,1,0,0,0,0),
     1661                                                        array(0,0,1,1,0,0,0,0,0),
     1662                                                        array(0,0,1,0,0,0,0,0,0),
     1663                                                        array(0,1,1,1,1,1,1,1,0),
     1664                                                ),
     1665                                        ),
     1666                                );
    1791667                return array(
    1801668                        'width'         => 9,
     
    1821670                        'data'          => array(
    1831671
    184                         'A' => array(
    185                                 array(0,0,0,0,1,0,0,0,0),
    186                                 array(0,0,0,1,0,1,0,0,0),
    187                                 array(0,0,0,1,0,1,0,0,0),
    188                                 array(0,0,0,1,0,1,0,0,0),
    189                                 array(0,0,1,0,0,0,1,0,0),
    190                                 array(0,0,1,0,0,0,1,0,0),
    191                                 array(0,0,1,0,0,0,1,0,0),
    192                                 array(0,1,0,0,0,0,0,1,0),
    193                                 array(0,1,0,0,0,0,0,1,0),
    194                                 array(0,1,1,1,1,1,1,1,0),
    195                                 array(0,1,0,0,0,0,0,1,0),
    196                                 array(1,0,0,0,0,0,0,0,1),
    197                                 array(1,0,0,0,0,0,0,0,1),
    198                                 array(1,0,0,0,0,0,0,0,1),
    199                                 array(1,0,0,0,0,0,0,0,1),
    200                         ),
    201                         'B' => array(
    202                                 array(1,1,1,1,1,1,1,0,0),
    203                                 array(1,0,0,0,0,0,0,1,0),
    204                                 array(1,0,0,0,0,0,0,0,1),
    205                                 array(1,0,0,0,0,0,0,0,1),
    206                                 array(1,0,0,0,0,0,0,0,1),
    207                                 array(1,0,0,0,0,0,0,0,1),
    208                                 array(1,0,0,0,0,0,0,1,0),
    209                                 array(1,1,1,1,1,1,1,0,0),
    210                                 array(1,0,0,0,0,0,0,1,0),
    211                                 array(1,0,0,0,0,0,0,0,1),
    212                                 array(1,0,0,0,0,0,0,0,1),
    213                                 array(1,0,0,0,0,0,0,0,1),
    214                                 array(1,0,0,0,0,0,0,0,1),
    215                                 array(1,0,0,0,0,0,0,1,0),
    216                                 array(1,1,1,1,1,1,1,0,0),
    217                         ),
    218                         'C' => array(
    219                                 array(0,0,1,1,1,1,1,0,0),
    220                                 array(0,1,0,0,0,0,0,1,0),
    221                                 array(1,0,0,0,0,0,0,0,1),
    222                                 array(1,0,0,0,0,0,0,0,1),
    223                                 array(1,0,0,0,0,0,0,0,0),
    224                                 array(1,0,0,0,0,0,0,0,0),
    225                                 array(1,0,0,0,0,0,0,0,0),
    226                                 array(1,0,0,0,0,0,0,0,0),
    227                                 array(1,0,0,0,0,0,0,0,0),
    228                                 array(1,0,0,0,0,0,0,0,0),
    229                                 array(1,0,0,0,0,0,0,0,0),
    230                                 array(1,0,0,0,0,0,0,0,1),
    231                                 array(1,0,0,0,0,0,0,0,1),
    232                                 array(0,1,0,0,0,0,0,1,0),
    233                                 array(0,0,1,1,1,1,1,0,0),
    234                         ),
    235                         'D' => array(
    236                                 array(1,1,1,1,1,1,1,0,0),
    237                                 array(1,0,0,0,0,0,0,1,0),
    238                                 array(1,0,0,0,0,0,0,0,1),
    239                                 array(1,0,0,0,0,0,0,0,1),
    240                                 array(1,0,0,0,0,0,0,0,1),
    241                                 array(1,0,0,0,0,0,0,0,1),
    242                                 array(1,0,0,0,0,0,0,0,1),
    243                                 array(1,0,0,0,0,0,0,0,1),
    244                                 array(1,0,0,0,0,0,0,0,1),
    245                                 array(1,0,0,0,0,0,0,0,1),
    246                                 array(1,0,0,0,0,0,0,0,1),
    247                                 array(1,0,0,0,0,0,0,0,1),
    248                                 array(1,0,0,0,0,0,0,0,1),
    249                                 array(1,0,0,0,0,0,0,1,0),
    250                                 array(1,1,1,1,1,1,1,0,0),
    251                         ),
    252                         'E' => array(
    253                                 array(1,1,1,1,1,1,1,1,1),
    254                                 array(1,0,0,0,0,0,0,0,0),
    255                                 array(1,0,0,0,0,0,0,0,0),
    256                                 array(1,0,0,0,0,0,0,0,0),
    257                                 array(1,0,0,0,0,0,0,0,0),
    258                                 array(1,0,0,0,0,0,0,0,0),
    259                                 array(1,0,0,0,0,0,0,0,0),
    260                                 array(1,1,1,1,1,1,1,1,0),
    261                                 array(1,0,0,0,0,0,0,0,0),
    262                                 array(1,0,0,0,0,0,0,0,0),
    263                                 array(1,0,0,0,0,0,0,0,0),
    264                                 array(1,0,0,0,0,0,0,0,0),
    265                                 array(1,0,0,0,0,0,0,0,0),
    266                                 array(1,0,0,0,0,0,0,0,0),
    267                                 array(1,1,1,1,1,1,1,1,1),
    268                         ),
    269                         'F' => array(
    270                                 array(1,1,1,1,1,1,1,1,1),
    271                                 array(1,0,0,0,0,0,0,0,0),
    272                                 array(1,0,0,0,0,0,0,0,0),
    273                                 array(1,0,0,0,0,0,0,0,0),
    274                                 array(1,0,0,0,0,0,0,0,0),
    275                                 array(1,0,0,0,0,0,0,0,0),
    276                                 array(1,0,0,0,0,0,0,0,0),
    277                                 array(1,1,1,1,1,1,1,0,0),
    278                                 array(1,0,0,0,0,0,0,0,0),
    279                                 array(1,0,0,0,0,0,0,0,0),
    280                                 array(1,0,0,0,0,0,0,0,0),
    281                                 array(1,0,0,0,0,0,0,0,0),
    282                                 array(1,0,0,0,0,0,0,0,0),
    283                                 array(1,0,0,0,0,0,0,0,0),
    284                                 array(1,0,0,0,0,0,0,0,0),
    285                         ),
    286                         'G' => array(
    287                                 array(0,0,1,1,1,1,1,0,0),
    288                                 array(0,1,0,0,0,0,0,1,0),
    289                                 array(1,0,0,0,0,0,0,0,1),
    290                                 array(1,0,0,0,0,0,0,0,0),
    291                                 array(1,0,0,0,0,0,0,0,0),
    292                                 array(1,0,0,0,0,0,0,0,0),
    293                                 array(1,0,0,0,0,0,0,0,0),
    294                                 array(1,0,0,0,0,0,0,0,0),
    295                                 array(1,0,0,0,0,0,1,1,1),
    296                                 array(1,0,0,0,0,0,0,0,1),
    297                                 array(1,0,0,0,0,0,0,0,1),
    298                                 array(1,0,0,0,0,0,0,0,1),
    299                                 array(1,0,0,0,0,0,0,0,1),
    300                                 array(0,1,0,0,0,0,0,1,0),
    301                                 array(0,0,1,1,1,1,1,0,0),
    302                         ),
    303                         'H' => array(
    304                                 array(1,0,0,0,0,0,0,0,1),
    305                                 array(1,0,0,0,0,0,0,0,1),
    306                                 array(1,0,0,0,0,0,0,0,1),
    307                                 array(1,0,0,0,0,0,0,0,1),
    308                                 array(1,0,0,0,0,0,0,0,1),
    309                                 array(1,0,0,0,0,0,0,0,1),
    310                                 array(1,0,0,0,0,0,0,0,1),
    311                                 array(1,1,1,1,1,1,1,1,1),
    312                                 array(1,0,0,0,0,0,0,0,1),
    313                                 array(1,0,0,0,0,0,0,0,1),
    314                                 array(1,0,0,0,0,0,0,0,1),
    315                                 array(1,0,0,0,0,0,0,0,1),
    316                                 array(1,0,0,0,0,0,0,0,1),
    317                                 array(1,0,0,0,0,0,0,0,1),
    318                                 array(1,0,0,0,0,0,0,0,1),
    319                         ),
    320                         'I' => array(
    321                                 array(1,1,1,1,1,1,1,1,1),
    322                                 array(0,0,0,0,1,0,0,0,0),
    323                                 array(0,0,0,0,1,0,0,0,0),
    324                                 array(0,0,0,0,1,0,0,0,0),
    325                                 array(0,0,0,0,1,0,0,0,0),
    326                                 array(0,0,0,0,1,0,0,0,0),
    327                                 array(0,0,0,0,1,0,0,0,0),
    328                                 array(0,0,0,0,1,0,0,0,0),
    329                                 array(0,0,0,0,1,0,0,0,0),
    330                                 array(0,0,0,0,1,0,0,0,0),
    331                                 array(0,0,0,0,1,0,0,0,0),
    332                                 array(0,0,0,0,1,0,0,0,0),
    333                                 array(0,0,0,0,1,0,0,0,0),
    334                                 array(0,0,0,0,1,0,0,0,0),
    335                                 array(1,1,1,1,1,1,1,1,1),
    336                         ),
    337                         'J' => array(
    338                                 array(1,1,1,1,1,1,1,1,1),
    339                                 array(0,0,0,0,0,1,0,0,0),
    340                                 array(0,0,0,0,0,1,0,0,0),
    341                                 array(0,0,0,0,0,1,0,0,0),
    342                                 array(0,0,0,0,0,1,0,0,0),
    343                                 array(0,0,0,0,0,1,0,0,0),
    344                                 array(0,0,0,0,0,1,0,0,0),
    345                                 array(0,0,0,0,0,1,0,0,0),
    346                                 array(0,0,0,0,0,1,0,0,0),
    347                                 array(0,0,0,0,0,1,0,0,0),
    348                                 array(0,0,0,0,0,1,0,0,0),
    349                                 array(1,0,0,0,0,1,0,0,0),
    350                                 array(1,0,0,0,0,1,0,0,0),
    351                                 array(0,1,0,0,1,0,0,0,0),
    352                                 array(0,0,1,1,0,0,0,0,0),
    353                         ),
    354                         'K' => array(    // New 'K', supplied by NeoThermic
    355                                 array(1,0,0,0,0,0,0,0,1),
    356                                 array(1,0,0,0,0,0,0,1,0),
    357                                 array(1,0,0,0,0,0,1,0,0),
    358                                 array(1,0,0,0,0,1,0,0,0),
    359                                 array(1,0,0,0,1,0,0,0,0),
    360                                 array(1,0,0,1,0,0,0,0,0),
    361                                 array(1,0,1,0,0,0,0,0,0),
    362                                 array(1,1,0,0,0,0,0,0,0),
    363                                 array(1,0,1,0,0,0,0,0,0),
    364                                 array(1,0,0,1,0,0,0,0,0),
    365                                 array(1,0,0,0,1,0,0,0,0),
    366                                 array(1,0,0,0,0,1,0,0,0),
    367                                 array(1,0,0,0,0,0,1,0,0),
    368                                 array(1,0,0,0,0,0,0,1,0),
    369                                 array(1,0,0,0,0,0,0,0,1),
    370                         ),
    371                         'L' => array(
    372                                 array(0,0,0,0,0,0,0,0,0),
    373                                 array(1,0,0,0,0,0,0,0,0),
    374                                 array(1,0,0,0,0,0,0,0,0),
    375                                 array(1,0,0,0,0,0,0,0,0),
    376                                 array(1,0,0,0,0,0,0,0,0),
    377                                 array(1,0,0,0,0,0,0,0,0),
    378                                 array(1,0,0,0,0,0,0,0,0),
    379                                 array(1,0,0,0,0,0,0,0,0),
    380                                 array(1,0,0,0,0,0,0,0,0),
    381                                 array(1,0,0,0,0,0,0,0,0),
    382                                 array(1,0,0,0,0,0,0,0,0),
    383                                 array(1,0,0,0,0,0,0,0,0),
    384                                 array(1,0,0,0,0,0,0,0,0),
    385                                 array(1,0,0,0,0,0,0,0,0),
    386                                 array(1,1,1,1,1,1,1,1,1),
    387                         ),
    388                         'M' => array(
    389                                 array(1,1,0,0,0,0,0,1,1),
    390                                 array(1,1,0,0,0,0,0,1,1),
    391                                 array(1,0,1,0,0,0,1,0,1),
    392                                 array(1,0,1,0,0,0,1,0,1),
    393                                 array(1,0,1,0,0,0,1,0,1),
    394                                 array(1,0,0,1,0,1,0,0,1),
    395                                 array(1,0,0,1,0,1,0,0,1),
    396                                 array(1,0,0,1,0,1,0,0,1),
    397                                 array(1,0,0,0,1,0,0,0,1),
    398                                 array(1,0,0,0,1,0,0,0,1),
    399                                 array(1,0,0,0,0,0,0,0,1),
    400                                 array(1,0,0,0,0,0,0,0,1),
    401                                 array(1,0,0,0,0,0,0,0,1),
    402                                 array(1,0,0,0,0,0,0,0,1),
    403                                 array(1,0,0,0,0,0,0,0,1),
    404                         ),
    405                         'N' => array(
    406                                 array(1,1,0,0,0,0,0,0,1),
    407                                 array(1,1,0,0,0,0,0,0,1),
    408                                 array(1,0,1,0,0,0,0,0,1),
    409                                 array(1,0,1,0,0,0,0,0,1),
    410                                 array(1,0,0,1,0,0,0,0,1),
    411                                 array(1,0,0,1,0,0,0,0,1),
    412                                 array(1,0,0,0,1,0,0,0,1),
    413                                 array(1,0,0,0,1,0,0,0,1),
    414                                 array(1,0,0,0,1,0,0,0,1),
    415                                 array(1,0,0,0,0,1,0,0,1),
    416                                 array(1,0,0,0,0,1,0,0,1),
    417                                 array(1,0,0,0,0,0,1,0,1),
    418                                 array(1,0,0,0,0,0,1,0,1),
    419                                 array(1,0,0,0,0,0,0,1,1),
    420                                 array(1,0,0,0,0,0,0,1,1),
    421                         ),
    422                         'O' => array(
    423                                 array(0,0,1,1,1,1,1,0,0),
    424                                 array(0,1,0,0,0,0,0,1,0),
    425                                 array(1,0,0,0,0,0,0,0,1),
    426                                 array(1,0,0,0,0,0,0,0,1),
    427                                 array(1,0,0,0,0,0,0,0,1),
    428                                 array(1,0,0,0,0,0,0,0,1),
    429                                 array(1,0,0,0,0,0,0,0,1),
    430                                 array(1,0,0,0,0,0,0,0,1),
    431                                 array(1,0,0,0,0,0,0,0,1),
    432                                 array(1,0,0,0,0,0,0,0,1),
    433                                 array(1,0,0,0,0,0,0,0,1),
    434                                 array(1,0,0,0,0,0,0,0,1),
    435                                 array(1,0,0,0,0,0,0,0,1),
    436                                 array(0,1,0,0,0,0,0,1,0),
    437                                 array(0,0,1,1,1,1,1,0,0),
    438                         ),
    439                         'P' => array(
    440                                 array(1,1,1,1,1,1,1,0,0),
    441                                 array(1,0,0,0,0,0,0,1,0),
    442                                 array(1,0,0,0,0,0,0,0,1),
    443                                 array(1,0,0,0,0,0,0,0,1),
    444                                 array(1,0,0,0,0,0,0,0,1),
    445                                 array(1,0,0,0,0,0,0,0,1),
    446                                 array(1,0,0,0,0,0,0,1,0),
    447                                 array(1,1,1,1,1,1,1,0,0),
    448                                 array(1,0,0,0,0,0,0,0,0),
    449                                 array(1,0,0,0,0,0,0,0,0),
    450                                 array(1,0,0,0,0,0,0,0,0),
    451                                 array(1,0,0,0,0,0,0,0,0),
    452                                 array(1,0,0,0,0,0,0,0,0),
    453                                 array(1,0,0,0,0,0,0,0,0),
    454                                 array(1,0,0,0,0,0,0,0,0),
    455                         ),
    456                         'Q' => array(
    457                                 array(0,0,1,1,1,1,1,0,0),
    458                                 array(0,1,0,0,0,0,0,1,0),
    459                                 array(1,0,0,0,0,0,0,0,1),
    460                                 array(1,0,0,0,0,0,0,0,1),
    461                                 array(1,0,0,0,0,0,0,0,1),
    462                                 array(1,0,0,0,0,0,0,0,1),
    463                                 array(1,0,0,0,0,0,0,0,1),
    464                                 array(1,0,0,0,0,0,0,0,1),
    465                                 array(1,0,0,0,0,0,0,0,1),
    466                                 array(1,0,0,0,0,0,0,0,1),
    467                                 array(1,0,0,0,0,0,0,0,1),
    468                                 array(1,0,0,0,0,1,0,0,1),
    469                                 array(1,0,0,0,0,0,1,0,1),
    470                                 array(0,1,0,0,0,0,0,1,0),
    471                                 array(0,0,1,1,1,1,1,0,1),
    472                         ),
    473                         'R' => array(
    474                                 array(1,1,1,1,1,1,1,0,0),
    475                                 array(1,0,0,0,0,0,0,1,0),
    476                                 array(1,0,0,0,0,0,0,0,1),
    477                                 array(1,0,0,0,0,0,0,0,1),
    478                                 array(1,0,0,0,0,0,0,0,1),
    479                                 array(1,0,0,0,0,0,0,0,1),
    480                                 array(1,0,0,0,0,0,0,1,0),
    481                                 array(1,1,1,1,1,1,1,0,0),
    482                                 array(1,1,1,0,0,0,0,0,0),
    483                                 array(1,0,0,1,0,0,0,0,0),
    484                                 array(1,0,0,0,1,0,0,0,0),
    485                                 array(1,0,0,0,0,1,0,0,0),
    486                                 array(1,0,0,0,0,0,1,0,0),
    487                                 array(1,0,0,0,0,0,0,1,0),
    488                                 array(1,0,0,0,0,0,0,0,1),
    489                         ),
    490                         'S' => array(
    491                                 array(0,0,1,1,1,1,1,0,0),
    492                                 array(0,1,0,0,0,0,0,1,0),
    493                                 array(1,0,0,0,0,0,0,0,1),
    494                                 array(1,0,0,0,0,0,0,0,0),
    495                                 array(1,0,0,0,0,0,0,0,0),
    496                                 array(1,0,0,0,0,0,0,0,0),
    497                                 array(0,1,0,0,0,0,0,0,0),
    498                                 array(0,0,1,1,1,1,1,0,0),
    499                                 array(0,0,0,0,0,0,0,1,0),
    500                                 array(0,0,0,0,0,0,0,0,1),
    501                                 array(0,0,0,0,0,0,0,0,1),
    502                                 array(0,0,0,0,0,0,0,0,1),
    503                                 array(1,0,0,0,0,0,0,0,1),
    504                                 array(0,1,0,0,0,0,0,1,0),
    505                                 array(0,0,1,1,1,1,1,0,0),
    506                         ),
    507                         'T' => array(
    508                                 array(1,1,1,1,1,1,1,1,1),
    509                                 array(0,0,0,0,1,0,0,0,0),
    510                                 array(0,0,0,0,1,0,0,0,0),
    511                                 array(0,0,0,0,1,0,0,0,0),
    512                                 array(0,0,0,0,1,0,0,0,0),
    513                                 array(0,0,0,0,1,0,0,0,0),
    514                                 array(0,0,0,0,1,0,0,0,0),
    515                                 array(0,0,0,0,1,0,0,0,0),
    516                                 array(0,0,0,0,1,0,0,0,0),
    517                                 array(0,0,0,0,1,0,0,0,0),
    518                                 array(0,0,0,0,1,0,0,0,0),
    519                                 array(0,0,0,0,1,0,0,0,0),
    520                                 array(0,0,0,0,1,0,0,0,0),
    521                                 array(0,0,0,0,1,0,0,0,0),
    522                                 array(0,0,0,0,1,0,0,0,0),
    523                         ),
    524                         'U' => array(
    525                                 array(1,0,0,0,0,0,0,0,1),
    526                                 array(1,0,0,0,0,0,0,0,1),
    527                                 array(1,0,0,0,0,0,0,0,1),
    528                                 array(1,0,0,0,0,0,0,0,1),
    529                                 array(1,0,0,0,0,0,0,0,1),
    530                                 array(1,0,0,0,0,0,0,0,1),
    531                                 array(1,0,0,0,0,0,0,0,1),
    532                                 array(1,0,0,0,0,0,0,0,1),
    533                                 array(1,0,0,0,0,0,0,0,1),
    534                                 array(1,0,0,0,0,0,0,0,1),
    535                                 array(1,0,0,0,0,0,0,0,1),
    536                                 array(1,0,0,0,0,0,0,0,1),
    537                                 array(1,0,0,0,0,0,0,0,1),
    538                                 array(0,1,0,0,0,0,0,1,0),
    539                                 array(0,0,1,1,1,1,1,0,0),
    540                         ),
    541                         'V' => array(
    542                                 array(1,0,0,0,0,0,0,0,1),
    543                                 array(1,0,0,0,0,0,0,0,1),
    544                                 array(1,0,0,0,0,0,0,0,1),
    545                                 array(0,1,0,0,0,0,0,1,0),
    546                                 array(0,1,0,0,0,0,0,1,0),
    547                                 array(0,1,0,0,0,0,0,1,0),
    548                                 array(0,0,1,0,0,0,1,0,0),
    549                                 array(0,0,1,0,0,0,1,0,0),
    550                                 array(0,0,1,0,0,0,1,0,0),
    551                                 array(0,0,1,0,0,0,1,0,0),
    552                                 array(0,0,0,1,0,1,0,0,0),
    553                                 array(0,0,0,1,0,1,0,0,0),
    554                                 array(0,0,0,1,0,1,0,0,0),
    555                                 array(0,0,0,0,1,0,0,0,0),
    556                                 array(0,0,0,0,1,0,0,0,0),
    557                         ),
    558                         'W' => array(    // New 'W', supplied by MHobbit
    559                                 array(1,0,0,0,0,0,0,0,1),
    560                                 array(1,0,0,0,0,0,0,0,1),
    561                                 array(1,0,0,0,0,0,0,0,1),
    562                                 array(1,0,0,0,0,0,0,0,1),
    563                                 array(1,0,0,0,0,0,0,0,1),
    564                                 array(1,0,0,0,1,0,0,0,1),
    565                                 array(1,0,0,0,1,0,0,0,1),
    566                                 array(1,0,0,1,0,1,0,0,1),
    567                                 array(1,0,0,1,0,1,0,0,1),
    568                                 array(1,0,0,1,0,1,0,0,1),
    569                                 array(1,0,1,0,0,0,1,0,1),
    570                                 array(1,0,1,0,0,0,1,0,1),
    571                                 array(1,0,1,0,0,0,1,0,1),
    572                                 array(1,1,0,0,0,0,0,1,1),
    573                                 array(1,1,0,0,0,0,0,1,1),
    574                         ),
    575                         'X' => array(
    576                                 array(1,0,0,0,0,0,0,0,1),
    577                                 array(1,0,0,0,0,0,0,0,1),
    578                                 array(0,1,0,0,0,0,0,1,0),
    579                                 array(0,1,0,0,0,0,0,1,0),
    580                                 array(0,0,1,0,0,0,1,0,0),
    581                                 array(0,0,0,1,0,1,0,0,0),
    582                                 array(0,0,0,1,0,1,0,0,0),
    583                                 array(0,0,0,0,1,0,0,0,0),
    584                                 array(0,0,0,1,0,1,0,0,0),
    585                                 array(0,0,0,1,0,1,0,0,0),
    586                                 array(0,0,1,0,0,0,1,0,0),
    587                                 array(0,1,0,0,0,0,1,0,0),
    588                                 array(0,1,0,0,0,0,0,1,0),
    589                                 array(1,0,0,0,0,0,0,0,1),
    590                                 array(1,0,0,0,0,0,0,0,1),
    591                         ),
    592                         'Y' => array(
    593                                 array(1,0,0,0,0,0,0,0,1),
    594                                 array(1,0,0,0,0,0,0,0,1),
    595                                 array(0,1,0,0,0,0,0,1,0),
    596                                 array(0,1,0,0,0,0,0,1,0),
    597                                 array(0,0,1,0,0,0,1,0,0),
    598                                 array(0,0,1,0,0,0,1,0,0),
    599                                 array(0,0,0,1,0,1,0,0,0),
    600                                 array(0,0,0,0,1,0,0,0,0),
    601                                 array(0,0,0,0,1,0,0,0,0),
    602                                 array(0,0,0,0,1,0,0,0,0),
    603                                 array(0,0,0,0,1,0,0,0,0),
    604                                 array(0,0,0,0,1,0,0,0,0),
    605                                 array(0,0,0,0,1,0,0,0,0),
    606                                 array(0,0,0,0,1,0,0,0,0),
    607                                 array(0,0,0,0,1,0,0,0,0),
    608                         ),
    609                         'Z' => array(    // New 'Z' supplied by Anon
    610                                 array(1,1,1,1,1,1,1,1,1),
    611                                 array(1,0,0,0,0,0,0,0,1),
    612                                 array(0,0,0,0,0,0,0,0,1),
    613                                 array(0,0,0,0,0,0,0,1,0),
    614                                 array(0,0,0,0,0,0,1,0,0),
    615                                 array(0,0,0,0,0,1,0,0,0),
    616                                 array(0,0,0,0,0,1,0,0,0),
    617                                 array(0,0,0,0,1,0,0,0,0),
    618                                 array(0,0,0,1,0,0,0,0,0),
    619                                 array(0,0,0,1,0,0,0,0,0),
    620                                 array(0,0,1,0,0,0,0,0,0),
    621                                 array(0,1,0,0,0,0,0,0,0),
    622                                 array(1,0,0,0,0,0,0,0,0),
    623                                 array(1,0,0,0,0,0,0,0,1),
    624                                 array(1,1,1,1,1,1,1,1,1),
    625                         ),
     1672                        'A' =>  $chars['A'][mt_rand(0, min(count($chars['A']), $config['captcha_gd_fonts']) -1)],
     1673                        'B' =>  $chars['B'][mt_rand(0, min(count($chars['B']), $config['captcha_gd_fonts']) -1)],
     1674                        'C' =>  $chars['C'][mt_rand(0, min(count($chars['C']), $config['captcha_gd_fonts']) -1)],
     1675                        'D' =>  $chars['D'][mt_rand(0, min(count($chars['D']), $config['captcha_gd_fonts']) -1)],
     1676                        'E' =>  $chars['E'][mt_rand(0, min(count($chars['E']), $config['captcha_gd_fonts']) -1)],
     1677                        'F' =>  $chars['F'][mt_rand(0, min(count($chars['F']), $config['captcha_gd_fonts']) -1)],
     1678                        'G' =>  $chars['G'][mt_rand(0, min(count($chars['G']), $config['captcha_gd_fonts']) -1)],
     1679                        'H' =>  $chars['H'][mt_rand(0, min(count($chars['H']), $config['captcha_gd_fonts']) -1)],
     1680                        'I' =>  $chars['I'][mt_rand(0, min(count($chars['I']), $config['captcha_gd_fonts']) -1)],
     1681                        'J' =>  $chars['J'][mt_rand(0, min(count($chars['J']), $config['captcha_gd_fonts']) -1)],
     1682                        'K' =>  $chars['K'][mt_rand(0, min(count($chars['K']), $config['captcha_gd_fonts']) -1)],
     1683                        'L' =>  $chars['L'][mt_rand(0, min(count($chars['L']), $config['captcha_gd_fonts']) -1)],
     1684                        'M' =>  $chars['M'][mt_rand(0, min(count($chars['M']), $config['captcha_gd_fonts']) -1)], 
     1685                        'N' =>  $chars['N'][mt_rand(0, min(count($chars['N']), $config['captcha_gd_fonts']) -1)],
     1686                        'O' =>  $chars['O'][mt_rand(0, min(count($chars['O']), $config['captcha_gd_fonts']) -1)],
     1687                        'P' =>  $chars['P'][mt_rand(0, min(count($chars['P']), $config['captcha_gd_fonts']) -1)],
     1688                        'Q' =>  $chars['Q'][mt_rand(0, min(count($chars['Q']), $config['captcha_gd_fonts']) -1)],
     1689                        'R' =>  $chars['R'][mt_rand(0, min(count($chars['R']), $config['captcha_gd_fonts']) -1)],
     1690                        'S' =>  $chars['S'][mt_rand(0, min(count($chars['S']), $config['captcha_gd_fonts']) -1)],
     1691                        'T' =>  $chars['T'][mt_rand(0, min(count($chars['T']), $config['captcha_gd_fonts']) -1)],
     1692                        'U' =>  $chars['U'][mt_rand(0, min(count($chars['U']), $config['captcha_gd_fonts']) -1)],
     1693                        'V' =>  $chars['V'][mt_rand(0, min(count($chars['V']), $config['captcha_gd_fonts']) -1)],
     1694                        'W' =>  $chars['W'][mt_rand(0, min(count($chars['W']), $config['captcha_gd_fonts']) -1)],
     1695                        'X' =>  $chars['X'][mt_rand(0, min(count($chars['X']), $config['captcha_gd_fonts']) -1)],
     1696                        'Y' =>  $chars['Y'][mt_rand(0, min(count($chars['Y']), $config['captcha_gd_fonts']) -1)],
     1697                        'Z' =>  $chars['Z'][mt_rand(0, min(count($chars['Z']), $config['captcha_gd_fonts']) -1)],
     1698
    6261699                        '1' => array(
    6271700                                array(0,0,0,1,1,0,0,0,0),
  • trunk/forum/includes/constants.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: constants.php 9187 2008-12-12 14:47:03Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2626
    2727// phpBB Version
    28 define('PHPBB_VERSION', '3.0.4');
     28define('PHPBB_VERSION', '3.0.7-PL1');
    2929
    3030// QA-related
     
    9292define('FORUM_FLAG_ACTIVE_TOPICS', 16);
    9393define('FORUM_FLAG_POST_REVIEW', 32);
     94define('FORUM_FLAG_QUICK_REPLY', 64);
     95
     96// Forum Options... sequential order. Modifications should begin at number 10 (number 29 is maximum)
     97define('FORUM_OPTION_FEED_NEWS', 1);
     98define('FORUM_OPTION_FEED_EXCLUDE', 2);
    9499
    95100// Optional text flags
     
    161166define('NUM_CORE_BBCODES', 12);
    162167
     168// Smiley hard limit
     169define('SMILEY_LIMIT', 1000);
     170
    163171// Magic url types
    164172define('MAGIC_URL_EMAIL', 1);
     
    185193@define('CHMOD_WRITE', 2);
    186194@define('CHMOD_EXECUTE', 1);
     195
     196// Captcha code length
     197define('CAPTCHA_MIN_CHARS', 4);
     198define('CAPTCHA_MAX_CHARS', 7);
    187199
    188200// Additional constants
  • trunk/forum/includes/db/db_tools.php

    r400 r702  
    33*
    44* @package dbal
    5 * @version $Id: db_tools.php 8814 2008-09-04 12:01:47Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2007 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3131        var $sql_layer = '';
    3232
     33        /**
     34        * @var object DB object
     35        */
     36        var $db = NULL;
     37
     38        /**
     39        * The Column types for every database we support
     40        * @var array
     41        */
    3342        var $dbms_type_map = array(
    3443                'mysql_41'      => array(
     
    243252        );
    244253
    245         // A list of types being unsigned for better reference in some db's
     254        /**
     255        * A list of types being unsigned for better reference in some db's
     256        * @var array
     257        */
    246258        var $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
     259
     260        /**
     261        * A list of supported DBMS. We change this class to support more DBMS, the DBMS itself only need to follow some rules.
     262        * @var array
     263        */
    247264        var $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite');
    248265
    249266        /**
    250         * Set this to true if you only want to return the 'to-be-executed' SQL statement(s) (as an array).
     267        * This is set to true if user only wants to return the 'to-be-executed' SQL statement(s) (as an array).
     268        * This mode has no effect on some methods (inserting of data for example). This is expressed within the methods command.
    251269        */
    252270        var $return_statements = false;
    253271
    254272        /**
    255         */
    256         function phpbb_db_tools(&$db)
     273        * Constructor. Set DB Object and set {@link $return_statements return_statements}.
     274        *
     275        * @param phpbb_dbal     $db                                     DBAL object
     276        * @param bool           $return_statements      True if only statements should be returned and no SQL being executed
     277        */
     278        function phpbb_db_tools(&$db, $return_statements = false)
    257279        {
    258280                $this->db = $db;
     281                $this->return_statements = $return_statements;
    259282
    260283                // Determine mapping database type
     
    289312                        break;
    290313                }
     314        }
     315
     316        /**
     317        * Check if table exists
     318        *
     319        *
     320        * @param string $table_name     The table name to check for
     321        * @return bool true if table exists, else false
     322        */
     323        function sql_table_exists($table_name)
     324        {
     325                $this->db->sql_return_on_error(true);
     326                $result = $this->db->sql_query_limit('SELECT * FROM ' . $table_name, 1);
     327                $this->db->sql_return_on_error(false);
     328
     329                if ($result)
     330                {
     331                        $this->db->sql_freeresult($result);
     332                        return true;
     333                }
     334
     335                return false;
     336        }
     337
     338        /**
     339        * Create SQL Table
     340        *
     341        * @param string $table_name     The table name to create
     342        * @param array  $table_data     Array containing table data.
     343        * @return array Statements if $return_statements is true.
     344        */
     345        function sql_create_table($table_name, $table_data)
     346        {
     347                // holds the DDL for a column
     348                $columns = $statements = array();
     349
     350                if ($this->sql_table_exists($table_name))
     351                {
     352                        return $this->_sql_run_sql($statements);
     353                }
     354
     355                // Begin transaction
     356                $statements[] = 'begin';
     357
     358                // Determine if we have created a PRIMARY KEY in the earliest
     359                $primary_key_gen = false;
     360
     361                // Determine if the table must be created with TEXTIMAGE
     362                $create_textimage = false;
     363
     364                // Determine if the table requires a sequence
     365                $create_sequence = false;
     366
     367                // Begin table sql statement
     368                switch ($this->sql_layer)
     369                {
     370                        case 'mssql':
     371                                $table_sql = 'CREATE TABLE [' . $table_name . '] (' . "\n";
     372                        break;
     373
     374                        default:
     375                                $table_sql = 'CREATE TABLE ' . $table_name . ' (' . "\n";
     376                        break;
     377                }
     378
     379                // Iterate through the columns to create a table
     380                foreach ($table_data['COLUMNS'] as $column_name => $column_data)
     381                {
     382                        // here lies an array, filled with information compiled on the column's data
     383                        $prepared_column = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
     384
     385                        // here we add the definition of the new column to the list of columns
     386                        switch ($this->sql_layer)
     387                        {
     388                                case 'mssql':
     389                                        $columns[] = "\t [{$column_name}] " . $prepared_column['column_type_sql_default'];
     390                                break;
     391
     392                                default:
     393                                        $columns[] = "\t {$column_name} " . $prepared_column['column_type_sql'];
     394                                break;
     395                        }
     396
     397                        // see if we have found a primary key set due to a column definition if we have found it, we can stop looking
     398                        if (!$primary_key_gen)
     399                        {
     400                                $primary_key_gen = isset($prepared_column['primary_key_set']) && $prepared_column['primary_key_set'];
     401                        }
     402
     403                        // create textimage DDL based off of the existance of certain column types
     404                        if (!$create_textimage)
     405                        {
     406                                $create_textimage = isset($prepared_column['textimage']) && $prepared_column['textimage'];
     407                        }
     408
     409                        // create sequence DDL based off of the existance of auto incrementing columns
     410                        if (!$create_sequence && isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'])
     411                        {
     412                                $create_sequence = $column_name;
     413                        }
     414                }
     415
     416                // this makes up all the columns in the create table statement
     417                $table_sql .= implode(",\n", $columns);
     418
     419                // Close the table for two DBMS and add to the statements
     420                switch ($this->sql_layer)
     421                {
     422                        case 'firebird':
     423                                $table_sql .= "\n);";
     424                                $statements[] = $table_sql;
     425                        break;
     426
     427                        case 'mssql':
     428                                $table_sql .= "\n) ON [PRIMARY]" . (($create_textimage) ? ' TEXTIMAGE_ON [PRIMARY]' : '');
     429                                $statements[] = $table_sql;
     430                        break;
     431                }
     432
     433                // we have yet to create a primary key for this table,
     434                // this means that we can add the one we really wanted instead
     435                if (!$primary_key_gen)
     436                {
     437                        // Write primary key
     438                        if (isset($table_data['PRIMARY_KEY']))
     439                        {
     440                                if (!is_array($table_data['PRIMARY_KEY']))
     441                                {
     442                                        $table_data['PRIMARY_KEY'] = array($table_data['PRIMARY_KEY']);
     443                                }
     444
     445                                switch ($this->sql_layer)
     446                                {
     447                                        case 'mysql_40':
     448                                        case 'mysql_41':
     449                                        case 'postgres':
     450                                        case 'sqlite':
     451                                                $table_sql .= ",\n\t PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
     452                                        break;
     453
     454                                        case 'firebird':
     455                                        case 'mssql':
     456                                                // We need the data here
     457                                                $old_return_statements = $this->return_statements;
     458                                                $this->return_statements = true;
     459
     460                                                $primary_key_stmts = $this->sql_create_primary_key($table_name, $table_data['PRIMARY_KEY']);
     461                                                foreach ($primary_key_stmts as $pk_stmt)
     462                                                {
     463                                                        $statements[] = $pk_stmt;
     464                                                }
     465
     466                                                $this->return_statements = $old_return_statements;
     467                                        break;
     468
     469                                        case 'oracle':
     470                                                $table_sql .= ",\n\t CONSTRAINT pk_{$table_name} PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
     471                                        break;
     472                                }
     473                        }
     474                }
     475
     476                // close the table
     477                switch ($this->sql_layer)
     478                {
     479                        case 'mysql_41':
     480                                // make sure the table is in UTF-8 mode
     481                                $table_sql .= "\n) CHARACTER SET `utf8` COLLATE `utf8_bin`;";
     482                                $statements[] = $table_sql;
     483                        break;
     484
     485                        case 'mysql_40':
     486                        case 'sqlite':
     487                                $table_sql .= "\n);";
     488                                $statements[] = $table_sql;
     489                        break;
     490
     491                        case 'postgres':
     492                                // do we need to add a sequence for auto incrementing columns?
     493                                if ($create_sequence)
     494                                {
     495                                        $statements[] = "CREATE SEQUENCE {$table_name}_seq;";
     496                                }
     497
     498                                $table_sql .= "\n);";
     499                                $statements[] = $table_sql;
     500                        break;
     501
     502                        case 'oracle':
     503                                $table_sql .= "\n);";
     504                                $statements[] = $table_sql;
     505
     506                                // do we need to add a sequence and a tigger for auto incrementing columns?
     507                                if ($create_sequence)
     508                                {
     509                                        // create the actual sequence
     510                                        $statements[] = "CREATE SEQUENCE {$table_name}_seq";
     511
     512                                        // the trigger is the mechanism by which we increment the counter
     513                                        $trigger = "CREATE OR REPLACE TRIGGER t_{$table_name}\n";
     514                                        $trigger .= "BEFORE INSERT ON {$table_name}\n";
     515                                        $trigger .= "FOR EACH ROW WHEN (\n";
     516                                        $trigger .= "\tnew.{$create_sequence} IS NULL OR new.{$create_sequence} = 0\n";
     517                                        $trigger .= ")\n";
     518                                        $trigger .= "BEGIN\n";
     519                                        $trigger .= "\tSELECT {$table_name}_seq.nextval\n";
     520                                        $trigger .= "\tINTO :new.{$create_sequence}\n";
     521                                        $trigger .= "\tFROM dual\n";
     522                                        $trigger .= "END;";
     523
     524                                        $statements[] = $trigger;
     525                                }
     526                        break;
     527
     528                        case 'firebird':
     529                                if ($create_sequence)
     530                                {
     531                                        $statements[] = "CREATE SEQUENCE {$table_name}_seq;";
     532                                }
     533                        break;
     534                }
     535
     536                // Write Keys
     537                if (isset($table_data['KEYS']))
     538                {
     539                        foreach ($table_data['KEYS'] as $key_name => $key_data)
     540                        {
     541                                if (!is_array($key_data[1]))
     542                                {
     543                                        $key_data[1] = array($key_data[1]);
     544                                }
     545
     546                                $old_return_statements = $this->return_statements;
     547                                $this->return_statements = true;
     548
     549                                $key_stmts = ($key_data[0] == 'UNIQUE') ? $this->sql_create_unique_index($table_name, $key_name, $key_data[1]) : $this->sql_create_index($table_name, $key_name, $key_data[1]);
     550
     551                                foreach ($key_stmts as $key_stmt)
     552                                {
     553                                        $statements[] = $key_stmt;
     554                                }
     555
     556                                $this->return_statements = $old_return_statements;
     557                        }
     558                }
     559
     560                // Commit Transaction
     561                $statements[] = 'commit';
     562
     563                return $this->_sql_run_sql($statements);
    291564        }
    292565
     
    309582        *               )
    310583        *
    311         * For more information have a look at /develop/create_schema_files.php (only available through CVS)
     584        * For more information have a look at /develop/create_schema_files.php (only available through SVN)
    312585        */
    313586        function perform_schema_changes($schema_changes)
     
    319592
    320593                $statements = array();
     594                $sqlite = false;
     595
     596                // For SQLite we need to perform the schema changes in a much more different way
     597                if ($this->db->sql_layer == 'sqlite' && $this->return_statements)
     598                {
     599                        $sqlite_data = array();
     600                        $sqlite = true;
     601                }
    321602
    322603                // Change columns?
     
    327608                                foreach ($columns as $column_name => $column_data)
    328609                                {
    329                                         $result = $this->sql_column_change($table, $column_name, $column_data);
    330 
    331                                         if ($this->return_statements)
     610                                        // If the column exists we change it, else we add it ;)
     611                                        if ($column_exists = $this->sql_column_exists($table, $column_name))
     612                                        {
     613                                                $result = $this->sql_column_change($table, $column_name, $column_data, true);
     614                                        }
     615                                        else
     616                                        {
     617                                                $result = $this->sql_column_add($table, $column_name, $column_data, true);
     618                                        }
     619
     620                                        if ($sqlite)
     621                                        {
     622                                                if ($column_exists)
     623                                                {
     624                                                        $sqlite_data[$table]['change_columns'][] = $result;
     625                                                }
     626                                                else
     627                                                {
     628                                                        $sqlite_data[$table]['add_columns'][] = $result;
     629                                                }
     630                                        }
     631                                        else if ($this->return_statements)
    332632                                        {
    333633                                                $statements = array_merge($statements, $result);
     
    344644                                foreach ($columns as $column_name => $column_data)
    345645                                {
    346                                         // Only add the column if it does not exist yet
    347                                         if (!$this->sql_column_exists($table, $column_name))
    348                                         {
    349                                                 $result = $this->sql_column_add($table, $column_name, $column_data);
    350 
    351                                                 if ($this->return_statements)
     646                                        // Only add the column if it does not exist yet, else change it (to be consistent)
     647                                        if ($column_exists = $this->sql_column_exists($table, $column_name))
     648                                        {
     649                                                $result = $this->sql_column_change($table, $column_name, $column_data, true);
     650                                        }
     651                                        else
     652                                        {
     653                                                $result = $this->sql_column_add($table, $column_name, $column_data, true);
     654                                        }
     655
     656                                        if ($sqlite)
     657                                        {
     658                                                if ($column_exists)
     659                                                {
     660                                                        $sqlite_data[$table]['change_columns'][] = $result;
     661                                                }
     662                                                else
     663                                                {
     664                                                        $sqlite_data[$table]['add_columns'][] = $result;
     665                                                }
     666                                        }
     667                                        else if ($this->return_statements)
     668                                        {
     669                                                $statements = array_merge($statements, $result);
     670                                        }
     671                                }
     672                        }
     673                }
     674
     675                // Remove keys?
     676                if (!empty($schema_changes['drop_keys']))
     677                {
     678                        foreach ($schema_changes['drop_keys'] as $table => $indexes)
     679                        {
     680                                foreach ($indexes as $index_name)
     681                                {
     682                                        $result = $this->sql_index_drop($table, $index_name);
     683
     684                                        if ($this->return_statements)
     685                                        {
     686                                                $statements = array_merge($statements, $result);
     687                                        }
     688                                }
     689                        }
     690                }
     691
     692                // Drop columns?
     693                if (!empty($schema_changes['drop_columns']))
     694                {
     695                        foreach ($schema_changes['drop_columns'] as $table => $columns)
     696                        {
     697                                foreach ($columns as $column)
     698                                {
     699                                        // Only remove the column if it exists...
     700                                        if ($this->sql_column_exists($table, $column))
     701                                        {
     702                                                $result = $this->sql_column_remove($table, $column, true);
     703
     704                                                if ($sqlite)
     705                                                {
     706                                                        $sqlite_data[$table]['drop_columns'][] = $result;
     707                                                }
     708                                                else if ($this->return_statements)
    352709                                                {
    353710                                                        $statements = array_merge($statements, $result);
     
    358715                }
    359716
    360                 // Remove keys?
    361                 if (!empty($schema_changes['drop_keys']))
    362                 {
    363                         foreach ($schema_changes['drop_keys'] as $table => $indexes)
    364                         {
    365                                 foreach ($indexes as $index_name)
    366                                 {
    367                                         $result = $this->sql_index_drop($table, $index_name);
    368 
    369                                         if ($this->return_statements)
    370                                         {
    371                                                 $statements = array_merge($statements, $result);
    372                                         }
    373                                 }
    374                         }
    375                 }
    376 
    377                 // Drop columns?
    378                 if (!empty($schema_changes['drop_columns']))
    379                 {
    380                         foreach ($schema_changes['drop_columns'] as $table => $columns)
    381                         {
    382                                 foreach ($columns as $column)
    383                                 {
    384                                         $result = $this->sql_column_remove($table, $column);
    385 
    386                                         if ($this->return_statements)
    387                                         {
    388                                                 $statements = array_merge($statements, $result);
    389                                         }
    390                                 }
    391                         }
    392                 }
    393 
    394717                // Add primary keys?
    395718                if (!empty($schema_changes['add_primary_keys']))
     
    397720                        foreach ($schema_changes['add_primary_keys'] as $table => $columns)
    398721                        {
    399                                 $result = $this->sql_create_primary_key($table, $columns);
    400 
    401                                 if ($this->return_statements)
     722                                $result = $this->sql_create_primary_key($table, $columns, true);
     723
     724                                if ($sqlite)
     725                                {
     726                                        $sqlite_data[$table]['primary_key'] = $result;
     727                                }
     728                                else if ($this->return_statements)
    402729                                {
    403730                                        $statements = array_merge($statements, $result);
     
    440767                }
    441768
     769                if ($sqlite)
     770                {
     771                        foreach ($sqlite_data as $table_name => $sql_schema_changes)
     772                        {
     773                                // Create temporary table with original data
     774                                $statements[] = 'begin';
     775
     776                                $sql = "SELECT sql
     777                                        FROM sqlite_master
     778                                        WHERE type = 'table'
     779                                                AND name = '{$table_name}'
     780                                        ORDER BY type DESC, name;";
     781                                $result = $this->db->sql_query($sql);
     782
     783                                if (!$result)
     784                                {
     785                                        continue;
     786                                }
     787
     788                                $row = $this->db->sql_fetchrow($result);
     789                                $this->db->sql_freeresult($result);
     790
     791                                // Create a backup table and populate it, destroy the existing one
     792                                $statements[] = preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql']);
     793                                $statements[] = 'INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name;
     794                                $statements[] = 'DROP TABLE ' . $table_name;
     795
     796                                // Get the columns...
     797                                preg_match('#\((.*)\)#s', $row['sql'], $matches);
     798
     799                                $plain_table_cols = trim($matches[1]);
     800                                $new_table_cols = preg_split('/,(?![\s\w]+\))/m', $plain_table_cols);
     801                                $column_list = array();
     802
     803                                foreach ($new_table_cols as $declaration)
     804                                {
     805                                        $entities = preg_split('#\s+#', trim($declaration));
     806                                        if ($entities[0] == 'PRIMARY')
     807                                        {
     808                                                continue;
     809                                        }
     810                                        $column_list[] = $entities[0];
     811                                }
     812
     813                                // note down the primary key notation because sqlite only supports adding it to the end for the new table
     814                                $primary_key = false;
     815                                $_new_cols = array();
     816
     817                                foreach ($new_table_cols as $key => $declaration)
     818                                {
     819                                        $entities = preg_split('#\s+#', trim($declaration));
     820                                        if ($entities[0] == 'PRIMARY')
     821                                        {
     822                                                $primary_key = $declaration;
     823                                                continue;
     824                                        }
     825                                        $_new_cols[] = $declaration;
     826                                }
     827
     828                                $new_table_cols = $_new_cols;
     829
     830                                // First of all... change columns
     831                                if (!empty($sql_schema_changes['change_columns']))
     832                                {
     833                                        foreach ($sql_schema_changes['change_columns'] as $column_sql)
     834                                        {
     835                                                foreach ($new_table_cols as $key => $declaration)
     836                                                {
     837                                                        $entities = preg_split('#\s+#', trim($declaration));
     838                                                        if (strpos($column_sql, $entities[0] . ' ') === 0)
     839                                                        {
     840                                                                $new_table_cols[$key] = $column_sql;
     841                                                        }
     842                                                }
     843                                        }
     844                                }
     845
     846                                if (!empty($sql_schema_changes['add_columns']))
     847                                {
     848                                        foreach ($sql_schema_changes['add_columns'] as $column_sql)
     849                                        {
     850                                                $new_table_cols[] = $column_sql;
     851                                        }
     852                                }
     853
     854                                // Now drop them...
     855                                if (!empty($sql_schema_changes['drop_columns']))
     856                                {
     857                                        foreach ($sql_schema_changes['drop_columns'] as $column_name)
     858                                        {
     859                                                // Remove from column list...
     860                                                $new_column_list = array();
     861                                                foreach ($column_list as $key => $value)
     862                                                {
     863                                                        if ($value === $column_name)
     864                                                        {
     865                                                                continue;
     866                                                        }
     867
     868                                                        $new_column_list[] = $value;
     869                                                }
     870
     871                                                $column_list = $new_column_list;
     872
     873                                                // Remove from table...
     874                                                $_new_cols = array();
     875                                                foreach ($new_table_cols as $key => $declaration)
     876                                                {
     877                                                        $entities = preg_split('#\s+#', trim($declaration));
     878                                                        if (strpos($column_name . ' ', $entities[0] . ' ') === 0)
     879                                                        {
     880                                                                continue;
     881                                                        }
     882                                                        $_new_cols[] = $declaration;
     883                                                }
     884                                                $new_table_cols = $_new_cols;
     885                                        }
     886                                }
     887
     888                                // Primary key...
     889                                if (!empty($sql_schema_changes['primary_key']))
     890                                {
     891                                        $new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')';
     892                                }
     893                                // Add a new one or the old primary key
     894                                else if ($primary_key !== false)
     895                                {
     896                                        $new_table_cols[] = $primary_key;
     897                                }
     898
     899                                $columns = implode(',', $column_list);
     900
     901                                // create a new table and fill it up. destroy the temp one
     902                                $statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');';
     903                                $statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
     904                                $statements[] = 'DROP TABLE ' . $table_name . '_temp';
     905
     906                                $statements[] = 'commit';
     907                        }
     908                }
     909
    442910                if ($this->return_statements)
    443911                {
     
    448916        /**
    449917        * Check if a specified column exist
     918        *
     919        * @param string $table                  Table to check the column at
     920        * @param string $column_name    The column to check
     921        *
    450922        * @return bool True if column exists, else false
    451923        */
     
    520992                                $sql = "SELECT column_name
    521993                                        FROM user_tab_columns
    522                                         WHERE table_name = '{$table}'";
     994                                        WHERE LOWER(table_name) = '" . strtolower($table) . "'";
    523995                                $result = $this->db->sql_query($sql);
    524996                                while ($row = $this->db->sql_fetchrow($result))
     
    5381010                                $sql = "SELECT RDB\$FIELD_NAME as FNAME
    5391011                                        FROM RDB\$RELATION_FIELDS
    540                                         WHERE RDB\$RELATION_NAME = '{$table}'";
     1012                                        WHERE RDB\$RELATION_NAME = '" . strtoupper($table) . "'";
    5411013                                $result = $this->db->sql_query($sql);
    5421014                                while ($row = $this->db->sql_fetchrow($result))
     
    6331105                {
    6341106                        list($orig_column_type, $column_length) = explode(':', $column_data[0]);
    635 
    6361107                        if (!is_array($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':']))
    6371108                        {
     
    6921163                        case 'firebird':
    6931164                                $sql .= " {$column_type} ";
     1165                                $return_array['column_type_sql_type'] = " {$column_type} ";
    6941166
    6951167                                if (!is_null($column_data[1]))
    6961168                                {
    6971169                                        $sql .= 'DEFAULT ' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
     1170                                        $return_array['column_type_sql_default'] = ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ' ';
    6981171                                }
    6991172
     
    7041177                                {
    7051178                                        $sql .= ' COLLATE UNICODE';
     1179                                }
     1180
     1181                                $return_array['auto_increment'] = false;
     1182                                if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
     1183                                {
     1184                                        $return_array['auto_increment'] = true;
    7061185                                }
    7071186
     
    7181197                                        if (strpos($column_data[1], '0x') === 0)
    7191198                                        {
    720                                                 $sql_default .= 'DEFAULT (' . $column_data[1] . ') ';
     1199                                                $return_array['default'] = 'DEFAULT (' . $column_data[1] . ') ';
     1200                                                $sql_default .= $return_array['default'];
    7211201                                        }
    7221202                                        else
    7231203                                        {
    724                                                 $sql_default .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
    725                                         }
    726                                 }
     1204                                                $return_array['default'] = 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
     1205                                                $sql_default .= $return_array['default'];
     1206                                        }
     1207                                }
     1208
     1209                                if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
     1210                                {
     1211//                                      $sql .= 'IDENTITY (1, 1) ';
     1212                                        $sql_default .= 'IDENTITY (1, 1) ';
     1213                                }
     1214
     1215                                $return_array['textimage'] = $column_type === '[text]';
    7271216
    7281217                                $sql .= 'NOT NULL';
     
    7301219
    7311220                                $return_array['column_type_sql_default'] = $sql_default;
     1221
    7321222                        break;
    7331223
     
    7641254                                // Therefore in oracle we allow NULL's for all DEFAULT '' entries
    7651255                                // Oracle does not like setting NOT NULL on a column that is already NOT NULL (this happens only on number fields)
    766                                 if (preg_match('/number/i', $column_type))
     1256                                if (!preg_match('/number/i', $column_type))
    7671257                                {
    7681258                                        $sql .= ($column_data[1] === '') ? '' : 'NOT NULL';
    7691259                                }
     1260
     1261                                $return_array['auto_increment'] = false;
     1262                                if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
     1263                                {
     1264                                        $return_array['auto_increment'] = true;
     1265                                }
     1266
    7701267                        break;
    7711268
     
    7751272                                $sql .= " {$column_type} ";
    7761273
     1274                                $return_array['auto_increment'] = false;
    7771275                                if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
    7781276                                {
    7791277                                        $default_val = "nextval('{$table_name}_seq')";
     1278                                        $return_array['auto_increment'] = true;
    7801279                                }
    7811280                                else if (!is_null($column_data[1]))
     
    7961295                                        $sql .= " CHECK ({$column_name} >= 0)";
    7971296                                }
     1297
    7981298                        break;
    7991299
    8001300                        case 'sqlite':
     1301                                $return_array['primary_key_set'] = false;
    8011302                                if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
    8021303                                {
    8031304                                        $sql .= ' INTEGER PRIMARY KEY';
     1305                                        $return_array['primary_key_set'] = true;
    8041306                                }
    8051307                                else
     
    8101312                                $sql .= ' NOT NULL ';
    8111313                                $sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}'" : '';
     1314
    8121315                        break;
    8131316                }
     
    8211324        * Add new column
    8221325        */
    823         function sql_column_add($table_name, $column_name, $column_data)
     1326        function sql_column_add($table_name, $column_name, $column_data, $inline = false)
    8241327        {
    8251328                $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
     
    8291332                {
    8301333                        case 'firebird':
    831                                 $statements[] = 'ALTER TABLE "' . $table_name . '" ADD "' . $column_name . '" ' . $column_data['column_type_sql'];
     1334                                $statements[] = 'ALTER TABLE ' . $table_name . ' ADD "' . strtoupper($column_name) . '" ' . $column_data['column_type_sql'];
    8321335                        break;
    8331336
     
    8461349
    8471350                        case 'postgres':
    848                                 $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
     1351                                if (version_compare($this->db->sql_server_info(true), '8.0', '>='))
     1352                                {
     1353                                        $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
     1354                                }
     1355                                else
     1356                                {
     1357                                        // old versions cannot add columns with default and null information
     1358                                        $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type'] . ' ' . $column_data['constraint'];
     1359
     1360                                        if (isset($column_data['null']))
     1361                                        {
     1362                                                if ($column_data['null'] == 'NOT NULL')
     1363                                                {
     1364                                                        $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET NOT NULL';
     1365                                                }
     1366                                        }
     1367
     1368                                        if (isset($column_data['default']))
     1369                                        {
     1370                                                $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
     1371                                        }
     1372                                }
     1373
    8491374                        break;
    8501375
    8511376                        case 'sqlite':
     1377
     1378                                if ($inline && $this->return_statements)
     1379                                {
     1380                                        return $column_name . ' ' . $column_data['column_type_sql'];
     1381                                }
     1382
    8521383                                if (version_compare(sqlite_libversion(), '3.0') == -1)
    8531384                                {
     
    9141445        * Drop column
    9151446        */
    916         function sql_column_remove($table_name, $column_name)
     1447        function sql_column_remove($table_name, $column_name, $inline = false)
    9171448        {
    9181449                $statements = array();
     
    9211452                {
    9221453                        case 'firebird':
    923                                 $statements[] = 'ALTER TABLE "' . $table_name . '" DROP "' . $column_name . '"';
     1454                                $statements[] = 'ALTER TABLE ' . $table_name . ' DROP "' . strtoupper($column_name) . '"';
    9241455                        break;
    9251456
     
    9421473
    9431474                        case 'sqlite':
     1475
     1476                                if ($inline && $this->return_statements)
     1477                                {
     1478                                        return $column_name;
     1479                                }
     1480
    9441481                                if (version_compare(sqlite_libversion(), '3.0') == -1)
    9451482                                {
     
    9841521                                        $columns = implode(',', $column_list);
    9851522
    986                                         $new_table_cols = $new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols);
     1523                                        $new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols);
    9871524
    9881525                                        // create a new table and fill it up. destroy the temp one
     
    10331570
    10341571        /**
    1035         * Add primary key
    1036         */
    1037         function sql_create_primary_key($table_name, $column)
     1572        * Drop Table
     1573        */
     1574        function sql_table_drop($table_name)
    10381575        {
    10391576                $statements = array();
    10401577
     1578                if (!$this->sql_table_exists($table_name))
     1579                {
     1580                        return $this->_sql_run_sql($statements);
     1581                }
     1582
     1583                // the most basic operation, get rid of the table
     1584                $statements[] = 'DROP TABLE ' . $table_name;
     1585
     1586                switch ($this->sql_layer)
     1587                {
     1588                        case 'firebird':
     1589                                $sql = 'SELECT RDB$GENERATOR_NAME as gen
     1590                                        FROM RDB$GENERATORS
     1591                                        WHERE RDB$SYSTEM_FLAG = 0
     1592                                                AND RDB$GENERATOR_NAME = \'' . strtoupper($table_name) . "_GEN'";
     1593                                $result = $this->db->sql_query($sql);
     1594
     1595                                // does a generator exist?
     1596                                if ($row = $this->db->sql_fetchrow($result))
     1597                                {
     1598                                        $statements[] = "DROP GENERATOR {$row['gen']};";
     1599                                }
     1600                                $this->db->sql_freeresult($result);
     1601                        break;
     1602
     1603                        case 'oracle':
     1604                                $sql = 'SELECT A.REFERENCED_NAME
     1605                                        FROM USER_DEPENDENCIES A, USER_TRIGGERS B
     1606                                        WHERE A.REFERENCED_TYPE = \'SEQUENCE\'
     1607                                                AND A.NAME = B.TRIGGER_NAME
     1608                                                AND B.TABLE_NAME = \'' . strtoupper($table_name) . "'";
     1609                                $result = $this->db->sql_query($sql);
     1610
     1611                                // any sequences ref'd to this table's triggers?
     1612                                while ($row = $this->db->sql_fetchrow($result))
     1613                                {
     1614                                        $statements[] = "DROP SEQUENCE {$row['referenced_name']}";
     1615                                }
     1616                                $this->db->sql_freeresult($result);
     1617
     1618                        case 'postgres':
     1619                                // PGSQL does not "tightly" bind sequences and tables, we must guess...
     1620                                $sql = "SELECT relname
     1621                                        FROM pg_class
     1622                                        WHERE relkind = 'S'
     1623                                                AND relname = '{$table_name}_seq'";
     1624                                $result = $this->db->sql_query($sql);
     1625
     1626                                // We don't even care about storing the results. We already know the answer if we get rows back.
     1627                                if ($this->db->sql_fetchrow($result))
     1628                                {
     1629                                        $statements[] =  "DROP SEQUENCE {$table_name}_seq;\n";
     1630                                }
     1631                                $this->db->sql_freeresult($result);
     1632                        break;
     1633                }
     1634
     1635                return $this->_sql_run_sql($statements);
     1636        }
     1637
     1638        /**
     1639        * Add primary key
     1640        */
     1641        function sql_create_primary_key($table_name, $column, $inline = false)
     1642        {
     1643                $statements = array();
     1644
    10411645                switch ($this->sql_layer)
    10421646                {
    10431647                        case 'firebird':
    10441648                        case 'postgres':
     1649                        case 'mysql_40':
     1650                        case 'mysql_41':
    10451651                                $statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
    10461652                        break;
     
    10551661                        break;
    10561662
    1057                         case 'mysql_40':
    1058                         case 'mysql_41':
    1059                                 $statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
    1060                         break;
    1061 
    10621663                        case 'oracle':
    10631664                                $statements[] = 'ALTER TABLE ' . $table_name . 'add CONSTRAINT pk_' . $table_name . ' PRIMARY KEY (' . implode(', ', $column) . ')';
     
    10651666
    10661667                        case 'sqlite':
     1668
     1669                                if ($inline && $this->return_statements)
     1670                                {
     1671                                        return $column;
     1672                                }
     1673
    10671674                                $sql = "SELECT sql
    10681675                                        FROM sqlite_master
     
    12051812                                        $sql = "SELECT LOWER(RDB\$INDEX_NAME) as index_name
    12061813                                                FROM RDB\$INDICES
    1207                                                 WHERE RDB\$RELATION_NAME = " . strtoupper($table_name) . "
     1814                                                WHERE RDB\$RELATION_NAME = '" . strtoupper($table_name) . "'
    12081815                                                        AND RDB\$UNIQUE_FLAG IS NULL
    12091816                                                        AND RDB\$FOREIGN_KEY IS NULL";
     
    12321839                                        $sql = "SELECT index_name
    12331840                                                FROM user_indexes
    1234                                                 WHERE table_name = '" . $table_name . "'
    1235                                                         AND generated = 'N'";
     1841                                                WHERE table_name = '" . strtoupper($table_name) . "'
     1842                                                        AND generated = 'N'
     1843                                                        AND uniqueness = 'NONUNIQUE'";
     1844                                        $col = 'index_name';
    12361845                                break;
    12371846
     
    12711880        * Change column type (not name!)
    12721881        */
    1273         function sql_column_change($table_name, $column_name, $column_data)
     1882        function sql_column_change($table_name, $column_name, $column_data, $inline = false)
    12741883        {
    12751884                $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
     
    12801889                        case 'firebird':
    12811890                                // Change type...
    1282                                 $statements[] = 'ALTER TABLE "' . $table_name . '" ALTER COLUMN "' . $column_name . '" TYPE ' . ' ' . $column_data['column_type_sql'];
     1891                                if (!empty($column_data['column_type_sql_default']))
     1892                                {
     1893                                        $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type'];
     1894                                        $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" SET DEFAULT ' . ' ' . $column_data['column_type_sql_default'];
     1895                                }
     1896                                else
     1897                                {
     1898                                        $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN "' . strtoupper($column_name) . '" TYPE ' . ' ' . $column_data['column_type_sql_type'];
     1899                                }
    12831900                        break;
    12841901
    12851902                        case 'mssql':
    12861903                                $statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
     1904
     1905                                if (!empty($column_data['default']))
     1906                                {
     1907                                        // Using TRANSACT-SQL for this statement because we do not want to have colliding data if statements are executed at a later stage
     1908                                        $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
     1909                                                SET @drop_default_name =
     1910                                                        (SELECT so.name FROM sysobjects so
     1911                                                        JOIN sysconstraints sc ON so.id = sc.constid
     1912                                                        WHERE object_name(so.parent_obj) = '{$table_name}'
     1913                                                                AND so.xtype = 'D'
     1914                                                                AND sc.colid = (SELECT colid FROM syscolumns
     1915                                                                        WHERE id = object_id('{$table_name}')
     1916                                                                                AND name = '{$column_name}'))
     1917                                                IF @drop_default_name <> ''
     1918                                                BEGIN
     1919                                                        SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
     1920                                                        EXEC(@cmd)
     1921                                                END
     1922                                                SET @cmd = 'ALTER TABLE [{$table_name}] ADD CONSTRAINT [DF_{$table_name}_{$column_name}_1] {$column_data['default']} FOR [{$column_name}]'
     1923                                                EXEC(@cmd)";
     1924                                }
    12871925                        break;
    12881926
     
    13611999                        case 'sqlite':
    13622000
     2001                                if ($inline && $this->return_statements)
     2002                                {
     2003                                        return $column_name . ' ' . $column_data['column_type_sql'];
     2004                                }
     2005
    13632006                                $sql = "SELECT sql
    13642007                                        FROM sqlite_master
  • trunk/forum/includes/db/dbal.php

    r400 r702  
    33*
    44* @package dbal
    5 * @version $Id: dbal.php 9178 2008-12-06 11:11:10Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    236236        function sql_like_expression($expression)
    237237        {
    238                 $expression = str_replace(array('_', '%'), array("\_", "\%"), $expression);
    239                 $expression = str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
     238                $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression);
     239                $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
    240240
    241241                return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\'');
     
    413413
    414414        /**
     415        * Run binary AND operator on DB column.
     416        * Results in sql statement: "{$column_name} & (1 << {$bit}) {$compare}"
     417        *
     418        * @param string $column_name The column name to use
     419        * @param int $bit The value to use for the AND operator, will be converted to (1 << $bit). Is used by options, using the number schema... 0, 1, 2...29
     420        * @param string $compare Any custom SQL code after the check (for example "= 0")
     421        */
     422        function sql_bit_and($column_name, $bit, $compare = '')
     423        {
     424                if (method_exists($this, '_sql_bit_and'))
     425                {
     426                        return $this->_sql_bit_and($column_name, $bit, $compare);
     427                }
     428
     429                return $column_name . ' & ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
     430        }
     431
     432        /**
     433        * Run binary OR operator on DB column.
     434        * Results in sql statement: "{$column_name} | (1 << {$bit}) {$compare}"
     435        *
     436        * @param string $column_name The column name to use
     437        * @param int $bit The value to use for the OR operator, will be converted to (1 << $bit). Is used by options, using the number schema... 0, 1, 2...29
     438        * @param string $compare Any custom SQL code after the check (for example "= 0")
     439        */
     440        function sql_bit_or($column_name, $bit, $compare = '')
     441        {
     442                if (method_exists($this, '_sql_bit_or'))
     443                {
     444                        return $this->_sql_bit_or($column_name, $bit, $compare);
     445                }
     446
     447                return $column_name . ' | ' . (1 << $bit) . (($compare) ? ' ' . $compare : '');
     448        }
     449
     450        /**
    415451        * Run more than one insert statement.
    416452        *
     
    436472                                if (!is_array($_sql_ary))
    437473                                {
    438                                         $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary));
    439                                         return true;
     474                                        return $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $sql_ary));
    440475                                }
    441476
     
    448483                        }
    449484
    450                         $this->sql_query('INSERT INTO ' . $table . ' ' . ' (' . implode(', ', array_keys($sql_ary[0])) . ') VALUES ' . implode(', ', $ary));
     485                        return $this->sql_query('INSERT INTO ' . $table . ' ' . ' (' . implode(', ', array_keys($sql_ary[0])) . ') VALUES ' . implode(', ', $ary));
    451486                }
    452487                else
     
    459494                                }
    460495
    461                                 $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $ary));
     496                                $result = $this->sql_query('INSERT INTO ' . $table . ' ' . $this->sql_build_array('INSERT', $ary));
     497
     498                                if (!$result)
     499                                {
     500                                        return false;
     501                                }
    462502                        }
    463503                }
  • trunk/forum/includes/db/firebird.php

    r400 r702  
    33*
    44* @package dbal
    5 * @version $Id: firebird.php 8967 2008-10-02 12:04:12Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2121/**
    2222* Firebird/Interbase Database Abstraction Layer
    23 * Minimum Requirement is Firebird 2.0
     23* Minimum Requirement is Firebird 2.1
    2424* @package dbal
    2525*/
     
    7373                }
    7474
    75                 return ($raw) ? '2.0' : 'Firebird/Interbase';
     75                return ($raw) ? '2.1' : 'Firebird/Interbase';
    7676        }
    7777
     
    447447        }
    448448
     449        function _sql_bit_and($column_name, $bit, $compare = '')
     450        {
     451                return 'BIN_AND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
     452        }
     453
     454        function _sql_bit_or($column_name, $bit, $compare = '')
     455        {
     456                return 'BIN_OR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
     457        }
     458
    449459        /**
    450460        * return sql error array
  • trunk/forum/includes/db/mysql.php

    r400 r702  
    33*
    44* @package dbal
    5 * @version $Id: mysql.php 8815 2008-09-04 13:37:01Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4545                $this->sql_layer = 'mysql4';
    4646
    47                 $this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword, $new_link) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
     47                $this->db_connect_id = ($this->persistency) ? @mysql_pconnect($this->server, $this->user, $sqlpassword) : @mysql_connect($this->server, $this->user, $sqlpassword, $new_link);
    4848
    4949                if ($this->db_connect_id && $this->dbname != '')
     
    5252                        {
    5353                                // Determine what version we are using and if it natively supports UNICODE
    54                                 if (version_compare($this->sql_server_info(true), '4.1.3', '>='))
     54                                if (version_compare($this->sql_server_info(true), '4.1.0', '>='))
    5555                                {
    5656                                        @mysql_query("SET NAMES 'utf8'", $this->db_connect_id);
     
    342342                return $data;
    343343        }
    344        
     344
    345345        /**
    346346        * return sql error array
  • trunk/forum/includes/db/oracle.php

    r400 r702  
    33*
    44* @package dbal
    5 * @version $Id: oracle.php 9175 2008-12-05 11:18:59Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    137137        function _rewrite_where($where_clause)
    138138        {
    139                 preg_match_all('/\s*(AND|OR)?\s*([\w_.]++)\s*(?:(=|<[=>]?|>=?)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER);
     139                preg_match_all('/\s*(AND|OR)?\s*([\w_.()]++)\s*(?:(=|<[=>]?|>=?|LIKE)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.()]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER);
    140140                $out = '';
    141141                foreach ($result as $val)
     
    256256                                if (strlen($query) > 4000)
    257257                                {
    258                                         if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/s', $query, $regs))
     258                                        if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/sU', $query, $regs))
    259259                                        {
    260260                                                if (strlen($regs[3]) > 4000)
    261261                                                {
    262262                                                        $cols = explode(', ', $regs[2]);
     263
    263264                                                        preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER);
     265
     266                                                        if (sizeof($cols) !== sizeof($vals))
     267                                                        {
     268                                                                // Try to replace some common data we know is from our restore script or from other sources
     269                                                                $regs[3] = str_replace("'||chr(47)||'", '/', $regs[3]);
     270                                                                $_vals = explode(', ', $regs[3]);
     271
     272                                                                $vals = array();
     273                                                                $is_in_val = false;
     274                                                                $i = 0;
     275                                                                $string = '';
     276
     277                                                                foreach ($_vals as $value)
     278                                                                {
     279                                                                        if (strpos($value, "'") === false && !$is_in_val)
     280                                                                        {
     281                                                                                $vals[$i++] = $value;
     282                                                                                continue;
     283                                                                        }
     284
     285                                                                        if (substr($value, -1) === "'")
     286                                                                        {
     287                                                                                $vals[$i] = $string . (($is_in_val) ? ', ' : '') . $value;
     288                                                                                $string = '';
     289                                                                                $is_in_val = false;
     290
     291                                                                                if ($vals[$i][0] !== "'")
     292                                                                                {
     293                                                                                        $vals[$i] = "''" . $vals[$i];
     294                                                                                }
     295                                                                                $i++;
     296                                                                                continue;
     297                                                                        }
     298                                                                        else
     299                                                                        {
     300                                                                                $string .= (($is_in_val) ? ', ' : '') . $value;
     301                                                                                $is_in_val = true;
     302                                                                        }
     303                                                                }
     304
     305                                                                if ($string)
     306                                                                {
     307                                                                        // New value if cols != value
     308                                                                        $vals[(sizeof($cols) !== sizeof($vals)) ? $i : $i - 1] .= $string;
     309                                                                }
     310
     311                                                                $vals = array(0 => $vals);
     312                                                        }
    264313
    265314                                                        $inserts = $vals[0];
     
    569618        }
    570619
     620        function _sql_bit_and($column_name, $bit, $compare = '')
     621        {
     622                return 'BITAND(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
     623        }
     624
     625        function _sql_bit_or($column_name, $bit, $compare = '')
     626        {
     627                return 'BITOR(' . $column_name . ', ' . (1 << $bit) . ')' . (($compare) ? ' ' . $compare : '');
     628        }
     629
    571630        /**
    572631        * return sql error array
  • trunk/forum/includes/db/postgres.php

    r400 r702  
    33*
    44* @package dbal
    5 * @version $Id: postgres.php 8814 2008-09-04 12:01:47Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2727{
    2828        var $last_query_text = '';
    29        
     29
    3030        /**
    3131        * Connect to server
     
    5656                                $connect_string .= "host=$sqlserver ";
    5757                        }
    58                
     58
    5959                        if ($port)
    6060                        {
     
    225225                if ($total == 0)
    226226                {
    227                         $total = -1;
     227                        $total = 'ALL';
    228228                }
    229229
  • trunk/forum/includes/diff/diff.php

    r400 r702  
    33*
    44* @package diff
    5 * @version $Id: diff.php 8765 2008-08-16 22:18:25Z aptx $
     5* @version $Id$
    66* @copyright (c) 2006 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    1818
    1919/**
    20 * Code from pear.php.net, Text_Diff-1.0.0 package
     20* Code from pear.php.net, Text_Diff-1.1.0 package
    2121* http://pear.php.net/package/Text_Diff/
    2222*
     
    5959        {
    6060                return $this->_edits;
     61        }
     62
     63        /**
     64        * returns the number of new (added) lines in a given diff.
     65        *
     66        * @since Text_Diff 1.1.0
     67        *
     68        * @return integer The number of new lines
     69        */
     70        function count_added_lines()
     71        {
     72                $count = 0;
     73
     74                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     75                {
     76                        $edit = $this->_edits[$i];
     77
     78                        if (is_a($edit, 'diff_op_add') || is_a($edit, 'diff_op_change'))
     79                        {
     80                                $count += $edit->nfinal();
     81                        }
     82                }
     83                return $count;
     84        }
     85
     86        /**
     87        * Returns the number of deleted (removed) lines in a given diff.
     88        *
     89        * @since Text_Diff 1.1.0
     90        *
     91        * @return integer The number of deleted lines
     92        */
     93        function count_deleted_lines()
     94        {
     95                $count = 0;
     96
     97                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     98                {
     99                        $edit = $this->_edits[$i];
     100
     101                        if (is_a($edit, 'diff_op_delete') || is_a($edit, 'diff_op_change'))
     102                        {
     103                                $count += $edit->norig();
     104                        }
     105                }
     106                return $count;
    61107        }
    62108
     
    87133                $rev->_edits = array();
    88134
    89                 foreach ($this->_edits as $edit)
    90                 {
     135                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     136                {
     137                        $edit = $this->_edits[$i];
    91138                        $rev->_edits[] = $edit->reverse();
    92139                }
     
    102149        function is_empty()
    103150        {
    104                 foreach ($this->_edits as $edit)
    105                 {
    106                         if (!is_a($edit, 'diff_op_copy'))
    107                         {
     151                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     152                {
     153                        $edit = $this->_edits[$i];
     154
     155                        // skip diff_op_copy
     156                        if (is_a($edit, 'diff_op_copy'))
     157                        {
     158                                continue;
     159                        }
     160
     161                        if (is_a($edit, 'diff_op_delete') || is_a($edit, 'diff_op_add'))
     162                        {
     163                                $orig = $edit->orig;
     164                                $final = $edit->final;
     165
     166                                // We can simplify one case where the array is usually supposed to be empty...
     167                                if (sizeof($orig) == 1 && trim($orig[0]) === '') $orig = array();
     168                                if (sizeof($final) == 1 && trim($final[0]) === '') $final = array();
     169
     170                                if (!$orig && !$final)
     171                                {
     172                                        continue;
     173                                }
     174
    108175                                return false;
    109176                        }
    110                 }
     177
     178                        return false;
     179                }
     180
    111181                return true;
    112182        }
     
    123193                $lcs = 0;
    124194
    125                 foreach ($this->_edits as $edit)
    126                 {
     195                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     196                {
     197                        $edit = $this->_edits[$i];
     198
    127199                        if (is_a($edit, 'diff_op_copy'))
    128200                        {
     
    144216                $lines = array();
    145217
    146                 foreach ($this->_edits as $edit)
    147                 {
     218                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     219                {
     220                        $edit = $this->_edits[$i];
     221
    148222                        if ($edit->orig)
    149223                        {
     
    165239                $lines = array();
    166240
    167                 foreach ($this->_edits as $edit)
    168                 {
     241                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     242                {
     243                        $edit = $this->_edits[$i];
     244
    169245                        if ($edit->final)
    170246                        {
     
    217293                $prevtype = null;
    218294
    219                 foreach ($this->_edits as $edit)
    220                 {
     295                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     296                {
     297                        $edit = $this->_edits[$i];
     298
    221299                        if ($prevtype == get_class($edit))
    222300                        {
     
    415493        * @param array $final2  The second version to compare to.
    416494        */
    417         function diff3(&$orig, &$final1, &$final2)
     495        function diff3(&$orig, &$final1, &$final2, $preserve_cr = true)
    418496        {
    419497                $diff_engine = new diff_engine();
    420498
    421                 $diff_1 = $diff_engine->diff($orig, $final1);
    422                 $diff_2 = $diff_engine->diff($orig, $final2);
    423 
    424                 unset($engine);
     499                $diff_1 = $diff_engine->diff($orig, $final1, $preserve_cr);
     500                $diff_2 = $diff_engine->diff($orig, $final2, $preserve_cr);
     501
     502                unset($diff_engine);
    425503
    426504                $this->_edits = $this->_diff3($diff_1, $diff_2);
     
    428506
    429507        /**
    430         * Return merged output
     508        * Return number of conflicts
     509        */
     510        function get_num_conflicts()
     511        {
     512                $conflicts = 0;
     513
     514                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     515                {
     516                        $edit = $this->_edits[$i];
     517
     518                        if ($edit->is_conflict())
     519                        {
     520                                $conflicts++;
     521                        }
     522                }
     523
     524                return $conflicts;
     525        }
     526
     527        /**
     528        * Get conflicts content for download. This is generally a merged file, but preserving conflicts and adding explanations to it.
     529        * A user could then go through this file, search for the conflicts and changes the code accordingly.
    431530        *
    432531        * @param string $label1 the cvs file version/label from the original set of lines
    433532        * @param string $label2 the cvs file version/label from the new set of lines
    434533        * @param string $label_sep the explanation between label1 and label2 - more of a helper for the user
    435         * @param bool $get_conflicts if set to true only the number of conflicts is returned
    436         * @param bool $merge_new if set to true the merged output will have the new file contents on a conflicting merge
    437534        *
    438535        * @return mixed the merged output
    439536        */
    440         function merged_output($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN', $get_conflicts = false, $merge_new = false)
     537        function get_conflicts_content($label1 = 'CURRENT_FILE', $label2 = 'NEW_FILE', $label_sep = 'DIFF_SEP_EXPLAIN')
    441538        {
    442539                global $user;
    443 
    444                 if ($get_conflicts)
    445                 {
    446                         foreach ($this->_edits as $edit)
    447                         {
    448                                 if ($edit->is_conflict())
    449                                 {
    450                                         $this->_conflicting_blocks++;
    451                                 }
    452                         }
    453 
    454                         return $this->_conflicting_blocks;
    455                 }
    456540
    457541                $label1 = (!empty($user->lang[$label1])) ? $user->lang[$label1] : $label1;
     
    461545                $lines = array();
    462546
    463                 foreach ($this->_edits as $edit)
    464                 {
     547                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     548                {
     549                        $edit = $this->_edits[$i];
     550
    465551                        if ($edit->is_conflict())
    466552                        {
    467                                 if (!$merge_new)
    468                                 {
    469                                         $lines = array_merge($lines, array('<<<<<<<' . ($label1 ? ' ' . $label1 : '')), $edit->final1, array('=======' . ($label_sep ? ' ' . $label_sep : '')), $edit->final2, array('>>>>>>>' . ($label2 ? ' ' . $label2 : '')));
    470                                 }
    471                                 else
    472                                 {
    473                                         $lines = array_merge($lines, $edit->final1);
    474                                 }
     553                                // Start conflict label
     554                                $label_start    = array('<<<<<<< ' . $label1);
     555                                $label_mid              = array('======= ' . $label_sep);
     556                                $label_end              = array('>>>>>>> ' . $label2);
     557
     558                                $lines = array_merge($lines, $label_start, $edit->final1, $label_mid, $edit->final2, $label_end);
    475559                                $this->_conflicting_blocks++;
    476560                        }
     
    485569
    486570        /**
     571        * Return merged output (used by the renderer)
     572        *
     573        * @return mixed the merged output
     574        */
     575        function merged_output()
     576        {
     577                return $this->get_conflicts_content();
     578        }
     579
     580        /**
    487581        * Merge the output and use the new file code for conflicts
    488582        */
     
    491585                $lines = array();
    492586
    493                 foreach ($this->_edits as $edit)
    494                 {
     587                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     588                {
     589                        $edit = $this->_edits[$i];
     590
    495591                        if ($edit->is_conflict())
    496592                        {
     
    513609                $lines = array();
    514610
    515                 foreach ($this->_edits as $edit)
    516                 {
     611                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     612                {
     613                        $edit = $this->_edits[$i];
     614
    517615                        if ($edit->is_conflict())
    518616                        {
     
    535633                $conflicts = array();
    536634
    537                 foreach ($this->_edits as $edit)
    538                 {
     635                for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++)
     636                {
     637                        $edit = $this->_edits[$i];
     638
    539639                        if ($edit->is_conflict())
    540640                        {
     
    660760                if (!isset($this->_merged))
    661761                {
     762                        // Prepare the arrays before we compare them. ;)
     763                        $this->solve_prepare();
     764
    662765                        if ($this->final1 === $this->final2)
    663766                        {
     
    674777                        else
    675778                        {
     779                                // The following tries to aggressively solve conflicts...
    676780                                $this->_merged = false;
     781                                $this->solve_conflict();
    677782                        }
    678783                }
     
    684789        {
    685790                return ($this->merged() === false) ? true : false;
     791        }
     792
     793        /**
     794        * Function to prepare the arrays for comparing - we want to skip over newline changes
     795        * @author acydburn
     796        */
     797        function solve_prepare()
     798        {
     799                // We can simplify one case where the array is usually supposed to be empty...
     800                if (sizeof($this->orig) == 1 && trim($this->orig[0]) === '') $this->orig = array();
     801                if (sizeof($this->final1) == 1 && trim($this->final1[0]) === '') $this->final1 = array();
     802                if (sizeof($this->final2) == 1 && trim($this->final2[0]) === '') $this->final2 = array();
     803
     804                // Now we only can have the case where the only difference between arrays are newlines, so compare all cases
     805
     806                // First, some strings we can compare...
     807                $orig = $final1 = $final2 = '';
     808
     809                foreach ($this->orig as $null => $line) $orig .= trim($line);
     810                foreach ($this->final1 as $null => $line) $final1 .= trim($line);
     811                foreach ($this->final2 as $null => $line) $final2 .= trim($line);
     812
     813                // final1 === final2
     814                if ($final1 === $final2)
     815                {
     816                        // We preserve the part which will be used in the merge later
     817                        $this->final2 = $this->final1;
     818                }
     819                // final1 === orig
     820                else if ($final1 === $orig)
     821                {
     822                        // Here it does not really matter what we choose, but we will use the new code
     823                        $this->orig = $this->final1;
     824                }
     825                // final2 === orig
     826                else if ($final2 === $orig)
     827                {
     828                        // Here it does not really matter too (final1 will be used), but we will use the new code
     829                        $this->orig = $this->final2;
     830                }
     831        }
     832
     833        /**
     834        * Find code portions from $orig in $final1 and use $final2 as merged instance if provided
     835        * @author acydburn
     836        */
     837        function _compare_conflict_seq($orig, $final1, $final2 = false)
     838        {
     839                $result = array('merge_found' => false, 'merge' => array());
     840
     841                $_orig = &$this->$orig;
     842                $_final1 = &$this->$final1;
     843
     844                // Ok, we basically search for $orig in $final1
     845                $compare_seq = sizeof($_orig);
     846
     847                // Go through the conflict code
     848                for ($i = 0, $j = 0, $size = sizeof($_final1); $i < $size; $i++, $j = $i)
     849                {
     850                        $line = $_final1[$i];
     851                        $skip = 0;
     852
     853                        for ($x = 0; $x < $compare_seq; $x++)
     854                        {
     855                                // Try to skip all matching lines
     856                                if (trim($line) === trim($_orig[$x]))
     857                                {
     858                                        $line = (++$j < $size) ? $_final1[$j] : $line;
     859                                        $skip++;
     860                                }
     861                        }
     862
     863                        if ($skip === $compare_seq)
     864                        {
     865                                $result['merge_found'] = true;
     866
     867                                if ($final2 !== false)
     868                                {
     869                                        $result['merge'] = array_merge($result['merge'], $this->$final2);
     870                                }
     871                                $i += ($skip - 1);
     872                        }
     873                        else if ($final2 !== false)
     874                        {
     875                                $result['merge'][] = $line;
     876                        }
     877                }
     878
     879                return $result;
     880        }
     881
     882        /**
     883        * Tries to solve conflicts aggressively based on typical "assumptions"
     884        * @author acydburn
     885        */
     886        function solve_conflict()
     887        {
     888                $this->_merged = false;
     889
     890                // CASE ONE: orig changed into final2, but modified/unknown code in final1.
     891                // IF orig is found "as is" in final1 we replace the code directly in final1 and populate this as final2/merge
     892                if (sizeof($this->orig) && sizeof($this->final2))
     893                {
     894                        $result = $this->_compare_conflict_seq('orig', 'final1', 'final2');
     895
     896                        if ($result['merge_found'])
     897                        {
     898                                $this->final2 = $result['merge'];
     899                                $this->_merged = &$this->final2;
     900                                return;
     901                        }
     902
     903                        $result = $this->_compare_conflict_seq('final2', 'final1');
     904
     905                        if ($result['merge_found'])
     906                        {
     907                                $this->_merged = &$this->final1;
     908                                return;
     909                        }
     910
     911                        // Try to solve $Id$ issues. ;)
     912                        if (sizeof($this->orig) == 1 && sizeof($this->final1) == 1 && sizeof($this->final2) == 1)
     913                        {
     914                                $match = '#^' . preg_quote('* @version $Id: ', '#') . '[a-z\._\- ]+[0-9]+ [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9\:Z]+ [a-z0-9_\- ]+\$$#';
     915
     916                                if (preg_match($match, $this->orig[0]) && preg_match($match, $this->final1[0]) && preg_match($match, $this->final2[0]))
     917                                {
     918                                        $this->_merged = &$this->final2;
     919                                        return;
     920                                }
     921                        }
     922
     923                        $second_run = false;
     924
     925                        // Try to solve issues where the only reason why the above did not work is a newline being removed in the final1 code but exist in the orig/final2 code
     926                        if (trim($this->orig[0]) === '' && trim($this->final2[0]) === '')
     927                        {
     928                                unset($this->orig[0], $this->final2[0]);
     929                                $this->orig = array_values($this->orig);
     930                                $this->final2 = array_values($this->final2);
     931
     932                                $second_run = true;
     933                        }
     934
     935                        // The same is true for a line at the end. ;)
     936                        if (sizeof($this->orig) && sizeof($this->final2) && sizeof($this->orig) === sizeof($this->final2) && trim($this->orig[sizeof($this->orig)-1]) === '' && trim($this->final2[sizeof($this->final2)-1]) === '')
     937                        {
     938                                unset($this->orig[sizeof($this->orig)-1], $this->final2[sizeof($this->final2)-1]);
     939                                $this->orig = array_values($this->orig);
     940                                $this->final2 = array_values($this->final2);
     941
     942                                $second_run = true;
     943                        }
     944
     945                        if ($second_run)
     946                        {
     947                                $result = $this->_compare_conflict_seq('orig', 'final1', 'final2');
     948
     949                                if ($result['merge_found'])
     950                                {
     951                                        $this->final2 = $result['merge'];
     952                                        $this->_merged = &$this->final2;
     953                                        return;
     954                                }
     955
     956                                $result = $this->_compare_conflict_seq('final2', 'final1');
     957
     958                                if ($result['merge_found'])
     959                                {
     960                                        $this->_merged = &$this->final1;
     961                                        return;
     962                                }
     963                        }
     964
     965                        return;
     966                }
     967
     968                // CASE TWO: Added lines from orig to final2 but final1 had added lines too. Just merge them.
     969                if (!sizeof($this->orig) && $this->final1 !== $this->final2 && sizeof($this->final1) && sizeof($this->final2))
     970                {
     971                        $result = $this->_compare_conflict_seq('final2', 'final1');
     972
     973                        if ($result['merge_found'])
     974                        {
     975                                $this->final2 = $this->final1;
     976                                $this->_merged = &$this->final1;
     977                        }
     978                        else
     979                        {
     980                                $result = $this->_compare_conflict_seq('final1', 'final2');
     981
     982                                if (!$result['merge_found'])
     983                                {
     984                                        $this->final2 = array_merge($this->final1, $this->final2);
     985                                        $this->_merged = &$this->final2;
     986                                }
     987                                else
     988                                {
     989                                        $this->final2 = $this->final1;
     990                                        $this->_merged = &$this->final1;
     991                                }
     992                        }
     993
     994                        return;
     995                }
     996
     997                // CASE THREE: Removed lines (orig has the to-remove line(s), but final1 has additional lines which does not need to be removed). Just remove orig from final1 and then use final1 as final2/merge
     998                if (!sizeof($this->final2) && sizeof($this->orig) && sizeof($this->final1) && $this->orig !== $this->final1)
     999                {
     1000                        $result = $this->_compare_conflict_seq('orig', 'final1');
     1001
     1002                        if (!$result['merge_found'])
     1003                        {
     1004                                return;
     1005                        }
     1006
     1007                        // First of all, try to find the code in orig in final1. ;)
     1008                        $compare_seq = sizeof($this->orig);
     1009                        $begin = $end = -1;
     1010                        $j = 0;
     1011
     1012                        for ($i = 0, $size = sizeof($this->final1); $i < $size; $i++)
     1013                        {
     1014                                $line = $this->final1[$i];
     1015
     1016                                if (trim($line) === trim($this->orig[$j]))
     1017                                {
     1018                                        // Mark begin
     1019                                        if ($begin === -1)
     1020                                        {
     1021                                                $begin = $i;
     1022                                        }
     1023
     1024                                        // End is always $i, the last found line
     1025                                        $end = $i;
     1026
     1027                                        if (isset($this->orig[$j+1]))
     1028                                        {
     1029                                                $j++;
     1030                                        }
     1031                                }
     1032                        }
     1033
     1034                        if ($begin !== -1 && $begin + ($compare_seq - 1) == $end)
     1035                        {
     1036                                foreach ($this->final1 as $i => $line)
     1037                                {
     1038                                        if ($i < $begin || $i > $end)
     1039                                        {
     1040                                                $merged[] = $line;
     1041                                        }
     1042                                }
     1043
     1044                                $this->final2 = $merged;
     1045                                $this->_merged = &$this->final2;
     1046                        }
     1047
     1048                        return;
     1049                }
     1050
     1051                return;
    6861052        }
    6871053}
  • trunk/forum/includes/diff/engine.php

    r400 r702  
    33*
    44* @package diff
    5 * @version $Id: engine.php 8765 2008-08-16 22:18:25Z aptx $
     5* @version $Id$
    66* @copyright (c) 2006 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    1818
    1919/**
    20 * Code from pear.php.net, Text_Diff-1.0.0 package
     20* Code from pear.php.net, Text_Diff-1.1.0 package
    2121* http://pear.php.net/package/Text_Diff/ (native engine)
    2222*
     
    5050class diff_engine
    5151{
     52        /**
     53        * If set to true we trim all lines before we compare them. This ensures that sole space/tab changes do not trigger diffs.
     54        */
     55        var $skip_whitespace_changes = true;
     56
    5257        function diff(&$from_lines, &$to_lines, $preserve_cr = true)
    5358        {
     
    8691                for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++)
    8792                {
    88                         if ($from_lines[$skip] !== $to_lines[$skip])
     93                        if (trim($from_lines[$skip]) !== trim($to_lines[$skip]))
    8994                        {
    9095                                break;
     
    99104                for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++)
    100105                {
    101                         if ($from_lines[$xi] !== $to_lines[$yi])
     106                        if (trim($from_lines[$xi]) !== trim($to_lines[$yi]))
    102107                        {
    103108                                break;
     
    109114                for ($xi = $skip; $xi < $n_from - $endskip; $xi++)
    110115                {
    111                         $xhash[$from_lines[$xi]] = 1;
     116                        if ($this->skip_whitespace_changes) $xhash[trim($from_lines[$xi])] = 1; else $xhash[$from_lines[$xi]] = 1;
    112117                }
    113118
    114119                for ($yi = $skip; $yi < $n_to - $endskip; $yi++)
    115120                {
    116                         $line = $to_lines[$yi];
     121                        $line = ($this->skip_whitespace_changes) ? trim($to_lines[$yi]) : $to_lines[$yi];
    117122
    118123                        if (($this->ychanged[$yi] = empty($xhash[$line])))
     
    127132                for ($xi = $skip; $xi < $n_from - $endskip; $xi++)
    128133                {
    129                         $line = $from_lines[$xi];
     134                        $line = ($this->skip_whitespace_changes) ? trim($from_lines[$xi]) : $from_lines[$xi];
    130135
    131136                        if (($this->xchanged[$xi] = empty($yhash[$line])))
     
    141146
    142147                // Merge edits when possible.
    143                 $this->_shift_boundaries($from_lines, $this->xchanged, $this->ychanged);
    144                 $this->_shift_boundaries($to_lines, $this->ychanged, $this->xchanged);
     148                if ($this->skip_whitespace_changes)
     149                {
     150                        $from_lines_clean = array_map('trim', $from_lines);
     151                        $to_lines_clean = array_map('trim', $to_lines);
     152
     153                        $this->_shift_boundaries($from_lines_clean, $this->xchanged, $this->ychanged);
     154                        $this->_shift_boundaries($to_lines_clean, $this->ychanged, $this->xchanged);
     155
     156                        unset($from_lines_clean, $to_lines_clean);
     157                }
     158                else
     159                {
     160                        $this->_shift_boundaries($from_lines, $this->xchanged, $this->ychanged);
     161                        $this->_shift_boundaries($to_lines, $this->ychanged, $this->xchanged);
     162                }
    145163
    146164                // Compute the edit operations.
  • trunk/forum/includes/diff/renderer.php

    r400 r702  
    33*
    44* @package diff
    5 * @version $Id: renderer.php 8766 2008-08-16 22:24:54Z aptx $
     5* @version $Id$
    66* @copyright (c) 2006 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    1818
    1919/**
    20 * Code from pear.php.net, Text_Diff-1.0.0 package
     20* Code from pear.php.net, Text_Diff-1.1.0 package
    2121* http://pear.php.net/package/Text_Diff/
    2222*
     
    537537        function get_diff_content($diff)
    538538        {
    539                 return '<textarea style="height: 290px;" class="full">' . htmlspecialchars($this->render($diff)) . '</textarea>';
     539                return '<textarea style="height: 290px;" rows="15" cols="76" class="full">' . htmlspecialchars($this->render($diff)) . '</textarea>';
    540540        }
    541541
  • trunk/forum/includes/functions.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions.php 9153 2008-12-02 17:02:56Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    7272        }
    7373
    74         if (!isset($_REQUEST[$var_name]) || (is_array($_REQUEST[$var_name]) && !is_array($default)) || (is_array($default) && !is_array($_REQUEST[$var_name])))
     74        $super_global = ($cookie) ? '_COOKIE' : '_REQUEST';
     75        if (!isset($GLOBALS[$super_global][$var_name]) || is_array($GLOBALS[$super_global][$var_name]) != is_array($default))
    7576        {
    7677                return (is_array($default)) ? array() : $default;
    7778        }
    7879
    79         $var = $_REQUEST[$var_name];
     80        $var = $GLOBALS[$super_global][$var_name];
    8081        if (!is_array($default))
    8182        {
     
    166167
    167168/**
     169* Set dynamic config value with arithmetic operation.
     170*/
     171function set_config_count($config_name, $increment, $is_dynamic = false)
     172{
     173        global $db, $cache;
     174
     175        switch ($db->sql_layer)
     176        {
     177                case 'firebird':
     178                        $sql_update = 'CAST(CAST(config_value as integer) + ' . (int) $increment . ' as VARCHAR(255))';
     179                break;
     180
     181                case 'postgres':
     182                        $sql_update = 'int4(config_value) + ' . (int) $increment;
     183                break;
     184
     185                // MySQL, SQlite, mssql, mssql_odbc, oracle
     186                default:
     187                        $sql_update = 'config_value + ' . (int) $increment;
     188                break;
     189        }
     190
     191        $db->sql_query('UPDATE ' . CONFIG_TABLE . ' SET config_value = ' . $sql_update . " WHERE config_name = '" . $db->sql_escape($config_name) . "'");
     192
     193        if (!$is_dynamic)
     194        {
     195                $cache->destroy('config');
     196        }
     197}
     198
     199/**
    168200* Generates an alphanumeric random string of given length
    169201*/
     
    201233/**
    202234* Return formatted string for filesizes
    203 */
    204 function get_formatted_filesize($bytes, $add_size_lang = true)
     235*
     236* @param int    $value                  filesize in bytes
     237* @param bool   $string_only    true if language string should be returned
     238* @param array  $allowed_units  only allow these units (data array indexes)
     239*
     240* @return mixed                                 data array if $string_only is false
     241* @author bantu
     242*/
     243function get_formatted_filesize($value, $string_only = true, $allowed_units = false)
    205244{
    206245        global $user;
    207246
    208         if ($bytes >= pow(2, 20))
    209         {
    210                 return ($add_size_lang) ? round($bytes / 1024 / 1024, 2) . ' ' . $user->lang['MIB'] : round($bytes / 1024 / 1024, 2);
    211         }
    212 
    213         if ($bytes >= pow(2, 10))
    214         {
    215                 return ($add_size_lang) ? round($bytes / 1024, 2) . ' ' . $user->lang['KIB'] : round($bytes / 1024, 2);
    216         }
    217 
    218         return ($add_size_lang) ? ($bytes) . ' ' . $user->lang['BYTES'] : ($bytes);
     247        $available_units = array(
     248                'gb' => array(
     249                        'min'           => 1073741824, // pow(2, 30)
     250                        'index'         => 3,
     251                        'si_unit'       => 'GB',
     252                        'iec_unit'      => 'GIB',
     253                ),
     254                'mb' => array(
     255                        'min'           => 1048576, // pow(2, 20)
     256                        'index'         => 2,
     257                        'si_unit'       => 'MB',
     258                        'iec_unit'      => 'MIB',
     259                ),
     260                'kb' => array(
     261                        'min'           => 1024, // pow(2, 10)
     262                        'index'         => 1,
     263                        'si_unit'       => 'KB',
     264                        'iec_unit'      => 'KIB',
     265                ),
     266                'b' => array(
     267                        'min'           => 0,
     268                        'index'         => 0,
     269                        'si_unit'       => 'BYTES', // Language index
     270                        'iec_unit'      => 'BYTES',  // Language index
     271                ),
     272        );
     273
     274        foreach ($available_units as $si_identifier => $unit_info)
     275        {
     276                if (!empty($allowed_units) && $si_identifier != 'b' && !in_array($si_identifier, $allowed_units))
     277                {
     278                        continue;
     279                }
     280
     281                if ($value >= $unit_info['min'])
     282                {
     283                        $unit_info['si_identifier'] = $si_identifier;
     284
     285                        break;
     286                }
     287        }
     288        unset($available_units);
     289
     290        for ($i = 0; $i < $unit_info['index']; $i++)
     291        {
     292                $value /= 1024;
     293        }
     294        $value = round($value, 2);
     295
     296        // Lookup units in language dictionary
     297        $unit_info['si_unit'] = (isset($user->lang[$unit_info['si_unit']])) ? $user->lang[$unit_info['si_unit']] : $unit_info['si_unit'];
     298        $unit_info['iec_unit'] = (isset($user->lang[$unit_info['iec_unit']])) ? $user->lang[$unit_info['iec_unit']] : $unit_info['iec_unit'];
     299
     300        // Default to IEC
     301        $unit_info['unit'] = $unit_info['iec_unit'];
     302
     303        if (!$string_only)
     304        {
     305                $unit_info['value'] = $value;
     306
     307                return $unit_info;
     308        }
     309
     310        return $value  . ' ' . $unit_info['unit'];
    219311}
    220312
     
    461553
    462554/**
     555* Hashes an email address to a big integer
     556*
     557* @param string $email          Email address
     558*
     559* @return string                        Unsigned Big Integer
     560*/
     561function phpbb_email_hash($email)
     562{
     563        return sprintf('%u', crc32(strtolower($email))) . strlen($email);
     564}
     565
     566/**
    463567* Global function for chmodding directories and files for internal use
     568*
    464569* This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions.
    465 * The function determines owner and group from common.php file and sets the same to the provided file. Permissions are mapped to the group, user always has rw(x) permission.
     570* The function determines owner and group from common.php file and sets the same to the provided file.
    466571* The function uses bit fields to build the permissions.
    467572* The function sets the appropiate execute bit on directories.
     
    476581* NOTE: The function uses POSIX extension and fileowner()/filegroup() functions. If any of them is disabled, this function tries to build proper permissions, by calling is_readable() and is_writable() functions.
    477582*
    478 * @param $filename The file/directory to be chmodded
    479 * @param $perms Permissions to set
    480 * @return true on success, otherwise false
    481 *
     583* @param string $filename       The file/directory to be chmodded
     584* @param int    $perms          Permissions to set
     585*
     586* @return bool  true on success, otherwise false
    482587* @author faw, phpBB Group
    483588*/
    484589function phpbb_chmod($filename, $perms = CHMOD_READ)
    485590{
     591        static $_chmod_info;
     592
    486593        // Return if the file no longer exists.
    487594        if (!file_exists($filename))
     
    490597        }
    491598
    492         if (!function_exists('fileowner') || !function_exists('filegroup'))
    493         {
    494                 $file_uid = $file_gid = false;
    495                 $common_php_owner = $common_php_group = false;
    496         }
    497         else
    498         {
    499                 global $phpbb_root_path, $phpEx;
    500 
    501                 // Determine owner/group of common.php file and the filename we want to change here
    502                 $common_php_owner = fileowner($phpbb_root_path . 'common.' . $phpEx);
    503                 $common_php_group = filegroup($phpbb_root_path . 'common.' . $phpEx);
    504 
    505                 $file_uid = fileowner($filename);
    506                 $file_gid = filegroup($filename);
    507 
    508                 // Try to set the owner to the same common.php has
    509                 if ($common_php_owner !== $file_uid && $common_php_owner !== false && $file_uid !== false)
    510                 {
    511                         // Will most likely not work
    512                         if (@chown($filename, $common_php_owner));
    513                         {
    514                                 clearstatcache();
    515                                 $file_uid = fileowner($filename);
    516                         }
    517                 }
    518 
    519                 // Try to set the group to the same common.php has
    520                 if ($common_php_group !== $file_gid && $common_php_group !== false && $file_gid !== false)
    521                 {
    522                         if (@chgrp($filename, $common_php_group));
    523                         {
    524                                 clearstatcache();
    525                                 $file_gid = filegroup($filename);
    526                         }
    527                 }
    528         }
    529 
    530         // And the owner and the groups PHP is running under.
    531         $php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false;
    532         $php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;
    533 
    534         // Who is PHP?
    535         if ($file_uid === false || $file_gid === false || $php_uid === false || $php_gids === false)
    536         {
    537                 $php = NULL;
    538         }
    539         else if ($file_uid == $php_uid /* && $common_php_owner !== false && $common_php_owner === $file_uid*/)
    540         {
    541                 $php = 'owner';
    542         }
    543         else if (in_array($file_gid, $php_gids))
    544         {
    545                 $php = 'group';
    546         }
    547         else
     599        // Determine some common vars
     600        if (empty($_chmod_info))
     601        {
     602                if (!function_exists('fileowner') || !function_exists('filegroup'))
     603                {
     604                        // No need to further determine owner/group - it is unknown
     605                        $_chmod_info['process'] = false;
     606                }
     607                else
     608                {
     609                        global $phpbb_root_path, $phpEx;
     610
     611                        // Determine owner/group of common.php file and the filename we want to change here
     612                        $common_php_owner = @fileowner($phpbb_root_path . 'common.' . $phpEx);
     613                        $common_php_group = @filegroup($phpbb_root_path . 'common.' . $phpEx);
     614
     615                        // And the owner and the groups PHP is running under.
     616                        $php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false;
     617                        $php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;
     618
     619                        // If we are unable to get owner/group, then do not try to set them by guessing
     620                        if (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)
     621                        {
     622                                $_chmod_info['process'] = false;
     623                        }
     624                        else
     625                        {
     626                                $_chmod_info = array(
     627                                        'process'               => true,
     628                                        'common_owner'  => $common_php_owner,
     629                                        'common_group'  => $common_php_group,
     630                                        'php_uid'               => $php_uid,
     631                                        'php_gids'              => $php_gids,
     632                                );
     633                        }
     634                }
     635        }
     636
     637        if ($_chmod_info['process'])
     638        {
     639                $file_uid = @fileowner($filename);
     640                $file_gid = @filegroup($filename);
     641
     642                // Change owner
     643                if (@chown($filename, $_chmod_info['common_owner']))
     644                {
     645                        clearstatcache();
     646                        $file_uid = @fileowner($filename);
     647                }
     648
     649                // Change group
     650                if (@chgrp($filename, $_chmod_info['common_group']))
     651                {
     652                        clearstatcache();
     653                        $file_gid = @filegroup($filename);
     654                }
     655
     656                // If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something
     657                if ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group'])
     658                {
     659                        $_chmod_info['process'] = false;
     660                }
     661        }
     662
     663        // Still able to process?
     664        if ($_chmod_info['process'])
     665        {
     666                if ($file_uid == $_chmod_info['php_uid'])
     667                {
     668                        $php = 'owner';
     669                }
     670                else if (in_array($file_gid, $_chmod_info['php_gids']))
     671                {
     672                        $php = 'group';
     673                }
     674                else
     675                {
     676                        // Since we are setting the everyone bit anyway, no need to do expensive operations
     677                        $_chmod_info['process'] = false;
     678                }
     679        }
     680
     681        // We are not able to determine or change something
     682        if (!$_chmod_info['process'])
    548683        {
    549684                $php = 'other';
     
    565700        switch ($php)
    566701        {
    567                 case null:
    568702                case 'owner':
    569                         /* ATTENTION: if php is owner or NULL we set it to group here. This is the most failsafe combination for the vast majority of server setups.
    570 
    571703                        $result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0));
    572704
    573705                        clearstatcache();
    574706
    575                         if (!is_null($php) || (is_readable($filename) && is_writable($filename)))
     707                        if (is_readable($filename) && is_writable($filename))
    576708                        {
    577709                                break;
    578710                        }
    579                 */
    580711
    581712                case 'group':
     
    584715                        clearstatcache();
    585716
    586                         if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename))))
     717                        if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))
    587718                        {
    588719                                break;
     
    594725                        clearstatcache();
    595726
    596                         if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename))))
     727                        if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))
    597728                        {
    598729                                break;
     
    605736
    606737        return $result;
     738}
     739
     740/**
     741* Test if a file/directory is writable
     742*
     743* This function calls the native is_writable() when not running under
     744* Windows and it is not disabled.
     745*
     746* @param string $file Path to perform write test on
     747* @return bool True when the path is writable, otherwise false.
     748*/
     749function phpbb_is_writable($file)
     750{
     751        if (strtolower(substr(PHP_OS, 0, 3)) === 'win' || !function_exists('is_writable'))
     752        {
     753                if (file_exists($file))
     754                {
     755                        // Canonicalise path to absolute path
     756                        $file = phpbb_realpath($file);
     757
     758                        if (is_dir($file))
     759                        {
     760                                // Test directory by creating a file inside the directory
     761                                $result = @tempnam($file, 'i_w');
     762
     763                                if (is_string($result) && file_exists($result))
     764                                {
     765                                        unlink($result);
     766
     767                                        // Ensure the file is actually in the directory (returned realpathed)
     768                                        return (strpos($result, $file) === 0) ? true : false;
     769                                }
     770                        }
     771                        else
     772                        {
     773                                $handle = @fopen($file, 'r+');
     774
     775                                if (is_resource($handle))
     776                                {
     777                                        fclose($handle);
     778                                        return true;
     779                                }
     780                        }
     781                }
     782                else
     783                {
     784                        // file does not exist test if we can write to the directory
     785                        $dir = dirname($file);
     786
     787                        if (file_exists($dir) && is_dir($dir) && phpbb_is_writable($dir))
     788                        {
     789                                return true;
     790                        }
     791                }
     792
     793                return false;
     794        }
     795        else
     796        {
     797                return is_writable($file);
     798        }
    607799}
    608800
     
    704896function is_absolute($path)
    705897{
    706         return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:/#i', $path))) ? true : false;
     898        return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:[/\\\]#i', $path))) ? true : false;
    707899}
    708900
     
    9851177                {
    9861178                        $selected = ($offset == $default) ? ' selected="selected"' : '';
    987                         $tz_select .= '<option title="'.$zone.'" value="' . $offset . '"' . $selected . '>' . $zone_trunc . '</option>';
     1179                        $tz_select .= '<option title="' . $zone . '" value="' . $offset . '"' . $selected . '>' . $zone_trunc . '</option>';
    9881180                }
    9891181        }
     
    10481240
    10491241                // Add 0 to forums array to mark global announcements correctly
    1050                 $forum_id[] = 0;
     1242                // $forum_id[] = 0;
    10511243
    10521244                if ($config['load_db_lastread'] && $user->data['is_registered'])
     
    10661258                        while ($row = $db->sql_fetchrow($result))
    10671259                        {
    1068                                 $sql_update[] = $row['forum_id'];
     1260                                $sql_update[] = (int) $row['forum_id'];
    10691261                        }
    10701262                        $db->sql_freeresult($result);
     
    14631655
    14641656        return $last_read;
     1657}
     1658
     1659/**
     1660* Get list of unread topics
     1661*
     1662* @param int $user_id                   User ID (or false for current user)
     1663* @param string $sql_extra              Extra WHERE SQL statement
     1664* @param string $sql_sort               ORDER BY SQL sorting statement
     1665* @param string $sql_limit              Limits the size of unread topics list, 0 for unlimited query
     1666*
     1667* @return array[int][int]               Topic ids as keys, mark_time of topic as value
     1668*/
     1669function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001)
     1670{
     1671        global $config, $db, $user;
     1672
     1673        $user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id;
     1674
     1675        // Data array we're going to return
     1676        $unread_topics = array();
     1677
     1678        if (empty($sql_sort))
     1679        {
     1680                $sql_sort = 'ORDER BY t.topic_last_post_time DESC';
     1681        }
     1682
     1683        if ($config['load_db_lastread'] && $user->data['is_registered'])
     1684        {
     1685                // Get list of the unread topics
     1686                $last_mark = $user->data['user_lastmark'];
     1687
     1688                $sql_array = array(
     1689                        'SELECT'                => 't.topic_id, t.topic_last_post_time, tt.mark_time as topic_mark_time, ft.mark_time as forum_mark_time',
     1690
     1691                        'FROM'                  => array(TOPICS_TABLE => 't'),
     1692
     1693                        'LEFT_JOIN'             => array(
     1694                                array(
     1695                                        'FROM'  => array(TOPICS_TRACK_TABLE => 'tt'),
     1696                                        'ON'    => "tt.user_id = $user_id AND t.topic_id = tt.topic_id",
     1697                                ),
     1698                                array(
     1699                                        'FROM'  => array(FORUMS_TRACK_TABLE => 'ft'),
     1700                                        'ON'    => "ft.user_id = $user_id AND t.forum_id = ft.forum_id",
     1701                                ),
     1702                        ),
     1703
     1704                        'WHERE'                 => "
     1705                                (
     1706                                (tt.mark_time IS NOT NULL AND t.topic_last_post_time > tt.mark_time) OR
     1707                                (tt.mark_time IS NULL AND ft.mark_time IS NOT NULL AND t.topic_last_post_time > ft.mark_time) OR
     1708                                (tt.mark_time IS NULL AND ft.mark_time IS NULL AND t.topic_last_post_time > $last_mark)
     1709                                )
     1710                                $sql_extra
     1711                                $sql_sort",
     1712                );
     1713
     1714                $sql = $db->sql_build_query('SELECT', $sql_array);
     1715                $result = $db->sql_query_limit($sql, $sql_limit);
     1716
     1717                while ($row = $db->sql_fetchrow($result))
     1718                {
     1719                        $topic_id = (int) $row['topic_id'];
     1720                        $unread_topics[$topic_id] = ($row['topic_mark_time']) ? (int) $row['topic_mark_time'] : (($row['forum_mark_time']) ? (int) $row['forum_mark_time'] : $last_mark);
     1721                }
     1722                $db->sql_freeresult($result);
     1723        }
     1724        else if ($config['load_anon_lastread'] || $user->data['is_registered'])
     1725        {
     1726                global $tracking_topics;
     1727
     1728                if (empty($tracking_topics))
     1729                {
     1730                        $tracking_topics = request_var($config['cookie_name'] . '_track', '', false, true);
     1731                        $tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
     1732                }
     1733
     1734                if (!$user->data['is_registered'])
     1735                {
     1736                        $user_lastmark = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0;
     1737                }
     1738                else
     1739                {
     1740                        $user_lastmark = (int) $user->data['user_lastmark'];
     1741                }
     1742
     1743                $sql = 'SELECT t.topic_id, t.forum_id, t.topic_last_post_time
     1744                        FROM ' . TOPICS_TABLE . ' t
     1745                        WHERE t.topic_last_post_time > ' . $user_lastmark . "
     1746                        $sql_extra
     1747                        $sql_sort";
     1748                $result = $db->sql_query_limit($sql, $sql_limit);
     1749
     1750                while ($row = $db->sql_fetchrow($result))
     1751                {
     1752                        $forum_id = (int) $row['forum_id'];
     1753                        $topic_id = (int) $row['topic_id'];
     1754                        $topic_id36 = base_convert($topic_id, 10, 36);
     1755
     1756                        if (isset($tracking_topics['t'][$topic_id36]))
     1757                        {
     1758                                $last_read = base_convert($tracking_topics['t'][$topic_id36], 36, 10) + $config['board_startdate'];
     1759
     1760                                if ($row['topic_last_post_time'] > $last_read)
     1761                                {
     1762                                        $unread_topics[$topic_id] = $last_read;
     1763                                }
     1764                        }
     1765                        else if (isset($tracking_topics['f'][$forum_id]))
     1766                        {
     1767                                $mark_time = base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate'];
     1768
     1769                                if ($row['topic_last_post_time'] > $mark_time)
     1770                                {
     1771                                        $unread_topics[$topic_id] = $mark_time;
     1772                                }
     1773                        }
     1774                        else
     1775                        {
     1776                                $unread_topics[$topic_id] = $user_lastmark;
     1777                        }
     1778                }
     1779                $db->sql_freeresult($result);
     1780        }
     1781
     1782        return $unread_topics;
    14651783}
    14661784
     
    17152033
    17162034        $on_page = floor($start_item / $per_page) + 1;
    1717         $url_delim = (strpos($base_url, '?') === false) ? '?' : '&amp;';
     2035        $url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&amp;');
    17182036
    17192037        $page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . $base_url . '">1</a>';
     
    19942312
    19952313        // Determine which type of redirect we need to handle...
    1996         $url_parts = parse_url($url);
     2314        $url_parts = @parse_url($url);
    19972315
    19982316        if ($url_parts === false)
     
    21382456
    21392457        // Remove previously added sid
    2140         if (strpos($url, '?sid=') !== false)
    2141         {
    2142                 $url = preg_replace('/(\?)sid=[a-z0-9]+(&amp;|&)?/', '\1', $url);
    2143         }
    2144         else if (strpos($url, '&sid=') !== false)
    2145         {
    2146                 $url = preg_replace('/&sid=[a-z0-9]+(&)?/', '\1', $url);
    2147         }
    2148         else if (strpos($url, '&amp;sid=') !== false)
    2149         {
    2150                 $url = preg_replace('/&amp;sid=[a-z0-9]+(&amp;)?/', '\1', $url);
     2458        if (strpos($url, 'sid=') !== false)
     2459        {
     2460                // All kind of links
     2461                $url = preg_replace('/(\?)?(&amp;|&)?sid=[a-z0-9]+/', '', $url);
     2462                // if the sid was the first param, make the old second as first ones
     2463                $url = preg_replace("/$phpEx(&amp;|&)+?/", "$phpEx?", $url);
    21512464        }
    21522465
     
    22102523
    22112524                $redirect .= ($query) ? '?' . $query : '';
     2525        }
     2526
     2527        // We need to be cautious here.
     2528        // On some situations, the redirect path is an absolute URL, sometimes a relative path
     2529        // For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,
     2530        // else we use the URL directly.
     2531        $url_parts = @parse_url($redirect);
     2532
     2533        // URL
     2534        if ($url_parts !== false && !empty($url_parts['scheme']) && !empty($url_parts['host']))
     2535        {
     2536                return str_replace('&', '&amp;', $redirect);
    22122537        }
    22132538
     
    23732698        if ($check && $confirm)
    23742699        {
    2375                 $user_id = request_var('user_id', 0);
     2700                $user_id = request_var('confirm_uid', 0);
    23762701                $session_id = request_var('sess', '');
    23772702                $confirm_key = request_var('confirm_key', '');
     
    23952720
    23962721        $s_hidden_fields = build_hidden_fields(array(
    2397                 'user_id'       => $user->data['user_id'],
    2398                 'sess'          => $user->session_id,
    2399                 'sid'           => $user->session_id)
    2400         );
     2722                'confirm_uid'   => $user->data['user_id'],
     2723                'sess'                  => $user->session_id,
     2724                'sid'                   => $user->session_id,
     2725        ));
    24012726
    24022727        // generate activation key
     
    24092734        else
    24102735        {
    2411                 page_header((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]);
     2736                page_header(((!isset($user->lang[$title])) ? $user->lang['CONFIRM'] : $user->lang[$title]), false);
    24122737        }
    24132738
     
    24572782{
    24582783        global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
     2784
     2785        if (!class_exists('phpbb_captcha_factory'))
     2786        {
     2787                include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
     2788        }
    24592789
    24602790        $err = '';
     
    25682898                        case LOGIN_ERROR_ATTEMPTS:
    25692899
    2570                                 // Show confirm image
    2571                                 $sql = 'DELETE FROM ' . CONFIRM_TABLE . "
    2572                                         WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
    2573                                                 AND confirm_type = " . CONFIRM_LOGIN;
    2574                                 $db->sql_query($sql);
    2575 
    2576                                 // Generate code
    2577                                 $code = gen_rand_string(mt_rand(5, 8));
    2578                                 $confirm_id = md5(unique_id($user->ip));
    2579                                 $seed = hexdec(substr(unique_id(), 4, 10));
    2580 
    2581                                 // compute $seed % 0x7fffffff
    2582                                 $seed -= 0x7fffffff * floor($seed / 0x7fffffff);
    2583 
    2584                                 $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
    2585                                         'confirm_id'    => (string) $confirm_id,
    2586                                         'session_id'    => (string) $user->session_id,
    2587                                         'confirm_type'  => (int) CONFIRM_LOGIN,
    2588                                         'code'                  => (string) $code,
    2589                                         'seed'                  => (int) $seed)
    2590                                 );
    2591                                 $db->sql_query($sql);
     2900                                $captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
     2901                                $captcha->init(CONFIRM_LOGIN);
     2902                                // $captcha->reset();
    25922903
    25932904                                $template->assign_vars(array(
    2594                                         'S_CONFIRM_CODE'                        => true,
    2595                                         'CONFIRM_ID'                            => $confirm_id,
    2596                                         'CONFIRM_IMAGE'                         => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_LOGIN) . '" alt="" title="" />',
    2597                                         'L_LOGIN_CONFIRM_EXPLAIN'       => sprintf($user->lang['LOGIN_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
     2905                                        'CAPTCHA_TEMPLATE'                      => $captcha->get_template(),
    25982906                                ));
    25992907
    26002908                                $err = $user->lang[$result['error_msg']];
    2601 
    26022909                        break;
    26032910
     
    26262933        }
    26272934
    2628         if (!$redirect)
    2629         {
    2630                 // We just use what the session code determined...
    2631                 // If we are not within the admin directory we use the page dir...
    2632                 $redirect = '';
    2633 
    2634                 if (!$admin)
    2635                 {
    2636                         $redirect .= ($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '';
    2637                 }
    2638 
    2639                 $redirect .= $user->page['page_name'] . (($user->page['query_string']) ? '?' . htmlspecialchars($user->page['query_string']) : '');
    2640         }
    2641 
    26422935        // Assign credential for username/password pair
    26432936        $credential = ($admin) ? md5(unique_id()) : false;
    26442937
    26452938        $s_hidden_fields = array(
    2646                 'redirect'      => $redirect,
    26472939                'sid'           => $user->session_id,
    26482940        );
     2941
     2942        if ($redirect)
     2943        {
     2944                $s_hidden_fields['redirect'] = $redirect;
     2945        }
    26492946
    26502947        if ($admin)
     
    26602957
    26612958                'U_SEND_PASSWORD'               => ($config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=sendpassword') : '',
    2662                 'U_RESEND_ACTIVATION'   => ($config['require_activation'] != USER_ACTIVATION_NONE && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
     2959                'U_RESEND_ACTIVATION'   => ($config['require_activation'] == USER_ACTIVATION_SELF && $config['email_enable']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=resend_act') : '',
    26632960                'U_TERMS_USE'                   => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
    26642961                'U_PRIVACY'                             => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
    26652962
    26662963                'S_DISPLAY_FULL_LOGIN'  => ($s_display) ? true : false,
    2667                 'S_LOGIN_ACTION'                => (!$admin) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id), // Needs to stay index.$phpEx because we are within the admin directory
    26682964                'S_HIDDEN_FIELDS'               => $s_hidden_fields,
    26692965
     
    27493045        }
    27503046
    2751         page_header($user->lang['LOGIN']);
     3047        page_header($user->lang['LOGIN'], false);
    27523048
    27533049        $template->assign_vars(array(
     3050                'S_LOGIN_ACTION'                => build_url(array('f')),
    27543051                'S_HIDDEN_FIELDS'               => build_hidden_fields(array('f' => $forum_data['forum_id'])))
    27553052        );
     
    28703167{
    28713168        global $db, $user;
     3169
     3170        // In phpBB 3.1.x i want to have logging in a class to be able to control it
     3171        // For now, we need a quite hakish approach to circumvent logging for some actions
     3172        // @todo implement cleanly
     3173        if (!empty($GLOBALS['skip_add_log']))
     3174        {
     3175                return false;
     3176        }
    28723177
    28733178        $args = func_get_args();
     
    31383443
    31393444        // Do not display notices if we suppress them via @
    3140         if (error_reporting() == 0)
     3445        if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE)
    31413446        {
    31423447                return;
     
    31473452        {
    31483453                $msg_text = $msg_long_text;
     3454        }
     3455
     3456        if (!defined('E_DEPRECATED'))
     3457        {
     3458                define('E_DEPRECATED', 8192);
    31493459        }
    31503460
     
    31813491                                $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile);
    31823492                                $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text);
    3183 
    31843493                                echo '<b>[phpBB Debug] PHP Notice</b>: in file <b>' . $errfile . '</b> on line <b>' . $errline . '</b>: <b>' . $msg_text . '</b><br />' . "\n";
     3494
     3495                                // we are writing an image - the user won't see the debug, so let's place it in the log
     3496                                if (defined('IMAGE_OUTPUT') || defined('IN_CRON'))
     3497                                {
     3498                                        add_log('critical', 'LOG_IMAGE_GENERATION_ERROR', $errfile, $errline, $msg_text);
     3499                                }
     3500                                // echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n";
    31853501                        }
    31863502
     
    32153531                                }
    32163532                        }
     3533
     3534                        if ((defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db))
     3535                        {
     3536                                // let's avoid loops
     3537                                $db->sql_return_on_error(true);
     3538                                add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $msg_text);
     3539                                $db->sql_return_on_error(false);
     3540                        }
     3541
     3542                        // Do not send 200 OK, but service unavailable on errors
     3543                        header('HTTP/1.1 503 Service Unavailable');
    32173544
    32183545                        garbage_collection();
     
    32943621                                else
    32953622                                {
    3296                                         page_header($msg_title);
     3623                                        page_header($msg_title, false);
    32973624                                }
    32983625                        }
     
    33233650                        exit_handler();
    33243651                break;
     3652
     3653                // PHP4 compatibility
     3654                case E_DEPRECATED:
     3655                        return true;
     3656                break;
    33253657        }
    33263658
     
    33323664/**
    33333665* Queries the session table to get information about online guests
    3334 * @param int $forum_id Limits the search to the forum with this id
     3666* @param int $item_id Limits the search to the item with this id
     3667* @param string $item The name of the item which is stored in the session table as session_{$item}_id
    33353668* @return int The number of active distinct guest sessions
    33363669*/
    3337 function obtain_guest_count($forum_id = 0)
     3670function obtain_guest_count($item_id = 0, $item = 'forum')
    33383671{
    33393672        global $db, $config;
    33403673
    3341         if ($forum_id)
    3342         {
    3343                 $reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id;
     3674        if ($item_id)
     3675        {
     3676                $reading_sql = ' AND s.session_' . $item . '_id = ' . (int) $item_id;
    33443677        }
    33453678        else
     
    33703703                        $reading_sql;
    33713704        }
    3372         $result = $db->sql_query($sql, 60);
     3705        $result = $db->sql_query($sql);
    33733706        $guests_online = (int) $db->sql_fetchfield('num_guests');
    33743707        $db->sql_freeresult($result);
     
    33793712/**
    33803713* Queries the session table to get information about online users
    3381 * @param int $forum_id Limits the search to the forum with this id
     3714* @param int $item_id Limits the search to the item with this id
     3715* @param string $item The name of the item which is stored in the session table as session_{$item}_id
    33823716* @return array An array containing the ids of online, hidden and visible users, as well as statistical info
    33833717*/
    3384 function obtain_users_online($forum_id = 0)
     3718function obtain_users_online($item_id = 0, $item = 'forum')
    33853719{
    33863720        global $db, $config, $user;
    33873721
    33883722        $reading_sql = '';
    3389         if ($forum_id !== 0)
    3390         {
    3391                 $reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id;
     3723        if ($item_id !== 0)
     3724        {
     3725                $reading_sql = ' AND s.session_' . $item . '_id = ' . (int) $item_id;
    33923726        }
    33933727
     
    34033737        if ($config['load_online_guests'])
    34043738        {
    3405                 $online_users['guests_online'] = obtain_guest_count($forum_id);
     3739                $online_users['guests_online'] = obtain_guest_count($item_id, $item);
    34063740        }
    34073741
     
    34423776* Uses the result of obtain_users_online to generate a localized, readable representation.
    34433777* @param mixed $online_users result of obtain_users_online - array with user_id lists for total, hidden and visible users, and statistics
    3444 * @param int $forum_id Indicate that the data is limited to one forum and not global.
     3778* @param int $item_id Indicate that the data is limited to one item and not global
     3779* @param string $item The name of the item which is stored in the session table as session_{$item}_id
    34453780* @return array An array containing the string for output to the template
    34463781*/
    3447 function obtain_users_online_string($online_users, $forum_id = 0)
     3782function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum')
    34483783{
    34493784        global $config, $db, $user, $auth;
    34503785
    34513786        $user_online_link = $online_userlist = '';
     3787        // Need caps version of $item for language-strings
     3788        $item_caps = strtoupper($item);
    34523789
    34533790        if (sizeof($online_users['online_users']))
     
    34843821        }
    34853822
    3486         if ($forum_id === 0)
     3823        if ($item_id === 0)
    34873824        {
    34883825                $online_userlist = $user->lang['REGISTERED_USERS'] . ' ' . $online_userlist;
     
    34903827        else if ($config['load_online_guests'])
    34913828        {
    3492                 $l_online = ($online_users['guests_online'] === 1) ? $user->lang['BROWSING_FORUM_GUEST'] : $user->lang['BROWSING_FORUM_GUESTS'];
     3829                $l_online = ($online_users['guests_online'] === 1) ? $user->lang['BROWSING_' . $item_caps . '_GUEST'] : $user->lang['BROWSING_' . $item_caps . '_GUESTS'];
    34933830                $online_userlist = sprintf($l_online, $online_userlist, $online_users['guests_online']);
    34943831        }
    34953832        else
    34963833        {
    3497                 $online_userlist = sprintf($user->lang['BROWSING_FORUM'], $online_userlist);
     3834                $online_userlist = sprintf($user->lang['BROWSING_' . $item_caps], $online_userlist);
    34983835        }
    34993836        // Build online listing
     
    35493886}
    35503887
     3888/**
     3889* Get option bitfield from custom data
     3890*
     3891* @param int    $bit            The bit/value to get
     3892* @param int    $data           Current bitfield to check
     3893* @return bool  Returns true if value of constant is set in bitfield, else false
     3894*/
     3895function phpbb_optionget($bit, $data)
     3896{
     3897        return ($data & 1 << (int) $bit) ? true : false;
     3898}
     3899
     3900/**
     3901* Set option bitfield
     3902*
     3903* @param int    $bit            The bit/value to set/unset
     3904* @param bool   $set            True if option should be set, false if option should be unset.
     3905* @param int    $data           Current bitfield to change
     3906*
     3907* @return int   The new bitfield
     3908*/
     3909function phpbb_optionset($bit, $set, $data)
     3910{
     3911        if ($set && !($data & 1 << $bit))
     3912        {
     3913                $data += 1 << $bit;
     3914        }
     3915        else if (!$set && ($data & 1 << $bit))
     3916        {
     3917                $data -= 1 << $bit;
     3918        }
     3919
     3920        return $data;
     3921}
     3922
     3923/**
     3924* Login using http authenticate.
     3925*
     3926* @param array  $param          Parameter array, see $param_defaults array.
     3927*
     3928* @return void
     3929*/
     3930function phpbb_http_login($param)
     3931{
     3932        global $auth, $user;
     3933        global $config;
     3934
     3935        $param_defaults = array(
     3936                'auth_message'  => '',
     3937
     3938                'autologin'             => false,
     3939                'viewonline'    => true,
     3940                'admin'                 => false,
     3941        );
     3942
     3943        // Overwrite default values with passed values
     3944        $param = array_merge($param_defaults, $param);
     3945
     3946        // User is already logged in
     3947        // We will not overwrite his session
     3948        if (!empty($user->data['is_registered']))
     3949        {
     3950                return;
     3951        }
     3952
     3953        // $_SERVER keys to check
     3954        $username_keys = array(
     3955                'PHP_AUTH_USER',
     3956                'Authorization',
     3957                'REMOTE_USER', 'REDIRECT_REMOTE_USER',
     3958                'HTTP_AUTHORIZATION', 'REDIRECT_HTTP_AUTHORIZATION',
     3959                'REMOTE_AUTHORIZATION', 'REDIRECT_REMOTE_AUTHORIZATION',
     3960                'AUTH_USER',
     3961        );
     3962
     3963        $password_keys = array(
     3964                'PHP_AUTH_PW',
     3965                'REMOTE_PASSWORD',
     3966                'AUTH_PASSWORD',
     3967        );
     3968
     3969        $username = null;
     3970        foreach ($username_keys as $k)
     3971        {
     3972                if (isset($_SERVER[$k]))
     3973                {
     3974                        $username = $_SERVER[$k];
     3975                        break;
     3976                }
     3977        }
     3978
     3979        $password = null;
     3980        foreach ($password_keys as $k)
     3981        {
     3982                if (isset($_SERVER[$k]))
     3983                {
     3984                        $password = $_SERVER[$k];
     3985                        break;
     3986                }
     3987        }
     3988
     3989        // Decode encoded information (IIS, CGI, FastCGI etc.)
     3990        if (!is_null($username) && is_null($password) && strpos($username, 'Basic ') === 0)
     3991        {
     3992                list($username, $password) = explode(':', base64_decode(substr($username, 6)), 2);
     3993    }
     3994
     3995        if (!is_null($username) && !is_null($password))
     3996        {
     3997                set_var($username, $username, 'string', true);
     3998                set_var($password, $password, 'string', true);
     3999
     4000                $auth_result = $auth->login($username, $password, $param['autologin'], $param['viewonline'], $param['admin']);
     4001
     4002                if ($auth_result['status'] == LOGIN_SUCCESS)
     4003                {
     4004                        return;
     4005                }
     4006                else if ($auth_result['status'] == LOGIN_ERROR_ATTEMPTS)
     4007                {
     4008                        header('HTTP/1.0 401 Unauthorized');
     4009                        trigger_error('NOT_AUTHORISED');
     4010                }
     4011        }
     4012
     4013        // Prepend sitename to auth_message
     4014        $param['auth_message'] = ($param['auth_message'] === '') ? $config['sitename'] : $config['sitename'] . ' - ' . $param['auth_message'];
     4015
     4016        // We should probably filter out non-ASCII characters - RFC2616
     4017        $param['auth_message'] = preg_replace('/[\x80-\xFF]/', '?', $param['auth_message']);
     4018
     4019        header('WWW-Authenticate: Basic realm="' . $param['auth_message'] . '"');
     4020        header('HTTP/1.0 401 Unauthorized');
     4021
     4022        trigger_error('NOT_AUTHORISED');
     4023}
    35514024
    35524025/**
    35534026* Generate page header
    35544027*/
    3555 function page_header($page_title = '', $display_online_list = true)
     4028function page_header($page_title = '', $display_online_list = true, $item_id = 0, $item = 'forum')
    35564029{
    35574030        global $db, $config, $template, $SID, $_SID, $user, $auth, $phpEx, $phpbb_root_path;
     
    35894062
    35904063        // Get users online list ... if required
    3591         $l_online_users = $online_userlist = $l_online_record = '';
     4064        $l_online_users = $online_userlist = $l_online_record = $l_online_time = '';
    35924065
    35934066        if ($config['load_online'] && $config['load_online_time'] && $display_online_list)
    35944067        {
    3595                 $f = request_var('f', 0);
    3596                 $f = max($f, 0);
    3597                 $online_users = obtain_users_online($f);
    3598                 $user_online_strings = obtain_users_online_string($online_users, $f);
     4068                /**
     4069                * Load online data:
     4070                * For obtaining another session column use $item and $item_id in the function-parameter, whereby the column is session_{$item}_id.
     4071                */
     4072                $item_id = max($item_id, 0);
     4073
     4074                $online_users = obtain_users_online($item_id, $item);
     4075                $user_online_strings = obtain_users_online_string($online_users, $item_id, $item);
    35994076
    36004077                $l_online_users = $user_online_strings['l_online_users'];
     
    36084085                }
    36094086
    3610                 $l_online_record = sprintf($user->lang['RECORD_ONLINE_USERS'], $config['record_online_users'], $user->format_date($config['record_online_date']));
     4087                $l_online_record = sprintf($user->lang['RECORD_ONLINE_USERS'], $config['record_online_users'], $user->format_date($config['record_online_date'], false, true));
    36114088
    36124089                $l_online_time = ($config['load_online_time'] == 1) ? 'VIEW_ONLINE_TIME' : 'VIEW_ONLINE_TIMES';
    36134090                $l_online_time = sprintf($user->lang[$l_online_time], $config['load_online_time']);
    3614         }
    3615         else
    3616         {
    3617                 $l_online_time = '';
    36184091        }
    36194092
     
    36574130                }
    36584131        }
     4132
     4133        $forum_id = request_var('f', 0);
     4134        $topic_id = request_var('t', 0);
     4135
     4136        $s_feed_news = false;
     4137
     4138        // Get option for news
     4139        if ($config['feed_enable'])
     4140        {
     4141                $sql = 'SELECT forum_id
     4142                        FROM ' . FORUMS_TABLE . '
     4143                        WHERE ' . $db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
     4144                $result = $db->sql_query_limit($sql, 1, 0, 600);
     4145                $s_feed_news = (int) $db->sql_fetchfield('forum_id');
     4146                $db->sql_freeresult($result);
     4147        }
     4148
     4149        // Determine board url - we may need it later
     4150        $board_url = generate_board_url() . '/';
     4151        $web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $phpbb_root_path;
    36594152
    36604153        // Which timezone?
     
    36854178                'S_USER_NEW_PRIVMSG'                    => $user->data['user_new_privmsg'],
    36864179                'S_USER_UNREAD_PRIVMSG'                 => $user->data['user_unread_privmsg'],
     4180                'S_USER_NEW'                                    => $user->data['user_new'],
    36874181
    36884182                'SID'                           => $SID,
     
    36904184                'SESSION_ID'            => $user->session_id,
    36914185                'ROOT_PATH'                     => $phpbb_root_path,
     4186                'BOARD_URL'                     => $board_url,
    36924187
    36934188                'L_LOGIN_LOGOUT'        => $l_login_logout,
     
    37114206                'U_SEARCH_NEW'                  => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'),
    37124207                'U_SEARCH_UNANSWERED'   => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'),
     4208                'U_SEARCH_UNREAD'               => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unreadposts'),
    37134209                'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),
    37144210                'U_DELETE_COOKIES'              => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),
    37154211                'U_TEAM'                                => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=leaders'),
     4212                'U_TERMS_USE'                   => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
     4213                'U_PRIVACY'                             => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
    37164214                'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '',
     4215                'U_FEED'                                => generate_board_url() . "/feed.$phpEx",
    37174216
    37184217                'S_USER_LOGGED_IN'              => ($user->data['user_id'] != ANONYMOUS) ? true : false,
     
    37364235                'S_NEW_PM'                              => ($s_privmsg_new) ? 1 : 0,
    37374236                'S_REGISTER_ENABLED'    => ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false,
    3738 
    3739                 'T_THEME_PATH'                  => "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme',
    3740                 'T_TEMPLATE_PATH'               => "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template',
    3741                 'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$phpbb_root_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template',
    3742                 'T_IMAGESET_PATH'               => "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset',
    3743                 'T_IMAGESET_LANG_PATH'  => "{$phpbb_root_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
    3744                 'T_IMAGES_PATH'                 => "{$phpbb_root_path}images/",
    3745                 'T_SMILIES_PATH'                => "{$phpbb_root_path}{$config['smilies_path']}/",
    3746                 'T_AVATAR_PATH'                 => "{$phpbb_root_path}{$config['avatar_path']}/",
    3747                 'T_AVATAR_GALLERY_PATH' => "{$phpbb_root_path}{$config['avatar_gallery_path']}/",
    3748                 'T_ICONS_PATH'                  => "{$phpbb_root_path}{$config['icons_path']}/",
    3749                 'T_RANKS_PATH'                  => "{$phpbb_root_path}{$config['ranks_path']}/",
    3750                 'T_UPLOAD_PATH'                 => "{$phpbb_root_path}{$config['upload_path']}/",
    3751                 'T_STYLESHEET_LINK'             => (!$user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&amp;id=" . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang'],
     4237                'S_FORUM_ID'                    => $forum_id,
     4238                'S_TOPIC_ID'                    => $topic_id,
     4239
     4240                'S_LOGIN_ACTION'                => ((!defined('ADMIN_START')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id)),
     4241                'S_LOGIN_REDIRECT'              => build_hidden_fields(array('redirect' => str_replace('&amp;', '&', build_url()))),
     4242
     4243                'S_ENABLE_FEEDS'                        => ($config['feed_enable']) ? true : false,
     4244                'S_ENABLE_FEEDS_OVERALL'        => ($config['feed_overall']) ? true : false,
     4245                'S_ENABLE_FEEDS_FORUMS'         => ($config['feed_overall_forums']) ? true : false,
     4246                'S_ENABLE_FEEDS_TOPICS'         => ($config['feed_topics_new']) ? true : false,
     4247                'S_ENABLE_FEEDS_TOPICS_ACTIVE'  => ($config['feed_topics_active']) ? true : false,
     4248                'S_ENABLE_FEEDS_NEWS'           => ($s_feed_news) ? true : false,
     4249
     4250                'T_THEME_PATH'                  => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme',
     4251                'T_TEMPLATE_PATH'               => "{$web_path}styles/" . $user->theme['template_path'] . '/template',
     4252                'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template',
     4253                'T_IMAGESET_PATH'               => "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset',
     4254                'T_IMAGESET_LANG_PATH'  => "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->data['user_lang'],
     4255                'T_IMAGES_PATH'                 => "{$web_path}images/",
     4256                'T_SMILIES_PATH'                => "{$web_path}{$config['smilies_path']}/",
     4257                'T_AVATAR_PATH'                 => "{$web_path}{$config['avatar_path']}/",
     4258                'T_AVATAR_GALLERY_PATH' => "{$web_path}{$config['avatar_gallery_path']}/",
     4259                'T_ICONS_PATH'                  => "{$web_path}{$config['icons_path']}/",
     4260                'T_RANKS_PATH'                  => "{$web_path}{$config['ranks_path']}/",
     4261                'T_UPLOAD_PATH'                 => "{$web_path}{$config['upload_path']}/",
     4262                'T_STYLESHEET_LINK'             => (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&amp;lang=' . $user->data['user_lang'], true, $user->session_id),
    37524263                'T_STYLESHEET_NAME'             => $user->theme['theme_name'],
     4264
     4265                'T_THEME_NAME'                  => $user->theme['theme_path'],
     4266                'T_TEMPLATE_NAME'               => $user->theme['template_path'],
     4267                'T_SUPER_TEMPLATE_NAME' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? $user->theme['template_inherit_path'] : $user->theme['template_path'],
     4268                'T_IMAGESET_NAME'               => $user->theme['imageset_path'],
     4269                'T_IMAGESET_LANG_NAME'  => $user->data['user_lang'],
     4270                'T_IMAGES'                              => 'images',
     4271                'T_SMILIES'                             => $config['smilies_path'],
     4272                'T_AVATAR'                              => $config['avatar_path'],
     4273                'T_AVATAR_GALLERY'              => $config['avatar_gallery_path'],
     4274                'T_ICONS'                               => $config['icons_path'],
     4275                'T_RANKS'                               => $config['ranks_path'],
     4276                'T_UPLOAD'                              => $config['upload_path'],
    37534277
    37544278                'SITE_LOGO_IMG'                 => $user->img('site_logo'),
     
    37854309                }
    37864310
    3787                 $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime);
     4311                $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress'] && @extension_loaded('zlib')) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime);
    37884312
    37894313                if ($auth->acl_get('a_') && defined('DEBUG_EXTRA'))
     
    38134337
    38144338        // Call cron-type script
     4339        $call_cron = false;
    38154340        if (!defined('IN_CRON') && $run_cron && !$config['board_disable'])
    38164341        {
     4342                $call_cron = true;
     4343                $time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();
     4344
     4345                // Any old lock present?
     4346                if (!empty($config['cron_lock']))
     4347                {
     4348                        $cron_time = explode(' ', $config['cron_lock']);
     4349
     4350                        // If 1 hour lock is present we do not call cron.php
     4351                        if ($cron_time[0] + 3600 >= $time_now)
     4352                        {
     4353                                $call_cron = false;
     4354                        }
     4355                }
     4356        }
     4357
     4358        // Call cron job?
     4359        if ($call_cron)
     4360        {
    38174361                $cron_type = '';
    38184362
    3819                 if (time() - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
     4363                if ($time_now - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx))
    38204364                {
    38214365                        // Process email queue
    38224366                        $cron_type = 'queue';
    38234367                }
    3824                 else if (method_exists($cache, 'tidy') && time() - $config['cache_gc'] > $config['cache_last_gc'])
     4368                else if (method_exists($cache, 'tidy') && $time_now - $config['cache_gc'] > $config['cache_last_gc'])
    38254369                {
    38264370                        // Tidy the cache
    38274371                        $cron_type = 'tidy_cache';
    38284372                }
    3829                 else if (time() - $config['warnings_gc'] > $config['warnings_last_gc'])
     4373                else if ($config['warnings_expire_days'] && ($time_now - $config['warnings_gc'] > $config['warnings_last_gc']))
    38304374                {
    38314375                        $cron_type = 'tidy_warnings';
    38324376                }
    3833                 else if (time() - $config['database_gc'] > $config['database_last_gc'])
     4377                else if ($time_now - $config['database_gc'] > $config['database_last_gc'])
    38344378                {
    38354379                        // Tidy the database
    38364380                        $cron_type = 'tidy_database';
    38374381                }
    3838                 else if (time() - $config['search_gc'] > $config['search_last_gc'])
     4382                else if ($time_now - $config['search_gc'] > $config['search_last_gc'])
    38394383                {
    38404384                        // Tidy the search
    38414385                        $cron_type = 'tidy_search';
    38424386                }
    3843                 else if (time() - $config['session_gc'] > $config['session_last_gc'])
     4387                else if ($time_now - $config['session_gc'] > $config['session_last_gc'])
    38444388                {
    38454389                        $cron_type = 'tidy_sessions';
  • trunk/forum/includes/functions_admin.php

    r400 r702  
    33*
    44* @package acp
    5 * @version $Id: functions_admin.php 9065 2008-11-13 17:32:55Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    1818
    1919/**
    20 * Recalculate Binary Tree
    21 function recalc_btree($sql_id, $sql_table, $module_class = '')
     20* Recalculate Nested Sets
     21*
     22* @param int    $new_id first left_id (should start with 1)
     23* @param string $pkey   primary key-column (containing the id for the parent_id of the children)
     24* @param string $table  constant or fullname of the table
     25* @param int    $parent_id parent_id of the current set (default = 0)
     26* @param array  $where  contains strings to compare closer on the where statement (additional)
     27*
     28* @author EXreaction
     29*/
     30function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = array())
    2231{
    2332        global $db;
    2433
    25         if (!$sql_id || !$sql_table)
    26         {
    27                 return;
    28         }
    29 
    30         $sql_where = ($module_class) ? " WHERE module_class = '" . $db->sql_escape($module_class) . "'" : '';
    31 
    32         // Reset to minimum possible left and right id
    33         $sql = "SELECT MIN(left_id) as min_left_id, MIN(right_id) as min_right_id
    34                 FROM $sql_table
    35                 $sql_where";
     34        $sql = 'SELECT *
     35                FROM ' . $table . '
     36                WHERE parent_id = ' . (int) $parent_id .
     37                ((!empty($where)) ? ' AND ' . implode(' AND ', $where) : '') . '
     38                ORDER BY left_id ASC';
    3639        $result = $db->sql_query($sql);
    37         $row = $db->sql_fetchrow($result);
     40        while ($row = $db->sql_fetchrow($result))
     41        {
     42                // First we update the left_id for this module
     43                if ($row['left_id'] != $new_id)
     44                {
     45                        $db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('left_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}");
     46                }
     47                $new_id++;
     48
     49                // Then we go through any children and update their left/right id's
     50                recalc_nested_sets($new_id, $pkey, $table, $row[$pkey], $where);
     51
     52                // Then we come back and update the right_id for this module
     53                if ($row['right_id'] != $new_id)
     54                {
     55                        $db->sql_query('UPDATE ' . $table . ' SET ' . $db->sql_build_array('UPDATE', array('right_id' => $new_id)) . " WHERE $pkey = {$row[$pkey]}");
     56                }
     57                $new_id++;
     58        }
    3859        $db->sql_freeresult($result);
    39 
    40         $substract = (int) (min($row['min_left_id'], $row['min_right_id']) - 1);
    41 
    42         if ($substract > 0)
    43         {
    44                 $sql = "UPDATE $sql_table
    45                         SET left_id = left_id - $substract, right_id = right_id - $substract
    46                         $sql_where";
    47                 $db->sql_query($sql);
    48         }
    49 
    50         $sql = "SELECT $sql_id, parent_id, left_id, right_id
    51                 FROM $sql_table
    52                 $sql_where
    53                 ORDER BY left_id ASC, parent_id ASC, $sql_id ASC";
    54         $f_result = $db->sql_query($sql);
    55 
    56         while ($item_data = $db->sql_fetchrow($f_result))
    57         {
    58                 if ($item_data['parent_id'])
    59                 {
    60                         $sql = "SELECT left_id, right_id
    61                                 FROM $sql_table
    62                                 $sql_where " . (($sql_where) ? 'AND' : 'WHERE') . "
    63                                         $sql_id = {$item_data['parent_id']}";
    64                         $result = $db->sql_query($sql);
    65 
    66                         if (!$row = $db->sql_fetchrow($result))
    67                         {
    68                                 $sql = "UPDATE $sql_table SET parent_id = 0 WHERE $sql_id = " . $item_data[$sql_id];
    69                                 $db->sql_query($sql);
    70                         }
    71                         $db->sql_freeresult($result);
    72 
    73                         $sql = "UPDATE $sql_table
    74                                 SET left_id = left_id + 2, right_id = right_id + 2
    75                                 $sql_where " . (($sql_where) ? 'AND' : 'WHERE') . "
    76                                         left_id > {$row['right_id']}";
    77                         $db->sql_query($sql);
    78 
    79                         $sql = "UPDATE $sql_table
    80                                 SET right_id = right_id + 2
    81                                 $sql_where " . (($sql_where) ? 'AND' : 'WHERE') . "
    82                                         {$row['left_id']} BETWEEN left_id AND right_id";
    83                         $db->sql_query($sql);
    84 
    85                         $item_data['left_id'] = $row['right_id'];
    86                         $item_data['right_id'] = $row['right_id'] + 1;
    87                 }
    88                 else
    89                 {
    90                         $sql = "SELECT MAX(right_id) AS right_id
    91                                 FROM $sql_table
    92                                 $sql_where";
    93                         $result = $db->sql_query($sql);
    94                         $row = $db->sql_fetchrow($result);
    95                         $db->sql_freeresult($result);
    96 
    97                         $item_data['left_id'] = $row['right_id'] + 1;
    98                         $item_data['right_id'] = $row['right_id'] + 2;
    99                 }
    100 
    101                 $sql = "UPDATE $sql_table
    102                         SET left_id = {$item_data['left_id']}, right_id = {$item_data['right_id']}
    103                         WHERE $sql_id = " . $item_data[$sql_id];
    104                 $db->sql_query($sql);
    105         }
    106         $db->sql_freeresult($f_result);
    10760}
    108 */
    10961
    11062/**
     
    11567        global $db, $user, $auth;
    11668
    117         $acl = ($ignore_acl) ? '' : (($only_acl_post) ? 'f_post' : array('f_list', 'a_forum', 'a_forumadd', 'a_forumdel'));
    118 
    11969        // This query is identical to the jumpbox one
    120         $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id
     70        $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id
    12171                FROM ' . FORUMS_TABLE . '
    12272                ORDER BY left_id ASC';
     
    14797                $disabled = false;
    14898
    149                 if ($acl && !$auth->acl_gets($acl, $row['forum_id']))
    150                 {
    151                         // List permission?
    152                         if ($auth->acl_get('f_list', $row['forum_id']))
     99                if (!$ignore_acl && $auth->acl_get('f_list', $row['forum_id']))
     100                {
     101                        if ($only_acl_post && !$auth->acl_get('f_post', $row['forum_id']) || (!$auth->acl_get('m_approve', $row['forum_id']) && !$auth->acl_get('f_noapprove', $row['forum_id'])))
    153102                        {
    154103                                $disabled = true;
    155104                        }
    156                         else
    157                         {
    158                                 continue;
    159                         }
     105                        else if (!$only_acl_post && !$auth->acl_gets(array('f_list', 'a_forum', 'a_forumadd', 'a_forumdel'), $row['forum_id']))
     106                        {
     107                                $disabled = true;
     108                        }
     109                }
     110                else if (!$ignore_acl)
     111                {
     112                        continue;
    160113                }
    161114
     
    303256                if ($acl_list == '' || ($acl_list != '' && $auth->acl_gets($acl_list, $row['forum_id'])))
    304257                {
    305                         $rowset[] = ($id_only) ? $row['forum_id'] : $row;
     258                        $rowset[] = ($id_only) ? (int) $row['forum_id'] : $row;
    306259                }
    307260        }
     
    356309
    357310/**
     311* Copies permissions from one forum to others
     312*
     313* @param int    $src_forum_id           The source forum we want to copy permissions from
     314* @param array  $dest_forum_ids         The destination forum(s) we want to copy to
     315* @param bool   $clear_dest_perms       True if destination permissions should be deleted
     316* @param bool   $add_log                        True if log entry should be added
     317*
     318* @return bool                                          False on error
     319*
     320* @author bantu
     321*/
     322function copy_forum_permissions($src_forum_id, $dest_forum_ids, $clear_dest_perms = true, $add_log = true)
     323{
     324        global $db;
     325
     326        // Only one forum id specified
     327        if (!is_array($dest_forum_ids))
     328        {
     329                $dest_forum_ids = array($dest_forum_ids);
     330        }
     331
     332        // Make sure forum ids are integers
     333        $src_forum_id = (int) $src_forum_id;
     334        $dest_forum_ids = array_map('intval', $dest_forum_ids);
     335
     336        // No source forum or no destination forums specified
     337        if (empty($src_forum_id) || empty($dest_forum_ids))
     338        {
     339                return false;
     340        }
     341
     342        // Check if source forum exists
     343        $sql = 'SELECT forum_name
     344                FROM ' . FORUMS_TABLE . '
     345                WHERE forum_id = ' . $src_forum_id;
     346        $result = $db->sql_query($sql);
     347        $src_forum_name = $db->sql_fetchfield('forum_name');
     348        $db->sql_freeresult($result);
     349
     350        // Source forum doesn't exist
     351        if (empty($src_forum_name))
     352        {
     353                return false;
     354        }
     355
     356        // Check if destination forums exists
     357        $sql = 'SELECT forum_id, forum_name
     358                FROM ' . FORUMS_TABLE . '
     359                WHERE ' . $db->sql_in_set('forum_id', $dest_forum_ids);
     360        $result = $db->sql_query($sql);
     361
     362        $dest_forum_ids = $dest_forum_names = array();
     363        while ($row = $db->sql_fetchrow($result))
     364        {
     365                $dest_forum_ids[]       = (int) $row['forum_id'];
     366                $dest_forum_names[]     = $row['forum_name'];
     367        }
     368        $db->sql_freeresult($result);
     369
     370        // No destination forum exists
     371        if (empty($dest_forum_ids))
     372        {
     373                return false;
     374        }
     375
     376        // From the mysql documentation:
     377        // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear
     378        // in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14.
     379        // Due to this we stay on the safe side if we do the insertion "the manual way"
     380
     381        // Rowsets we're going to insert
     382        $users_sql_ary = $groups_sql_ary = array();
     383
     384        // Query acl users table for source forum data
     385        $sql = 'SELECT user_id, auth_option_id, auth_role_id, auth_setting
     386                FROM ' . ACL_USERS_TABLE . '
     387                WHERE forum_id = ' . $src_forum_id;
     388        $result = $db->sql_query($sql);
     389
     390        while ($row = $db->sql_fetchrow($result))
     391        {
     392                $row = array(
     393                        'user_id'                       => (int) $row['user_id'],
     394                        'auth_option_id'        => (int) $row['auth_option_id'],
     395                        'auth_role_id'          => (int) $row['auth_role_id'],
     396                        'auth_setting'          => (int) $row['auth_setting'],
     397                );
     398
     399                foreach ($dest_forum_ids as $dest_forum_id)
     400                {
     401                        $users_sql_ary[] = $row + array('forum_id' => $dest_forum_id);
     402                }
     403        }
     404        $db->sql_freeresult($result);
     405
     406        // Query acl groups table for source forum data
     407        $sql = 'SELECT group_id, auth_option_id, auth_role_id, auth_setting
     408                FROM ' . ACL_GROUPS_TABLE . '
     409                WHERE forum_id = ' . $src_forum_id;
     410        $result = $db->sql_query($sql);
     411
     412        while ($row = $db->sql_fetchrow($result))
     413        {
     414                $row = array(
     415                        'group_id'                      => (int) $row['group_id'],
     416                        'auth_option_id'        => (int) $row['auth_option_id'],
     417                        'auth_role_id'          => (int) $row['auth_role_id'],
     418                        'auth_setting'          => (int) $row['auth_setting'],
     419                );
     420
     421                foreach ($dest_forum_ids as $dest_forum_id)
     422                {
     423                        $groups_sql_ary[] = $row + array('forum_id' => $dest_forum_id);
     424                }
     425        }
     426        $db->sql_freeresult($result);
     427
     428        $db->sql_transaction('begin');
     429
     430        // Clear current permissions of destination forums
     431        if ($clear_dest_perms)
     432        {
     433                $sql = 'DELETE FROM ' . ACL_USERS_TABLE . '
     434                        WHERE ' . $db->sql_in_set('forum_id', $dest_forum_ids);
     435                $db->sql_query($sql);
     436
     437                $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . '
     438                        WHERE ' . $db->sql_in_set('forum_id', $dest_forum_ids);
     439                $db->sql_query($sql);
     440        }
     441
     442        $db->sql_multi_insert(ACL_USERS_TABLE, $users_sql_ary);
     443        $db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary);
     444
     445        if ($add_log)
     446        {
     447                add_log('admin', 'LOG_FORUM_COPIED_PERMISSIONS', $src_forum_name, implode(', ', $dest_forum_names));
     448        }
     449
     450        $db->sql_transaction('commit');
     451
     452        return true;
     453}
     454
     455/**
    358456* Get physical file listing
    359457*/
    360458function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png')
    361459{
    362         $matches = array();
     460        $matches = array($dir => array());
    363461
    364462        // Remove initial / if present
     
    620718        if ($approved_topics)
    621719        {
    622                 set_config('num_topics', $config['num_topics'] - $approved_topics, true);
     720                set_config_count('num_topics', $approved_topics * (-1), true);
    623721        }
    624722
     
    653751                }
    654752
    655                 $where_clause = $db->sql_in_set($where_type, array_map('intval', $where_ids));
     753                $where_ids = array_map('intval', $where_ids);
     754
     755/*              Possible code for splitting post deletion
     756                if (sizeof($where_ids) >= 1001)
     757                {
     758                        // Split into chunks of 1000
     759                        $chunks = array_chunk($where_ids, 1000);
     760
     761                        foreach ($chunks as $_where_ids)
     762                        {
     763                                delete_posts($where_type, $_where_ids, $auto_sync, $posted_sync, $post_count_sync, $call_delete_topics);
     764                        }
     765
     766                        return;
     767                }*/
     768
     769                $where_clause = $db->sql_in_set($where_type, $where_ids);
    656770        }
    657771
     
    666780        while ($row = $db->sql_fetchrow($result))
    667781        {
    668                 $post_ids[] = $row['post_id'];
    669                 $poster_ids[] = $row['poster_id'];
    670                 $topic_ids[] = $row['topic_id'];
    671                 $forum_ids[] = $row['forum_id'];
     782                $post_ids[] = (int) $row['post_id'];
     783                $poster_ids[] = (int) $row['poster_id'];
     784                $topic_ids[] = (int) $row['topic_id'];
     785                $forum_ids[] = (int) $row['forum_id'];
    672786
    673787                if ($row['post_postcount'] && $post_count_sync && $row['post_approved'])
     
    777891        if ($approved_posts)
    778892        {
    779                 set_config('num_posts', $config['num_posts'] - $approved_posts, true);
     893                set_config_count('num_posts', $approved_posts * (-1), true);
    780894        }
    781895
     
    800914        global $db, $config;
    801915
    802         if (is_array($ids) && sizeof($ids))
     916        // 0 is as bad as an empty array
     917        if (empty($ids))
     918        {
     919                return false;
     920        }
     921
     922        if (is_array($ids))
    803923        {
    804924                $ids = array_unique($ids);
     
    810930        }
    811931
    812         if (!sizeof($ids))
    813         {
    814                 return false;
    815         }
     932        $sql_where = '';
    816933
    817934        switch ($mode)
     
    820937                case 'message':
    821938                        $sql_id = 'post_msg_id';
     939                        $sql_where = ' AND in_message = ' . ($mode == 'message' ? 1 : 0);
    822940                break;
    823941
     
    843961                        FROM ' . ATTACHMENTS_TABLE . '
    844962                        WHERE ' . $db->sql_in_set($sql_id, $ids);
     963
     964        $sql .= $sql_where;
     965
    845966        $result = $db->sql_query($sql);
    846967
     
    868989        $sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . '
    869990                WHERE ' . $db->sql_in_set($sql_id, $ids);
     991
     992        $sql .= $sql_where;
     993
    870994        $db->sql_query($sql);
    871995        $num_deleted = $db->sql_affectedrows();
     
    8951019        if ($space_removed || $files_removed)
    8961020        {
    897                 set_config('upload_dir_size', $config['upload_dir_size'] - $space_removed, true);
    898                 set_config('num_files', $config['num_files'] - $files_removed, true);
     1021                set_config_count('upload_dir_size', $space_removed * (-1), true);
     1022                set_config_count('num_files', $files_removed * (-1), true);
    8991023        }
    9001024
     
    9161040        if (sizeof($post_ids))
    9171041        {
    918                 $sql = 'UPDATE ' . POSTS_TABLE . '
    919                         SET post_attachment = 0
    920                         WHERE ' . $db->sql_in_set('post_id', $post_ids);
    921                 $db->sql_query($sql);
     1042                // Just check which posts are still having an assigned attachment not orphaned by querying the attachments table
     1043                $sql = 'SELECT post_msg_id
     1044                        FROM ' . ATTACHMENTS_TABLE . '
     1045                        WHERE ' . $db->sql_in_set('post_msg_id', $post_ids) . '
     1046                                AND in_message = 0
     1047                                AND is_orphan = 0';
     1048                $result = $db->sql_query($sql);
     1049
     1050                $remaining_ids = array();
     1051                while ($row = $db->sql_fetchrow($result))
     1052                {
     1053                        $remaining_ids[] = $row['post_msg_id'];
     1054                }
     1055                $db->sql_freeresult($result);
     1056
     1057                // Now only unset those ids remaining
     1058                $post_ids = array_diff($post_ids, $remaining_ids);
     1059
     1060                if (sizeof($post_ids))
     1061                {
     1062                        $sql = 'UPDATE ' . POSTS_TABLE . '
     1063                                SET post_attachment = 0
     1064                                WHERE ' . $db->sql_in_set('post_id', $post_ids);
     1065                        $db->sql_query($sql);
     1066                }
    9221067        }
    9231068
     
    9251070        if (sizeof($message_ids))
    9261071        {
    927                 $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
    928                         SET message_attachment = 0
    929                         WHERE ' . $db->sql_in_set('msg_id', $message_ids);
    930                 $db->sql_query($sql);
     1072                // Just check which messages are still having an assigned attachment not orphaned by querying the attachments table
     1073                $sql = 'SELECT post_msg_id
     1074                        FROM ' . ATTACHMENTS_TABLE . '
     1075                        WHERE ' . $db->sql_in_set('post_msg_id', $message_ids) . '
     1076                                AND in_message = 1
     1077                                AND is_orphan = 0';
     1078                $result = $db->sql_query($sql);
     1079
     1080                $remaining_ids = array();
     1081                while ($row = $db->sql_fetchrow($result))
     1082                {
     1083                        $remaining_ids[] = $row['post_msg_id'];
     1084                }
     1085                $db->sql_freeresult($result);
     1086
     1087                // Now only unset those ids remaining
     1088                $message_ids = array_diff($message_ids, $remaining_ids);
     1089
     1090                if (sizeof($message_ids))
     1091                {
     1092                        $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
     1093                                SET message_attachment = 0
     1094                                WHERE ' . $db->sql_in_set('msg_id', $message_ids);
     1095                        $db->sql_query($sql);
     1096                }
    9311097        }
    9321098
     
    10741240        $sql = 'SELECT COUNT(attach_id) AS num_entries
    10751241                FROM ' . ATTACHMENTS_TABLE . "
    1076                 WHERE physical_filename = '" . $db->sql_escape(basename($filename)) . "'";
     1242                WHERE physical_filename = '" . $db->sql_escape(utf8_basename($filename)) . "'";
    10771243        $result = $db->sql_query($sql);
    10781244        $num_entries = (int) $db->sql_fetchfield('num_entries');
     
    10851251        }
    10861252
    1087         $filename = ($mode == 'thumbnail') ? 'thumb_' . basename($filename) : basename($filename);
     1253        $filename = ($mode == 'thumbnail') ? 'thumb_' . utf8_basename($filename) : utf8_basename($filename);
    10881254        return @unlink($phpbb_root_path . $config['upload_path'] . '/' . $filename);
    10891255}
     
    11691335        {
    11701336                case 'topic_moved':
     1337                        $db->sql_transaction('begin');
    11711338                        switch ($db->sql_layer)
    11721339                        {
     
    12051372                                break;
    12061373                        }
    1207                 break;
     1374
     1375                        $db->sql_transaction('commit');
     1376                        break;
    12081377
    12091378                case 'topic_approved':
     1379
     1380                        $db->sql_transaction('begin');
    12101381                        switch ($db->sql_layer)
    12111382                        {
     
    12431414                                break;
    12441415                        }
    1245                 break;
     1416
     1417                        $db->sql_transaction('commit');
     1418                        break;
    12461419
    12471420                case 'post_reported':
    12481421                        $post_ids = $post_reported = array();
     1422
     1423                        $db->sql_transaction('begin');
    12491424
    12501425                        $sql = 'SELECT p.post_id, p.post_reported
     
    12981473                                $db->sql_query($sql);
    12991474                        }
    1300                 break;
     1475
     1476                        $db->sql_transaction('commit');
     1477                        break;
    13011478
    13021479                case 'topic_reported':
     
    13071484
    13081485                        $topic_ids = $topic_reported = array();
     1486
     1487                        $db->sql_transaction('begin');
    13091488
    13101489                        $sql = 'SELECT DISTINCT(t.topic_id)
     
    13401519                                $db->sql_query($sql);
    13411520                        }
    1342                 break;
     1521
     1522                        $db->sql_transaction('commit');
     1523                        break;
    13431524
    13441525                case 'post_attachment':
    13451526                        $post_ids = $post_attachment = array();
     1527
     1528                        $db->sql_transaction('begin');
    13461529
    13471530                        $sql = 'SELECT p.post_id, p.post_attachment
     
    13951578                                $db->sql_query($sql);
    13961579                        }
    1397                 break;
     1580
     1581                        $db->sql_transaction('commit');
     1582                        break;
    13981583
    13991584                case 'topic_attachment':
     
    14041589
    14051590                        $topic_ids = $topic_attachment = array();
     1591
     1592                        $db->sql_transaction('begin');
    14061593
    14071594                        $sql = 'SELECT DISTINCT(t.topic_id)
     
    14371624                                $db->sql_query($sql);
    14381625                        }
    1439                 break;
     1626
     1627                        $db->sql_transaction('commit');
     1628
     1629                        break;
    14401630
    14411631                case 'forum':
     1632
     1633                        $db->sql_transaction('begin');
    14421634
    14431635                        // 1: Get the list of all forums
     
    16411833                                }
    16421834                        }
    1643                 break;
     1835
     1836                        $db->sql_transaction('commit');
     1837                        break;
    16441838
    16451839                case 'topic':
    16461840                        $topic_data = $post_ids = $approved_unapproved_ids = $resync_forums = $delete_topics = $delete_posts = $moved_topics = array();
     1841
     1842                        $db->sql_transaction('begin');
    16471843
    16481844                        $sql = 'SELECT t.topic_id, t.forum_id, t.topic_moved_id, t.topic_approved, ' . (($sync_extra) ? 't.topic_attachment, t.topic_reported, ' : '') . 't.topic_poster, t.topic_time, t.topic_replies, t.topic_replies_real, t.topic_first_post_id, t.topic_first_poster_name, t.topic_first_poster_colour, t.topic_last_post_id, t.topic_last_post_subject, t.topic_last_poster_id, t.topic_last_poster_name, t.topic_last_poster_colour, t.topic_last_post_time
     
    19682164                        unset($topic_data);
    19692165
     2166                        $db->sql_transaction('commit');
     2167
    19702168                        // if some topics have been resync'ed then resync parent forums
    19712169                        // except when we're only syncing a range, we don't want to sync forums during
     
    19752173                                sync('forum', 'forum_id', array_values($resync_forums), true, true);
    19762174                        }
    1977                 break;
     2175                        break;
    19782176        }
    19792177
     
    21612359                // Remove users who have group memberships with DENY moderator permissions
    21622360                $sql = $db->sql_build_query('SELECT', array(
    2163                         'SELECT'        => 'a.forum_id, ug.user_id',
     2361                        'SELECT'        => 'a.forum_id, ug.user_id, g.group_id',
    21642362
    21652363                        'FROM'          => array(
    21662364                                ACL_OPTIONS_TABLE       => 'o',
    21672365                                USER_GROUP_TABLE        => 'ug',
    2168                                 ACL_GROUPS_TABLE        => 'a'
     2366                                GROUPS_TABLE            => 'g',
     2367                                ACL_GROUPS_TABLE        => 'a',
    21692368                        ),
    21702369
     
    21802379                                        OR r.auth_setting = ' . ACL_NEVER . ')
    21812380                                AND a.group_id = ug.group_id
     2381                                AND g.group_id = ug.group_id
     2382                                AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
    21822383                                AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . "
    21832384                                AND ug.user_pending = 0
     
    22992500* View log
    23002501*/
    2301 function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC')
     2502function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id = 0, $topic_id = 0, $user_id = 0, $limit_days = 0, $sort_by = 'l.log_time DESC', $keywords = '')
    23022503{
    23032504        global $db, $user, $auth, $phpEx, $phpbb_root_path, $phpbb_admin_path;
     
    23162517                case 'mod':
    23172518                        $log_type = LOG_MOD;
     2519                        $sql_forum = '';
    23182520
    23192521                        if ($topic_id)
    23202522                        {
    2321                                 $sql_forum = 'AND l.topic_id = ' . intval($topic_id);
     2523                                $sql_forum = 'AND l.topic_id = ' . (int) $topic_id;
    23222524                        }
    23232525                        else if (is_array($forum_id))
     
    23252527                                $sql_forum = 'AND ' . $db->sql_in_set('l.forum_id', array_map('intval', $forum_id));
    23262528                        }
    2327                         else
    2328                         {
    2329                                 $sql_forum = ($forum_id) ? 'AND l.forum_id = ' . intval($forum_id) : '';
     2529                        else if ($forum_id)
     2530                        {
     2531                                $sql_forum = 'AND l.forum_id = ' . (int) $forum_id;
    23302532                        }
    23312533                break;
     
    23482550                default:
    23492551                        return;
     2552        }
     2553
     2554        // Use no preg_quote for $keywords because this would lead to sole backslashes being added
     2555        // We also use an OR connection here for spaces and the | string. Currently, regex is not supported for searching (but may come later).
     2556        $keywords = preg_split('#[\s|]+#u', utf8_strtolower($keywords), 0, PREG_SPLIT_NO_EMPTY);
     2557        $sql_keywords = '';
     2558
     2559        if (!empty($keywords))
     2560        {
     2561                $keywords_pattern = array();
     2562
     2563                // Build pattern and keywords...
     2564                for ($i = 0, $num_keywords = sizeof($keywords); $i < $num_keywords; $i++)
     2565                {
     2566                        $keywords_pattern[] = preg_quote($keywords[$i], '#');
     2567                        $keywords[$i] = $db->sql_like_expression($db->any_char . $keywords[$i] . $db->any_char);
     2568                }
     2569
     2570                $keywords_pattern = '#' . implode('|', $keywords_pattern) . '#ui';
     2571
     2572                $operations = array();
     2573                foreach ($user->lang as $key => $value)
     2574                {
     2575                        if (substr($key, 0, 4) == 'LOG_' && preg_match($keywords_pattern, $value))
     2576                        {
     2577                                $operations[] = $key;
     2578                        }
     2579                }
     2580
     2581                $sql_keywords = 'AND (';
     2582                if (!empty($operations))
     2583                {
     2584                        $sql_keywords .= $db->sql_in_set('l.log_operation', $operations) . ' OR ';
     2585                }
     2586                $sql_keywords .= 'LOWER(l.log_data) ' . implode(' OR LOWER(l.log_data) ', $keywords) . ')';
    23502587        }
    23512588
     
    23552592                        AND u.user_id = l.user_id
    23562593                        " . (($limit_days) ? "AND l.log_time >= $limit_days" : '') . "
     2594                        $sql_keywords
    23572595                        $sql_forum
    23582596                ORDER BY $sort_by";
     
    23952633                if (!empty($row['log_data']))
    23962634                {
    2397                         $log_data_ary = unserialize($row['log_data']);
     2635                        $log_data_ary = @unserialize($row['log_data']);
     2636                        $log_data_ary = ($log_data_ary === false) ? array() : $log_data_ary;
    23982637
    23992638                        if (isset($user->lang[$row['log_operation']]))
     
    24182657                                }
    24192658                        }
    2420                         else
     2659                        else if (!empty($log_data_ary))
    24212660                        {
    24222661                                $log[$i]['action'] .= '<br />' . implode('', $log_data_ary);
     
    25162755
    25172756        $sql = 'SELECT COUNT(l.log_id) AS total_entries
    2518                 FROM ' . LOG_TABLE . " l
     2757                FROM ' . LOG_TABLE . ' l, ' . USERS_TABLE . " u
    25192758                WHERE l.log_type = $log_type
     2759                        AND l.user_id = u.user_id
    25202760                        AND l.log_time >= $limit_days
     2761                        $sql_keywords
    25212762                        $sql_forum";
    25222763        $result = $db->sql_query($sql);
     
    26612902        }
    26622903
    2663         $sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason
     2904        $sql = 'SELECT *
    26642905                FROM ' . USERS_TABLE . '
    26652906                WHERE user_type = ' . USER_INACTIVE .
     
    30303271}
    30313272
     3273/**
     3274 * Obtains the latest version information
     3275 *
     3276 * @param bool $force_update Ignores cached data. Defaults to false.
     3277 * @param bool $warn_fail Trigger a warning if obtaining the latest version information fails. Defaults to false.
     3278 * @param int $ttl Cache version information for $ttl seconds. Defaults to 86400 (24 hours).
     3279 *
     3280 * @return string | false Version info on success, false on failure.
     3281 */
     3282function obtain_latest_version_info($force_update = false, $warn_fail = false, $ttl = 86400)
     3283{
     3284        global $cache;
     3285
     3286        $info = $cache->get('versioncheck');
     3287
     3288        if ($info === false || $force_update)
     3289        {
     3290                $errstr = '';
     3291                $errno = 0;
     3292
     3293                $info = get_remote_file('www.phpbb.com', '/updatecheck',
     3294                                ((defined('PHPBB_QA')) ? '30x_qa.txt' : '30x.txt'), $errstr, $errno);
     3295
     3296                if ($info === false)
     3297                {
     3298                        $cache->destroy('versioncheck');
     3299                        if ($warn_fail)
     3300                        {
     3301                                trigger_error($errstr, E_USER_WARNING);
     3302                        }
     3303                        return false;
     3304                }
     3305
     3306                $cache->put('versioncheck', $info, $ttl);
     3307        }
     3308
     3309        return $info;
     3310}
     3311
     3312/**
     3313 * Enables a particular flag in a bitfield column of a given table.
     3314 *
     3315 * @param string        $table_name             The table to update
     3316 * @param string        $column_name    The column containing a bitfield to update
     3317 * @param int           $flag                   The binary flag which is OR-ed with the current column value
     3318 * @param string        $sql_more               This string is attached to the sql query generated to update the table.
     3319 *
     3320 * @return void
     3321 */
     3322function enable_bitfield_column_flag($table_name, $column_name, $flag, $sql_more = '')
     3323{
     3324        global $db;
     3325
     3326        $sql = 'UPDATE ' . $table_name . '
     3327                SET ' . $column_name . ' = ' . $db->sql_bit_or($column_name, $flag) . '
     3328                ' . $sql_more;
     3329        $db->sql_query($sql);
     3330}
     3331
    30323332?>
  • trunk/forum/includes/functions_compress.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_compress.php 8780 2008-08-22 12:52:48Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    8181                        }
    8282                }
     83                else
     84                {
     85                        // $src does not exist
     86                        return false;
     87                }
    8388
    8489                return true;
     
    9095        function add_custom_file($src, $filename)
    9196        {
     97                if (!file_exists($src))
     98                {
     99                        return false;
     100                }
     101
    92102                $this->data($filename, file_get_contents($src), false, stat($src));
    93103                return true;
     
    156166        function compress_zip($mode, $file)
    157167        {
    158                 return $this->fp = @fopen($file, $mode . 'b');
     168                $this->fp = @fopen($file, $mode . 'b');
     169
     170                if (!$this->fp)
     171                {
     172                        trigger_error('Unable to open file ' . $file . ' [' . $mode . 'b]');
     173                }
    159174        }
    160175
  • trunk/forum/includes/functions_content.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_content.php 9184 2008-12-11 14:46:38Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    251251        $text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", '     '));
    252252
     253        // we need to turn the entities back into their original form, to not cut the message in between them
     254        $entities = array('&lt;', '&gt;', '&#91;', '&#93;', '&#46;', '&#58;', '&#058;');
     255        $characters = array('<', '>', '[', ']', '.', ':', ':');
     256        $text = str_replace($entities, $characters, $text);
     257
    253258        $word_indizes = array();
    254259        if (sizeof($words))
     
    262267                                if (preg_match('#(?:[^\w]|^)(' . $word . ')(?:[^\w]|$)#i', $text, $match))
    263268                                {
     269                                        if (empty($match[1]))
     270                                        {
     271                                                continue;
     272                                        }
     273
    264274                                        $pos = utf8_strpos($text, $match[1]);
    265275                                        if ($pos !== false)
     
    341351                                }
    342352                        }
    343                         return $final_text;
     353                        return str_replace($characters, $entities, $final_text);
    344354                }
    345355        }
     
    347357        if (!sizeof($words) || !sizeof($word_indizes))
    348358        {
    349                 return (utf8_strlen($text) >= $length + 3) ? utf8_substr($text, 0, $length) . '...' : $text;
     359                return str_replace($characters, $entities, ((utf8_strlen($text) >= $length + 3) ? utf8_substr($text, 0, $length) . '...' : $text));
    350360        }
    351361}
     
    676686        static $censors;
    677687
     688        // Nothing to do?
     689        if ($text === '')
     690        {
     691                return '';
     692        }
     693
    678694        // We moved the word censor checks in here because we call this function quite often - and then only need to do the check once
    679695        if (!isset($censors) || !is_array($censors))
     
    724740        else
    725741        {
    726                 return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . $phpbb_root_path . $config['smilies_path'] . '/\2 />', $text);
     742                $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
     743                return preg_replace('#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/(.*?) \/><!\-\- s\1 \-\->#', '<img src="' . $root_path . $config['smilies_path'] . '/\2 />', $text);
    727744        }
    728745}
     
    832849                // Some basics...
    833850                $attachment['extension'] = strtolower(trim($attachment['extension']));
    834                 $filename = $phpbb_root_path . $config['upload_path'] . '/' . basename($attachment['physical_filename']);
    835                 $thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']);
     851                $filename = $phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($attachment['physical_filename']);
     852                $thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . utf8_basename($attachment['physical_filename']);
    836853
    837854                $upload_icon = '';
     
    849866                }
    850867
    851                 $filesize = $attachment['filesize'];
    852                 $size_lang = ($filesize >= 1048576) ? $user->lang['MIB'] : (($filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
    853                 $filesize = get_formatted_filesize($filesize, false);
     868                $filesize = get_formatted_filesize($attachment['filesize'], false);
    854869
    855870                $comment = bbcode_nl2br(censor_text($attachment['attach_comment']));
     
    857872                $block_array += array(
    858873                        'UPLOAD_ICON'           => $upload_icon,
    859                         'FILESIZE'                      => $filesize,
    860                         'SIZE_LANG'                     => $size_lang,
    861                         'DOWNLOAD_NAME'         => basename($attachment['real_filename']),
     874                        'FILESIZE'                      => $filesize['value'],
     875                        'SIZE_LANG'                     => $filesize['unit'],
     876                        'DOWNLOAD_NAME'         => utf8_basename($attachment['real_filename']),
    862877                        'COMMENT'                       => $comment,
    863878                );
     
    951966                                                'THUMB_IMAGE'           => $thumbnail_link,
    952967                                        );
     968
     969                                        $update_count[] = $attachment['attach_id'];
    953970                                break;
    954971
     
    9971014                                                'WIDTH'                 => $width,
    9981015                                                'HEIGHT'                => $height,
     1016                                                'U_VIEW_LINK'   => $download_link . '&amp;view=1',
    9991017                                        );
    10001018
     
    10891107* @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char)
    10901108* @param int $max_store_length Maximum character length of string (multibyte character count as 1 char / Html entity count as entity chars).
    1091 * @param bool $allow_reply Allow Re: in front of string
     1109* @param bool $allow_reply Allow Re: in front of string
     1110*       NOTE: This parameter can cause undesired behavior (returning strings longer than $max_store_legnth) and is deprecated.
    10921111* @param string $append String to be appended
    10931112*/
    1094 function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = true, $append = '')
     1113function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '')
    10951114{
    10961115        $chars = array();
     
    11271146                        $string = implode('', $chars);
    11281147                }
    1129                 while (utf8_strlen($string) > $max_store_length || !sizeof($chars));
     1148                while (!empty($chars) && utf8_strlen($string) > $max_store_length);
    11301149        }
    11311150
     
    11601179{
    11611180        static $_profile_cache;
    1162         static $_base_profile_url;
    1163 
    1164         $cache_key = $user_id;
    1165 
    1166         // If the get_username_string() function had been executed once with an (to us) unkown mode, all modes are pre-filled and we can just grab it.
    1167         if ($user_id && $user_id != ANONYMOUS && isset($_profile_cache[$cache_key][$mode]))
    1168         {
    1169                 // If the mode is 'no_profile', we simply construct the TPL code due to calls to this mode being very very rare
    1170                 if ($mode == 'no_profile')
    1171                 {
    1172                         $tpl = (!$_profile_cache[$cache_key]['colour']) ? '{USERNAME}' : '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
    1173                         return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($_profile_cache[$cache_key]['colour'], $_profile_cache[$cache_key]['username']), $tpl);
    1174                 }
    1175 
    1176                 return $_profile_cache[$cache_key][$mode];
    1177         }
    1178 
    1179         global $phpbb_root_path, $phpEx, $user, $auth;
    1180 
    1181         $username_colour = ($username_colour) ? '#' . $username_colour : '';
    1182 
    1183         if ($guest_username === false)
    1184         {
    1185                 $username = ($username) ? $username : $user->lang['GUEST'];
    1186         }
    1187         else
    1188         {
    1189                 $username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $user->lang['GUEST']);
    1190         }
    1191 
    1192         // Build cache for all modes
    1193         $_profile_cache[$cache_key]['colour'] = $username_colour;
    1194         $_profile_cache[$cache_key]['username'] = $username;
    1195         $_profile_cache[$cache_key]['no_profile'] = true;
    1196 
    1197         // Profile url - only show if not anonymous and permission to view profile if registered user
    1198         // For anonymous the link leads to a login page.
    1199         if ($user_id && $user_id != ANONYMOUS && ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('u_viewprofile')))
    1200         {
    1201                 if (empty($_base_profile_url))
    1202                 {
    1203                         $_base_profile_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u={USER_ID}');
    1204                 }
    1205 
    1206                 $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&amp;u=' . (int) $user_id : str_replace('={USER_ID}', '=' . (int) $user_id, $_base_profile_url);
    1207                 $tpl = (!$username_colour) ? '<a href="{PROFILE_URL}">{USERNAME}</a>' : '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>';
    1208                 $_profile_cache[$cache_key]['full'] = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl);
    1209         }
    1210         else
    1211         {
    1212                 $tpl = (!$username_colour) ? '{USERNAME}' : '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
    1213                 $_profile_cache[$cache_key]['full'] = str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), $tpl);
    1214                 $profile_url = '';
    1215         }
    1216 
    1217         // Use the profile url from above
    1218         $_profile_cache[$cache_key]['profile'] = $profile_url;
    1219 
    1220         // If - by any chance - no_profile is called before any other mode, we need to do the calculation here
    1221         if ($mode == 'no_profile')
    1222         {
    1223                 $tpl = (!$_profile_cache[$cache_key]['colour']) ? '{USERNAME}' : '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
    1224                 return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($_profile_cache[$cache_key]['colour'], $_profile_cache[$cache_key]['username']), $tpl);
    1225         }
    1226 
    1227         return $_profile_cache[$cache_key][$mode];
     1181
     1182        // We cache some common variables we need within this function
     1183        if (empty($_profile_cache))
     1184        {
     1185                global $phpbb_root_path, $phpEx;
     1186
     1187                $_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u={USER_ID}');
     1188                $_profile_cache['tpl_noprofile'] = '{USERNAME}';
     1189                $_profile_cache['tpl_noprofile_colour'] = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
     1190                $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}">{USERNAME}</a>';
     1191                $_profile_cache['tpl_profile_colour'] = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>';
     1192        }
     1193
     1194        global $user, $auth;
     1195
     1196        // This switch makes sure we only run code required for the mode
     1197        switch ($mode)
     1198        {
     1199                case 'full':
     1200                case 'no_profile':
     1201                case 'colour':
     1202
     1203                        // Build correct username colour
     1204                        $username_colour = ($username_colour) ? '#' . $username_colour : '';
     1205
     1206                        // Return colour
     1207                        if ($mode == 'colour')
     1208                        {
     1209                                return $username_colour;
     1210                        }
     1211
     1212                // no break;
     1213
     1214                case 'username':
     1215
     1216                        // Build correct username
     1217                        if ($guest_username === false)
     1218                        {
     1219                                $username = ($username) ? $username : $user->lang['GUEST'];
     1220                        }
     1221                        else
     1222                        {
     1223                                $username = ($user_id && $user_id != ANONYMOUS) ? $username : ((!empty($guest_username)) ? $guest_username : $user->lang['GUEST']);
     1224                        }
     1225
     1226                        // Return username
     1227                        if ($mode == 'username')
     1228                        {
     1229                                return $username;
     1230                        }
     1231
     1232                // no break;
     1233
     1234                case 'profile':
     1235
     1236                        // Build correct profile url - only show if not anonymous and permission to view profile if registered user
     1237                        // For anonymous the link leads to a login page.
     1238                        if ($user_id && $user_id != ANONYMOUS && ($user->data['user_id'] == ANONYMOUS || $auth->acl_get('u_viewprofile')))
     1239                        {
     1240                                $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&amp;u=' . (int) $user_id : str_replace(array('={USER_ID}', '=%7BUSER_ID%7D'), '=' . (int) $user_id, $_profile_cache['base_url']);
     1241                        }
     1242                        else
     1243                        {
     1244                                $profile_url = '';
     1245                        }
     1246
     1247                        // Return profile
     1248                        if ($mode == 'profile')
     1249                        {
     1250                                return $profile_url;
     1251                        }
     1252
     1253                // no break;
     1254        }
     1255
     1256        if (($mode == 'full' && !$profile_url) || $mode == 'no_profile')
     1257        {
     1258                return str_replace(array('{USERNAME_COLOUR}', '{USERNAME}'), array($username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_noprofile'] : $_profile_cache['tpl_noprofile_colour']);
     1259        }
     1260
     1261        return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
    12281262}
    12291263
  • trunk/forum/includes/functions_convert.php

    r400 r702  
    33*
    44* @package install
    5 * @version $Id: functions_convert.php 8876 2008-09-18 14:26:56Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2006 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    206206/**
    207207* Generate the email hash stored in the users table
     208*
     209* Note: Deprecated, calls should directly go to phpbb_email_hash()
    208210*/
    209211function gen_email_hash($email)
    210212{
    211         return (crc32(strtolower($email)) . strlen($email));
     213        return phpbb_email_hash($email);
    212214}
    213215
     
    552554
    553555        // copy file will prepend $phpBB_root_path
    554         $target = $config[$config_var] . '/' . basename(($use_target === false) ? $source : $use_target);
     556        $target = $config[$config_var] . '/' . utf8_basename(($use_target === false) ? $source : $use_target);
    555557
    556558        if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0)
     
    568570        if ($result['copied'])
    569571        {
    570                 $result['target'] = basename($target);
     572                $result['target'] = utf8_basename($target);
    571573        }
    572574        else
    573575        {
    574                 $result['target'] = ($use_target !== false) ? $result['orig_source'] : basename($target);
     576                $result['target'] = ($use_target !== false) ? $result['orig_source'] : utf8_basename($target);
    575577        }
    576578
     
    601603                        $thumb_dir = $convert->convertor['thumbnails'][0];
    602604                        $thumb_prefix = $convert->convertor['thumbnails'][1];
    603                         $thumb_source = $thumb_dir . $thumb_prefix . basename($result['source']);
     605                        $thumb_source = $thumb_dir . $thumb_prefix . utf8_basename($result['source']);
    604606
    605607                        if (strpos($thumb_source, $convert->convertor['upload_path']) !== 0)
     
    12331235                }
    12341236
     1237                if (isset($convert->config_schema['array_name']))
     1238                {
     1239                        unset($convert->config_schema['array_name']);
     1240                }
     1241
    12351242                $convert_config = extract_variables_from_file($filename);
    12361243                if (!empty($convert->config_schema['array_name']))
     
    12651272
    12661273        $convert_config = get_config();
     1274
    12671275        foreach ($schema['settings'] as $config_name => $src)
    12681276        {
     
    12751283                else
    12761284                {
    1277                         $config_value = (isset($convert_config[$src])) ? $convert_config[$src] : '';
    1278                 }
     1285                        if ($schema['table_format'] != 'file' || empty($schema['array_name']))
     1286                        {
     1287                                $config_value = (isset($convert_config[$src])) ? $convert_config[$src] : '';
     1288                        }
     1289                        else if (!empty($schema['array_name']))
     1290                        {
     1291                                $src_ary = $schema['array_name'];
     1292                                $config_value = (isset($convert_config[$src_ary][$src])) ? $convert_config[$src_ary][$src] : '';
     1293                        }
     1294                }
    12791295
    12801296                if ($config_value !== '')
     
    16991715                'GLOBAL_MODERATORS'     => array('00AA00', 1, 0),
    17001716                'ADMINISTRATORS'        => array('AA0000', 1, 1),
    1701                 'BOTS'                          => array('9E8DA7', 0, 0)
     1717                'BOTS'                          => array('9E8DA7', 0, 0),
     1718                'NEWLY_REGISTERED'              => array('', 0, 0),
    17021719        );
    17031720
     
    22572274        if (substr($trg, -1) == '/')
    22582275        {
    2259                 $trg .= basename($src);
     2276                $trg .= utf8_basename($src);
    22602277        }
    22612278        $src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__);
  • trunk/forum/includes/functions_display.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_display.php 9082 2008-11-22 20:26:09Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    103103        $forum_tracking_info = array();
    104104        $branch_root_id = $root_data['forum_id'];
     105
     106        // Check for unread global announcements (index page only)
     107        $ga_unread = false;
     108        if ($root_data['forum_id'] == 0)
     109        {
     110                $unread_ga_list = get_unread_topics($user->data['user_id'], 'AND t.forum_id = 0', '', 1);
     111
     112                if (!empty($unread_ga_list))
     113                {
     114                        $ga_unread = true;
     115                }
     116        }
     117
    105118        while ($row = $db->sql_fetchrow($result))
    106119        {
     
    155168                }
    156169
     170                // Count the difference of real to public topics, so we can display an information to moderators
     171                $row['forum_id_unapproved_topics'] = ($auth->acl_get('m_approve', $forum_id) && ($row['forum_topics_real'] != $row['forum_topics'])) ? $forum_id : 0;
    157172                $row['forum_topics'] = ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics'];
    158173
     
    211226                        {
    212227                                $subforums[$parent_id][$row['parent_id']]['children'][] = $forum_id;
     228                        }
     229
     230                        if (!$forum_rows[$parent_id]['forum_id_unapproved_topics'] && $row['forum_id_unapproved_topics'])
     231                        {
     232                                $forum_rows[$parent_id]['forum_id_unapproved_topics'] = $forum_id;
    213233                        }
    214234
     
    238258        if ($mark_read == 'forums' || $mark_read == 'all')
    239259        {
    240                 $redirect = build_url('mark', 'hash');
     260                $redirect = build_url(array('mark', 'hash'));
    241261                $token = request_var('hash', '');
    242262                if (check_link_hash($token, 'global'))
     
    249269                        else
    250270                        {
     271                                // Add 0 to forums array to mark global announcements correctly
     272                                $forum_ids[] = 0;
    251273                                markread('topics', $forum_ids);
    252274                                $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
     
    300322
    301323                $forum_unread = (isset($forum_tracking_info[$forum_id]) && $row['orig_forum_last_post_time'] > $forum_tracking_info[$forum_id]) ? true : false;
     324
     325                // Mark the first visible forum on index as unread if there's any unread global announcement
     326                if ($ga_unread && !empty($forum_ids_moderator) && $forum_id == $forum_ids_moderator[0])
     327                {
     328                        $forum_unread = true;
     329                }
    302330
    303331                $folder_image = $folder_alt = $l_subforums = '';
     
    429457                        'S_LIST_SUBFORUMS'      => ($row['display_subforum_list']) ? true : false,
    430458                        'S_SUBFORUMS'           => (sizeof($subforums_list)) ? true : false,
     459                        'S_FEED_ENABLED'        => ($config['feed_forum'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $row['forum_options'])) ? true : false,
    431460
    432461                        'FORUM_ID'                              => $row['forum_id'],
     
    452481                        'L_MODERATOR_STR'               => $l_moderator,
    453482
     483                        'U_UNAPPROVED_TOPICS'   => ($row['forum_id_unapproved_topics']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=unapproved_topics&amp;f=' . $row['forum_id_unapproved_topics']) : '',
    454484                        'U_VIEWFORUM'           => $u_viewforum,
    455485                        'U_LAST_POSTER'         => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']),
     
    474504                'S_HAS_SUBFORUM'        => ($visible_forums) ? true : false,
    475505                'L_SUBFORUM'            => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
    476                 'LAST_POST_IMG'         => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'))
    477         );
     506                'LAST_POST_IMG'         => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
     507                'UNAPPROVED_IMG'        => $user->img('icon_topic_unapproved', 'TOPICS_UNAPPROVED'),
     508        ));
    478509
    479510        if ($return_moderators)
     
    515546function generate_forum_nav(&$forum_data)
    516547{
    517         global $db, $user, $template, $auth;
     548        global $db, $user, $template, $auth, $config;
    518549        global $phpEx, $phpbb_root_path;
    519550
     
    562593                'FORUM_ID'              => $forum_data['forum_id'],
    563594                'FORUM_NAME'    => $forum_data['forum_name'],
    564                 'FORUM_DESC'    => generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']))
    565         );
     595                'FORUM_DESC'    => generate_text_for_display($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options']),
     596
     597                'S_ENABLE_FEEDS_FORUM'  => ($config['feed_forum'] && $forum_data['forum_type'] == FORUM_POST && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $forum_data['forum_options'])) ? true : false,
     598        ));
    566599
    567600        return;
     
    659692        global $config, $template, $db, $phpbb_root_path, $phpEx, $user, $auth;
    660693
    661         // Have we disabled the display of moderators? If so, then return
    662         // from whence we came ...
    663         if (!$config['load_moderators'])
    664         {
    665                 return;
    666         }
    667 
    668         $forum_sql = '';
     694        $forum_id_ary = array();
    669695
    670696        if ($forum_id !== false)
     
    675701                }
    676702
    677                 // If we don't have a forum then we can't have a moderator
    678                 if (!sizeof($forum_id))
    679                 {
    680                         return;
    681                 }
    682 
    683                 $forum_sql = 'AND m.' . $db->sql_in_set('forum_id', $forum_id);
     703                // Exchange key/value pair to be able to faster check for the forum id existence
     704                $forum_id_ary = array_flip($forum_id);
    684705        }
    685706
     
    702723                ),
    703724
    704                 'WHERE'         => "m.display_on_index = 1 $forum_sql",
     725                'WHERE'         => 'm.display_on_index = 1',
    705726        );
    706727
     728        // We query every forum here because for caching we should not have any parameter.
    707729        $sql = $db->sql_build_query('SELECT', $sql_array);
    708730        $result = $db->sql_query($sql, 3600);
     
    710732        while ($row = $db->sql_fetchrow($result))
    711733        {
     734                $f_id = (int) $row['forum_id'];
     735
     736                if (!isset($forum_id_ary[$f_id]))
     737                {
     738                        continue;
     739                }
     740
    712741                if (!empty($row['user_id']))
    713742                {
    714                         $forum_moderators[$row['forum_id']][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
     743                        $forum_moderators[$f_id][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']);
    715744                }
    716745                else
     
    720749                        if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))
    721750                        {
    722                                 $forum_moderators[$row['forum_id']][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>';
     751                                $forum_moderators[$f_id][] = '<span' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . '>' . $group_name . '</span>';
    723752                        }
    724753                        else
    725754                        {
    726                                 $forum_moderators[$row['forum_id']][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
     755                                $forum_moderators[$f_id][] = '<a' . (($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . ';"' : '') . ' href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_name . '</a>';
    727756                        }
    728757                }
     
    847876function display_custom_bbcodes()
    848877{
    849         global $db, $template;
     878        global $db, $template, $user;
    850879
    851880        // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
     
    861890        while ($row = $db->sql_fetchrow($result))
    862891        {
     892                // If the helpline is defined within the language file, we will use the localised version, else just use the database entry...
     893                if (isset($user->lang[strtoupper($row['bbcode_helpline'])]))
     894                {
     895                        $row['bbcode_helpline'] = $user->lang[strtoupper($row['bbcode_helpline'])];
     896                }
     897
    863898                $template->assign_block_vars('custom_tags', array(
    864899                        'BBCODE_NAME'           => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'",
     
    11951230* @param string $avatar_height Height of users avatar
    11961231* @param string $alt Optional language string for alt tag within image, can be a language key or text
     1232* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
    11971233*
    11981234* @return string Avatar image
    11991235*/
    1200 function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
     1236function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
    12011237{
    12021238        global $user, $config, $phpbb_root_path, $phpEx;
    12031239
    1204         if (empty($avatar) || !$avatar_type)
     1240        if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
    12051241        {
    12061242                return '';
     
    12121248        {
    12131249                case AVATAR_UPLOAD:
     1250                        if (!$config['allow_avatar_upload'] && !$ignore_config)
     1251                        {
     1252                                return '';
     1253                        }
    12141254                        $avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
    12151255                break;
    12161256
    12171257                case AVATAR_GALLERY:
     1258                        if (!$config['allow_avatar_local'] && !$ignore_config)
     1259                        {
     1260                                return '';
     1261                        }
    12181262                        $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
    12191263                break;
     1264
     1265                case AVATAR_REMOTE:
     1266                        if (!$config['allow_avatar_remote'] && !$ignore_config)
     1267                        {
     1268                                return '';
     1269                        }
     1270                break;
    12201271        }
    12211272
  • trunk/forum/includes/functions_install.php

    r400 r702  
    33*
    44* @package install
    5 * @version $Id: functions_install.php 8507 2008-04-20 04:57:29Z davidmj $
     5* @version $Id$
    66* @copyright (c) 2006 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2222function can_load_dll($dll)
    2323{
    24         return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && @dl($dll . '.' . PHP_SHLIB_SUFFIX)) ? true : false;
     24        // SQLite2 is a tricky thing, from 5.0.0 it requires PDO; if PDO is not loaded we must state that SQLite is unavailable
     25        // as the installer doesn't understand that the extension has a prerequisite.
     26        //
     27        // On top of this sometimes the SQLite extension is compiled for a different version of PDO
     28        // by some Linux distributions which causes phpBB to bomb out with a blank page.
     29        //
     30        // Net result we'll disable automatic inclusion of SQLite support
     31        //
     32        // See: r9618 and #56105
     33        if ($dll == 'sqlite')
     34        {
     35                return false;
     36        }
     37        return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && function_exists('dl') && @dl($dll . '.' . PHP_SHLIB_SUFFIX)) ? true : false;
    2538}
    2639
     
    176189{
    177190        global $lang;
    178        
     191
    179192        $available_dbms = get_available_dbms(false, false, $only_20x_options);
    180193        $dbms_options = '';
     
    397410                                        else
    398411                                        {
    399                                                 $sql = "SELECT FIRST 0 char_length('')
    400                                                         FROM RDB\$DATABASE";
     412                                                $sql = 'SELECT 1 FROM RDB$DATABASE
     413                                                        WHERE BIN_AND(10, 1) = 0';
    401414                                                $result = $db->sql_query($sql);
    402                                                 if (!$result) // This can only fail if char_length is not defined
     415                                                if (!$result) // This can only fail if BIN_AND is not defined
    403416                                                {
    404417                                                        $error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
     
    441454                                }
    442455                        break;
    443                        
     456
    444457                        case 'oracle':
    445458                                if ($unicode_check)
     
    463476                                }
    464477                        break;
    465                        
     478
    466479                        case 'postgres':
    467480                                if ($unicode_check)
  • trunk/forum/includes/functions_jabber.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_jabber.php 8979 2008-10-08 12:44:23Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2007 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    477477                                        else if (in_array('PLAIN', $methods) && ($this->session['ssl'] || !empty($this->session['tls'])))
    478478                                        {
     479                                                // http://www.ietf.org/rfc/rfc4616.txt (PLAIN SASL Mechanism)
    479480                                                $this->send("<auth xmlns='urn:ietf:params:xml:ns:xmpp-sasl' mechanism='PLAIN'>"
    480                                                         . base64_encode(chr(0) . $this->username . '@' . $this->server . chr(0) . $this->password) .
     481                                                        . base64_encode($this->username . '@' . $this->server . chr(0) . $this->username . chr(0) . $this->password) .
    481482                                                        '</auth>');
    482483                                        }
  • trunk/forum/includes/functions_messenger.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_messenger.php 9078 2008-11-22 19:55:00Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2828        var $mail_priority = MAIL_NORMAL_PRIORITY;
    2929        var $use_queue = true;
     30
     31        var $tpl_obj = NULL;
    3032        var $tpl_msg = array();
     33        var $eol = "\n";
    3134
    3235        /**
     
    3942                $this->use_queue = (!$config['email_package_size']) ? false : $use_queue;
    4043                $this->subject = '';
     44
     45                // Determine EOL character (\n for UNIX, \r\n for Windows and \r for Mac)
     46                $this->eol = (!defined('PHP_EOL')) ? (($eol = strtolower(substr(PHP_OS, 0, 3))) == 'win') ? "\r\n" : (($eol == 'mac') ? "\r" : "\n") : PHP_EOL;
     47                $this->eol = (!$this->eol) ? "\n" : $this->eol;
    4148        }
    4249
     
    5865                global $config;
    5966
     67                if (!trim($address))
     68                {
     69                        return;
     70                }
     71
    6072                $pos = isset($this->addresses['to']) ? sizeof($this->addresses['to']) : 0;
    6173
     
    7890        function cc($address, $realname = '')
    7991        {
     92                if (!trim($address))
     93                {
     94                        return;
     95                }
     96
    8097                $pos = isset($this->addresses['cc']) ? sizeof($this->addresses['cc']) : 0;
    8198                $this->addresses['cc'][$pos]['email'] = trim($address);
     
    88105        function bcc($address, $realname = '')
    89106        {
     107                if (!trim($address))
     108                {
     109                        return;
     110                }
     111
    90112                $pos = isset($this->addresses['bcc']) ? sizeof($this->addresses['bcc']) : 0;
    91113                $this->addresses['bcc'][$pos]['email'] = trim($address);
     
    99121        {
    100122                // IM-Addresses could be empty
    101                 if (!$address)
     123                if (!trim($address))
    102124                {
    103125                        return;
     
    152174        * Set email template to use
    153175        */
    154         function template($template_file, $template_lang = '')
    155         {
    156                 global $config, $phpbb_root_path;
     176        function template($template_file, $template_lang = '', $template_path = '')
     177        {
     178                global $config, $phpbb_root_path, $user;
    157179
    158180                if (!trim($template_file))
    159181                {
    160                         trigger_error('No template file set', E_USER_ERROR);
     182                        trigger_error('No template file for emailing set.', E_USER_ERROR);
    161183                }
    162184
    163185                if (!trim($template_lang))
    164186                {
     187                        // fall back to board default language if the user's language is
     188                        // missing $template_file.  If this does not exist either,
     189                        // $tpl->set_custom_template will do a trigger_error
    165190                        $template_lang = basename($config['default_lang']);
    166191                }
    167192
    168                 if (empty($this->tpl_msg[$template_lang . $template_file]))
    169                 {
    170                         $tpl_file = "{$phpbb_root_path}language/$template_lang/email/$template_file.txt";
    171 
    172                         if (!file_exists($tpl_file))
    173                         {
    174                                 trigger_error("Could not find email template file [ $tpl_file ]", E_USER_ERROR);
    175                         }
    176 
    177                         if (($data = @file_get_contents($tpl_file)) === false)
    178                         {
    179                                 trigger_error("Failed opening template file [ $tpl_file ]", E_USER_ERROR);
    180                         }
    181 
    182                         $this->tpl_msg[$template_lang . $template_file] = $data;
    183                 }
    184 
    185                 $this->msg = $this->tpl_msg[$template_lang . $template_file];
     193                // tpl_msg now holds a template object we can use to parse the template file
     194                if (!isset($this->tpl_msg[$template_lang . $template_file]))
     195                {
     196                        $this->tpl_msg[$template_lang . $template_file] = new template();
     197                        $tpl = &$this->tpl_msg[$template_lang . $template_file];
     198
     199                        $fallback_template_path = false;
     200
     201                        if (!$template_path)
     202                        {
     203                                $template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
     204                                $template_path .= $template_lang . '/email';
     205
     206                                // we can only specify default language fallback when the path is not a custom one for which we
     207                                // do not know the default language alternative
     208                                if ($template_lang !== basename($config['default_lang']))
     209                                {
     210                                        $fallback_template_path = (!empty($user->lang_path)) ? $user->lang_path : $phpbb_root_path . 'language/';
     211                                        $fallback_template_path .= basename($config['default_lang']) . '/email';
     212                                }
     213                        }
     214
     215                        $tpl->set_custom_template($template_path, $template_lang . '_email', $fallback_template_path);
     216
     217                        $tpl->set_filenames(array(
     218                                'body'          => $template_file . '.txt',
     219                        ));
     220                }
     221
     222                $this->tpl_obj = &$this->tpl_msg[$template_lang . $template_file];
     223                $this->vars = &$this->tpl_obj->_rootref;
     224                $this->tpl_msg = '';
    186225
    187226                return true;
     
    193232        function assign_vars($vars)
    194233        {
    195                 $this->vars = (empty($this->vars)) ? $vars : $this->vars + $vars;
     234                if (!is_object($this->tpl_obj))
     235                {
     236                        return;
     237                }
     238
     239                $this->tpl_obj->assign_vars($vars);
     240        }
     241
     242        function assign_block_vars($blockname, $vars)
     243        {
     244                if (!is_object($this->tpl_obj))
     245                {
     246                        return;
     247                }
     248
     249                $this->tpl_obj->assign_block_vars($blockname, $vars);
    196250        }
    197251
     
    204258
    205259                // We add some standard variables we always use, no need to specify them always
    206                 $this->vars['U_BOARD'] = (!isset($this->vars['U_BOARD'])) ? generate_board_url() : $this->vars['U_BOARD'];
    207                 $this->vars['EMAIL_SIG'] = (!isset($this->vars['EMAIL_SIG'])) ? str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])) : $this->vars['EMAIL_SIG'];
    208                 $this->vars['SITENAME'] = (!isset($this->vars['SITENAME'])) ? htmlspecialchars_decode($config['sitename']) : $this->vars['SITENAME'];
    209 
    210                 // Escape all quotes, else the eval will fail.
    211                 $this->msg = str_replace ("'", "\'", $this->msg);
    212                 $this->msg = preg_replace('#\{([a-z0-9\-_]*?)\}#is', "' . ((isset(\$this->vars['\\1'])) ? \$this->vars['\\1'] : '') . '", $this->msg);
    213 
    214                 eval("\$this->msg = '$this->msg';");
     260                if (!isset($this->vars['U_BOARD']))
     261                {
     262                        $this->assign_vars(array(
     263                                'U_BOARD'       => generate_board_url(),
     264                        ));
     265                }
     266
     267                if (!isset($this->vars['EMAIL_SIG']))
     268                {
     269                        $this->assign_vars(array(
     270                                'EMAIL_SIG'     => str_replace('<br />', "\n", "-- \n" . htmlspecialchars_decode($config['board_email_sig'])),
     271                        ));
     272                }
     273
     274                if (!isset($this->vars['SITENAME']))
     275                {
     276                        $this->assign_vars(array(
     277                                'SITENAME'      => htmlspecialchars_decode($config['sitename']),
     278                        ));
     279                }
     280
     281                // Parse message through template
     282                $this->msg = trim($this->tpl_obj->assign_display('body'));
     283
     284                // Because we use \n for newlines in the body message we need to fix line encoding errors for those admins who uploaded email template files in the wrong encoding
     285                $this->msg = str_replace("\r\n", "\n", $this->msg);
    215286
    216287                // We now try and pull a subject from the email body ... if it exists,
     
    310381                global $config;
    311382
     383                // We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility
    312384                $headers = array();
    313385
     
    335407                $headers[] = 'X-Priority: ' . $this->mail_priority;
    336408                $headers[] = 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High'));
    337                 $headers[] = 'X-Mailer: PhpBB3';
     409                $headers[] = 'X-Mailer: phpBB3';
    338410                $headers[] = 'X-MimeOLE: phpBB3';
    339411                $headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url());
    340412
    341                 // We use \n here instead of \r\n because our smtp mailer is adjusting it to \r\n automatically, whereby the php mail function only works
    342                 // if using \n.
    343 
    344413                if (sizeof($this->extra_headers))
    345414                {
    346                         $headers[] = implode("\n", $this->extra_headers);
    347                 }
    348 
    349                 return implode("\n", $headers);
     415                        $headers = array_merge($headers, $this->extra_headers);
     416                }
     417
     418                return $headers;
    350419        }
    351420
     
    360429                {
    361430                        return false;
     431                }
     432
     433                // Addresses to send to?
     434                if (empty($this->addresses) || (empty($this->addresses['to']) && empty($this->addresses['cc']) && empty($this->addresses['bcc'])))
     435                {
     436                        // Send was successful. ;)
     437                        return true;
    362438                }
    363439
     
    382458                        $this->from = '<' . $config['board_contact'] . '>';
    383459                }
     460
     461                $encode_eol = ($config['smtp_delivery']) ? "\r\n" : $this->eol;
    384462
    385463                // Build to, cc and bcc strings
     
    394472                        foreach ($address_ary as $which_ary)
    395473                        {
    396                                 $$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? '"' . mail_encode($which_ary['name']) . '" <' . $which_ary['email'] . '>' : $which_ary['email']);
     474                                $$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
    397475                        }
    398476                }
     
    413491                        else
    414492                        {
    415                                 ob_start();
    416                                 $result = $config['email_function_name']($mail_to, mail_encode($this->subject), wordwrap(utf8_wordwrap($this->msg), 997, "\n", true), $headers);
    417                                 $err_msg = ob_get_clean();
     493                                $result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, $this->eol, $err_msg);
    418494                        }
    419495
     
    452528                if (empty($this->addresses['im']))
    453529                {
    454                         return false;
     530                        // Send was successful. ;)
     531                        return true;
    455532                }
    456533
     
    520597        var $package_size = 0;
    521598        var $cache_file = '';
     599        var $eol = "\n";
    522600
    523601        /**
     
    530608                $this->data = array();
    531609                $this->cache_file = "{$phpbb_root_path}cache/queue.$phpEx";
     610
     611                // Determine EOL character (\n for UNIX, \r\n for Windows and \r for Mac)
     612                $this->eol = (!defined('PHP_EOL')) ? (($eol = strtolower(substr(PHP_OS, 0, 3))) == 'win') ? "\r\n" : (($eol == 'mac') ? "\r" : "\n") : PHP_EOL;
     613                $this->eol = (!$this->eol) ? "\n" : $this->eol;
    532614        }
    533615
     
    652734                                                else
    653735                                                {
    654                                                         ob_start();
    655                                                         $result = $config['email_function_name']($to, mail_encode($subject), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers);
    656                                                         $err_msg = ob_get_clean();
     736                                                        $result = phpbb_mail($to, $subject, $msg, $headers, $this->eol, $err_msg);
    657737                                                }
    658738
     
    705785                        {
    706786                                @flock($fp, LOCK_EX);
    707                                 fwrite($fp, "<?php\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>");
     787                                fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>");
    708788                                @flock($fp, LOCK_UN);
    709789                                fclose($fp);
    710790
    711                                 phpbb_chmod($this->cache_file, CHMOD_WRITE);
     791                                phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
    712792                        }
    713793                }
     
    746826                {
    747827                        @flock($fp, LOCK_EX);
    748                         fwrite($fp, "<?php\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>");
     828                        fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>");
    749829                        @flock($fp, LOCK_UN);
    750830                        fclose($fp);
    751831
    752                         phpbb_chmod($this->cache_file, CHMOD_WRITE);
     832                        phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
    753833                }
    754834        }
     
    758838* Replacement or substitute for PHP's mail command
    759839*/
    760 function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '')
     840function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false)
    761841{
    762842        global $config, $user;
     
    765845        $message = preg_replace("#(?<!\r)\n#si", "\r\n", $message);
    766846
    767         if ($headers != '')
    768         {
    769                 if (is_array($headers))
    770                 {
    771                         $headers = (sizeof($headers) > 1) ? join("\n", $headers) : $headers[0];
    772                 }
    773                 $headers = chop($headers);
    774 
    775                 // Make sure there are no bare linefeeds in the headers
    776                 $headers = preg_replace('#(?<!\r)\n#si', "\r\n", $headers);
     847        if ($headers !== false)
     848        {
     849                if (!is_array($headers))
     850                {
     851                        // Make sure there are no bare linefeeds in the headers
     852                        $headers = preg_replace('#(?<!\r)\n#si', "\n", $headers);
     853                        $headers = explode("\n", $headers);
     854                }
    777855
    778856                // Ok this is rather confusing all things considered,
    779857                // but we have to grab bcc and cc headers and treat them differently
    780858                // Something we really didn't take into consideration originally
    781                 $header_array = explode("\r\n", $headers);
    782                 $headers = '';
    783 
    784                 foreach ($header_array as $header)
     859                $headers_used = array();
     860
     861                foreach ($headers as $header)
    785862                {
    786863                        if (strpos(strtolower($header), 'cc:') === 0 || strpos(strtolower($header), 'bcc:') === 0)
    787864                        {
    788                                 $header = '';
    789                         }
    790                         $headers .= ($header != '') ? $header . "\r\n" : '';
    791                 }
    792 
    793                 $headers = chop($headers);
     865                                continue;
     866                        }
     867                        $headers_used[] = trim($header);
     868                }
     869
     870                $headers = chop(implode("\r\n", $headers_used));
    794871        }
    795872
     
    9471024
    9481025        // Now any custom headers....
    949         $smtp->server_send("$headers\r\n");
     1026        if ($headers !== false)
     1027        {
     1028                $smtp->server_send("$headers\r\n");
     1029        }
    9501030
    9511031        // Ok now we are ready for the message...
     
    10681148
    10691149                $err_msg = '';
    1070                 $local_host = (function_exists('php_uname')) ? php_uname('n') : $user->host;
     1150
     1151                // Here we try to determine the *real* hostname (reverse DNS entry preferrably)
     1152                $local_host = $user->host;
     1153
     1154                if (function_exists('php_uname'))
     1155                {
     1156                        $local_host = php_uname('n');
     1157
     1158                        // Able to resolve name to IP
     1159                        if (($addr = @gethostbyname($local_host)) !== $local_host)
     1160                        {
     1161                                // Able to resolve IP back to name
     1162                                if (($name = @gethostbyaddr($addr)) !== $addr)
     1163                                {
     1164                                        $local_host = $name;
     1165                                }
     1166                        }
     1167                }
    10711168
    10721169                // If we are authenticating through pop-before-smtp, we
     
    14061503*
    14071504* Please note that this version fully supports RFC 2045 section 6.8.
     1505*
     1506* @param string $eol End of line we are using (optional to be backwards compatible)
    14081507*/
    1409 function mail_encode($str)
     1508function mail_encode($str, $eol = "\r\n")
    14101509{
    14111510        // define start delimimter, end delimiter and spacer
    14121511        $start = "=?UTF-8?B?";
    14131512        $end = "?=";
    1414         $spacer = $end . ' ' . $start;
    1415         $split_length = 64;
    1416 
     1513        $delimiter = "$eol ";
     1514
     1515        // Maximum length is 75. $split_length *must* be a multiple of 4, but <= 75 - strlen($start . $delimiter . $end)!!!
     1516        $split_length = 60;
    14171517        $encoded_str = base64_encode($str);
    14181518
     
    14261526        if (strlen($str) === utf8_strlen($str))
    14271527        {
    1428                 return $start . implode($spacer, str_split($encoded_str, $split_length)) . $end;
     1528                return $start . implode($end . $delimiter . $start, str_split($encoded_str, $split_length)) . $end;
    14291529        }
    14301530
     
    14421542                }
    14431543
    1444                 $str .= $start . base64_encode($text) . $end . ' ';
    1445         }
    1446 
    1447         return substr($str, 0, -1);
     1544                $str .= $start . base64_encode($text) . $end . $delimiter;
     1545        }
     1546
     1547        return substr($str, 0, -strlen($delimiter));
    14481548}
    14491549
     1550/**
     1551* Wrapper for sending out emails with the PHP's mail function
     1552*/
     1553function phpbb_mail($to, $subject, $msg, $headers, $eol, &$err_msg)
     1554{
     1555        global $config;
     1556
     1557        // We use the EOL character for the OS here because the PHP mail function does not correctly transform line endings. On Windows SMTP is used (SMTP is \r\n), on UNIX a command is used...
     1558        // Reference: http://bugs.php.net/bug.php?id=15841
     1559        $headers = implode($eol, $headers);
     1560
     1561        ob_start();
     1562        // On some PHP Versions mail() *may* fail if there are newlines within the subject.
     1563        // Newlines are used as a delimiter for lines in mail_encode() according to RFC 2045 section 6.8.
     1564        // Because PHP can't decide what is wanted we revert back to the non-RFC-compliant way of separating by one space (Use '' as parameter to mail_encode() results in SPACE used)
     1565        $result = $config['email_function_name']($to, mail_encode($subject, ''), wordwrap(utf8_wordwrap($msg), 997, "\n", true), $headers);
     1566        $err_msg = ob_get_clean();
     1567
     1568        return $result;
     1569}
     1570
    14501571?>
  • trunk/forum/includes/functions_posting.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_posting.php 9166 2008-12-03 16:40:53Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2525        global $phpEx, $phpbb_root_path;
    2626
     27        $start = request_var('start', 0);
     28
    2729        if ($mode == 'window')
    2830        {
     
    4547                page_header($user->lang['SMILIES']);
    4648
     49                $sql = 'SELECT COUNT(smiley_id) AS item_count
     50                        FROM ' . SMILIES_TABLE . '
     51                        GROUP BY smiley_url';
     52                $result = $db->sql_query($sql, 3600);
     53
     54                $smiley_count = 0;
     55                while ($row = $db->sql_fetchrow($result))
     56                {
     57                        ++$smiley_count;
     58                }
     59                $db->sql_freeresult($result);
     60
    4761                $template->set_filenames(array(
    4862                        'body' => 'posting_smilies.html')
     63                );
     64
     65                $template->assign_var('PAGINATION',
     66                        generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id),
     67                                $smiley_count, $config['smilies_per_page'], $start, true)
    4968                );
    5069        }
     
    6584        }
    6685
    67         $last_url = '';
    68 
    69         $sql = 'SELECT *
    70                 FROM ' . SMILIES_TABLE .
    71                 (($mode == 'inline') ? ' WHERE display_on_posting = 1 ' : '') . '
    72                 ORDER BY smiley_order';
    73         $result = $db->sql_query($sql, 3600);
     86        if ($mode == 'window')
     87        {
     88                $sql = 'SELECT smiley_url, MIN(emotion) as emotion, MIN(code) AS code, smiley_width, smiley_height
     89                        FROM ' . SMILIES_TABLE . '
     90                        GROUP BY smiley_url, smiley_width, smiley_height
     91                        ORDER BY MIN(smiley_order)';
     92                $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $start, 3600);
     93        }
     94        else
     95        {
     96                $sql = 'SELECT *
     97                        FROM ' . SMILIES_TABLE . '
     98                        WHERE display_on_posting = 1
     99                        ORDER BY smiley_order';
     100                $result = $db->sql_query($sql, 3600);
     101        }
    74102
    75103        $smilies = array();
     
    85113        if (sizeof($smilies))
    86114        {
     115                $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
     116
    87117                foreach ($smilies as $row)
    88118                {
     
    90120                                'SMILEY_CODE'   => $row['code'],
    91121                                'A_SMILEY_CODE' => addslashes($row['code']),
    92                                 'SMILEY_IMG'    => $phpbb_root_path . $config['smilies_path'] . '/' . $row['smiley_url'],
     122                                'SMILEY_IMG'    => $root_path . $config['smilies_path'] . '/' . $row['smiley_url'],
    93123                                'SMILEY_WIDTH'  => $row['smiley_width'],
    94124                                'SMILEY_HEIGHT' => $row['smiley_height'],
     
    615645
    616646        // Do not create a thumbnail if the resulting width/height is bigger than the original one
    617         if ($new_width > $width && $new_height > $height)
     647        if ($new_width >= $width && $new_height >= $height)
    618648        {
    619649                return false;
     
    630660                }
    631661
    632                 @passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -antialias -sample ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" +profile "*" "' . str_replace('\\', '/', $destination) . '"');
     662                @passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -geometry ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" "' . str_replace('\\', '/', $destination) . '"');
    633663
    634664                if (file_exists($destination))
     
    657687
    658688                                case IMG_JPG:
     689                                        @ini_set('gd.jpeg_ignore_warning', 1);
    659690                                        $image = @imagecreatefromjpeg($source);
    660691                                break;
     
    667698                                        $image = @imagecreatefromwbmp($source);
    668699                                break;
     700                        }
     701
     702                        if (empty($image))
     703                        {
     704                                return false;
    669705                        }
    670706
     
    752788                foreach ($attachment_data as $i => $attachment)
    753789                {
    754                         $s_inline_attachment_options .= '<option value="' . $i . '">' . basename($attachment['real_filename']) . '</option>';
     790                        $s_inline_attachment_options .= '<option value="' . $i . '">' . utf8_basename($attachment['real_filename']) . '</option>';
    755791                }
    756792
     
    786822                {
    787823                        $hidden = '';
    788                         $attach_row['real_filename'] = basename($attach_row['real_filename']);
     824                        $attach_row['real_filename'] = utf8_basename($attach_row['real_filename']);
    789825
    790826                        foreach ($attach_row as $key => $value)
     
    796832
    797833                        $template->assign_block_vars('attach_row', array(
    798                                 'FILENAME'                      => basename($attach_row['real_filename']),
    799                                 'A_FILENAME'            => addslashes(basename($attach_row['real_filename'])),
     834                                'FILENAME'                      => utf8_basename($attach_row['real_filename']),
     835                                'A_FILENAME'            => addslashes(utf8_basename($attach_row['real_filename'])),
    800836                                'FILE_COMMENT'          => $attach_row['attach_comment'],
    801837                                'ATTACH_ID'                     => $attach_row['attach_id'],
     
    819855* Load Drafts
    820856*/
    821 function load_drafts($topic_id = 0, $forum_id = 0, $id = 0)
     857function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $msg_id = 0)
    822858{
    823859        global $user, $db, $template, $auth;
     
    912948                        // Either display as PM draft if forum_id and topic_id are empty or if access to the forums has been denied afterwards...
    913949                        $link_pm = true;
    914                         $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=compose&amp;d={$draft['draft_id']}");
     950                        $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=compose&amp;d={$draft['draft_id']}" . (($pm_action) ? "&amp;action=$pm_action" : '') . (($msg_id) ? "&amp;p=$msg_id" : ''));
    915951                }
    916952
     
    945981                        " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . '
    946982                        ' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . '
     983                        ' . (($mode == 'post_review_edit') ? " AND p.post_id = $cur_post_id" : '') . '
    947984                ORDER BY p.post_time ';
    948985        $sql .= ($mode == 'post_review') ? 'ASC' : 'DESC';
     
    9631000        }
    9641001
     1002        // Handle 'post_review_edit' like 'post_review' from now on
     1003        if ($mode == 'post_review_edit')
     1004        {
     1005                $mode = 'post_review';
     1006        }
     1007
    9651008        $sql = $db->sql_build_query('SELECT', array(
    966                 'SELECT'        => 'u.username, u.user_id, u.user_colour, p.*',
     1009                'SELECT'        => 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe',
    9671010
    9681011                'FROM'          => array(
    9691012                        USERS_TABLE             => 'u',
    9701013                        POSTS_TABLE             => 'p',
     1014                ),
     1015
     1016                'LEFT_JOIN'     => array(
     1017                        array(
     1018                                'FROM'  => array(ZEBRA_TABLE => 'z'),
     1019                                'ON'    => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id'
     1020                        )
    9711021                ),
    9721022
     
    10611111                $post_subject = censor_text($post_subject);
    10621112
     1113                $post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id'];
     1114                $u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&amp;t=$topic_id&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}");
     1115
    10631116                $template->assign_block_vars($mode . '_row', array(
    10641117                        'POST_AUTHOR_FULL'              => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
     
    10681121
    10691122                        'S_HAS_ATTACHMENTS'     => (!empty($attachments[$row['post_id']])) ? true : false,
     1123                        'S_FRIEND'                      => ($row['friend']) ? true : false,
     1124                        'S_IGNORE_POST'         => ($row['foe']) ? true : false,
     1125                        'L_IGNORE_POST'         => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "<a href=\"{$u_show_post}\" onclick=\"dE('{$post_anchor}', 1); return false;\">", '</a>') : '',
    10701126
    10711127                        'POST_SUBJECT'          => $post_subject,
     
    11141170        if (!$topic_notification && !$forum_notification)
    11151171        {
    1116                 trigger_error('WRONG_NOTIFICATION_MODE');
     1172                trigger_error('NO_MODE');
    11171173        }
    11181174
     
    15021558        }
    15031559
     1560        if (($post_mode == 'delete') || ($post_mode == 'delete_last_post') || ($post_mode == 'delete_first_post'))
     1561        {
     1562                $sql = 'SELECT 1 AS has_attachments
     1563                        FROM ' . ATTACHMENTS_TABLE . '
     1564                        WHERE topic_id = ' . $topic_id;
     1565                $result = $db->sql_query_limit($sql, 1);
     1566                $has_attachments = (int) $db->sql_fetchfield('has_attachments');
     1567                $db->sql_freeresult($result);
     1568
     1569                if (!$has_attachments)
     1570                {
     1571                        $sql_data[TOPICS_TABLE] .= ', topic_attachment = 0';
     1572                }
     1573        }
     1574
    15041575//      $sql_data[USERS_TABLE] = ($data['post_postcount']) ? 'user_posts = user_posts - 1' : '';
    15051576
     
    15531624/**
    15541625* Submit Post
     1626* @todo Split up and create lightweight, simple API for this.
    15551627*/
    1556 function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true)
     1628function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true, $update_search_index = true)
    15571629{
    15581630        global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path;
     
    16061678
    16071679        // This variable indicates if the user is able to post or put into the queue - it is used later for all code decisions regarding approval
     1680        // The variable name should be $post_approved, because it indicates if the post is approved or not
    16081681        $post_approval = 1;
    16091682
    1610         // Check the permissions for post approval, as well as the queue trigger where users are put on approval with a post count lower than specified. Moderators are not affected.
    1611         if ((($config['enable_queue_trigger'] && $user->data['user_posts'] < $config['queue_trigger_posts']) || !$auth->acl_get('f_noapprove', $data['forum_id'])) && !$auth->acl_get('m_approve', $data['forum_id']))
    1612         {
     1683        // Check the permissions for post approval. Moderators are not affected.
     1684        if (!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']))
     1685        {
     1686                // Post not approved, but in queue
    16131687                $post_approval = 0;
     1688        }
     1689
     1690        // Mods are able to force approved/unapproved posts. True means the post is approved, false the post is unapproved
     1691        if (isset($data['force_approved_state']))
     1692        {
     1693                $post_approval = ($data['force_approved_state']) ? 1 : 0;
    16141694        }
    16151695
     
    17261806                                'topic_poster'                          => (int) $user->data['user_id'],
    17271807                                'topic_time'                            => $current_time,
     1808                                'topic_last_view_time'          => $current_time,
    17281809                                'forum_id'                                      => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'],
    17291810                                'icon_id'                                       => $data['icon_id'],
     
    17391820                        if (isset($poll['poll_options']) && !empty($poll['poll_options']))
    17401821                        {
     1822                                $poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time;
     1823                                $poll_length = $poll['poll_length'] * 86400;
     1824                                if ($poll_length < 0)
     1825                                {
     1826                                        $poll_start = $poll_start + $poll_length;
     1827                                        if ($poll_start < 0)
     1828                                        {
     1829                                                $poll_start = 0;
     1830                                        }
     1831                                        $poll_length = 1;
     1832                                }
     1833
    17411834                                $sql_data[TOPICS_TABLE]['sql'] = array_merge($sql_data[TOPICS_TABLE]['sql'], array(
    17421835                                        'poll_title'            => $poll['poll_title'],
    1743                                         'poll_start'            => ($poll['poll_start']) ? $poll['poll_start'] : $current_time,
     1836                                        'poll_start'            => $poll_start,
    17441837                                        'poll_max_options'      => $poll['poll_max_options'],
    1745                                         'poll_length'           => ($poll['poll_length'] * 86400),
     1838                                        'poll_length'           => $poll_length,
    17461839                                        'poll_vote_change'      => $poll['poll_vote_change'])
    17471840                                );
     
    17611854
    17621855                case 'reply':
    1763                         $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies_real = topic_replies_real + 1, topic_bumped = 0, topic_bumper = 0' . (($post_approval) ? ', topic_replies = topic_replies + 1' : '') . ((!empty($data['attachment_data']) || (isset($data['topic_attachment']) && $data['topic_attachment'])) ? ', topic_attachment = 1' : '');
     1856                        $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_view_time = ' . $current_time . ',
     1857                                topic_replies_real = topic_replies_real + 1,
     1858                                topic_bumped = 0,
     1859                                topic_bumper = 0' .
     1860                                (($post_approval) ? ', topic_replies = topic_replies + 1' : '') .
     1861                                ((!empty($data['attachment_data']) || (isset($data['topic_attachment']) && $data['topic_attachment'])) ? ', topic_attachment = 1' : '');
     1862
    17641863                        $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id']) && $post_approval) ? ', user_posts = user_posts + 1' : '');
    17651864
     
    17721871                case 'edit_topic':
    17731872                case 'edit_first_post':
     1873                        if (isset($poll['poll_options']) && !empty($poll['poll_options']))
     1874                        {
     1875                                $poll_start = ($poll['poll_start']) ? $poll['poll_start'] : $current_time;
     1876                                $poll_length = $poll['poll_length'] * 86400;
     1877                                if ($poll_length < 0)
     1878                                {
     1879                                        $poll_start = $poll_start + $poll_length;
     1880                                        if ($poll_start < 0)
     1881                                        {
     1882                                                $poll_start = 0;
     1883                                        }
     1884                                        $poll_length = 1;
     1885                                }
     1886                        }
    17741887
    17751888                        $sql_data[TOPICS_TABLE]['sql'] = array(
     
    17821895                                'topic_time_limit'                      => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0,
    17831896                                'poll_title'                            => (isset($poll['poll_options'])) ? $poll['poll_title'] : '',
    1784                                 'poll_start'                            => (isset($poll['poll_options'])) ? (($poll['poll_start']) ? $poll['poll_start'] : $current_time) : 0,
     1897                                'poll_start'                            => (isset($poll['poll_options'])) ? $poll_start : 0,
    17851898                                'poll_max_options'                      => (isset($poll['poll_options'])) ? $poll['poll_max_options'] : 1,
    1786                                 'poll_length'                           => (isset($poll['poll_options'])) ? ($poll['poll_length'] * 86400) : 0,
     1899                                'poll_length'                           => (isset($poll['poll_options'])) ? $poll_length : 0,
    17871900                                'poll_vote_change'                      => (isset($poll['poll_vote_change'])) ? $poll['poll_vote_change'] : 0,
     1901                                'topic_last_view_time'          => $current_time,
    17881902
    17891903                                'topic_attachment'                      => (!empty($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0),
     
    18111925                                $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - ' . ($topic_row['topic_replies'] + 1);
    18121926
    1813                                 set_config('num_topics', $config['num_topics'] - 1, true);
    1814                                 set_config('num_posts', $config['num_posts'] - ($topic_row['topic_replies'] + 1), true);
     1927                                set_config_count('num_topics', -1, true);
     1928                                set_config_count('num_posts', ($topic_row['topic_replies'] + 1) * (-1), true);
    18151929
    18161930                                // Only decrement this post, since this is the one non-approved now
     
    18291943                        if (!$post_approval && $data['post_approved'])
    18301944                        {
    1831                                 $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies = topic_replies - 1';
     1945                                $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies = topic_replies - 1, topic_last_view_time = ' . $current_time;
    18321946                                $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - 1';
    18331947
    1834                                 set_config('num_posts', $config['num_posts'] - 1, true);
     1948                                set_config_count('num_posts', -1, true);
    18351949
    18361950                                if ($auth->acl_get('f_postcount', $data['forum_id']))
     
    20732187                        {
    20742188                                // insert attachment into db
    2075                                 if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
     2189                                if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
    20762190                                {
    20772191                                        continue;
     
    20992213                if ($space_taken && $files_added)
    21002214                {
    2101                         set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true);
    2102                         set_config('num_files', $config['num_files'] + $files_added, true);
     2215                        set_config_count('upload_dir_size', $space_taken, true);
     2216                        set_config_count('num_files', $files_added, true);
    21032217                }
    21042218        }
     
    23332447                if ($post_mode == 'post')
    23342448                {
    2335                         set_config('num_topics', $config['num_topics'] + 1, true);
    2336                         set_config('num_posts', $config['num_posts'] + 1, true);
     2449                        set_config_count('num_topics', 1, true);
     2450                        set_config_count('num_posts', 1, true);
    23372451                }
    23382452
    23392453                if ($post_mode == 'reply')
    23402454                {
    2341                         set_config('num_posts', $config['num_posts'] + 1, true);
     2455                        set_config_count('num_posts', 1, true);
    23422456                }
    23432457        }
     
    23772491
    23782492        // Index message contents
    2379         if ($update_message && $data['enable_indexing'])
     2493        if ($update_search_index && $data['enable_indexing'])
    23802494        {
    23812495                // Select the search method and do some additional checks to ensure it can actually be utilised
     
    24122526                        $db->sql_query($sql);
    24132527                }
    2414                 else if ($data['notify_set'] && !$data['notify'])
     2528                else if (($config['email_enable'] || $config['jab_enable']) && $data['notify_set'] && !$data['notify'])
    24152529                {
    24162530                        $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . '
     
    24292543        // Mark this topic as read
    24302544        // We do not use post_time here, this is intended (post_time can have a date in the past if editing a message)
    2431         markread('topic', $data['forum_id'], $data['topic_id'], time());
     2545        markread('topic', (($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']), $data['topic_id'], time());
    24322546
    24332547        //
     
    24372551                        FROM ' . FORUMS_TRACK_TABLE . '
    24382552                        WHERE user_id = ' . $user->data['user_id'] . '
    2439                                 AND forum_id = ' . $data['forum_id'];
     2553                                AND forum_id = ' . (($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']);
    24402554                $result = $db->sql_query($sql);
    24412555                $f_mark_time = (int) $db->sql_fetchfield('mark_time');
     
    24502564        {
    24512565                // Update forum info
    2452                 $sql = 'SELECT forum_last_post_time
    2453                         FROM ' . FORUMS_TABLE . '
    2454                         WHERE forum_id = ' . $data['forum_id'];
     2566                if ($topic_type == POST_GLOBAL)
     2567                {
     2568                        $sql = 'SELECT MAX(topic_last_post_time) as forum_last_post_time
     2569                                FROM ' . TOPICS_TABLE . '
     2570                                WHERE forum_id = 0';
     2571                }
     2572                else
     2573                {
     2574                        $sql = 'SELECT forum_last_post_time
     2575                                FROM ' . FORUMS_TABLE . '
     2576                                WHERE forum_id = ' . $data['forum_id'];
     2577                }
    24552578                $result = $db->sql_query($sql);
    24562579                $forum_last_post_time = (int) $db->sql_fetchfield('forum_last_post_time');
    24572580                $db->sql_freeresult($result);
    24582581
    2459                 update_forum_tracking_info($data['forum_id'], $forum_last_post_time, $f_mark_time, false);
     2582                update_forum_tracking_info((($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']), $forum_last_post_time, $f_mark_time, false);
    24602583        }
    24612584
  • trunk/forum/includes/functions_privmsgs.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_privmsgs.php 8993 2008-10-10 17:38:17Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    895895                case 'delete_marked':
    896896
     897                        global $auth;
     898
     899                        if (!$auth->acl_get('u_pm_delete'))
     900                        {
     901                                trigger_error('NO_AUTH_DELETE_MESSAGE');
     902                        }
     903
    897904                        if (confirm_box(true))
    898905                        {
     
    11461153                        $sql = 'SELECT user_id, username, user_colour
    11471154                                FROM ' . USERS_TABLE . '
    1148                                 WHERE ' . $db->sql_in_set('user_id', $u) . '
    1149                                         AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
     1155                                WHERE ' . $db->sql_in_set('user_id', $u);
    11501156                        $result = $db->sql_query($sql);
    11511157
     
    13511357                                        AND ug.user_pending = 0
    13521358                                        AND u.user_id = ug.user_id
    1353                                         AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' . 
     1359                                        AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' .
    13541360                                        $sql_allow_pm;
    13551361                        $result = $db->sql_query($sql);
     
    13571363                        while ($row = $db->sql_fetchrow($result))
    13581364                        {
     1365                                // Additionally, do not include the sender if he is in the group he wants to send to. ;)
     1366                                if ($row['user_id'] === $user->data['user_id'])
     1367                                {
     1368                                        continue;
     1369                                }
     1370
    13591371                                $field = ($data['address_list']['g'][$row['group_id']] == 'to') ? 'to' : 'bcc';
    13601372                                $recipients[$row['user_id']] = $field;
     
    14061418                                'bbcode_uid'            => $data['bbcode_uid'],
    14071419                                'to_address'            => implode(':', $to),
    1408                                 'bcc_address'           => implode(':', $bcc)
     1420                                'bcc_address'           => implode(':', $bcc),
     1421                                'message_reported'      => 0,
    14091422                        );
    14101423                break;
     
    15461559                        {
    15471560                                // insert attachment into db
    1548                                 if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
     1561                                if (!@file_exists($phpbb_root_path . $config['upload_path'] . '/' . utf8_basename($orphan_rows[$attach_row['attach_id']]['physical_filename'])))
    15491562                                {
    15501563                                        continue;
     
    15721585                if ($space_taken && $files_added)
    15731586                {
    1574                         set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true);
    1575                         set_config('num_files', $config['num_files'] + $files_added, true);
     1587                        set_config_count('upload_dir_size', $space_taken, true);
     1588                        set_config_count('num_files', $files_added, true);
    15761589                }
    15771590        }
     
    16921705        global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode;
    16931706
     1707        // Select all receipts and the author from the pm we currently view, to only display their pm-history
     1708        $sql = 'SELECT author_id, user_id
     1709                FROM ' . PRIVMSGS_TO_TABLE . "
     1710                WHERE msg_id = $msg_id
     1711                        AND folder_id <> " . PRIVMSGS_HOLD_BOX;
     1712        $result = $db->sql_query($sql);
     1713
     1714        $recipients = array();
     1715        while ($row = $db->sql_fetchrow($result))
     1716        {
     1717                $recipients[] = (int) $row['user_id'];
     1718                $recipients[] = (int) $row['author_id'];
     1719        }
     1720        $db->sql_freeresult($result);
     1721        $recipients = array_unique($recipients);
     1722
    16941723        // Get History Messages (could be newer)
    16951724        $sql = 'SELECT t.*, p.*, u.*
     
    16971726                WHERE t.msg_id = p.msg_id
    16981727                        AND p.author_id = u.user_id
    1699                         AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ")
     1728                        AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ')
     1729                        AND ' . $db->sql_in_set('t.author_id', $recipients, false, true) . "
    17001730                        AND t.user_id = $user_id";
     1731
     1732        // We no longer need those.
     1733        unset($recipients);
    17011734
    17021735        if (!$message_row['root_level'])
     
    17641797        $next_history_pm = $previous_history_pm = $prev_id = 0;
    17651798
    1766         foreach ($rowset as $id => $row)
    1767         {
     1799        // Re-order rowset to be able to get the next/prev message rows...
     1800        $rowset = array_values($rowset);
     1801
     1802        for ($i = 0, $size = sizeof($rowset); $i < $size; $i++)
     1803        {
     1804                $row = &$rowset[$i];
     1805                $id = (int) $row['msg_id'];
     1806
    17681807                $author_id      = $row['author_id'];
    17691808                $folder_id      = (int) $row['folder_id'];
     
    17761815                $decoded_message = false;
    17771816
    1778                 if ($in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id'])
     1817                if ($in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS)
    17791818                {
    17801819                        $decoded_message = $message;
     
    17961835                if ($id == $msg_id)
    17971836                {
    1798                         $next_history_pm = next($rowset);
    1799                         $next_history_pm = (sizeof($next_history_pm)) ? (int) $next_history_pm['msg_id'] : 0;
     1837                        $next_history_pm = (isset($rowset[$i + 1])) ? (int) $rowset[$i + 1]['msg_id'] : 0;
    18001838                        $previous_history_pm = $prev_id;
    18011839                }
     
    18201858                        'MSG_ID'                        => $row['msg_id'],
    18211859                        'U_VIEW_MESSAGE'        => "$url&amp;f=$folder_id&amp;p=" . $row['msg_id'],
    1822                         'U_QUOTE'                       => (!$in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS && $author_id != $user->data['user_id']) ? "$url&amp;mode=compose&amp;action=quote&amp;f=" . $folder_id . "&amp;p=" . $row['msg_id'] : '',
     1860                        'U_QUOTE'                       => (!$in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=quote&amp;f=" . $folder_id . "&amp;p=" . $row['msg_id'] : '',
    18231861                        'U_POST_REPLY_PM'       => ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&amp;mode=compose&amp;action=reply&amp;f=$folder_id&amp;p=" . $row['msg_id'] : '')
    18241862                );
    1825                 unset($rowset[$id]);
     1863                unset($rowset[$i]);
    18261864                $prev_id = $id;
    18271865        }
     
    18591897}
    18601898
     1899/**
     1900* Generates an array of coloured recipient names from a list of PMs - (groups & users)
     1901*
     1902* @param        array   $pm_by_id       An array of rows from PRIVMSGS_TABLE, keys are the msg_ids.
     1903*
     1904* @return       array                           2D Array: array(msg_id => array('username or group string', ...), ...)
     1905*                                                               Usernames are generated with {@link get_username_string get_username_string}
     1906*                                                               Groups are coloured and have a link to the membership page
     1907*/
     1908function get_recipient_strings($pm_by_id)
     1909{
     1910        global $db, $phpbb_root_path, $phpEx, $user;
     1911
     1912        $address_list = $recipient_list = $address = array();
     1913
     1914        $_types = array('u', 'g');
     1915
     1916        foreach ($pm_by_id as $message_id => $row)
     1917        {
     1918                $address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address']));
     1919
     1920                foreach ($_types as $ug_type)
     1921                {
     1922                        if (isset($address[$message_id][$ug_type]) && sizeof($address[$message_id][$ug_type]))
     1923                        {
     1924                                foreach ($address[$message_id][$ug_type] as $ug_id => $in_to)
     1925                                {
     1926                                        $recipient_list[$ug_type][$ug_id] = array('name' => $user->lang['NA'], 'colour' => '');
     1927                                }
     1928                        }
     1929                }
     1930        }
     1931
     1932        foreach ($_types as $ug_type)
     1933        {
     1934                if (!empty($recipient_list[$ug_type]))
     1935                {
     1936                        if ($ug_type == 'u')
     1937                        {
     1938                                $sql = 'SELECT user_id as id, username as name, user_colour as colour
     1939                                        FROM ' . USERS_TABLE . '
     1940                                        WHERE ';
     1941                        }
     1942                        else
     1943                        {
     1944                                $sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type
     1945                                        FROM ' . GROUPS_TABLE . '
     1946                                        WHERE ';
     1947                        }
     1948                        $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type])));
     1949
     1950                        $result = $db->sql_query($sql);
     1951
     1952                        while ($row = $db->sql_fetchrow($result))
     1953                        {
     1954                                if ($ug_type == 'g')
     1955                                {
     1956                                        $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name'];
     1957                                }
     1958
     1959                                $recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
     1960                        }
     1961                        $db->sql_freeresult($result);
     1962                }
     1963        }
     1964
     1965        foreach ($address as $message_id => $adr_ary)
     1966        {
     1967                foreach ($adr_ary as $type => $id_ary)
     1968                {
     1969                        foreach ($id_ary as $ug_id => $_id)
     1970                        {
     1971                                if ($type == 'u')
     1972                                {
     1973                                        $address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']);
     1974                                }
     1975                                else
     1976                                {
     1977                                        $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : '';
     1978                                        $link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $ug_id) . '"' . $user_colour . '>';
     1979                                        $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : '');
     1980                                }
     1981                        }
     1982                }
     1983        }
     1984
     1985        return $address_list;
     1986}
     1987
    18611988?>
  • trunk/forum/includes/functions_profile_fields.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_profile_fields.php 9127 2008-11-26 19:58:35Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4040                {
    4141                        case 'register':
    42                                 // If the field is required we show it on the registration page and do not show hidden fields
    43                                 $sql_where .= ' AND f.field_show_on_reg = 1 AND f.field_no_view = 0';
     42                                // If the field is required we show it on the registration page
     43                                $sql_where .= ' AND f.field_show_on_reg = 1';
    4444                        break;
    4545
     
    9393                switch ($field_type)
    9494                {
    95                         case FIELD_INT:
    96                         case FIELD_DROPDOWN:
    97                                 $field_value = (int) $field_value;
    98                         break;
    99 
    100                         case FIELD_BOOL:
    101                                 $field_value = (bool) $field_value;
    102                         break;
    103                 }
    104 
    105                 switch ($field_type)
    106                 {
    10795                        case FIELD_DATE:
    10896                                $field_validate = explode('-', $field_value);
     
    134122
    135123                        case FIELD_BOOL:
     124                                $field_value = (bool) $field_value;
     125                       
    136126                                if (!$field_value && $field_data['field_required'])
    137127                                {
     
    141131
    142132                        case FIELD_INT:
    143                                 if (empty($field_value) && !$field_data['field_required'])
     133                                if (trim($field_value) === '' && !$field_data['field_required'])
    144134                                {
    145135                                        return false;
    146136                                }
     137                               
     138                                $field_value = (int) $field_value;
    147139
    148140                                if ($field_value < $field_data['field_minlen'])
     
    157149
    158150                        case FIELD_DROPDOWN:
     151                                $field_value = (int) $field_value;
     152                       
    159153                                if ($field_value == $field_data['field_novalue'] && $field_data['field_required'])
    160154                                {
     
    165159                        case FIELD_STRING:
    166160                        case FIELD_TEXT:
    167                                 if (empty($field_value) && !$field_data['field_required'])
     161                                if (trim($field_value) === '' && !$field_data['field_required'])
    168162                                {
    169163                                        return false;
    170164                                }
    171                                 else if (empty($field_value) && $field_data['field_required'])
     165                                else if (trim($field_value) === '' && $field_data['field_required'])
    172166                                {
    173167                                        return 'FIELD_REQUIRED';
     
    260254
    261255        /**
    262         * Submit profile field
     256        * Submit profile field for validation
    263257        * @access public
    264258        */
     
    271265                {
    272266                        case 'register':
    273                                 // If the field is required we show it on the registration page and do not show hidden fields
    274                                 $sql_where .= ' AND f.field_show_on_reg = 1 AND f.field_no_view = 0';
     267                                // If the field is required we show it on the registration page
     268                                $sql_where .= ' AND f.field_show_on_reg = 1';
    275269                        break;
    276270
     
    351345
    352346        /**
     347        * Update profile field data directly
     348        */
     349        function update_profile_field_data($user_id, &$cp_data)
     350        {
     351                global $db;
     352
     353                if (!sizeof($cp_data))
     354                {
     355                        return;
     356                }
     357
     358                switch ($db->sql_layer)
     359                {
     360                        case 'oracle':
     361                        case 'firebird':
     362                        case 'postgres':
     363                                $right_delim = $left_delim = '"';
     364                        break;
     365
     366                        case 'sqlite':
     367                        case 'mssql':
     368                        case 'mssql_odbc':
     369                                $right_delim = ']';
     370                                $left_delim = '[';
     371                        break;
     372
     373                        case 'mysql':
     374                        case 'mysql4':
     375                        case 'mysqli':
     376                                $right_delim = $left_delim = '`';
     377                        break;
     378                }
     379
     380                // use new array for the UPDATE; changes in the key do not affect the original array
     381                $cp_data_sql = array();
     382                foreach ($cp_data as $key => $value)
     383                {
     384                        // Firebird is case sensitive with delimiter
     385                        $cp_data_sql[$left_delim . (($db->sql_layer == 'firebird' || $db->sql_layer == 'oracle') ? strtoupper($key) : $key) . $right_delim] = $value;
     386                }
     387
     388                $sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
     389                        SET ' . $db->sql_build_array('UPDATE', $cp_data_sql) . "
     390                        WHERE user_id = $user_id";
     391                $db->sql_query($sql);
     392
     393                if (!$db->sql_affectedrows())
     394                {
     395                        $cp_data_sql['user_id'] = (int) $user_id;
     396
     397                        $db->sql_return_on_error(true);
     398
     399                        $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data_sql);
     400                        $db->sql_query($sql);
     401
     402                        $db->sql_return_on_error(false);
     403                }
     404        }
     405
     406        /**
    353407        * Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled)
    354408        * This is directly connected to the user -> mode == grab is to grab the user specific fields, mode == show is for assigning the row to the template
     
    455509                {
    456510                        case 'int':
    457                                 if ($value == '')
     511                                if ($value === '')
    458512                                {
    459513                                        return NULL;
     
    571625                        else
    572626                        {
    573                                 if (!$preview && isset($user->profile_fields[$user_ident]) && is_null($user->profile_fields[$user_ident]))
     627                                if (!$preview && array_key_exists($user_ident, $user->profile_fields) && is_null($user->profile_fields[$user_ident]))
    574628                                {
    575629                                        $value = NULL;
     
    585639                        }
    586640
    587                         return (is_null($value)) ? '' : (int) $value;
     641                        return (is_null($value) || $value === '') ? '' : (int) $value;
    588642                }
    589643                else
  • trunk/forum/includes/functions_template.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_template.php 8813 2008-09-04 11:52:01Z aptx $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    129129                $code = preg_replace('#<!-- PHP -->.*?<!-- ENDPHP -->#s', '<!-- PHP -->', $code);
    130130
    131                 preg_match_all('#<!-- INCLUDE ([a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
     131                preg_match_all('#<!-- INCLUDE (\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
    132132                $include_blocks = $matches[1];
    133                 $code = preg_replace('#<!-- INCLUDE [a-zA-Z0-9\_\-\+\./]+ -->#', '<!-- INCLUDE -->', $code);
     133                $code = preg_replace('#<!-- INCLUDE (?:\{\$?[A-Z0-9\-_]+\}|[a-zA-Z0-9\_\-\+\./]+) -->#', '<!-- INCLUDE -->', $code);
    134134
    135135                preg_match_all('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches);
     
    194194                                case 'INCLUDE':
    195195                                        $temp = array_shift($include_blocks);
     196
     197                                        // Dynamic includes
     198                                        // Cheap match rather than a full blown regexp, we already know
     199                                        // the format of the input so just use string manipulation.
     200                                        if ($temp[0] == '{')
     201                                        {
     202                                                $file = false;
     203
     204                                                if ($temp[1] == '$')
     205                                                {
     206                                                        $var = substr($temp, 2, -1);
     207                                                        //$file = $this->template->_tpldata['DEFINE']['.'][$var];
     208                                                        $temp = "\$this->_tpldata['DEFINE']['.']['$var']";
     209                                                }
     210                                                else
     211                                                {
     212                                                        $var = substr($temp, 1, -1);
     213                                                        //$file = $this->template->_rootref[$var];
     214                                                        $temp = "\$this->_rootref['$var']";
     215                                                }
     216                                        }
     217                                        else
     218                                        {
     219                                                $file = $temp;
     220                                        }
     221
    196222                                        $compile_blocks[] = '<?php ' . $this->compile_tag_include($temp) . ' ?>';
    197                                         $this->template->_tpl_include($temp, false);
     223
     224                                        // No point in checking variable includes
     225                                        if ($file)
     226                                        {
     227                                                $this->template->_tpl_include($file, false);
     228                                        }
    198229                                break;
    199230
     
    221252                }
    222253
     254                // Remove unused opening/closing tags
     255                $template_php = str_replace(' ?><?php ', ' ', $template_php);
     256
     257                // Now add a newline after each php closing tag which already has a newline
     258                // PHP itself strips a newline if a closing tag is used (this is documented behaviour) and it is mostly not intended by style authors to remove newlines
     259                $template_php = preg_replace('#\?\>([\r\n])#', '?>\1\1', $template_php);
     260
    223261                // There will be a number of occasions where we switch into and out of
    224262                // PHP mode instantaneously. Rather than "burden" the parser with this
    225263                // we'll strip out such occurences, minimising such switching
    226                 $template_php = str_replace(' ?><?php ', ' ', $template_php);
    227 
    228                 return (!$no_echo) ? $template_php : "\$$echo_var .= '" . $template_php . "'";
     264                if ($no_echo)
     265                {
     266                        return "\$$echo_var .= '" . $template_php . "'";
     267                }
     268
     269                return $template_php;
    229270        }
    230271
     
    254295                if (strpos($text_blocks, '{L_') !== false)
    255296                {
    256                         $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ \\1 }')); ?>", $text_blocks);
     297                        $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ \\1 }')); ?>", $text_blocks);
    257298                }
    258299
     
    261302                if (strpos($text_blocks, '{LA_') !== false)
    262303                {
    263                         $text_blocks = preg_replace('#\{LA_([a-z0-9\-_]*)\}#is', "<?php echo ((isset(\$this->_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks);
     304                        $text_blocks = preg_replace('#\{LA_([A-Z0-9\-_]+)\}#', "<?php echo ((isset(\$this->_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ \\1 }'))); ?>", $text_blocks);
    264305                }
    265306
    266307                // Handle remaining varrefs
    267                 $text_blocks = preg_replace('#\{([a-z0-9\-_]+)\}#is', "<?php echo (isset(\$this->_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks);
    268                 $text_blocks = preg_replace('#\{\$([a-z0-9\-_]+)\}#is', "<?php echo (isset(\$this->_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks);
     308                $text_blocks = preg_replace('#\{([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$this->_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks);
     309                $text_blocks = preg_replace('#\{\$([A-Z0-9\-_]+)\}#', "<?php echo (isset(\$this->_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks);
    269310
    270311                return;
     
    592633        function compile_tag_include($tag_args)
    593634        {
     635                // Process dynamic includes
     636                if ($tag_args[0] == '$')
     637                {
     638                        return "if (isset($tag_args)) { \$this->_tpl_include($tag_args); }";
     639                }
     640
    594641                return "\$this->_tpl_include('$tag_args');";
    595642        }
     
    601648        function compile_tag_include_php($tag_args)
    602649        {
    603                 return "include('" . $tag_args . "');";
     650                return "\$this->_php_include('$tag_args');";
    604651        }
    605652
     
    749796                $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx;
    750797
     798                $data = "<?php if (!defined('IN_PHPBB')) exit;" . ((strpos($data, '<?php') === 0) ? substr($data, 5) : ' ?>' . $data);
     799
    751800                if ($fp = @fopen($filename, 'wb'))
    752801                {
     
    756805                        @fclose($fp);
    757806
    758                         phpbb_chmod($filename, CHMOD_WRITE);
     807                        phpbb_chmod($filename, CHMOD_READ | CHMOD_WRITE);
    759808                }
    760809
  • trunk/forum/includes/functions_transfer.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_transfer.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    207207
    208208                $this->_chdir($directory);
    209                 $result = $this->_ls('');
     209                $result = $this->_ls();
    210210
    211211                if ($result !== false && is_array($result))
     
    317317                }
    318318
     319                // login to the server
     320                if (!@ftp_login($this->connection, $this->username, $this->password))
     321                {
     322                        return 'ERR_UNABLE_TO_LOGIN';
     323                }
     324
    319325                // attempt to turn pasv mode on
    320326                @ftp_pasv($this->connection, true);
    321 
    322                 // login to the server
    323                 if (!@ftp_login($this->connection, $this->username, $this->password))
    324                 {
    325                         return 'ERR_UNABLE_TO_LOGIN';
    326                 }
    327327
    328328                // change to the root directory
     
    461461        function _ls($dir = './')
    462462        {
    463                 return @ftp_nlist($this->connection, $dir);
     463                $list = @ftp_nlist($this->connection, $dir);
     464
     465                // See bug #46295 - Some FTP daemons don't like './'
     466                if ($dir === './')
     467                {
     468                        // Let's try some alternatives
     469                        $list = (empty($list)) ? @ftp_nlist($this->connection, '.') : $list;
     470                        $list = (empty($list)) ? @ftp_nlist($this->connection, '') : $list;
     471                }
     472
     473                // Return on error
     474                if ($list === false)
     475                {
     476                        return false;
     477                }
     478
     479                // Remove path if prepended
     480                foreach ($list as $key => $item)
     481                {
     482                        // Use same separator for item and dir
     483                        $item = str_replace('\\', '/', $item);
     484                        $dir = str_replace('\\', '/', $dir);
     485
     486                        if (!empty($dir) && strpos($item, $dir) === 0)
     487                        {
     488                                $item = substr($item, strlen($dir));
     489                        }
     490
     491                        $list[$key] = $item;
     492                }
     493
     494                return $list;
    464495        }
    465496
     
    707738                while (!@feof($this->data_connection))
    708739                {
    709                         $list[] = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512));
     740                        $filename = preg_replace('#[\r\n]#', '', @fgets($this->data_connection, 512));
     741
     742                        if ($filename !== '')
     743                        {
     744                                $list[] = $filename;
     745                        }
    710746                }
    711747                $this->_close_data_connection();
     748
     749                // Clear buffer
     750                $this->_check_command();
     751
     752                // See bug #46295 - Some FTP daemons don't like './'
     753                if ($dir === './' && empty($list))
     754                {
     755                        // Let's try some alternatives
     756                        $list = $this->_ls('.');
     757
     758                        if (empty($list))
     759                        {
     760                                $list = $this->_ls('');
     761                        }
     762
     763                        return $list;
     764                }
     765
     766                // Remove path if prepended
     767                foreach ($list as $key => $item)
     768                {
     769                        // Use same separator for item and dir
     770                        $item = str_replace('\\', '/', $item);
     771                        $dir = str_replace('\\', '/', $dir);
     772
     773                        if (!empty($dir) && strpos($item, $dir) === 0)
     774                        {
     775                                $item = substr($item, strlen($dir));
     776                        }
     777
     778                        $list[$key] = $item;
     779                }
    712780
    713781                return $list;
     
    792860                        $response .= $result;
    793861                }
    794                 while (substr($response, 3, 1) != ' ');
     862                while (substr($result, 3, 1) !== ' ');
    795863
    796864                if (!preg_match('#^[123]#', $response))
  • trunk/forum/includes/functions_upload.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_upload.php 8783 2008-08-23 17:23:40Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    5959                $this->filename = $upload_ary['tmp_name'];
    6060                $this->filesize = $upload_ary['size'];
    61                 $name = trim(htmlspecialchars(basename($upload_ary['name'])));
     61                $name = trim(utf8_htmlspecialchars(utf8_basename($upload_ary['name'])));
    6262                $this->realname = $this->uploadname = (STRIP) ? stripslashes($name) : $name;
    6363                $this->mimetype = $upload_ary['type'];
     
    291291                $upload_mode = (@ini_get('open_basedir') || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') ? 'move' : 'copy';
    292292                $upload_mode = ($this->local) ? 'local' : $upload_mode;
    293                 $this->destination_file = $this->destination_path . '/' . basename($this->realname);
     293                $this->destination_file = $this->destination_path . '/' . utf8_basename($this->realname);
    294294
    295295                // Check if the file already exist, else there is something wrong...
     
    314314                                                {
    315315                                                        $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
    316                                                         return false;
    317316                                                }
    318317                                        }
    319 
    320                                         @unlink($this->filename);
    321318
    322319                                break;
     
    329326                                                {
    330327                                                        $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
    331                                                         return false;
    332328                                                }
    333329                                        }
    334 
    335                                         @unlink($this->filename);
    336330
    337331                                break;
     
    342336                                        {
    343337                                                $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file);
    344                                                 return false;
    345338                                        }
    346                                         @unlink($this->filename);
    347339
    348340                                break;
     341                        }
     342
     343                        // Remove temporary filename
     344                        @unlink($this->filename);
     345
     346                        if (sizeof($this->error))
     347                        {
     348                                return false;
    349349                        }
    350350
     
    418418                if ($this->upload->max_filesize && ($this->get('filesize') > $this->upload->max_filesize || $this->filesize == 0))
    419419                {
    420                         $size_lang = ($this->upload->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->upload->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES'] );
    421420                        $max_filesize = get_formatted_filesize($this->upload->max_filesize, false);
    422421
    423                         $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
     422                        $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']);
    424423
    425424                        return false;
     
    595594                if ($file->get('filename') == 'none')
    596595                {
    597                         $file->error[] = (@ini_get('upload_max_filesize') == '') ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], @ini_get('upload_max_filesize'));
     596                        $max_filesize = @ini_get('upload_max_filesize');
     597                        $unit = 'MB';
     598
     599                        if (!empty($max_filesize))
     600                        {
     601                                $unit = strtolower(substr($max_filesize, -1, 1));
     602                                $max_filesize = (int) $max_filesize;
     603
     604                                $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB');
     605                        }
     606
     607                        $file->error[] = (empty($max_filesize)) ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], $max_filesize, $user->lang[$unit]);
    598608                        return $file;
    599609                }
     
    625635                if ($filedata === false)
    626636                {
    627                         $_FILES[$form_name]['name'] = basename($source_file);
     637                        $_FILES[$form_name]['name'] = utf8_basename($source_file);
    628638                        $_FILES[$form_name]['size'] = 0;
    629639                        $mimetype = '';
     
    671681                if ($file->get('filename') == 'none')
    672682                {
    673                         $file->error[] = (@ini_get('upload_max_filesize') == '') ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], @ini_get('upload_max_filesize'));
     683                        $max_filesize = @ini_get('upload_max_filesize');
     684                        $unit = 'MB';
     685
     686                        if (!empty($max_filesize))
     687                        {
     688                                $unit = strtolower(substr($max_filesize, -1, 1));
     689                                $max_filesize = (int) $max_filesize;
     690
     691                                $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB');
     692                        }
     693
     694                        $file->error[] = (empty($max_filesize)) ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], $max_filesize, $user->lang[$unit]);
    674695                        return $file;
    675696                }
     
    726747
    727748                $url['path'] = implode('', $url['path']);
    728                 $upload_ary['name'] = basename($url['path']) . (($ext) ? '.' . $ext : '');
     749                $upload_ary['name'] = utf8_basename($url['path']) . (($ext) ? '.' . $ext : '');
    729750                $filename = $url['path'];
    730751                $filesize = 0;
     
    819840                {
    820841                        case 1:
    821                                 $error = (@ini_get('upload_max_filesize') == '') ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], @ini_get('upload_max_filesize'));
     842                                $max_filesize = @ini_get('upload_max_filesize');
     843                                $unit = 'MB';
     844
     845                                if (!empty($max_filesize))
     846                                {
     847                                        $unit = strtolower(substr($max_filesize, -1, 1));
     848                                        $max_filesize = (int) $max_filesize;
     849
     850                                        $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB');
     851                                }
     852
     853                                $error = (empty($max_filesize)) ? $user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf($user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], $max_filesize, $user->lang[$unit]);
    822854                        break;
    823855
    824856                        case 2:
    825                                 $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
    826857                                $max_filesize = get_formatted_filesize($this->max_filesize, false);
    827858
    828                                 $error = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
     859                                $error = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']);
    829860                        break;
    830861
     
    859890                if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0))
    860891                {
    861                         $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);
    862892                        $max_filesize = get_formatted_filesize($this->max_filesize, false);
    863893
    864                         $file->error[] = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang);
     894                        $file->error[] = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize['value'], $max_filesize['unit']);
    865895                }
    866896
  • trunk/forum/includes/functions_user.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: functions_user.php 8949 2008-09-26 21:29:05Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    172172                'user_pass_convert'     => 0,
    173173                'user_email'            => strtolower($user_row['user_email']),
    174                 'user_email_hash'       => crc32(strtolower($user_row['user_email'])) . strlen($user_row['user_email']),
     174                'user_email_hash'       => phpbb_email_hash($user_row['user_email']),
    175175                'group_id'                      => $user_row['group_id'],
    176176                'user_type'                     => $user_row['user_type'],
     
    188188                'user_regdate'          => time(),
    189189                'user_passchg'          => time(),
    190                 'user_options'          => 895,
     190                'user_options'          => 230271,
     191                // We do not set the new flag here - registration scripts need to specify it
     192                'user_new'                      => 0,
    191193
    192194                'user_inactive_reason'  => 0,
     
    276278        group_set_user_default($user_row['group_id'], array($user_id), false);
    277279
     280        // Add to newly registered users group if user_new is 1
     281        if ($config['new_member_post_limit'] && $sql_ary['user_new'])
     282        {
     283                $sql = 'SELECT group_id
     284                        FROM ' . GROUPS_TABLE . "
     285                        WHERE group_name = 'NEWLY_REGISTERED'
     286                                AND group_type = " . GROUP_SPECIAL;
     287                $result = $db->sql_query($sql);
     288                $add_group_id = (int) $db->sql_fetchfield('group_id');
     289                $db->sql_freeresult($result);
     290
     291                if ($add_group_id)
     292                {
     293                        // Because these actions only fill the log unneccessarily we skip the add_log() entry with a little hack. :/
     294                        $GLOBALS['skip_add_log'] = true;
     295
     296                        // Add user to "newly registered users" group and set to default group if admin specified so.
     297                        if ($config['new_member_group_default'])
     298                        {
     299                                group_user_add($add_group_id, $user_id, false, false, true);
     300                        }
     301                        else
     302                        {
     303                                group_user_add($add_group_id, $user_id);
     304                        }
     305
     306                        unset($GLOBALS['skip_add_log']);
     307                }
     308        }
     309
    278310        // set the newest user and adjust the user count if the user is a normal user and no activation mail is sent
    279         if ($user_row['user_type'] == USER_NORMAL)
     311        if ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_FOUNDER)
    280312        {
    281313                set_config('newest_user_id', $user_id, true);
    282314                set_config('newest_username', $user_row['username'], true);
    283                 set_config('num_users', $config['num_users'] + 1, true);
     315                set_config_count('num_users', 1, true);
    284316
    285317                $sql = 'SELECT group_colour
     
    420452                                        SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = ''
    421453                                        WHERE topic_last_poster_id = $user_id";
     454                                $db->sql_query($sql);
     455
     456                                $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
     457                                        SET poster_id = ' . ANONYMOUS . "
     458                                        WHERE poster_id = $user_id";
    422459                                $db->sql_query($sql);
    423460
     
    491528        $db->sql_transaction('begin');
    492529
    493         $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE);
     530        $table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE, MODERATOR_CACHE_TABLE, DRAFTS_TABLE, BOOKMARKS_TABLE, SESSIONS_KEYS_TABLE);
    494531
    495532        foreach ($table_ary as $table)
     
    501538
    502539        $cache->destroy('sql', MODERATOR_CACHE_TABLE);
     540
     541        // Delete user log entries about this user
     542        $sql = 'DELETE FROM ' . LOG_TABLE . '
     543                WHERE reportee_id = ' . $user_id;
     544        $db->sql_query($sql);
     545
     546        // Change user_id to anonymous for this users triggered events
     547        $sql = 'UPDATE ' . LOG_TABLE . '
     548                SET user_id = ' . ANONYMOUS . '
     549                WHERE user_id = ' . $user_id;
     550        $db->sql_query($sql);
     551
     552        // Delete the user_id from the zebra table
     553        $sql = 'DELETE FROM ' . ZEBRA_TABLE . '
     554                WHERE user_id = ' . $user_id . '
     555                        OR zebra_id = ' . $user_id;
     556        $db->sql_query($sql);
     557
     558        // Delete the user_id from the banlist
     559        $sql = 'DELETE FROM ' . BANLIST_TABLE . '
     560                WHERE ban_userid = ' . $user_id;
     561        $db->sql_query($sql);
     562
     563        // Delete the user_id from the session table
     564        $sql = 'DELETE FROM ' . SESSIONS_TABLE . '
     565                WHERE session_user_id = ' . $user_id;
     566        $db->sql_query($sql);
    503567
    504568        // Remove any undelivered mails...
     
    570634        if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE)
    571635        {
    572                 set_config('num_users', $config['num_users'] - 1, true);
     636                set_config_count('num_users', -1, true);
    573637        }
    574638
     
    651715        if ($deactivated)
    652716        {
    653                 set_config('num_users', $config['num_users'] - $deactivated, true);
     717                set_config_count('num_users', $deactivated * (-1), true);
    654718        }
    655719
    656720        if ($activated)
    657721        {
    658                 set_config('num_users', $config['num_users'] + $activated, true);
     722                set_config_count('num_users', $activated, true);
    659723        }
    660724
     
    895959                                        }
    896960                                }
    897                                 else
     961
     962                                if (empty($banlist_ary))
    898963                                {
    899964                                        trigger_error('NO_IPS_DEFINED');
     
    9681033                while ($row = $db->sql_fetchrow($result));
    9691034
    970                 $banlist_ary = array_unique(array_diff($banlist_ary, $banlist_ary_tmp));
     1035                $banlist_ary_tmp = array_intersect($banlist_ary, $banlist_ary_tmp);
     1036
     1037                if (sizeof($banlist_ary_tmp))
     1038                {
     1039                        // One or more entities are already banned/excluded, delete the existing bans, so they can be re-inserted with the given new length
     1040                        $sql = 'DELETE FROM ' . BANLIST_TABLE . '
     1041                                WHERE ' . $db->sql_in_set($type, $banlist_ary_tmp) . '
     1042                                        AND ban_exclude = ' . (int) $ban_exclude;
     1043                        $db->sql_query($sql);
     1044                }
     1045
    9711046                unset($banlist_ary_tmp);
    9721047        }
     
    10511126                $log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_';
    10521127
    1053                 // Add to moderator and admin log
     1128                // Add to moderator log, admin log and user notes
    10541129                add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
    10551130                add_log('mod', 0, 0, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
     1131                if ($mode == 'user')
     1132                {
     1133                        foreach ($banlist_ary as $user_id)
     1134                        {
     1135                                add_log('user', $user_id, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
     1136                        }
     1137                }
    10561138
    10571139                $cache->destroy('sql', BANLIST_TABLE);
     
    10921174                {
    10931175                        case 'user':
    1094                                 $sql = 'SELECT u.username AS unban_info
     1176                                $sql = 'SELECT u.username AS unban_info, u.user_id
    10951177                                        FROM ' . USERS_TABLE . ' u, ' . BANLIST_TABLE . ' b
    10961178                                        WHERE ' . $db->sql_in_set('b.ban_id', $unban_sql) . '
     
    11131195
    11141196                $l_unban_list = '';
     1197                $user_ids_ary = array();
    11151198                while ($row = $db->sql_fetchrow($result))
    11161199                {
    11171200                        $l_unban_list .= (($l_unban_list != '') ? ', ' : '') . $row['unban_info'];
     1201                        if ($mode == 'user')
     1202                        {
     1203                                $user_ids_ary[] = $row['user_id'];
     1204                        }
    11181205                }
    11191206                $db->sql_freeresult($result);
     
    11231210                $db->sql_query($sql);
    11241211
    1125                 // Add to moderator and admin log
     1212                // Add to moderator log, admin log and user notes
    11261213                add_log('admin', 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
    11271214                add_log('mod', 0, 0, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
     1215                if ($mode == 'user')
     1216                {
     1217                        foreach ($user_ids_ary as $user_id)
     1218                        {
     1219                                add_log('user', $user_id, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
     1220                        }
     1221                }
    11281222        }
    11291223
     
    11351229/**
    11361230* Whois facility
     1231*
     1232* @link http://tools.ietf.org/html/rfc3912 RFC3912: WHOIS Protocol Specification
    11371233*/
    11381234function user_ipwhois($ip)
     
    11471243        }
    11481244
    1149         $match = array(
    1150                 '#RIPE\.NET#is'                         => 'whois.ripe.net',
    1151                 '#whois\.apnic\.net#is'         => 'whois.apnic.net',
    1152                 '#nic\.ad\.jp#is'                       => 'whois.nic.ad.jp',
    1153                 '#whois\.registro\.br#is'       => 'whois.registro.br'
    1154         );
    1155 
    11561245        if (($fsk = @fsockopen('whois.arin.net', 43)))
    11571246        {
    1158                 fputs($fsk, "$ip\n");
     1247                // CRLF as per RFC3912
     1248                fputs($fsk, "$ip\r\n");
    11591249                while (!feof($fsk))
    11601250                {
     
    11641254        }
    11651255
    1166         foreach (array_keys($match) as $server)
    1167         {
    1168                 if (preg_match($server, $ipwhois))
    1169                 {
    1170                         $ipwhois = '';
    1171                         if (($fsk = @fsockopen($match[$server], 43)))
    1172                         {
    1173                                 fputs($fsk, "$ip\n");
    1174                                 while (!feof($fsk))
    1175                                 {
    1176                                         $ipwhois .= fgets($fsk, 1024);
    1177                                 }
    1178                                 @fclose($fsk);
    1179                         }
    1180                         break;
    1181                 }
     1256        $match = array();
     1257
     1258        // Test for referrals from ARIN to other whois databases, roll on rwhois
     1259        if (preg_match('#ReferralServer: whois://(.+)#im', $ipwhois, $match))
     1260        {
     1261                if (strpos($match[1], ':') !== false)
     1262                {
     1263                        $pos    = strrpos($match[1], ':');
     1264                        $server = substr($match[1], 0, $pos);
     1265                        $port   = (int) substr($match[1], $pos + 1);
     1266                        unset($pos);
     1267                }
     1268                else
     1269                {
     1270                        $server = $match[1];
     1271                        $port   = 43;
     1272                }
     1273
     1274                $buffer = '';
     1275
     1276                if (($fsk = @fsockopen($server, $port)))
     1277                {
     1278                        fputs($fsk, "$ip\r\n");
     1279                        while (!feof($fsk))
     1280                        {
     1281                                $buffer .= fgets($fsk, 1024);
     1282                        }
     1283                        @fclose($fsk);
     1284                }
     1285
     1286                // Use the result from ARIN if we don't get any result here
     1287                $ipwhois = (empty($buffer)) ? $ipwhois : $buffer;
    11821288        }
    11831289
     
    14151521                        else if ($mbstring)
    14161522                        {
    1417                                 $regex = '[-\]_+ [[:upper:][:lower:][:digit:]]+';
     1523                                $regex = '[-\]_+ \[[:upper:][:lower:][:digit:]]+';
    14181524                        }
    14191525                        else
     
    14401546        else if ($mbstring)
    14411547        {
    1442                 $matches = array();
    1443                 mb_ereg_search_init('^' . $username . '$', $regex, $matches);
     1548                mb_ereg_search_init($username, '^' . $regex . '$');
    14441549                if (!mb_ereg_search())
    14451550                {
     
    16231728                $sql = 'SELECT user_email_hash
    16241729                        FROM ' . USERS_TABLE . "
    1625                         WHERE user_email_hash = " . (crc32($email) . strlen($email));
     1730                        WHERE user_email_hash = " . $db->sql_escape(phpbb_email_hash($email));
    16261731                $result = $db->sql_query($sql);
    16271732                $row = $db->sql_fetchrow($result);
     
    20572162                                                {
    20582163                                                        $avatar_list[$file][$avatar_row_count][$avatar_col_count] = array(
    2059                                                                 'file'          => "$file/$sub_file",
    2060                                                                 'filename'      => $sub_file,
     2164                                                                'file'          => rawurlencode($file) . '/' . rawurlencode($sub_file),
     2165                                                                'filename'      => rawurlencode($sub_file),
    20612166                                                                'name'          => ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $sub_file))),
    20622167                                                        );
     
    23452450
    23462451        $error = array();
    2347         $attribute_ary = array(
    2348                 'group_colour'                  => 'string',
    2349                 'group_rank'                    => 'int',
    2350                 'group_avatar'                  => 'string',
    2351                 'group_avatar_type'             => 'int',
    2352                 'group_avatar_width'    => 'int',
    2353                 'group_avatar_height'   => 'int',
    2354 
    2355                 'group_receive_pm'              => 'int',
    2356                 'group_legend'                  => 'int',
    2357                 'group_message_limit'   => 'int',
    2358                 'group_max_recipients'  => 'int',
    2359 
    2360                 'group_founder_manage'  => 'int',
    2361         );
    2362 
    2363         // Those are group-only attributes
    2364         $group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit', 'group_max_recipients', 'group_founder_manage');
     2452
     2453        // Attributes which also affect the users table
     2454        $user_attribute_ary = array('group_colour', 'group_rank', 'group_avatar', 'group_avatar_type', 'group_avatar_width', 'group_avatar_height');
    23652455
    23662456        // Check data. Limit group name length.
     
    24002490                if (sizeof($group_attributes))
    24012491                {
    2402                         foreach ($attribute_ary as $attribute => $_type)
    2403                         {
    2404                                 if (isset($group_attributes[$attribute]))
    2405                                 {
    2406                                         settype($group_attributes[$attribute], $_type);
    2407                                         $sql_ary[$attribute] = $group_attributes[$attribute];
    2408                                 }
    2409                         }
     2492                        // Merge them with $sql_ary to properly update the group
     2493                        $sql_ary = array_merge($sql_ary, $group_attributes);
    24102494                }
    24112495
     
    24322516                                remove_default_avatar($group_id, $user_ary);
    24332517                        }
     2518
    24342519                        if (isset($sql_ary['group_rank']) && !$sql_ary['group_rank'])
    24352520                        {
     
    24472532                                WHERE group_id = $group_id";
    24482533                        $db->sql_query($sql);
     2534
     2535                        // One special case is the group skip auth setting. If this was changed we need to purge permissions for this group
     2536                        if (isset($group_attributes['group_skip_auth']))
     2537                        {
     2538                                // Get users within this group...
     2539                                $sql = 'SELECT user_id
     2540                                        FROM ' . USER_GROUP_TABLE . '
     2541                                        WHERE group_id = ' . $group_id . '
     2542                                                AND user_pending = 0';
     2543                                $result = $db->sql_query($sql);
     2544
     2545                                $user_id_ary = array();
     2546                                while ($row = $db->sql_fetchrow($result))
     2547                                {
     2548                                        $user_id_ary[] = $row['user_id'];
     2549                                }
     2550                                $db->sql_freeresult($result);
     2551
     2552                                if (!empty($user_id_ary))
     2553                                {
     2554                                        global $auth;
     2555
     2556                                        // Clear permissions cache of relevant users
     2557                                        $auth->acl_clear_prefetch($user_id_ary);
     2558                                }
     2559                        }
    24492560                }
    24502561                else
     
    24572568                {
    24582569                        $group_id = $db->sql_nextid();
     2570
    24592571                        if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == AVATAR_UPLOAD)
    24602572                        {
     
    24672579                if (sizeof($group_attributes))
    24682580                {
    2469                         foreach ($attribute_ary as $attribute => $_type)
    2470                         {
    2471                                 if (isset($group_attributes[$attribute]) && !in_array($attribute, $group_only_ary))
     2581                        // Go through the user attributes array, check if a group attribute matches it and then set it. ;)
     2582                        foreach ($user_attribute_ary as $attribute)
     2583                        {
     2584                                if (!isset($group_attributes[$attribute]))
    24722585                                {
    2473                                         // If we are about to set an avatar, we will not overwrite user avatars if no group avatar is set...
    2474                                         if (strpos($attribute, 'group_avatar') === 0 && !$group_attributes[$attribute])
    2475                                         {
    2476                                                 continue;
    2477                                         }
    2478 
    2479                                         $sql_ary[$attribute] = $group_attributes[$attribute];
     2586                                        continue;
    24802587                                }
     2588
     2589                                // If we are about to set an avatar, we will not overwrite user avatars if no group avatar is set...
     2590                                if (strpos($attribute, 'group_avatar') === 0 && !$group_attributes[$attribute])
     2591                                {
     2592                                        continue;
     2593                                }
     2594
     2595                                $sql_ary[$attribute] = $group_attributes[$attribute];
    24812596                        }
    24822597                }
     
    26822797        if ($default)
    26832798        {
    2684                 group_set_user_default($group_id, $user_id_ary, $group_attributes);
     2799                group_user_attributes('default', $group_id, $user_id_ary, false, $group_name, $group_attributes);
    26852800        }
    26862801
     
    26952810        }
    26962811
    2697         $log = ($leader) ? 'LOG_MODS_ADDED' : 'LOG_USERS_ADDED';
     2812        $log = ($leader) ? 'LOG_MODS_ADDED' : (($pending) ? 'LOG_USERS_PENDING' : 'LOG_USERS_ADDED');
    26982813
    26992814        add_log('admin', $log, $group_name, implode(', ', $username_ary));
     
    27142829function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false)
    27152830{
    2716         global $db, $auth;
    2717 
    2718         $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS');
     2831        global $db, $auth, $config;
     2832
     2833        if ($config['coppa_enable'])
     2834        {
     2835                $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED_COPPA', 'REGISTERED', 'BOTS', 'GUESTS');
     2836        }
     2837        else
     2838        {
     2839                $group_order = array('ADMINISTRATORS', 'GLOBAL_MODERATORS', 'NEWLY_REGISTERED', 'REGISTERED', 'BOTS', 'GUESTS');
     2840        }
    27192841
    27202842        // We need both username and user_id info
     
    27802902        while ($row = $db->sql_fetchrow($result))
    27812903        {
    2782                 if ($default_groups[$row['user_id']] == $group_id && (!isset($temp_ary[$row['user_id']]) || array_search($row['group_name'], $group_order) < $temp_ary[$row['user_id']]))
     2904                if ($default_groups[$row['user_id']] == $group_id && (!isset($temp_ary[$row['user_id']]) || $group_order_id[$row['group_name']] < $temp_ary[$row['user_id']]))
    27832905                {
    27842906                        $temp_ary[$row['user_id']] = $row['group_id'];
     
    27872909        $db->sql_freeresult($result);
    27882910
     2911        // sql_where_ary holds the new default groups and their users
    27892912        $sql_where_ary = array();
    27902913        foreach ($temp_ary as $uid => $gid)
     
    28202943        $log = 'LOG_GROUP_REMOVE';
    28212944
    2822         add_log('admin', $log, $group_name, implode(', ', $username_ary));
     2945        if ($group_name)
     2946        {
     2947                add_log('admin', $log, $group_name, implode(', ', $username_ary));
     2948        }
    28232949
    28242950        group_update_listings($group_id);
     
    30103136
    30113137                case 'default':
     3138                        // We only set default group for approved members of the group
     3139                        $sql = 'SELECT user_id
     3140                                FROM ' . USER_GROUP_TABLE . "
     3141                                WHERE group_id = $group_id
     3142                                        AND user_pending = 0
     3143                                        AND " . $db->sql_in_set('user_id', $user_id_ary);
     3144                        $result = $db->sql_query($sql);
     3145
     3146                        $user_id_ary = $username_ary = array();
     3147                        while ($row = $db->sql_fetchrow($result))
     3148                        {
     3149                                $user_id_ary[] = $row['user_id'];
     3150                        }
     3151                        $db->sql_freeresult($result);
     3152
     3153                        $result = user_get_id_name($user_id_ary, $username_ary);
     3154                        if (!sizeof($user_id_ary) || $result !== false)
     3155                        {
     3156                                return 'NO_USERS';
     3157                        }
     3158
    30123159                        $sql = 'SELECT user_id, group_id FROM ' . USERS_TABLE . '
    30133160                                WHERE ' . $db->sql_in_set('user_id', $user_id_ary, false, true);
     
    30983245function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false)
    30993246{
    3100         global $db;
     3247        global $cache, $db;
    31013248
    31023249        if (empty($user_id_ary))
     
    31983345                group_update_listings($group_id);
    31993346        }
     3347
     3348        // Because some tables/caches use usercolour-specific data we need to purge this here.
     3349        $cache->destroy('sql', MODERATOR_CACHE_TABLE);
    32003350}
    32013351
     
    32143364        $db->sql_freeresult($result);
    32153365
    3216         if (!$row)
     3366        if (!$row || ($row['group_type'] == GROUP_SPECIAL && empty($user->lang)))
    32173367        {
    32183368                return '';
     
    33573507}
    33583508
     3509
     3510
     3511/**
     3512* Funtion to make a user leave the NEWLY_REGISTERED system group.
     3513* @access public
     3514* @param $user_id The id of the user to remove from the group
     3515*/
     3516function remove_newly_registered($user_id, $user_data = false)
     3517{
     3518        global $db;
     3519
     3520        if ($user_data === false)
     3521        {
     3522                $sql = 'SELECT *
     3523                        FROM ' . USERS_TABLE . '
     3524                        WHERE user_id = ' . $user_id;
     3525                $result = $db->sql_query($sql);
     3526                $user_row = $db->sql_fetchrow($result);
     3527                $db->sql_freeresult($result);
     3528
     3529                if (!$user_row)
     3530                {
     3531                        return false;
     3532                }
     3533                else
     3534                {
     3535                        $user_data  = $user_row;
     3536                }
     3537        }
     3538
     3539        if (empty($user_data['user_new']))
     3540        {
     3541                return false;
     3542        }
     3543
     3544        $sql = 'SELECT group_id
     3545                FROM ' . GROUPS_TABLE . "
     3546                WHERE group_name = 'NEWLY_REGISTERED'
     3547                        AND group_type = " . GROUP_SPECIAL;
     3548        $result = $db->sql_query($sql);
     3549        $group_id = (int) $db->sql_fetchfield('group_id');
     3550        $db->sql_freeresult($result);
     3551
     3552        if (!$group_id)
     3553        {
     3554                return false;
     3555        }
     3556
     3557        // We need to call group_user_del here, because this function makes sure everything is correctly changed.
     3558        // A downside for a call within the session handler is that the language is not set up yet - so no log entry
     3559        group_user_del($group_id, $user_id);
     3560
     3561        // Set user_new to 0 to let this not be triggered again
     3562        $sql = 'UPDATE ' . USERS_TABLE . '
     3563                SET user_new = 0
     3564                WHERE user_id = ' . $user_id;
     3565        $db->sql_query($sql);
     3566
     3567        // The new users group was the users default group?
     3568        if ($user_data['group_id'] == $group_id)
     3569        {
     3570                // Which group is now the users default one?
     3571                $sql = 'SELECT group_id
     3572                        FROM ' . USERS_TABLE . '
     3573                        WHERE user_id = ' . $user_id;
     3574                $result = $db->sql_query($sql);
     3575                $user_data['group_id'] = $db->sql_fetchfield('group_id');
     3576                $db->sql_freeresult($result);
     3577        }
     3578
     3579        return $user_data['group_id'];
     3580}
     3581
    33593582?>
  • trunk/forum/includes/mcp/mcp_front.php

    r400 r702  
    33*
    44* @package mcp
    5 * @version $Id: mcp_front.php 9029 2008-10-18 18:44:41Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3535
    3636                $template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false);
    37                
     37
    3838                if (!empty($forum_list))
    3939                {
     
    120120                        }
    121121
     122                        $s_hidden_fields = build_hidden_fields(array(
     123                                'redirect'              => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main' . (($forum_id) ? '&amp;f=' . $forum_id : ''))
     124                        ));
     125
    122126                        $template->assign_vars(array(
     127                                'S_HIDDEN_FIELDS'               => $s_hidden_fields,
    123128                                'S_MCP_QUEUE_ACTION'    => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"),
    124129                        ));
     
    153158                                FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p
    154159                                WHERE r.post_id = p.post_id
     160                                        AND r.pm_id = 0
    155161                                        AND r.report_closed = 0
    156162                                        AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')';
     
    182188
    183189                                        'WHERE'         => 'r.post_id = p.post_id
     190                                                AND r.pm_id = 0
    184191                                                AND r.report_closed = 0
    185192                                                AND r.reason_id = rr.reason_id
     
    241248                                );
    242249                        }
     250                }
     251        }
     252
     253        // Latest 5 reported PMs
     254        if ($module->loaded('pm_reports') && $auth->acl_getf_global('m_report'))
     255        {
     256                $template->assign_var('S_SHOW_PM_REPORTS', true);
     257                $user->add_lang(array('ucp'));
     258
     259                $sql = 'SELECT COUNT(r.report_id) AS total
     260                        FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . ' p
     261                        WHERE r.post_id = 0
     262                                AND r.pm_id = p.msg_id
     263                                AND r.report_closed = 0';
     264                $result = $db->sql_query($sql);
     265                $total = (int) $db->sql_fetchfield('total');
     266                $db->sql_freeresult($result);
     267
     268                if ($total)
     269                {
     270                        include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
     271
     272                        $sql = $db->sql_build_query('SELECT', array(
     273                                'SELECT'        => 'r.report_id, r.report_time, p.msg_id, p.message_subject, p.message_time, p.to_address, p.bcc_address, u.username, u.username_clean, u.user_colour, u.user_id, u2.username as author_name, u2.username_clean as author_name_clean, u2.user_colour as author_colour, u2.user_id as author_id',
     274
     275                                'FROM'          => array(
     276                                        REPORTS_TABLE                   => 'r',
     277                                        REPORTS_REASONS_TABLE   => 'rr',
     278                                        USERS_TABLE                             => array('u', 'u2'),
     279                                        PRIVMSGS_TABLE                          => 'p'
     280                                ),
     281
     282                                'WHERE'         => 'r.pm_id = p.msg_id
     283                                        AND r.post_id = 0
     284                                        AND r.report_closed = 0
     285                                        AND r.reason_id = rr.reason_id
     286                                        AND r.user_id = u.user_id
     287                                        AND p.author_id = u2.user_id',
     288
     289                                'ORDER_BY'      => 'p.message_time DESC'
     290                        ));
     291                        $result = $db->sql_query_limit($sql, 5);
     292
     293                        $pm_by_id = $pm_list = array();
     294                        while ($row = $db->sql_fetchrow($result))
     295                        {
     296                                $pm_by_id[(int) $row['msg_id']] = $row;
     297                                $pm_list[] = (int) $row['msg_id'];
     298                        }
     299
     300                        $address_list = get_recipient_strings($pm_by_id);
     301
     302                        foreach ($pm_list as $message_id)
     303                        {
     304                                $row = $pm_by_id[$message_id];
     305
     306                                $template->assign_block_vars('pm_report', array(
     307                                        'U_PM_DETAILS'  => append_sid("{$phpbb_root_path}mcp.$phpEx", 'r=' . $row['report_id'] . "&amp;i=pm_reports&amp;mode=pm_report_details"),
     308
     309                                        'REPORTER_FULL'         => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']),
     310                                        'REPORTER'                      => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
     311                                        'REPORTER_COLOUR'       => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
     312                                        'U_REPORTER'            => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
     313
     314                                        'PM_AUTHOR_FULL'                => get_username_string('full', $row['author_id'], $row['author_name'], $row['author_colour']),
     315                                        'PM_AUTHOR'                     => get_username_string('username', $row['author_id'], $row['author_name'], $row['author_colour']),
     316                                        'PM_AUTHOR_COLOUR'              => get_username_string('colour', $row['author_id'], $row['author_name'], $row['author_colour']),
     317                                        'U_PM_AUTHOR'                   => get_username_string('profile', $row['author_id'], $row['author_name'], $row['author_colour']),
     318
     319                                        'PM_SUBJECT'            => $row['message_subject'],
     320                                        'REPORT_TIME'           => $user->format_date($row['report_time']),
     321                                        'PM_TIME'                       => $user->format_date($row['message_time']),
     322                                        'RECIPIENTS'            => implode(', ', $address_list[$row['msg_id']]),
     323                                ));
     324                        }
     325                }
     326
     327                if ($total == 0)
     328                {
     329                        $template->assign_vars(array(
     330                                'L_PM_REPORTS_TOTAL'    =>      $user->lang['PM_REPORTS_ZERO_TOTAL'],
     331                                'S_HAS_PM_REPORTS'              =>      false)
     332                        );
     333                }
     334                else
     335                {
     336                        $template->assign_vars(array(
     337                                'L_PM_REPORTS_TOTAL'    => ($total == 1) ? $user->lang['PM_REPORT_TOTAL'] : sprintf($user->lang['PM_REPORTS_TOTAL'], $total),
     338                                'S_HAS_PM_REPORTS'              => true)
     339                        );
    243340                }
    244341        }
  • trunk/forum/includes/mcp/mcp_logs.php

    r400 r702  
    33*
    44* @package mcp
    5 * @version $Id: mcp_logs.php 9029 2008-10-18 18:44:41Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    165165                $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
    166166
     167                $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
     168                $keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
     169
    167170                // Grab log data
    168171                $log_data = array();
    169172                $log_count = 0;
    170                 view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort);
     173                view_log('mod', $log_data, $log_count, $config['topics_per_page'], $start, $forum_list, $topic_id, 0, $sql_where, $sql_sort, $keywords);
    171174
    172175                $template->assign_vars(array(
    173176                        'PAGE_NUMBER'           => on_page($log_count, $config['topics_per_page'], $start),
    174177                        'TOTAL'                         => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count),
    175                         'PAGINATION'            => generate_pagination($this->u_action . "&amp;$u_sort_param", $log_count, $config['topics_per_page'], $start),
     178                        'PAGINATION'            => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
    176179
    177180                        'L_TITLE'                       => $user->lang['MCP_LOGS'],
     
    183186                        'S_SELECT_SORT_DAYS'    => $s_limit_days,
    184187                        'S_LOGS'                                => ($log_count > 0),
     188                        'S_KEYWORDS'                    => $keywords,
    185189                        )
    186190                );
     
    189193                {
    190194                        $data = array();
    191                                
     195
    192196                        $checks = array('viewtopic', 'viewforum');
    193197                        foreach ($checks as $check)
  • trunk/forum/includes/mcp/mcp_main.php

    r400 r702  
    33*
    44* @package mcp
    5 * @version $Id: mcp_main.php 8950 2008-09-27 10:59:25Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    569569                                $additional_msg = $user->lang['FORUM_NOT_POSTABLE'];
    570570                        }
    571                         else if (!$auth->acl_get('f_post', $to_forum_id))
     571                        else if (!$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id)))
    572572                        {
    573573                                $additional_msg = $user->lang['USER_CANNOT_POST'];
     
    595595                $leave_shadow = (isset($_POST['move_leave_shadow'])) ? true : false;
    596596
    597                 $topics_moved = sizeof($topic_ids);
    598                 $topics_authed_moved = 0;
    599597                $forum_sync_data = array();
    600598
     
    602600                $forum_sync_data[$to_forum_id] = $forum_data;
    603601
     602                // Real topics added to target forum
     603                $topics_moved = sizeof($topic_data);
     604
     605                // Approved topics added to target forum
     606                $topics_authed_moved = 0;
     607
     608                // Posts (topic replies + topic post if approved) added to target forum
     609                $topic_posts_added = 0;
     610
     611                // Posts (topic replies + topic post if approved and not global announcement) removed from source forum
     612                $topic_posts_removed = 0;
     613
     614                // Real topics removed from source forum (all topics without global announcements)
     615                $topics_removed = 0;
     616
     617                // Approved topics removed from source forum (except global announcements)
     618                $topics_authed_removed = 0;
     619
    604620                foreach ($topic_data as $topic_id => $topic_info)
    605621                {
    606                         if ($topic_info['topic_approved'] == '1')
     622                        if ($topic_info['topic_approved'])
    607623                        {
    608624                                $topics_authed_moved++;
     625                                $topic_posts_added++;
     626                        }
     627
     628                        $topic_posts_added += $topic_info['topic_replies'];
     629
     630                        if ($topic_info['topic_type'] != POST_GLOBAL)
     631                        {
     632                                $topics_removed++;
     633                                $topic_posts_removed += $topic_info['topic_replies'];
     634
     635                                if ($topic_info['topic_approved'])
     636                                {
     637                                        $topics_authed_removed++;
     638                                        $topic_posts_removed++;
     639                                }
    609640                        }
    610641                }
     
    612643                $db->sql_transaction('begin');
    613644
    614                 $sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts
    615                         FROM ' . TOPICS_TABLE . ' t
    616                         WHERE ' . $db->sql_in_set('t.topic_id', $topic_ids);
    617                 $result = $db->sql_query($sql);
    618                 $row_data = $db->sql_fetchrow($result);
    619                 $db->sql_freeresult($result);
    620 
    621645                $sync_sql = array();
    622646
    623                 if ($row_data['topic_posts'])
    624                 {
    625                         $sync_sql[$forum_id][]          = 'forum_posts = forum_posts - ' . (int) $row_data['topic_posts'];
    626                         $sync_sql[$to_forum_id][]       = 'forum_posts = forum_posts + ' . (int) $row_data['topic_posts'];
     647                if ($topic_posts_added)
     648                {
     649                        $sync_sql[$to_forum_id][] = 'forum_posts = forum_posts + ' . $topic_posts_added;
    627650                }
    628651
    629652                if ($topics_authed_moved)
    630653                {
    631                         $sync_sql[$to_forum_id][]       = 'forum_topics = forum_topics + ' . (int) $topics_authed_moved;
    632                 }
    633 
    634                 $sync_sql[$to_forum_id][]       = 'forum_topics_real = forum_topics_real + ' . (int) $topics_moved;
     654                        $sync_sql[$to_forum_id][] = 'forum_topics = forum_topics + ' . (int) $topics_authed_moved;
     655                }
     656
     657                $sync_sql[$to_forum_id][] = 'forum_topics_real = forum_topics_real + ' . (int) $topics_moved;
    635658
    636659                // Move topics, but do not resync yet
     
    693716                                $db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow));
    694717
    695                                 $topics_authed_moved--;
    696                                 $topics_moved--;
     718                                // Shadow topics only count on new "topics" and not posts... a shadow topic alone has 0 posts
     719                                $topics_removed--;
     720                                $topics_authed_removed--;
    697721                        }
    698722                }
    699723                unset($topic_data);
    700724
    701                 $sync_sql[$forum_id][]  = 'forum_topics_real = forum_topics_real - ' . (int) $topics_moved;
    702 
    703                 if ($topics_authed_moved)
    704                 {
    705                         $sync_sql[$forum_id][]  = 'forum_topics = forum_topics - ' . (int) $topics_authed_moved;
     725                if ($topic_posts_removed)
     726                {
     727                        $sync_sql[$forum_id][] = 'forum_posts = forum_posts - ' . $topic_posts_removed;
     728                }
     729
     730                if ($topics_removed)
     731                {
     732                        $sync_sql[$forum_id][]  = 'forum_topics_real = forum_topics_real - ' . (int) $topics_removed;
     733                }
     734
     735                if ($topics_authed_removed)
     736                {
     737                        $sync_sql[$forum_id][]  = 'forum_topics = forum_topics - ' . (int) $topics_authed_removed;
    706738                }
    707739
     
    782814                foreach ($data as $topic_id => $row)
    783815                {
    784                         add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_' . ($row['topic_moved_id'] ? 'SHADOW_' : '') . 'TOPIC', $row['topic_title']);
     816                        if ($row['topic_moved_id'])
     817                        {
     818                                add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_SHADOW_TOPIC', $row['topic_title']);
     819                        }
     820                        else
     821                        {
     822                                add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']);
     823                        }
    785824                }
    786825
     
    866905                foreach ($post_data as $id => $row)
    867906                {
    868                         add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject']);
     907                        $post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
     908                        add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username);
    869909                }
    870910
     
    930970        else
    931971        {
     972                if ($affected_topics != 1 || $deleted_topics || !$topic_id)
     973                {
     974                        $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&i=main&mode=forum_view", false);
     975                }
     976
    932977                meta_refresh(3, $redirect);
    933978                trigger_error($success_msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link));
     
    10281073                                'poll_title'                            => (string) $topic_row['poll_title'],
    10291074                                'poll_start'                            => (int) $topic_row['poll_start'],
    1030                                 'poll_length'                           => (int) $topic_row['poll_length']
     1075                                'poll_length'                           => (int) $topic_row['poll_length'],
     1076                                'poll_max_options'                      => (int) $topic_row['poll_max_options'],
     1077                                'poll_vote_change'                      => (int) $topic_row['poll_vote_change'],
    10311078                        );
    10321079
     
    11301177                                                        'is_orphan'                     => (int) $attach_row['is_orphan'],
    11311178                                                        'poster_id'                     => (int) $attach_row['poster_id'],
    1132                                                         'physical_filename'     => (string) basename($attach_row['physical_filename']),
    1133                                                         'real_filename'         => (string) basename($attach_row['real_filename']),
     1179                                                        'physical_filename'     => (string) utf8_basename($attach_row['physical_filename']),
     1180                                                        'real_filename'         => (string) utf8_basename($attach_row['real_filename']),
    11341181                                                        'download_count'        => (int) $attach_row['download_count'],
    11351182                                                        'attach_comment'        => (string) $attach_row['attach_comment'],
     
    11901237
    11911238                sync('forum', 'forum_id', $to_forum_id);
    1192                 set_config('num_topics', $config['num_topics'] + sizeof($new_topic_id_list), true);
    1193                 set_config('num_posts', $config['num_posts'] + $total_posts, true);
     1239                set_config_count('num_topics', sizeof($new_topic_id_list), true);
     1240                set_config_count('num_posts', $total_posts, true);
    11941241
    11951242                foreach ($new_topic_id_list as $topic_id => $new_topic_id)
  • trunk/forum/includes/mcp/mcp_notes.php

    r400 r702  
    33*
    44* @package mcp
    5 * @version $Id: mcp_notes.php 8598 2008-06-04 15:37:06Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    194194                $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
    195195
     196                $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
     197                $keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
     198
    196199                $log_data = array();
    197200                $log_count = 0;
    198                 view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
     201                view_log('user', $log_data, $log_count, $config['topics_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort, $keywords);
    199202
    200203                if ($log_count)
     
    220223                        'S_SELECT_SORT_KEY'             => $s_sort_key,
    221224                        'S_SELECT_SORT_DAYS'    => $s_limit_days,
     225                        'S_KEYWORDS'                    => $keywords,
    222226
    223227                        'L_TITLE'                       => $user->lang['MCP_NOTES_USER'],
    224228
    225                         'PAGE_NUMBER'           => on_page($log_count, $config['posts_per_page'], $start),
    226                         'PAGINATION'            => generate_pagination($this->u_action . "&amp;st=$st&amp;sk=$sk&amp;sd=$sd", $log_count, $config['posts_per_page'], $start),
     229                        'PAGE_NUMBER'           => on_page($log_count, $config['topics_per_page'], $start),
     230                        'PAGINATION'            => generate_pagination($this->u_action . "&amp;$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start),
    227231                        'TOTAL_REPORTS'         => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count),
    228232
    229                         'USERNAME'                      => $userrow['username'],
    230                         'USER_COLOR'            => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '',
    231233                        'RANK_TITLE'            => $rank_title,
    232234                        'JOINED'                        => $user->format_date($userrow['user_regdate']),
    233235                        'POSTS'                         => ($userrow['user_posts']) ? $userrow['user_posts'] : 0,
    234236                        'WARNINGS'                      => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0,
     237
     238                        'USERNAME_FULL'         => get_username_string('full', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
     239                        'USERNAME_COLOUR'       => get_username_string('colour', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
     240                        'USERNAME'                      => get_username_string('username', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
     241                        'U_PROFILE'                     => get_username_string('profile', $userrow['user_id'], $userrow['username'], $userrow['user_colour']),
    235242
    236243                        'AVATAR_IMG'            => $avatar_img,
  • trunk/forum/includes/mcp/mcp_queue.php

    r400 r702  
    33*
    44* @package mcp
    5 * @version $Id: mcp_queue.php 9133 2008-11-30 12:03:43Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    106106                                        $template->assign_vars(array(
    107107                                                'S_TOPIC_REVIEW'        => true,
     108                                                'S_BBCODE_ALLOWED'      => $post_info['enable_bbcode'],
    108109                                                'TOPIC_TITLE'           => $post_info['topic_title'])
    109110                                        );
     
    492493
    493494                $total_topics = $total_posts = 0;
    494                 $forum_topics_posts = $topic_approve_sql = $topic_replies_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array();
    495                 $user_posts_sql = array();
    496 
    497                 $update_forum_information = false;
     495                $topic_approve_sql = $post_approve_sql = $topic_id_list = $forum_id_list = $approve_log = array();
     496                $user_posts_sql = $post_approved_list = array();
    498497
    499498                foreach ($post_info as $post_id => $post_data)
    500499                {
     500                        if ($post_data['post_approved'])
     501                        {
     502                                $post_approved_list[] = $post_id;
     503                                continue;
     504                        }
     505
    501506                        $topic_id_list[$post_data['topic_id']] = 1;
    502507
     
    518523                                if ($post_data['forum_id'])
    519524                                {
    520                                         if (!isset($forum_topics_posts[$post_data['forum_id']]))
    521                                         {
    522                                                 $forum_topics_posts[$post_data['forum_id']] = array(
    523                                                         'forum_posts'   => 0,
    524                                                         'forum_topics'  => 0
    525                                                 );
    526                                         }
    527 
    528525                                        $total_topics++;
    529                                         $forum_topics_posts[$post_data['forum_id']]['forum_topics']++;
    530526                                }
    531527                                $topic_approve_sql[] = $post_data['topic_id'];
     
    540536                        else
    541537                        {
    542                                 if (!isset($topic_replies_sql[$post_data['topic_id']]))
    543                                 {
    544                                         $topic_replies_sql[$post_data['topic_id']] = 0;
    545                                 }
    546                                 $topic_replies_sql[$post_data['topic_id']]++;
    547 
    548538                                $approve_log[] = array(
    549539                                        'type'                  => 'post',
     
    556546                        if ($post_data['forum_id'])
    557547                        {
    558                                 if (!isset($forum_topics_posts[$post_data['forum_id']]))
    559                                 {
    560                                         $forum_topics_posts[$post_data['forum_id']] = array(
    561                                                 'forum_posts'   => 0,
    562                                                 'forum_topics'  => 0
    563                                         );
    564                                 }
    565 
    566548                                $total_posts++;
    567                                 $forum_topics_posts[$post_data['forum_id']]['forum_posts']++;
    568549
    569550                                // Increment by topic_replies if we approve a topic...
     
    572553                                {
    573554                                        $total_posts += $post_data['topic_replies'];
    574                                         $forum_topics_posts[$post_data['forum_id']]['forum_posts'] += $post_data['topic_replies'];
    575555                                }
    576556                        }
    577557
    578558                        $post_approve_sql[] = $post_id;
    579 
    580                         // If the post is newer than the last post information stored we need to update the forum information
    581                         if ($post_data['post_time'] >= $post_data['forum_last_post_time'])
    582                         {
    583                                 $update_forum_information = true;
    584                         }
     559                }
     560
     561                $post_id_list = array_values(array_diff($post_id_list, $post_approved_list));
     562                for ($i = 0, $size = sizeof($post_approved_list); $i < $size; $i++)
     563                {
     564                        unset($post_info[$post_approved_list[$i]]);
    585565                }
    586566
     
    601581                }
    602582
     583                unset($topic_approve_sql, $post_approve_sql);
     584
    603585                foreach ($approve_log as $log_data)
    604586                {
    605587                        add_log('mod', $log_data['forum_id'], $log_data['topic_id'], ($log_data['type'] == 'topic') ? 'LOG_TOPIC_APPROVED' : 'LOG_POST_APPROVED', $log_data['post_subject']);
    606                 }
    607 
    608                 if (sizeof($topic_replies_sql))
    609                 {
    610                         foreach ($topic_replies_sql as $topic_id => $num_replies)
    611                         {
    612                                 $sql = 'UPDATE ' . TOPICS_TABLE . "
    613                                         SET topic_replies = topic_replies + $num_replies
    614                                         WHERE topic_id = $topic_id";
    615                                 $db->sql_query($sql);
    616                         }
    617                 }
    618 
    619                 if (sizeof($forum_topics_posts))
    620                 {
    621                         foreach ($forum_topics_posts as $forum_id => $row)
    622                         {
    623                                 $sql = 'UPDATE ' . FORUMS_TABLE . '
    624                                         SET ';
    625                                 $sql .= ($row['forum_topics']) ? "forum_topics = forum_topics + {$row['forum_topics']}" : '';
    626                                 $sql .= ($row['forum_topics'] && $row['forum_posts']) ? ', ' : '';
    627                                 $sql .= ($row['forum_posts']) ? "forum_posts = forum_posts + {$row['forum_posts']}" : '';
    628                                 $sql .= " WHERE forum_id = $forum_id";
    629 
    630                                 $db->sql_query($sql);
    631                         }
    632588                }
    633589
     
    653609                if ($total_topics)
    654610                {
    655                         set_config('num_topics', $config['num_topics'] + $total_topics, true);
     611                        set_config_count('num_topics', $total_topics, true);
    656612                }
    657613
    658614                if ($total_posts)
    659615                {
    660                         set_config('num_posts', $config['num_posts'] + $total_posts, true);
    661                 }
    662                 unset($topic_approve_sql, $topic_replies_sql, $post_approve_sql);
    663 
    664                 update_post_information('topic', array_keys($topic_id_list));
    665 
    666                 if ($update_forum_information)
    667                 {
    668                         update_post_information('forum', array_keys($forum_id_list));
    669                 }
     616                        set_config_count('num_posts', $total_posts, true);
     617                }
     618
     619                sync('topic', 'topic_id', array_keys($topic_id_list), true);
     620                sync('forum', 'forum_id', array_keys($forum_id_list), true, true);
    670621                unset($topic_id_list, $forum_id_list);
    671622
     
    734685                else
    735686                {
    736                         $success_msg = (sizeof($post_id_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS';
     687                        $success_msg = (sizeof($post_id_list) + sizeof($post_approved_list) == 1) ? 'POST_APPROVED_SUCCESS' : 'POSTS_APPROVED_SUCCESS';
    737688                }
    738689        }
     
    846797        if (confirm_box(true))
    847798        {
    848 
    849                 // If Topic -> forum_topics_real -= 1
    850                 // If Post -> topic_replies_real -= 1
    851 
    852                 $num_disapproved = 0;
    853                 $forum_topics_real = $topic_id_list = $forum_id_list = $topic_replies_real_sql = $post_disapprove_sql = $disapprove_log = array();
    854 
     799                $disapprove_log = $disapprove_log_topics = $disapprove_log_posts = array();
     800                $topic_replies_real = $post_disapprove_list = array();
     801
     802                // Build a list of posts to be unapproved and get the related topics real replies count
    855803                foreach ($post_info as $post_id => $post_data)
    856804                {
    857                         $topic_id_list[$post_data['topic_id']] = 1;
    858 
    859                         if ($post_data['forum_id'])
    860                         {
    861                                 $forum_id_list[$post_data['forum_id']] = 1;
    862                         }
    863 
    864                         // Topic or Post. ;)
    865                         /**
    866                         * @todo this probably is a different method than the one used by delete_posts, does this cause counter inconsistency?
    867                         */
    868                         if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_last_post_id'] == $post_id)
    869                         {
    870                                 if ($post_data['forum_id'])
    871                                 {
    872                                         if (!isset($forum_topics_real[$post_data['forum_id']]))
    873                                         {
    874                                                 $forum_topics_real[$post_data['forum_id']] = 0;
    875                                         }
    876                                         $forum_topics_real[$post_data['forum_id']]++;
    877                                         $num_disapproved++;
    878                                 }
    879 
    880                                 $disapprove_log[] = array(
    881                                         'type'                  => 'topic',
    882                                         'post_subject'  => $post_data['post_subject'],
    883                                         'forum_id'              => $post_data['forum_id'],
    884                                         'topic_id'              => 0, // useless to log a topic id, as it will be deleted
     805                        $post_disapprove_list[$post_id] = $post_data['topic_id'];
     806                        if (!isset($topic_replies_real[$post_data['topic_id']]))
     807                        {
     808                                $topic_replies_real[$post_data['topic_id']] = $post_data['topic_replies_real'];
     809                        }
     810                }
     811
     812                // Now we build the log array
     813                foreach ($post_disapprove_list as $post_id => $topic_id)
     814                {
     815                        // If the count of disapproved posts for the topic is greater
     816                        // than topic's real replies count, the whole topic is disapproved/deleted
     817                        if (sizeof(array_keys($post_disapprove_list, $topic_id)) > $topic_replies_real[$topic_id])
     818                        {
     819                                // Don't write the log more than once for every topic
     820                                if (!isset($disapprove_log_topics[$topic_id]))
     821                                {
     822                                        // Build disapproved topics log
     823                                        $disapprove_log_topics[$topic_id] = array(
     824                                                'type'                  => 'topic',
     825                                                'post_subject'  => $post_info[$post_id]['topic_title'],
     826                                                'forum_id'              => $post_info[$post_id]['forum_id'],
     827                                                'topic_id'              => 0, // useless to log a topic id, as it will be deleted
     828                                        );
     829                                }
     830                        }
     831                        else
     832                        {
     833                                // Build disapproved posts log
     834                                $disapprove_log_posts[] = array(
     835                                        'type'                  => 'post',
     836                                        'post_subject'  => $post_info[$post_id]['post_subject'],
     837                                        'forum_id'              => $post_info[$post_id]['forum_id'],
     838                                        'topic_id'              => $post_info[$post_id]['topic_id'],
    885839                                );
    886                         }
    887                         else
    888                         {
    889                                 if (!isset($topic_replies_real_sql[$post_data['topic_id']]))
    890                                 {
    891                                         $topic_replies_real_sql[$post_data['topic_id']] = 0;
    892                                 }
    893                                 $topic_replies_real_sql[$post_data['topic_id']]++;
    894 
    895                                 $disapprove_log[] = array(
    896                                         'type'                  => 'post',
    897                                         'post_subject'  => $post_data['post_subject'],
    898                                         'forum_id'              => $post_data['forum_id'],
    899                                         'topic_id'              => $post_data['topic_id'],
    900                                 );
    901                         }
    902 
    903                         $post_disapprove_sql[] = $post_id;
    904                 }
    905 
    906                 unset($post_data);
    907 
    908                 if (sizeof($forum_topics_real))
    909                 {
    910                         foreach ($forum_topics_real as $forum_id => $topics_real)
    911                         {
    912                                 $sql = 'UPDATE ' . FORUMS_TABLE . "
    913                                         SET forum_topics_real = forum_topics_real - $topics_real
    914                                         WHERE forum_id = $forum_id";
    915                                 $db->sql_query($sql);
    916                         }
    917                 }
    918 
    919                 if (sizeof($topic_replies_real_sql))
    920                 {
    921                         foreach ($topic_replies_real_sql as $topic_id => $num_replies)
    922                         {
    923                                 $sql = 'UPDATE ' . TOPICS_TABLE . "
    924                                         SET topic_replies_real = topic_replies_real - $num_replies
    925                                         WHERE topic_id = $topic_id";
    926                                 $db->sql_query($sql);
    927                         }
    928                 }
    929 
    930                 if (sizeof($post_disapprove_sql))
     840
     841                        }
     842                }
     843
     844                // Get disapproved posts/topics counts separately
     845                $num_disapproved_topics = sizeof($disapprove_log_topics);
     846                $num_disapproved_posts = sizeof($disapprove_log_posts);
     847
     848                // Build the whole log
     849                $disapprove_log = array_merge($disapprove_log_topics, $disapprove_log_posts);
     850
     851                // Unset unneeded arrays
     852                unset($post_data, $disapprove_log_topics, $disapprove_log_posts);
     853
     854                // Let's do the job - delete disapproved posts
     855                if (sizeof($post_disapprove_list))
    931856                {
    932857                        if (!function_exists('delete_posts'))
     
    936861
    937862                        // We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts
    938                         delete_posts('post_id', $post_disapprove_sql);
     863                        // Note: function delete_posts triggers related forums/topics sync,
     864                        // so we don't need to call update_post_information later and to adjust real topic replies or forum topics count manually
     865                        delete_posts('post_id', array_keys($post_disapprove_list));
    939866
    940867                        foreach ($disapprove_log as $log_data)
     
    943870                        }
    944871                }
    945                 unset($post_disapprove_sql, $topic_replies_real_sql);
    946 
    947                 update_post_information('topic', array_keys($topic_id_list));
    948 
    949                 if (sizeof($forum_id_list))
    950                 {
    951                         update_post_information('forum', array_keys($forum_id_list));
    952                 }
    953                 unset($topic_id_list, $forum_id_list);
    954872
    955873                $messenger = new messenger();
     
    980898                                                        // Load up the language pack
    981899                                                        $lang = array();
    982                                                         @include($phpbb_root_path . '/language/' . $post_data['user_lang'] . '/mcp.' . $phpEx);
     900                                                        @include($phpbb_root_path . '/language/' . basename($post_data['user_lang']) . '/mcp.' . $phpEx);
    983901
    984902                                                        // If we find the reason in this language pack use it
     
    1019937                $messenger->save_queue();
    1020938
    1021                 if (sizeof($forum_topics_real))
    1022                 {
    1023                         $success_msg = ($num_disapproved == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS';
     939                if ($num_disapproved_topics)
     940                {
     941                        $success_msg = ($num_disapproved_topics == 1) ? 'TOPIC_DISAPPROVED_SUCCESS' : 'TOPICS_DISAPPROVED_SUCCESS';
    1024942                }
    1025943                else
    1026944                {
    1027                         $success_msg = (sizeof($post_id_list) == 1) ? 'POST_DISAPPROVED_SUCCESS' : 'POSTS_DISAPPROVED_SUCCESS';
     945                        $success_msg = ($num_disapproved_posts == 1) ? 'POST_DISAPPROVED_SUCCESS' : 'POSTS_DISAPPROVED_SUCCESS';
    1028946                }
    1029947        }
  • trunk/forum/includes/mcp/mcp_reports.php

    r400 r702  
    33*
    44* @package mcp
    5 * @version $Id: mcp_reports.php 9015 2008-10-14 18:29:50Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    7878                                                AND rr.reason_id = r.reason_id
    7979                                                AND r.user_id = u.user_id
     80                                                AND r.pm_id = 0
    8081                                        ORDER BY report_closed ASC';
    8182                                $result = $db->sql_query_limit($sql, 1);
     
    116117                                        $template->assign_vars(array(
    117118                                                'S_TOPIC_REVIEW'        => true,
     119                                                'S_BBCODE_ALLOWED'      => $post_info['enable_bbcode'],
    118120                                                'TOPIC_TITLE'           => $post_info['topic_title'])
    119121                                        );
     
    150152                                if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
    151153                                {
    152                                         $extensions = $cache->obtain_attach_extensions($post_info['forum_id']);
    153 
    154154                                        $sql = 'SELECT *
    155155                                                FROM ' . ATTACHMENTS_TABLE . '
    156156                                                WHERE post_msg_id = ' . $post_id . '
    157157                                                        AND in_message = 0
    158                                                 ORDER BY filetime DESC, post_msg_id ASC';
     158                                                ORDER BY filetime DESC';
    159159                                        $result = $db->sql_query($sql);
    160160
     
    259259                                unset($forum_list_read);
    260260
    261                                 if ($topic_id && $forum_id)
     261                                if ($topic_id)
    262262                                {
    263263                                        $topic_info = get_topic_data(array($topic_id));
     
    268268                                        }
    269269
    270                                         $topic_info = $topic_info[$topic_id];
    271                                         $forum_id = $topic_info['forum_id'];
    272                                 }
    273                                 else if ($topic_id && !$forum_id)
    274                                 {
    275                                         $topic_id = 0;
     270                                        if ($forum_id != $topic_info[$topic_id]['forum_id'])
     271                                        {
     272                                                $topic_id = 0;
     273                                        }
     274                                        else
     275                                        {
     276                                                $topic_info = $topic_info[$topic_id];
     277                                                $forum_id = (int) $topic_info['forum_id'];
     278                                        }
    276279                                }
    277280
     
    330333
    331334                                $forum_topics = ($total == -1) ? $forum_info['forum_topics'] : $total;
    332                                 $limit_time_sql = ($sort_days) ? 'AND t.topic_last_post_time >= ' . (time() - ($sort_days * 86400)) : '';
     335                                $limit_time_sql = ($sort_days) ? 'AND r.report_time >= ' . (time() - ($sort_days * 86400)) : '';
    333336
    334337                                if ($mode == 'reports')
     
    347350                                                AND r.post_id = p.post_id
    348351                                                " . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
    349                                                 ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = p.poster_id' : '') . '
     352                                                ' . (($sort_order_sql[0] == 'r') ? 'AND ru.user_id = r.user_id' : '') . '
    350353                                                ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
    351354                                                AND t.topic_id = p.topic_id
     355                                                AND r.pm_id = 0
    352356                                                $limit_time_sql
    353357                                        ORDER BY $sort_order_sql";
     
    372376                                                        AND u.user_id = p.poster_id
    373377                                                        AND ru.user_id = r.user_id
     378                                                        AND r.pm_id = 0
    374379                                                ORDER BY ' . $sort_order_sql;
    375380                                        $result = $db->sql_query($sql);
     
    426431                                        'TOPIC_ID'                              => $topic_id,
    427432                                        'TOTAL'                                 => $total,
    428                                         'TOTAL_REPORTS'                 => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),                                   
     433                                        'TOTAL_REPORTS'                 => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total),
    429434                                        )
    430435                                );
     
    439444* Closes a report
    440445*/
    441 function close_report($report_id_list, $mode, $action)
     446function close_report($report_id_list, $mode, $action, $pm = false)
    442447{
    443         global $db, $template, $user, $config;
     448        global $db, $template, $user, $config, $auth;
    444449        global $phpEx, $phpbb_root_path;
    445450
    446         $sql = 'SELECT r.post_id
    447                 FROM ' . REPORTS_TABLE . ' r
    448                 WHERE ' . $db->sql_in_set('r.report_id', $report_id_list);
     451        $pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 ';
     452        $id_column = ($pm) ? 'pm_id' : 'post_id';
     453        $module = ($pm) ? 'pm_reports' : 'reports';
     454        $pm_prefix = ($pm) ? 'PM_' : '';
     455
     456        $sql = "SELECT r.$id_column
     457                FROM " . REPORTS_TABLE . ' r
     458                WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . $pm_where;
    449459        $result = $db->sql_query($sql);
    450460
     
    452462        while ($row = $db->sql_fetchrow($result))
    453463        {
    454                 $post_id_list[] = $row['post_id'];
     464                $post_id_list[] = $row[$id_column];
    455465        }
    456466        $post_id_list = array_unique($post_id_list);
    457467
    458         if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report')))
    459         {
    460                 trigger_error('NOT_AUTHORISED');
     468        if ($pm)
     469        {
     470                if (!$auth->acl_getf_global('m_report'))
     471                {
     472                        trigger_error('NOT_AUTHORISED');
     473                }
     474        }
     475        else
     476        {
     477                if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_report')))
     478                {
     479                        trigger_error('NOT_AUTHORISED');
     480                }
    461481        }
    462482
     
    465485                $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=reports');
    466486        }
     487        elseif ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false)
     488        {
     489                $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=pm_reports');
     490        }
    467491        else if ($action == 'close' && !request_var('r', 0))
    468492        {
    469                 $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&amp;mode=reports');
     493                $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&amp;mode=' . $module);
    470494        }
    471495        else
     
    478502
    479503        $s_hidden_fields = build_hidden_fields(array(
    480                 'i'                                     => 'reports',
     504                'i'                                     => $module,
    481505                'mode'                          => $mode,
    482506                'report_id_list'        => $report_id_list,
     
    487511        if (confirm_box(true))
    488512        {
    489                 $post_info = get_post_data($post_id_list, 'm_report');
    490 
    491                 $sql = 'SELECT r.report_id, r.post_id, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type
    492                         FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u
     513                $post_info = ($pm) ? get_pm_data($post_id_list) : get_post_data($post_id_list, 'm_report');
     514
     515                $sql = "SELECT r.report_id, r.$id_column, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type
     516                        FROM " . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u
    493517                        WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . '
    494518                                ' . (($action == 'close') ? 'AND r.report_closed = 0' : '') . '
    495                                 AND r.user_id = u.user_id';
     519                                AND r.user_id = u.user_id' . $pm_where;
    496520                $result = $db->sql_query($sql);
    497521
     
    504528                        if (!$report['report_closed'])
    505529                        {
    506                                 $close_report_posts[] = $report['post_id'];
    507                                 $close_report_topics[] = $post_info[$report['post_id']]['topic_id'];
     530                                $close_report_posts[] = $report[$id_column];
     531
     532                                if (!$pm)
     533                                {
     534                                        $close_report_topics[] = $post_info[$report['post_id']]['topic_id'];
     535                                }
    508536                        }
    509537
     
    520548                        $close_report_topics = array_unique($close_report_topics);
    521549
    522                         if (sizeof($close_report_posts))
     550                        if (!$pm && sizeof($close_report_posts))
    523551                        {
    524552                                // Get a list of topics that still contain reported posts
     
    559587                        if (sizeof($close_report_posts))
    560588                        {
    561                                 $sql = 'UPDATE ' . POSTS_TABLE . '
    562                                         SET post_reported = 0
    563                                         WHERE ' . $db->sql_in_set('post_id', $close_report_posts);
    564                                 $db->sql_query($sql);
    565 
    566                                 if (sizeof($close_report_topics))
    567                                 {
    568                                         $sql = 'UPDATE ' . TOPICS_TABLE . '
    569                                                 SET topic_reported = 0
    570                                                 WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . '
    571                                                         OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics);
     589                                if ($pm)
     590                                {
     591                                        $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
     592                                                SET message_reported = 0
     593                                                WHERE ' . $db->sql_in_set('msg_id', $close_report_posts);
    572594                                        $db->sql_query($sql);
     595
     596                                        if ($action == 'delete')
     597                                        {
     598                                                delete_pm(ANONYMOUS, $close_report_posts, PRIVMSGS_INBOX);
     599                                        }
     600                                }
     601                                else
     602                                {
     603                                        $sql = 'UPDATE ' . POSTS_TABLE . '
     604                                                SET post_reported = 0
     605                                                WHERE ' . $db->sql_in_set('post_id', $close_report_posts);
     606                                        $db->sql_query($sql);
     607
     608                                        if (sizeof($close_report_topics))
     609                                        {
     610                                                $sql = 'UPDATE ' . TOPICS_TABLE . '
     611                                                        SET topic_reported = 0
     612                                                        WHERE ' . $db->sql_in_set('topic_id', $close_report_topics) . '
     613                                                                OR ' . $db->sql_in_set('topic_moved_id', $close_report_topics);
     614                                                $db->sql_query($sql);
     615                                        }
    573616                                }
    574617                        }
     
    580623                foreach ($reports as $report)
    581624                {
    582                         add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' .  strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']);
     625                        if ($pm)
     626                        {
     627                                add_log('mod', 0, 0, 'LOG_PM_REPORT_' .  strtoupper($action) . 'D', $post_info[$report['pm_id']]['message_subject']);
     628                        }
     629                        else
     630                        {
     631                                add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' .  strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']);
     632                        }
    583633                }
    584634
     
    595645                                }
    596646
    597                                 $post_id = $reporter['post_id'];
    598 
    599                                 $messenger->template('report_' . $action . 'd', $reporter['user_lang']);
     647                                $post_id = $reporter[$id_column];
     648
     649                                $messenger->template((($pm) ? 'pm_report_' : 'report_') . $action . 'd', $reporter['user_lang']);
    600650
    601651                                $messenger->to($reporter['user_email'], $reporter['username']);
    602652                                $messenger->im($reporter['user_jabber'], $reporter['username']);
    603653
    604                                 $messenger->assign_vars(array(
    605                                         'USERNAME'              => htmlspecialchars_decode($reporter['username']),
    606                                         'CLOSER_NAME'   => htmlspecialchars_decode($user->data['username']),
    607                                         'POST_SUBJECT'  => htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])),
    608                                         'TOPIC_TITLE'   => htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title'])))
    609                                 );
     654                                if ($pm)
     655                                {
     656                                        $messenger->assign_vars(array(
     657                                                'USERNAME'              => htmlspecialchars_decode($reporter['username']),
     658                                                'CLOSER_NAME'   => htmlspecialchars_decode($user->data['username']),
     659                                                'PM_SUBJECT'    => htmlspecialchars_decode(censor_text($post_info[$post_id]['message_subject'])),
     660                                        ));
     661                                }
     662                                else
     663                                {
     664                                        $messenger->assign_vars(array(
     665                                                'USERNAME'              => htmlspecialchars_decode($reporter['username']),
     666                                                'CLOSER_NAME'   => htmlspecialchars_decode($user->data['username']),
     667                                                'POST_SUBJECT'  => htmlspecialchars_decode(censor_text($post_info[$post_id]['post_subject'])),
     668                                                'TOPIC_TITLE'   => htmlspecialchars_decode(censor_text($post_info[$post_id]['topic_title'])))
     669                                        );
     670                                }
    610671
    611672                                $messenger->send($reporter['user_notify_type']);
    612673                        }
    613674                }
    614                
    615                 foreach ($post_info as $post)
    616                 {
    617                         $forum_ids[$post['forum_id']] = $post['forum_id'];
    618                         $topic_ids[$post['topic_id']] = $post['topic_id'];
    619                 }
    620                
     675
     676                if (!$pm)
     677                {
     678                        foreach ($post_info as $post)
     679                        {
     680                                $forum_ids[$post['forum_id']] = $post['forum_id'];
     681                                $topic_ids[$post['topic_id']] = $post['topic_id'];
     682                        }
     683                }
     684
    621685                unset($notify_reporters, $post_info, $reports);
    622686
    623687                $messenger->save_queue();
    624688
    625                 $success_msg = (sizeof($report_id_list) == 1) ? 'REPORT_' . strtoupper($action) . 'D_SUCCESS' : 'REPORTS_' . strtoupper($action) . 'D_SUCCESS';
     689                $success_msg = (sizeof($report_id_list) == 1) ? "{$pm_prefix}REPORT_" . strtoupper($action) . 'D_SUCCESS' : "{$pm_prefix}REPORTS_" . strtoupper($action) . 'D_SUCCESS';
    626690        }
    627691        else
    628692        {
    629                 confirm_box(false, $user->lang[strtoupper($action) . '_REPORT' . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);
     693                confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);
    630694        }
    631695
     
    640704        {
    641705                meta_refresh(3, $redirect);
     706
    642707                $return_forum = '';
    643                 if (sizeof($forum_ids == 1))
    644                 {
    645                         $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
    646                 }
    647708                $return_topic = '';
    648                 if (sizeof($topic_ids == 1))
    649                 {
    650                         $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&amp;f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
    651                 }
    652                
     709
     710                if (!$pm)
     711                {
     712                        if (sizeof($forum_ids) === 1)
     713                        {
     714                                $return_forum = sprintf($user->lang['RETURN_FORUM'], '<a href="' . append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
     715                        }
     716
     717                        if (sizeof($topic_ids) === 1)
     718                        {
     719                                $return_topic = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . current($topic_ids) . '&amp;f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />';
     720                        }
     721                }
     722
    653723                trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>'));
    654724        }
  • trunk/forum/includes/mcp/mcp_topic.php

    r400 r702  
    33*
    44* @package mcp
    5 * @version $Id: mcp_topic.php 9030 2008-10-19 18:32:11Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    107107        if ($total == -1)
    108108        {
    109                 $total = $topic_info['topic_replies'] + 1;
     109                if ($auth->acl_get('m_approve', $topic_info['forum_id']))
     110                {
     111                        $total = $topic_info['topic_replies_real'] + 1;
     112                }
     113                else
     114                {
     115                        $total = $topic_info['topic_replies'] + 1;
     116                }
    110117        }
    111118
     
    260267        $s_topic_icons = false;
    261268
    262         if ($auth->acl_get('m_split', $topic_info['forum_id']))
     269        if ($auth->acl_gets('m_split', 'm_merge', (int) $topic_info['forum_id']))
    263270        {
    264271                include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
     
    302309                'ACTION'                        => $action,
    303310
    304                 'REPORTED_IMG'          => $user->img('icon_topic_reported', 'POST_REPORTED', false, true),
    305                 'UNAPPROVED_IMG'        => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED', false, true),
     311                'REPORTED_IMG'          => $user->img('icon_topic_reported', 'POST_REPORTED'),
     312                'UNAPPROVED_IMG'        => $user->img('icon_topic_unapproved', 'POST_UNAPPROVED'),
     313                'INFO_IMG'                      => $user->img('icon_post_info', 'VIEW_INFO'),
    306314
    307315                'S_MCP_ACTION'          => "$url&amp;i=$id&amp;mode=$mode&amp;action=$action&amp;start=$start",
     
    502510
    503511                // Update forum statistics
    504                 set_config('num_topics', $config['num_topics'] + 1, true);
     512                set_config_count('num_topics', 1, true);
    505513
    506514                // Link back to both topics
  • trunk/forum/includes/mcp/mcp_warn.php

    r400 r702  
    33*
    44* @package mcp
    5 * @version $Id: mcp_warn.php 9002 2008-10-11 17:01:43Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    205205                $sql = 'SELECT u.*, p.*
    206206                        FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
    207                         WHERE post_id = $post_id
     207                        WHERE p.post_id = $post_id
    208208                                AND u.user_id = p.poster_id";
    209209                $result = $db->sql_query($sql);
     
    421421                        'U_POST_ACTION'         => $this->u_action,
    422422
    423                         'USERNAME'                      => $user_row['username'],
    424                         'USER_COLOR'            => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',
    425423                        'RANK_TITLE'            => $rank_title,
    426424                        'JOINED'                        => $user->format_date($user_row['user_regdate']),
    427425                        'POSTS'                         => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
    428426                        'WARNINGS'                      => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
     427
     428                        'USERNAME_FULL'         => get_username_string('full', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
     429                        'USERNAME_COLOUR'       => get_username_string('colour', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
     430                        'USERNAME'                      => get_username_string('username', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
     431                        'U_PROFILE'                     => get_username_string('profile', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
    429432
    430433                        'AVATAR_IMG'            => $avatar_img,
  • trunk/forum/includes/message_parser.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: message_parser.php 9034 2008-10-24 00:49:30Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    119119                        'img'                   => array('bbcode_id' => 4,      'regexp' => array('#\[img\](.*)\[/img\]#iUe' => "\$this->bbcode_img('\$1')")),
    120120                        'size'                  => array('bbcode_id' => 5,      'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")),
    121                         'color'                 => array('bbcode_id' => 6,      'regexp' => array('!\[color=(#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")),
     121                        'color'                 => array('bbcode_id' => 6,      'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")),
    122122                        'u'                             => array('bbcode_id' => 7,      'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")),
    123123                        'list'                  => array('bbcode_id' => 9,      'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#ise' => "\$this->bbcode_parse_list('\$0')")),
     
    696696                * [quote="[quote]test[/quote]"]test[/quote] (correct: parsed - Username displayed as [quote]test[/quote])
    697697                * #20735 - [quote]test[/[/b]quote] test [/quote][/quote] test - (correct: quoted: "test[/[/b]quote] test" / non-quoted: "[/quote] test" - also failed if layout distorted)
     698                * #40565 - [quote="a"]a[/quote][quote="a]a[/quote] (correct: first quote tag parsed, second quote tag unparsed)
    698699                */
    699700
     
    706707
    707708                // To let the parser not catch tokens within quote_username quotes we encode them before we start this...
    708                 $in = preg_replace('#quote=&quot;(.*?)&quot;\]#ie', "'quote=&quot;' . str_replace(array('[', ']'), array('&#91;', '&#93;'), '\$1') . '&quot;]'", $in);
     709                $in = preg_replace('#quote=&quot;(.*?)&quot;\]#ie', "'quote=&quot;' . str_replace(array('[', ']', '\\\"'), array('&#91;', '&#93;', '\"'), '\$1') . '&quot;]'", $in);
    709710
    710711                $tok = ']';
     
    859860                while ($in);
    860861
     862                $out .= $buffer;
     863
    861864                if (sizeof($close_tags))
    862865                {
     
    10501053                // Init BBCode UID
    10511054                $this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN);
    1052 
    1053                 if ($message)
    1054                 {
    1055                         $this->message = $message;
    1056                 }
     1055                $this->message = $message;
    10571056        }
    10581057
     
    10641063                global $config, $db, $user;
    10651064
    1066                 $mode = ($mode != 'post') ? 'sig' : 'post';
    1067 
    10681065                $this->mode = $mode;
     1066
     1067                foreach (array('chars', 'smilies', 'urls', 'font_size', 'img_height', 'img_width') as $key)
     1068                {
     1069                        if (!isset($config['max_' . $mode . '_' . $key]))
     1070                        {
     1071                                $config['max_' . $mode . '_' . $key] = 0;
     1072                        }
     1073                }
    10691074
    10701075                $this->allow_img_bbcode = $allow_img_bbcode;
     
    10911096                $this->message = preg_replace($match, $replace, trim($this->message));
    10921097
    1093                 // Message length check. 0 disables this check completely.
    1094                 if ($config['max_' . $mode . '_chars'] > 0)
    1095                 {
    1096                         $msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
    1097 
    1098                         if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars'])
    1099                         {
    1100                                 $this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $msg_len, $config['max_' . $mode . '_chars']);
     1098                // Store message length...
     1099                $message_length = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
     1100
     1101                // Maximum message length check. 0 disables this check completely.
     1102                if ((int) $config['max_' . $mode . '_chars'] > 0 && $message_length > (int) $config['max_' . $mode . '_chars'])
     1103                {
     1104                        $this->warn_msg[] = sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $message_length, (int) $config['max_' . $mode . '_chars']);
     1105                        return (!$update_this_message) ? $return_message : $this->warn_msg;
     1106                }
     1107
     1108                // Minimum message length check for post only
     1109                if ($mode === 'post')
     1110                {
     1111                        if (!$message_length || $message_length < (int) $config['min_post_chars'])
     1112                        {
     1113                                $this->warn_msg[] = (!$message_length) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_FEW_CHARS_LIMIT'], $message_length, (int) $config['min_post_chars']);
    11011114                                return (!$update_this_message) ? $return_message : $this->warn_msg;
    11021115                        }
    1103                 }
    1104 
    1105                 // Check for "empty" message
    1106                 if ($mode !== 'sig' && utf8_clean_string($this->message) === '')
    1107                 {
    1108                         $this->warn_msg[] = $user->lang['TOO_FEW_CHARS'];
    1109                         return (!$update_this_message) ? $return_message : $this->warn_msg;
    11101116                }
    11111117
     
    11501156                                $num_urls += preg_match_all('#\<!-- ([lmwe]) --\>.*?\<!-- \1 --\>#', $this->message, $matches);
    11511157                        }
     1158                }
     1159
     1160                // Check for "empty" message. We do not check here for maximum length, because bbcode, smilies, etc. can add to the length.
     1161                // The maximum length check happened before any parsings.
     1162                if ($mode === 'post' && utf8_clean_string($this->message) === '')
     1163                {
     1164                        $this->warn_msg[] = $user->lang['TOO_FEW_CHARS'];
     1165                        return (!$update_this_message) ? $return_message : $this->warn_msg;
    11521166                }
    11531167
     
    12991313
    13001314                                // (assertion)
    1301                                 $match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)';
     1315                                $match[] = preg_quote($row['code'], '#');
    13021316                                $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->';
    13031317                        }
     
    13091323                        if ($max_smilies)
    13101324                        {
    1311                                 $num_matches = preg_match_all('#' . implode('|', $match) . '#', $this->message, $matches);
     1325                                $num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#', $this->message, $matches);
    13121326                                unset($matches);
    13131327
     
    13201334
    13211335                        // Make sure the delimiter # is added in front and at the end of every element within $match
    1322                         $this->message = trim(preg_replace(explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#'), $replace, $this->message));
     1336                        $this->message = trim(preg_replace(explode(chr(0), '#(?<=^|[\n .])' . implode('(?![^<>]*>)#' . chr(0) . '#(?<=^|[\n .])', $match) . '(?![^<>]*>)#'), $replace, $this->message));
    13231337                }
    13241338        }
     
    16131627                $bbcode_bitfield = $this->bbcode_bitfield;
    16141628
    1615                 $poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false);
     1629                $poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll');
    16161630
    16171631                $bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield));
     
    16361650                                $this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG'];
    16371651                        }
    1638                         $poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false);
     1652                        $poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll');
    16391653                        if (strlen($poll['poll_title']) > 255)
    16401654                        {
  • trunk/forum/includes/search/fulltext_mysql.php

    r400 r702  
    33*
    44* @package search
    5 * @version $Id: fulltext_mysql.php 8814 2008-09-04 12:01:47Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    119119        function split_keywords(&$keywords, $terms)
    120120        {
    121                 global $config;
     121                global $config, $user;
    122122
    123123                if ($terms == 'all')
     
    166166                        preg_match_all('#(?:[^\w*"()]|^)([+\-|]?(?:[\w*"()]+\'?)*[\w*"()])(?:[^\w*"()]|$)#u', $split_keywords, $matches);
    167167                        $this->split_words = $matches[1];
     168                }
     169
     170                // We limit the number of allowed keywords to minimize load on the database
     171                if ($config['max_num_search_keywords'] && sizeof($this->split_words) > $config['max_num_search_keywords'])
     172                {
     173                        trigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], sizeof($this->split_words)));
    168174                }
    169175
     
    319325        *
    320326        * @param        string          $type                           contains either posts or topics depending on what should be searched for
    321         * @param        string          &$fields                        contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
    322         * @param        string          &$terms                         is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
    323         * @param        array           &$sort_by_sql           contains SQL code for the ORDER BY part of a query
    324         * @param        string          &$sort_key                      is the key of $sort_by_sql for the selected sorting
    325         * @param        string          &$sort_dir                      is either a or d representing ASC and DESC
    326         * @param        string          &$sort_days                     specifies the maximum amount of days a post may be old
    327         * @param        array           &$ex_fid_ary            specifies an array of forum ids which should not be searched
    328         * @param        array           &$m_approve_fid_ary     specifies an array of forum ids in which the searcher is allowed to view unapproved posts
    329         * @param        int                     &$topic_id                      is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
    330         * @param        array           &$author_ary            an array of author ids if the author should be ignored during the search the array is empty
     327        * @param        string          $fields                         contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
     328        * @param        string          $terms                          is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
     329        * @param        array           $sort_by_sql            contains SQL code for the ORDER BY part of a query
     330        * @param        string          $sort_key                       is the key of $sort_by_sql for the selected sorting
     331        * @param        string          $sort_dir                       is either a or d representing ASC and DESC
     332        * @param        string          $sort_days                      specifies the maximum amount of days a post may be old
     333        * @param        array           $ex_fid_ary                     specifies an array of forum ids which should not be searched
     334        * @param        array           $m_approve_fid_ary      specifies an array of forum ids in which the searcher is allowed to view unapproved posts
     335        * @param        int                     $topic_id                       is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
     336        * @param        array           $author_ary                     an array of author ids if the author should be ignored during the search the array is empty
     337        * @param        string          $author_name            specifies the author match, when ANONYMOUS is also a search-match
    331338        * @param        array           &$id_ary                        passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
    332339        * @param        int                     $start                          indicates the first index of the page
     
    336343        * @access       public
    337344        */
    338         function keyword_search($type, &$fields, &$terms, &$sort_by_sql, &$sort_key, &$sort_dir, &$sort_days, &$ex_fid_ary, &$m_approve_fid_ary, &$topic_id, &$author_ary, &$id_ary, $start, $per_page)
     345        function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
    339346        {
    340347                global $config, $db;
     
    435442                $sql_from                       = ($join_topic) ? TOPICS_TABLE . ' t, ' : '';
    436443                $field                          = ($type == 'posts') ? 'post_id' : 'topic_id';
    437                 $sql_author                     = (sizeof($author_ary) == 1) ? ' = ' . $author_ary[0] : 'IN (' . implode(', ', $author_ary) . ')';
     444                if (sizeof($author_ary) && $author_name)
     445                {
     446                        // first one matches post of registered users, second one guests and deleted users
     447                        $sql_author = ' AND (' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
     448                }
     449                else if (sizeof($author_ary))
     450                {
     451                        $sql_author = ' AND ' . $db->sql_in_set('p.poster_id', $author_ary);
     452                }
     453                else
     454                {
     455                        $sql_author = '';
     456                }
    438457
    439458                $sql_where_options = $sql_sort_join;
     
    442461                $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
    443462                $sql_where_options .= $m_approve_fid_sql;
    444                 $sql_where_options .= (sizeof($author_ary)) ? ' AND p.poster_id ' . $sql_author : '';
     463                $sql_where_options .= $sql_author;
    445464                $sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
    446465                $sql_where_options .= $sql_match_where;
     
    455474                while ($row = $db->sql_fetchrow($result))
    456475                {
    457                         $id_ary[] = $row[$field];
     476                        $id_ary[] = (int) $row[$field];
    458477                }
    459478                $db->sql_freeresult($result);
     
    490509        * Performs a search on an author's posts without caring about message contents. Depends on display specific params
    491510        *
    492         * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
    493         * @param int $start indicates the first index of the page
    494         * @param int $per_page number of ids each page is supposed to contain
    495         * @return total number of results
    496         */
    497         function author_search($type, $firstpost_only, &$sort_by_sql, &$sort_key, &$sort_dir, &$sort_days, &$ex_fid_ary, &$m_approve_fid_ary, &$topic_id, &$author_ary, &$id_ary, $start, $per_page)
     511        * @param        string          $type                           contains either posts or topics depending on what should be searched for
     512        * @param        boolean         $firstpost_only         if true, only topic starting posts will be considered
     513        * @param        array           $sort_by_sql            contains SQL code for the ORDER BY part of a query
     514        * @param        string          $sort_key                       is the key of $sort_by_sql for the selected sorting
     515        * @param        string          $sort_dir                       is either a or d representing ASC and DESC
     516        * @param        string          $sort_days                      specifies the maximum amount of days a post may be old
     517        * @param        array           $ex_fid_ary                     specifies an array of forum ids which should not be searched
     518        * @param        array           $m_approve_fid_ary      specifies an array of forum ids in which the searcher is allowed to view unapproved posts
     519        * @param        int                     $topic_id                       is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
     520        * @param        array           $author_ary                     an array of author ids
     521        * @param        string          $author_name            specifies the author match, when ANONYMOUS is also a search-match
     522        * @param        array           &$id_ary                        passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
     523        * @param        int                     $start                          indicates the first index of the page
     524        * @param        int                     $per_page                       number of ids each page is supposed to contain
     525        * @return       boolean|int                                             total number of results
     526        *
     527        * @access       public
     528        */
     529        function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
    498530        {
    499531                global $config, $db;
     
    517549                        implode(',', $ex_fid_ary),
    518550                        implode(',', $m_approve_fid_ary),
    519                         implode(',', $author_ary)
     551                        implode(',', $author_ary),
     552                        $author_name,
    520553                )));
    521554
     
    530563
    531564                // Create some display specific sql strings
    532                 $sql_author             = $db->sql_in_set('p.poster_id', $author_ary);
     565                if ($author_name)
     566                {
     567                        // first one matches post of registered users, second one guests and deleted users
     568                        $sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
     569                }
     570                else
     571                {
     572                        $sql_author = $db->sql_in_set('p.poster_id', $author_ary);
     573                }
    533574                $sql_fora               = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
    534575                $sql_topic_id   = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : '';
     
    610651                while ($row = $db->sql_fetchrow($result))
    611652                {
    612                         $id_ary[] = $row[$field];
     653                        $id_ary[] = (int) $row[$field];
    613654                }
    614655                $db->sql_freeresult($result);
  • trunk/forum/includes/search/fulltext_native.php

    r400 r702  
    33*
    44* @package search
    5 * @version $Id: fulltext_native.php 9173 2008-12-04 17:01:39Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    8282        function split_keywords($keywords, $terms)
    8383        {
    84                 global $db, $user;
     84                global $db, $user, $config;
    8585
    8686                $keywords = trim($this->cleanup($keywords, '+-|()*'));
     
    168168
    169169                $keywords = preg_replace($match, $replace, $keywords);
     170                $num_keywords = sizeof(explode(' ', $keywords));
     171
     172                // We limit the number of allowed keywords to minimize load on the database
     173                if ($config['max_num_search_keywords'] && $num_keywords > $config['max_num_search_keywords'])
     174                {
     175                        trigger_error($user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', $config['max_num_search_keywords'], $num_keywords));
     176                }
    170177
    171178                // $keywords input format: each word separated by a space, words in a bracket are not separated
     
    196203                        $sql = 'SELECT word_id, word_text, word_common
    197204                                FROM ' . SEARCH_WORDLIST_TABLE . '
    198                                 WHERE ' . $db->sql_in_set('word_text', $exact_words);
     205                                WHERE ' . $db->sql_in_set('word_text', $exact_words) . '
     206                                ORDER BY word_count ASC';
    199207                        $result = $db->sql_query($sql);
    200208
     
    371379                }
    372380
    373                 sort($this->must_contain_ids);
    374                 sort($this->must_not_contain_ids);
    375                 sort($this->must_exclude_one_ids);
    376 
    377381                if (!empty($this->search_query))
    378382                {
     
    386390        *
    387391        * @param        string          $type                           contains either posts or topics depending on what should be searched for
    388         * @param        string          &$fields                        contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
    389         * @param        string          &$terms                         is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
    390         * @param        array           &$sort_by_sql           contains SQL code for the ORDER BY part of a query
    391         * @param        string          &$sort_key                      is the key of $sort_by_sql for the selected sorting
    392         * @param        string          &$sort_dir                      is either a or d representing ASC and DESC
    393         * @param        string          &$sort_days                     specifies the maximum amount of days a post may be old
    394         * @param        array           &$ex_fid_ary            specifies an array of forum ids which should not be searched
    395         * @param        array           &$m_approve_fid_ary     specifies an array of forum ids in which the searcher is allowed to view unapproved posts
    396         * @param        int                     &$topic_id                      is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
    397         * @param        array           &$author_ary            an array of author ids if the author should be ignored during the search the array is empty
     392        * @param        string          $fields                         contains either titleonly (topic titles should be searched), msgonly (only message bodies should be searched), firstpost (only subject and body of the first post should be searched) or all (all post bodies and subjects should be searched)
     393        * @param        string          $terms                          is either 'all' (use query as entered, words without prefix should default to "have to be in field") or 'any' (ignore search query parts and just return all posts that contain any of the specified words)
     394        * @param        array           $sort_by_sql            contains SQL code for the ORDER BY part of a query
     395        * @param        string          $sort_key                       is the key of $sort_by_sql for the selected sorting
     396        * @param        string          $sort_dir                       is either a or d representing ASC and DESC
     397        * @param        string          $sort_days                      specifies the maximum amount of days a post may be old
     398        * @param        array           $ex_fid_ary                     specifies an array of forum ids which should not be searched
     399        * @param        array           $m_approve_fid_ary      specifies an array of forum ids in which the searcher is allowed to view unapproved posts
     400        * @param        int                     $topic_id                       is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
     401        * @param        array           $author_ary                     an array of author ids if the author should be ignored during the search the array is empty
     402        * @param        string          $author_name            specifies the author match, when ANONYMOUS is also a search-match
    398403        * @param        array           &$id_ary                        passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
    399404        * @param        int                     $start                          indicates the first index of the page
     
    403408        * @access       public
    404409        */
    405         function keyword_search($type, &$fields, &$terms, &$sort_by_sql, &$sort_key, &$sort_dir, &$sort_days, &$ex_fid_ary, &$m_approve_fid_ary, &$topic_id, &$author_ary, &$id_ary, $start, $per_page)
     410        function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
    406411        {
    407412                global $config, $db;
     
    413418                }
    414419
     420                $must_contain_ids = $this->must_contain_ids;
     421                $must_not_contain_ids = $this->must_not_contain_ids;
     422                $must_exclude_one_ids = $this->must_exclude_one_ids;
     423
     424                sort($must_contain_ids);
     425                sort($must_not_contain_ids);
     426                sort($must_exclude_one_ids);
     427
    415428                // generate a search_key from all the options to identify the results
    416429                $search_key = md5(implode('#', array(
    417                         serialize($this->must_contain_ids),
    418                         serialize($this->must_not_contain_ids),
    419                         serialize($this->must_exclude_one_ids),
     430                        serialize($must_contain_ids),
     431                        serialize($must_not_contain_ids),
     432                        serialize($must_exclude_one_ids),
    420433                        $type,
    421434                        $fields,
     
    426439                        implode(',', $ex_fid_ary),
    427440                        implode(',', $m_approve_fid_ary),
    428                         implode(',', $author_ary)
     441                        implode(',', $author_ary),
     442                        $author_name,
    429443                )));
    430444
     
    617631                if (sizeof($author_ary))
    618632                {
    619                         $sql_where[] = $db->sql_in_set('p.poster_id', $author_ary);
     633                        if ($author_name)
     634                        {
     635                                // first one matches post of registered users, second one guests and deleted users
     636                                $sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
     637                        }
     638                        else
     639                        {
     640                                $sql_author = $db->sql_in_set('p.poster_id', $author_ary);
     641                        }
     642                        $sql_where[] = $sql_author;
    620643                }
    621644
     
    639662                        $sql_array_count = $sql_array;
    640663
     664                        if ($left_join_topics)
     665                        {
     666                                $sql_array_count['LEFT_JOIN'][] = array(
     667                                        'FROM'  => array(TOPICS_TABLE => 't'),
     668                                        'ON'    => 'p.topic_id = t.topic_id'
     669                                );
     670                        }
     671
    641672                        switch ($db->sql_layer)
    642673                        {
     
    645676
    646677                                        // 3.x does not support SQL_CALC_FOUND_ROWS
    647                                         $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
     678                                        // $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
    648679                                        $is_mysql = true;
    649680
     
    694725                        break;
    695726                }
    696                
     727
    697728                if ($left_join_topics)
    698729                {
    699                         $sql_array['LEFT_JOIN'][$left_join_topics] = array(
     730                        $sql_array['LEFT_JOIN'][] = array(
    700731                                'FROM'  => array(TOPICS_TABLE => 't'),
    701732                                'ON'    => 'p.topic_id = t.topic_id'
     
    714745                while ($row = $db->sql_fetchrow($result))
    715746                {
    716                         $id_ary[] = $row[(($type == 'posts') ? 'post_id' : 'topic_id')];
     747                        $id_ary[] = (int) $row[(($type == 'posts') ? 'post_id' : 'topic_id')];
    717748                }
    718749                $db->sql_freeresult($result);
     
    726757                if (!$total_results && $is_mysql)
    727758                {
     759                        // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
     760                        $sql_array_copy = $sql_array;
     761                        $sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id ';
     762
     763                        $sql = $db->sql_build_query('SELECT', $sql_array_copy);
     764                        unset($sql_array_copy);
     765
     766                        $db->sql_query($sql);
     767                        $db->sql_freeresult($result);
     768
    728769                        $sql = 'SELECT FOUND_ROWS() as total_results';
    729770                        $result = $db->sql_query($sql);
     
    749790        * @param        string          $type                           contains either posts or topics depending on what should be searched for
    750791        * @param        boolean         $firstpost_only         if true, only topic starting posts will be considered
    751         * @param        array           &$sort_by_sql           contains SQL code for the ORDER BY part of a query
    752         * @param        string          &$sort_key                      is the key of $sort_by_sql for the selected sorting
    753         * @param        string          &$sort_dir                      is either a or d representing ASC and DESC
    754         * @param        string          &$sort_days                     specifies the maximum amount of days a post may be old
    755         * @param        array           &$ex_fid_ary            specifies an array of forum ids which should not be searched
    756         * @param        array           &$m_approve_fid_ary     specifies an array of forum ids in which the searcher is allowed to view unapproved posts
    757         * @param        int                     &$topic_id                      is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
    758         * @param        array           &$author_ary            an array of author ids
     792        * @param        array           $sort_by_sql            contains SQL code for the ORDER BY part of a query
     793        * @param        string          $sort_key                       is the key of $sort_by_sql for the selected sorting
     794        * @param        string          $sort_dir                       is either a or d representing ASC and DESC
     795        * @param        string          $sort_days                      specifies the maximum amount of days a post may be old
     796        * @param        array           $ex_fid_ary                     specifies an array of forum ids which should not be searched
     797        * @param        array           $m_approve_fid_ary      specifies an array of forum ids in which the searcher is allowed to view unapproved posts
     798        * @param        int                     $topic_id                       is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
     799        * @param        array           $author_ary                     an array of author ids
     800        * @param        string          $author_name            specifies the author match, when ANONYMOUS is also a search-match
    759801        * @param        array           &$id_ary                        passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered
    760802        * @param        int                     $start                          indicates the first index of the page
     
    764806        * @access       public
    765807        */
    766         function author_search($type, $firstpost_only, &$sort_by_sql, &$sort_key, &$sort_dir, &$sort_days, &$ex_fid_ary, &$m_approve_fid_ary, &$topic_id, &$author_ary, &$id_ary, $start, $per_page)
     808        function author_search($type, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_ary, $author_name, &$id_ary, $start, $per_page)
    767809        {
    768810                global $config, $db;
     
    786828                        implode(',', $ex_fid_ary),
    787829                        implode(',', $m_approve_fid_ary),
    788                         implode(',', $author_ary)
     830                        implode(',', $author_ary),
     831                        $author_name,
    789832                )));
    790833
     
    799842
    800843                // Create some display specific sql strings
    801                 $sql_author             = $db->sql_in_set('p.poster_id', $author_ary);
     844                if ($author_name)
     845                {
     846                        // first one matches post of registered users, second one guests and deleted users
     847                        $sql_author = '(' . $db->sql_in_set('p.poster_id', array_diff($author_ary, array(ANONYMOUS)), false, true) . ' OR p.post_username ' . $author_name . ')';
     848                }
     849                else
     850                {
     851                        $sql_author = $db->sql_in_set('p.poster_id', $author_ary);
     852                }
    802853                $sql_fora               = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '';
    803854                $sql_time               = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
     
    849900                                case 'mysql4':
    850901                                case 'mysqli':
    851                                         $select = 'SQL_CALC_FOUND_ROWS ' . $select;
     902//                                      $select = 'SQL_CALC_FOUND_ROWS ' . $select;
    852903                                        $is_mysql = true;
    853904                                break;
     
    936987                while ($row = $db->sql_fetchrow($result))
    937988                {
    938                         $id_ary[] = $row[$field];
     989                        $id_ary[] = (int) $row[$field];
    939990                }
    940991                $db->sql_freeresult($result);
     
    942993                if (!$total_results && $is_mysql)
    943994                {
     995                        // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it.
     996                        $sql = str_replace('SELECT ' . $select, 'SELECT DISTINCT SQL_CALC_FOUND_ROWS p.post_id', $sql);
     997
     998                        $db->sql_query($sql);
     999                        $db->sql_freeresult($result);
     1000
    9441001                        $sql = 'SELECT FOUND_ROWS() as total_results';
    9451002                        $result = $db->sql_query($sql);
     
    11111168                // Get unique words from the above arrays
    11121169                $unique_add_words = array_unique(array_merge($words['add']['post'], $words['add']['title']));
    1113                
     1170
    11141171                // We now have unique arrays of all words to be added and removed and
    11151172                // individual arrays of added and removed words for text and title. What
  • trunk/forum/includes/session.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: session.php 9170 2008-12-04 12:56:12Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    214214                $this->browser                          = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : '';
    215215                $this->referer                          = (!empty($_SERVER['HTTP_REFERER'])) ? htmlspecialchars((string) $_SERVER['HTTP_REFERER']) : '';
    216                 $this->forwarded_for            = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? (string) $_SERVER['HTTP_X_FORWARDED_FOR'] : '';
     216                $this->forwarded_for            = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? htmlspecialchars((string) $_SERVER['HTTP_X_FORWARDED_FOR']) : '';
    217217
    218218                $this->host                                     = $this->extract_current_hostname();
     
    222222                if ($config['forwarded_for_check'])
    223223                {
    224                         $this->forwarded_for = preg_replace('#, +#', ', ', $this->forwarded_for);
     224                        $this->forwarded_for = preg_replace('#[ ]{2,}#', ' ', str_replace(array(',', ' '), ' ', $this->forwarded_for));
    225225
    226226                        // split the list of IPs
    227                         $ips = explode(', ', $this->forwarded_for);
     227                        $ips = explode(' ', $this->forwarded_for);
    228228                        foreach ($ips as $ip)
    229229                        {
     
    268268                // Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests
    269269                // it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip.
    270                 $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : '';
     270                $this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars((string) $_SERVER['REMOTE_ADDR']) : '';
     271                $this->ip = preg_replace('#[ ]{2,}#', ' ', str_replace(array(',', ' '), ' ', $this->ip));
     272
     273                // split the list of IPs
     274                $ips = explode(' ', $this->ip);
     275
     276                // Default IP if REMOTE_ADDR is invalid
     277                $this->ip = '127.0.0.1';
     278
     279                foreach ($ips as $ip)
     280                {
     281                        // check IPv4 first, the IPv6 is hopefully only going to be used very seldomly
     282                        if (!empty($ip) && !preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip))
     283                        {
     284                                // Just break
     285                                break;
     286                        }
     287
     288                        // Use the last in chain
     289                        $this->ip = $ip;
     290                }
     291
    271292                $this->load = false;
    272293
     
    397418                                                                $db->sql_query($sql);
    398419                                                        }
     420
     421                                                        if ($this->data['user_id'] != ANONYMOUS && !empty($config['new_member_post_limit']) && $this->data['user_new'] && $config['new_member_post_limit'] <= $this->data['user_posts'])
     422                                                        {
     423                                                                $this->leave_newly_registered();
     424                                                        }
    399425                                                }
    400426
     
    481507                                foreach (explode(',', $row['bot_ip']) as $bot_ip)
    482508                                {
     509                                        $bot_ip = trim($bot_ip);
     510
     511                                        if (!$bot_ip)
     512                                        {
     513                                                continue;
     514                                        }
     515
    483516                                        if (strpos($this->ip, $bot_ip) === 0)
    484517                                        {
     
    595628                        else
    596629                        {
    597                                 $ips = explode(', ', $this->forwarded_for);
     630                                $ips = explode(' ', $this->forwarded_for);
    598631                                $ips[] = $this->ip;
    599632                                $this->check_ban($this->data['user_id'], $ips);
     
    720753//              $db->sql_return_on_error(false);
    721754
     755                // Something quite important: session_page always holds the *last* page visited, except for the *first* visit.
     756                // We are not able to simply have an empty session_page btw, therefore we need to tell phpBB how to detect this special case.
     757                // If the session id is empty, we have a completely new one and will set an "identifier" here. This identifier is able to be checked later.
     758                if (empty($this->data['session_id']))
     759                {
     760                        // This is a temporary variable, only set for the very first visit
     761                        $this->data['session_created'] = true;
     762                }
     763
    722764                $this->session_id = $this->data['session_id'] = md5(unique_id());
    723765
     
    876918        function session_gc()
    877919        {
    878                 global $db, $config;
     920                global $db, $config, $phpbb_root_path, $phpEx;
    879921
    880922                $batch_size = 10;
     
    934976                                $db->sql_query($sql);
    935977                        }
    936                         $this->confirm_gc();
     978
     979                        // only called from CRON; should be a safe workaround until the infrastructure gets going
     980                        if (!class_exists('captcha_factory'))
     981                        {
     982                                include($phpbb_root_path . "includes/captcha/captcha_factory." . $phpEx);
     983                        }
     984                        phpbb_captcha_factory::garbage_collect($config['captcha_plugin']);
    937985                }
    938986
    939987                return;
    940988        }
    941 
    942         function confirm_gc($type = 0)
    943         {
    944                 global $db, $config;
    945 
    946                 $sql = 'SELECT DISTINCT c.session_id
    947                                 FROM ' . CONFIRM_TABLE . ' c
    948                                 LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id)
    949                                 WHERE s.session_id IS NULL' .
    950                                         ((empty($type)) ? '' : ' AND c.confirm_type = ' . (int) $type);
    951                 $result = $db->sql_query($sql);
    952 
    953                 if ($row = $db->sql_fetchrow($result))
    954                 {
    955                         $sql_in = array();
    956                         do
    957                         {
    958                                 $sql_in[] = (string) $row['session_id'];
    959                         }
    960                         while ($row = $db->sql_fetchrow($result));
    961 
    962                         if (sizeof($sql_in))
    963                         {
    964                                 $sql = 'DELETE FROM ' . CONFIRM_TABLE . '
    965                                         WHERE ' . $db->sql_in_set('session_id', $sql_in);
    966                                 $db->sql_query($sql);
    967                         }
    968                 }
    969                 $db->sql_freeresult($result);
    970         }
    971 
    972989
    973990        /**
     
    12051222
    12061223                $dnsbl_check = array(
    1207                         'sbl-xbl.spamhaus.org'  => 'http://www.spamhaus.org/query/bl?ip=',
     1224                        'sbl.spamhaus.org'      => 'http://www.spamhaus.org/query/bl?ip=',
    12081225                );
    12091226
     
    13391356                global $config, $db;
    13401357
    1341                 $user_id = ($user_id === false) ? $this->data['user_id'] : $user_id;
     1358                $user_id = ($user_id === false) ? (int) $this->data['user_id'] : (int) $user_id;
    13421359
    13431360                $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
     
    13451362                $db->sql_query($sql);
    13461363
     1364                // If the user is logged in, update last visit info first before deleting sessions
     1365                $sql = 'SELECT session_time, session_page
     1366                        FROM ' . SESSIONS_TABLE . '
     1367                        WHERE session_user_id = ' . (int) $user_id . '
     1368                        ORDER BY session_time DESC';
     1369                $result = $db->sql_query_limit($sql, 1);
     1370                $row = $db->sql_fetchrow($result);
     1371                $db->sql_freeresult($result);
     1372
     1373                if ($row)
     1374                {
     1375                        $sql = 'UPDATE ' . USERS_TABLE . '
     1376                                SET user_lastvisit = ' . (int) $row['session_time'] . ", user_lastpage = '" . $db->sql_escape($row['session_page']) . "'
     1377                                WHERE user_id = " . (int) $user_id;
     1378                        $db->sql_query($sql);
     1379                }
     1380
    13471381                // Let's also clear any current sessions for the specified user_id
    13481382                // If it's the current user then we'll leave this session intact
    13491383                $sql_where = 'session_user_id = ' . (int) $user_id;
    1350                 $sql_where .= ($user_id === $this->data['user_id']) ? " AND session_id <> '" . $db->sql_escape($this->session_id) . "'" : '';
     1384                $sql_where .= ($user_id === (int) $this->data['user_id']) ? " AND session_id <> '" . $db->sql_escape($this->session_id) . "'" : '';
    13511385
    13521386                $sql = 'DELETE FROM ' . SESSIONS_TABLE . "
     
    13561390                // We're changing the password of the current user and they have a key
    13571391                // Lets regenerate it to be safe
    1358                 if ($user_id === $this->data['user_id'] && $this->cookie_data['k'])
     1392                if ($user_id === (int) $this->data['user_id'] && $this->cookie_data['k'])
    13591393                {
    13601394                        $this->set_login_key($user_id);
     
    13691403        function validate_referer($check_script_path = false)
    13701404        {
     1405                global $config;
     1406
    13711407                // no referer - nothing to validate, user's fault for turning it off (we only check on POST; so meta can't be the reason)
    13721408                if (empty($this->referer) || empty($this->host))
     
    13781414                $ref = substr($this->referer, strpos($this->referer, '://') + 3);
    13791415
    1380                 if (!(stripos($ref, $host) === 0))
     1416                if (!(stripos($ref, $host) === 0) && (!$config['force_server_vars'] || !(stripos($ref, $config['server_name']) === 0)))
    13811417                {
    13821418                        return false;
     
    14361472        var $img_array = array();
    14371473
    1438         // Able to add new option (id 7)
    1439         var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10);
     1474        // Able to add new options (up to id 31)
     1475        var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
    14401476        var $keyvalues = array();
    14411477
     
    15281564                $lang = &$this->lang;
    15291565
    1530                 if ((@include $this->lang_path . $this->lang_name . "/common.$phpEx") === false)
     1566                // Do not suppress error if in DEBUG_EXTRA mode
     1567                $include_result = (defined('DEBUG_EXTRA')) ? (include $this->lang_path . $this->lang_name . "/common.$phpEx") : (@include $this->lang_path . $this->lang_name . "/common.$phpEx");
     1568
     1569                if ($include_result === false)
    15311570                {
    15321571                        die('Language file ' . $this->lang_path . $this->lang_name . "/common.$phpEx" . " couldn't be opened.");
     
    15361575                unset($lang_set);
    15371576
    1538                 if (!empty($_GET['style']) && $auth->acl_get('a_styles'))
     1577                if (!empty($_GET['style']) && $auth->acl_get('a_styles') && !defined('ADMIN_START'))
    15391578                {
    15401579                        global $SID, $_EXTRA_URL;
     
    16581697                $this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang'];
    16591698
    1660                 $sql = 'SELECT image_name, image_filename, image_lang, image_height, image_width
     1699                // Same query in style.php
     1700                $sql = 'SELECT *
    16611701                        FROM ' . STYLES_IMAGESET_DATA_TABLE . '
    16621702                        WHERE imageset_id = ' . $this->theme['imageset_id'] . "
     
    17571797                // Disable board if the install/ directory is still present
    17581798                // For the brave development army we do not care about this, else we need to comment out this everytime we develop locally
    1759                 if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install'))
     1799                if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install') && !is_file($phpbb_root_path . 'install'))
    17601800                {
    17611801                        // Adjust the message slightly according to the permissions
     
    17741814                if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
    17751815                {
    1776                         header('HTTP/1.1 503 Service Unavailable');
     1816                        if ($this->data['is_bot'])
     1817                        {
     1818                                header('HTTP/1.1 503 Service Unavailable');
     1819                        }
    17771820
    17781821                        $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE';
     
    17901833                                if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_'))
    17911834                                {
    1792                                         header('HTTP/1.1 503 Service Unavailable');
     1835                                        if ($this->data['is_bot'])
     1836                                        {
     1837                                                header('HTTP/1.1 503 Service Unavailable');
     1838                                        }
    17931839                                        trigger_error('BOARD_UNAVAILABLE');
    17941840                                }
     
    18281874                // Does the user need to change their password? If so, redirect to the
    18291875                // ucp profile reg_details page ... of course do not redirect if we're already in the ucp
    1830                 if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && $this->data['is_registered'] && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
     1876                if (!defined('IN_ADMIN') && !defined('ADMIN_START') && $config['chg_passforce'] && !empty($this->data['is_registered']) && $auth->acl_get('u_chgpasswd') && $this->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400))
    18311877                {
    18321878                        if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx")
     
    20012047                        }
    20022048
    2003                         if ((@include $language_filename) === false)
     2049                        if (!file_exists($language_filename))
     2050                        {
     2051                                global $config;
     2052
     2053                                if ($this->lang_name == 'en')
     2054                                {
     2055                                        // The user's selected language is missing the file, the board default's language is missing the file, and the file doesn't exist in /en.
     2056                                        $language_filename = str_replace($this->lang_path . 'en', $this->lang_path . $this->data['user_lang'], $language_filename);
     2057                                        trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
     2058                                }
     2059                                else if ($this->lang_name == basename($config['default_lang']))
     2060                                {
     2061                                        // Fall back to the English Language
     2062                                        $this->lang_name = 'en';
     2063                                        $this->set_lang($lang, $help, $lang_file, $use_db, $use_help);
     2064                                }
     2065                                else if ($this->lang_name == $this->data['user_lang'])
     2066                                {
     2067                                        // Fall back to the board default language
     2068                                        $this->lang_name = basename($config['default_lang']);
     2069                                        $this->set_lang($lang, $help, $lang_file, $use_db, $use_help);
     2070                                }
     2071
     2072                                // Reset the lang name
     2073                                $this->lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
     2074                                return;
     2075                        }
     2076
     2077                        // Do not suppress error if in DEBUG_EXTRA mode
     2078                        $include_result = (defined('DEBUG_EXTRA')) ? (include $language_filename) : (@include $language_filename);
     2079
     2080                        if ($include_result === false)
    20042081                        {
    20052082                                trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
     
    20372114                        $date_cache[$format] = array(
    20382115                                'is_short'              => strpos($format, '|'),
    2039                                 'zone_offset'   => $this->timezone + $this->dst,
    20402116                                'format_short'  => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1),
    20412117                                'format_long'   => str_replace('|', '', $format),
     
    20502126                }
    20512127
     2128                // Zone offset
     2129                $zone_offset = $this->timezone + $this->dst;
     2130
    20522131                // Show date <= 1 hour ago as 'xx min ago'
    2053                 // A small tolerence is given for times in the future and times in the future but in the same minute are displayed as '< than a minute ago'
     2132                // A small tolerence is given for times in the future but in the same minute are displayed as '< than a minute ago'
    20542133                if ($delta <= 3600 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO']))
    20552134                {
     
    20592138                if (!$midnight)
    20602139                {
    2061                         list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $date_cache[$format]['zone_offset']));
    2062                         $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $date_cache[$format]['zone_offset'];
    2063                 }
    2064 
    2065                 if ($date_cache[$format]['is_short'] !== false && !$forcedate)
     2140                        list($d, $m, $y) = explode(' ', gmdate('j n Y', time() + $zone_offset));
     2141                        $midnight = gmmktime(0, 0, 0, $m, $d, $y) - $zone_offset;
     2142                }
     2143
     2144                if ($date_cache[$format]['is_short'] !== false && !$forcedate && !($gmepoch < $midnight - 86400 || $gmepoch > $midnight + 172800))
    20662145                {
    20672146                        $day = false;
     
    20822161                        if ($day !== false)
    20832162                        {
    2084                                 return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $date_cache[$format]['zone_offset']), $date_cache[$format]['lang']));
    2085                         }
    2086                 }
    2087 
    2088                 return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $date_cache[$format]['zone_offset']), $date_cache[$format]['lang']);
     2163                                return str_replace('||', $this->lang['datetime'][$day], strtr(@gmdate($date_cache[$format]['format_short'], $gmepoch + $zone_offset), $date_cache[$format]['lang']));
     2164                        }
     2165                }
     2166
     2167                return strtr(@gmdate($date_cache[$format]['format_long'], $gmepoch + $zone_offset), $date_cache[$format]['lang']);
    20892168        }
    20902169
     
    21562235                        }
    21572236
    2158                         $img_data['src'] = $phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename'];
     2237                        // Use URL if told so
     2238                        $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path;
     2239
     2240                        $img_data['src'] = $root_path . 'styles/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename'];
    21592241                        $img_data['width'] = $this->img_array[$img]['image_width'];
    21602242                        $img_data['height'] = $this->img_array[$img]['image_height'];
     
    22292311                }
    22302312        }
     2313
     2314        /**
     2315        * Funtion to make the user leave the NEWLY_REGISTERED system group.
     2316        * @access public
     2317        */
     2318        function leave_newly_registered()
     2319        {
     2320                global $db;
     2321
     2322                if (empty($this->data['user_new']))
     2323                {
     2324                        return false;
     2325                }
     2326
     2327                if (!function_exists('remove_newly_registered'))
     2328                {
     2329                        global $phpbb_root_path, $phpEx;
     2330
     2331                        include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
     2332                }
     2333                if ($group = remove_newly_registered($this->data['user_id'], $this->data))
     2334                {
     2335                        $this->data['group_id'] = $group;
     2336
     2337                }
     2338                $this->data['user_permissions'] = '';
     2339                $this->data['user_new'] = 0;
     2340
     2341                return true;
     2342        }
    22312343}
    22322344
  • trunk/forum/includes/template.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: template.php 8943 2008-09-26 13:09:56Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4040        var $files_template = array();
    4141        var $inherit_root = '';
     42        var $orig_tpl_storedb;
     43        var $orig_tpl_inherits_id;
    4244
    4345        // this will hash handle names to the compiled/uncompiled code for that handle.
     
    5658                        $this->root = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template';
    5759                        $this->cachepath = $phpbb_root_path . 'cache/tpl_' . str_replace('_', '-', $user->theme['template_path']) . '_';
    58                        
     60
     61                        if ($this->orig_tpl_storedb === null)
     62                        {
     63                                $this->orig_tpl_storedb = $user->theme['template_storedb'];
     64                        }
     65
     66                        if ($this->orig_tpl_inherits_id === null)
     67                        {
     68                                $this->orig_tpl_inherits_id = $user->theme['template_inherits_id'];
     69                        }
     70
     71                        $user->theme['template_storedb'] = $this->orig_tpl_storedb;
     72                        $user->theme['template_inherits_id'] = $this->orig_tpl_inherits_id;
     73
    5974                        if ($user->theme['template_inherits_id'])
    6075                        {
     
    7691        * @access public
    7792        */
    78         function set_custom_template($template_path, $template_name)
    79         {
    80                 global $phpbb_root_path;
     93        function set_custom_template($template_path, $template_name, $fallback_template_path = false)
     94        {
     95                global $phpbb_root_path, $user;
     96
     97                // Make sure $template_path has no ending slash
     98                if (substr($template_path, -1) == '/')
     99                {
     100                        $template_path = substr($template_path, 0, -1);
     101                }
    81102
    82103                $this->root = $template_path;
    83104                $this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_';
    84105
     106                if ($fallback_template_path !== false)
     107                {
     108                        if (substr($fallback_template_path, -1) == '/')
     109                        {
     110                                $fallback_template_path = substr($fallback_template_path, 0, -1);
     111                        }
     112
     113                        $this->inherit_root = $fallback_template_path;
     114                        $this->orig_tpl_inherits_id = true;
     115                }
     116                else
     117                {
     118                        $this->orig_tpl_inherits_id = false;
     119                }
     120
     121                // the database does not store the path or name of a custom template
     122                // so there is no way we can properly store custom templates there
     123                $this->orig_tpl_storedb = false;
     124
     125                $this->_rootref = &$this->_tpldata['.'][0];
     126
    85127                return true;
    86128        }
     
    106148                        $this->filename[$handle] = $filename;
    107149                        $this->files[$handle] = $this->root . '/' . $filename;
    108                        
     150
    109151                        if ($this->inherit_root)
    110152                        {
     
    112154                        }
    113155                }
    114                
     156
    115157                return true;
    116158        }
     
    123165        {
    124166                $this->_tpldata = array('.' => array(0 => array()));
     167                $this->_rootref = &$this->_tpldata['.'][0];
    125168        }
    126169
     
    210253                return true;
    211254        }
    212        
     255
    213256        /**
    214257        * Load a compiled template if possible, if not, recompile it
     
    219262                global $user, $phpEx, $config;
    220263
     264                if (!isset($this->filename[$handle]))
     265                {
     266                        trigger_error("template->_tpl_load(): No file specified for handle $handle", E_USER_ERROR);
     267                }
     268
     269                // reload these settings to have the values they had when this object was initialised
     270                // using set_template or set_custom_template, they might otherwise have been overwritten
     271                // by other template class instances in between.
     272                $user->theme['template_storedb'] = $this->orig_tpl_storedb;
     273                $user->theme['template_inherits_id'] = $this->orig_tpl_inherits_id;
     274
    221275                $filename = $this->cachepath . str_replace('/', '.', $this->filename[$handle]) . '.' . $phpEx;
    222                 $this->files_template[$handle] = $user->theme['template_id'];
    223                
     276                $this->files_template[$handle] = (isset($user->theme['template_id'])) ? $user->theme['template_id'] : 0;
     277
    224278                $recompile = false;
    225279                if (!file_exists($filename) || @filesize($filename) === 0)
     
    237291                        $recompile = (@filemtime($filename) < filemtime($this->files[$handle])) ? true : false;
    238292                }
    239                
     293
    240294                // Recompile page if the original template is newer, otherwise load the compiled version
    241295                if (!$recompile)
     
    250304                        include($phpbb_root_path . 'includes/functions_template.' . $phpEx);
    251305                }
    252                
     306
    253307                // Inheritance - we point to another template file for this one. Equality is also used for store_db
    254308                if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'] && !file_exists($this->files[$handle]))
     
    257311                        $this->files_template[$handle] = $user->theme['template_inherits_id'];
    258312                }
    259                
     313
    260314                $compile = new template_compile($this);
    261315
     
    283337                        }
    284338                        $ids[] = $user->theme['template_id'];
    285                        
     339
    286340                        foreach ($ids as $id)
    287341                        {
     
    291345                                        AND (template_filename = '" . $db->sql_escape($this->filename[$handle]) . "'
    292346                                                OR template_included " . $db->sql_like_expression($db->any_char . $this->filename[$handle] . ':' . $db->any_char) . ')';
    293                        
     347
    294348                                $result = $db->sql_query($sql);
    295349                                while ($row = $db->sql_fetchrow($result))
     
    299353                                $db->sql_freeresult($result);
    300354                        }
    301                                        
     355
    302356                        if (sizeof($rows))
    303357                        {
     
    327381                                                $this->files_template[$row['template_filename']] = $user->theme['template_id'];
    328382                                        }
    329                                        
     383
    330384                                        if ($force_reload || $row['template_mtime'] < filemtime($file))
    331385                                        {
     
    469523                                unset($this->_tpldata[$blockname][($s_row_count - 1)]['S_LAST_ROW']);
    470524                        }
    471                        
     525
    472526                        // Add a new iteration to this block with the variable assignments we were given.
    473527                        $this->_tpldata[$blockname][] = $vararray;
     
    512566                        return false;
    513567                }
    514                
     568
    515569                // Change key to zero (change first position) if false and to last position if true
    516570                if ($key === false || $key === true)
     
    615669                }
    616670        }
     671
     672        /**
     673        * Include a php-file
     674        * @access private
     675        */
     676        function _php_include($filename)
     677        {
     678                global $phpbb_root_path;
     679
     680                $file = $phpbb_root_path . $filename;
     681
     682                if (!file_exists($file))
     683                {
     684                        // trigger_error cannot be used here, as the output already started
     685                        echo 'template->_php_include(): File ' . htmlspecialchars($file) . ' does not exist or is empty';
     686                        return;
     687                }
     688                include($file);
     689        }
    617690}
    618691
  • trunk/forum/includes/ucp/ucp_activate.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_activate.php 9067 2008-11-21 13:21:53Z Kellanved $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    5757                }
    5858
     59                // Do not allow activating by non administrators when admin activation is on
     60                // Only activation type the user should be able to do is INACTIVE_REMIND
     61                // or activate a new password which is not an activation state :@
     62                if (!$user_row['user_newpasswd'] && $user_row['user_inactive_reason'] != INACTIVE_REMIND && $config['require_activation'] == USER_ACTIVATION_ADMIN && !$auth->acl_get('a_user'))
     63                {
     64                        if (!$user->data['is_registered'])
     65                        {
     66                                login_box('', $user->lang['NO_AUTH_OPERATION']);
     67                        }
     68                        trigger_error('NO_AUTH_OPERATION');
     69                }
     70
    5971                $update_password = ($user_row['user_newpasswd']) ? true : false;
    6072
     
    7385                                WHERE user_id = ' . $user_row['user_id'];
    7486                        $db->sql_query($sql);
     87
     88                        add_log('user', $user_row['user_id'], 'LOG_USER_NEW_PASSWORD', $user_row['username']);
    7589                }
    7690
  • trunk/forum/includes/ucp/ucp_attachments.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_attachments.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    185185                        'U_SORT_DOWNLOADS'              => $this->u_action . "&amp;sk=e&amp;sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'),
    186186                        'U_SORT_POST_TIME'              => $this->u_action . "&amp;sk=f&amp;sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
    187                         'U_SORT_TOPIC_TITLE'    => $this->u_action . "&amp;sk=g&amp;sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'),
     187                        'U_SORT_TOPIC_TITLE'    => $this->u_action . "&amp;sk=g&amp;sd=" . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'),
    188188
    189189                        'S_DISPLAY_MARK_ALL'    => ($num_attachments) ? true : false,
  • trunk/forum/includes/ucp/ucp_confirm.php

    r400 r702  
    33*
    44* @package VC
    5 * @version $Id: ucp_confirm.php 8655 2008-06-13 19:39:01Z acydburn $
    6 * @copyright (c) 2005 phpBB Group
     5* @version $Id$
     6* @copyright (c) 2005 2008 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
    88*
     
    3838                global $db, $user, $phpbb_root_path, $config, $phpEx;
    3939
    40                 // Do we have an id? No, then just exit
    41                 $confirm_id = request_var('id', '');
    42                 $type = request_var('type', 0);
    43 
    44                 if (!$confirm_id || !$type)
    45                 {
    46                         exit;
    47                 }
    48 
    49                 // Try and grab code for this id and session
    50                 $sql = 'SELECT code, seed
    51                         FROM ' . CONFIRM_TABLE . "
    52                         WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
    53                                 AND confirm_id = '" . $db->sql_escape($confirm_id) . "'
    54                                 AND confirm_type = $type";
    55                 $result = $db->sql_query($sql);
    56                 $row = $db->sql_fetchrow($result);
    57                 $db->sql_freeresult($result);
    58 
    59                 // If we have a row then grab data else create a new id
    60                 if (!$row)
    61                 {
    62                         exit;
    63                 }
    64 
    65                 if ($config['captcha_gd'])
    66                 {
    67                         include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);
    68                 }
    69                 else
    70                 {
    71                         include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx);
    72                 }
    73 
    74                 $captcha = new captcha();
    75                 $captcha->execute($row['code'], $row['seed']);
     40                include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
     41                $captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']);
     42                $captcha->init(request_var('type', 0));
     43                $captcha->execute();
    7644
    7745                garbage_collection();
  • trunk/forum/includes/ucp/ucp_groups.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_groups.php 9067 2008-11-21 13:21:53Z Kellanved $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4242                {
    4343                        case 'membership':
    44                
     44
    4545                                $this->page_title = 'UCP_USERGROUPS_MEMBER';
    4646
     
    341341                                        );
    342342
    343                                         $group_id_ary[] = $row['group_id'];
     343                                        $group_id_ary[] = (int) $row['group_id'];
    344344                                }
    345345                                $db->sql_freeresult($result);
     
    415415                                $action         = (isset($_POST['addusers'])) ? 'addusers' : request_var('action', '');
    416416                                $group_id       = request_var('g', 0);
    417                                
     417
    418418                                include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    419419
     
    439439                                                trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . $return_page, E_USER_WARNING);
    440440                                        }
    441                                        
     441
    442442                                        $group_name = $group_row['group_name'];
    443443                                        $group_type = $group_row['group_type'];
    444                                        
     444
    445445                                        $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />';
    446446
     
    451451                                                'GROUP_DESC_DISP'               => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
    452452                                                'GROUP_TYPE'                    => $group_row['group_type'],
    453                                                
     453
    454454                                                'AVATAR'                                => $avatar_img,
    455455                                                'AVATAR_IMAGE'                  => $avatar_img,
     
    605605                                                                // group. This prevents existing group members being updated if no changes
    606606                                                                // were made.
    607                                                
     607
    608608                                                                $group_attributes = array();
    609                                                                 $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients');
    610                                                                 foreach ($test_variables as $test)
    611                                                                 {
    612                                                                         if ($action == 'add' || (isset($submit_ary[$test]) && $group_row['group_' . $test] != $submit_ary[$test]))
     609                                                                $test_variables = array(
     610                                                                        'rank'                  => 'int',
     611                                                                        'colour'                => 'string',
     612                                                                        'avatar'                => 'string',
     613                                                                        'avatar_type'   => 'int',
     614                                                                        'avatar_width'  => 'int',
     615                                                                        'avatar_height' => 'int',
     616                                                                        'receive_pm'    => 'int',
     617                                                                        'legend'                => 'int',
     618                                                                        'message_limit' => 'int',
     619                                                                        'max_recipients'=> 'int',
     620                                                                );
     621
     622                                                                foreach ($test_variables as $test => $type)
     623                                                                {
     624                                                                        if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test]))
    613625                                                                        {
     626                                                                                settype($submit_ary[$test], $type);
    614627                                                                                $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test];
    615628                                                                        }
     
    676689                                                $display_gallery = (isset($_POST['display_gallery'])) ? true : false;
    677690
    678                                                 if ($config['allow_avatar_local'] && $display_gallery)
     691                                                if ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery)
    679692                                                {
    680693                                                        avatar_gallery($category, $avatar_select, 4);
    681694                                                }
    682                                                
    683                                                 $avatars_enabled = ($can_upload || ($config['allow_avatar_local'] || $config['allow_avatar_remote'])) ? true : false;
     695
     696                                                $avatars_enabled = ($config['allow_avatar'] && (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
    684697
    685698                                                $template->assign_vars(array(
    686699                                                        'S_EDIT'                        => true,
    687700                                                        'S_INCLUDE_SWATCH'      => true,
    688                                                         'S_CAN_UPLOAD'          => $can_upload,
    689                                                         'S_FORM_ENCTYPE'        => ($can_upload) ? ' enctype="multipart/form-data"' : '',
     701                                                        'S_FORM_ENCTYPE'        => ($config['allow_avatar'] && $can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) ? ' enctype="multipart/form-data"' : '',
    690702                                                        'S_ERROR'                       => (sizeof($error)) ? true : false,
    691703                                                        'S_SPECIAL_GROUP'       => ($group_type == GROUP_SPECIAL) ? true : false,
    692704                                                        'S_AVATARS_ENABLED'     => $avatars_enabled,
    693                                                         'S_DISPLAY_GALLERY'     => ($config['allow_avatar_local'] && !$display_gallery) ? true : false,
     705                                                        'S_DISPLAY_GALLERY'     => ($config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery) ? true : false,
    694706                                                        'S_IN_GALLERY'          => ($config['allow_avatar_local'] && $display_gallery) ? true : false,
     707
     708                                                        'S_UPLOAD_AVATAR_FILE'  => ($config['allow_avatar'] && $config['allow_avatar_upload'] && $can_upload) ? true : false,
     709                                                        'S_UPLOAD_AVATAR_URL'   => ($config['allow_avatar'] && $config['allow_avatar_remote_upload'] && $can_upload) ? true : false,
     710                                                        'S_LINK_AVATAR'                 => ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false,
    695711
    696712                                                        'ERROR_MSG'                             => (sizeof($error)) ? implode('<br />', $error) : '',
     
    698714                                                        'GROUP_MESSAGE_LIMIT'   => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0,
    699715                                                        'GROUP_MAX_RECIPIENTS'  => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0,
    700                                                        
     716
    701717                                                        'GROUP_DESC'                    => $group_desc_data['text'],
    702718                                                        'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'],
     
    840856
    841857                                                        'U_ACTION'                      => $this->u_action . "&amp;g=$group_id",
     858                                                        'S_UCP_ACTION'          => $this->u_action . "&amp;g=$group_id",
    842859                                                        'U_FIND_USERNAME'       => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=ucp&amp;field=usernames'),
    843860                                                ));
     
    897914                                                        {
    898915                                                                $start = 0;
    899                                
     916
    900917                                                                do
    901918                                                                {
     
    949966                                                }
    950967
     968                                                // redirect to last screen
     969                                                redirect($this->u_action . '&amp;action=list&amp;g=' . $group_id);
     970
    951971                                        break;
    952972
     
    9951015                                                }
    9961016
     1017                                                // redirect to last screen
     1018                                                redirect($this->u_action . '&amp;action=list&amp;g=' . $group_id);
     1019
    9971020                                        break;
    9981021
     
    10281051
    10291052                                                $default = request_var('default', 0);
    1030                                                
     1053
    10311054                                                if (confirm_box(true))
    10321055                                                {
  • trunk/forum/includes/ucp/ucp_main.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_main.php 9136 2008-11-30 14:36:59Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    634634        function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array())
    635635        {
    636                 global $user, $db, $template, $config, $auth, $phpbb_root_path, $phpEx;
     636                global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx;
    637637
    638638                $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE;
    639639                $start = request_var('start', 0);
     640
     641                // Grab icons
     642                $icons = $cache->obtain_icons();
    640643
    641644                $sql_array = array(
     
    777780                        topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type);
    778781
    779                         $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id");
     782                        $view_topic_url_params = "f=$forum_id&amp;t=$topic_id";
     783                        $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
    780784
    781785                        // Send vars to template
     
    810814                                'TOPIC_FOLDER_IMG'              => $user->img($folder_img, $folder_alt),
    811815                                'TOPIC_FOLDER_IMG_SRC'  => $user->img($folder_img, $folder_alt, false, '', 'src'),
     816                                'TOPIC_FOLDER_IMG_ALT'  => $user->lang[$folder_alt],
    812817                                'TOPIC_ICON_IMG'                => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '',
    813818                                'TOPIC_ICON_IMG_WIDTH'  => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '',
     
    819824                                'S_UNREAD_TOPIC'                => $unread_topic,
    820825
    821                                 'U_NEWEST_POST'                 => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=unread") . '#unread',
    822                                 'U_LAST_POST'                   => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
     826                                'U_NEWEST_POST'                 => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;view=unread') . '#unread',
     827                                'U_LAST_POST'                   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
    823828                                'U_VIEW_TOPIC'                  => $view_topic_url,
    824829                                'U_VIEW_FORUM'                  => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
  • trunk/forum/includes/ucp/ucp_pm.php

    r400 r702  
    22/**
    33* @package ucp
    4 * @version $Id: ucp_pm.php 8521 2008-04-21 13:20:13Z acydburn $
     4* @version $Id$
    55* @copyright (c) 2005 phpBB Group
    66* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    120120                                if (!$auth->acl_get('u_sendpm'))
    121121                                {
    122                                         trigger_error('NO_AUTH_SEND_MESSAGE');
     122                                        // trigger_error('NO_AUTH_SEND_MESSAGE');
     123                                        $template->assign_vars(array(
     124                                                'S_NO_AUTH_SEND_MESSAGE'        => true,
     125                                                'S_COMPOSE_PM_VIEW'                     => true,
     126                                        ));
     127
     128                                        $tpl_file = 'ucp_pm_viewfolder';
     129                                        break;
    123130                                }
    124131
  • trunk/forum/includes/ucp/ucp_pm_compose.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_pm_compose.php 9168 2008-12-03 16:48:06Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4747        $lastclick              = request_var('lastclick', 0);
    4848
     49        // Reply to all triggered (quote/reply)
     50        $reply_to_all   = request_var('reply_to_all', 0);
     51
    4952        // Do NOT use request_var or specialchars here
    5053        $address_list   = isset($_REQUEST['address_list']) ? $_REQUEST['address_list'] : array();
     
    8588                redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'));
    8689        }
     90
     91        // Since viewtopic.php language entries are used in several modes,
     92        // we include the language file here
     93        $user->add_lang('viewtopic');
    8794
    8895        // Output PM_TO box if message composing
     
    311318                        if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview)
    312319                        {
    313                                 if ($action == 'quotepost')
     320                                // Add the original author as the recipient if quoting a post or only replying and not having checked "reply to all"
     321                                if ($action == 'quotepost' || !$reply_to_all)
    314322                                {
    315323                                        $address_list = array('u' => array($post['author_id'] => 'to'));
     
    317325                                else
    318326                                {
    319                                         // We try to include every previously listed member from the TO Header
     327                                        // We try to include every previously listed member from the TO Header - Reply to all
    320328                                        $address_list = rebuild_header(array('to' => $post['to_address']));
    321329
     
    440448
    441449        // If this is a quote/reply "to all"... we may increase the max_recpients to the number of original recipients
    442         if (($action == 'reply' || $action == 'quote') && $max_recipients)
     450        if (($action == 'reply' || $action == 'quote') && $max_recipients && $reply_to_all)
    443451        {
    444452                // We try to include every previously listed member from the TO Header
     
    632640        if ($load && $drafts)
    633641        {
    634                 load_drafts(0, 0, $id);
     642                load_drafts(0, 0, $id, $action, $msg_id);
    635643        }
    636644
     
    747755        if (!sizeof($error) && $preview)
    748756        {
    749                 $user->add_lang('viewtopic');
    750757                $preview_message = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false);
    751758
     
    761768                        $parse_sig->bbcode_bitfield = $preview_signature_bitfield;
    762769
    763                         $parse_sig->format_display($enable_bbcode, $enable_urls, $enable_smilies);
     770                        $parse_sig->format_display($config['allow_sig_bbcode'], $config['allow_sig_links'], $config['allow_sig_smilies']);
    764771                        $preview_signature = $parse_sig->message;
    765772                        unset($parse_sig);
     
    805812
    806813        // Decode text for message display
    807         $bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh && !sizeof($error)) ? $bbcode_uid : $message_parser->bbcode_uid;
     814        $bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh && (!sizeof($error) || (sizeof($error) && !$submit))) ? $bbcode_uid : $message_parser->bbcode_uid;
    808815
    809816        $message_parser->decode_message($bbcode_uid);
     
    851858                $forward_text[] = $user->lang['FWD_ORIGINAL_MESSAGE'];
    852859                $forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject));
    853                 $forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time));
     860                $forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true));
    854861                $forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text);
    855862                $forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to']));
     
    10401047                'SMILIES_STATUS'                => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
    10411048                'URL_STATUS'                    => ($url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
     1049                'MAX_FONT_SIZE'                 => (int) $config['max_post_font_size'],
    10421050                'MINI_POST_IMG'                 => $user->img('icon_post_target', $user->lang['PM']),
    10431051                'ERROR'                                 => (sizeof($error)) ? implode('<br />', $error) : '',
     
    11251133
    11261134        // Build usernames to add
    1127         $usernames = (isset($_REQUEST['username'])) ? array(request_var('username', '', true)) : array();
     1135        $usernames = request_var('username', '', true);
     1136        $usernames = (empty($usernames)) ? array() : array($usernames);
     1137
    11281138        $username_list = request_var('username_list', '', true);
    11291139        if ($username_list)
     
    11391149                global $refresh, $submit, $preview;
    11401150
    1141                 $refresh = $preview = true;
     1151                $refresh = true;
    11421152                $submit = false;
     1153
     1154                // Preview is only true if there was also a message entered
     1155                if (request_var('message', ''))
     1156                {
     1157                        $preview = true;
     1158                }
    11431159        }
    11441160
  • trunk/forum/includes/ucp/ucp_pm_options.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_pm_options.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    109109                                $db->sql_query($sql);
    110110                                $msg = $user->lang['FOLDER_ADDED'];
     111                        }
     112                        else
     113                        {
     114                                $msg = $user->lang['FOLDER_NAME_EMPTY'];
    111115                        }
    112116                }
     
    634638{
    635639        global $template;
     640        global $module;
     641
     642        $exclude = array();
     643
     644        if (!$module->loaded('zebra', 'friends'))
     645        {
     646                $exclude[RULE_IS_FRIEND] = true;
     647        }
     648
     649        if (!$module->loaded('zebra', 'foes'))
     650        {
     651                $exclude[RULE_IS_FOE] = true;
     652        }
    636653
    637654        $s_rule_options = '';
     
    640657                foreach ($check_ary as $value => $_check)
    641658                {
     659                        if (isset($exclude[$value]))
     660                        {
     661                                continue;
     662                        }
    642663                        $s_rule_options .= '<option value="' . $value . '"' . (($value == $rule_option) ? ' selected="selected"' : '') . '>' . $rule_lang[$value] . '</option>';
    643664                }
  • trunk/forum/includes/ucp/ucp_pm_viewfolder.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_pm_viewfolder.php 8795 2008-08-29 11:50:01Z Kellanved $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    6666                $mark_options = array('mark_important', 'delete_marked');
    6767
     68                // Minimise edits
     69                if (!$auth->acl_get('u_pm_delete') && $key = array_search('delete_marked', $mark_options))
     70                {
     71                        unset($mark_options[$key]);
     72                }
     73
    6874                $s_mark_options = '';
    6975                foreach ($mark_options as $mark_option)
     
    116122                        if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX)
    117123                        {
    118                                 $recipient_list = $address = array();
    119 
    120                                 foreach ($folder_info['rowset'] as $message_id => $row)
    121                                 {
    122                                         $address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address']));
    123                                         $_save = array('u', 'g');
    124                                         foreach ($_save as $save)
    125                                         {
    126                                                 if (isset($address[$message_id][$save]) && sizeof($address[$message_id][$save]))
    127                                                 {
    128                                                         foreach (array_keys($address[$message_id][$save]) as $ug_id)
    129                                                         {
    130                                                                 $recipient_list[$save][$ug_id] = array('name' => $user->lang['NA'], 'colour' => '');
    131                                                         }
    132                                                 }
    133                                         }
    134                                 }
    135 
    136                                 $_types = array('u', 'g');
    137                                 foreach ($_types as $ug_type)
    138                                 {
    139                                         if (!empty($recipient_list[$ug_type]))
    140                                         {
    141                                                 if ($ug_type == 'u')
    142                                                 {
    143                                                         $sql = 'SELECT user_id as id, username as name, user_colour as colour
    144                                                                 FROM ' . USERS_TABLE . '
    145                                                                 WHERE ';
    146                                                 }
    147                                                 else
    148                                                 {
    149                                                         $sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type
    150                                                                 FROM ' . GROUPS_TABLE . '
    151                                                                 WHERE ';
    152                                                 }
    153                                                 $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type])));
    154 
    155                                                 $result = $db->sql_query($sql);
    156 
    157                                                 while ($row = $db->sql_fetchrow($result))
    158                                                 {
    159                                                         if ($ug_type == 'g')
    160                                                         {
    161                                                                 $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name'];
    162                                                         }
    163 
    164                                                         $recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
    165                                                 }
    166                                                 $db->sql_freeresult($result);
    167                                         }
    168                                 }
    169 
    170                                 foreach ($address as $message_id => $adr_ary)
    171                                 {
    172                                         foreach ($adr_ary as $type => $id_ary)
    173                                         {
    174                                                 foreach ($id_ary as $ug_id => $_id)
    175                                                 {
    176                                                         if ($type == 'u')
    177                                                         {
    178                                                                 $address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']);
    179                                                         }
    180                                                         else
    181                                                         {
    182                                                                 $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : '';
    183                                                                 $link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $ug_id) . '"' . $user_colour . '>';
    184                                                                 $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : '');
    185                                                         }
    186                                                 }
    187                                         }
    188                                 }
    189                                 unset($recipient_list, $address);
     124                                $address_list = get_recipient_strings($folder_info['rowset']);
    190125                        }
    191 
    192                         $data = array();
    193126
    194127                        foreach ($folder_info['pm_list'] as $message_id)
     
    268201                {
    269202                        // Build Recipient List if in outbox/sentbox
    270                         $address = array();
     203
     204                        $address_temp = $address = $data = array();
     205
    271206                        if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX)
    272207                        {
    273208                                foreach ($folder_info['rowset'] as $message_id => $row)
    274209                                {
    275                                         $address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address']));
     210                                        $address_temp[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address']));
     211                                        $address[$message_id] = array();
    276212                                }
    277213                        }
     
    297233                                foreach ($_types as $ug_type)
    298234                                {
    299                                         if (isset($address[$message_id][$ug_type]) && sizeof($address[$message_id][$ug_type]))
     235                                        if (isset($address_temp[$message_id][$ug_type]) && sizeof($address_temp[$message_id][$ug_type]))
    300236                                        {
     237                                                if (!isset($address[$message_id][$ug_type]))
     238                                                {
     239                                                        $address[$message_id][$ug_type] = array();
     240                                                }
    301241                                                if ($ug_type == 'u')
    302242                                                {
     
    311251                                                                WHERE ';
    312252                                                }
    313                                                 $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($address[$message_id][$ug_type])));
     253                                                $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($address_temp[$message_id][$ug_type])));
    314254
    315255                                                $result = $db->sql_query($sql);
     
    317257                                                while ($info_row = $db->sql_fetchrow($result))
    318258                                                {
    319                                                         $address[$message_id][$ug_type][$address[$message_id][$ug_type][$info_row['id']]][] = $info_row['name'];
    320                                                         unset($address[$message_id][$ug_type][$info_row['id']]);
     259                                                        $address[$message_id][$ug_type][$address_temp[$message_id][$ug_type][$info_row['id']]][] = $info_row['name'];
     260                                                        unset($address_temp[$message_id][$ug_type][$info_row['id']]);
    321261                                                }
    322262                                                $db->sql_freeresult($result);
     
    324264                                }
    325265
     266                                // There is the chance that all recipients of the message got deleted. To avoid creating
     267                                // exports without recipients, we add a bogus "undisclosed recipient".
     268                                if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) &&
     269                                    !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u'])))
     270                                {
     271                                        $address[$message_id]['u'] = array();
     272                                        $address[$message_id]['u']['to'] = array();
     273                                        $address[$message_id]['u']['to'][] = $user->lang['UNDISCLOSED_RECIPIENT'];
     274                                }
     275
    326276                                decode_message($message_row['message_text'], $message_row['bbcode_uid']);
    327 
     277                               
    328278                                $data[] = array(
    329279                                        'subject'       => censor_text($row['message_subject']),
    330280                                        'sender'        => $row['username'],
    331                                         'date'          => $user->format_date($row['message_time']),
     281                                        // ISO 8601 date. For PHP4 we are able to hardcode the timezone because $user->format_date() does not set it.
     282                                        'date'          => $user->format_date($row['message_time'], (PHP_VERSION >= 5) ? 'c' : "Y-m-d\TH:i:s+00:00", true),
    332283                                        'to'            => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? $address[$message_id] : '',
    333284                                        'message'       => $message_row['message_text']
     
    457408        {
    458409                $sort_by_text = array('t' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
    459                 $sort_by_sql = array('t' => 'p.msg_id', 's' => 'p.message_subject');
     410                $sort_by_sql = array('t' => 'p.message_time', 's' => array('p.message_subject', 'p.message_time'));
    460411        }
    461412        else
    462413        {
    463414                $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
    464                 $sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.msg_id', 's' => 'p.message_subject');
     415                $sort_by_sql = array('a' => array('u.username_clean', 'p.message_time'), 't' => 'p.message_time', 's' => array('p.message_subject', 'p.message_time'));
    465416        }
    466417
     
    503454                'TOTAL_MESSAGES'        => (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)),
    504455
    505                 'POST_IMG'              => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'PM_LOCKED') : $user->img('button_pm_new', 'POST_PM'),
    506 
    507                 'L_NO_MESSAGES' => (!$auth->acl_get('u_sendpm')) ? $user->lang['POST_PM_LOCKED'] : $user->lang['NO_MESSAGES'],
     456                'POST_IMG'              => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'),
     457
     458                'S_NO_AUTH_SEND_MESSAGE'        => !$auth->acl_get('u_sendpm'),
    508459
    509460                'S_SELECT_SORT_DIR'             => $s_sort_dir,
     
    512463                'S_TOPIC_ICONS'                 => ($config['enable_pm_icons']) ? true : false,
    513464
    514                 'U_POST_NEW_TOPIC'      => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose') : '', 
     465                'U_POST_NEW_TOPIC'      => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose') : '',
    515466                'S_PM_ACTION'           => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=view&amp;action=view_folder&amp;f=$folder_id" . (($start !== 0) ? "&amp;start=$start" : '')),
    516467        ));
     
    532483
    533484                // Select the sort order
    534                 $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
     485                $direction = ($sort_dir == 'd') ? 'ASC' : 'DESC';
    535486                $sql_start = max(0, $pm_count - $sql_limit - $start);
    536487        }
     
    538489        {
    539490                // Select the sort order
    540                 $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
     491                $direction = ($sort_dir == 'd') ? 'DESC' : 'ASC';
    541492                $sql_start = $start;
     493        }
     494
     495        // Sql sort order
     496        if (is_array($sort_by_sql[$sort_key]))
     497        {
     498                $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
     499        }
     500        else
     501        {
     502                $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
    542503        }
    543504
  • trunk/forum/includes/ucp/ucp_pm_viewmessage.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_pm_viewmessage.php 9174 2008-12-04 19:58:42Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3030        $folder_id      = (int) $folder_id;
    3131        $author_id      = (int) $message_row['author_id'];
     32        $view           = request_var('view', '');
    3233
    3334        // Not able to view message, it was deleted by the sender
     
    169170        $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
    170171
     172        // Number of "to" recipients
     173        $num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match);
     174
    171175        $template->assign_vars(array(
    172176                'MESSAGE_AUTHOR_FULL'           => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']),
     
    179183                'AUTHOR_AVATAR'         => (isset($user_info['avatar'])) ? $user_info['avatar'] : '',
    180184                'AUTHOR_JOINED'         => $user->format_date($user_info['user_regdate']),
    181                 'AUTHOR_POSTS'          => (!empty($user_info['user_posts'])) ? $user_info['user_posts'] : '',
     185                'AUTHOR_POSTS'          => (int) $user_info['user_posts'],
    182186                'AUTHOR_FROM'           => (!empty($user_info['user_from'])) ? $user_info['user_from'] : '',
    183187
     
    190194                'QUOTE_IMG'                     => $user->img('icon_post_quote', $user->lang['POST_QUOTE_PM']),
    191195                'REPLY_IMG'                     => $user->img('button_pm_reply', $user->lang['POST_REPLY_PM']),
     196                'REPORT_IMG'            => $user->img('icon_post_report', 'REPORT_PM'),
    192197                'EDIT_IMG'                      => $user->img('icon_post_edit', $user->lang['POST_EDIT_PM']),
    193198                'MINI_POST_IMG'         => $user->img('icon_post_target', $user->lang['PM']),
    194199
    195                 'SENT_DATE'                     => $user->format_date($message_row['message_time']),
     200                'SENT_DATE'                     => ($view == 'print') ? $user->format_date($message_row['message_time'], false, true) : $user->format_date($message_row['message_time']),
    196201                'SUBJECT'                       => $message_row['message_subject'],
    197202                'MESSAGE'                       => $message,
     
    210215                'U_DELETE'                      => ($auth->acl_get('u_pm_delete')) ? "$url&amp;mode=compose&amp;action=delete&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
    211216                'U_EMAIL'                       => $user_info['email'],
     217                'U_REPORT'                      => ($config['allow_pm_report']) ? append_sid("{$phpbb_root_path}report.$phpEx", "pm=" . $message_row['msg_id']) : '',
    212218                'U_QUOTE'                       => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=quote&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
    213219                'U_EDIT'                        => (($message_row['message_time'] > time() - ($config['pm_edit_time'] * 60) || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&amp;mode=compose&amp;action=edit&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
    214220                'U_POST_REPLY_PM'       => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=reply&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
     221                'U_POST_REPLY_ALL'      => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=reply&amp;f=$folder_id&amp;reply_to_all=1&amp;p=" . $message_row['msg_id'] : '',
    215222                'U_PREVIOUS_PM'         => "$url&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] . "&amp;view=previous",
    216223                'U_NEXT_PM'                     => "$url&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] . "&amp;view=next",
     224
     225                'U_PM_ACTION'           => $url . '&amp;mode=compose&amp;f=' . $folder_id . '&amp;p=' . $message_row['msg_id'],
    217226
    218227                'S_HAS_ATTACHMENTS'     => (sizeof($attachments)) ? true : false,
     
    220229                'S_AUTHOR_DELETED'      => ($author_id == ANONYMOUS) ? true : false,
    221230                'S_SPECIAL_FOLDER'      => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)),
     231                'S_PM_RECIPIENTS'       => $num_recipients,
    222232
    223233                'U_PRINT_PM'            => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] . "&amp;view=print" : '',
     
    287297                if ($row)
    288298                {
    289                         $user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'])) ? true : false;
     299                        $user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline'))) ? true : false;
    290300                }
    291301        }
  • trunk/forum/includes/ucp/ucp_prefs.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_prefs.php 8990 2008-10-09 15:41:19Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    283283                                        'S_DISABLE_CENSORS'     => $data['wordcensor'],
    284284
    285                                         'S_CHANGE_CENSORS'              => ($auth->acl_get('u_chgcensors')) ? true : false,
     285                                        'S_CHANGE_CENSORS'              => ($auth->acl_get('u_chgcensors') && $config['allow_nocensors']) ? true : false,
    286286
    287287                                        'S_TOPIC_SORT_DAYS'             => $s_limit_topic_days,
  • trunk/forum/includes/ucp/ucp_profile.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_profile.php 8990 2008-10-09 15:41:19Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    111111                                                        'username_clean'        => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'],
    112112                                                        'user_email'            => ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'],
    113                                                         'user_email_hash'       => ($auth->acl_get('u_chgemail')) ? crc32($data['email']) . strlen($data['email']) : $user->data['user_email_hash'],
     113                                                        'user_email_hash'       => ($auth->acl_get('u_chgemail')) ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'],
    114114                                                        'user_password'         => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? phpbb_hash($data['new_password']) : $user->data['user_password'],
    115115                                                        'user_passchg'          => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0,
     
    134134                                                $message = 'PROFILE_UPDATED';
    135135
    136                                                 if ($config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
     136                                                if ($auth->acl_get('u_chgemail') && $config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
    137137                                                {
    138138                                                        $message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';
     
    350350                                                $data['notify'] = $user->data['user_notify_type'];
    351351
    352                                                 if (!$config['jab_enable'] || !$data['jabber'] || !@extension_loaded('xml'))
     352                                                if ($data['notify'] == NOTIFY_IM && (!$config['jab_enable'] || !$data['jabber'] || !@extension_loaded('xml')))
    353353                                                {
    354354                                                        // User has not filled in a jabber address (Or one of the modules is disabled or jabber is disabled)
    355355                                                        // Disable notify by Jabber now for this user.
    356                                                         $data['notify'] = NOTIFY_BOTH;
     356                                                        $data['notify'] = NOTIFY_EMAIL;
    357357                                                }
    358358
     
    381381
    382382                                                // Update Custom Fields
    383                                                 if (sizeof($cp_data))
    384                                                 {
    385                                                         $sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
    386                                                                 SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
    387                                                                 WHERE user_id = ' . $user->data['user_id'];
    388                                                         $db->sql_query($sql);
    389 
    390                                                         if (!$db->sql_affectedrows())
    391                                                         {
    392                                                                 $cp_data['user_id'] = (int) $user->data['user_id'];
    393 
    394                                                                 $db->sql_return_on_error(true);
    395 
    396                                                                 $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data);
    397                                                                 $db->sql_query($sql);
    398 
    399                                                                 $db->sql_return_on_error(false);
    400                                                         }
    401                                                 }
     383                                                $cp->update_profile_field_data($user->data['user_id'], $cp_data);
    402384
    403385                                                meta_refresh(3, $this->u_action);
     
    475457                                include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    476458
    477                                 $enable_bbcode  = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;
    478                                 $enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;
    479                                 $enable_urls    = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
     459                                $enable_bbcode  = ($config['allow_sig_bbcode']) ? (bool) $user->optionget('sig_bbcode') : false;
     460                                $enable_smilies = ($config['allow_sig_smilies']) ? (bool) $user->optionget('sig_smilies') : false;
     461                                $enable_urls    = ($config['allow_sig_links']) ? (bool) $user->optionget('sig_links') : false;
    480462
    481463                                $signature              = utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true));
     
    486468                                {
    487469                                        include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
     470
     471                                        $enable_bbcode  = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false;
     472                                        $enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false;
     473                                        $enable_urls    = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
    488474
    489475                                        if (!sizeof($error))
     
    506492                                                if (!sizeof($error) && $submit)
    507493                                                {
     494                                                        $user->optionset('sig_bbcode', $enable_bbcode);
     495                                                        $user->optionset('sig_smilies', $enable_smilies);
     496                                                        $user->optionset('sig_links', $enable_urls);
     497
    508498                                                        $sql_ary = array(
    509499                                                                'user_sig'                                      => (string) $message_parser->message,
     500                                                                'user_options'                          => $user->data['user_options'],
    510501                                                                'user_sig_bbcode_uid'           => (string) $message_parser->bbcode_uid,
    511502                                                                'user_sig_bbcode_bitfield'      => $message_parser->bbcode_bitfield
     
    550541                                        'FLASH_STATUS'                  => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
    551542                                        'URL_STATUS'                    => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
     543                                        'MAX_FONT_SIZE'                 => (int) $config['max_sig_font_size'],
    552544
    553545                                        'L_SIGNATURE_EXPLAIN'   => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
     
    573565                                $category = basename(request_var('category', ''));
    574566
    575                                 $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
     567                                $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
    576568
    577569                                add_form_key('ucp_avatar');
     
    596588                                }
    597589
     590                                if (!$config['allow_avatar'] && $user->data['user_avatar_type'])
     591                                {
     592                                        $error[] = $user->lang['AVATAR_NOT_ALLOWED'];
     593                                }
     594                                else if ((($user->data['user_avatar_type'] == AVATAR_UPLOAD) && !$config['allow_avatar_upload']) ||
     595                                 (($user->data['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) ||
     596                                 (($user->data['user_avatar_type'] == AVATAR_GALLERY) && !$config['allow_avatar_local']))
     597                                {
     598                                        $error[] = $user->lang['AVATAR_TYPE_NOT_ALLOWED'];
     599                                }
     600
    598601                                $template->assign_vars(array(
    599602                                        'ERROR'                 => (sizeof($error)) ? implode('<br />', $error) : '',
    600                                         'AVATAR'                => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
     603                                        'AVATAR'                => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height'], 'USER_AVATAR', true),
    601604                                        'AVATAR_SIZE'   => $config['avatar_filesize'],
    602605
    603606                                        'U_GALLERY'             => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&amp;mode=avatar&amp;display_gallery=1'),
    604607
    605                                         'S_FORM_ENCTYPE'        => ($can_upload) ? ' enctype="multipart/form-data"' : '',
     608                                        'S_FORM_ENCTYPE'        => ($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) ? ' enctype="multipart/form-data"' : '',
    606609
    607610                                        'L_AVATAR_EXPLAIN'      => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024),
    608611                                ));
    609612
    610                                 if ($display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
     613                                if ($config['allow_avatar'] && $display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
    611614                                {
    612615                                        avatar_gallery($category, $avatar_select, 4);
    613616                                }
    614                                 else
    615                                 {
    616                                         $avatars_enabled = ($can_upload || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
     617                                else if ($config['allow_avatar'])
     618                                {
     619                                        $avatars_enabled = (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
    617620
    618621                                        $template->assign_vars(array(
     
    621624
    622625                                                'S_AVATARS_ENABLED'             => $avatars_enabled,
    623                                                 'S_UPLOAD_AVATAR_FILE'  => $can_upload,
    624                                                 'S_UPLOAD_AVATAR_URL'   => $can_upload,
     626                                                'S_UPLOAD_AVATAR_FILE'  => ($can_upload && $config['allow_avatar_upload']) ? true : false,
     627                                                'S_UPLOAD_AVATAR_URL'   => ($can_upload && $config['allow_avatar_remote_upload']) ? true : false,
    625628                                                'S_LINK_AVATAR'                 => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false,
    626629                                                'S_DISPLAY_GALLERY'             => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false)
  • trunk/forum/includes/ucp/ucp_register.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_register.php 8782 2008-08-23 17:20:55Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3838                include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
    3939
    40                 $confirm_id             = request_var('confirm_id', '');
    4140                $coppa                  = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
    4241                $agreed                 = (!empty($_POST['agreed'])) ? 1 : 0;
     
    5453                }
    5554
    56 
    5755                if ($change_lang || $user_lang != $config['default_lang'])
    5856                {
     
    6967                                }
    7068
    71                                 $user->lang_name = $lang = $use_lang;
     69                                $user->lang_name = $user_lang = $use_lang;
    7270                                $user->lang = array();
     71                                $user->data['user_lang'] = $user->lang_name;
    7372                                $user->add_lang(array('common', 'ucp'));
    7473                        }
     
    8079                }
    8180
     81
    8282                $cp = new custom_profile();
    8383
    8484                $error = $cp_data = $cp_error = array();
    85 
    8685
    8786                if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable']))
     
    9089                        $add_coppa = ($coppa !== false) ? '&amp;coppa=' . $coppa : '';
    9190
    92                         $s_hidden_fields = ($confirm_id) ? array('confirm_id' => $confirm_id) : array();
     91                        $s_hidden_fields = array(
     92                                'change_lang'   => $change_lang,
     93                        );
    9394
    9495                        // If we change the language, we want to pass on some more possible parameter.
     
    100101                                        'email'                         => strtolower(request_var('email', '')),
    101102                                        'email_confirm'         => strtolower(request_var('email_confirm', '')),
    102                                         'confirm_code'          => request_var('confirm_code', ''),
    103                                         'confirm_id'            => request_var('confirm_id', ''),
    104103                                        'lang'                          => $user->lang_name,
    105104                                        'tz'                            => request_var('tz', (float) $config['board_timezone']),
    106105                                ));
    107                         }
     106
     107                        }
     108
     109                        // Checking amount of available languages
     110                        $sql = 'SELECT lang_id
     111                                FROM ' . LANG_TABLE;
     112                        $result = $db->sql_query($sql);
     113
     114                        $lang_row = array();
     115                        while ($row = $db->sql_fetchrow($result))
     116                        {
     117                                $lang_row[] = $row;
     118                        }
     119                        $db->sql_freeresult($result);
    108120
    109121                        if ($coppa === false && $config['coppa_enable'])
     
    114126
    115127                                $template->assign_vars(array(
     128                                        'S_LANG_OPTIONS'        => (sizeof($lang_row) > 1) ? language_select($user_lang) : '',
    116129                                        'L_COPPA_NO'            => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday),
    117130                                        'L_COPPA_YES'           => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday),
     
    128141                        {
    129142                                $template->assign_vars(array(
     143                                        'S_LANG_OPTIONS'        => (sizeof($lang_row) > 1) ? language_select($user_lang) : '',
    130144                                        'L_TERMS_OF_USE'        => sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()),
    131145
     
    137151                                );
    138152                        }
     153                        unset($lang_row);
    139154
    140155                        $this->tpl_name = 'ucp_agreement';
    141156                        return;
    142157                }
    143 
     158               
     159               
     160                // The CAPTCHA kicks in here. We can't help that the information gets lost on language change.
     161                if ($config['enable_confirm'])
     162                {
     163                        include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
     164                        $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
     165                        $captcha->init(CONFIRM_REG);
     166                }
    144167
    145168                // Try to manually determine the timezone and adjust the dst if the server date/time complies with the default setting +/- 1
     
    168191                        'email'                         => strtolower(request_var('email', '')),
    169192                        'email_confirm'         => strtolower(request_var('email_confirm', '')),
    170                         'confirm_code'          => request_var('confirm_code', ''),
    171193                        'lang'                          => basename(request_var('lang', $user->lang_name)),
    172194                        'tz'                            => request_var('tz', (float) $timezone),
     
    188210                                        array('email')),
    189211                                'email_confirm'         => array('string', false, 6, 60),
    190                                 'confirm_code'          => array('string', !$config['enable_confirm'], 5, 8),
    191212                                'tz'                            => array('num', false, -14, 14),
    192213                                'lang'                          => array('match', false, '#^[a-z_\-]{2,}$#i'),
    193214                        ));
     215
    194216                        if (!check_form_key('ucp_register'))
    195217                        {
    196218                                $error[] = $user->lang['FORM_INVALID'];
    197219                        }
     220
    198221                        // Replace "error" strings with their real, localised form
    199222                        $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
    200223
     224                        if ($config['enable_confirm'])
     225                        {
     226                                $vc_response = $captcha->validate($data);
     227                                if ($vc_response !== false)
     228                                {
     229                                        $error[] = $vc_response;
     230                                }
     231
     232                                if ($config['max_reg_attempts'] && $captcha->get_attempt_count() > $config['max_reg_attempts'])
     233                                {
     234                                        $error[] = $user->lang['TOO_MANY_REGISTERS'];
     235                                }
     236                        }
     237
    201238                        // DNSBL check
    202239                        if ($config['check_dnsbl'])
     
    210247                        // validate custom profile fields
    211248                        $cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error);
    212 
    213                         // Visual Confirmation handling
    214                         $wrong_confirm = false;
    215                         if ($config['enable_confirm'])
    216                         {
    217                                 if (!$confirm_id)
    218                                 {
    219                                         $error[] = $user->lang['CONFIRM_CODE_WRONG'];
    220                                         $wrong_confirm = true;
    221                                 }
    222                                 else
    223                                 {
    224                                         $sql = 'SELECT code
    225                                                 FROM ' . CONFIRM_TABLE . "
    226                                                 WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
    227                                                         AND session_id = '" . $db->sql_escape($user->session_id) . "'
    228                                                         AND confirm_type = " . CONFIRM_REG;
    229                                         $result = $db->sql_query($sql);
    230                                         $row = $db->sql_fetchrow($result);
    231                                         $db->sql_freeresult($result);
    232 
    233                                         if ($row)
    234                                         {
    235                                                 if (strcasecmp($row['code'], $data['confirm_code']) === 0)
    236                                                 {
    237                                                         $sql = 'DELETE FROM ' . CONFIRM_TABLE . "
    238                                                                 WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
    239                                                                         AND session_id = '" . $db->sql_escape($user->session_id) . "'
    240                                                                         AND confirm_type = " . CONFIRM_REG;
    241                                                         $db->sql_query($sql);
    242                                                 }
    243                                                 else
    244                                                 {
    245                                                         $error[] = $user->lang['CONFIRM_CODE_WRONG'];
    246                                                         $wrong_confirm = true;
    247                                                 }
    248                                         }
    249                                         else
    250                                         {
    251                                                 $error[] = $user->lang['CONFIRM_CODE_WRONG'];
    252                                                 $wrong_confirm = true;
    253                                         }
    254                                 }
    255                         }
    256249
    257250                        if (!sizeof($error))
     
    327320                                );
    328321
     322                                if ($config['new_member_post_limit'])
     323                                {
     324                                        $user_row['user_new'] = 1;
     325                                }
     326
    329327                                // Register user...
    330328                                $user_id = user_add($user_row, $cp_data);
     
    334332                                {
    335333                                        trigger_error('NO_USER', E_USER_ERROR);
     334                                }
     335
     336                                // Okay, captcha, your job is done.
     337                                if ($config['enable_confirm'] && isset($captcha))
     338                                {
     339                                        $captcha->reset();
    336340                                }
    337341
     
    441445                        $s_hidden_fields['coppa'] = $coppa;
    442446                }
     447
     448                if ($config['enable_confirm'])
     449                {
     450                        $s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields());
     451                }
    443452                $s_hidden_fields = build_hidden_fields($s_hidden_fields);
    444 
    445453                $confirm_image = '';
    446454
    447455                // Visual Confirmation - Show images
    448 
    449456                if ($config['enable_confirm'])
    450457                {
    451                         if ($change_lang)
    452                         {
    453                                 $str = '&amp;change_lang=' . $change_lang;
    454                                 $sql = 'SELECT code
    455                                                 FROM ' . CONFIRM_TABLE . "
    456                                                 WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
    457                                                         AND session_id = '" . $db->sql_escape($user->session_id) . "'
    458                                                         AND confirm_type = " . CONFIRM_REG;
    459                                 $result = $db->sql_query($sql);
    460                                 if (!$row = $db->sql_fetchrow($result))
    461                                 {
    462                                         $confirm_id = '';
    463                                 }
    464                                 $db->sql_freeresult($result);
    465                         }
    466                         else
    467                         {
    468                                 $str = '';
    469                         }
    470                         if (!$change_lang || !$confirm_id)
    471                         {
    472                                 $user->confirm_gc(CONFIRM_REG);
    473 
    474                                 $sql = 'SELECT COUNT(session_id) AS attempts
    475                                         FROM ' . CONFIRM_TABLE . "
    476                                         WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
    477                                                 AND confirm_type = " . CONFIRM_REG;
    478                                 $result = $db->sql_query($sql);
    479                                 $attempts = (int) $db->sql_fetchfield('attempts');
    480                                 $db->sql_freeresult($result);
    481 
    482                                 if ($config['max_reg_attempts'] && $attempts > $config['max_reg_attempts'])
    483                                 {
    484                                         trigger_error('TOO_MANY_REGISTERS');
    485                                 }
    486 
    487                                 $code = gen_rand_string(mt_rand(5, 8));
    488                                 $confirm_id = md5(unique_id($user->ip));
    489                                 $seed = hexdec(substr(unique_id(), 4, 10));
    490 
    491                                 // compute $seed % 0x7fffffff
    492                                 $seed -= 0x7fffffff * floor($seed / 0x7fffffff);
    493 
    494                                 $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
    495                                         'confirm_id'    => (string) $confirm_id,
    496                                         'session_id'    => (string) $user->session_id,
    497                                         'confirm_type'  => (int) CONFIRM_REG,
    498                                         'code'                  => (string) $code,
    499                                         'seed'                  => (int) $seed)
    500                                 );
    501                                 $db->sql_query($sql);
    502                         }
    503                         $confirm_image = '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_REG . $str) . '" alt="" title="" />';
    504                         $s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />';
     458                        $template->assign_vars(array(
     459                                'CAPTCHA_TEMPLATE'              => $captcha->get_template(),
     460                        ));
    505461                }
    506462
     
    525481                        'EMAIL'                         => $data['email'],
    526482                        'EMAIL_CONFIRM'         => $data['email_confirm'],
    527                         'CONFIRM_IMG'           => $confirm_image,
    528 
    529                         'L_CONFIRM_EXPLAIN'                     => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
     483
    530484                        'L_REG_COND'                            => $l_reg_cond,
    531485                        'L_USERNAME_EXPLAIN'            => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
     
    534488                        'S_LANG_OPTIONS'        => language_select($data['lang']),
    535489                        'S_TZ_OPTIONS'          => tz_select($data['tz']),
    536                         'S_CONFIRM_CODE'        => ($config['enable_confirm']) ? true : false,
     490                        'S_CONFIRM_REFRESH'     => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false,
     491                        'S_REGISTRATION'        => true,
    537492                        'S_COPPA'                       => $coppa,
    538493                        'S_HIDDEN_FIELDS'       => $s_hidden_fields,
    539494                        'S_UCP_ACTION'          => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'),
    540                         )
    541                 );
     495                ));
    542496
    543497                //
  • trunk/forum/includes/ucp/ucp_remind.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_remind.php 8977 2008-10-06 14:04:33Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3939                        $sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason
    4040                                FROM ' . USERS_TABLE . "
    41                                 WHERE user_email = '" . $db->sql_escape($email) . "'
     41                                WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
    4242                                        AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
    4343                        $result = $db->sql_query($sql);
  • trunk/forum/includes/ucp/ucp_resend.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_resend.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4646                        $sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_inactive_reason
    4747                                FROM ' . USERS_TABLE . "
    48                                 WHERE user_email = '" . $db->sql_escape($email) . "'
     48                                WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "'
    4949                                        AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
    5050                        $result = $db->sql_query($sql);
     
    134134                                        $messenger->im($row['user_jabber'], $row['username']);
    135135
     136                                        $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
     137                                        $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
     138                                        $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
     139                                        $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
     140
    136141                                        $messenger->assign_vars(array(
    137142                                                'USERNAME'                      => htmlspecialchars_decode($user_row['username']),
     
    147152                        meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
    148153
    149                         $message = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? $user->lang['ACIVATION_EMAIL_SENT_ADMIN'] : $user->lang['ACTIVATION_EMAIL_SENT'];
     154                        $message = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? $user->lang['ACTIVATION_EMAIL_SENT_ADMIN'] : $user->lang['ACTIVATION_EMAIL_SENT'];
    150155                        $message .= '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
    151156                        trigger_error($message);
  • trunk/forum/includes/ucp/ucp_zebra.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp_zebra.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    5353                                if (confirm_box(true))
    5454                                {
     55                                        // Remove users
     56                                        if (!empty($data['usernames']))
     57                                        {
     58                                                $sql = 'DELETE FROM ' . ZEBRA_TABLE . '
     59                                                        WHERE user_id = ' . $user->data['user_id'] . '
     60                                                                AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
     61                                                $db->sql_query($sql);
     62
     63                                                $updated = true;
     64                                        }
     65
     66                                        // Add users
    5567                                        if ($data['add'])
    5668                                        {
     
    125137                                                                        $user_id_ary[] = $row['user_id'];
    126138                                                                }
     139                                                                else if ($row['user_id'] != ANONYMOUS)
     140                                                                {
     141                                                                        $error[] = $user->lang['NOT_ADDED_' . $l_mode . '_BOTS'];
     142                                                                }
    127143                                                                else
    128144                                                                {
     
    183199                                                        }
    184200                                                }
    185                                         }
    186                                         else if (sizeof($data['usernames']))
    187                                         {
    188                                                 // Force integer values
    189                                                 $data['usernames'] = array_map('intval', $data['usernames']);
    190 
    191                                                 $sql = 'DELETE FROM ' . ZEBRA_TABLE . '
    192                                                         WHERE user_id = ' . $user->data['user_id'] . '
    193                                                                 AND ' . $db->sql_in_set('zebra_id', $data['usernames']);
    194                                                 $db->sql_query($sql);
    195 
    196                                                 $updated = true;
    197201                                        }
    198202
  • trunk/forum/includes/utf/utf_tools.php

    r400 r702  
    33*
    44* @package utf
    5 * @version $Id: utf_tools.php 8510 2008-04-20 05:16:42Z davidmj $
     5* @version $Id$
    66* @copyright (c) 2006 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    7171                $len = strlen($str);
    7272                $ret = '';
    73        
     73
    7474                while ($pos < $len)
    7575                {
     
    253253                {
    254254                        $ar     = explode($needle, $str);
    255                        
     255
    256256                        if (sizeof($ar) > 1)
    257257                        {
     
    528528                }
    529529                else
    530                 {       
     530                {
    531531                        // offset == 0; just anchor the pattern
    532532                        $op = '^';
     
    561561                                $lx = (int) ($length / 65535);
    562562                                $ly = $length % 65535;
    563                                
     563
    564564                                // negative length requires a captured group
    565565                                // of length characters
     
    633633                return array($str);
    634634        }
    635        
     635
    636636        preg_match_all('/.{' . $split_len . '}|[^\x00]{1,' . $split_len . '}$/us', $str, $ar);
    637637        return $ar[0];
     
    19181918}
    19191919
     1920/**
     1921* UTF8-safe basename() function
     1922*
     1923* basename() has some limitations and is dependent on the locale setting
     1924* according to the PHP manual. Therefore we provide our own locale independant
     1925* basename function.
     1926*
     1927* @param string $filename The filename basename() should be applied to
     1928* @return string The basenamed filename
     1929*/
     1930function utf8_basename($filename)
     1931{
     1932        // We always check for forward slash AND backward slash
     1933        // because they could be mixed or "sneaked" in. ;)
     1934        // You know, never trust user input...
     1935        if (strpos($filename, '/') !== false)
     1936        {
     1937                $filename = utf8_substr($filename, utf8_strrpos($filename, '/') + 1);
     1938        }
     1939
     1940        if (strpos($filename, '\\') !== false)
     1941        {
     1942                $filename = utf8_substr($filename, utf8_strrpos($filename, '\\') + 1);
     1943        }
     1944
     1945        return $filename;
     1946}
     1947
     1948/**
     1949* UTF8-safe str_replace() function
     1950*
     1951* @param string $search The value to search for
     1952* @param string $replace The replacement string
     1953* @param string $subject The target string
     1954* @return string The resultant string
     1955*/
     1956function utf8_str_replace($search, $replace, $subject)
     1957{
     1958        if (!is_array($search))
     1959        {
     1960                $search = array($search);
     1961                if (is_array($replace))
     1962                {
     1963                        $replace = (string) $replace;
     1964                        trigger_error('Array to string conversion', E_USER_NOTICE);
     1965                }
     1966        }
     1967
     1968        $length = sizeof($search);
     1969
     1970        if (!is_array($replace))
     1971        {
     1972                $replace = array_fill(0, $length, $replace);
     1973        }
     1974        else
     1975        {
     1976                $replace = array_pad($replace, $length, '');
     1977        }
     1978
     1979        for ($i = 0; $i < $length; $i++)
     1980        {
     1981                $search_length = utf8_strlen($search[$i]);
     1982                $replace_length = utf8_strlen($replace[$i]);
     1983
     1984                $offset = 0;
     1985                while (($start = utf8_strpos($subject, $search[$i], $offset)) !== false)
     1986                {
     1987                        $subject = utf8_substr($subject, 0, $start) . $replace[$i] . utf8_substr($subject, $start + $search_length);
     1988                        $offset = $start + $replace_length;
     1989                }
     1990        }
     1991
     1992        return $subject;
     1993}
     1994
    19201995?>
  • trunk/forum/index.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: index.php 8987 2008-10-09 14:17:02Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    8585{
    8686        $now = getdate(time() + $user->timezone + $user->dst - date('Z'));
    87         $sql = 'SELECT user_id, username, user_colour, user_birthday
    88                 FROM ' . USERS_TABLE . "
    89                 WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
    90                         AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
     87        $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday
     88                FROM ' . USERS_TABLE . ' u
     89                LEFT JOIN ' . BANLIST_TABLE . " b ON (u.user_id = b.ban_userid)
     90                WHERE (b.ban_id IS NULL
     91                        OR b.ban_exclude = 1)
     92                        AND u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%'
     93                        AND u.user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
    9194        $result = $db->sql_query($sql);
    9295
  • trunk/forum/language/en/acp/ban.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: ban.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4949        'BAN_GIVE_REASON'               => 'Reason shown to the banned',
    5050        'BAN_UPDATE_SUCCESSFUL' => 'The banlist has been updated successfully.',
     51        'BANNED_UNTIL_DATE'             => 'until %s', // Example: "until Mon 13.Jul.2009, 14:44"
     52        'BANNED_UNTIL_DURATION' => '%1$s (until %2$s)', // Example: "7 days (until Tue 14.Jul.2009, 14:44)"
    5153
    5254        'EMAIL_BAN'                                     => 'Ban one or more e-mail addresses',
     
    6870
    6971        'PERMANENT'             => 'Permanent',
    70        
     72
    7173        'UNTIL'                                         => 'Until',
    7274        'USER_BAN'                                      => 'Ban one or more usernames',
     
    7678        'USER_UNBAN'                            => 'Un-ban or un-exclude usernames',
    7779        'USER_UNBAN_EXPLAIN'            => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users are emphasised.',
    78        
    79 
    8080));
    8181
  • trunk/forum/language/en/acp/board.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: board.php 9037 2008-10-26 10:52:43Z acydburn $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    7171        'ALLOW_NO_CENSORS_EXPLAIN'      => 'Users can choose to disable the automatic word censoring of posts and private messages.',
    7272        'ALLOW_PM_ATTACHMENTS'          => 'Allow attachments in private messages',
     73        'ALLOW_PM_REPORT'                       => 'Allow users to report private messages',
     74        'ALLOW_PM_REPORT_EXPLAIN'       => 'If this setting is enabled, users have the option of reporting a private message they have received or sent to the board’s moderators. These private messages will then be visible in the Moderator Control Panel.',
     75        'ALLOW_QUICK_REPLY'                     => 'Allow quick reply',
     76        'ALLOW_QUICK_REPLY_EXPLAIN'     => 'This switch allows for the quick reply to be disabled board-wide. When enabled, forum specific settings will be used to determine whether the quick reply is displayed in individual forums.',
     77        'ALLOW_QUICK_REPLY_BUTTON'      => 'Submit and enable quick reply in all forums',
    7378        'ALLOW_SIG'                                     => 'Allow signatures',
    7479        'ALLOW_SIG_BBCODE'                      => 'Allow BBCode in user signatures',
     
    8893        'ACP_AVATAR_SETTINGS_EXPLAIN'   => 'Avatars are generally small, unique images a user can associate with themselves. Depending on the style they are usually displayed below the username when viewing topics. Here you can determine how users can define their avatars. Please note that in order to upload avatars you need to have created the directory you name below and ensure it can be written to by the web server. Please also note that file size limits are only imposed on uploaded avatars, they do not apply to remotely linked images.',
    8994
     95        'ALLOW_AVATARS'                                 => 'Enable avatars',
     96        'ALLOW_AVATARS_EXPLAIN'                 => 'Allow general usage of avatars;<br />If you disable avatars in general or avatars of a certain mode, the disabled avatars will no longer be shown on the board, but users will still be able to download their own avatars in the User Control Panel.',
    9097        'ALLOW_LOCAL'                                   => 'Enable gallery avatars',
    9198        'ALLOW_REMOTE'                                  => 'Enable remote avatars',
    9299        'ALLOW_REMOTE_EXPLAIN'                  => 'Avatars linked to from another website.',
     100        'ALLOW_REMOTE_UPLOAD'                   => 'Enable remote avatar uploading',
     101        'ALLOW_REMOTE_UPLOAD_EXPLAIN'   => 'Allow uploading of avatars from another website.',
    93102        'ALLOW_UPLOAD'                                  => 'Enable avatar uploading',
    94103        'AVATAR_GALLERY_PATH'                   => 'Avatar gallery path',
     
    141150        'ALLOW_POST_FLASH_EXPLAIN'                      => 'If disallowed the <code>[FLASH]</code> BBCode tag is disabled in posts. Otherwise the permission system controls which users can use the <code>[FLASH]</code> BBCode tag.',
    142151
    143         'ENABLE_QUEUE_TRIGGER'                  => 'Enable queued posts',
    144         'ENABLE_QUEUE_TRIGGER_EXPLAIN'  => 'Ability to put registered users posts to post approval if their post count is lower than the specified value below. This setting has no effect on the permission setting for post/topic approval.',
    145         'QUEUE_TRIGGER_POSTS'                   => 'Maximum post count for queued posts',
    146         'QUEUE_TRIGGER_POSTS_EXPLAIN'   => 'If queued posts is enabled, this is the post count the user need to reach in order to post without post approval. If the users post count is below this number, the post is stored in the queue automatically.',
    147 
    148152        'BUMP_INTERVAL'                                 => 'Bump interval',
    149         'BUMP_INTERVAL_EXPLAIN'                 => 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic.',
    150         'CHAR_LIMIT'                                    => 'Maximum characters per post',
    151         'CHAR_LIMIT_EXPLAIN'                    => 'The number of characters allowed within a post. Set to 0 for unlimited characters.',
     153        'BUMP_INTERVAL_EXPLAIN'                 => 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic. Setting the value to 0 disables this feature.',
     154        'CHAR_LIMIT'                                    => 'Maximum characters per post/message',
     155        'CHAR_LIMIT_EXPLAIN'                    => 'The number of characters allowed within a post/private message. Set to 0 for unlimited characters.',
     156        'DELETE_TIME'                                   => 'Limit deleting time',
     157        'DELETE_TIME_EXPLAIN'                   => 'Limits the time available to delete a new post. Setting the value to 0 disables this behaviour.',
    152158        'DISPLAY_LAST_EDITED'                   => 'Display last edited time information',
    153159        'DISPLAY_LAST_EDITED_EXPLAIN'   => 'Choose if the last edited by information to be displayed on posts.',
     
    167173        'MAX_POST_URLS'                                 => 'Maximum links per post',
    168174        'MAX_POST_URLS_EXPLAIN'                 => 'Maximum number of URLs in a post. Set to 0 for unlimited links.',
     175        'MIN_CHAR_LIMIT'                                => 'Minimum characters per post/message',
     176        'MIN_CHAR_LIMIT_EXPLAIN'                => 'The minimum number of characters the user need to enter within a post/private message.',
    169177        'POSTING'                                               => 'Posting',
    170178        'POSTS_PER_PAGE'                                => 'Posts per page',
     
    173181        'SMILIES_LIMIT'                                 => 'Maximum smilies per post',
    174182        'SMILIES_LIMIT_EXPLAIN'                 => 'Maximum number of smilies in a post. Set to 0 for unlimited smilies.',
     183        'SMILIES_PER_PAGE'                              => 'Smilies per page',
    175184        'TOPICS_PER_PAGE'                               => 'Topics per page',
    176185));
     
    198207        'ACP_REGISTER_SETTINGS_EXPLAIN'         => 'Here you are able to define registration and profile related settings.',
    199208
    200         'ACC_ACTIVATION'                        => 'Account activation',
    201         'ACC_ACTIVATION_EXPLAIN'        => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations.',
     209        'ACC_ACTIVATION'                                => 'Account activation',
     210        'ACC_ACTIVATION_EXPLAIN'                => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations.',
     211        'NEW_MEMBER_POST_LIMIT'                 => 'New member post limit',
     212        'NEW_MEMBER_POST_LIMIT_EXPLAIN' => 'New members are within the <em>Newly Registered Users</em> group until they reach this number of posts. You can use this group to keep them from using the PM system or to review their posts. <strong>A value of 0 disables this feature.</strong>',
     213        'NEW_MEMBER_GROUP_DEFAULT'              => 'Set Newly Registered Users group to default',
     214        'NEW_MEMBER_GROUP_DEFAULT_EXPLAIN'      => 'If set to yes and a new member post limit is specified newly registered users will be not only put into the <em>Newly Registered Users</em> group, but this group also being their default one. This may come in handy if you want to assign a group default rank and/or avatar the user then inherits.',
     215
    202216        'ACC_ADMIN'                                     => 'By Admin',
    203217        'ACC_DISABLE'                           => 'Disable',
     
    232246));
    233247
     248// Feeds
     249$lang = array_merge($lang, array(
     250        'ACP_FEED_MANAGEMENT'                           => 'General syndication feeds settings',
     251        'ACP_FEED_MANAGEMENT_EXPLAIN'           => 'This module makes available various ATOM feeds, parsing any BBCode in posts to make them readable in external feeds.',
     252
     253        'ACP_FEED_GENERAL'                                      => 'General feed settings',
     254        'ACP_FEED_POST_BASED'                           => 'Post-based feed settings',
     255        'ACP_FEED_TOPIC_BASED'                          => 'Topic-based feed settings',
     256        'ACP_FEED_SETTINGS_OTHER'                       => 'Other feeds and settings',
     257
     258        'ACP_FEED_ENABLE'                                       => 'Enable feeds',
     259        'ACP_FEED_ENABLE_EXPLAIN'                       => 'Turns on or off ATOM feeds for the entire board.<br />Disabling this switches off all feeds, no matter how the options below are set.',
     260        'ACP_FEED_LIMIT'                                        => 'Number of items',
     261        'ACP_FEED_LIMIT_EXPLAIN'                        => 'The maximum number of feed items to display.',
     262
     263        'ACP_FEED_OVERALL'                                      => 'Enable board-wide feed',
     264        'ACP_FEED_OVERALL_EXPLAIN'                      => 'Board-wide new posts.',
     265        'ACP_FEED_FORUM'                                        => 'Enable per-forum feeds',
     266        'ACP_FEED_FORUM_EXPLAIN'                        => 'Single forum and subforums new posts.',
     267        'ACP_FEED_TOPIC'                                        => 'Enable per-topic feeds',
     268        'ACP_FEED_TOPIC_EXPLAIN'                        => 'Single topics new posts.',
     269
     270        'ACP_FEED_TOPICS_NEW'                           => 'Enable new topics feed',
     271        'ACP_FEED_TOPICS_NEW_EXPLAIN'           => 'Enables the “New Topics” feed, which displays the last created topics including the first post.',
     272        'ACP_FEED_TOPICS_ACTIVE'                        => 'Enable active topics feed',
     273        'ACP_FEED_TOPICS_ACTIVE_EXPLAIN'        => 'Enables the “Active Topics” feed, which displays the last active topics including the last post.',
     274        'ACP_FEED_NEWS'                                         => 'News feed',
     275        'ACP_FEED_NEWS_EXPLAIN'                         => 'Pull the first post from these forums. Select no forums to disable news feed.<br />Select multiple forums by holding <samp>CTRL</samp> and clicking.',
     276
     277        'ACP_FEED_OVERALL_FORUMS'                       => 'Enable forums feed',
     278        'ACP_FEED_OVERALL_FORUMS_EXPLAIN'       => 'Enables the “All forums” feed, which displays a list of forums.',
     279
     280        'ACP_FEED_HTTP_AUTH'                            => 'Allow HTTP Authentication',
     281        'ACP_FEED_HTTP_AUTH_EXPLAIN'            => 'Enables HTTP authentication, which allows users to receive content that is hidden to guest users by adding the <samp>auth=http</samp> parameter to the feed URL. Please note that some PHP setups require additional changes to the .htaccess file. Instructions can be found in that file.',
     282        'ACP_FEED_ITEM_STATISTICS'                      => 'Item statistics',
     283        'ACP_FEED_ITEM_STATISTICS_EXPLAIN'      => 'Display individual statistics underneath feed items<br />(e.g. posted by, date and time, replies, views)',
     284        'ACP_FEED_EXCLUDE_ID'                           => 'Exclude these forums',
     285        'ACP_FEED_EXCLUDE_ID_EXPLAIN'           => 'Content from these will be <strong>not included in feeds</strong>. Select no forum to pull data from all forums.<br />Select/Deselect multiple forums by holding <samp>CTRL</samp> and clicking.',
     286));
     287
    234288// Visual Confirmation Settings
    235289$lang = array_merge($lang, array(
    236         'ACP_VC_SETTINGS_EXPLAIN'               => 'Here you are able to define visual confirmation defaults and CAPTCHA settings.',
    237 
     290        'ACP_VC_SETTINGS_EXPLAIN'                               => 'Here you can select and configure CAPTCHA plugins, which implement various ways to reject registration attempts from so-called spambots.',
     291        'AVAILABLE_CAPTCHAS'                                    => 'Available plugins',
     292        'CAPTCHA_UNAVAILABLE'                                   => 'The CAPTCHA cannot be selected as its requirements are not met.',
    238293        'CAPTCHA_GD'                                                    => 'GD CAPTCHA',
     294        'CAPTCHA_GD_3D'                                                 => 'GD 3D Captcha',
    239295        'CAPTCHA_GD_FOREGROUND_NOISE'                   => 'GD CAPTCHA foreground noise',
    240296        'CAPTCHA_GD_EXPLAIN'                                    => 'Use GD to make a more advanced CAPTCHA.',
     
    244300        'CAPTCHA_GD_Y_GRID'                                             => 'GD CAPTCHA background noise y-axis',
    245301        'CAPTCHA_GD_Y_GRID_EXPLAIN'                             => 'Use lower settings of this to make the GD based CAPTCHA harder. 0 will disable y-axis background noise.',
    246 
     302        'CAPTCHA_GD_WAVE'                                               => 'GD CAPTCHA wave distortion',
     303        'CAPTCHA_GD_WAVE_EXPLAIN'                               => 'This applies a wave distortion to the CAPTCHA.',
     304        'CAPTCHA_GD_3D_NOISE'                                   => 'Add 3D-noise objects',
     305        'CAPTCHA_GD_3D_NOISE_EXPLAIN'                   => 'This adds additional objects to the CAPTCHA, over the letters.',
     306        'CAPTCHA_GD_FONTS'                                              => 'Use different fonts',
     307        'CAPTCHA_GD_FONTS_EXPLAIN'                              => 'This setting controls how many different letter shapes are used. You can just use the default shapes or introduce altered letters. Adding lowercase letters is also possible.',
     308        'CAPTCHA_FONT_DEFAULT'                                  => 'Default',
     309        'CAPTCHA_FONT_NEW'                                              => 'New Shapes',
     310        'CAPTCHA_FONT_LOWER'                                    => 'Also use lowercase',
     311        'CAPTCHA_NO_GD'                                                 => 'CAPTCHA without GD',
    247312        'CAPTCHA_PREVIEW_MSG'                                   => 'Your changes to the visual confirmation setting were not saved. This is just a preview.',
    248         'CAPTCHA_PREVIEW_EXPLAIN'                               => 'The CAPTCHA as it will look like using the current settings. Use the preview button to refresh. Note that captchas are randomized and will differ from one view to the next.',
     313        'CAPTCHA_PREVIEW_EXPLAIN'                               => 'The CAPTCHA as it would look like using the current selection.',
     314
     315        'CAPTCHA_SELECT'                                                => 'Installed CAPTCHA plugins',
     316        'CAPTCHA_SELECT_EXPLAIN'                                => 'The dropdown holds the CAPTCHA plugins recognized by the board. Gray entries are not available right now and might need configuration prior to use.',
     317        'CAPTCHA_CONFIGURE'                                             => 'Configure CAPTCHAs',
     318        'CAPTCHA_CONFIGURE_EXPLAIN'                             => 'Change the settings for the selected CAPTCHA.',
     319        'CONFIGURE'                                                             => 'Configure',
     320        'CAPTCHA_NO_OPTIONS'                                    => 'This CAPTCHA has no configuration options.',
     321
    249322        'VISUAL_CONFIRM_POST'                                   => 'Enable visual confirmation for guest postings',
    250323        'VISUAL_CONFIRM_POST_EXPLAIN'                   => 'Requires anonymous users to enter a random code matching an image to help prevent mass postings.',
    251324        'VISUAL_CONFIRM_REG'                                    => 'Enable visual confirmation for registrations',
    252325        'VISUAL_CONFIRM_REG_EXPLAIN'                    => 'Requires new users to enter a random code matching an image to help prevent mass registrations.',
     326        'VISUAL_CONFIRM_REFRESH'                                => 'Enable users to refresh the confirmation image',
     327        'VISUAL_CONFIRM_REFRESH_EXPLAIN'                => 'Allows users to request new confirmation codes, if they are unable to solve the VC during registration. Some plugins might not support this option.',
    253328));
    254329
     
    318393        'LDAP_NO_IDENTITY'                              => 'Could not find a login identity for %s.',
    319394        'LDAP_PASSWORD'                                 => 'LDAP password',
    320         'LDAP_PASSWORD_EXPLAIN'                 => 'Leave blank to use anonymous binding. Else fill in the password for the above user.  Required for Active Directory Servers. <strong>WARNING:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.',
     395        'LDAP_PASSWORD_EXPLAIN'                 => 'Leave blank to use anonymous binding. Else fill in the password for the above user. Required for Active Directory Servers.<br /><em><strong>Warning:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.</em>',
    321396        'LDAP_PORT'                                             => 'LDAP server port',
    322397        'LDAP_PORT_EXPLAIN'                             => 'Optionally you can specify a port which should be used to connect to the LDAP server instead of the default port 389.',
     
    336411
    337412        'ENABLE_GZIP'                           => 'Enable GZip compression',
    338         'ENABLE_GZIP_EXPLAIN'           => 'Generated content will be compressed prior to sending it to the user. This can reduce network traffic but will also increase CPU usage on both server and client side.',
     413        'ENABLE_GZIP_EXPLAIN'           => 'Generated content will be compressed prior to sending it to the user. This can reduce network traffic but will also increase CPU usage on both server and client side. Requires zlib PHP extension to be loaded.',
    339414        'FORCE_SERVER_VARS'                     => 'Force server URL settings',
    340415        'FORCE_SERVER_VARS_EXPLAIN'     => 'If set to yes the server settings defined here will be used in favour of the automatically determined values.',
     
    423498        'EMAIL_SIG_EXPLAIN'                             => 'This text will be attached to all e-mails the board sends.',
    424499        'ENABLE_EMAIL'                                  => 'Enable board-wide e-mails',
    425         'ENABLE_EMAIL_EXPLAIN'                  => 'If this is set to disabled no e-mails will be sent by the board at all.',
     500        'ENABLE_EMAIL_EXPLAIN'                  => 'If this is set to disabled no e-mails will be sent by the board at all. <em>Note the user and admin account activation settings require this setting to be enabled. If currently using “user” or “admin” activation in the activation settings, disabling this setting will require no activation of new accounts.</em>',
    426501        'SMTP_AUTH_METHOD'                              => 'Authentication method for SMTP',
    427502        'SMTP_AUTH_METHOD_EXPLAIN'              => 'Only used if a username/password is set, ask your provider if you are unsure which method to use.',
     
    430505        'SMTP_LOGIN'                                    => 'LOGIN',
    431506        'SMTP_PASSWORD'                                 => 'SMTP password',
    432         'SMTP_PASSWORD_EXPLAIN'                 => 'Only enter a password if your SMTP server requires it.',
     507        'SMTP_PASSWORD_EXPLAIN'                 => 'Only enter a password if your SMTP server requires it.<br /><em><strong>Warning:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.</em>',
    433508        'SMTP_PLAIN'                                    => 'PLAIN',
    434509        'SMTP_POP_BEFORE_SMTP'                  => 'POP-BEFORE-SMTP',
     
    453528        'JAB_PACKAGE_SIZE_EXPLAIN'      => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and will not be queued for later sending.',
    454529        'JAB_PASSWORD'                          => 'Jabber password',
     530        'JAB_PASSWORD_EXPLAIN'          => '<em><strong>Warning:</strong> This password will be stored as plain text in the database visible to everybody who can access your database or who can view this configuration page.</em>',
    455531        'JAB_PORT'                                      => 'Jabber port',
    456532        'JAB_PORT_EXPLAIN'                      => 'Leave blank unless you know it is not port 5222.',
  • trunk/forum/language/en/acp/common.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: common.php 9049 2008-11-05 22:03:16Z toonarmy $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    8989        'ACP_FORUM_MODERATORS'                  => 'Forum moderators',
    9090        'ACP_FORUM_PERMISSIONS'                 => 'Forum permissions',
     91        'ACP_FORUM_PERMISSIONS_COPY'    => 'Copy forum permissions',
    9192        'ACP_FORUM_ROLES'                               => 'Forum roles',
    9293
     
    149150        'ACP_RESTORE'                           => 'Restore',
    150151
     152        'ACP_FEED'                                      => 'Feed management',
     153        'ACP_FEED_SETTINGS'                     => 'Feed settings',
     154
    151155        'ACP_SEARCH'                            => 'Search configuration',
    152156        'ACP_SEARCH_INDEX'                      => 'Search index',
     
    154158
    155159        'ACP_SECURITY_SETTINGS'         => 'Security settings',
     160        'ACP_SEND_STATISTICS'           => 'Send statistical information',
    156161        'ACP_SERVER_CONFIGURATION'      => 'Server configuration',
    157162        'ACP_SERVER_SETTINGS'           => 'Server settings',
     
    161166        'ACP_STYLE_MANAGEMENT'          => 'Style management',
    162167        'ACP_STYLES'                            => 'Styles',
     168
     169        'ACP_SUBMIT_CHANGES'            => 'Submit changes',
    163170
    164171        'ACP_TEMPLATES'                         => 'Templates',
     
    182189        'ACP_USER_SECURITY'                             => 'User security',
    183190        'ACP_USER_SIG'                                  => 'Signature',
    184 
    185         'ACP_VC_SETTINGS'                                       => 'Visual confirmation settings',
     191        'ACP_USER_WARNINGS'                             => 'Warnings',
     192
     193        'ACP_VC_SETTINGS'                                       => 'CAPTCHA module settings',
    186194        'ACP_VC_CAPTCHA_DISPLAY'                        => 'CAPTCHA image preview',
    187195        'ACP_VERSION_CHECK'                                     => 'Check for updates',
     
    202210        'ADMIN_PANEL'                   => 'Administration Control Panel',
    203211
    204         'ADM_LOGOUT'                    => 'ACP Logout',
     212        'ADM_LOGOUT'                    => 'ACP&nbsp;Logout',
    205213        'ADM_LOGGED_OUT'                => 'Successfully logged out from Administration Control Panel',
    206214
     
    242250        'MANAGE'                                => 'Manage',
    243251        'MENU_TOGGLE'                   => 'Hide or display the side menu',
     252        'MORE'                                  => 'More',                      // Not used at the moment
     253        'MORE_INFORMATION'              => 'More information »',
    244254        'MOVE_DOWN'                             => 'Move down',
    245255        'MOVE_UP'                               => 'Move up',
     
    258268        'PERMISSIONS_TRANSFERRED'                       => 'Permissions transferred',
    259269        'PERMISSIONS_TRANSFERRED_EXPLAIN'       => 'You currently have the permissions from %1$s. You are able to browse the board with this user’s permissions, but not access the administration control panel since admin permissions were not transferred. You can <a href="%2$s"><strong>revert to your permission set</strong></a> at any time.',
    260         'PIXEL'                                                         => 'px',
    261270        'PROCEED_TO_ACP'                                        => '%sProceed to the ACP%s',
    262271
     
    268277        'SELECT_OPTION'                 => 'Select option',
    269278
    270         'SETTING_TOO_LOW'               => 'The entered value for the setting “%1$s” is too low. The minimal allowed value is %2$d.',
    271         'SETTING_TOO_BIG'               => 'The entered value for the setting “%1$s” is too big. The maximal allowed value is %2$d.',
    272         'SETTING_TOO_LONG'              => 'The entered value for the setting “%1$s” is too long. The maximal allowed length is %2$d.',
    273         'SETTING_TOO_SHORT'             => 'The entered value for the setting “%1$s” is not long enough. The minimal allowed length is %2$d.',
     279        'SETTING_TOO_LOW'               => 'The provided value for the setting “%1$s” is too low. The minimum acceptable value is %2$d.',
     280        'SETTING_TOO_BIG'               => 'The provided value for the setting “%1$s” is too high. The maximum acceptable value is %2$d.',
     281        'SETTING_TOO_LONG'              => 'The provided value for the setting “%1$s” is too long. The maximum acceptable length is %2$d.',
     282        'SETTING_TOO_SHORT'             => 'The provided value for the setting “%1$s” is too short. The minimum acceptable length is %2$d.',
     283
     284        'SHOW_ALL_OPERATIONS'   => 'Show all operations',
    274285
    275286        'UCP'                                   => 'User Control Panel',
     
    329340        'NUMBER_ORPHAN'         => 'Orphan attachments',
    330341
     342        'PHP_VERSION_OLD'       => 'The version of PHP on this server will no longer be supported by future versions of phpBB. %sDetails%s',
     343
    331344        'POSTS_PER_DAY'         => 'Posts per day',
    332345
     
    334347        'PURGE_CACHE_CONFIRM'   => 'Are you sure you wish to purge the cache?',
    335348        'PURGE_CACHE_EXPLAIN'   => 'Purge all cache related items, this includes any cached template files or queries.',
     349
     350        'PURGE_SESSIONS'                        => 'Purge all sessions',
     351        'PURGE_SESSIONS_CONFIRM'        => 'Are you sure you wish to purge all sessions? This will log out all users.',
     352        'PURGE_SESSIONS_EXPLAIN'        => 'Purge all sessions. This will log out all users by truncating the session table.',
    336353
    337354        'RESET_DATE'                                    => 'Reset board’s start date',
     
    358375        'USERS_PER_DAY'         => 'Users per day',
    359376
    360         'VALUE'                                 => 'Value',
    361         'VIEW_ADMIN_LOG'                => 'View administrator log',
    362         'VIEW_INACTIVE_USERS'   => 'View inactive users',
     377        'VALUE'                                         => 'Value',
     378        'VERSIONCHECK_FAIL'                     => 'Failed to obtain latest version information.',
     379        'VERSIONCHECK_FORCE_UPDATE'     => 'Re-Check version',
     380        'VIEW_ADMIN_LOG'                        => 'View administrator log',
     381        'VIEW_INACTIVE_USERS'           => 'View inactive users',
    363382
    364383        'WELCOME_PHPBB'                 => 'Welcome to phpBB',
     
    385404        'SORT_REASON'           => 'Reason',
    386405        'SORT_REG_DATE'         => 'Registration date',
     406        'SORT_LAST_REMINDER'=> 'Last reminded',
     407        'SORT_REMINDER'         => 'Reminder sent',
    387408
    388409        'USER_IS_INACTIVE'              => 'User is inactive',
     410));
     411
     412// Send statistics page
     413$lang = array_merge($lang, array(
     414        'EXPLAIN_SEND_STATISTICS'       => 'Please send information about your server and board configurations to phpBB for statistical analysis. All information that could identify you or your website has been removed - the data is entirely <strong>anonymous</strong>. We base decisions about future phpBB versions on this information. The statistics are made available publically. We also share this data with the PHP project, the programming language phpBB is made with.',
     415        'EXPLAIN_SHOW_STATISTICS'       => 'Using the button below you can preview all variables that will be transmitted.',
     416        'DONT_SEND_STATISTICS'          => 'Return to the ACP if you do not wish to send statistical information to phpBB.',
     417        'GO_ACP_MAIN'                           => 'Go to the ACP start page',
     418        'HIDE_STATISTICS'                       => 'Hide details',
     419        'SEND_STATISTICS'                       => 'Send statistical information',
     420        'SHOW_STATISTICS'                       => 'Show details',
     421        'THANKS_SEND_STATISTICS'        => 'Thank you for submitting your information.',
    389422));
    390423
     
    465498        'LOG_CONFIG_POST'                       => '<strong>Altered post settings</strong>',
    466499        'LOG_CONFIG_REGISTRATION'       => '<strong>Altered user registration settings</strong>',
     500        'LOG_CONFIG_FEED'                       => '<strong>Altered syndication feeds settings</strong>',
    467501        'LOG_CONFIG_SEARCH'                     => '<strong>Altered search settings</strong>',
    468502        'LOG_CONFIG_SECURITY'           => '<strong>Altered security settings</strong>',
     
    470504        'LOG_CONFIG_SETTINGS'           => '<strong>Altered board settings</strong>',
    471505        'LOG_CONFIG_SIGNATURE'          => '<strong>Altered signature settings</strong>',
    472         'LOG_CONFIG_VISUAL'                     => '<strong>Altered visual confirmation settings</strong>',
     506        'LOG_CONFIG_VISUAL'                     => '<strong>Altered antibot settings</strong>',
    473507
    474508        'LOG_APPROVE_TOPIC'                     => '<strong>Approved topic</strong><br />» %s',
    475509        'LOG_BUMP_TOPIC'                        => '<strong>User bumped topic</strong><br />» %s',
    476         'LOG_DELETE_POST'                       => '<strong>Deleted post</strong><br />» %s',
     510        'LOG_DELETE_POST'                       => '<strong>Deleted post “%1$s” written by</strong><br />» %2$s',
    477511        'LOG_DELETE_SHADOW_TOPIC'       => '<strong>Deleted shadow topic</strong><br />» %s',
    478         'LOG_DELETE_TOPIC'                      => '<strong>Deleted topic</strong><br />» %s',
     512        'LOG_DELETE_TOPIC'                      => '<strong>Deleted topic “%1$s” written by</strong><br />» %2$s',
    479513        'LOG_FORK'                                      => '<strong>Copied topic</strong><br />» from %s',
    480514        'LOG_LOCK'                                      => '<strong>Locked topic</strong><br />» %s',
     
    482516        'LOG_MERGE'                                     => '<strong>Merged posts</strong> into topic<br />» %s',
    483517        'LOG_MOVE'                                      => '<strong>Moved topic</strong><br />» from %1$s to %2$s',
     518        'LOG_PM_REPORT_CLOSED'          => '<strong>Closed PM report</strong><br />» %s',
     519        'LOG_PM_REPORT_DELETED'         => '<strong>Deleted PM report</strong><br />» %s',
    484520        'LOG_POST_APPROVED'                     => '<strong>Approved post</strong><br />» %s',
    485521        'LOG_POST_DISAPPROVED'          => '<strong>Disapproved post “%1$s” with the following reason</strong><br />» %2$s',
     
    512548
    513549        'LOG_FORUM_ADD'                                                 => '<strong>Created new forum</strong><br />» %s',
     550        'LOG_FORUM_COPIED_PERMISSIONS'                  => '<strong>Copied forum permissions</strong> from %1$s<br />» %2$s',
    514551        'LOG_FORUM_DEL_FORUM'                                   => '<strong>Deleted forum</strong><br />» %s',
    515552        'LOG_FORUM_DEL_FORUMS'                                  => '<strong>Deleted forum and its subforums</strong><br />» %s',
    516553        'LOG_FORUM_DEL_MOVE_FORUMS'                             => '<strong>Deleted forum and moved subforums</strong> to %1$s<br />» %2$s',
    517554        'LOG_FORUM_DEL_MOVE_POSTS'                              => '<strong>Deleted forum and moved posts </strong> to %1$s<br />» %2$s',
    518         'LOG_FORUM_DEL_MOVE_POSTS_FORUMS'               => '<strong>Deleted forum and its subforums, moved messages</strong> to %1$s<br />» %2$s',
     555        'LOG_FORUM_DEL_MOVE_POSTS_FORUMS'               => '<strong>Deleted forum and its subforums, moved posts</strong> to %1$s<br />» %2$s',
    519556        'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS'  => '<strong>Deleted forum, moved posts</strong> to %1$s <strong>and subforums</strong> to %2$s<br />» %3$s',
    520         'LOG_FORUM_DEL_POSTS'                                   => '<strong>Deleted forum and its messages</strong><br />» %s',
    521         'LOG_FORUM_DEL_POSTS_FORUMS'                    => '<strong>Deleted forum, its messages and subforums</strong><br />» %s',
    522         'LOG_FORUM_DEL_POSTS_MOVE_FORUMS'               => '<strong>Deleted forum and its messages, moved subforums</strong> to %1$s<br />» %2$s',
     557        'LOG_FORUM_DEL_POSTS'                                   => '<strong>Deleted forum and its posts</strong><br />» %s',
     558        'LOG_FORUM_DEL_POSTS_FORUMS'                    => '<strong>Deleted forum, its posts and subforums</strong><br />» %s',
     559        'LOG_FORUM_DEL_POSTS_MOVE_FORUMS'               => '<strong>Deleted forum and its posts, moved subforums</strong> to %1$s<br />» %2$s',
    523560        'LOG_FORUM_EDIT'                                                => '<strong>Edited forum details</strong><br />» %s',
    524561        'LOG_FORUM_MOVE_DOWN'                                   => '<strong>Moved forum</strong> %1$s <strong>below</strong> %2$s',
    525562        'LOG_FORUM_MOVE_UP'                                             => '<strong>Moved forum</strong> %1$s <strong>above</strong> %2$s',
    526563        'LOG_FORUM_SYNC'                                                => '<strong>Re-synchronised forum</strong><br />» %s',
     564
     565        'LOG_GENERAL_ERROR'     => '<strong>A general error occured</strong>: %1$s <br />» %2$s',
    527566
    528567        'LOG_GROUP_CREATED'             => '<strong>New usergroup created</strong><br />» %s',
     
    534573        'LOG_GROUP_UPDATED'             => '<strong>Usergroup details updated</strong><br />» %s',
    535574        'LOG_MODS_ADDED'                => '<strong>Added new leaders to usergroup</strong> %1$s<br />» %2$s',
     575        'LOG_USERS_ADDED'               => '<strong>Added new members to usergroup</strong> %1$s<br />» %2$s',
    536576        'LOG_USERS_APPROVED'    => '<strong>Users approved in usergroup</strong> %1$s<br />» %2$s',
    537         'LOG_USERS_ADDED'               => '<strong>Added new members to usergroup</strong> %1$s<br />» %2$s',
     577        'LOG_USERS_PENDING'             => '<strong>Users requested to join group “%1$s” and need to be approved</strong><br />» %2$s',
     578
     579        'LOG_IMAGE_GENERATION_ERROR'    => '<strong>Error while creating image</strong><br />» Error in %1$s on line %2$s: %3$s',
    538580
    539581        'LOG_IMAGESET_ADD_DB'                   => '<strong>Added new imageset to database</strong><br />» %s',
     
    604646
    605647        'LOG_PURGE_CACHE'                       => '<strong>Purged cache</strong>',
     648        'LOG_PURGE_SESSIONS'            => '<strong>Purged sessions</strong>',
     649
    606650
    607651        'LOG_RANK_ADDED'                => '<strong>Added new rank</strong><br />» %s',
     
    655699        'LOG_USER_DEL_ATTACH'   => '<strong>Removed all attachments made by the user</strong><br />» %s',
    656700        'LOG_USER_DEL_AVATAR'   => '<strong>Removed user avatar</strong><br />» %s',
     701        'LOG_USER_DEL_OUTBOX'   => '<strong>Emptied user outbox</strong><br />» %s',
    657702        'LOG_USER_DEL_POSTS'    => '<strong>Removed all posts made by the user</strong><br />» %s',
    658703        'LOG_USER_DEL_SIG'              => '<strong>Removed user signature</strong><br />» %s',
     
    661706        'LOG_USER_NEW_PASSWORD' => '<strong>Changed user password</strong><br />» %s',
    662707        'LOG_USER_REACTIVATE'   => '<strong>Forced user account reactivation</strong><br />» %s',
     708        'LOG_USER_REMOVED_NR'   => '<strong>Removed newly registered flag from user</strong><br />» %s',
     709
    663710        'LOG_USER_UPDATE_EMAIL' => '<strong>User “%1$s” changed e-mail</strong><br />» from “%2$s” to “%3$s”',
    664711        'LOG_USER_UPDATE_NAME'  => '<strong>Changed username</strong><br />» from “%1$s” to “%2$s”',
     
    684731        'LOG_USER_GROUP_RESIGN'                 => '<strong>User resigned membership from group</strong><br />» %s',
    685732
     733        'LOG_WARNING_DELETED'           => '<strong>Deleted user warning</strong><br />» %s',
     734        'LOG_WARNINGS_DELETED'          => '<strong>Deleted %2$s user warnings</strong><br />» %1$s', // Example: '<strong>Deleted 2 user warnings</strong><br />» username'
     735        'LOG_WARNINGS_DELETED_ALL'      => '<strong>Deleted all user warnings</strong><br />» %s',
     736
    686737        'LOG_WORD_ADD'                  => '<strong>Added word censor</strong><br />» %s',
    687738        'LOG_WORD_DELETE'               => '<strong>Deleted word censor</strong><br />» %s',
  • trunk/forum/language/en/acp/database.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: database.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    5555
    5656        'FILE_TYPE'                     => 'File type',
     57        'FILE_WRITE_FAIL'       => 'Unable to write file to storage folder.',
    5758        'FULL_BACKUP'           => 'Full',
    5859
  • trunk/forum/language/en/acp/forums.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: forums.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4545        'AUTO_PRUNE_VIEWED_EXPLAIN'     => 'Number of days since topic was viewed after which topic is removed.',
    4646
     47        'CONTINUE'                                              => 'Continue',
    4748        'COPY_PERMISSIONS'                              => 'Copy permissions from',
     49        'COPY_PERMISSIONS_EXPLAIN'              => 'To ease up the permission setup for your new forum, you can copy the permissions of an existing forum.',
    4850        'COPY_PERMISSIONS_ADD_EXPLAIN'  => 'Once created, the forum will have the same permissions as the one you select here. If no forum is selected the newly created forum will not be visible until permissions had been set.',
    4951        'COPY_PERMISSIONS_EDIT_EXPLAIN' => 'If you select to copy permissions, the forum will have the same permissions as the one you select here. This will overwrite any permissions you have previously set for this forum with the permissions of the forum you select here. If no forum is selected the current permissions will be kept.',
     52        'COPY_TO_ACL'                                   => 'Alternatively, you are also able to %sset up new permissions%s for this forum.',
    5053        'CREATE_FORUM'                                  => 'Create new forum',
    5154
     
    6366        'ENABLE_POST_REVIEW'                    => 'Enable post review',
    6467        'ENABLE_POST_REVIEW_EXPLAIN'    => 'If set to yes users are able to review their post if new posts were made to the topic while users wrote theirs. This should be disabled for chat forums.',
     68        'ENABLE_QUICK_REPLY'                    => 'Enable quick reply',
     69        'ENABLE_QUICK_REPLY_EXPLAIN'    => 'Enables the quick reply in this forum. This setting is not considered if the quick reply is disabled board wide. The quick reply will only be displayed for users who have permission to post in this forum.',
    6570        'ENABLE_RECENT'                                 => 'Display active topics',
    6671        'ENABLE_RECENT_EXPLAIN'                 => 'If set to yes topics made to this forum will be shown in the active topics list.',
     
    8287        'FORUM_IMAGE'                                           => 'Forum image',
    8388        'FORUM_IMAGE_EXPLAIN'                           => 'Location, relative to the phpBB root directory, of an additional image to associate with this forum.',
     89        'FORUM_IMAGE_NO_EXIST'                          => 'The specified forum image does not exist',
    8490        'FORUM_LINK_EXPLAIN'                            => 'Full URL (including the protocol, i.e.: <samp>http://</samp>) to the destination location that clicking this forum will take the user, e.g.: <samp>http://www.phpbb.com/</samp>.',
    8591        'FORUM_LINK_TRACK'                                      => 'Track link redirects',
     
    94100        'FORUM_PASSWORD_UNSET'                          => 'Remove forum password',
    95101        'FORUM_PASSWORD_UNSET_EXPLAIN'          => 'Check here if you want to remove the forum password.',
    96         'FORUM_PASSWORD_OLD'                            => 'The forum password is using an old encryption and should be changed.',
     102        'FORUM_PASSWORD_OLD'                            => 'The forum password is using an old hashing method and should be changed.',
    97103        'FORUM_PASSWORD_MISMATCH'                       => 'The passwords you entered did not match.',
    98104        'FORUM_PRUNE_SETTINGS'                          => 'Forum prune settings',
  • trunk/forum/language/en/acp/groups.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: groups.php 8911 2008-09-23 13:03:33Z acydburn $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    8989        'GROUP_MAX_RECIPIENTS'                  => 'Maximum number of allowed recipients per private message',
    9090        'GROUP_MAX_RECIPIENTS_EXPLAIN'  => 'The maximum number of allowed recipients in a private message. If 0 is entered, the board-wide setting is used.',
     91        'GROUP_OPTIONS_SAVE'                    => 'Group wide options',
    9192        'GROUP_PROMOTE'                                 => 'Promote to group leader',
    9293        'GROUP_RANK'                                    => 'Group rank',
     
    9596        'GROUP_REQUEST'                                 => 'Request',
    9697        'GROUP_SETTINGS_SAVE'                   => 'Group wide settings',
     98        'GROUP_SKIP_AUTH'                               => 'Exempt group leader from permissions',
     99        'GROUP_SKIP_AUTH_EXPLAIN'               => 'If enabled group leader no longer inherit permissions from the group.',
    97100        'GROUP_TYPE'                                    => 'Group type',
    98101        'GROUP_TYPE_EXPLAIN'                    => 'This determines which users can join or view this group.',
    99102        'GROUP_UPDATED'                                 => 'Group preferences updated successfully.',
    100        
     103
    101104        'GROUP_USERS_ADDED'                             => 'New users added to group successfully.',
    102105        'GROUP_USERS_EXIST'                             => 'The selected users are already members.',
  • trunk/forum/language/en/acp/language.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: language.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3838$lang = array_merge($lang, array(
    3939        'ACP_FILES'                                             => 'Admin language files',
    40         'ACP_LANGUAGE_PACKS_EXPLAIN'    => 'Here you are able to install/remove language packs.',
     40        'ACP_LANGUAGE_PACKS_EXPLAIN'    => 'Here you are able to install/remove language packs. The default language pack is marked with an asterisk (*).',
    4141
    4242        'EMAIL_FILES'                   => 'E-mail templates',
  • trunk/forum/language/en/acp/permissions.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: permissions.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    5151                <h2>Permission Masks</h2>
    5252                <p>These are used to view the effective permissions assigned to Users, Moderators (Local and Global), Administrators or Forums.</p>
    53        
     53
    5454                <br />
    5555
     
    7272        'ACL_TYPE_LOCAL_M_'             => 'Forum Moderator permissions',
    7373        'ACL_TYPE_LOCAL_F_'             => 'Forum permissions',
    74        
     74
    7575        'ACL_NO'                                => 'No',
    7676        'ACL_VIEW'                              => 'Viewing permissions',
     
    8181        'ACP_FORUM_MODERATORS_EXPLAIN'                          => 'Here you can assign users and groups as forum moderators. To assign users access to forums, to define global moderative permissions or administrators please use the appropriate page.',
    8282        'ACP_FORUM_PERMISSIONS_EXPLAIN'                         => 'Here you can alter which users and groups can access which forums. To assign moderators or define administrators please use the appropriate page.',
     83        'ACP_FORUM_PERMISSIONS_COPY_EXPLAIN'            => 'Here you can copy forum permissions from one forum to one or more other forums.',
    8384        'ACP_GLOBAL_MODERATORS_EXPLAIN'                         => 'Here you can assign global moderator permissions to users or groups. These moderators are like ordinary moderators except they have access to every forum on your board.',
    8485        'ACP_GROUPS_FORUM_PERMISSIONS_EXPLAIN'          => 'Here you can assign forum permissions to groups.',
    8586        'ACP_GROUPS_PERMISSIONS_EXPLAIN'                        => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual users permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.',
    86         'ACP_ADMIN_ROLES_EXPLAIN'                                       => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.',
    87         'ACP_FORUM_ROLES_EXPLAIN'                                       => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.',
    88         'ACP_MOD_ROLES_EXPLAIN'                                         => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.',
    89         'ACP_USER_ROLES_EXPLAIN'                                        => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.',
     87        'ACP_ADMIN_ROLES_EXPLAIN'                                       => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.',
     88        'ACP_FORUM_ROLES_EXPLAIN'                                       => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.',
     89        'ACP_MOD_ROLES_EXPLAIN'                                         => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.',
     90        'ACP_USER_ROLES_EXPLAIN'                                        => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.',
    9091        'ACP_USERS_FORUM_PERMISSIONS_EXPLAIN'           => 'Here you can assign forum permissions to users.',
    9192        'ACP_USERS_PERMISSIONS_EXPLAIN'                         => 'Here you can assign global permissions to users - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. To alter these settings for large numbers of users the Group permissions system is the preferred method. User’s permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.',
     
    110111        'AUTH_UPDATED'                          => 'Permissions have been updated.',
    111112
     113        'COPY_PERMISSIONS_CONFIRM'                              => 'Are you sure you wish to carry out this operation? Please be aware that this will overwrite any existing permissions on the selected targets.',
     114        'COPY_PERMISSIONS_FORUM_FROM_EXPLAIN'   => 'The source forum you want to copy permissions from.',
     115        'COPY_PERMISSIONS_FORUM_TO_EXPLAIN'             => 'The destination forums you want the copied permissions applied to.',
     116        'COPY_PERMISSIONS_FROM'                                 => 'Copy permissions from',
     117        'COPY_PERMISSIONS_TO'                                   => 'Apply permissions to',
     118
    112119        'CREATE_ROLE'                           => 'Create role',
    113120        'CREATE_ROLE_FROM'                      => 'Use settings from…',
     
    165172        'ROLE_FORUM_READONLY'           => 'Read Only Access',
    166173        'ROLE_FORUM_STANDARD'           => 'Standard Access',
     174        'ROLE_FORUM_NEW_MEMBER'         => 'Newly registered User',
    167175        'ROLE_MOD_FULL'                         => 'Full Moderator',
    168176        'ROLE_MOD_QUEUE'                        => 'Queue Moderator',
     
    174182        'ROLE_USER_NOPM'                        => 'No Private Messages',
    175183        'ROLE_USER_STANDARD'            => 'Standard Features',
     184        'ROLE_USER_NEW_MEMBER'          => 'Newly registered User',
     185
    176186
    177187        'ROLE_DESCRIPTION_ADMIN_FORUM'                  => 'Can access the forum management and forum permission settings.',
     
    188198        'ROLE_DESCRIPTION_FORUM_READONLY'               => 'Can read the forum, but cannot create new topics or reply to posts.',
    189199        'ROLE_DESCRIPTION_FORUM_STANDARD'               => 'Can use most forum features including attachments and deleting own topics, but cannot lock own topics, and cannot create polls.',
     200        'ROLE_DESCRIPTION_FORUM_NEW_MEMBER'             => 'A role for members of the special newly registered users group; contains <samp>NEVER</samp> permissions to lock features for new users.',
    190201        'ROLE_DESCRIPTION_MOD_FULL'                             => 'Can use all moderating features, including banning.',
    191202        'ROLE_DESCRIPTION_MOD_QUEUE'                    => 'Can use the Moderation Queue to validate and edit posts, but nothing else.',
     
    197208        'ROLE_DESCRIPTION_USER_NOPM'                    => 'Has a limited feature set, and is not allowed to use Private Messages.',
    198209        'ROLE_DESCRIPTION_USER_STANDARD'                => 'Can access most but not all user features. Cannot change user name or ignore the flood limit, for instance.',
    199        
     210        'ROLE_DESCRIPTION_USER_NEW_MEMBER'              => 'A role for members of the special newly registered users group; contains <samp>NEVER</samp> permissions to lock features for new users.',
     211
    200212        'ROLE_DESCRIPTION_EXPLAIN'              => 'You are able to enter a short explanation of what the role is doing or for what it is meant for. The text you enter here will be displayed within the permissions screens too.',
    201213        'ROLE_DESCRIPTION_LONG'                 => 'The role description is too long, please limit it to 4000 characters.',
     
    242254        'TRACE_USER_GLOBAL_NEVER_TOTAL_KEPT'    => 'The forum independent user permission evaluates to <samp>NEVER</samp> which doesn’t influence the local permission. %sTrace global permission%s',
    243255
    244         'TRACE_USER_FOUNDER'                                    => 'The user has the founder type set, therefore admin permissions are set to <samp>YES</samp> by default.',
     256        'TRACE_USER_FOUNDER'                                    => 'The user is a founder, therefore admin permissions are always set to <samp>YES</samp>.',
    245257        'TRACE_USER_KEPT'                                               => 'The user’s permission is <samp>NO</samp> so the old total value is kept.',
    246258        'TRACE_USER_KEPT_LOCAL'                                 => 'The user’s permission for this forum is <samp>NO</samp> so the old total value is kept.',
  • trunk/forum/language/en/acp/permissions_phpbb.php

    r400 r702  
    44*
    55* @package language
    6 * @version $Id: permissions_phpbb.php 8911 2008-09-23 13:03:33Z acydburn $
     6* @version $Id$
    77* @copyright (c) 2005 phpBB Group
    88* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    122122        'acl_u_pm_attach'       => array('lang' => 'Can attach files in private messages', 'cat' => 'pm'),
    123123        'acl_u_pm_download'     => array('lang' => 'Can download files in private messages', 'cat' => 'pm'),
    124         'acl_u_pm_bbcode'       => array('lang' => 'Can post BBCode in private messages', 'cat' => 'pm'),
    125         'acl_u_pm_smilies'      => array('lang' => 'Can post smilies in private messages', 'cat' => 'pm'),
    126         'acl_u_pm_img'          => array('lang' => 'Can post images in private messages', 'cat' => 'pm'),
    127         'acl_u_pm_flash'        => array('lang' => 'Can post Flash in private messages', 'cat' => 'pm'),
     124        'acl_u_pm_bbcode'       => array('lang' => 'Can use BBCode in private messages', 'cat' => 'pm'),
     125        'acl_u_pm_smilies'      => array('lang' => 'Can use smilies in private messages', 'cat' => 'pm'),
     126        'acl_u_pm_img'          => array('lang' => 'Can use [img] BBCode tag in private messages', 'cat' => 'pm'),
     127        'acl_u_pm_flash'        => array('lang' => 'Can use [flash] BBCode tag in private messages', 'cat' => 'pm'),
    128128
    129129        'acl_u_sendemail'       => array('lang' => 'Can send e-mails', 'cat' => 'misc'),
     
    152152        'acl_f_download'        => array('lang' => 'Can download files', 'cat' => 'content'),
    153153        'acl_f_sigs'            => array('lang' => 'Can use signatures', 'cat' => 'content'),
    154         'acl_f_bbcode'          => array('lang' => 'Can post BBCode', 'cat' => 'content'),
    155         'acl_f_smilies'         => array('lang' => 'Can post smilies', 'cat' => 'content'),
    156         'acl_f_img'                     => array('lang' => 'Can post images', 'cat' => 'content'),
    157         'acl_f_flash'           => array('lang' => 'Can post Flash', 'cat' => 'content'),
     154        'acl_f_bbcode'          => array('lang' => 'Can use BBCode', 'cat' => 'content'),
     155        'acl_f_smilies'         => array('lang' => 'Can use smilies', 'cat' => 'content'),
     156        'acl_f_img'                     => array('lang' => 'Can use [img] BBCode tag', 'cat' => 'content'),
     157        'acl_f_flash'           => array('lang' => 'Can use [flash] BBCode tag', 'cat' => 'content'),
    158158
    159159        'acl_f_edit'            => array('lang' => 'Can edit own posts', 'cat' => 'actions'),
  • trunk/forum/language/en/acp/posting.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: posting.php 8743 2008-08-12 16:03:18Z Kellanved $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4242        'ADD_BBCODE'                            => 'Add a new BBCode',
    4343
     44        'BBCODE_DANGER'                         => 'The BBCode you are trying to add seems to use a {TEXT} token inside a HTML attribute. This is a possible XSS security issue. Try using the more restrictive {SIMPLETEXT} or {INTTEXT} types instead. Only proceed if you understand the risks involved and you consider the use of {TEXT} absolutely unavoidable.',
     45        'BBCODE_DANGER_PROCEED'         => 'Proceed', //'I understand the risk',
     46
    4447        'BBCODE_ADDED'                          => 'BBCode added successfully.',
    4548        'BBCODE_EDITED'                         => 'BBCode edited successfully.',
     
    6972        'TOKEN'                                 => 'Token',
    7073        'TOKENS'                                => 'Tokens',
    71         'TOKENS_EXPLAIN'                => 'Tokens are placeholders for user input. The input will be validated only if it matches the corresponding definition. If needed, you can number them by adding a number as the last character between the braces, e.g. {TEXT1}, {TEXT2}.<br /><br />Within the HTML replacement you can also use any language string present in your language/ directory like this: {L_<em>&lt;STRINGNAME&gt;</em>} where <em>&lt;STRINGNAME&gt;</em> is the name of the translated string you want to add. For example, {L_WROTE} will be displayed as &quot;wrote&quot; or its translation according to user’s locale.<br /><br /><strong>Please note that only tokens listed below are able to be used within custom BBCodes.</strong>',
     74        'TOKENS_EXPLAIN'                => 'Tokens are placeholders for user input. The input will be validated only if it matches the corresponding definition. If needed, you can number them by adding a number as the last character between the braces, e.g. {TEXT1}, {TEXT2}.<br /><br />Within the HTML replacement you can also use any language string present in your language/ directory like this: {L_<em>&lt;STRINGNAME&gt;</em>} where <em>&lt;STRINGNAME&gt;</em> is the name of the translated string you want to add. For example, {L_WROTE} will be displayed as “wrote” or its translation according to user’s locale.<br /><br /><strong>Please note that only tokens listed below are able to be used within custom BBCodes.</strong>',
    7275        'TOKEN_DEFINITION'              => 'What can it be?',
    7376        'TOO_MANY_BBCODES'              => 'You cannot create any more BBCodes. Please remove one or more BBCodes then try again.',
    7477
    7578        'tokens'        =>      array(
    76                 'TEXT'                  => 'Any text, including foreign characters, numbers, etc… You should not use this token in HTML tags. Instead try to use IDENTIFIER or SIMPLETEXT.',
     79                'TEXT'                  => 'Any text, including foreign characters, numbers, etc… You should not use this token in HTML tags. Instead try to use IDENTIFIER, INTTEXT or SIMPLETEXT.',
    7780                'SIMPLETEXT'    => 'Characters from the latin alphabet (A-Z), numbers, spaces, commas, dots, minus, plus, hyphen and underscore',
     81                'INTTEXT'               => 'Unicode letter characters, numbers, spaces, commas, dots, minus, plus, hyphen, underscore and whitespaces.',
    7882                'IDENTIFIER'    => 'Characters from the latin alphabet (A-Z), numbers, hyphen and underscore',
    7983                'NUMBER'                => 'Any series of digits',
    8084                'EMAIL'                 => 'A valid e-mail address',
    81                 'URL'                   => 'A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, &quot;http://&quot; is prefixed to the string.',
     85                'URL'                   => 'A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, “http://” is prefixed to the string.',
    8286                'LOCAL_URL'             => 'A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol.',
    8387                'COLOR'                 => 'A HTML colour, can be either in the numeric form <samp>#FF1234</samp> or a <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-color">CSS colour keyword</a> such as <samp>fuchsia</samp> or <samp>InactiveBorder</samp>'
     
    181185        'SMILIES_WIDTH'                         => 'Smiley width',
    182186
     187        'TOO_MANY_SMILIES'                      => 'Limit of %d smilies reached.',
     188
    183189        'WRONG_PAK_TYPE'        => 'The specified package does not contain the appropriate data.',
    184190));
     
    186192// Word censors
    187193$lang = array_merge($lang, array(
    188         'ACP_WORDS_EXPLAIN'             => 'From this control panel you can add, edit, and remove words that will be automatically censored on your forums. In addition people will not be allowed to register with usernames containing these words. Wildcards (*) are accepted in the word field, e.g. *test* will match detestable, test* would match testing, *test would match detest.',
     194        'ACP_WORDS_EXPLAIN'             => 'From this control panel you can add, edit, and remove words that will be automatically censored on your forums. People are still allowed to register with usernames containing these words. Wildcards (*) are accepted in the word field, e.g. *test* will match detestable, test* would match testing, *test would match detest.',
    189195        'ADD_WORD'                              => 'Add new word',
    190196
     
    218224        'RANK_IMAGE'                    => 'Rank image',
    219225        'RANK_IMAGE_EXPLAIN'    => 'Use this to define a small image associated with the rank. The path is relative to the root phpBB directory.',
     226        'RANK_IMAGE_IN_USE'             => '(In use)',
    220227        'RANK_MINIMUM'                  => 'Minimum posts',
    221228        'RANK_REMOVED'                  => 'The rank was successfully deleted.',
  • trunk/forum/language/en/acp/profile.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: profile.php 9128 2008-11-26 20:10:29Z acydburn $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    6767        'DISPLAY_AT_REGISTER'                   => 'Display on registration screen',
    6868        'DISPLAY_AT_REGISTER_EXPLAIN'   => 'If this option is enabled, the field will be displayed on registration.',
    69         'DISPLAY_PROFILE_FIELD'                 => 'Display profile field',
     69        'DISPLAY_ON_VT'                                 => 'Display on viewtopic screen',
     70        'DISPLAY_ON_VT_EXPLAIN'                 => 'If this option is enabled, the field will be displayed in the mini-profile on the topic screen.',
     71        'DISPLAY_PROFILE_FIELD'                 => 'Publicly display profile field',
    7072        'DISPLAY_PROFILE_FIELD_EXPLAIN' => 'The profile field will be shown in all locations allowed within the load settings. Setting this to “no” will hide the field from topic pages, profiles and the memberlist.',
    7173        'DROPDOWN_ENTRIES_EXPLAIN'              => 'Enter your options now, every option in one line.',
  • trunk/forum/language/en/acp/prune.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: prune.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    3838// User pruning
    3939$lang = array_merge($lang, array(
    40         'ACP_PRUNE_USERS_EXPLAIN'       => 'Here you can delete (or deactivate) users from your board. This can be done in a variety of ways; by post count, last activity, etc. Each of these criteria can be combined, i.e. you can prune users last active before 2002-01-01 with fewer than 10 posts. Alternatively you can enter a list of users directly into the text box, any criteria entered will be ignored. Take care with this facility! Once a user is deleted there is no way back.',
     40        'ACP_PRUNE_USERS_EXPLAIN'       => 'This section allows you to delete or deactivate users on your board. Accounts can be filtered in a variety of ways; by post count, most recent activity, etc. Criteria may be combined to narrow down which accounts are affected. For example, you can prune users with fewer than 10 posts, who were also inactive after 2002-01-01. Alternatively, you may skip the criteria selection completely by entering a list of users (each on a separate line) into the text field. Take care with this facility! Once a user is deleted, there is no way to reverse the action.',
    4141
    4242        'DEACTIVATE_DELETE'                     => 'Deactivate or delete',
    43         'DEACTIVATE_DELETE_EXPLAIN'     => 'Choose whether to deactivate users or delete them entirely, note there is no undo!',
     43        'DEACTIVATE_DELETE_EXPLAIN'     => 'Choose whether to deactivate users or delete them entirely. Please note that deleted users cannot be restored!',
    4444        'DELETE_USERS'                          => 'Delete',
    4545        'DELETE_USER_POSTS'                     => 'Delete pruned user posts',
     
    4848        'JOINED_EXPLAIN'                        => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format.',
    4949
    50         'LAST_ACTIVE_EXPLAIN'           => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format.',
     50        'LAST_ACTIVE_EXPLAIN'           => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format. Enter <kbd>0000-00-00</kbd> to prune users who never logged in, <em>Before</em> and <em>After</em> conditions will be ignored.',
    5151
    5252        'PRUNE_USERS_LIST'                              => 'Users to be pruned',
     
    5454        'PRUNE_USERS_LIST_DEACTIVATE'   => 'With the selected critera for pruning users the following accounts will be deactivated.',
    5555
    56         'SELECT_USERS_EXPLAIN'          => 'Enter specific usernames here, they will be used in preference to the criteria above.',
     56        'SELECT_USERS_EXPLAIN'          => 'Enter specific usernames here, they will be used in preference to the criteria above. Founders cannot be pruned.',
    5757
    5858        'USER_DEACTIVATE_SUCCESS'       => 'The selected users have been deactivated successfully.',
  • trunk/forum/language/en/acp/search.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: search.php 9126 2008-11-26 19:17:52Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    7373        'MAX_SEARCH_CHARS'                                              => 'Max characters indexed by search',
    7474        'MAX_SEARCH_CHARS_EXPLAIN'                              => 'Words with no more than this many characters will be indexed for searching.',
     75        'MAX_NUM_SEARCH_KEYWORDS'                               => 'Maximum number of allowed keywords',
     76        'MAX_NUM_SEARCH_KEYWORDS_EXPLAIN'               => 'Maximum number of words the user is able to search for. A value of 0 allows an unlimited number of words.',
    7577        'MIN_SEARCH_CHARS'                                              => 'Min characters indexed by search',
    7678        'MIN_SEARCH_CHARS_EXPLAIN'                              => 'Words with at least this many characters will be indexed for searching.',
  • trunk/forum/language/en/acp/styles.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: styles.php 9046 2008-11-02 16:19:11Z acydburn $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    393393        'TEMPLATE_LOCATION_EXPLAIN'     => 'Images are always stored on the filesystem.',
    394394        'TEMPLATE_NAME'                         => 'Template name',
     395        'TEMPLATE_FILE_NOT_WRITABLE'=> 'Unable to write to template file %s. Please check the permissions for the directory and the files.',
    395396        'TEMPLATE_REFRESHED'            => 'Template refreshed successfully.',
    396397
  • trunk/forum/language/en/acp/users.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: users.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    7878
    7979        'NO_SPECIAL_RANK'               => 'No special rank assigned',
     80        'NO_WARNINGS'                   => 'No warnings.',
    8081        'NOT_MANAGE_FOUNDER'    => 'You tried to manage a user with founder status. Only founders are allowed to manage other founders.',
    8182
     
    103104        'USER_ADMIN_DEL_ATTACH'                 => 'Delete all attachments',
    104105        'USER_ADMIN_DEL_AVATAR'                 => 'Delete avatar',
     106        'USER_ADMIN_DEL_OUTBOX'                 => 'Empty PM outbox',
    105107        'USER_ADMIN_DEL_POSTS'                  => 'Delete all posts',
    106108        'USER_ADMIN_DEL_SIG'                    => 'Delete signature',
    107109        'USER_ADMIN_EXPLAIN'                    => 'Here you can change your users information and certain specific options.',
    108110        'USER_ADMIN_FORCE'                              => 'Force reactivation',
     111        'USER_ADMIN_LEAVE_NR'                   => 'Remove from Newly Registered',
    109112        'USER_ADMIN_MOVE_POSTS'                 => 'Move all posts',
    110113        'USER_ADMIN_SIG_REMOVED'                => 'Successfully removed signature from user account.',
    111114        'USER_ATTACHMENTS_REMOVED'              => 'Successfully removed all attachments made by this user.',
     115        'USER_AVATAR_NOT_ALLOWED'               => 'The avatar cannot be displayed because avatars have been disallowed.',
    112116        'USER_AVATAR_UPDATED'                   => 'Successfully updated user avatars details.',
     117        'USER_AVATAR_TYPE_NOT_ALLOWED'  => 'The current avatar cannot be displayed because its type has been disallowed.',
    113118        'USER_CUSTOM_PROFILE_FIELDS'    => 'Custom profile fields',
    114119        'USER_DELETED'                                  => 'User deleted successfully.',
     
    117122        'USER_GROUP_PENDING'                    => 'Groups user is in pending mode',
    118123        'USER_GROUP_SPECIAL'                    => 'Pre-defined groups user is a member of',
     124        'USER_LIFTED_NR'                                => 'Successfully removed the user’s newly registered status.',
    119125        'USER_NO_ATTACHMENTS'                   => 'There are no attached files to display.',
     126        'USER_OUTBOX_EMPTIED'                   => 'Successfully emptied user’s private message outbox.',
     127        'USER_OUTBOX_EMPTY'                             => 'The user’s private message outbox was already empty.',
    120128        'USER_OVERVIEW_UPDATED'                 => 'User details updated.',
    121129        'USER_POSTS_DELETED'                    => 'Successfully removed all posts made by this user.',
     
    127135        'USER_RANK_UPDATED'                             => 'User rank updated.',
    128136        'USER_SIG_UPDATED'                              => 'User signature successfully updated.',
     137        'USER_WARNING_LOG_DELETED'              => 'No information available. Possibly the log entry has been deleted.',
    129138        'USER_TOOLS'                                    => 'Basic tools',
    130139));
  • trunk/forum/language/en/common.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: common.php 9162 2008-12-03 11:18:31Z acydburn $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    8888        'AVATAR_PARTIAL_UPLOAD'                 => 'The specified file was only partially uploaded.',
    8989        'AVATAR_PHP_SIZE_NA'                    => 'The avatar’s filesize is too large.<br />The maximum allowed filesize set in php.ini could not be determined.',
    90         'AVATAR_PHP_SIZE_OVERRUN'               => 'The avatar’s filesize is too large. The maximum allowed upload size is %d MB.<br />Please note this is set in php.ini and cannot be overridden.',
     90        'AVATAR_PHP_SIZE_OVERRUN'               => 'The avatar’s filesize is too large. The maximum allowed upload size is %1$d %2$s.<br />Please note this is set in php.ini and cannot be overridden.',
    9191        'AVATAR_URL_INVALID'                    => 'The URL you specified is invalid.',
    9292        'AVATAR_URL_NOT_FOUND'                  => 'The file specified could not be found.',
     
    159159
    160160        'EDIT_POST'                                                     => 'Edit post',
    161         'EMAIL'                                                         => 'E-mail',
     161        'EMAIL'                                                         => 'E-mail', // Short form for EMAIL_ADDRESS
    162162        'EMAIL_ADDRESS'                                         => 'E-mail address',
    163163        'EMAIL_SMTP_ERROR_RESPONSE'                     => 'Ran into problems sending e-mail at <strong>Line %1$s</strong>. Response: %2$s.',
     
    229229
    230230        'GENERAL_ERROR'                         => 'General Error',
     231        'GB'                                            => 'GB',
     232        'GIB'                                           => 'GiB',
    231233        'GO'                                            => 'Go',
    232234        'GOTO_PAGE'                                     => 'Go to page',
     
    249251        'G_REGISTERED_COPPA'            => 'Registered COPPA users',
    250252        'G_GLOBAL_MODERATORS'           => 'Global moderators',
     253        'G_NEWLY_REGISTERED'            => 'Newly registered users',
    251254
    252255        'HIDDEN_USERS_ONLINE'                   => '%d hidden users online',
     
    382385        'NO_POSTS'                                      => 'No posts',
    383386        'NO_POSTS_TIME_FRAME'           => 'No posts exist inside this topic for the selected time frame.',
     387        'NO_FEED_ENABLED'                       => 'Feeds are not available on this board.',
     388        'NO_FEED'                                       => 'The requested feed is not available.',
    384389        'NO_SUBJECT'                            => 'No subject specified',                                                              // Used for posts having no subject defined but displayed within management pages.
    385390        'NO_SUCH_SEARCH_MODULE'         => 'The specified search backend doesn’t exist.',
     
    413418        'PAGE_OF'                               => 'Page <strong>%1$d</strong> of <strong>%2$d</strong>',
    414419        'PASSWORD'                              => 'Password',
     420        'PIXEL'                                 => 'px',
    415421        'PLAY_QUICKTIME_FILE'   => 'Play Quicktime file',
    416422        'PM'                                    => 'PM',
     
    485491        'RETURN_TOPIC'                          => '%sReturn to the topic last visited%s',
    486492        'RETURN_TO'                                     => 'Return to',
     493        'FEED'                                          => 'Feed',
     494        'FEED_NEWS'                                     => 'News',
     495        'FEED_TOPICS_ACTIVE'            => 'Active Topics',
     496        'FEED_TOPICS_NEW'                       => 'New Topics',
    487497        'RULES_ATTACH_CAN'                      => 'You <strong>can</strong> post attachments in this forum',
    488498        'RULES_ATTACH_CANNOT'           => 'You <strong>cannot</strong> post attachments in this forum',
     
    516526        'SEARCH_TOPIC'                          => 'Search this topic…',
    517527        'SEARCH_UNANSWERED'                     => 'View unanswered posts',
     528        'SEARCH_UNREAD'                         => 'View unread posts',
    518529        'SECONDS'                                       => 'Seconds',
    519530        'SELECT'                                        => 'Select',
     
    521532        'SELECT_DESTINATION_FORUM'      => 'Please select a destination forum',
    522533        'SELECT_FORUM'                          => 'Select a forum',
    523         'SEND_EMAIL'                            => 'E-mail',
     534        'SEND_EMAIL'                            => 'E-mail',                            // Used for submit buttons
    524535        'SEND_EMAIL_USER'                       => 'E-mail',                            // Used as: {L_SEND_EMAIL_USER} {USERNAME} -> E-mail UserX
    525536        'SEND_PRIVATE_MESSAGE'          => 'Send private message',
     
    534545        'SORT_LOCATION'                         => 'Location',
    535546        'SORT_RANK'                                     => 'Rank',
     547        'SORT_POSTS'                            => 'Posts',
    536548        'SORT_TOPIC_TITLE'                      => 'Topic title',
    537549        'SORT_USERNAME'                         => 'Username',
     
    597609        'TOPIC'                         => 'Topic',
    598610        'TOPICS'                        => 'Topics',
     611        'TOPICS_UNAPPROVED'     => 'At least one topic in this forum has not been approved.',
    599612        'TOPIC_ICON'            => 'Topic icon',
    600613        'TOPIC_LOCKED'          => 'This topic is locked, you cannot edit posts or make further replies.',
     
    642655        'USERS'                                 => 'Users',
    643656        'USE_PERMISSIONS'               => 'Test out user’s permissions',
     657
     658        'USER_NEW_PERMISSION_DISALLOWED'        => 'We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more to be able to use this feature.',
    644659
    645660        'VARIANT_DATE_SEPARATOR'        => ' / ',       // Used in date format dropdown, eg: "Today, 13:37 / 01 Jan 2007, 13:37" ... to join a relative date with calendar date
  • trunk/forum/language/en/email/admin_welcome_activated.txt

    r400 r702  
    33Hello {USERNAME},
    44
    5 Your account on "{SITENAME}" has now been activated, you may login using the username and password you received in a previous e-mail.
     5Your account on "{SITENAME}" has now been activated, you may login using the username you received in a previous e-mail.
     6
     7Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
    68
    79{EMAIL_SIG}
  • trunk/forum/language/en/email/admin_welcome_inactive.txt

    r400 r702  
    77----------------------------
    88Username: {USERNAME}
    9 Password: {PASSWORD}
    109
    1110Board URL: {U_BOARD}
    1211----------------------------
    1312
    14 Your account is currently inactive, the administrator of the board will need to activate it before you can log in. You will receive another e-mail when this has occurred.
     13Your account is currently inactive and will need to be approved by an administrator before you can log in. Another email will be sent when this has occured.
    1514
    16 Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
     15Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
    1716
    1817Thank you for registering.
  • trunk/forum/language/en/email/coppa_resend_inactive.txt

    r400 r702  
    33{WELCOME_MSG}
    44
    5 In compliance with the COPPA your account is currently inactive.
     5In compliance with the COPPA, your account is currently inactive.
    66
    7 Please print this message out and have your parent or guardian sign and date it. Then fax it to:
     7Please print this message and have your parent or guardian sign and date it. Then fax it to:
    88
    99{FAX_INFO}
     
    3434
    3535
    36 Once the administrator has received the above form via fax or regular mail your account will be activated.
     36Once the administrator has received the above form via fax or regular mail, your account will be activated.
    3737
    38 Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
     38Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
    3939
    4040Thank you for registering.
  • trunk/forum/language/en/email/coppa_welcome_inactive.txt

    r400 r702  
    33{WELCOME_MSG}
    44
    5 In compliance with the COPPA your account is currently inactive.
     5In compliance with the COPPA, your account is currently inactive.
    66
    7 Please print this message out and have your parent or guardian sign and date it. Then fax it to:
     7Please print this message and have your parent or guardian sign and date it. Then fax it to:
    88
    99{FAX_INFO}
     
    1717
    1818Username: {USERNAME}
    19 Password: {PASSWORD}
    2019E-mail: {EMAIL_ADDRESS}
    2120
     
    3534
    3635
    37 Once the administrator has received the above form via fax or regular mail your account will be activated.
     36Once the administrator has received the above form via fax or regular mail, your account will be activated.
    3837
    39 Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
     38Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
    4039
    4140Thank you for registering.
  • trunk/forum/language/en/email/installed.txt

    r400 r702  
    55You have successfully installed phpBB on your server.
    66
    7 This e-mail contains important information on your installation that you should keep safe. The password has been encrypted in the database and cannot be recovered, although you can request a new password should you lose this one.
     7This e-mail contains important information regarding your installation and should be kept for reference. Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
    88
    99----------------------------
    1010Username: {USERNAME}
    11 Password: {PASSWORD}
    1211
    1312Board URL: {U_BOARD}
    1413----------------------------
    1514
    16 Useful information on your phpBB installation can be found in the docs folder of your installation and on phpBB.com's support page - http://www.phpbb.com/support/
     15Useful information regarding the phpBB software can be found in the docs folder of your installation and on phpBB.com's support page - http://www.phpbb.com/support/
    1716
    18 In order to keep the board safe and secure, it is highly recommended that you keep current with software releases which can be easily done by subscribing to phpBB.com's mailing list, located at the above URL.
     17In order to keep your board safe and secure, we highly recommended keeping current with software releases. For your convenience, a mailing list is available at the page referenced above.
    1918
    2019{EMAIL_SIG}
  • trunk/forum/language/en/email/newtopic_notify.txt

    r400 r702  
    33Hello {USERNAME},
    44
    5 You are receiving this notification because you are watching the forum, "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic since your last visit, "{TOPIC_TITLE}". You can use the following link to view forum, no more notifications will be sent until you visit the forum.
     5You are receiving this notification because you are watching the forum, "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.
    66
    77{U_FORUM}
  • trunk/forum/language/en/email/user_reactivate_account.txt

    r400 r702  
    1010----------------------------
    1111
    12 Your password has been encrypted in our database. Should you forget your password you can request a new one which will be activated in the same way as this account.
     12Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
    1313
    1414Please visit the following link to reactivate your account:
  • trunk/forum/language/en/email/user_remind_inactive.txt

    r400 r702  
    33Hello {USERNAME},
    44
    5 On {REGISTER_DATE} you registered a new account at "{SITENAME}". To date you have not activated this account which is a prerequisite for board login. For your convenience the activation link is repeated below.
     5This notification is a reminder that your account at "{SITENAME}", created on {REGISTER_DATE}, remains inactive. If you would like to activate this account, please visit the following link:
    66
    77{U_ACTIVATE}
  • trunk/forum/language/en/email/user_resend_inactive.txt

    r400 r702  
    99----------------------------
    1010
    11 Your password has been encrypted in our database. Should you forget your password you can request a new one which will be activated in the same way as this account.
     11Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
    1212
    13 Your account is currently inactive. You cannot use it until you visit the following link:
     13Please visit the following link in order to activate your account:
    1414
    1515{U_ACTIVATE}
  • trunk/forum/language/en/email/user_welcome.txt

    r400 r702  
    77----------------------------
    88Username: {USERNAME}
    9 Password: {PASSWORD}
    109
    1110Board URL: {U_BOARD}
    1211----------------------------
    1312
    14 Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
     13Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
    1514
    1615Thank you for registering.
  • trunk/forum/language/en/email/user_welcome_inactive.txt

    r400 r702  
    77----------------------------
    88Username: {USERNAME}
    9 Password: {PASSWORD}
    109
    1110Board URL: {U_BOARD}
    1211----------------------------
    1312
    14 Your account is currently inactive. You cannot use it until you visit the following link:
     13Please visit the following link in order to activate your account:
    1514
    1615{U_ACTIVATE}
    1716
    18 Please do not forget your password as it has been encrypted in our database and we cannot retrieve it for you. However, should you forget your password you can request a new one which will be activated in the same way as this account.
     17Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
    1918
    2019Thank you for registering.
  • trunk/forum/language/en/help_bbcode.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: help_bbcode.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    7777        array(
    7878                0 => 'Creating an Ordered list',
    79                 1 => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: arabic-numbers"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>'
     79                1 => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: decimal;"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>'
     80        ),
     81        // This block will switch the FAQ-Questions to the second template column
     82        array(
     83                0 => '--',
     84                1 => '--'
    8085        ),
    8186        array(
  • trunk/forum/language/en/help_faq.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: help_faq.php 8896 2008-09-19 16:59:40Z acydburn $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    9696        ),
    9797        array(
    98                 0 => 'How do I show an image below my username?',
    99                 1 => 'There are two images that may appear below a username when viewing posts. Depending on the used style, the first may be an image associated with your rank, generally in the form of stars, blocks or dots, indicating how many posts you have made or your status on the board. The second, usually a larger image, is known as an avatar and is generally unique or personal to each user. It is up to the board administrator to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrator and ask them for their reasons.'
     98                0 => 'How do I show an image along with my username?',
     99                1 => 'There are two images which may appear along with a username when viewing posts. One of them may be an image associated with your rank, generally in the form of stars, blocks or dots, indicating how many posts you have made or your status on the board. Another, usually a larger image, is known as an avatar and is generally unique or personal to each user. It is up to the board administrator to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrator and ask them for their reasons.'
    100100        ),
    101101        array(
     
    117117        array(
    118118                0 => 'How do I edit or delete a post?',
    119                 1 => 'Unless you are a board administrator or moderator, you can only edit or delete your own posts. You can edit a post by clicking the edit button for the relevant post, sometimes for only a limited time after the post was made. If someone has already replied to the post, you will find a small piece of text output below the post when you return to the topic which lists the number of times you edited it along with the date and time. This will only appear if someone has made a reply; it will not appear if a moderator or administrator edited the post, though they may leave a note as to why they’ve edited the post at their own digression. Please note that normal users cannot delete a post once someone has replied.'
     119                1 => 'Unless you are a board administrator or moderator, you can only edit or delete your own posts. You can edit a post by clicking the edit button for the relevant post, sometimes for only a limited time after the post was made. If someone has already replied to the post, you will find a small piece of text output below the post when you return to the topic which lists the number of times you edited it along with the date and time. This will only appear if someone has made a reply; it will not appear if a moderator or administrator edited the post, though they may leave a note as to why they’ve edited the post at their own discretion. Please note that normal users cannot delete a post once someone has replied.'
    120120        ),
    121121        array(
     
    202202                0 => 'What are topic icons?',
    203203                1 => 'Topic icons are author chosen images associated with posts to indicate their content. The ability to use topic icons depends on the permissions set by the board administrator.'
     204        ),
     205        // This block will switch the FAQ-Questions to the second template column
     206        array(
     207                0 => '--',
     208                1 => '--'
    204209        ),
    205210        array(
  • trunk/forum/language/en/install.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: install.php 9177 2008-12-05 11:36:51Z acydburn $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    134134        'DB_PORT'                                       => 'Database server port',
    135135        'DB_PORT_EXPLAIN'                       => 'Leave this blank unless you know the server operates on a non-standard port.',
     136        'DB_UPDATE_NOT_SUPPORTED'       => 'We are sorry, but this script does not support updating from versions of phpBB prior to “%1$s”. The version you currently have installed is “%2$s”. Please update to a previous version before running this script. Assistance with this is available in the Support Forum on phpBB.com.',
    136137        'DB_USERNAME'                           => 'Database username',
    137138        'DB_TEST'                                       => 'Test connection',
     
    167168        'FILLING_TABLE'                         => 'Filling table <strong>%s</strong>',
    168169        'FILLING_TABLES'                        => 'Filling tables',
     170
     171        'FIREBIRD_DBMS_UPDATE_REQUIRED'         => 'phpBB no longer supports Firebird/Interbase prior to Version 2.1. Please update your Firebird installation to at least 2.1.0 before proceeding with the update.',
     172
    169173        'FINAL_STEP'                            => 'Process final step',
    170174        'FORUM_ADDRESS'                         => 'Board address',
     
    185189        'INSTALL_CONGRATS'                      => 'Congratulations!',
    186190        'INSTALL_CONGRATS_EXPLAIN'      => '
    187                 <p>You have now successfully installed phpBB %1$s. From here, you have two options as to what to do with your newly installed phpBB3:</p>
     191                You have successfully installed phpBB %1$s. Please proceed by choosing one of the following options:</p>
    188192                <h2>Convert an existing board to phpBB3</h2>
    189                 <p>The phpBB Unified Convertor Framework supports the conversion of phpBB 2.0.x and other board systems to phpBB3. If you have an existing board that you wish to convert, please <a href="%2$s">proceed on to the convertor</a>.</p>
     193                <p>The phpBB Unified Convertor Framework supports the conversion of phpBB 2.0.x and other board systems to phpBB3. If you have an existing board that you wish to convert, please <a href="%2$s">proceed to the convertor</a>.</p>
    190194                <h2>Go live with your phpBB3!</h2>
    191                 <p>Clicking the button below will take you to your Administration Control Panel (ACP). Take some time to examine the options available to you. Remember that help is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Documentation</a> and the <a href="http://www.phpbb.com/community/viewforum.php?f=46">support forums</a>, see the <a href="%3$s">README</a> for further information.</p><p><strong>Please now delete, move or rename the install directory before you use your board. If this directory is still present, only the Administration Control Panel (ACP) will be accessible.</strong></p>',
     195                <p>Clicking the button below will take you to a form for submitting statistical data to phpBB in your Administration Control Panel (ACP). We would appreciate it if you could help us by sending that information. Afterwards you should take some time to examine the options available to you. Remember that help is available online via the <a href="http://www.phpbb.com/support/documentation/3.0/">Documentation</a>, <a href="%3$s">README</a> and the <a href="http://www.phpbb.com/community/viewforum.php?f=46">Support Forums</a>.</p><p><strong>Please delete, move or rename the install directory before using your board. While this directory exists, only the Administration Control Panel (ACP) will be accessible.</strong>',
    192196        'INSTALL_INTRO'                         => 'Welcome to Installation',
    193197
     
    209213                <li>PostgreSQL 7.3+</li>
    210214                <li>SQLite 2.8.2+</li>
    211                 <li>Firebird 2.0+</li>
     215                <li>Firebird 2.1+</li>
    212216                <li>MS SQL Server 2000 or above (directly or via ODBC)</li>
    213217                <li>Oracle</li>
     
    231235        'INST_ERR_DB_NO_SQLITE'         => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
    232236        'INST_ERR_DB_NO_ORACLE'         => 'The version of Oracle installed on this machine requires you to set the <var>NLS_CHARACTERSET</var> parameter to <var>UTF8</var>. Either upgrade your installation to 9.2+ or change the parameter.',
    233         'INST_ERR_DB_NO_FIREBIRD'       => 'The version of Firebird installed on this machine is older than 2.0, please upgrade to a newer version.',
     237        'INST_ERR_DB_NO_FIREBIRD'       => 'The version of Firebird installed on this machine is older than 2.1, please upgrade to a newer version.',
    234238        'INST_ERR_DB_NO_FIREBIRD_PS'=> 'The database you selected for Firebird has a page size less than 8192, it must be at least 8192.',
    235239        'INST_ERR_DB_NO_POSTGRES'       => 'The database you have selected was not created in <var>UNICODE</var> or <var>UTF8</var> encoding. Try installing with a database in <var>UNICODE</var> or <var>UTF8</var> encoding.',
     
    269273        'MAKE_FOLDER_WRITABLE'          => 'Please make sure that this folder exists and is writable by the webserver then try again:<br />»<strong>%s</strong>.',
    270274        'MAKE_FOLDERS_WRITABLE'         => 'Please make sure that these folders exist and are writable by the webserver then try again:<br />»<strong>%s</strong>.',
     275
     276        'MYSQL_SCHEMA_UPDATE_REQUIRED'  => 'Your MySQL database schema for phpBB is outdated. phpBB detected a schema for MySQL 3.x/4.x, but the server runs on MySQL %2$s.<br /><strong>Before you proceed the update, you need to upgrade the schema.</strong><br /><br />Please refer to the <a href="http://www.phpbb.com/kb/article/doesnt-have-a-default-value-errors/">Knowledge Base article about upgrading the MySQL schema</a>. If you encounter problems, please use <a href="http://www.phpbb.com/community/viewforum.php?f=46">our support forums</a>.',
    271277
    272278        'NAMING_CONFLICT'                       => 'Naming conflict: %s and %s are both aliases<br /><br />%s',
     
    363369// Updater
    364370$lang = array_merge($lang, array(
    365         'ALL_FILES_UP_TO_DATE'          => 'All files are up to date with the latest phpBB version. You should now <a href="../ucp.php?mode=login">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory!',
     371        'ALL_FILES_UP_TO_DATE'          => 'All files are up to date with the latest phpBB version. You should now <a href="../ucp.php?mode=login&amp;redirect=adm/index.php%3Fi=send_statistics%26mode=send_statistics">login to your board</a> and check if everything is working fine. Do not forget to delete, rename or move your install directory! Please send us updated information about your server and board configurations from the <a href="../ucp.php?mode=login&amp;redirect=adm/index.php%3Fi=send_statistics%26mode=send_statistics">Send statistics</a> module in your ACP.',
    366372        'ARCHIVE_FILE'                          => 'Source file within archive',
    367373
     
    382388        'CONTINUE_UPDATE_NOW'                   => 'Continue the update process now',           // Shown within the database update script at the end if called from the updater
    383389        'CONTINUE_UPDATE'                               => 'Continue update now',                                       // Shown after file upload to indicate the update process is not yet finished
    384         'CURRENT_FILE'                                  => 'Beginning of current original file',
     390        'CURRENT_FILE'                                  => 'Begin of Conflict - Original File code before update',
    385391        'CURRENT_VERSION'                               => 'Current version',
    386392
     
    392398        'DIFF_INLINE'                                           => 'Inline',
    393399        'DIFF_RAW'                                                      => 'Raw unified diff',
    394         'DIFF_SEP_EXPLAIN'                                      => 'End of current original file / Beginning of new updated file',
     400        'DIFF_SEP_EXPLAIN'                                      => 'Code block used within the updated/new file',
    395401        'DIFF_SIDE_BY_SIDE'                                     => 'Side by Side',
    396402        'DIFF_UNIFIED'                                          => 'Unified diff',
     
    400406        'DOWNLOAD_AS'                                           => 'Download as',
    401407        'DOWNLOAD_UPDATE_METHOD_BUTTON'         => 'Download modified files archive (recommended)',
     408        'DOWNLOAD_CONFLICTS'                            => 'Download conflicts for this file',
     409        'DOWNLOAD_CONFLICTS_EXPLAIN'            => 'Search for &lt;&lt;&lt; to spot conflicts',
    402410        'DOWNLOAD_UPDATE_METHOD'                        => 'Download modified files archive',
    403411        'DOWNLOAD_UPDATE_METHOD_EXPLAIN'        => 'Once downloaded you should unpack the archive. You will find the modified files you need to upload to your phpBB root directory within it. Please upload the files to their respective locations then. After you have uploaded all files, please check the files again with the other button below.',
     
    444452        'MERGE_NO_MERGE_NEW_OPTION'     => 'Do not merge - use new file',
    445453        'MERGE_NO_MERGE_MOD_OPTION'     => 'Do not merge - use currently installed file',
    446         'MERGE_MOD_FILE_OPTION'         => 'Merge differences and use modified code within conflicting block',
    447         'MERGE_NEW_FILE_OPTION'         => 'Merge differences and use new file code within conflicting block',
     454        'MERGE_MOD_FILE_OPTION'         => 'Merge modifications (removes new phpBB code within conflicting block)',
     455        'MERGE_NEW_FILE_OPTION'         => 'Merge modifications (removes modified code within conflicting block)',
    448456        'MERGE_SELECT_ERROR'            => 'Conflicting file merge modes are not correctly selected.',
    449457        'MERGING_FILES'                         => 'Merging differences',
    450458        'MERGING_FILES_EXPLAIN'         => 'Currently collecting final file changes.<br /><br />Please wait until phpBB has completed all operations on changed files.',
    451459
    452         'NEW_FILE'                                              => 'End of new updated file',
     460        'NEW_FILE'                                              => 'End of Conflict',
    453461        'NEW_USERNAME'                                  => 'New username',
    454462        'NO_AUTH_UPDATE'                                => 'Not authorised to update',
     
    463471        'NOTICE'                                                => 'Notice',
    464472        'NUM_CONFLICTS'                                 => 'Number of conflicts',
    465         'NUMBER_OF_FILES_COLLECTED'             => 'Currently differences of %1$d of %2$d files have been checked.<br />Please wait until all files are checked.',
     473        'NUMBER_OF_FILES_COLLECTED'             => 'Currently differences from %1$d of %2$d files have been checked.<br />Please wait until all files are checked.',
    466474
    467475        'OLD_UPDATE_FILES'              => 'Update files are out of date. The update files found are for updating from phpBB %1$s to phpBB %2$s but the latest version of phpBB is %3$s.',
     
    556564        'USER_INACTIVE'                                 => 'Inactive user',
    557565
    558         'VERSION_CHECK'                         => 'Version check',
    559         'VERSION_CHECK_EXPLAIN'         => 'Checks to see if the version of phpBB you are currently running is up to date.',
    560         'VERSION_NOT_UP_TO_DATE'        => 'Your version of phpBB is not up to date. Please continue the update process.',
    561         'VERSION_NOT_UP_TO_DATE_ACP'=> 'Your version of phpBB is not up to date.<br />Below you will find a link to the release announcement for the latest version as well as instructions on how to perform the update.',
    562         'VERSION_UP_TO_DATE'            => 'Your installation is up to date, no updates are available for your version of phpBB. You may want to continue anyway to perform a file validity check.',
    563         'VERSION_UP_TO_DATE_ACP'        => 'Your installation is up to date, no updates are available for your version of phpBB. You do not need to update your installation.',
    564         'VIEWING_FILE_CONTENTS'         => 'Viewing file contents',
    565         'VIEWING_FILE_DIFF'                     => 'Viewing file differences',
     566        'VERSION_CHECK'                                 => 'Version check',
     567        'VERSION_CHECK_EXPLAIN'                 => 'Checks to see if your phpBB installation is up to date.',
     568        'VERSION_NOT_UP_TO_DATE'                => 'Your phpBB installation is not up to date. Please continue the update process.',
     569        'VERSION_NOT_UP_TO_DATE_ACP'    => 'Your phpBB installation is not up to date.<br />Below is a link to the release announcement, which contains more information as well as instructions on updating.',
     570        'VERSION_NOT_UP_TO_DATE_TITLE'  => 'Your phpBB installation is not up to date.',
     571        'VERSION_UP_TO_DATE'                    => 'Your phpBB installation is up to date. Although there are no updates available at this time, you may continue in order to perform a file validity check.',
     572        'VERSION_UP_TO_DATE_ACP'                => 'Your phpBB installation is up to date. There are no updates available at this time.',
     573        'VIEWING_FILE_CONTENTS'                 => 'Viewing file contents',
     574        'VIEWING_FILE_DIFF'                             => 'Viewing file differences',
    566575
    567576        'WRONG_INFO_FILE_FORMAT'        => 'Wrong info file format',
  • trunk/forum/language/en/mcp.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: mcp.php 8940 2008-09-26 11:25:04Z toonarmy $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4747        'ALL_REPORTS'                   => 'All reports',
    4848        'ALREADY_REPORTED'              => 'This post has already been reported.',
     49        'ALREADY_REPORTED_PM'   => 'This private message has already been reported.',
    4950        'ALREADY_WARNED'                => 'A warning has already been issued for this post.',
    5051        'APPROVE'                               => 'Approve',
     
    5960        'CAN_LEAVE_BLANK'               => 'This can be left blank.',
    6061        'CHANGE_POSTER'                 => 'Change poster',
     62        'CLOSE_PM_REPORT'               => 'Close PM report',
     63        'CLOSE_PM_REPORT_CONFIRM'       => 'Are you sure you want to close the selected PM report?',
     64        'CLOSE_PM_REPORTS'              => 'Close PM reports',
     65        'CLOSE_PM_REPORTS_CONFIRM'      => 'Are you sure you want to close the selected PM reports?',
    6166        'CLOSE_REPORT'                  => 'Close report',
    6267        'CLOSE_REPORT_CONFIRM'  => 'Are you sure you want to close the selected report?',
     
    6469        'CLOSE_REPORTS_CONFIRM' => 'Are you sure you want to close the selected reports?',
    6570
     71        'DELETE_PM_REPORT'                      => 'Delete PM report',
     72        'DELETE_PM_REPORT_CONFIRM'      => 'Are you sure you want to delete the selected PM report?',
     73        'DELETE_PM_REPORTS'                     => 'Delete PM reports',
     74        'DELETE_PM_REPORTS_CONFIRM'     => 'Are you sure you want to delete the selected PM reports?',
    6675        'DELETE_POSTS'                          => 'Delete posts',
    6776        'DELETE_POSTS_CONFIRM'          => 'Are you sure you want to delete these posts?',
     
    107116        'LATEST_LOGS'                           => 'Latest 5 logged actions',
    108117        'LATEST_REPORTED'                       => 'Latest 5 reports',
     118        'LATEST_REPORTED_PMS'           => 'Latest 5 PM reports',
    109119        'LATEST_UNAPPROVED'                     => 'Latest 5 posts awaiting approval',
    110120        'LATEST_WARNING_TIME'           => 'Latest warning issued',
     
    171181        'MCP_POST_REPORTS'                              => 'Reports issued on this post',
    172182
    173         'MCP_REPORTS'                                   => 'Reported posts',
     183        'MCP_PM_REPORTS'                                => 'Reported PMs',
     184        'MCP_PM_REPORT_DETAILS'                 => 'PM Report details',
     185        'MCP_PM_REPORTS_CLOSED'                 => 'Closed PM reports',
     186        'MCP_PM_REPORTS_CLOSED_EXPLAIN' => 'This is a list of all reports about private messages which have previously been resolved.',
     187        'MCP_PM_REPORTS_OPEN'                   => 'Open PM reports',
     188        'MCP_PM_REPORTS_OPEN_EXPLAIN'   => 'This is a list of all reported private messages which are still to be handled.',
     189
     190        'MCP_REPORTS'                                   => 'Reported messages',
    174191        'MCP_REPORT_DETAILS'                    => 'Report details',
    175192        'MCP_REPORTS_CLOSED'                    => 'Closed reports',
     
    233250        'OTHER_USERS'                   => 'Other users posting from this IP',
    234251
     252        'PM_REPORT_CLOSED_SUCCESS'      => 'The selected PM report has been closed successfully.',
     253        'PM_REPORT_DELETED_SUCCESS'     => 'The selected PM report has been deleted successfully.',
     254        'PM_REPORTED_SUCCESS'           => 'This private message has been successfully reported.',
     255        'PM_REPORT_TOTAL'                       => 'In total there is <strong>1</strong> PM report to review.',
     256        'PM_REPORTS_CLOSED_SUCCESS'     => 'The selected PM reports have been closed successfully.',
     257        'PM_REPORTS_DELETED_SUCCESS'=> 'The selected PM reports have been deleted successfully.',
     258        'PM_REPORTS_TOTAL'                      => 'In total there are <strong>%d</strong> PM reports to review.',
     259        'PM_REPORTS_ZERO_TOTAL'         => 'There are no PM reports to review.',
     260        'PM_REPORT_DETAILS'                     => 'Private message report details',
    235261        'POSTER'                                        => 'Poster',
    236262        'POSTS_APPROVED_SUCCESS'        => 'The selected posts have been approved.',
     
    265291        'REPORT_DETAILS'                        => 'Report details',
    266292        'REPORT_MESSAGE'                        => 'Report this message',
    267         'REPORT_MESSAGE_EXPLAIN'        => 'Use this form to report the selected message. Reporting should generally be used only if the message breaks forum rules.',
     293        'REPORT_MESSAGE_EXPLAIN'        => 'Use this form to report the selected private message. Reporting should generally be used only if the message breaks forum rules. <strong>Reporting a private message will make its contents visible to all moderators.</strong>',
    268294        'REPORT_NOTIFY'                         => 'Notify me',
    269295        'REPORT_NOTIFY_EXPLAIN'         => 'Informs you when your report is dealt with.',
     
    276302        'RETURN_NEW_FORUM'                      => '%sGo to the new forum%s',
    277303        'RETURN_NEW_TOPIC'                      => '%sGo to the new topic%s',
     304        'RETURN_PM'                                     => '%sReturn to the private message%s',
    278305        'RETURN_POST'                           => '%sReturn to the post%s',
    279306        'RETURN_QUEUE'                          => '%sReturn to the queue%s',
     
    303330        'SPLIT_TOPIC_EXPLAIN'                           => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post.',
    304331
     332        'THIS_PM_IP'                            => 'IP for this private message',
    305333        'THIS_POST_IP'                          => 'IP for this post',
    306334        'TOPICS_APPROVED_SUCCESS'       => 'The selected topics have been approved.',
     
    347375
    348376        'VIEW_DETAILS'                  => 'View details',
     377        'VIEW_PM'                               => 'View private message',
    349378        'VIEW_POST'                             => 'View post',
    350379
     
    366395                ),
    367396                'DESCRIPTION' => array(
    368                         'WAREZ'         => 'The post contains links to illegal or pirated software.',
    369                         'SPAM'          => 'The reported post has the only purpose to advertise for a website or another product.',
    370                         'OFF_TOPIC'     => 'The reported post is off topic.',
    371                         'OTHER'         => 'The reported post does not fit into any other category, please use the further information field.',
     397                        'WAREZ'         => 'The message contains links to illegal or pirated software.',
     398                        'SPAM'          => 'The reported message has the only purpose to advertise for a website or another product.',
     399                        'OFF_TOPIC'     => 'The reported message is off topic.',
     400                        'OTHER'         => 'The reported message does not fit into any other category, please use the further information field.',
    372401                )
    373402        ),
  • trunk/forum/language/en/memberlist.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: memberlist.php 8574 2008-05-29 13:59:47Z Kellanved $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    8282        'IM_MSNM'                               => 'Please note that you need Windows Messenger installed to use this.',
    8383        'IM_MSNM_BROWSER'               => 'Your browser does not support this.',
    84         'IM_MSNM_CONNECT'               => 'MSNM is not connected.\nYou have to connect to MSNM to continue.',         
     84        'IM_MSNM_CONNECT'               => 'MSNM is not connected.\nYou have to connect to MSNM to continue.',
    8585        'IM_NAME'                               => 'Your Name',
    8686        'IM_NO_DATA'                    => 'There is no suitable contact information for this user.',
     
    9191        'IM_SENT_JABBER'                => 'Your message to %1$s has been sent successfully.',
    9292        'IM_USER'                               => 'Send an instant message',
    93        
     93
    9494        'LAST_ACTIVE'                           => 'Last active',
    9595        'LESS_THAN'                                     => 'Less than',
     
    135135        'USER_BAN'                              => 'Banning',
    136136        'USER_FORUM'                    => 'User statistics',
     137        'USER_LAST_REMINDED'    => array(
     138                0               => 'No reminder sent at this time',
     139                1               => '%1$d reminder sent<br />» %2$s',
     140        ),
    137141        'USER_ONLINE'                   => 'Online',
    138142        'USER_PRESENCE'                 => 'Board presence',
  • trunk/forum/language/en/posting.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: posting.php 8555 2008-05-15 14:10:11Z Kellanved $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    142142        'PARTIAL_UPLOAD'                        => 'The uploaded file was only partially uploaded.',
    143143        'PHP_SIZE_NA'                           => 'The attachment’s file size is too large.<br />Could not determine the maximum size defined by PHP in php.ini.',
    144         'PHP_SIZE_OVERRUN'                      => 'The attachment’s file size is too large, the maximum upload size is %d MB.<br />Please note this is set in php.ini and cannot be overridden.',
     144        'PHP_SIZE_OVERRUN'                      => 'The attachment’s file size is too large, the maximum upload size is %1$d %2$s.<br />Please note this is set in php.ini and cannot be overridden.',
    145145        'PLACE_INLINE'                          => 'Place inline',
    146146        'POLL_DELETE'                           => 'Delete poll',
     
    168168        'POST_NORMAL'                           => 'Normal',
    169169        'POST_REVIEW'                           => 'Post review',
     170        'POST_REVIEW_EDIT'                      => 'Post review',
     171        'POST_REVIEW_EDIT_EXPLAIN'      => 'This post has been altered by another user while you were editing it. You may wish to review the current version of this post and adjust your edits.',
    170172        'POST_REVIEW_EXPLAIN'           => 'At least one new post has been made to this topic. You may wish to review your post in light of this.',
    171173        'POST_STORED'                           => 'This message has been posted successfully.',
     
    185187        'STICKY_ANNOUNCE_TIME_LIMIT'=> 'Sticky/Announcement time limit',
    186188        'STICK_TOPIC_FOR'                       => 'Stick topic for',
    187         'STICK_TOPIC_FOR_EXPLAIN'       => 'Enter 0 or leave blank for a never ending Sticky/Announcement.',
     189        'STICK_TOPIC_FOR_EXPLAIN'       => 'Enter 0 or leave blank for a never ending Sticky/Announcement. Please note that this number is relative to the date of the post.',
    188190        'STYLES_TIP'                            => 'Tip: Styles can be applied quickly to selected text.',
    189191
    190192        'TOO_FEW_CHARS'                         => 'Your message contains too few characters.',
     193        'TOO_FEW_CHARS_LIMIT'           => 'Your message contains %1$d characters. The minimum number of characters you need to enter is %2$d.',
    191194        'TOO_FEW_POLL_OPTIONS'          => 'You must enter at least two poll options.',
    192195        'TOO_MANY_ATTACHMENTS'          => 'Cannot add another attachment, %d is the maximum.',
  • trunk/forum/language/en/search.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: search.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    5454
    5555        'LOGIN_EXPLAIN_EGOSEARCH'       => 'The board requires you to be registered and logged in to view your own posts.',
     56        'LOGIN_EXPLAIN_UNREADSEARCH'=> 'The board requires you to be registered and logged in to view your unread posts.',
     57
     58        'MAX_NUM_SEARCH_KEYWORDS_REFINE'        => 'You specified too many words to search for. Please do not enter more than %1$d words.',
    5659
    5760        'NO_KEYWORDS'                   => 'You must specify at least one word to search for. Each word must consist of at least %d characters and must not contain more than %d characters excluding wildcards.',
  • trunk/forum/language/en/search_synonyms.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: search_synonyms.php 8479 2008-03-29 00:22:48Z naderman $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2727        'anemic'                        => 'anaemic',
    2828        'anesthesia'            => 'anaesthesia',
    29         'appologize'            => 'appologise',
     29        'apologize'                     => 'apologise',
    3030        'archean'                       => 'archaean',
    3131        'archeology'            => 'archaeology',
  • trunk/forum/language/en/ucp.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: ucp.php 9162 2008-12-03 11:18:31Z acydburn $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    8080        'ADD_RULE'                                              => 'Add rule',
    8181        'ADD_TO'                                                => 'Add [To]',
     82        'ADD_USERS_UCP_EXPLAIN'                 => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Please enter each username on a separate line.',
    8283        'ADMIN_EMAIL'                                   => 'Administrators can e-mail me information',
    8384        'AGREE'                                                 => 'I agree to these terms',
     
    9394        'AVATAR_GALLERY'                                => 'Local gallery',
    9495        'AVATAR_GENERAL_UPLOAD_ERROR'   => 'Could not upload avatar to %s.',
     96        'AVATAR_NOT_ALLOWED'                    => 'Your avatar cannot be displayed because avatars have been disallowed.',
    9597        'AVATAR_PAGE'                                   => 'Page',
     98        'AVATAR_TYPE_NOT_ALLOWED'               => 'Your current avatar cannot be displayed because its type has been disallowed.',
    9699
    97100        'BACK_TO_DRAFTS'                        => 'Back to saved drafts',
     
    123126        'CONFIRM_EMAIL_EXPLAIN'         => 'You only need to specify this if you are changing your e-mail address.',
    124127        'CONFIRM_EXPLAIN'                       => 'To prevent automated registrations the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.',
     128        'VC_REFRESH'                            => 'Refresh confirmation code',
     129        'VC_REFRESH_EXPLAIN'            => 'If you cannot read the code you can request a new one by clicking the button.',
     130
    125131        'CONFIRM_PASSWORD'                      => 'Confirm password',
    126132        'CONFIRM_PASSWORD_EXPLAIN'      => 'You only need to confirm your password if you changed it above.',
     
    195201        'FOLDER_ADDED'                          => 'Folder successfully added.',
    196202        'FOLDER_MESSAGE_STATUS'         => '%1$d from %2$d messages stored',
     203        'FOLDER_NAME_EMPTY'                     => 'You must enter a name for this folder.',
    197204        'FOLDER_NAME_EXIST'                     => 'Folder <strong>%s</strong> already exists.',
    198205        'FOLDER_OPTIONS'                        => 'Folder options',
     
    271278        'NOTIFY_ON_PM'                                  => 'Notify me on new private messages',
    272279        'NOT_ADDED_FRIENDS_ANONYMOUS'   => 'You cannot add the anonymous user to your friends list.',
     280        'NOT_ADDED_FRIENDS_BOTS'                => 'You cannot add bots to your friends list.',
    273281        'NOT_ADDED_FRIENDS_FOES'                => 'You cannot add users to your friends list who are on your foes list.',
    274282        'NOT_ADDED_FRIENDS_SELF'                => 'You cannot add yourself to the friends list.',
    275283        'NOT_ADDED_FOES_MOD_ADMIN'              => 'You cannot add administrators and moderators to your foes list.',
    276284        'NOT_ADDED_FOES_ANONYMOUS'              => 'You cannot add the anonymous user to your foes list.',
     285        'NOT_ADDED_FOES_BOTS'                   => 'You cannot add bots to your foes list.',
    277286        'NOT_ADDED_FOES_FRIENDS'                => 'You cannot add users to your foes list who are on your friends list.',
    278287        'NOT_ADDED_FOES_SELF'                   => 'You cannot add yourself to the foes list.',
     
    326335        'PASSWORD'                                      => 'Password',
    327336        'PASSWORD_ACTIVATED'            => 'Your new password has been activated.',
    328         'PASSWORD_UPDATED'                      => 'Your password has been sent successfully to your original e-mail address.',
     337        'PASSWORD_UPDATED'                      => 'A new password was sent to your registered e-mail address.',
    329338        'PERMISSIONS_RESTORED'          => 'Successfully restored original permissions.',
    330339        'PERMISSIONS_TRANSFERRED'       => 'Successfully transferred permissions from <strong>%s</strong>, you are now able to browse the board with this user’s permissions.<br />Please note that admin permissions were not transferred. You are able to revert to your permission set at any time.',
     
    344353        'POST_FORWARD_PM'                       => 'Forward message',
    345354        'POST_NEW_PM'                           => 'Compose message',
    346         'POST_PM_LOCKED'                        => 'Private messaging is locked',
     355        'POST_PM_LOCKED'                        => 'Private messaging is locked.',
    347356        'POST_PM_POST'                          => 'Quote post',
    348357        'POST_QUOTE_PM'                         => 'Quote message',
     
    366375        'RENAME_FOLDER'                                         => 'Rename folder',
    367376        'REPLIED_MESSAGE'                                       => 'Replied to message',
     377        'REPLY_TO_ALL'                                          => 'Reply to sender and all recipients.',
     378        'REPORT_PM'                                                     => 'Report private message',
    368379        'RESIGN_SELECTED'                                       => 'Resign selected',
    369380        'RETURN_FOLDER'                                         => '%1$sReturn to previous folder%2$s',
     
    415426        'UCP_MAIN_SUBSCRIBED'           => 'Manage subscriptions',
    416427
    417         'UCP_MSNM'                                      => 'MSN Messenger',
     428        'UCP_MSNM'                                      => 'WL/MSN Messenger',
    418429        'UCP_NO_ATTACHMENTS'            => 'You have posted no files.',
    419430
     
    450461        'UCP_ZEBRA_FOES'                                => 'Manage foes',
    451462        'UCP_ZEBRA_FRIENDS'                             => 'Manage friends',
     463        'UNDISCLOSED_RECIPIENT'                 => 'Undisclosed Recipient',
    452464        'UNKNOWN_FOLDER'                                => 'Unknown folder',
    453465        'UNWATCH_MARKED'                                => 'Unwatch marked',
  • trunk/forum/language/en/viewtopic.php

    r400 r702  
    55*
    66* @package language
    7 * @version $Id: viewtopic.php 8775 2008-08-21 15:41:12Z Kellanved $
     7* @version $Id$
    88* @copyright (c) 2005 phpBB Group
    99* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4949
    5050        'CODE'                                  => 'Code',
     51        'COLLAPSE_QR'                   => 'Hide Quick Reply',
    5152
    5253        'DELETE_TOPIC'                  => 'Delete topic',
     
    6061        'FILE_NOT_FOUND_404'    => 'The file <strong>%s</strong> does not exist.',
    6162        'FORK_TOPIC'                    => 'Copy topic',
    62 
     63        'FULL_EDITOR'                   => 'Full Editor',
     64       
    6365        'LINKAGE_FORBIDDEN'             => 'You are not authorised to view, download or link from/to this site.',
    6466        'LOGIN_NOTIFY_TOPIC'    => 'You have been notified about this topic, please login to view it.',
     
    8789
    8890        'QUICK_MOD'                             => 'Quick-mod tools',
     91        'QUICKREPLY'                    => 'Quick Reply',
    8992        'QUOTE'                                 => 'Quote',
    9093
     
    9295        'RETURN_POST'                   => '%sReturn to the post%s',
    9396
     97        'SHOW_QR'                               => 'Quick Reply',
    9498        'SUBMIT_VOTE'                   => 'Submit vote',
    9599
  • trunk/forum/mcp.php

    r400 r702  
    33*
    44* @package mcp
    5 * @version $Id: mcp.php 9015 2008-10-14 18:29:50Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    7878$topic_id = request_var('t', 0);
    7979$forum_id = request_var('f', 0);
     80$report_id = request_var('r', 0);
    8081$user_id = request_var('u', 0);
    8182$username = utf8_normalize_nfc(request_var('username', '', true));
     
    171172
    172173                case 'topic_logs':
     174                        // Reset start parameter if we jumped from the quickmod dropdown
     175                        if (request_var('start', 0))
     176                        {
     177                                $_REQUEST['start'] = 0;
     178                        }
     179
    173180                        $module->set_active('logs', 'topic_logs');
    174181                break;
     
    206213}
    207214
    208 if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed')
     215if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'pm_report_details')
    209216{
    210217        $module->set_display('reports', 'report_details', false);
     218}
     219
     220if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'report_details')
     221{
     222        $module->set_display('pm_reports', 'pm_report_details', false);
    211223}
    212224
     
    318330function extra_url()
    319331{
    320         global $forum_id, $topic_id, $post_id, $user_id;
     332        global $forum_id, $topic_id, $post_id, $report_id, $user_id;
    321333
    322334        $url_extra = '';
     
    325337        $url_extra .= ($post_id) ? "&amp;p=$post_id" : '';
    326338        $url_extra .= ($user_id) ? "&amp;u=$user_id" : '';
     339        $url_extra .= ($report_id) ? "&amp;r=$report_id" : '';
    327340
    328341        return $url_extra;
     
    559572
    560573/**
     574* Get simple pm data
     575*/
     576function get_pm_data($pm_ids)
     577{
     578        global $db, $auth, $config, $user;
     579
     580        $rowset = array();
     581
     582        if (!sizeof($pm_ids))
     583        {
     584                return array();
     585        }
     586
     587        $sql_array = array(
     588                'SELECT'        => 'p.*, u.*',
     589
     590                'FROM'          => array(
     591                        USERS_TABLE                     => 'u',
     592                        PRIVMSGS_TABLE          => 'p',
     593                ),
     594
     595                'WHERE'         => $db->sql_in_set('p.msg_id', $pm_ids) . '
     596                        AND u.user_id = p.author_id',
     597        );
     598
     599        $sql = $db->sql_build_query('SELECT', $sql_array);
     600        $result = $db->sql_query($sql);
     601        unset($sql_array);
     602
     603        while ($row = $db->sql_fetchrow($result))
     604        {
     605                $rowset[$row['msg_id']] = $row;
     606        }
     607        $db->sql_freeresult($result);
     608
     609        return $rowset;
     610}
     611
     612/**
    561613* sorting in mcp
    562614*
    563615* @param string $where_sql should either be WHERE (default if ommited) or end with AND or OR
     616*
     617* $mode reports and reports_closed: the $where parameters uses aliases p for posts table and r for report table
     618* $mode unapproved_posts: the $where parameters uses aliases p for posts table and t for topic table
    564619*/
    565620function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE')
     
    609664                        $default_key = 't';
    610665                        $default_dir = 'd';
    611                         $where_sql .= ($topic_id) ? ' topic_id = ' . $topic_id . ' AND' : '';
    612 
    613                         $sql = 'SELECT COUNT(post_id) AS total
    614                                 FROM ' . POSTS_TABLE . "
    615                                 $where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
    616                                         AND post_approved = 0';
     666                        $where_sql .= ($topic_id) ? ' p.topic_id = ' . $topic_id . ' AND' : '';
     667
     668                        $sql = 'SELECT COUNT(p.post_id) AS total
     669                                FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
     670                                $where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
     671                                        AND p.post_approved = 0
     672                                        AND t.topic_id = p.topic_id
     673                                        AND t.topic_first_post_id <> p.post_id';
    617674
    618675                        if ($min_time)
     
    638695                break;
    639696
     697                case 'pm_reports':
     698                case 'pm_reports_closed':
    640699                case 'reports':
    641700                case 'reports_closed':
    642                         $type = 'reports';
     701                        $pm = (strpos($mode, 'pm_') === 0) ? true : false;
     702
     703                        $type = ($pm) ? 'pm_reports' : 'reports';
    643704                        $default_key = 't';
    644705                        $default_dir = 'd';
     
    647708                        if ($topic_id)
    648709                        {
    649                                 $where_sql .= ' p.topic_id = ' . $topic_id;
     710                                $where_sql .= ' p.topic_id = ' . $topic_id . ' AND ';
    650711                        }
    651712                        else if ($forum_id)
    652713                        {
    653                                 $where_sql .= ' p.forum_id = ' . $forum_id;
     714                                $where_sql .= ' p.forum_id = ' . $forum_id . ' AND ';
     715                        }
     716                        else if (!$pm)
     717                        {
     718                                $where_sql .= ' ' . $db->sql_in_set('p.forum_id', get_forum_list(array('!f_read', '!m_report')), true, true) . ' AND ';
     719                        }
     720
     721                        if ($mode == 'reports' || $mode == 'pm_reports')
     722                        {
     723                                $where_sql .= ' r.report_closed = 0 AND ';
    654724                        }
    655725                        else
    656726                        {
    657                                 $where_sql .= ' ' . $db->sql_in_set('p.forum_id', get_forum_list(array('!f_read', '!m_report')), true, true);
    658                         }
    659 
    660                         if ($mode == 'reports')
    661                         {
    662                                 $where_sql .= ' AND r.report_closed = 0';
     727                                $where_sql .= ' r.report_closed = 1 AND ';
     728                        }
     729
     730                        if ($pm)
     731                        {
     732                                $sql = 'SELECT COUNT(r.report_id) AS total
     733                                        FROM ' . REPORTS_TABLE . ' r, ' . PRIVMSGS_TABLE . " p
     734                                        $where_sql r.post_id = 0
     735                                                AND p.msg_id = r.pm_id
     736                                                $limit_time_sql";
    663737                        }
    664738                        else
    665739                        {
    666                                 $where_sql .= ' AND r.report_closed = 1';
    667                         }
    668 
    669                         $sql = 'SELECT COUNT(r.report_id) AS total
    670                                 FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . " p
    671                                 $where_sql
    672                                         AND p.post_id = r.post_id
    673                                         $limit_time_sql";
     740                                $sql = 'SELECT COUNT(r.report_id) AS total
     741                                        FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . " p
     742                                        $where_sql r.pm_id = 0
     743                                                AND p.post_id = r.post_id
     744                                                $limit_time_sql";
     745                        }
    674746                break;
    675747
     
    712784                        $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']);
    713785                        $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.post_time', 't' => 'r.report_time', 's' => 'p.post_subject');
     786                break;
     787
     788                case 'pm_reports':
     789                        $limit_days = array(0 => $user->lang['ALL_REPORTS'], 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']);
     790                        $sort_by_text = array('a' => $user->lang['AUTHOR'], 'r' => $user->lang['REPORTER'], 'p' => $user->lang['POST_TIME'], 't' => $user->lang['REPORT_TIME'], 's' => $user->lang['SUBJECT']);
     791                        $sort_by_sql = array('a' => 'u.username_clean', 'r' => 'ru.username', 'p' => 'p.message_time', 't' => 'r.report_time', 's' => 'p.message_subject');
    714792                break;
    715793
  • trunk/forum/memberlist.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: memberlist.php 9156 2008-12-02 18:48:25Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    431431                $user_id = (int) $member['user_id'];
    432432
     433                // Get group memberships
     434                // Also get visiting user's groups to determine hidden group memberships if necessary.
     435                $auth_hidden_groups = ($user_id === (int) $user->data['user_id'] || $auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? true : false;
     436                $sql_uid_ary = ($auth_hidden_groups) ? array($user_id) : array($user_id, (int) $user->data['user_id']);
     437
    433438                // Do the SQL thang
    434                 $sql = 'SELECT g.group_id, g.group_name, g.group_type
    435                         FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug
    436                         WHERE ug.user_id = $user_id
    437                                 AND g.group_id = ug.group_id" . ((!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? ' AND g.group_type <> ' . GROUP_HIDDEN : '') . '
    438                                 AND ug.user_pending = 0
    439                         ORDER BY g.group_type, g.group_name';
     439                $sql = 'SELECT g.group_id, g.group_name, g.group_type, ug.user_id
     440                        FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug
     441                        WHERE ' . $db->sql_in_set('ug.user_id', $sql_uid_ary) . '
     442                                AND g.group_id = ug.group_id
     443                                AND ug.user_pending = 0';
    440444                $result = $db->sql_query($sql);
    441445
     446                // Divide data into profile data and current user data
     447                $profile_groups = $user_groups = array();
     448                while ($row = $db->sql_fetchrow($result))
     449                {
     450                        $row['user_id'] = (int) $row['user_id'];
     451                        $row['group_id'] = (int) $row['group_id'];
     452
     453                        if ($row['user_id'] == $user_id)
     454                        {
     455                                $profile_groups[] = $row;
     456                        }
     457                        else
     458                        {
     459                                $user_groups[$row['group_id']] = $row['group_id'];
     460                        }
     461                }
     462                $db->sql_freeresult($result);
     463
     464                // Filter out hidden groups and sort groups by name
     465                $group_data = $group_sort = array();
     466                foreach ($profile_groups as $row)
     467                {
     468                        if ($row['group_type'] == GROUP_SPECIAL)
     469                        {
     470                                // Lookup group name in language dictionary
     471                                if (isset($user->lang['G_' . $row['group_name']]))
     472                                {
     473                                        $row['group_name'] = $user->lang['G_' . $row['group_name']];
     474                                }
     475                        }
     476                        else if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))
     477                        {
     478                                // Skip over hidden groups the user cannot see
     479                                continue;
     480                        }
     481
     482                        $group_sort[$row['group_id']] = utf8_clean_string($row['group_name']);
     483                        $group_data[$row['group_id']] = $row;
     484                }
     485                unset($profile_groups);
     486                unset($user_groups);
     487                asort($group_sort);
     488
    442489                $group_options = '';
    443                 while ($row = $db->sql_fetchrow($result))
    444                 {
    445                         $group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
    446                 }
    447                 $db->sql_freeresult($result);
     490                foreach ($group_sort as $group_id => $null)
     491                {
     492                        $row = $group_data[$group_id];
     493
     494                        $group_options .= '<option value="' . $row['group_id'] . '"' . (($row['group_id'] == $member['group_id']) ? ' selected="selected"' : '') . '>' . $row['group_name'] . '</option>';
     495                }
     496                unset($group_data);
     497                unset($group_sort);
    448498
    449499                // What colour is the zebra
     
    501551                $poster_avatar = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']);
    502552
    503                 $template->assign_vars(show_profile($member));
     553                // We need to check if the modules 'zebra' ('friends' & 'foes' mode),  'notes' ('user_notes' mode) and  'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links
     554                $zebra_enabled = $friends_enabled = $foes_enabled = $user_notes_enabled = $warn_user_enabled = false;
     555
     556                // Only check if the user is logged in
     557                if ($user->data['is_registered'])
     558                {
     559                        if (!class_exists('p_master'))
     560                        {
     561                                include($phpbb_root_path . 'includes/functions_module.' . $phpEx);
     562                        }
     563                        $module = new p_master();
     564
     565                        $module->list_modules('ucp');
     566                        $module->list_modules('mcp');
     567
     568                        $user_notes_enabled = ($module->loaded('notes', 'user_notes')) ? true : false;
     569                        $warn_user_enabled = ($module->loaded('warn', 'warn_user')) ? true : false;
     570                        $zebra_enabled = ($module->loaded('zebra')) ? true : false;
     571                        $friends_enabled = ($module->loaded('zebra', 'friends')) ? true : false;
     572                        $foes_enabled = ($module->loaded('zebra', 'foes')) ? true : false;
     573
     574                        unset($module);
     575                }
     576
     577                $template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled));
    504578
    505579                // Custom Profile Fields
     
    511585                        $profile_fields = $cp->generate_profile_fields_template('grab', $user_id);
    512586                        $profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template('show', false, $profile_fields[$user_id]) : array();
    513                 }
    514 
    515                 // We need to check if the module 'zebra' is accessible
    516                 $zebra_enabled = false;
    517 
    518                 if ($user->data['user_id'] != $user_id && $user->data['is_registered'])
    519                 {
    520                         include_once($phpbb_root_path . 'includes/functions_module.' . $phpEx);
    521                         $module = new p_master();
    522                         $module->list_modules('ucp');
    523                         $module->set_active('zebra');
    524 
    525                         $zebra_enabled = ($module->active_module === false) ? false : true;
    526 
    527                         unset($module);
    528587                }
    529588
     
    574633                        'U_MCP_QUEUE'                   => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
    575634
    576                         'U_SWITCH_PERMISSIONS'  => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_id}") : '',
    577 
     635                        'U_SWITCH_PERMISSIONS'  => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_id}&amp;hash=" . generate_link_hash('switchperm')) : '',
     636
     637                        'S_USER_NOTES'          => ($user_notes_enabled) ? true : false,
     638                        'S_WARN_USER'           => ($warn_user_enabled) ? true : false,
    578639                        'S_ZEBRA'                       => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false,
    579                         'U_ADD_FRIEND'          => (!$friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
    580                         'U_ADD_FOE'                     => (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
    581                         'U_REMOVE_FRIEND'       => ($friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
    582                         'U_REMOVE_FOE'          => ($foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;mode=foes&amp;usernames[]=' . $user_id) : '',
     640                        'U_ADD_FRIEND'          => (!$friend && !$foe && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
     641                        'U_ADD_FOE'                     => (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;mode=foes&amp;add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',
     642                        'U_REMOVE_FRIEND'       => ($friend && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;usernames[]=' . $user_id) : '',
     643                        'U_REMOVE_FOE'          => ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&amp;remove=1&amp;mode=foes&amp;usernames[]=' . $user_id) : '',
    583644                ));
    584645
     
    891952
    892953                $template->assign_vars(array(
    893                         'ERROR_MESSAGE'         => (sizeof($error)) ? implode('<br />', $error) : '')
     954                        'ERROR_MESSAGE'         => (sizeof($error)) ? implode('<br />', $error) : '',
     955                        'SUBJECT'                       => $subject,
     956                        'MESSAGE'                       => $message,
     957                        )
    894958                );
    895959
     
    9631027                        $search_group_id        = request_var('search_group_id', 0);
    9641028
     1029                        // when using these, make sure that we actually have values defined in $find_key_match
    9651030                        $joined_select  = request_var('joined_select', 'lt');
    9661031                        $active_select  = request_var('active_select', 'lt');
    9671032                        $count_select   = request_var('count_select', 'eq');
     1033
    9681034                        $joined                 = explode('-', request_var('joined', ''));
    9691035                        $active                 = explode('-', request_var('active', ''));
     
    10031069                        $sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', $db->any_char, $msn)) . ' ' : '';
    10041070                        $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : '';
    1005                         $sql_where .= (is_numeric($count)) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : '';
    1006                         $sql_where .= (sizeof($joined) > 1) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : '';
    1007                         $sql_where .= ($auth->acl_get('u_viewonline') && sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
     1071                        $sql_where .= (is_numeric($count) && isset($find_key_match[$count_select])) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : '';
     1072                        $sql_where .= (sizeof($joined) > 1 && isset($find_key_match[$joined_select])) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : '';
     1073                        $sql_where .= ($auth->acl_get('u_viewonline') && sizeof($active) > 1 && isset($find_key_match[$active_select])) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : '';
    10081074                        $sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : '';
    10091075
     
    12361302                        'active'                => array('active', ''),
    12371303                        'count'                 => (request_var('count', '') !== '') ? array('count', 0) : array('count', ''),
    1238                         'ipdomain'              => array('ip', ''),
     1304                        'ip'                    => array('ip', ''),
    12391305                        'first_char'    => array('first_char', ''),
    12401306                );
     
    15201586
    15211587// Output the page
    1522 page_header($page_title);
     1588page_header($page_title, false);
    15231589
    15241590$template->set_filenames(array(
     
    15321598* Prepare profile data
    15331599*/
    1534 function show_profile($data)
     1600function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false)
    15351601{
    15361602        global $config, $auth, $template, $user, $phpEx, $phpbb_root_path;
     
    16181684                'S_JABBER_ENABLED'      => ($config['jab_enable']) ? true : false,
    16191685
     1686                'S_WARNINGS'    => ($auth->acl_getf_global('m_') || $auth->acl_get('m_warn')) ? true : false,
     1687
    16201688                'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&amp;sr=posts") : '',
    1621                 'U_NOTES'               => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '',
    1622                 'U_WARN'                => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '',
     1689                'U_NOTES'               => ($user_notes_enabled && $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $user_id, true, $user->session_id) : '',
     1690                'U_WARN'                => ($warn_user_enabled && $auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $user_id, true, $user->session_id) : '',
    16231691                'U_PM'                  => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($data['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $user_id) : '',
    16241692                'U_EMAIL'               => $email,
    16251693                'U_WWW'                 => (!empty($data['user_website'])) ? $data['user_website'] : '',
     1694                'U_SHORT_WWW'                   => (!empty($data['user_website'])) ? ((strlen($data['user_website']) > 55) ? substr($data['user_website'], 0, 39) . ' ... ' . substr($data['user_website'], -10) : $data['user_website']) : '',
    16261695                'U_ICQ'                 => ($data['user_icq']) ? 'http://www.icq.com/people/webmsg.php?to=' . urlencode($data['user_icq']) : '',
    16271696                'U_AIM'                 => ($data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=aim&amp;u=' . $user_id) : '',
  • trunk/forum/posting.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: posting.php 9048 2008-11-04 15:54:43Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4040$cancel         = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false;
    4141
    42 $refresh        = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false;
     42$refresh        = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['full_editor']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false;
    4343$mode           = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', '');
    4444
     
    4646$current_time = time();
    4747
    48 
    4948// Was cancel pressed? If so then redirect to the appropriate page
    5049if ($cancel || ($current_time - $lastclick < 2 && $submit))
    5150{
    52         $redirect = ($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $topic_id) : (($forum_id) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}index.$phpEx")));
     51        $f = ($forum_id) ? 'f=' . $forum_id . '&amp;' : '';
     52        $redirect = ($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 't=' . $topic_id) : (($forum_id) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}index.$phpEx")));
    5353        redirect($redirect);
    5454}
     
    7575                }
    7676
     77                // Force forum id
     78                $sql = 'SELECT forum_id
     79                        FROM ' . TOPICS_TABLE . '
     80                        WHERE topic_id = ' . $topic_id;
     81                $result = $db->sql_query($sql);
     82                $f_id = (int) $db->sql_fetchfield('forum_id');
     83                $db->sql_freeresult($result);
     84
     85                $forum_id = (!$f_id) ? $forum_id : $f_id;
     86
    7787                $sql = 'SELECT f.*, t.*
    7888                        FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f
    7989                        WHERE t.topic_id = $topic_id
    8090                                AND (f.forum_id = t.forum_id
    81                                         OR f.forum_id = $forum_id)";
     91                                        OR f.forum_id = $forum_id)" .
     92                        (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1');
    8293        break;
    8394
     
    90101                        trigger_error('NO_POST');
    91102                }
     103
     104                // Force forum id
     105                $sql = 'SELECT forum_id
     106                        FROM ' . POSTS_TABLE . '
     107                        WHERE post_id = ' . $post_id;
     108                $result = $db->sql_query($sql);
     109                $f_id = (int) $db->sql_fetchfield('forum_id');
     110                $db->sql_freeresult($result);
     111
     112                $forum_id = (!$f_id) ? $forum_id : $f_id;
    92113
    93114                $sql = 'SELECT f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield
     
    97118                                AND u.user_id = p.poster_id
    98119                                AND (f.forum_id = t.forum_id
    99                                         OR f.forum_id = $forum_id)";
     120                                        OR f.forum_id = $forum_id)" .
     121                                (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1');
    100122        break;
    101123
     
    143165}
    144166
     167// Not able to reply to unapproved posts/topics
     168// TODO: add more descriptive language key
     169if ($auth->acl_get('m_approve', $forum_id) && ((($mode == 'reply' || $mode == 'bump') && !$post_data['topic_approved']) || ($mode == 'quote' && !$post_data['post_approved'])))
     170{
     171        trigger_error(($mode == 'reply' || $mode == 'bump') ? 'TOPIC_UNAPPROVED' : 'POST_UNAPPROVED');
     172}
     173
    145174if ($mode == 'popup')
    146175{
     
    150179
    151180$user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']);
     181
     182if ($config['enable_post_confirm'] && !$user->data['is_registered'])
     183{
     184        include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx);
     185        $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']);
     186        $captcha->init(CONFIRM_POST);
     187}
    152188
    153189// Use post_row values in favor of submitted ones...
     
    343379
    344380$post_data['post_edit_locked']  = (isset($post_data['post_edit_locked'])) ? (int) $post_data['post_edit_locked'] : 0;
     381$post_data['post_subject_md5']  = (isset($post_data['post_subject']) && $mode == 'edit') ? md5($post_data['post_subject']) : '';
    345382$post_data['post_subject']              = (in_array($mode, array('quote', 'edit'))) ? $post_data['post_subject'] : ((isset($post_data['topic_title'])) ? $post_data['topic_title'] : '');
    346383$post_data['topic_time_limit']  = (isset($post_data['topic_time_limit'])) ? (($post_data['topic_time_limit']) ? (int) $post_data['topic_time_limit'] / 86400 : (int) $post_data['topic_time_limit']) : 0;
     
    467504// HTML, BBCode, Smilies, Images and Flash status
    468505$bbcode_status  = ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id)) ? true : false;
    469 $smilies_status = ($bbcode_status && $config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? true : false;
     506$smilies_status = ($config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? true : false;
    470507$img_status             = ($bbcode_status && $auth->acl_get('f_img', $forum_id)) ? true : false;
    471508$url_status             = ($config['allow_post_links']) ? true : false;
    472509$flash_status   = ($bbcode_status && $auth->acl_get('f_flash', $forum_id) && $config['allow_post_flash']) ? true : false;
    473 $quote_status   = ($auth->acl_get('f_reply', $forum_id)) ? true : false;
     510$quote_status   = true;
    474511
    475512// Save Draft
     
    517554                        );
    518555
     556                        $hidden_fields = array(
     557                                'icon_id'                       => 0,
     558
     559                                'disable_bbcode'        => false,
     560                                'disable_smilies'       => false,
     561                                'disable_magic_url'     => false,
     562                                'attach_sig'            => true,
     563                                'lock_topic'            => false,
     564
     565                                'topic_type'            => POST_NORMAL,
     566                                'topic_time_limit'      => 0,
     567
     568                                'poll_title'            => '',
     569                                'poll_option_text'      => '',
     570                                'poll_max_options'      => 1,
     571                                'poll_length'           => 0,
     572                                'poll_vote_change'      => false,
     573                        );
     574
     575                        foreach ($hidden_fields as $name => $default)
     576                        {
     577                                if (!isset($_POST[$name]))
     578                                {
     579                                        // Don't include it, if its not available
     580                                        unset($hidden_fields[$name]);
     581                                        continue;
     582                                }
     583
     584                                if (is_bool($default))
     585                                {
     586                                        // Use the string representation
     587                                        $hidden_fields[$name] = request_var($name, '');
     588                                }
     589                                else
     590                                {
     591                                        $hidden_fields[$name] = request_var($name, $default);
     592                                }
     593                        }
     594
     595                        $s_hidden_fields .= build_hidden_fields($hidden_fields);
     596
    519597                        confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
    520598                }
     
    565643}
    566644
    567 $solved_captcha = false;
    568645
    569646if ($submit || $preview || $refresh)
     
    579656        $post_data['topic_type']                = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));
    580657        $post_data['topic_time_limit']  = request_var('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0));
    581         $post_data['icon_id']                   = request_var('icon', 0);
     658
     659        if ($post_data['enable_icons'] && $auth->acl_get('f_icons', $forum_id))
     660        {
     661                $post_data['icon_id'] = request_var('icon', (int) $post_data['icon_id']);
     662        }
    582663
    583664        $post_data['enable_bbcode']             = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true;
     
    647728                $post_data['poll_option_text']  = utf8_normalize_nfc(request_var('poll_option_text', '', true));
    648729                $post_data['poll_max_options']  = request_var('poll_max_options', 1);
    649                 $post_data['poll_vote_change']  = ($auth->acl_get('f_votechg', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0;
     730                $post_data['poll_vote_change']  = ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0;
    650731        }
    651732
     
    674755        $message_md5 = md5($message_parser->message);
    675756
     757        // If editing and checksum has changed we know the post was edited while we're editing
     758        // Notify and show user the changed post
     759        if ($mode == 'edit' && $post_data['forum_flags'] & FORUM_FLAG_POST_REVIEW)
     760        {
     761                $edit_post_message_checksum = request_var('edit_post_message_checksum', '');
     762                $edit_post_subject_checksum = request_var('edit_post_subject_checksum', '');
     763
     764                // $post_data['post_checksum'] is the checksum of the post submitted in the meantime
     765                // $message_md5 is the checksum of the post we're about to submit
     766                // $edit_post_message_checksum is the checksum of the post we're editing
     767                // ...
     768
     769                // We make sure nobody else made exactly the same change
     770                // we're about to submit by also checking $message_md5 != $post_data['post_checksum']
     771                if (($edit_post_message_checksum !== '' && $edit_post_message_checksum != $post_data['post_checksum'] && $message_md5 != $post_data['post_checksum'])
     772                 || ($edit_post_subject_checksum !== '' && $edit_post_subject_checksum != $post_data['post_subject_md5'] && md5($post_data['post_subject']) != $post_data['post_subject_md5']))
     773                {
     774                        if (topic_review($topic_id, $forum_id, 'post_review_edit', $post_id))
     775                        {
     776                                $template->assign_vars(array(
     777                                        'S_POST_REVIEW'                 => true,
     778
     779                                        'L_POST_REVIEW'                 => $user->lang['POST_REVIEW_EDIT'],
     780                                        'L_POST_REVIEW_EXPLAIN' => $user->lang['POST_REVIEW_EDIT_EXPLAIN'],
     781                                ));
     782                        }
     783
     784                        $submit = false;
     785                        $refresh = true;
     786                }
     787        }
     788
    676789        // Check checksum ... don't re-parse message if the same
    677790        $update_message = ($mode != 'edit' || $message_md5 != $post_data['post_checksum'] || $status_switch || strlen($post_data['bbcode_uid']) < BBCODE_UID_LEN) ? true : false;
     791
     792        // Also check if subject got updated...
     793        $update_subject = $mode != 'edit' || ($post_data['post_subject_md5'] && $post_data['post_subject_md5'] != md5($post_data['post_subject']));
    678794
    679795        // Parse message
     
    742858        if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply')))
    743859        {
    744                 $confirm_id = request_var('confirm_id', '');
    745                 $confirm_code = request_var('confirm_code', '');
    746 
    747                 $sql = 'SELECT code
    748                         FROM ' . CONFIRM_TABLE . "
    749                         WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'
    750                                 AND session_id = '" . $db->sql_escape($user->session_id) . "'
    751                                 AND confirm_type = " . CONFIRM_POST;
    752                 $result = $db->sql_query($sql);
    753                 $confirm_row = $db->sql_fetchrow($result);
    754                 $db->sql_freeresult($result);
    755 
    756                 if (empty($confirm_row['code']) || strcasecmp($confirm_row['code'], $confirm_code) !== 0)
    757                 {
    758                         $error[] = $user->lang['CONFIRM_CODE_WRONG'];
    759                 }
    760                 else
    761                 {
    762                         $solved_captcha = true;
     860                $captcha_data = array(
     861                        'message'       => utf8_normalize_nfc(request_var('message', '', true)),
     862                        'subject'       => utf8_normalize_nfc(request_var('subject', '', true)),
     863                        'username'      => utf8_normalize_nfc(request_var('username', '', true)),
     864                );
     865                $vc_response = $captcha->validate($captcha_data);
     866                if ($vc_response)
     867                {
     868                        $error[] = $vc_response;
    763869                }
    764870        }
     
    887993                                        $db->sql_freeresult($result);
    888994
    889                                         if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id))
     995                                        if ($forum_type != FORUM_POST || !$auth->acl_get('f_post', $to_forum_id) || (!$auth->acl_get('m_approve', $to_forum_id) && !$auth->acl_get('f_noapprove', $to_forum_id)))
    890996                                        {
    891997                                                $to_forum_id = 0;
     
    9991105                        }
    10001106
    1001                         $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message);
    1002 
    1003                         // Check the permissions for post approval, as well as the queue trigger where users are put on approval with a post count lower than specified. Moderators are not affected.
    1004                         if ((($config['enable_queue_trigger'] && $user->data['user_posts'] < $config['queue_trigger_posts']) || !$auth->acl_get('f_noapprove', $data['forum_id'])) && !$auth->acl_get('m_approve', $data['forum_id']))
     1107                        // The last parameter tells submit_post if search indexer has to be run
     1108                        $redirect_url = submit_post($mode, $post_data['post_subject'], $post_data['username'], $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
     1109
     1110                        if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
     1111                        {
     1112                                $captcha->reset();
     1113                        }
     1114
     1115                        // Check the permissions for post approval. Moderators are not affected.
     1116                        if ((!$auth->acl_get('f_noapprove', $data['forum_id']) && !$auth->acl_get('m_approve', $data['forum_id']) && empty($data['force_approved_state'])) || (isset($data['force_approved_state']) && !$data['force_approved_state']))
    10051117                        {
    10061118                                meta_refresh(10, $redirect_url);
     
    11291241if ($mode == 'quote' && !$submit && !$preview && !$refresh)
    11301242{
    1131         $message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
     1243        if ($config['allow_bbcode'])
     1244        {
     1245                $message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
     1246        }
     1247        else
     1248        {
     1249                $offset = 0;
     1250                $quote_string = "&gt; ";
     1251                $message = censor_text(trim($message_parser->message));
     1252                // see if we are nesting. It's easily tricked but should work for one level of nesting
     1253                if (strpos($message, "&gt;") !== false)
     1254                {
     1255                        $offset = 10;
     1256                }
     1257                $message = utf8_wordwrap($message, 75 + $offset, "\n");
     1258
     1259                $message = $quote_string . $message;
     1260                $message = str_replace("\n", "\n" . $quote_string, $message);
     1261                $message_parser->message =  $post_data['quote_username'] . " " . $user->lang['WROTE'] . " :\n" . $message . "\n";
     1262        }
    11321263}
    11331264
     
    11581289// Forum moderators?
    11591290$moderators = array();
    1160 get_moderators($moderators, $forum_id);
     1291if ($config['load_moderators'])
     1292{
     1293        get_moderators($moderators, $forum_id);
     1294}
    11611295
    11621296// Generate smiley listing
     
    12191353generate_forum_rules($post_data);
    12201354
    1221 if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_captcha === false && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
    1222 {
    1223         // Show confirm image
    1224         $sql = 'DELETE FROM ' . CONFIRM_TABLE . "
    1225                 WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
    1226                         AND confirm_type = " . CONFIRM_POST;
    1227         $db->sql_query($sql);
    1228 
    1229         // Generate code
    1230         $code = gen_rand_string(mt_rand(5, 8));
    1231         $confirm_id = md5(unique_id($user->ip));
    1232         $seed = hexdec(substr(unique_id(), 4, 10));
    1233 
    1234         // compute $seed % 0x7fffffff
    1235         $seed -= 0x7fffffff * floor($seed / 0x7fffffff);
    1236 
    1237         $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array(
    1238                 'confirm_id'    => (string) $confirm_id,
    1239                 'session_id'    => (string) $user->session_id,
    1240                 'confirm_type'  => (int) CONFIRM_POST,
    1241                 'code'                  => (string) $code,
    1242                 'seed'                  => (int) $seed)
    1243         );
    1244         $db->sql_query($sql);
     1355// Posting uses is_solved for legacy reasons. Plugins have to use is_solved to force themselves to be displayed.
     1356if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === false) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
     1357{
    12451358
    12461359        $template->assign_vars(array(
    12471360                'S_CONFIRM_CODE'                        => true,
    1248                 'CONFIRM_ID'                            => $confirm_id,
    1249                 'CONFIRM_IMAGE'                         => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&amp;id=' . $confirm_id . '&amp;type=' . CONFIRM_POST) . '" alt="" title="" />',
    1250                 'L_POST_CONFIRM_EXPLAIN'        => sprintf($user->lang['POST_CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'),
     1361                'CAPTCHA_TEMPLATE'                      => $captcha->get_template(),
    12511362        ));
    12521363}
     
    12561367$s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', $draft_id) . '" />' : '';
    12571368
     1369if ($mode == 'edit')
     1370{
     1371        $s_hidden_fields .= build_hidden_fields(array(
     1372                'edit_post_message_checksum'    => $post_data['post_checksum'],
     1373                'edit_post_subject_checksum'    => $post_data['post_subject_md5'],
     1374        ));
     1375}
     1376
    12581377// Add the confirm id/code pair to the hidden fields, else an error is displayed on next submit/preview
    1259 if ($solved_captcha !== false)
    1260 {
    1261         $s_hidden_fields .= build_hidden_fields(array(
    1262                 'confirm_id'            => request_var('confirm_id', ''),
    1263                 'confirm_code'          => request_var('confirm_code', ''))
    1264         );
     1378if (isset($captcha) && $captcha->is_solved() !== false)
     1379{
     1380        $s_hidden_fields .= build_hidden_fields($captcha->get_hidden_fields());
    12651381}
    12661382
     
    12871403        'SMILIES_STATUS'                => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
    12881404        'URL_STATUS'                    => ($bbcode_status && $url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
     1405        'MAX_FONT_SIZE'                 => (int) $config['max_post_font_size'],
    12891406        'MINI_POST_IMG'                 => $user->img('icon_post_target', $user->lang['POST']),
    12901407        'POST_DATE'                             => ($post_data['post_time']) ? $user->format_date($post_data['post_time']) : '',
     
    13031420        'S_DISPLAY_USERNAME'            => (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS)) ? true : false,
    13041421        'S_SHOW_TOPIC_ICONS'            => $s_topic_icons,
    1305         'S_DELETE_ALLOWED'                      => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id))) ? true : false,
     1422        'S_DELETE_ALLOWED'                      => ($mode == 'edit' && (($post_id == $post_data['topic_last_post_id'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id) && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])) || $auth->acl_get('m_delete', $forum_id))) ? true : false,
    13061423        'S_BBCODE_ALLOWED'                      => $bbcode_status,
    13071424        'S_BBCODE_CHECKED'                      => ($bbcode_checked) ? ' checked="checked"' : '',
     
    13411458        $template->assign_vars(array(
    13421459                'S_SHOW_POLL_BOX'               => true,
    1343                 'S_POLL_VOTE_CHANGE'    => ($auth->acl_get('f_votechg', $forum_id)),
     1460                'S_POLL_VOTE_CHANGE'    => ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id)),
    13441461                'S_POLL_DELETE'                 => ($mode == 'edit' && sizeof($post_data['poll_options']) && ((!$post_data['poll_last_vote'] && $post_data['poster_id'] == $user->data['user_id'] && $auth->acl_get('f_delete', $forum_id)) || $auth->acl_get('m_delete', $forum_id))),
    13451462                'S_POLL_DELETE_CHECKED' => (!empty($poll_delete)) ? true : false,
     
    13621479
    13631480// Output page ...
    1364 page_header($page_title);
     1481page_header($page_title, false);
    13651482
    13661483$template->set_filenames(array(
     
    13901507        ($forum_style) ? $user->setup('posting', $forum_style) : $user->setup('posting');
    13911508
    1392         page_header($user->lang['PROGRESS_BAR']);
     1509        page_header($user->lang['PROGRESS_BAR'], false);
    13931510
    13941511        $template->set_filenames(array(
     
    14151532
    14161533        // If moderator removing post or user itself removing post, present a confirmation screen
    1417         if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])))
     1534        if ($auth->acl_get('m_delete', $forum_id) || ($post_data['poster_id'] == $user->data['user_id'] && $user->data['is_registered'] && $auth->acl_get('f_delete', $forum_id) && $post_id == $post_data['topic_last_post_id'] && !$post_data['post_edit_locked'] && ($post_data['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time'])))
    14181535        {
    14191536                $s_hidden_fields = build_hidden_fields(array(
     
    14391556
    14401557                        $next_post_id = delete_post($forum_id, $topic_id, $post_id, $data);
     1558                        $post_username = ($post_data['poster_id'] == ANONYMOUS && !empty($post_data['post_username'])) ? $post_data['post_username'] : $post_data['username'];
    14411559
    14421560                        if ($next_post_id === false)
    14431561                        {
    1444                                 add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title']);
     1562                                add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title'], $post_username);
    14451563
    14461564                                $meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
     
    14491567                        else
    14501568                        {
    1451                                 add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_POST', $post_data['post_subject']);
     1569                                add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_POST', $post_data['post_subject'], $post_username);
    14521570
    14531571                                $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p=$next_post_id") . "#p$next_post_id";
  • trunk/forum/report.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: report.php 8479 2008-03-29 00:22:48Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2525$forum_id               = request_var('f', 0);
    2626$post_id                = request_var('p', 0);
     27$pm_id                  = request_var('pm', 0);
    2728$reason_id              = request_var('reason_id', 0);
    2829$report_text    = utf8_normalize_nfc(request_var('report_text', '', true));
     
    3132$submit = (isset($_POST['submit'])) ? true : false;
    3233
    33 if (!$post_id)
     34if (!$post_id && (!$pm_id || !$config['allow_pm_report']))
    3435{
    3536        trigger_error('NO_POST_SELECTED');
    3637}
    3738
    38 $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;p=$post_id") . "#p$post_id";
     39if ($post_id)
     40{
     41        $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;p=$post_id") . "#p$post_id";
     42        $pm_id = 0;
     43}
     44else
     45{
     46        $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&p=$pm_id");
     47        $post_id = 0;
     48        $forum_id = 0;
     49}
    3950
    4051// Has the report been cancelled?
     
    4455}
    4556
    46 // Grab all relevant data
    47 $sql = 'SELECT t.*, p.*
    48         FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
    49         WHERE p.post_id = $post_id
    50                 AND p.topic_id = t.topic_id";
    51 $result = $db->sql_query($sql);
    52 $report_data = $db->sql_fetchrow($result);
    53 $db->sql_freeresult($result);
    54 
    55 if (!$report_data)
    56 {
    57         trigger_error('POST_NOT_EXIST');
    58 }
    59 
    60 $forum_id = (int) ($report_data['forum_id']) ? $report_data['forum_id'] : $forum_id;
    61 $topic_id = (int) $report_data['topic_id'];
    62 
    63 $sql = 'SELECT *
    64         FROM ' . FORUMS_TABLE . '
    65         WHERE forum_id = ' . $forum_id;
    66 $result = $db->sql_query($sql);
    67 $forum_data = $db->sql_fetchrow($result);
    68 $db->sql_freeresult($result);
    69 
    70 if (!$forum_data)
    71 {
    72         trigger_error('FORUM_NOT_EXIST');
    73 }
    74 
    75 // Check required permissions
    76 $acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT');
    77 
    78 foreach ($acl_check_ary as $acl => $error)
    79 {
    80         if (!$auth->acl_get($acl, $forum_id))
    81         {
    82                 trigger_error($error);
    83         }
    84 }
    85 unset($acl_check_ary);
    86 
    87 if ($report_data['post_reported'])
    88 {
    89         $message = $user->lang['ALREADY_REPORTED'];
    90         $message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
    91         trigger_error($message);
     57if ($post_id)
     58{
     59        // Grab all relevant data
     60        $sql = 'SELECT t.*, p.*
     61                FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
     62                WHERE p.post_id = $post_id
     63                        AND p.topic_id = t.topic_id";
     64        $result = $db->sql_query($sql);
     65        $report_data = $db->sql_fetchrow($result);
     66        $db->sql_freeresult($result);
     67
     68        if (!$report_data)
     69        {
     70                trigger_error('POST_NOT_EXIST');
     71        }
     72
     73        $forum_id = (int) ($report_data['forum_id']) ? $report_data['forum_id'] : $forum_id;
     74        $topic_id = (int) $report_data['topic_id'];
     75
     76        $sql = 'SELECT *
     77                FROM ' . FORUMS_TABLE . '
     78                WHERE forum_id = ' . $forum_id;
     79        $result = $db->sql_query($sql);
     80        $forum_data = $db->sql_fetchrow($result);
     81        $db->sql_freeresult($result);
     82
     83        if (!$forum_data)
     84        {
     85                trigger_error('FORUM_NOT_EXIST');
     86        }
     87
     88        // Check required permissions
     89        $acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT');
     90
     91        foreach ($acl_check_ary as $acl => $error)
     92        {
     93                if (!$auth->acl_get($acl, $forum_id))
     94                {
     95                        trigger_error($error);
     96                }
     97        }
     98        unset($acl_check_ary);
     99
     100        if ($report_data['post_reported'])
     101        {
     102                $message = $user->lang['ALREADY_REPORTED'];
     103                $message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
     104                trigger_error($message);
     105        }
     106}
     107else
     108{
     109        // Grab all relevant data
     110        $sql = 'SELECT p.*, pt.*
     111                FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . " pt
     112                WHERE p.msg_id = $pm_id
     113                        AND p.msg_id = pt.msg_id
     114                        AND (p.author_id = " . $user->data['user_id'] . " OR pt.user_id = " . $user->data['user_id'] . ")";
     115        $result = $db->sql_query($sql);
     116        $report_data = $db->sql_fetchrow($result);
     117        $db->sql_freeresult($result);
     118
     119        if (!$report_data)
     120        {
     121                $user->add_lang('ucp');
     122                trigger_error('NO_MESSAGE');
     123        }
     124
     125        if ($report_data['message_reported'])
     126        {
     127                $message = $user->lang['ALREADY_REPORTED_PM'];
     128                $message .= '<br /><br />' . sprintf($user->lang['RETURN_PM'], '<a href="' . $redirect_url . '">', '</a>');
     129                trigger_error($message);
     130        }
    92131}
    93132
     
    110149                'reason_id'             => (int) $reason_id,
    111150                'post_id'               => $post_id,
     151                'pm_id'                 => $pm_id,
    112152                'user_id'               => (int) $user->data['user_id'],
    113153                'user_notify'   => (int) $user_notify,
     
    121161        $report_id = $db->sql_nextid();
    122162
    123         if (!$report_data['post_reported'])
     163        if ($post_id)
    124164        {
    125165                $sql = 'UPDATE ' . POSTS_TABLE . '
     
    127167                        WHERE post_id = ' . $post_id;
    128168                $db->sql_query($sql);
    129         }
    130 
    131         if (!$report_data['topic_reported'])
    132         {
    133                 $sql = 'UPDATE ' . TOPICS_TABLE . '
    134                         SET topic_reported = 1
    135                         WHERE topic_id = ' . $report_data['topic_id'] . '
    136                                 OR topic_moved_id = ' . $report_data['topic_id'];
     169
     170                if (!$report_data['topic_reported'])
     171                {
     172                        $sql = 'UPDATE ' . TOPICS_TABLE . '
     173                                SET topic_reported = 1
     174                                WHERE topic_id = ' . $report_data['topic_id'] . '
     175                                        OR topic_moved_id = ' . $report_data['topic_id'];
     176                        $db->sql_query($sql);
     177                }
     178
     179                $lang_return = $user->lang['RETURN_TOPIC'];
     180                $lang_success = $user->lang['POST_REPORTED_SUCCESS'];
     181        }
     182        else
     183        {
     184                $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
     185                        SET message_reported = 1
     186                        WHERE msg_id = ' . $pm_id;
    137187                $db->sql_query($sql);
     188
     189                $sql_ary = array(
     190                        'msg_id'                => $pm_id,
     191                        'user_id'               => ANONYMOUS,
     192                        'author_id'             => (int) $report_data['author_id'],
     193                        'pm_deleted'    => 0,
     194                        'pm_new'                => 0,
     195                        'pm_unread'             => 0,
     196                        'pm_replied'    => 0,
     197                        'pm_marked'             => 0,
     198                        'pm_forwarded'  => 0,
     199                        'folder_id'             => PRIVMSGS_INBOX,
     200                );
     201
     202                $sql = 'INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
     203                $db->sql_query($sql);
     204
     205                $lang_return = $user->lang['RETURN_PM'];
     206                $lang_success = $user->lang['PM_REPORTED_SUCCESS'];
    138207        }
    139208
    140209        meta_refresh(3, $redirect_url);
    141210
    142         $message = $user->lang['POST_REPORTED_SUCCESS'] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
     211        $message = $lang_success . '<br /><br />' . sprintf($lang_return, '<a href="' . $redirect_url . '">', '</a>');
    143212        trigger_error($message);
    144213}
     
    147216display_reasons($reason_id);
    148217
     218$page_title = ($pm_id) ? $user->lang['REPORT_MESSAGE'] : $user->lang['REPORT_POST'];
     219
    149220$template->assign_vars(array(
     221        'S_REPORT_POST'         => ($pm_id) ? false : true,
    150222        'REPORT_TEXT'           => $report_text,
    151         'S_REPORT_ACTION'       => append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $post_id),
     223        'S_REPORT_ACTION'       => append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $post_id . '&amp;pm=' . $pm_id),
    152224
    153225        'S_NOTIFY'                      => $user_notify,
     
    158230
    159231// Start output of page
    160 page_header($user->lang['REPORT_POST']);
     232page_header($page_title);
    161233
    162234$template->set_filenames(array(
  • trunk/forum/search.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: search.php 9040 2008-11-01 19:00:50Z naderman $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    4848$search_forum   = request_var('fid', array(0));
    4949
     50// We put login boxes for the case if search_id is egosearch or unreadposts
     51// because a guest should be able to log in even if guests search is not permitted
     52
     53// Egosearch is an author search
     54if ($search_id == 'egosearch')
     55{
     56        $author_id = $user->data['user_id'];
     57
     58        if ($user->data['user_id'] == ANONYMOUS)
     59        {
     60                login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
     61        }
     62}
     63
     64// Search for unread posts needs user to be logged in if topics tracking for guests is disabled
     65if ($search_id == 'unreadposts' && !$config['load_anon_lastread'] && !$user->data['is_registered'])
     66{
     67        login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']);
     68}
     69
    5070// Is user able to search? Has search been disabled?
    5171if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search'])
     
    85105        $id_ary = array();
    86106
    87         // egosearch is an author search
    88         if ($search_id == 'egosearch')
    89         {
    90                 $author_id = $user->data['user_id'];
    91 
    92                 if ($user->data['user_id'] == ANONYMOUS)
    93                 {
    94                         login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']);
    95                 }
    96         }
    97 
    98107        // If we are looking for authors get their ids
    99108        $author_id_ary = array();
     109        $sql_author_match = '';
    100110        if ($author_id)
    101111        {
     
    114124                        FROM ' . USERS_TABLE . "
    115125                        WHERE $sql_where
    116                                 AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';
     126                                AND user_type <> " . USER_IGNORE;
    117127                $result = $db->sql_query_limit($sql, 100);
    118128
     
    122132                }
    123133                $db->sql_freeresult($result);
     134
     135                $sql_where = (strpos($author, '*') !== false) ? ' post_username ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " post_username = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
     136
     137                $sql = 'SELECT 1 as guest_post
     138                        FROM ' . POSTS_TABLE . "
     139                        WHERE $sql_where
     140                                AND poster_id = " . ANONYMOUS;
     141                $result = $db->sql_query_limit($sql, 1);
     142                $found_guest_post = $db->sql_fetchfield('guest_post');
     143                $db->sql_freeresult($result);
     144
     145                if ($found_guest_post)
     146                {
     147                        $author_id_ary[] = ANONYMOUS;
     148                        $sql_author_match = (strpos($author, '*') !== false) ? ' ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
     149                }
    124150
    125151                if (!sizeof($author_id_ary))
     
    156182        $not_in_fid = (sizeof($ex_fid_ary)) ? 'WHERE ' . $db->sql_in_set('f.forum_id', $ex_fid_ary, true) . " OR (f.forum_password <> '' AND fa.user_id <> " . (int) $user->data['user_id'] . ')' : "";
    157183
    158         $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, fa.user_id
     184        $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, f.forum_flags, fa.user_id
    159185                FROM ' . FORUMS_TABLE . ' f
    160186                LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id
     
    169195        {
    170196                if ($row['forum_password'] && $row['user_id'] != $user->data['user_id'])
     197                {
     198                        $ex_fid_ary[] = (int) $row['forum_id'];
     199                        continue;
     200                }
     201
     202                // Exclude forums from active topics
     203                if (!($row['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) && ($search_id == 'active_topics'))
    171204                {
    172205                        $ex_fid_ary[] = (int) $row['forum_id'];
     
    308341                                        $last_post_time = '';
    309342                                }
    310 
    311343
    312344                                if ($sort_key == 'a')
     
    342374                        break;
    343375
     376                        case 'unreadposts':
     377                                $l_search_title = $user->lang['SEARCH_UNREAD'];
     378                                // force sorting
     379                                $show_results = 'topics';
     380                                $sort_key = 't';
     381                                $sort_by_sql['t'] = 't.topic_last_post_time';
     382                                $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
     383
     384                                $sql_where = 'AND t.topic_moved_id = 0
     385                                        ' . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
     386                                        ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '');
     387
     388                                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);
     389                                $s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = '';
     390
     391                                $unread_list = array();
     392                                $unread_list = get_unread_topics($user->data['user_id'], $sql_where, $sql_sort);
     393
     394                                if (!empty($unread_list))
     395                                {
     396                                        $sql = 'SELECT t.topic_id
     397                                                FROM ' . TOPICS_TABLE . ' t
     398                                                WHERE ' . $db->sql_in_set('t.topic_id', array_keys($unread_list)) . "
     399                                                $sql_sort";
     400                                        $field = 'topic_id';
     401                                }
     402                        break;
     403
    344404                        case 'newposts':
    345405                                $l_search_title = $user->lang['SEARCH_NEW'];
     
    373433                                                        ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . "
    374434                                                $sql_sort";
     435/*
     436                [Fix] queued replies missing from "view new posts" (Bug #42705 - Patch by Paul)
     437                - Creates temporary table, query is far from optimized
     438
     439                                        $sql = 'SELECT t.topic_id
     440                                                FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
     441                                                WHERE p.post_time > ' . $user->data['user_lastvisit'] . '
     442                                                        AND t.topic_id = p.topic_id
     443                                                        AND t.topic_moved_id = 0
     444                                                        ' . $m_approve_fid_sql . '
     445                                                        ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . "
     446                                                GROUP BY t.topic_id
     447                                                $sql_sort";
     448*/
    375449                                        $field = 'topic_id';
    376450                                }
     
    396470                        while ($row = $db->sql_fetchrow($result))
    397471                        {
    398                                 $id_ary[] = $row[$field];
     472                                $id_ary[] = (int) $row[$field];
    399473                        }
    400474                        $db->sql_freeresult($result);
     
    416490        if (!empty($search->search_query))
    417491        {
    418                 $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page);
     492                $total_match_count = $search->keyword_search($show_results, $search_fields, $search_terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
    419493        }
    420494        else if (sizeof($author_id_ary))
    421495        {
    422496                $firstpost_only = ($search_fields === 'firstpost' || $search_fields == 'titleonly') ? true : false;
    423                 $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $id_ary, $start, $per_page);
     497                $total_match_count = $search->author_search($show_results, $firstpost_only, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $m_approve_fid_ary, $topic_id, $author_id_ary, $sql_author_match, $id_ary, $start, $per_page);
    424498        }
    425499
     
    471545
    472546        $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
    473         $u_show_results = ($show_results != 'posts') ? '&amp;sr=' . $show_results : '';
     547        $u_show_results = '&amp;sr=' . $show_results;
    474548        $u_search_forum = implode('&amp;fid%5B%5D=', $search_forum);
    475549
    476550        $u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results);
    477551        $u_search .= ($search_id) ? '&amp;search_id=' . $search_id : '';
    478         $u_search .= ($u_hilit) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($search->search_query)) : '';
     552        $u_search .= ($u_hilit) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
    479553        $u_search .= ($search_terms != 'all') ? '&amp;terms=' . $search_terms : '';
    480554        $u_search .= ($topic_id) ? '&amp;t=' . $topic_id : '';
     
    582656                        while ($row = $db->sql_fetchrow($result))
    583657                        {
     658                                $row['forum_id'] = (int) $row['forum_id'];
     659                                $row['topic_id'] = (int) $row['topic_id'];
     660
    584661                                if ($row['topic_status'] == ITEM_MOVED)
    585662                                {
     
    768845                        }
    769846
    770                         $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$u_forum_id&amp;t=$result_topic_id" . (($u_hilit) ? "&amp;hilit=$u_hilit" : ''));
     847                        $view_topic_url_params = "f=$u_forum_id&amp;t=$result_topic_id" . (($u_hilit) ? "&amp;hilit=$u_hilit" : '');
     848                        $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
    771849
    772850                        $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies'];
     
    826904                                        'S_POSTS_UNAPPROVED'    => $posts_unapproved,
    827905
    828                                         'U_LAST_POST'                   => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
     906                                        'U_LAST_POST'                   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
    829907                                        'U_LAST_POST_AUTHOR'    => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
    830908                                        'U_TOPIC_AUTHOR'                => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
    831                                         'U_NEWEST_POST'                 => $view_topic_url . '&amp;view=unread#unread',
     909                                        'U_NEWEST_POST'                 => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;view=unread') . '#unread',
    832910                                        'U_MCP_REPORT'                  => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=reports&amp;t=' . $result_topic_id, true, $user->session_id),
    833911                                        'U_MCP_QUEUE'                   => $u_mcp_queue,
     
    9301008        page_footer();
    9311009}
    932 
    9331010
    9341011// Search forum
  • trunk/forum/style.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: style.php 8780 2008-08-22 12:52:48Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    1616$phpEx = substr(strrchr(__FILE__, '.'), 1);
    1717
    18 // Report all errors, except notices
    19 error_reporting(E_ALL ^ E_NOTICE);
     18// Report all errors, except notices and deprecation messages
     19if (!defined('E_DEPRECATED'))
     20{
     21        define('E_DEPRECATED', 8192);
     22}
     23error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
    2024
    2125require($phpbb_root_path . 'config.' . $phpEx);
     
    3236
    3337// Load Extensions
    34 if (!empty($load_extensions))
     38if (!empty($load_extensions) && function_exists('dl'))
    3539{
    3640        $load_extensions = explode(',', $load_extensions);
     
    9296        if (!$user)
    9397        {
    94                 $id                     = $config['default_style'];
    95                 $recompile      = false;
     98                $id                     = ($id) ? $id : $config['default_style'];
     99//              Commented out because calls do not always include the SID anymore
     100//              $recompile      = false;
    96101                $user           = array('user_id' => ANONYMOUS);
    97102        }
     
    119124        $user_image_lang = (file_exists($phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $user['user_lang'] : $config['default_lang'];
    120125
     126        // Same query in session.php
    121127        $sql = 'SELECT *
    122128                FROM ' . STYLES_IMAGESET_DATA_TABLE . '
    123129                WHERE imageset_id = ' . $theme['imageset_id'] . "
    124                 AND image_filename <> '' 
     130                AND image_filename <> ''
    125131                AND image_lang IN ('" . $db->sql_escape($user_image_lang) . "', '')";
    126132        $result = $db->sql_query($sql, 3600);
     
    258264                                        $replace[] = $imgs[$img]['src'];
    259265                                break;
    260                                
     266
    261267                                case 'WIDTH':
    262268                                        $replace[] = $imgs[$img]['width'];
    263269                                break;
    264        
     270
    265271                                case 'HEIGHT':
    266272                                        $replace[] = $imgs[$img]['height'];
  • trunk/forum/styles/prosilver/imageset/imageset.cfg

    r400 r702  
    33#
    44# @package phpBB3
    5 # @copyright (c) 2006 phpBB Group 
    6 # @license http://opensource.org/licenses/gpl-license.php GNU Public License 
     5# @copyright (c) 2006 phpBB Group
     6# @license http://opensource.org/licenses/gpl-license.php GNU Public License
    77#
    88#
     
    1212#
    1313# Values get trimmed, if you want to add a space in front or at the end of
    14 # the value, then enclose the value with single or double quotes. 
     14# the value, then enclose the value with single or double quotes.
    1515# Single and double quotes do not need to be escaped.
    1616#
    17 # 
     17#
    1818
    1919# General Information about this style
    2020name = prosilver
    2121copyright = &copy; phpBB Group, 2007
    22 version = 3.0.4
     22version = 3.0.7
    2323
    2424# Images
    2525img_site_logo = site_logo.gif*52*139
    26 img_poll_left = 
    27 img_poll_center = 
    28 img_poll_right = 
    29 img_icon_friend = 
    30 img_icon_foe = 
     26img_poll_left =
     27img_poll_center =
     28img_poll_right =
     29img_icon_friend =
     30img_icon_foe =
    3131
    3232img_forum_link = forum_link.gif*27*27
     
    112112img_icon_topic_unapproved = icon_topic_unapproved.gif*14*16
    113113
    114 img_icon_user_profile = 
     114img_icon_user_profile =
    115115
    116116img_icon_user_warn = icon_user_warn.gif*20*20
  • trunk/forum/styles/prosilver/style.cfg

    r400 r702  
    33#
    44# @package phpBB3
    5 # @copyright (c) 2005 phpBB Group 
    6 # @license http://opensource.org/licenses/gpl-license.php GNU Public License 
     5# @copyright (c) 2005 phpBB Group
     6# @license http://opensource.org/licenses/gpl-license.php GNU Public License
    77#
    88#
     
    1212#
    1313# Values get trimmed, if you want to add a space in front or at the end of
    14 # the value, then enclose the value with single or double quotes. 
     14# the value, then enclose the value with single or double quotes.
    1515# Single and double quotes do not need to be escaped.
    1616#
    17 # 
     17#
    1818
    1919# General Information about this style
    2020name = prosilver
    2121copyright = &copy; phpBB Group, 2007
    22 version = 3.0.4
     22version = 3.0.7
  • trunk/forum/styles/prosilver/template/attachment.html

    r400 r702  
    6262                <!-- ELSEIF _file.S_FLASH_FILE -->
    6363                        <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{_file.WIDTH}" height="{_file.HEIGHT}">
    64                                 <param name="movie" value="{_file.U_DOWNLOAD_LINK}" />
     64                                <param name="movie" value="{_file.U_VIEW_LINK}" />
    6565                                <param name="play" value="true" />
    6666                                <param name="loop" value="true" />
     
    6868                                <param name="allowScriptAccess" value="never" />
    6969                                <param name="allowNetworking" value="internal" />
    70                                 <embed src="{_file.U_DOWNLOAD_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never" allownetworking="internal"></embed>
     70                                <embed src="{_file.U_VIEW_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never" allownetworking="internal"></embed>
    7171                        </object>
    7272                <!-- ELSEIF _file.S_QUICKTIME_FILE -->
  • trunk/forum/styles/prosilver/template/drafts.html

    r400 r702  
    1111</div>
    1212
    13 <div class="forumbg">
     13<div class="<!-- IF not S_PRIVMSGS -->forumbg<!-- ELSE -->panel<!-- ENDIF -->">
    1414        <div class="inner"><span class="corners-top"><span></span></span>
    1515
     
    2222                </li>
    2323        </ul>
    24         <ul class="topiclist topics">
     24        <ul class="topiclist<!-- IF not S_PRIVMSGS --> topics<!-- ELSE --> cplist<!-- ENDIF -->">
    2525
    2626        <!-- BEGIN draftrow -->
  • trunk/forum/styles/prosilver/template/editor.js

    r400 r702  
    88var theSelection = false;
    99
     10var bbcodeEnabled = true;
    1011// Check for Browser & Platform for PC & IE specific bits
    1112// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
     
    1516var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1));
    1617var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1));
    17 
    1818var baseHeight;
    19 onload_functions.push('initInsertions()');
    2019
    2120/**
     
    252251        if (theSelection)
    253252        {
    254                 insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
     253                if (bbcodeEnabled)
     254                {
     255                        insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
     256                }
     257                else
     258                {
     259                        var lines = split_lines(theSelection);
     260                        for (i = 0; i < lines.length; i++)
     261                        {
     262                                insert_text('> ' + lines[i] + '\n')
     263                        }
     264                }
    255265        }
    256266
     
    258268}
    259269
     270function split_lines(text)
     271{
     272        var lines = text.split('\n');
     273        var splitLines = new Array();
     274        var j = 0;
     275        for(i = 0; i < lines.length; i++)
     276        {
     277                if (lines[i].length <= 80)
     278                {
     279                        splitLines[j] = lines[i];
     280                        j++;
     281                }
     282                else
     283                {
     284                        var line = lines[i];
     285                        do
     286                        {
     287                                var splitAt = line.indexOf(' ', 80);
     288                               
     289                                if (splitAt == -1)
     290                                {
     291                                        splitLines[j] = line;
     292                                        j++
     293                                }
     294                                else
     295                                {
     296                                        splitLines[j] = line.substring(0, splitAt);
     297                                        line = line.substring(splitAt);
     298                                        j++;
     299                                }
     300                        }
     301                        while(splitAt != -1)
     302                }
     303        }
     304        return splitLines;
     305}
    260306/**
    261307* From http://www.massless.org/mozedit/
     
    263309function mozWrap(txtarea, open, close)
    264310{
    265         var selLength = txtarea.textLength;
     311        var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
    266312        var selStart = txtarea.selectionStart;
    267313        var selEnd = txtarea.selectionEnd;
     
    278324
    279325        txtarea.value = s1 + open + s2 + close + s3;
    280         txtarea.selectionStart = selEnd + open.length + close.length;
    281         txtarea.selectionEnd = txtarea.selectionStart;
     326        txtarea.selectionStart = selStart + open.length;
     327        txtarea.selectionEnd = selEnd + open.length;
    282328        txtarea.focus();
    283329        txtarea.scrollTop = scrollTop;
  • trunk/forum/styles/prosilver/template/faq_body.html

    r400 r702  
    88                <div class="column1">
    99                <!-- BEGIN faq_block -->
    10                         <!-- IF faq_block.S_ROW_COUNT == 4 -->
     10                        <!-- IF faq_block.SWITCH_COLUMN or (SWITCH_COLUMN_MANUALLY and faq_block.S_ROW_COUNT == 4) -->
    1111                                </div>
    1212
  • trunk/forum/styles/prosilver/template/forum_fn.js

    r400 r702  
    2424        var page = prompt(jump_page, on_page);
    2525
    26         if (page !== null && !isNaN(page) && page > 0)
    27         {
    28                 document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
     26        if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
     27        {
     28                if (base_url.indexOf('?') == -1)
     29                {
     30                        document.location.href = base_url + '?start=' + ((page - 1) * per_page);
     31                }
     32                else
     33                {
     34                        document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
     35                }
    2936        }
    3037}
     
    201208                else
    202209                {
     210                        // workaround for bug # 42885
     211                        if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>')
     212                        {
     213                                e.innerHTML = e.innerHTML + '&nbsp;';
     214                        }
     215
    203216                        var r = document.createRange();
    204217                        r.selectNodeContents(e);
     
    256269        obj.Play();
    257270}
     271
     272/**
     273* Check if the nodeName of elem is name
     274* @author jQuery
     275*/
     276function is_node_name(elem, name)
     277{
     278        return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase();
     279}
     280
     281/**
     282* Check if elem is in array, return position
     283* @author jQuery
     284*/
     285function is_in_array(elem, array)
     286{
     287        for (var i = 0, length = array.length; i < length; i++)
     288                // === is correct (IE)
     289                if (array[i] === elem)
     290                        return i;
     291
     292        return -1;
     293}
     294
     295/**
     296* Find Element, type and class in tree
     297* Not used, but may come in handy for those not using JQuery
     298* @author jQuery.find, Meik Sievertsen
     299*/
     300function find_in_tree(node, tag, type, class_name)
     301{
     302        var result, element, i = 0, length = node.childNodes.length;
     303
     304        for (element = node.childNodes[0]; i < length; element = node.childNodes[++i])
     305        {
     306                if (!element || element.nodeType != 1) continue;
     307
     308                if ((!tag || is_node_name(element, tag)) && (!type || element.type == type) && (!class_name || is_in_array(class_name, (element.className || element).toString().split(/\s+/)) > -1))
     309                {
     310                        return element;
     311                }
     312
     313                if (element.childNodes.length)
     314                        result = find_in_tree(element, tag, type, class_name);
     315
     316                if (result) return result;
     317        }
     318}
     319
     320var in_autocomplete = false;
     321var last_key_entered = '';
     322
     323/**
     324* Check event key
     325*/
     326function phpbb_check_key(event)
     327{
     328        // Keycode is array down or up?
     329        if (event.keyCode && (event.keyCode == 40 || event.keyCode == 38))
     330                in_autocomplete = true;
     331
     332        // Make sure we are not within an "autocompletion" field
     333        if (in_autocomplete)
     334        {
     335                // If return pressed and key changed we reset the autocompletion
     336                if (!last_key_entered || last_key_entered == event.which)
     337                {
     338                        in_autocompletion = false;
     339                        return true;
     340                }
     341        }
     342
     343        // Keycode is not return, then return. ;)
     344        if (event.which != 13)
     345        {
     346                last_key_entered = event.which;
     347                return true;
     348        }
     349
     350        return false;
     351}
     352
     353/**
     354* Usually used for onkeypress event, to submit a form on enter
     355*/
     356function submit_default_button(event, selector, class_name)
     357{
     358        // Add which for key events
     359        if (!event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode))
     360                event.which = event.charCode || event.keyCode;
     361
     362        if (phpbb_check_key(event))
     363                return true;
     364
     365        var current = selector['parentNode'];
     366
     367        // Search parent form element
     368        while (current && (!current.nodeName || current.nodeType != 1 || !is_node_name(current, 'form')) && current != document)
     369                current = current['parentNode'];
     370
     371        // Find the input submit button with the class name
     372        //current = find_in_tree(current, 'input', 'submit', class_name);
     373        var input_tags = current.getElementsByTagName('input');
     374        current = false;
     375
     376        for (var i = 0, element = input_tags[0]; i < input_tags.length; element = input_tags[++i])
     377        {
     378                if (element.type == 'submit' && is_in_array(class_name, (element.className || element).toString().split(/\s+/)) > -1)
     379                        current = element;
     380        }
     381
     382        if (!current)
     383                return true;
     384
     385        // Submit form
     386        current.focus();
     387        current.click();
     388        return false;
     389}
     390
     391/**
     392* Apply onkeypress event for forcing default submit button on ENTER key press
     393* The jQuery snippet used is based on http://greatwebguy.com/programming/dom/default-html-button-submit-on-enter-with-jquery/
     394* The non-jQuery code is a mimick of the jQuery code ;)
     395*/
     396function apply_onkeypress_event()
     397{
     398        // jQuery code in case jQuery is used
     399        if (jquery_present)
     400        {
     401                jQuery('form input[type=text], form input[type=password]').live('keypress', function (e)
     402                {
     403                        var default_button = jQuery(this).parents('form').find('input[type=submit].default-submit-action');
     404                       
     405                        if (!default_button || default_button.length <= 0)
     406                                return true;
     407
     408                        if (phpbb_check_key(e))
     409                                return true;
     410
     411                        if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13))
     412                        {
     413                                default_button.click();
     414                                return false;
     415                        }
     416
     417                        return true;
     418                });
     419       
     420                return;
     421        }
     422
     423        var input_tags = document.getElementsByTagName('input');
     424
     425        for (var i = 0, element = input_tags[0]; i < input_tags.length ; element = input_tags[++i])
     426        {
     427                if (element.type == 'text' || element.type == 'password')
     428                {
     429                        // onkeydown is possible too
     430                        element.onkeypress = function (evt) { submit_default_button((evt || window.event), this, 'default-submit-action'); };
     431                }
     432        }
     433}
     434
     435/**
     436* Detect JQuery existance. We currently do not deliver it, but some styles do, so why not benefit from it. ;)
     437*/
     438var jquery_present = typeof jQuery == 'function';
  • trunk/forum/styles/prosilver/template/forumlist_body.html

    r400 r702  
    2828                        <dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
    2929                                <dt title="{forumrow.FORUM_FOLDER_IMG_ALT}">
     30                                <!-- IF S_ENABLE_FEEDS and forumrow.S_FEED_ENABLED --><!-- <a class="feed-icon-forum" title="{L_FEED} - {forumrow.FORUM_NAME}" href="{U_FEED}?f={forumrow.FORUM_ID}"><img src="{T_THEME_PATH}/images/feed.gif" alt="{L_FEED} - {forumrow.FORUM_NAME}" /></a> --><!-- ENDIF -->
     31
    3032                                        <!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF -->
    3133                                        <a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />
     
    4244                                        <dd class="posts">{forumrow.POSTS} <dfn>{L_POSTS}</dfn></dd>
    4345                                        <dd class="lastpost"><span>
     46                                                <!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF -->
    4447                                                <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
    4548                                                <!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{forumrow.LAST_POST_TIME}<!-- ELSE -->{L_NO_POSTS}<br />&nbsp;<!-- ENDIF --></span>
  • trunk/forum/styles/prosilver/template/index_body.html

    r400 r702  
    77<ul class="linklist">
    88        <!-- IF S_DISPLAY_SEARCH -->
    9                 <li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
     9                <li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
    1010        <!-- ENDIF -->
    1111        <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
     
    1919        <h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a><!-- IF S_REGISTER_ENABLED -->&nbsp; &bull; &nbsp;<a href="{U_REGISTER}">{L_REGISTER}</a><!-- ENDIF --></h3>
    2020                <fieldset class="quick-login">
    21                         <label for="username">{L_USERNAME}:</label>&nbsp;<input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" /> 
     21                        <label for="username">{L_USERNAME}:</label>&nbsp;<input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" />
    2222                        <label for="password">{L_PASSWORD}:</label>&nbsp;<input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" />
    2323                        <!-- IF S_AUTOLOGIN_ENABLED -->
     
    2525                        <!-- ENDIF -->
    2626                        <input type="submit" name="login" value="{L_LOGIN}" class="button2" />
     27                        {S_LOGIN_REDIRECT}
    2728                </fieldset>
    2829        </form>
  • trunk/forum/styles/prosilver/template/login_body.html

    r400 r702  
    77        <div class="content">
    88                <h2><!-- IF LOGIN_EXPLAIN -->{LOGIN_EXPLAIN}<!-- ELSE -->{L_LOGIN}<!-- ENDIF --></h2>
    9                
     9
    1010                <fieldset <!-- IF not S_CONFIRM_CODE -->class="fields1"<!-- ELSE -->class="fields2"<!-- ENDIF -->>
    1111                <!-- IF LOGIN_ERROR --><div class="error">{LOGIN_ERROR}</div><!-- ENDIF -->
     
    2222                        <!-- ENDIF -->
    2323                </dl>
    24                
    25                 <!-- IF S_CONFIRM_CODE -->
    26                 <dl>
    27                         <dt><label for="confirm_code">{L_CONFIRM_CODE}:</label><br /><span>{L_CONFIRM_CODE_EXPLAIN}</span></dt>
    28                                 <dd><input type="hidden" name="confirm_id" value="{CONFIRM_ID}" />{CONFIRM_IMAGE}</dd>
    29                                 <dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="3" class="inputbox narrow" title="{L_CONFIRM_CODE}" /></dd>
    30                 </dl>
     24                <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
     25                        <!-- DEFINE $CAPTCHA_TAB_INDEX = 3 -->
     26                        <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
    3127                <!-- ENDIF -->
    32                
    3328                <!-- IF S_DISPLAY_FULL_LOGIN -->
    3429                <dl>
     
    3732                </dl>
    3833                <!-- ENDIF -->
     34
    3935                <dl>
    4036                        <dt>&nbsp;</dt>
    4137                        <dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="6" value="{L_LOGIN}" class="button1" /></dd>
    4238                </dl>
    43        
     39                {S_LOGIN_REDIRECT}
    4440                </fieldset>
    4541        </div>
    4642        <span class="corners-bottom"><span></span></span></div>
    4743</div>
     44
    4845
    4946<!-- IF not S_ADMIN_AUTH and S_REGISTER_ENABLED -->
  • trunk/forum/styles/prosilver/template/login_forum.html

    r400 r702  
    2525                <dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" id="login" class="button1" value="{L_LOGIN}" tabindex="2" /></dd>
    2626        </dl>
     27        {S_LOGIN_REDIRECT}
    2728        </fieldset>
    2829
  • trunk/forum/styles/prosilver/template/mcp_forum.html

    r400 r702  
    3636                <li class="row<!-- IF topicrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->">
    3737                        <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
    38                                 <dt <!-- IF topicrow.TOPIC_ICON_IMG and S_TOPIC_ICONS -->style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
     38                                <dt <!-- IF topicrow.TOPIC_ICON_IMG -->style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF -->>
    3939                                        <!-- IF topicrow.S_SELECT_TOPIC --><a href="{topicrow.U_SELECT_TOPIC}" class="topictitle">[ {L_SELECT_MERGE} ]</a>&nbsp;&nbsp; <!-- ENDIF -->
    4040                                        <a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
  • trunk/forum/styles/prosilver/template/mcp_front.html

    r400 r702  
    5252        <!-- IF .unapproved -->
    5353        <fieldset class="display-actions">
     54                {S_HIDDEN_FIELDS}
    5455                <input class="button2" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" />&nbsp;
    5556                <input class="button1" type="submit" name="action[approve]" value="{L_APPROVE}" />
     
    101102<!-- ENDIF -->
    102103
     104<!-- IF S_SHOW_PM_REPORTS -->
     105        <div class="panel">
     106                <div class="inner"><span class="corners-top"><span></span></span>
     107
     108                <h3>{L_LATEST_REPORTED_PMS}</h3>
     109                <!-- IF S_HAS_PM_REPORTS --><p>{L_PM_REPORTS_TOTAL}</p><!-- ENDIF -->
     110
     111                <!-- IF .pm_report -->
     112                        <ul class="topiclist">
     113                                <li class="header">
     114                                        <dl>
     115                                                <dt>{L_VIEW_DETAILS}</dt>
     116                                                <dd class="moderation"><span>{L_REPORTER}</span></dd>
     117                                        </dl>
     118                                </li>
     119                        </ul>
     120                        <ul class="topiclist cplist">
     121
     122                        <!-- BEGIN pm_report -->
     123                        <li class="row<!-- IF report.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
     124                                <dl>
     125                                        <dt>
     126                                                <a href="{pm_report.U_PM_DETAILS}" class="topictitle">{pm_report.PM_SUBJECT}</a> {pm_report.ATTACH_ICON_IMG}<br />
     127                                                <span>{L_MESSAGE_BY_AUTHOR} {pm_report.PM_AUTHOR_FULL} &raquo; {pm_report.PM_TIME}</span><br />
     128                                                <span>{L_MESSAGE_TO} {pm_report.RECIPIENTS}</span>
     129                                        </dt>
     130                                        <dd class="moderation">
     131                                                <span>{L_REPORTED} {L_POST_BY_AUTHOR} {pm_report.REPORTER_FULL} {L_REPORTED_ON_DATE} {pm_report.REPORT_TIME}</span>
     132                                        </dd>
     133                                </dl>
     134                        </li>
     135                        <!-- END pm_report -->
     136                        </ul>
     137                <!-- ELSE -->
     138                        <p>{L_PM_REPORTS_ZERO_TOTAL}</p>
     139                <!-- ENDIF -->
     140
     141                <span class="corners-bottom"><span></span></span></div>
     142        </div>
     143<!-- ENDIF -->
     144
    103145<!-- IF S_SHOW_LOGS -->
    104146        <div class="panel">
  • trunk/forum/styles/prosilver/template/mcp_logs.html

    r400 r702  
    99
    1010        <ul class="linklist">
     11                <li class="leftside">
     12                        {L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
     13                </li>
    1114                <li class="rightside pagination">
    1215                        <!-- IF TOTAL -->{TOTAL} <!-- ENDIF -->
     
    7275                                <input class="button2" type="submit" name="action[del_all]" value="{L_DELETE_ALL}" />
    7376                                &nbsp;<input class="button1" type="submit" value="{L_DELETE_MARKED}" name="action[del_marked]" />
    74        
     77
    7578                                <div><a href="#" onclick="marklist('mcp', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'mark', false); return false;">{L_UNMARK_ALL}</a></div>
    7679                        </fieldset>
  • trunk/forum/styles/prosilver/template/mcp_notes_user.html

    r400 r702  
    88        <div class="inner"><span class="corners-top"><span></span></span>
    99
    10         <h3><!-- IF USER_COLOR --><span style="color: #{USER_COLOR}">{USERNAME}</span><!-- ELSE -->{USERNAME}<!-- ENDIF --></h3>
     10        <h3>{USERNAME_FULL}</h3>
    1111
    1212        <div>
     
    4343
    4444<fieldset class="submit-buttons">
    45         {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp; 
     45        {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
    4646        <input type="submit" name="action[add_feedback]" value="{L_SUBMIT}" class="button1" />
    4747        {S_FORM_TOKEN}
     
    4949
    5050<div class="panel">
    51         <div class="inner"><span class="corners-top"><span></span></span>               
     51        <div class="inner"><span class="corners-top"><span></span></span>
    5252
    5353        <ul class="linklist">
     54                <li class="leftside">
     55                        {L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="button2" name="filter" value="{L_SEARCH}" />
     56                </li>
    5457                <li class="rightside pagination">
    5558                        <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} <!-- ENDIF -->
     
    9194                <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF -->
    9295                <!-- IF PREVIOUS_PAGE --><a href="{PREVIOUS_PAGE}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_PREVIOUS}</a><!-- ENDIF -->
    93                 <label>{L_DISPLAY_POSTS}: {S_SELECT_SORT_DAYS}</label>
    94                 <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>               
     96                <label>{L_DISPLAY_LOG}: {S_SELECT_SORT_DAYS}</label>
     97                <label>{L_SORT_BY} {S_SELECT_SORT_KEY}</label><label>{S_SELECT_SORT_DIR}</label>
    9598                <input type="submit" name="sort" value="{L_GO}" class="button2" />
    9699        </fieldset>
     
    106109
    107110        <span class="corners-bottom"><span></span></span></div>
    108 </div> 
     111</div>
    109112
    110113<!-- IF S_CLEAR_ALLOWED -->
     
    115118
    116119<fieldset class="display-actions">
    117         <div><a href="#" onclick="marklist('mcp', 'marknote', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('mcp', 'marknote', false); return false;">{L_UNMARK_ALL}</a></div>           
     120        <div><a href="#" onclick="marklist('mcp', 'marknote', true); return false;">{L_MARK_ALL}</a> &bull; <a href="#" onclick="marklist('mcp', 'marknote', false); return false;">{L_UNMARK_ALL}</a></div>
    118121</fieldset>
    119122<!-- ENDIF -->
  • trunk/forum/styles/prosilver/template/mcp_post.html

    r400 r702  
    22
    33<!-- IF S_MCP_REPORT -->
     4        <!-- IF S_PM -->
     5        <h2>{L_PM_REPORT_DETAILS}</h2>
     6        <!-- ELSE -->
    47        <h2>{L_REPORT_DETAILS}</h2>
     8        <!-- ENDIF -->
    59
    610        <div id="report" class="panel">
     
    913                <div class="postbody">
    1014                        <h3>{L_REPORT_REASON}: {REPORT_REASON_TITLE}</h3>
    11                         <p class="author">{L_REPORTED} {L_POST_BY_AUTHOR} {REPORTER_FULL} {L_REPORTED_ON_DATE} {REPORT_DATE}</p>
     15                        <p class="author">{L_REPORTED} {L_POST_BY_AUTHOR} {REPORTER_FULL} &laquo; {REPORT_DATE}</p>
    1216                <!-- IF not S_POST_REPORTED -->
    1317                        <p class="rules">{L_REPORT_CLOSED}</p>
     
    5256
    5357                <h3><a href="{U_VIEW_POST}">{POST_SUBJECT}</a></h3>
     58                <!-- IF S_PM -->
     59                <p class="author">
     60                        <strong>{L_SENT_AT}:</strong> {POST_DATE}
     61                        <br /><strong>{L_PM_FROM}:</strong> {POST_AUTHOR_FULL}
     62                        <!-- IF S_TO_RECIPIENT --><br /><strong>{L_TO}:</strong> <!-- BEGIN to_recipient --><!-- IF to_recipient.NAME_FULL -->{to_recipient.NAME_FULL}<!-- ELSE --><a href="{to_recipient.U_VIEW}" style="color:<!-- IF to_recipient.COLOUR -->{to_recipient.COLOUR}<!-- ELSEIF to_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{to_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END to_recipient --><!-- ENDIF -->
     63                        <!-- IF S_BCC_RECIPIENT --><br /><strong>{L_BCC}:</strong> <!-- BEGIN bcc_recipient --><!-- IF bcc_recipient.NAME_FULL -->{bcc_recipient.NAME_FULL}<!-- ELSE --><a href="{bcc_recipient.U_VIEW}" style="color:<!-- IF bcc_recipient.COLOUR -->{bcc_recipient.COLOUR}<!-- ELSEIF bcc_recipient.IS_GROUP -->#0000FF<!-- ENDIF -->;">{bcc_recipient.NAME}</a><!-- ENDIF -->&nbsp;<!-- END bcc_recipient --><!-- ENDIF -->
     64                </p>
     65                <!-- ELSE -->
    5466                <p class="author">{MINI_POST_IMG} {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} &raquo; {POST_DATE}</p>
     67                <!-- ENDIF -->
    5568
    5669                <!-- IF S_POST_UNAPPROVED -->
     
    91104                <!-- IF S_MCP_REPORT and S_CAN_VIEWIP -->
    92105                        <hr />
    93                         <div>{L_THIS_POST_IP}: <!-- IF U_WHOIS -->
     106                        <div><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->: <!-- IF U_WHOIS -->
    94107                                <a href="{U_WHOIS}"><!-- IF POST_IPADDR -->{POST_IPADDR}<!-- ELSE -->{POST_IP}<!-- ENDIF --></a> (<!-- IF POST_IPADDR -->{POST_IP}<!-- ELSE --><a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a><!-- ENDIF -->)
    95108                        <!-- ELSE -->
     
    153166                <div class="inner"><span class="corners-top"><span></span></span>
    154167
    155                 <p><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS} | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></p>
     168                <p><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS}<!-- IF not S_PM --> | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ENDIF --><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></p>
    156169
    157170                <span class="corners-bottom"><span></span></span></div>
     
    172185
    173186                                <!-- BEGIN usernotes -->
    174                                         <span class="small"><strong>{L_REPORTED_BY}: {usernotes.REPORT_BY} {L_REPORTED_ON_DATE} {usernotes.REPORT_AT}</strong></span>
     187                                        <span class="small"><strong>{L_REPORTED_BY}: {usernotes.REPORT_BY} &laquo; {usernotes.REPORT_AT}</strong></span>
    175188                                        <!-- IF S_CLEAR_ALLOWED --><div class="right-box"><input type="checkbox" name="marknote[]" value="{usernotes.ID}" /></div><!-- ENDIF -->
    176189                                        <div class="postbody">{usernotes.ACTION}</div>
     
    212225
    213226                        <!-- BEGIN reports -->
    214                                 <span class="small"><strong>{L_REPORTED_BY}: <!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --> {L_REPORTED_ON_DATE} {reports.REPORT_TIME}</strong></span>
     227                                <span class="small"><strong>{L_REPORTED_BY}: <!-- IF reports.U_REPORTER --><a href="{reports.U_REPORTER}">{reports.REPORTER}</a><!-- ELSE -->{reports.REPORTER}<!-- ENDIF --> &laquo; {reports.REPORT_TIME}</strong></span>
    215228                                <p><em>{reports.REASON_TITLE}: {reports.REASON_DESC}</em><!-- IF reports.REPORT_TEXT --><br />{reports.REPORT_TEXT}<!-- ENDIF --></p>
    216229                        <!-- END reports -->
  • trunk/forum/styles/prosilver/template/mcp_reports.html

    r400 r702  
    33<form id="mcp" method="post" action="{S_MCP_ACTION}">
    44
     5<!-- IF not S_PM -->
    56<fieldset class="forum-selection">
    67        <label for="fo">{L_FORUM}: <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label>
     
    89        {S_FORM_TOKEN}
    910</fieldset>
     11<!-- ENDIF -->
    1012
    1113<h2>{L_TITLE}</h2>
     
    2729                                <dl>
    2830                                        <dt>{L_VIEW_DETAILS}</dt>
    29                                         <dd class="moderation"><span>{L_REPORTER} &amp; {L_FORUM}</span></dd>
     31                                        <dd class="moderation"><span>{L_REPORTER}<!-- IF not S_PM --> &amp; {L_FORUM}<!-- ENDIF --></span></dd>
    3032                                        <dd class="mark">{L_MARK}</dd>
    3133                                </dl>
     
    3739                        <li class="row<!-- IF postrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
    3840                                <dl>
     41                                        <!-- IF S_PM -->
     42                                        <dt>
     43                                                <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.PM_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br />
     44                                                <span>{L_MESSAGE_BY_AUTHOR} {postrow.PM_AUTHOR_FULL} &raquo; {postrow.PM_TIME}</span><br />
     45                                                <span>{L_MESSAGE_TO} {postrow.RECIPIENTS}</span>
     46                                        </dt>
     47                                        <dd class="moderation">
     48                                                <span>{postrow.REPORTER_FULL} &laquo; {postrow.REPORT_TIME}</span>
     49                                        </dd>
     50                                        <!-- ELSE -->
    3951                                        <dt>
    4052                                                <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.POST_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br />
     
    4254                                        </dt>
    4355                                        <dd class="moderation">
    44                                                 <span>{postrow.REPORTER_FULL} {L_REPORTED_ON_DATE} {postrow.REPORT_TIME}<br />
     56                                                <span>{postrow.REPORTER_FULL} &laquo; {postrow.REPORT_TIME}<br />
    4557                                                {L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a></span>
    4658                                        </dd>
     59                                        <!-- ENDIF -->
    4760                                        <dd class="mark"><input type="checkbox" name="report_id_list[]" value="{postrow.REPORT_ID}" /></dd>
    4861                                </dl>
  • trunk/forum/styles/prosilver/template/mcp_topic.html

    r400 r702  
    107107
    108108                        <div class="postbody" id="pr{postrow.POST_ID}">
    109                                 <div class="right-box"><a href="{postrow.U_POST_DETAILS}">{L_POST_DETAILS}</a> | {L_SELECT}: <input type="checkbox" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></div>
     109                                <ul class="profile-icons"><li class="info-icon"><a href="{postrow.U_POST_DETAILS}" title="{L_POST_DETAILS}"><span>{L_POST_DETAILS}</span></a></li><li>{L_SELECT}: <input type="checkbox" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></li></ul>
    110110
    111111                                <h3><a href="{postrow.U_POST_DETAILS}">{postrow.POST_SUBJECT}</a></h3>
     
    114114                                <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
    115115                                <p class="rules">
    116                                         <!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><!-- ENDIF -->
     116                                        <!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><br /><!-- ENDIF -->
    117117                                        <!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
    118118                                </p>
     
    161161        </select>&nbsp;
    162162        <input class="button1" type="submit" name="mcp_topic_submit" value="{L_SUBMIT}" />
    163         <div><a href="#" onclick="marklist('mcp', '', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', '', false); return false;">{L_UNMARK_ALL}</a></div>
     163        <div><a href="#" onclick="marklist('mcp', 'post', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'post', false); return false;">{L_UNMARK_ALL}</a></div>
    164164{S_HIDDEN_FIELDS}
    165165{S_FORM_TOKEN}
  • trunk/forum/styles/prosilver/template/mcp_warn_user.html

    r400 r702  
    88        <div class="inner"><span class="corners-top"><span></span></span>
    99
    10         <h3><!-- IF USER_COLOR --><span style="color: #{USER_COLOR}">{USERNAME}</span><!-- ELSE -->{USERNAME}<!-- ENDIF --></h3>
     10        <h3>{USERNAME_FULL}</h3>
    1111
    1212        <div>
  • trunk/forum/styles/prosilver/template/memberlist_body.html

    r400 r702  
    132132        <tr class="<!-- IF memberrow.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
    133133                <td><!-- IF memberrow.RANK_IMG --><span class="rank-img">{memberrow.RANK_IMG}</span><!-- ELSE --><span class="rank-img">{memberrow.RANK_TITLE}</span><!-- ENDIF --><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input type="checkbox" name="user" value="{memberrow.USERNAME}" /> <!-- ENDIF -->{memberrow.USERNAME_FULL}<!-- IF S_SELECT_SINGLE --><br />[&nbsp;<a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
    134                 <td class="posts"><!-- IF memberrow.POSTS --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td>
    135                 <td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}: {memberrow.U_WWW}">{memberrow.U_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
     134                <td class="posts"><!-- IF memberrow.POSTS and S_DISPLAY_SEARCH --><a href="{memberrow.U_SEARCH_USER}" title="{L_SEARCH_USER_POSTS}">{memberrow.POSTS}</a><!-- ELSE -->{memberrow.POSTS}<!-- ENDIF --></td>
     135                <td class="info"><!-- IF memberrow.U_WWW or memberrow.LOCATION --><!-- IF memberrow.U_WWW --><div><a href="{memberrow.U_WWW}" title="{L_VISIT_WEBSITE}: {memberrow.U_WWW}">{memberrow.U_SHORT_WWW}</a></div><!-- ENDIF --><!-- IF memberrow.LOCATION --><div>{memberrow.LOCATION}</div><!-- ENDIF --><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
    136136                <td>{memberrow.JOINED}</td>
    137137                <!-- IF S_VIEWONLINE --><td>{memberrow.VISITED}&nbsp;</td><!-- ENDIF -->
  • trunk/forum/styles/prosilver/template/memberlist_im.html

    r400 r702  
    88<div class="panel bg2">
    99        <div class="inner"><span class="corners-top"><span></span></span>
    10        
     10
    1111        <p>{L_SEND_IM_EXPLAIN}</p>
    1212
     
    1414        <dl class="fields2">
    1515                <dt><label>{L_IM_RECIPIENT}:</label></dt>
    16                 <dd><strong>{USERNAME}</strong><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM --> [ {IM_CONTACT} ]<!-- ENDIF --><!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd>
     16                <dd><strong>{USERNAME}</strong><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM or S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --><!-- IF PRESENCE_IMG --> {PRESENCE_IMG}<!-- ENDIF --></dd>
    1717        </dl>
    1818
     
    8282        <span class="corners-bottom"><span></span></span></div>
    8383</div>
    84 <a  href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
    8584</form>
     85
     86<a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
    8687
    8788<script type="text/javascript">
  • trunk/forum/styles/prosilver/template/memberlist_view.html

    r400 r702  
    3535                <!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields -->
    3636                <!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
    37                         <!-- IF U_ADD_FRIEND and U_ADD_FOE-->
    38                                 <dt>&nbsp;</dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd>
    39                                 <dt>&nbsp;</dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd>
     37                        <!-- IF U_REMOVE_FRIEND -->
     38                                <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
     39                        <!-- ELSEIF U_REMOVE_FOE -->
     40                                <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd>
    4041                        <!-- ELSE -->
    41                                 <!-- IF U_REMOVE_FRIEND -->
    42                                         <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd>
    43                                 <!-- ELSE -->
    44                                         <dt>&nbsp;</dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd>
     42                                <!-- IF U_ADD_FRIEND -->
     43                                        <dt>&nbsp;</dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd>
     44                                <!-- ENDIF -->
     45                                <!-- IF U_ADD_FOE -->
     46                                        <dt>&nbsp;</dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd>
    4547                                <!-- ENDIF -->
    4648                        <!-- ENDIF -->
     
    6062                <!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}:</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER} {USERNAME}</a></dd><!-- ENDIF -->
    6163                <!-- IF U_WWW --><dt>{L_WEBSITE}:</dt> <dd><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}">{U_WWW}</a></dd><!-- ENDIF -->
    62                 <!-- IF U_PM --><dt>{L_PM}:</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd>
    63                 <!-- ENDIF -->
     64                <!-- IF U_PM --><dt>{L_PM}:</dt> <dd><a href="{U_PM}">{L_SEND_PRIVATE_MESSAGE}</a></dd><!-- ENDIF -->
    6465                <!-- IF U_MSN or USER_MSN --><dt>{L_MSNM}:</dt> <dd><!-- IF U_MSN --><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_MSNM_MESSAGE}</a><!-- ELSE -->{USER_MSN}<!-- ENDIF --></dd><!-- ENDIF -->
    6566                <!-- IF U_YIM or USER_YIM --><dt>{L_YIM}:</dt> <dd><!-- IF U_YIM --><a href="{U_YIM}" onclick="popup(this.href, 780, 550); return false;">{L_SEND_YIM_MESSAGE}</a><!-- ELSE -->{USER_YIM}<!-- ENDIF --></dd><!-- ENDIF -->
     
    6768                <!-- IF U_ICQ or USER_ICQ --><dt>{L_ICQ}:</dt> <dd><!-- IF U_ICQ --><a href="{U_ICQ}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_ICQ_MESSAGE}</a><!-- ELSE -->{USER_ICQ}<!-- ENDIF --></dd><!-- ENDIF -->
    6869                <!-- IF U_JABBER and S_JABBER_ENABLED --><dt>{L_JABBER}:</dt> <dd><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false;">{L_SEND_JABBER_MESSAGE}</a></dd><!-- ELSEIF USER_JABBER --><dt>{L_JABBER}:</dt> <dd>{USER_JABBER}</dd><!-- ENDIF -->
    69                 <!-- IF S_PROFILE_FIELD_1 -->
     70                <!-- IF S_PROFILE_FIELD1 -->
    7071                        <!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
    7172                        <dt>{postrow.PROFILE_FIELD1_NAME}:</dt> <dd>{postrow.PROFILE_FIELD1_VALUE}</dd>
     
    7980                        <dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
    8081                        <dt>{L_VISITED}:</dt> <dd>{VISITED}</dd>
    81                         <!-- IF U_NOTES or U_WARN -->
     82                        <!-- IF S_WARNINGS -->
    8283                        <dt>{L_WARNINGS}: </dt>
    83                         <dd><strong>{WARNINGS}</strong> [ <a href="{U_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_WARN --> | <a href="{U_WARN}">{L_WARN_USER}</a> <!-- ENDIF -->]</dd>
     84                        <dd><strong>{WARNINGS}</strong><!-- IF U_NOTES or U_WARN --> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]<!-- ENDIF --></dd>
    8485                        <!-- ENDIF -->
    8586                        <dt>{L_TOTAL_POSTS}:</dt>
    86                                 <dd>{POSTS} | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong>
     87                                <dd>{POSTS} <!-- IF S_DISPLAY_SEARCH -->| <strong><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></strong><!-- ENDIF -->
    8788                                        <!-- IF POSTS_PCT --><br />({POSTS_PCT} / {POSTS_DAY})<!-- ENDIF -->
    8889                                        <!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />(<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>)<!-- ELSEIF POSTS_IN_QUEUE --><br />({L_POSTS_IN_QUEUE})<!-- ENDIF -->
  • trunk/forum/styles/prosilver/template/overall_header.html

    r400 r702  
    1212<meta name="keywords" content="" />
    1313<meta name="description" content="" />
     14<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    1415{META}
    1516<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
     17
     18<!-- IF S_ENABLE_FEEDS -->
     19        <!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
     20        <!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
     21        <!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
     22        <!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
     23        <!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" /><!-- ENDIF -->
     24        <!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
     25        <!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}" /><!-- ENDIF -->
     26<!-- ENDIF -->
    1627
    1728<!--
     
    1930        Based on style:   prosilver (this is the default phpBB3 style)
    2031        Original author:  Tom Beddard ( http://www.subBlue.com/ )
    21         Modified by:     
    22        
     32        Modified by:
     33
    2334        NOTE: This page was generated by phpBB, the free open-source bulletin board package.
    2435              The phpBB Group is not responsible for the content of this page and forum. For more information
     
    103114                                <h1>{SITENAME}</h1>
    104115                                <p>{SITE_DESCRIPTION}</p>
    105                                 <p style="display: none;"><a href="#start_here">{L_SKIP}</a></p>
     116                                <p class="skiplink"><a href="#start_here">{L_SKIP}</a></p>
    106117                        </div>
    107118
     
    110121                                <form action="{U_SEARCH}" method="post" id="search">
    111122                                <fieldset>
    112                                         <input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" /> 
     123                                        <input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" />
    113124                                        <input class="button2" value="{L_SEARCH}" type="submit" /><br />
    114125                                        <a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_SEARCH_HIDDEN_FIELDS}
     
    127138                                <li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>&#8249;</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li>
    128139
    129                                 <li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="fontsizeup(); return false;" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li>
     140                                <li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="return fontsizeup(event);" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li>
    130141
    131142                                <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
     
    138149                        <ul class="linklist leftside">
    139150                                <li class="icon-ucp">
    140                                         <a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="u">{L_PROFILE}</a>
    141                                                 <!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF --> &bull;
     151                                        <a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="e">{L_PROFILE}</a>
     152                                                <!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF -->
     153                                        <!-- IF S_DISPLAY_SEARCH --> &bull;
    142154                                        <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a>
     155                                        <!-- ENDIF -->
    143156                                        <!-- IF U_RESTORE_PERMISSIONS --> &bull;
    144157                                        <a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a>
     
    152165                                <!-- IF not S_IS_BOT -->
    153166                                        <!-- IF S_DISPLAY_MEMBERLIST --><li class="icon-members"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->
    154                                         <!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED --><li class="icon-register"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
    155                                         <li class="icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="l">{L_LOGIN_LOGOUT}</a></li>
     167                                        <!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="icon-register"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
     168                                        <li class="icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x">{L_LOGIN_LOGOUT}</a></li>
    156169                                <!-- ENDIF -->
    157170                        </ul>
     
    164177        <a name="start_here"></a>
    165178        <div id="page-body">
    166                
    167                  <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
    168                 <div id="message" class="rules">
     179                <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
     180                <div id="information" class="rules">
    169181                        <div class="inner"><span class="corners-top"><span></span></span>
    170182                                <strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED}
  • trunk/forum/styles/prosilver/template/posting_buttons.html

    r400 r702  
    9494                <option value="85">{L_FONT_SMALL}</option>
    9595                <option value="100" selected="selected">{L_FONT_NORMAL}</option>
    96                 <option value="150">{L_FONT_LARGE}</option>
    97                 <option value="200">{L_FONT_HUGE}</option>
     96                <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 150 -->
     97                        <option value="150">{L_FONT_LARGE}</option>
     98                        <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 200 -->
     99                                <option value="200">{L_FONT_HUGE}</option>
     100                        <!-- ENDIF -->
     101                <!-- ENDIF -->
    98102        </select>
    99103        <input type="button" class="button2" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="change_palette();" title="{L_BBCODE_S_HELP}" />
  • trunk/forum/styles/prosilver/template/posting_editor.html

    r400 r702  
     1<script type="text/javascript">
     2// <![CDATA[
     3        onload_functions.push('apply_onkeypress_event()');
     4// ]]>
     5</script>
     6
    17<fieldset class="fields1">
    28        <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
     
    6268                        <div class="column2">
    6369                                <dl>
    64                                         <dd><label for="group_list">{L_USERGROUPS}:</label> <select name="group_list[]" id="group_list "multiple="true" size="4" class="inputbox">{S_GROUP_OPTIONS}</select></dd>
     70                                        <dd><label for="group_list">{L_USERGROUPS}:</label> <select name="group_list[]" id="group_list" multiple="multiple" size="4" class="inputbox">{S_GROUP_OPTIONS}</select></dd>
    6571                                </dl>
    6672                        </div>
     
    8995
    9096        <!-- IF not S_PRIVMSGS and S_DISPLAY_USERNAME -->
    91         <dl>
     97        <dl style="clear: left;">
    9298                <dt><label for="username">{L_USERNAME}:</label></dt>
    93                 <dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox" /></dd>
     99                <dd><input type="text" tabindex="1" name="username" id="username" size="25" value="{USERNAME}" class="inputbox autowidth" /></dd>
    94100        </dl>
    95101        <!-- ENDIF -->
     
    100106                <dd><input type="text" name="subject" id="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->60<!-- ELSE -->64<!-- ENDIF -->" tabindex="2" value="{SUBJECT}{DRAFT_SUBJECT}" class="inputbox autowidth" /></dd>
    101107        </dl>
    102                 <!-- IF S_CONFIRM_CODE -->
    103                 <dl>
    104                         <dt><label for="confirm_code">{L_CONFIRM_CODE}:</label><br /><span>{L_CONFIRM_CODE_EXPLAIN}</span></dt>
    105                                 <dd><input type="hidden" name="confirm_id" value="{CONFIRM_ID}" />{CONFIRM_IMAGE}</dd>
    106                                 <dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="3" class="inputbox narrow" title="{L_CONFIRM_CODE}" /></dd>
    107                 </dl>
    108                 <!-- ENDIF -->
     108        <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
     109                <!-- DEFINE $CAPTCHA_TAB_INDEX = 3 -->
     110                <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
     111        <!-- ENDIF -->
    109112        <!-- ENDIF -->
    110113
     
    129132                        {FLASH_STATUS}<br />
    130133                        {URL_STATUS}<br />
    131                         {SMILIES_STATUS}
    132                 <!-- ENDIF -->
     134                <!-- ENDIF -->
     135                {SMILIES_STATUS}
    133136                <!-- ENDIF -->
    134137                <!-- IF S_EDIT_DRAFT || S_DISPLAY_REVIEW -->
     
    140143
    141144        <div id="message-box">
    142                 <textarea <!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT -->name="signature" id="signature" style="height: 9em;"<!-- ELSE -->name="message" id="message"<!-- ENDIF --> rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea>
     145                <textarea <!-- IF S_UCP_ACTION and not S_PRIVMSGS and not S_EDIT_DRAFT -->name="signature" id="signature" style="height: 9em;"<!-- ELSE -->name="message" id="message"<!-- ENDIF --> rows="15" cols="76" tabindex="4" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" class="inputbox">{MESSAGE}{DRAFT_MESSAGE}{SIGNATURE}</textarea>
    143146        </div>
    144147</fieldset>
     
    161164                        <dl>
    162165
    163                                 <dt><label for="comment_list[{attach_row.ASSOC_INDEX}]">{L_FILE_COMMENT}:</label></dt>
    164                                 <dd><textarea name="comment_list[{attach_row.ASSOC_INDEX}]" id="comment_list[{attach_row.ASSOC_INDEX}]" rows="1" cols="35" class="inputbox">{attach_row.FILE_COMMENT}</textarea></dd>
     166                                <dt><label for="comment_list_{attach_row.ASSOC_INDEX}">{L_FILE_COMMENT}:</label></dt>
     167                                <dd><textarea name="comment_list[{attach_row.ASSOC_INDEX}]" id="comment_list_{attach_row.ASSOC_INDEX}" rows="1" cols="35" class="inputbox">{attach_row.FILE_COMMENT}</textarea></dd>
    165168                                <dd><a href="{attach_row.U_VIEW_ATTACHMENT}" class="{S_CONTENT_FLOW_END}">{attach_row.FILENAME}</a></dd>
    166169                                <dd style="margin-top: 5px;">
     
    185188                        {S_HIDDEN_ADDRESS_FIELD}
    186189                        {S_HIDDEN_FIELDS}
    187                         <!-- IF S_HAS_DRAFTS --><input type="submit" accesskey="d" tabindex="9" name="load" value="{L_LOAD}" class="button2" onclick="load_draft = true;" />&nbsp; <!-- ENDIF -->
    188                         <!-- IF S_SAVE_ALLOWED --><input type="submit" accesskey="k" tabindex="8" name="save" value="{L_SAVE}" class="button2" />&nbsp; <!-- ENDIF -->
     190                        <!-- IF S_HAS_DRAFTS --><input type="submit" accesskey="d" tabindex="8" name="load" value="{L_LOAD}" class="button2" onclick="load_draft = true;" />&nbsp; <!-- ENDIF -->
     191                        <!-- IF S_SAVE_ALLOWED --><input type="submit" accesskey="k" tabindex="7" name="save" value="{L_SAVE}" class="button2" />&nbsp; <!-- ENDIF -->
    189192                        <input type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" class="button1"<!-- IF not S_PRIVMSGS --> onclick="document.getElementById('postform').action += '#preview';"<!-- ENDIF --> />&nbsp;
    190                         <input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
     193                        <input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1 default-submit-action" />&nbsp;
    191194
    192195                </fieldset>
  • trunk/forum/styles/prosilver/template/posting_preview.html

    r400 r702  
    1 <div class="post bg2" id="preview">
     1<div class="post <!-- IF S_PRIVMSGS -->pm<!-- ELSE -->bg2<!-- ENDIF -->" id="preview">
    22        <div class="inner"><span class="corners-top"><span></span></span>
    33
     
    2020</div>
    2121
    22 <div class="post <!-- IF S_PRIVMSGS --> pm<!-- ELSE --> bg2<!-- ENDIF -->">
     22<div class="post bg2">
    2323        <div class="inner"><span class="corners-top"><span></span></span>
    2424
     
    2727        <div class="postbody">
    2828                <h3>{L_PREVIEW}: {PREVIEW_SUBJECT}</h3>
    29                
     29
    3030                <div class="content">{PREVIEW_MESSAGE}</div>
    31                
     31
    3232                <!-- IF .attachment -->
    3333                <dl class="attachbox">
     
    3838                </dl>
    3939                <!-- ENDIF -->
    40                
     40
    4141                <!-- IF PREVIEW_SIGNATURE --><div class="signature">{PREVIEW_SIGNATURE}</div><!-- ENDIF -->
    4242        </div>
  • trunk/forum/styles/prosilver/template/posting_review.html

    r400 r702  
    44
    55<!-- BEGIN post_review_row -->
    6 <div id="ppr{post_review_row.POST_ID}" class="post <!-- IF post_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF post_review_row.ONLINE_STATUS --> online<!-- ENDIF -->">
     6<!-- IF post_review_row.S_IGNORE_POST -->
     7<div class="post bg3 post-ignore">
    78        <div class="inner"><span class="corners-top"><span></span></span>
     9                {post_review_row.L_IGNORE_POST}
     10<!-- ELSE -->
     11<div class="post <!-- IF post_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF post_review_row.ONLINE_STATUS --> online<!-- ENDIF -->">
     12        <div class="inner"><span class="corners-top"><span></span></span>
     13<!-- ENDIF -->
    814
    9         <div class="postbody">
     15        <div class="postbody" id="ppr{post_review_row.POST_ID}">
    1016                <h3><a href="#ppr{post_review_row.POST_ID}">{post_review_row.POST_SUBJECT}</a></h3>
    1117                <p class="author"><!-- IF S_IS_BOT -->{post_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{post_review_row.U_MINI_POST}">{post_review_row.MINI_POST_IMG}</a><!-- ENDIF --> {L_POST_BY_AUTHOR}<strong>  {post_review_row.POST_AUTHOR_FULL}</strong> &raquo; {post_review_row.POST_DATE}</p>
  • trunk/forum/styles/prosilver/template/posting_smilies.html

    r400 r702  
    1313        <div class="inner"><span class="corners-top"><span></span></span>
    1414                <!-- BEGIN smiley -->
    15                         <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
     15                        <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
    1616                <!-- END smiley -->
    1717       
    1818        <span class="corners-bottom"><span></span></span></div>
    1919</div>
     20<div>{PAGINATION}</div>
    2021<a  href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
    2122
  • trunk/forum/styles/prosilver/template/posting_topic_review.html

    r400 r702  
    66
    77<div id="topicreview">
     8<script type="text/javascript">
     9// <![CDATA[
     10        bbcodeEnabled = {S_BBCODE_ALLOWED};
     11// ]]>
     12</script>
    813        <!-- BEGIN topic_review_row -->
     14
     15        <!-- IF topic_review_row.S_IGNORE_POST -->
     16        <div class="post bg3 post-ignore">
     17                <div class="inner"><span class="corners-top"><span></span></span>
     18                        {topic_review_row.L_IGNORE_POST}
     19        <!-- ELSE -->
    920        <div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
    1021                <div class="inner"><span class="corners-top"><span></span></span>
     22        <!-- ENDIF -->
    1123
    1224                <div class="postbody" id="pr{topic_review_row.POST_ID}">
  • trunk/forum/styles/prosilver/template/search_results.html

    r400 r702  
    1919                        <!-- IF SEARCH_IN_RESULTS -->
    2020                                <label for="add_keywords">{L_SEARCH_IN_RESULTS}: <input type="text" name="add_keywords" id="add_keywords" value="" class="inputbox narrow" /></label>
    21                                 <input type="hidden" name="show_results" value="posts" />
    2221                                <input class="button2" type="submit" name="submit" value="{L_SEARCH}" />
    2322                        <!-- ENDIF -->
     
    140139                <!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY -->
    141140                        <label><!-- IF S_SHOW_TOPICS -->{L_DISPLAY_POSTS}<!-- ELSE -->{L_SORT_BY}</label><label><!-- ENDIF --> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY --></label> <label>{S_SELECT_SORT_KEY}</label>
    142                         <label>{S_SELECT_SORT_DIR} <!-- ELSE --></label><!-- ENDIF --><input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
     141                        <label>{S_SELECT_SORT_DIR}<!-- ENDIF --> <input type="submit" name="sort" value="{L_GO}" class="button2" /></label>
    143142                <!-- ENDIF -->
    144143        </fieldset>
  • trunk/forum/styles/prosilver/template/simple_header.html

    r400 r702  
    1818// <![CDATA[
    1919
     20        var jump_page = '{LA_JUMP_PAGE}:';
     21        var on_page = '{ON_PAGE}';
     22        var per_page = '{PER_PAGE}';
     23        var base_url = '{A_BASE_URL}';
     24        var style_cookie = 'phpBBstyle';
    2025        var onload_functions = new Array();
    2126        var onunload_functions = new Array();
     
    4449</script>
    4550<script type="text/javascript" src="{T_TEMPLATE_PATH}/styleswitcher.js"></script>
     51<script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>
    4652
    4753<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
  • trunk/forum/styles/prosilver/template/styleswitcher.js

    r400 r702  
    11
    2 function fontsizeup()
     2function fontsizeup(event)
    33{
     4        // Skip tabs; 9 being the ASCII code for a tab
     5        if (event && getKeyCode(event) == 9)
     6        {
     7                return true;
     8        }
     9
    410        var active = getActiveStyleSheet();
    511
     
    3036                break;
    3137        }
     38
     39        return false;
    3240}
    3341
    34 function fontsizedown()
     42function fontsizedown(event)
    3543{
    36         active = getActiveStyleSheet();
     44        // Skip tabs
     45        if (event && getKeyCode(event) == 9)
     46        {
     47                return true;
     48        }
     49
     50        var active = getActiveStyleSheet();
    3751
    3852        switch (active)
     
    6175                break;
    6276        }
     77
     78        return false;
     79}
     80
     81function getKeyCode(event)
     82{
     83        // IE doesn't fire the onkeypress event for tabs
     84        // Reference: http://www.quirksmode.org/js/keys.html
     85
     86        var code = (event.keyCode) ? event.keyCode : 0;
     87
     88        // Probably using FF
     89        if (!code && event.charCode)
     90        {
     91                code = event.charCode;
     92        }
     93
     94        return code;
    6395}
    6496
  • trunk/forum/styles/prosilver/template/template.cfg

    r400 r702  
    33#
    44# @package phpBB3
    5 # @copyright (c) 2006 phpBB Group 
    6 # @license http://opensource.org/licenses/gpl-license.php GNU Public License 
     5# @copyright (c) 2006 phpBB Group
     6# @license http://opensource.org/licenses/gpl-license.php GNU Public License
    77#
    88#
     
    1212#
    1313# Values get trimmed, if you want to add a space in front or at the end of
    14 # the value, then enclose the value with single or double quotes. 
     14# the value, then enclose the value with single or double quotes.
    1515# Single and double quotes do not need to be escaped.
    1616#
    17 # 
     17#
    1818
    1919# General Information about this template
    2020name = prosilver
    2121copyright = &copy; phpBB Group, 2007
    22 version = 3.0.4
     22version = 3.0.7
    2323
    2424# Defining a different template bitfield
  • trunk/forum/styles/prosilver/template/ucp_agreement.html

    r400 r702  
    11<!-- INCLUDE overall_header.html -->
    22
     3<!-- IF S_SHOW_COPPA or S_REGISTRATION -->
    34
    4 <!-- IF S_SHOW_COPPA or S_REGISTRATION -->
     5<!-- IF S_LANG_OPTIONS -->
     6<script type="text/javascript">
     7// <![CDATA[
     8        /**
     9        * Change language
     10        */
     11        function change_language(lang_iso)
     12        {
     13                document.forms['register'].change_lang.value = lang_iso;
     14                document.forms['register'].submit();
     15        }
     16
     17// ]]>
     18</script>
     19
     20        <form method="post" action="{S_UCP_ACTION}" id="register">
     21                <p class="rightside">
     22                        <label for="lang">{L_LANGUAGE}:</label><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select>
     23                        {S_HIDDEN_FIELDS}
     24                </p>
     25        </form>
     26
     27        <div class="clear"></div>
     28
     29<!-- ENDIF -->
    530
    631        <form method="post" action="{S_UCP_ACTION}" id="agreement">
  • trunk/forum/styles/prosilver/template/ucp_avatar_options.html

    r400 r702  
    1414        </dl>
    1515
    16         <!-- IF S_UPLOAD_AVATAR_FILE or S_CAN_UPLOAD -->
     16        <!-- IF S_UPLOAD_AVATAR_FILE -->
    1717                <dl>
    1818                        <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt>
     
    2121        <!-- ENDIF -->
    2222
    23         <!-- IF S_UPLOAD_AVATAR_URL or S_EDIT -->
     23        <!-- IF S_UPLOAD_AVATAR_URL -->
    2424                <dl>
    2525                        <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt>
     
    2828        <!-- ENDIF -->
    2929
    30         <!-- IF S_LINK_AVATAR or S_EDIT -->
     30        <!-- IF S_LINK_AVATAR -->
    3131                <dl>
    3232                        <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt>
     
    3636                        <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
    3737                        <dd>
    38                                 <label for="width"><input type="text" name="width" id="width" size="3" value="{AVATAR_WIDTH}" class="inputbox autowidth" /> px</label> &times;&nbsp;
    39                                 <label for="height"><input type="text" name="height" id="height" size="3" value="{AVATAR_HEIGHT}" class="inputbox autowidth" /> px</label>
     38                                <label for="width"><input type="text" name="width" id="width" size="3" value="{AVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
     39                                <label for="height"><input type="text" name="height" id="height" size="3" value="{AVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
    4040                        </dd>
    4141                </dl>
    4242        <!-- ENDIF -->
    4343        </fieldset>
    44        
     44
    4545        <!-- IF S_IN_AVATAR_GALLERY -->
    4646                <span class="corners-bottom"><span></span></span></div>
     
    5151
    5252                <h3>{L_AVATAR_GALLERY}</h3>
    53        
     53
    5454                <fieldset>
    5555                        <label for="category">{L_AVATAR_CATEGORY}: <select name="category" id="category">{S_CAT_OPTIONS}</select></label>
     
    6464                <!-- END avatar_column --><!-- END avatar_row -->
    6565                </div>
    66        
     66
    6767        <!-- ENDIF -->
    6868
  • trunk/forum/styles/prosilver/template/ucp_groups_manage.html

    r400 r702  
    171171        <h3>{L_ADD_USERS}</h3>
    172172
    173         <p>{L_ADD_USERS_EXPLAIN}</p>
     173        <p>{L_ADD_USERS_UCP_EXPLAIN}</p>
    174174
    175175        <fieldset>
  • trunk/forum/styles/prosilver/template/ucp_main_bookmarks.html

    r400 r702  
    3333                        <!-- ELSE -->
    3434                        <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
    35                                 <dt style="<!-- IF topicrow.TOPIC_ICON_IMG -->background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;<!-- ENDIF -->" title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
     35                                <dt<!-- IF topicrow.TOPIC_ICON_IMG --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
    3636                                        <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
    3737                                        <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
  • trunk/forum/styles/prosilver/template/ucp_main_front.html

    r400 r702  
    3434                <dt>{L_JOINED}:</dt> <dd>{JOINED}</dd>
    3535                <dt>{L_VISITED}:</dt> <dd>{LAST_VISIT_YOU}</dd>
    36                 <dt>{L_TOTAL_POSTS}:</dt> <dd><!-- IF POSTS_PCT -->{POSTS} | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd>
     36                <dt>{L_TOTAL_POSTS}:</dt> <dd><!-- IF POSTS_PCT -->{POSTS}<!-- IF S_DISPLAY_SEARCH --> | <strong><a href="{U_SEARCH_USER}">{L_SEARCH_YOUR_POSTS}</a></strong><!-- ENDIF --><br />({POSTS_DAY} / {POSTS_PCT})<!-- ELSE -->{POSTS}<!-- ENDIF --></dd>
    3737                <!-- IF ACTIVE_FORUM --><dt>{L_ACTIVE_IN_FORUM}:</dt> <dd><strong><a href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></strong><br />({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})</dd><!-- ENDIF -->
    3838                <!-- IF ACTIVE_TOPIC --><dt>{L_ACTIVE_IN_TOPIC}:</dt> <dd><strong><a href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></strong><br />({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})</dd><!-- ENDIF -->
  • trunk/forum/styles/prosilver/template/ucp_main_subscribed.html

    r400 r702  
    5353                <li class="row<!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ELSEIF topicrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->">
    5454                        <dl class="icon" style="background-image: url({topicrow.TOPIC_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
    55                                 <dt style="<!-- IF topicrow.TOPIC_ICON_IMG -->background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;<!-- ENDIF -->" title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
     55                                <dt<!-- IF topicrow.TOPIC_ICON_IMG --> style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;"<!-- ENDIF --> title="{topicrow.TOPIC_FOLDER_IMG_ALT}">
    5656                                        <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF --><a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
    5757                                        <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
  • trunk/forum/styles/prosilver/template/ucp_pm_history.html

    r400 r702  
    1818
    1919                        <h3><a href="{history_row.U_VIEW_MESSAGE}" <!-- IF history_row.S_CURRENT_MSG -->class="current"<!-- ENDIF -->>{history_row.SUBJECT}</a></h3>
    20                         <p class="author<!-- IF history_row.S_CURRENT_MSG --> current<!-- ENDIF -->">{history_row.MINI_POST_IMG} {L_SENT_AT}: <strong>{history_row.SENT_DATE}</strong><br />
     20                        <p class="author">{history_row.MINI_POST_IMG} {L_SENT_AT}: <strong>{history_row.SENT_DATE}</strong><br />
    2121                                {L_MESSAGE_BY_AUTHOR} {history_row.MESSAGE_AUTHOR_FULL}</p>
    22                         <div class="content<!-- IF history_row.S_CURRENT_MSG --> current<!-- ENDIF -->">{history_row.MESSAGE}</div>
     22                        <div class="content">{history_row.MESSAGE}</div>
    2323                        <div id="message_{history_row.MSG_ID}" style="display: none;">{history_row.DECODED_MESSAGE}</div>
    2424                </div>
  • trunk/forum/styles/prosilver/template/ucp_pm_message_header.html

    r400 r702  
    11<h2>{L_TITLE}<!-- IF CUR_FOLDER_NAME -->: {CUR_FOLDER_NAME}<!-- ENDIF --></h2>
    22
    3 <form id="viewfolder" method="post" action="{S_PM_ACTION}">
    4 
    5 <div class="panel">
     3<div class="panel clearfix pm-panel-header<!-- IF S_VIEW_MESSAGE --> pm<!-- ENDIF -->">
    64        <div class="inner"><span class="corners-top"><span></span></span>
    75
    86        <!-- IF FOLDER_STATUS and FOLDER_MAX_MESSAGES neq 0 --><p>{FOLDER_STATUS}</p><!-- ENDIF -->
    9        
    10                 <!-- IF U_POST_REPLY_PM or U_POST_NEW_TOPIC or U_FORWARD_PM -->
     7
     8        <!-- IF U_POST_REPLY_PM or U_POST_NEW_TOPIC or U_FORWARD_PM -->
    119                <div class="buttons">
    12                         <!-- IF U_POST_REPLY_PM --><div class="pmreply-icon"><a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}"><span></span>{L_POST_REPLY_PM}</a></div>
     10                        <!-- IF U_POST_REPLY_PM --><div class="pmreply-icon clearfix"><a title="{L_POST_REPLY_PM}" href="{U_POST_REPLY_PM}"><span></span>{L_POST_REPLY_PM}</a></div>
    1311                        <!-- ELSEIF U_POST_NEW_TOPIC --><div class="newpm-icon"><a href="{U_POST_NEW_TOPIC}" accesskey="n" title="{L_UCP_PM_COMPOSE}"><span></span>{L_UCP_PM_COMPOSE}</a></div><!-- ENDIF -->
    1412                        <!-- IF U_FORWARD_PM --><div class="forwardpm-icon"><a title="{L_POST_FORWARD_PM}" href="{U_FORWARD_PM}"><span></span>{L_FORWARD_PM}</a></div><!-- ENDIF -->
    1513                </div>
     14
     15                <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 -->
     16                        <div class="reply-all"><a title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}">&raquo; {L_REPLY_TO_ALL}</a></div>
    1617                <!-- ENDIF -->
    1718
     19        <!-- ENDIF -->
     20
    1821                <!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
    19         <ul class="linklist">
     22        <ul class="linklist pm-return-to">
    2023                <li class="rightside pagination">
    2124                        <!-- IF S_VIEW_MESSAGE --><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO} {CUR_FOLDER_NAME}</a><!-- ENDIF -->
     
    2730        </ul>
    2831                <!-- ENDIF -->
     32        </div>
     33</div>
     34
     35<form id="viewfolder" method="post" action="{S_PM_ACTION}">
  • trunk/forum/styles/prosilver/template/ucp_pm_viewfolder.html

    r400 r702  
    33<!-- IF not PROMPT -->
    44        <!-- INCLUDE ucp_pm_message_header.html -->
     5        <div class="panel pm-panel-message"><div>
    56<!-- ENDIF -->
    6 
    77
    88<!-- IF PROMPT -->
     
    8484                </ul>
    8585        <!-- ELSE -->
    86                 <p><strong>{L_NO_MESSAGES}</strong></p>
     86                <p><strong>
     87                        <!-- IF S_COMPOSE_PM_VIEW and S_NO_AUTH_SEND_MESSAGE -->
     88                                <!-- IF S_USER_NEW -->{L_USER_NEW_PERMISSION_DISALLOWED}<!-- ELSE -->{L_NO_AUTH_SEND_MESSAGE}<!-- ENDIF -->
     89                        <!-- ELSE -->
     90                                {L_NO_MESSAGES}
     91                        <!-- ENDIF -->
     92                </strong></p>
    8793        <!-- ENDIF -->
    8894
  • trunk/forum/styles/prosilver/template/ucp_pm_viewmessage.html

    r400 r702  
    1 <!-- INCLUDE ucp_header.html -->
     1        <!-- INCLUDE ucp_header.html -->
    22
    33<!-- INCLUDE ucp_pm_message_header.html -->
    44
    5         <span class="corners-bottom"><span></span></span></div>
    6 </div>
    75
    86<!-- IF S_DISPLAY_HISTORY and (U_VIEW_PREVIOUS_HISTORY or U_VIEW_NEXT_HISTORY) -->
    9         <fieldset class="display-options clearfix">
     7        <fieldset class="display-options clearfix bg1 pm-message-nav">
    108                <!-- IF U_VIEW_PREVIOUS_HISTORY --><a href="{U_VIEW_PREVIOUS_HISTORY}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_HISTORY}</a><!-- ENDIF -->
    119                <!-- IF U_VIEW_NEXT_HISTORY --><a href="{U_VIEW_NEXT_HISTORY}" class="right-box {S_CONTENT_FLOW_END}">{L_VIEW_NEXT_HISTORY}</a><!-- ENDIF -->
     
    1412
    1513
    16 <div id="post-{MESSAGE_ID}" class="post pm<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->">
    17         <div class="inner"><span class="corners-top"><span></span></span>
     14<div id="post-{MESSAGE_ID}" class="panel clearfix post pm-panel-message pm<!-- IF S_POST_UNAPPROVED or S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF S_ONLINE --> online<!-- ENDIF -->">
     15<div>
    1816
    1917        <div class="postbody">
    2018
    21                 <!-- IF U_DELETE or U_EDIT or U_QUOTE -->
     19                <!-- IF U_DELETE or U_EDIT or U_QUOTE or U_REPORT -->
    2220                <ul class="profile-icons">
    2321                        <!-- IF U_EDIT --><li class="edit-icon"><a href="{U_EDIT}" title="{L_POST_EDIT_PM}"><span>{L_POST_EDIT_PM}</span></a></li><!-- ENDIF -->
    2422                        <!-- IF U_DELETE --><li class="delete-icon"><a href="{U_DELETE}" title="{L_DELETE_MESSAGE}"><span>{L_DELETE_MESSAGE}</span></a></li><!-- ENDIF -->
     23                        <!-- IF U_REPORT --><li class="report-icon"><a href="{U_REPORT}" title="{L_REPORT_PM}"><span>{L_REPORT_PM}</span></a></li><!-- ENDIF -->
    2524                        <!-- IF U_QUOTE --><li class="quote-icon"><a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}"><span>{L_POST_QUOTE_PM}</span></a></li><!-- ENDIF -->
    2625                </ul>
     
    6867                <!-- IF RANK_IMG --><dd>{RANK_IMG}</dd><!-- ENDIF -->
    6968                <dd>&nbsp;</dd>
    70                 <!-- IF AUTHOR_POSTS --><dd><strong>{L_POSTS}:</strong> {AUTHOR_POSTS}</dd><!-- ENDIF -->
     69                <dd><strong>{L_POSTS}:</strong> {AUTHOR_POSTS}</dd>
    7170                <!-- IF AUTHOR_JOINED --><dd><strong>{L_JOINED}:</strong> {AUTHOR_JOINED}</dd><!-- ENDIF -->
    7271                <!-- IF AUTHOR_FROM --><dd><strong>{L_LOCATION}:</strong> {AUTHOR_FROM}</dd><!-- ENDIF -->
     
    7675                        <ul class="profile-icons">
    7776                        <!-- IF U_PM --><li class="pm-icon"><a href="{U_PM}" title="{L_PRIVATE_MESSAGE}"><span>{L_PRIVATE_MESSAGE}</span></a></li><!-- ENDIF -->
    78                         <!-- IF U_EMAIL --><li class="email-icon"><a href="{U_EMAIL}" title="{L_EMAIL}"><span>{L_EMAIL}</span></a></li><!-- ENDIF -->
     77                        <!-- IF U_EMAIL --><li class="email-icon"><a href="{U_EMAIL}" title="{L_SEND_EMAIL_USER} {MESSAGE_AUTHOR}"><span>{L_SEND_EMAIL_USER} {MESSAGE_AUTHOR}</span></a></li><!-- ENDIF -->
    7978                        <!-- IF U_WWW --><li class="web-icon"><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF -->
    8079                        <!-- IF U_MSN --><li class="msnm-icon"><a href="{U_MSN}" onclick="popup(this.href, 550, 320); return false;" title="{L_MSNM}"><span>{L_MSNM}</span></a></li><!-- ENDIF -->
  • trunk/forum/styles/prosilver/template/ucp_pm_viewmessage_print.html

    r400 r702  
    8484                <td>
    8585                <!-- BEGIN to_recipient -->
    86                         <!-- IF to_recipient.COLOUR --><span style="color:{to_recipient.COLOUR}"><!-- ELSE --><span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->><!-- ENDIF -->{to_recipient.NAME}</span>&nbsp;
     86                        <span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->>{to_recipient.NAME}</span>&nbsp;
    8787                <!-- END to_recipient -->
    8888                </td>
  • trunk/forum/styles/prosilver/template/ucp_profile_signature.html

    r400 r702  
    99                <div class="inner"><span class="corners-top"><span></span></span>
    1010                <h3>{L_SIGNATURE_PREVIEW}</h3>
    11                 <div class="postbody pm">
     11                <div class="postbody">
    1212                        <div class="signature" style="border-top:none; margin-top: 0; ">{SIGNATURE_PREVIEW}</div>
    1313                </div>
     
    3434                        <div><label for="disable_magic_url"><input type="checkbox" name="disable_magic_url" id="disable_magic_url"{S_MAGIC_URL_CHECKED} /> {L_DISABLE_MAGIC_URL}</label></div>
    3535                <!-- ENDIF -->
    36        
     36
    3737        </fieldset>
    3838
     
    4242<fieldset class="submit-buttons">
    4343        {S_HIDDEN_FIELDS}
    44         <input type="reset" name="reset" value="{L_RESET}" class="button2" />&nbsp; 
    45         <input type="submit" name="preview" value="{L_PREVIEW}" class="button2" />&nbsp; 
     44        <input type="reset" name="reset" value="{L_RESET}" class="button2" />&nbsp;
     45        <input type="submit" name="preview" value="{L_PREVIEW}" class="button2" />&nbsp;
    4646        <input type="submit" name="submit" value="{L_SUBMIT}" class="button1" />
    4747        {S_FORM_TOKEN}
  • trunk/forum/styles/prosilver/template/ucp_register.html

    r400 r702  
    1111                document.forms['register'].submit.click();
    1212        }
     13
     14        <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH -->
     15        onload_functions.push('apply_onkeypress_event()');
     16        <!-- ENDIF -->
    1317
    1418// ]]>
     
    2731                <dl><dd><strong>{L_REG_COND}</strong></dd></dl>
    2832        <!-- ENDIF -->
    29         <!-- IF .profile_fields -->
    30                 <dl><dd><strong>{L_ITEMS_REQUIRED}</strong></dd></dl>
    31         <!-- ENDIF -->
    32 
    3333        <dl>
    3434                <dt><label for="username">{L_USERNAME}:</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt>
     
    5656        <dl>
    5757                <dt><label for="lang">{L_LANGUAGE}:</label></dt>
    58                 <dd><select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></dd>
     58                <dd><select name="lang" id="lang" onchange="change_language(this.value); return false;" tabindex="6" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></dd>
    5959        </dl>
    6060        <dl>
    6161                <dt><label for="tz">{L_TIMEZONE}:</label></dt>
    62                 <dd><select name="tz" id="tz" class="autowidth">{S_TZ_OPTIONS}</select></dd>
     62                <dd><select name="tz" id="tz" tabindex="7" class="autowidth">{S_TZ_OPTIONS}</select></dd>
    6363        </dl>
     64
     65        <!-- IF .profile_fields -->
     66                <dl><dd><strong>{L_ITEMS_REQUIRED}</strong></dd></dl>
    6467
    6568        <!-- BEGIN profile_fields -->
     
    7174                </dl>
    7275        <!-- END profile_fields -->
     76        <!-- ENDIF -->
     77
    7378        </fieldset>
    74 
    75 <!-- IF S_CONFIRM_CODE -->
    7679        <span class="corners-bottom"><span></span></span></div>
    7780</div>
    78 
    79 <div class="panel">
    80         <div class="inner"><span class="corners-top"><span></span></span>
    81 
    82         <h3>{L_CONFIRMATION}</h3>
    83         <p>{L_CONFIRM_EXPLAIN}</p>
    84 
    85         <fieldset class="fields2">
    86         <dl>
    87                 <dt><label for="confirm_code">{L_CONFIRM_CODE}:</label></dt>
    88                 <dd>{CONFIRM_IMG}</dd>
    89                 <dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" class="inputbox narrow" title="{L_CONFIRM_CODE}" /></dd>
    90                 <dd>{L_CONFIRM_CODE_EXPLAIN}</dd>
    91         </dl>
    92         </fieldset>
     81<!-- IF CAPTCHA_TEMPLATE -->
     82        <!-- DEFINE $CAPTCHA_TAB_INDEX = 8 -->
     83        <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
    9384<!-- ENDIF -->
    9485
    9586<!-- IF S_COPPA -->
    96         <span class="corners-bottom"><span></span></span></div>
    97 </div>
     87
    9888
    9989<div class="panel">
     
    10393
    10494        <p>{L_COPPA_EXPLAIN}</p>
    105 <!-- ENDIF -->
    106 
    10795        <span class="corners-bottom"><span></span></span></div>
    10896</div>
     97<!-- ENDIF -->
    10998
    11099<div class="panel">
     
    114103                {S_HIDDEN_FIELDS}
    115104                <input type="reset" value="{L_RESET}" name="reset" class="button2" />&nbsp;
    116                 <input type="submit" name="submit" id ="submit" value="{L_SUBMIT}" class="button1" />
     105                <input type="submit" tabindex="9" name="submit" id="submit" value="{L_SUBMIT}" class="button1 default-submit-action" />
    117106                {S_FORM_TOKEN}
    118107        </fieldset>
  • trunk/forum/styles/prosilver/template/viewforum_body.html

    r400 r702  
    44
    55<!-- IF FORUM_DESC or MODERATORS or U_MCP -->
    6 <p>
     6<div>
    77        <!-- NOTE: remove the style="display: none" when you want to have the forum description on the forum body -->
    8         <!-- IF FORUM_DESC --><span style="display: none">{FORUM_DESC}<br /></span><!-- ENDIF -->
    9         <!-- IF MODERATORS --><strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS}<!-- ENDIF -->
    10 </p>
     8        <!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF -->
     9        <!-- IF MODERATORS --><p><strong><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->:</strong> {MODERATORS}</p><!-- ENDIF -->
     10</div>
    1111<!-- ENDIF -->
    1212
     
    7676        </div>
    7777
    78         <!-- IF not S_USER_LOGGED_IN -->
     78        <!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
    7979
    8080                <form action="{S_LOGIN_ACTION}" method="post">
     
    101101                                        <dd><input type="submit" name="login" tabindex="5" value="{L_LOGIN}" class="button1" /></dd>
    102102                                </dl>
     103                                {S_LOGIN_REDIRECT}
    103104                                </fieldset>
    104105                        </div>
  • trunk/forum/styles/prosilver/template/viewtopic_body.html

    r400 r702  
    33<h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
    44<!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body -->
    5 <!-- IF FORUM_DESC --><span style="display: none">{FORUM_DESC}<br /></span><!-- ENDIF -->
     5<!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF -->
    66
    77<!-- IF MODERATORS or U_MCP -->
     
    115115<!-- BEGIN postrow -->
    116116        <!-- IF postrow.S_FIRST_UNREAD --><a id="unread"></a><!-- ENDIF -->
    117         <div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_ONLINE --> online<!-- ENDIF -->">
     117        <div id="p{postrow.POST_ID}" class="post <!-- IF postrow.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF postrow.S_UNREAD_POST --> unreadpost<!-- ENDIF --><!-- IF postrow.S_POST_REPORTED --> reported<!-- ENDIF --><!-- IF postrow.S_ONLINE and not postrow.S_IGNORE_POST --> online<!-- ENDIF -->">
    118118                <div class="inner"><span class="corners-top"><span></span></span>
    119119
     
    124124
    125125                <!-- IF not S_IS_BOT -->
    126                         <!-- IF postrow.U_QUOTE or postrow.U_INFO or postrow.U_DELETE or postrow.U_EDIT -->
     126                        <!-- IF postrow.U_EDIT or postrow.U_DELETE or postrow.U_REPORT or postrow.U_WARN or postrow.U_INFO or postrow.U_QUOTE -->
    127127                                <ul class="profile-icons">
    128128                                        <!-- IF postrow.U_EDIT --><li class="edit-icon"><a href="{postrow.U_EDIT}" title="{L_EDIT_POST}"><span>{L_EDIT_POST}</span></a></li><!-- ENDIF -->
     
    141141                        <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED -->
    142142                                <p class="rules">
    143                                         <!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><!-- ENDIF -->
     143                                        <!-- IF postrow.S_POST_UNAPPROVED -->{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}"><strong>{L_POST_UNAPPROVED}</strong></a><br /><!-- ENDIF -->
    144144                                        <!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF -->
    145145                                </p>
     
    164164                        <!-- ENDIF -->
    165165
    166                         <!-- IF postrow.BUMPED_MESSAGE --><div class="notice">{postrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
     166                        <!-- IF postrow.BUMPED_MESSAGE --><div class="notice"><br /><br />{postrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
    167167                        <!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF -->
    168168                <!-- ENDIF -->
     
    201201                                <ul class="profile-icons">
    202202                                        <!-- IF postrow.U_PM --><li class="pm-icon"><a href="{postrow.U_PM}" title="{L_PRIVATE_MESSAGE}"><span>{L_PRIVATE_MESSAGE}</span></a></li><!-- ENDIF -->
    203                                         <!-- IF postrow.U_EMAIL --><li class="email-icon"><a href="{postrow.U_EMAIL}" title="{L_EMAIL}"><span>{L_EMAIL}</span></a></li><!-- ENDIF -->
     203                                        <!-- IF postrow.U_EMAIL --><li class="email-icon"><a href="{postrow.U_EMAIL}" title="{L_SEND_EMAIL_USER} {postrow.POST_AUTHOR}"><span>{L_SEND_EMAIL_USER} {postrow.POST_AUTHOR}</span></a></li><!-- ENDIF -->
    204204                                        <!-- IF postrow.U_WWW --><li class="web-icon"><a href="{postrow.U_WWW}" title="{L_VISIT_WEBSITE}: {postrow.U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF -->
    205205                                        <!-- IF postrow.U_MSN --><li class="msnm-icon"><a href="{postrow.U_MSN}" onclick="popup(this.href, 550, 320); return false;" title="{L_MSNM}"><span>{L_MSNM}</span></a></li><!-- ENDIF -->
     
    223223        <hr class="divider" />
    224224<!-- END postrow -->
    225 
     225<!-- IF S_QUICK_REPLY -->
     226        <!-- INCLUDE quickreply_editor.html -->
     227<!-- ENDIF -->
    226228<!-- IF S_NUM_POSTS > 1 or PREVIOUS_PAGE -->
    227229        <form id="viewtopic" method="post" action="{S_TOPIC_ACTION}">
  • trunk/forum/styles/prosilver/template/viewtopic_print.html

    r400 r702  
    1212<meta name="keywords" content="" />
    1313<meta name="description" content="" />
    14 <meta name="robots" CONTENT="noindex" />
     14<meta name="robots" content="noindex" />
    1515{META}
    1616<title>{SITENAME} &bull; {PAGE_TITLE}</title>
     
    2626                <h1>{SITENAME}</h1>
    2727                <p>{SITE_DESCRIPTION}<br /><a href="{U_FORUM}">{U_FORUM}</a></p>
    28                
     28
    2929                <h2>{TOPIC_TITLE}</h2>
    3030                <p><a href="{U_TOPIC}">{U_TOPIC}</a></p>
     
    3737                                <h3>{postrow.POST_SUBJECT}</h3>
    3838                                <div class="date">{postrow.MINI_POST_IMG}{L_POSTED}: <strong>{postrow.POST_DATE}</strong></div>
    39                                 <div class="author">{L_POST_BY_AUTHOR} <strong<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{postrow.POST_AUTHOR}</strong></div>
     39                                <div class="author">{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR}</strong></div>
    4040                                <div class="content">{postrow.MESSAGE}</div>
    4141                        </div>
  • trunk/forum/styles/prosilver/theme/bidi.css

    r400 r702  
    226226}
    227227
     228/* Links adjustment to correctly display an order of rtl/ltr mixed content */
     229.rtl a {
     230        direction: rtl;
     231        unicode-bidi: embed;
     232}
     233
    228234.rtl a.top {
    229235        float: left;
     
    235241}
    236242
     243.rtl .skiplink {
     244        /* invisible skip link, used for accessibility  */
     245        position: relative;
     246        width: 1px;
     247        height: 1px;
     248        overflow: hidden;
     249        display: block;
     250        left: 0;
     251}
     252
     253.rtl a.feed-icon-forum {
     254        float: left;
     255}
     256
    237257/**
    238258* content.css
    239259*/
     260.rtl ul.topiclist dfn {
     261        /* Labels for post/view counts */
     262        position: relative;
     263        width: 1px;
     264        height: 1px;
     265        overflow: hidden;
     266        display: block;
     267        left: 0;
     268}
     269
    240270.rtl ul.topiclist dt {
    241271        float: right;
     
    348378.rtl blockquote {
    349379        margin: 0.5em 25px 0 1px;
     380        background-position: 99% 8px;
    350381}
    351382
    352383.rtl blockquote blockquote {
    353384        /* Nested quotes */
    354         margin: 0.5em 15px 0 1px;       
     385        margin: 0.5em 15px 0 1px;
    355386}
    356387
     
    720751*/
    721752
    722 
     753/** Reference: Bug #27155 */
     754.rtl #wrap, .rtl .headerbar, .rtl #site-description, .rtl .navbar {
     755        position: relative;
     756}
  • trunk/forum/styles/prosilver/theme/colours.css

    r400 r702  
    460460        background-image: url("{T_THEME_PATH}/images/quote.gif");
    461461        border-color:#DBDBCE;
     462}
     463
     464.rtl blockquote {
     465        background-image: url("{T_THEME_PATH}/images/quote_rtl.gif");
    462466}
    463467
     
    787791}
    788792
     793.rtl #navigation a {
     794        background-image: url("{T_THEME_PATH}/images/bg_menu_rtl.gif");
     795        background-position: 0 100%;
     796}
     797
    789798#navigation a:hover {
     799        background-image: none;
    790800        background-color: #aabac6;
    791801        color: #BC2A4D;
     
    862872/* PM Message history */
    863873.current {
    864         color: #999999 !important;
     874        color: #000000 !important;
     875}
     876
     877/* PM panel adjustments */
     878.pm-panel-header,
     879#cp-main .pm-message-nav {
     880        border-bottom-color: #A4B3BF;
    865881}
    866882
     
    883899}
    884900
    885 pmlist li.pm_foe_colour, .pm_foe_colour {
     901.pmlist li.pm_foe_colour, .pm_foe_colour {
    886902        border-color: #000000;
    887903}
     
    907923        border-color: #666666;
    908924        background-color: #FAFAFA;
     925        color: #000;
    909926}
    910927
  • trunk/forum/styles/prosilver/theme/common.css

    r400 r702  
    1111        font-size: 100%;
    1212        /* Always show a scrollbar for short pages - stops the jump when the scrollbar appears. non-IE browsers */
    13         height: 100%;
    14         margin-bottom: 1px;
     13        height: 101%;
    1514}
    1615
     
    398397table.table1 .mark              { text-align: center; width: 7%; }
    399398table.table1 .info              { text-align: left; width: 30%; }
    400 table.table1 .info div  { width: 100%; white-space: nowrap; overflow: hidden; }
     399table.table1 .info div  { width: 100%; white-space: normal; overflow: hidden; }
    401400table.table1 .autocol   { line-height: 2em; white-space: nowrap; }
    402401table.table1 thead .autocol { padding-left: 1em; }
     
    600599}
    601600
    602 div.rules ul {
     601div.rules ul, div.rules ol {
    603602        margin-left: 20px;
    604603}
     
    612611p.rules img {
    613612        vertical-align: middle;
     613        padding-top: 5px;
    614614}
    615615
  • trunk/forum/styles/prosilver/theme/content.css

    r400 r702  
    4545ul.topiclist dfn {
    4646        /* Labels for post/view counts */
    47         display: none;
     47        position: absolute;
     48        left: -999px;
     49        width: 990px;
    4850}
    4951
     
    131133}
    132134
     135/* List in forum description */
     136dl.icon dt ol,
     137dl.icon dt ul {
     138        list-style-position: inside;
     139        margin-left: 1em;
     140}
     141
     142dl.icon dt li {
     143        display: list-item;
     144        list-style-type: inherit;
     145}
     146
    133147dd.lastpost {
    134148        width: 25%;
     
    281295}
    282296
     297.post-ignore .postbody {
     298        display: none;
     299}
     300
    283301/* Content container styles
    284302----------------------------------------*/
     
    290308        font-size: 1em;
    291309        color: #333333;
     310        padding-bottom: 1px;
    292311}
    293312
  • trunk/forum/styles/prosilver/theme/cp.css

    r400 r702  
    347347#pm-menu {
    348348        line-height: 2.5em;
     349}
     350
     351/* PM panel adjustments */
     352.pm-panel-header {
     353        margin: 0;
     354        padding-bottom: 10px;
     355        border-bottom: 1px dashed #A4B3BF;
     356}
     357
     358.reply-all {
     359        display: block;
     360        padding-top: 4px;
     361        clear: both;
     362        float: left;
     363}
     364
     365.pm-panel-message {
     366        padding-top: 10px;
     367}
     368
     369.pm-return-to {
     370        padding-top: 23px;
     371}
     372
     373#cp-main .pm-message-nav {
     374        margin: 0;
     375        padding: 2px 10px 5px 10px;
     376        border-bottom: 1px dashed #A4B3BF;
    349377}
    350378
  • trunk/forum/styles/prosilver/theme/forms.css

    r400 r702  
    317317        font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
    318318        color: #000;
    319         background: #FAFAFA none repeat-x top;
     319        background: #FAFAFA none repeat-x top left;
    320320}
    321321
  • trunk/forum/styles/prosilver/theme/links.css

    r400 r702  
    11/* proSilver Link Styles
    22---------------------------------------- */
     3
     4/* Links adjustment to correctly display an order of rtl/ltr mixed content */
     5a {
     6        direction: ltr;
     7        unicode-bidi: embed;
     8}
    39
    410a:link  { color: #898989; text-decoration: none; }
     
    199205        background-position: 100% 60%;
    200206}
     207
     208/* invisible skip link, used for accessibility  */
     209.skiplink {
     210        position: absolute;
     211        left: -999px;
     212        width: 990px;
     213}
     214
     215/* Feed icon in forumlist_body.html */
     216a.feed-icon-forum {
     217        float: right;
     218        margin: 3px;
     219}
  • trunk/forum/styles/prosilver/theme/print.css

    r400 r702  
    2626
    2727img, .noprint, #sub-header, #sub-footer, .navbar, .box1, .divider, .signature { display: none; }
     28/* Display smilies (Bug #47265) */
     29.content img {
     30        display: inline;
     31}
    2832
    2933/* Container for the main body */
     
    109113
    110114/* Quote */
    111 .postquote {
     115.postquote, blockquote {
    112116        font-size: 85%;
    113117        margin: 1em 18% 1em 4%;
     
    121125.postquote span { display: block; }
    122126.postquote span .postquote { font-size: 100%; }
    123 .quote-by { font-weight: bold; }
     127.quote-by, blockquote cite {
     128        color: black;
     129        display : block;
     130        font-weight: bold;
     131}
     132
     133/* List */
     134ol, ul {
     135        margin-left: 15pt
     136}
    124137
    125138/* Misc page elements */
  • trunk/forum/styles/prosilver/theme/theme.cfg

    r400 r702  
    33#
    44# @package phpBB3
    5 # @copyright (c) 2006 phpBB Group 
    6 # @license http://opensource.org/licenses/gpl-license.php GNU Public License 
     5# @copyright (c) 2006 phpBB Group
     6# @license http://opensource.org/licenses/gpl-license.php GNU Public License
    77#
    88#
     
    1212#
    1313# Values get trimmed, if you want to add a space in front or at the end of
    14 # the value, then enclose the value with single or double quotes. 
     14# the value, then enclose the value with single or double quotes.
    1515# Single and double quotes do not need to be escaped.
    1616#
    1717# Available and used values:
    1818# parse_css_file
    19 # 
     19#
    2020
    2121# General Information about this theme
    2222name = prosilver
    2323copyright = &copy; phpBB Group, 2007
    24 version = 3.0.4
     24version = 3.0.7
    2525
    2626# Some configuration options
    2727
    2828#
    29 # You have to turn this option on if you want to use the 
     29# You have to turn this option on if you want to use the
    3030# path template variables ({T_IMAGESET_PATH} for example) within
    3131# your css file.
  • trunk/forum/styles/prosilver/theme/tweaks.css

    r400 r702  
    6868}
    6969
     70* html li.row dl.icon dt {
     71        height: 35px;
     72        overflow: visible;
     73}
     74
    7075* html #search-box {
    7176        width: 25%;
     
    8388}
    8489
     90* html .forumbg table.table1 {
     91        margin: 0 -2px 0px -1px;
     92}
  • trunk/forum/styles/subsilver2/imageset/imageset.cfg

    r400 r702  
    33#
    44# @package phpBB3
    5 # @copyright (c) 2005 phpBB Group 
    6 # @license http://opensource.org/licenses/gpl-license.php GNU Public License 
     5# @copyright (c) 2005 phpBB Group
     6# @license http://opensource.org/licenses/gpl-license.php GNU Public License
    77#
    88#
     
    1212#
    1313# Values get trimmed, if you want to add a space in front or at the end of
    14 # the value, then enclose the value with single or double quotes. 
     14# the value, then enclose the value with single or double quotes.
    1515# Single and double quotes do not need to be escaped.
    1616#
     
    2020name = subsilver2
    2121copyright = &copy; phpBB Group, 2003
    22 version = 3.0.4
     22version = 3.0.7
    2323
    24 # Images 
     24# Images
    2525img_site_logo = site_logo.gif*94*170
    2626img_upload_bar = upload_bar.gif*16*280
    2727img_poll_left = poll_left.gif*12*4
    28 img_poll_center = poll_center.gif*12*
     28img_poll_center = poll_center.gif*12*1
    2929img_poll_right = poll_right.gif*12*4
    3030img_icon_friend =
     
    8282img_global_unread_locked_mine = announce_unread_locked_mine.gif*18*19
    8383
    84 img_subforum_read = 
    85 img_subforum_unread = 
     84img_subforum_read =
     85img_subforum_unread =
    8686
    8787img_pm_read = topic_read.gif*18*19
  • trunk/forum/styles/subsilver2/style.cfg

    r400 r702  
    33#
    44# @package phpBB3
    5 # @copyright (c) 2005 phpBB Group 
    6 # @license http://opensource.org/licenses/gpl-license.php GNU Public License 
     5# @copyright (c) 2005 phpBB Group
     6# @license http://opensource.org/licenses/gpl-license.php GNU Public License
    77#
    88#
     
    1212#
    1313# Values get trimmed, if you want to add a space in front or at the end of
    14 # the value, then enclose the value with single or double quotes. 
     14# the value, then enclose the value with single or double quotes.
    1515# Single and double quotes do not need to be escaped.
    1616#
    17 # 
     17#
    1818
    1919# General Information about this style
    2020name = subsilver2
    2121copyright = &copy; 2005 phpBB Group
    22 version = 3.0.4
     22version = 3.0.7
  • trunk/forum/styles/subsilver2/template/editor.js

    r400 r702  
    1717
    1818var baseHeight;
    19 window.onload = initInsertions;
    2019
    2120/**
     
    263262function mozWrap(txtarea, open, close)
    264263{
    265         var selLength = txtarea.textLength;
     264        var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength;
    266265        var selStart = txtarea.selectionStart;
    267266        var selEnd = txtarea.selectionEnd;
     
    278277
    279278        txtarea.value = s1 + open + s2 + close + s3;
    280         txtarea.selectionStart = selEnd + open.length + close.length;
    281         txtarea.selectionEnd = txtarea.selectionStart;
     279        txtarea.selectionStart = selStart + open.length;
     280        txtarea.selectionEnd = selEnd + open.length;
    282281        txtarea.focus();
    283282        txtarea.scrollTop = scrollTop;
  • trunk/forum/styles/subsilver2/template/forumlist_body.html

    r400 r702  
    2020                        <td class="row1">
    2121                                <!-- IF forumrow.FORUM_IMAGE -->
    22                                         <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div><div style="float: {S_CONTENT_FLOW_BEGIN};">
     22                                        <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div>
    2323                                <!-- ENDIF -->
    2424                                <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
    2525                                <p class="forumdesc">{forumrow.FORUM_DESC}</p>
    26                                 <!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->
    2726                        </td>
    2827                        <!-- IF forumrow.CLICKS -->
     
    4342                        <td class="row1" width="100%">
    4443                                <!-- IF forumrow.FORUM_IMAGE -->
    45                                         <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div><div style="float: {S_CONTENT_FLOW_BEGIN};">
     44                                        <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}: 5px;">{forumrow.FORUM_IMAGE}</div>
    4645                                <!-- ENDIF -->
    4746                                <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
     
    5352                                        <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}</p>
    5453                                <!-- ENDIF -->
    55                                 <!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->
    5654                        </td>
    5755                        <td class="row2" align="center"><p class="topicdetails">{forumrow.TOPICS}</p></td>
     
    5957                        <td class="row2" align="center" nowrap="nowrap">
    6058                                <!-- IF forumrow.LAST_POST_TIME -->
    61                                         <p class="topicdetails">{forumrow.LAST_POST_TIME}</p>
     59                                        <p class="topicdetails"><!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a>&nbsp;<!-- ENDIF -->{forumrow.LAST_POST_TIME}</p>
    6260                                        <p class="topicdetails">{forumrow.LAST_POSTER_FULL}
    6361                                                <!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a><!-- ENDIF -->
  • trunk/forum/styles/subsilver2/template/index_body.html

    r400 r702  
    6868</table>
    6969
    70 <!-- IF not S_USER_LOGGED_IN -->
     70<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
    7171        <br clear="all" />
    7272
    7373        <form method="post" action="{S_LOGIN_ACTION}">
    74        
     74
    7575        <table class="tablebg" width="100%" cellspacing="1">
    7676        <tr>
     
    8181        </tr>
    8282        </table>
     83        {S_LOGIN_REDIRECT}
    8384        {S_FORM_TOKEN}
    8485        </form>
  • trunk/forum/styles/subsilver2/template/login_body.html

    r400 r702  
    6666</tr>
    6767
    68 <!-- IF S_CONFIRM_CODE -->
     68<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
    6969</table>
    7070<table class="tablebg" width="100%" cellspacing="1">
    71         <tr>
    72                 <th colspan="2" valign="middle">{L_LOGIN_CONFIRMATION}</th>
    73         </tr>
    74         <tr>
    75                 <td class="row3" colspan="2"><span class="gensmall">{L_LOGIN_CONFIRM_EXPLAIN}</span></td>
    76         </tr>
    77         <tr>
    78                 <td class="row1" colspan="2" align="center">
    79                         <input type="hidden" name="confirm_id" value="{CONFIRM_ID}" />
    80                         {CONFIRM_IMAGE}
    81                 </td>
    82         </tr>
    83         <tr>
    84                 <td class="row1"><b class="genmed">{L_CONFIRM_CODE}: </b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
    85                 <td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8" /></td>
    86         </tr>
     71               
     72        <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
    8773<!-- ENDIF -->
     74
    8875<tr>
    8976        <td class="cat" <!-- IF not S_ADMIN_AUTH or S_CONFIRM_CODE -->colspan="2"<!-- ENDIF --> align="center">{S_HIDDEN_FIELDS}<input type="submit" name="login" class="btnmain" value="{L_LOGIN}" tabindex="5" /></td>
     
    9178</table>
    9279{S_FORM_TOKEN}
    93 
     80{S_LOGIN_REDIRECT}
    9481</form>
    9582
  • trunk/forum/styles/subsilver2/template/login_forum.html

    r400 r702  
    3333        </table>
    3434        {S_FORM_TOKEN}
     35        {S_LOGIN_REDIRECT}
    3536        </form>
    3637
  • trunk/forum/styles/subsilver2/template/mcp_ban.html

    r400 r702  
    8585        <tr>
    8686                <td class="row1" valign="top"><b>{L_BAN_LENGTH}:</b></td>
    87                 <td class="row2"><input style="border: 0; width: 100%" type="text" name="unbanlength" disabled="disabled" /></td>
     87                <td class="row2"><input style="border: 0; width: 100%" type="text" name="unbanlength" readonly="readonly" /></td>
    8888        </tr>
    8989        <tr>
    9090                <td class="row1" valign="top"><b>{L_BAN_REASON}:</b></td>
    91                 <td class="row2"><textarea style="border: 0; width: 100%" name="unbanreason" disabled="disabled" rows="5" cols="80">&nbsp;</textarea></td>
     91                <td class="row2"><textarea style="border: 0; width: 100%" name="unbanreason" readonly="readonly" rows="5" cols="80">&nbsp;</textarea></td>
    9292        </tr>
    9393        <tr>
    9494                <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}:</b></td>
    95                 <td class="row2"><textarea style="border: 0; width: 100%" name="unbangivereason" disabled="disabled" rows="5" cols="80">&nbsp;</textarea></td>
     95                <td class="row2"><textarea style="border: 0; width: 100%" name="unbangivereason" readonly="readonly" rows="5" cols="80">&nbsp;</textarea></td>
    9696        </tr>
    9797        <tr>
  • trunk/forum/styles/subsilver2/template/mcp_front.html

    r400 r702  
    3636        <!-- ENDIF -->
    3737        <tr>
    38                 <td class="cat" colspan="6" align="center"><input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /></td>
     38                <td class="cat" colspan="6" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /></td>
    3939        </tr>
    4040        </table>
     
    8686<!-- ENDIF -->
    8787
     88<!-- IF S_SHOW_PM_REPORTS -->
     89        <table class="tablebg" width="100%" cellspacing="1">
     90        <tr>
     91                <td class="row3" colspan="6" align="center"><b class="gen">{L_LATEST_REPORTED_PMS}</b></td>
     92        </tr>
     93        <tr>
     94                <th>&nbsp;{L_PM_SUBJECT}&nbsp;</th>
     95                <th>&nbsp;{L_PM_FROM}&nbsp;</th>
     96                <th>&nbsp;{L_TO} &amp; {L_BCC}&nbsp;</th>
     97                <th>&nbsp;{L_SENT_AT}&nbsp;</th>
     98                <th>&nbsp;{L_REPORTER}&nbsp;</th>
     99                <th>&nbsp;{L_REPORT_TIME}&nbsp;</th>
     100        </tr>
     101        <!-- BEGIN pm_report -->
     102                <tr>
     103                        <td class="row1" valign="top"><span class="gen">{pm_report.PM_SUBJECT}</span><br /><span class="gensmall">[ <a href="{pm_report.U_PM_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
     104                        <td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.PM_AUTHOR_FULL}</span></td>
     105                        <td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.RECIPIENTS}</span></td>
     106                        <td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.PM_TIME}</span></td>
     107                        <td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.REPORTER_FULL}</span></td>
     108                        <td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.REPORT_TIME}</span></td>
     109                </tr>
     110        <!-- BEGINELSE -->
     111                <tr>
     112                        <td class="row1" colspan="6" align="center"><span class="gen">{L_PM_REPORTS_ZERO_TOTAL}</span></td>
     113                </tr>
     114        <!-- END pm_report -->
     115        <!-- IF S_HAS_PM_REPORTS -->
     116                <tr>
     117                        <td class="row3" colspan="6"><span class="gensmall">{L_PM_REPORTS_TOTAL}</span></td>
     118                </tr>
     119        <!-- ENDIF -->
     120        </table>
     121
     122        <br clear="all" /><br />
     123<!-- ENDIF -->
     124
    88125<!-- IF S_SHOW_LOGS -->
    89126        <table class="tablebg" width="100%" cellspacing="1" cellpadding="4" border="0" align="{S_CONTENT_FLOW_END}">
  • trunk/forum/styles/subsilver2/template/mcp_logs.html

    r400 r702  
    2323        <!-- END log -->
    2424        <tr align="center">
     25                <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_SEARCH_KEYWORDS}:</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td>
     26        </tr>
     27        <tr align="center">
    2528                <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
    2629        </tr>
  • trunk/forum/styles/subsilver2/template/mcp_notes_user.html

    r400 r702  
    1111                <table cellspacing="1" cellpadding="2" border="0">
    1212                <tr>
    13                         <td class="gen" align="center"><!-- IF USER_COLOR --><b style="color: #{USER_COLOR}"><!-- ELSE --><b><!-- ENDIF -->{USERNAME}</b></td>
     13                        <td class="gen" align="center"><b>{USERNAME_FULL}</b></td>
    1414                </tr>
    1515                <!-- IF RANK_TITLE -->
     
    5555<!-- IF S_USER_NOTES -->
    5656
     57        <tr align="center">
     58                <td colspan="5" class="row3"><span class="gensmall">{L_SEARCH_KEYWORDS}:</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td>
     59        </tr>
    5760        <tr align="center">
    5861                <td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
  • trunk/forum/styles/subsilver2/template/mcp_post.html

    r400 r702  
    66        <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
    77        <tr>
    8                 <th colspan="2" align="center">{L_REPORT_DETAILS}</th>
     8                <th colspan="2" align="center"><!-- IF S_PM -->{L_PM_REPORT_DETAILS}<!-- ELSE -->{L_REPORT_DETAILS}<!-- ENDIF --></th>
    99        </tr>
    1010        <tr>
     
    4444<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
    4545<tr>
    46         <th colspan="2" align="center">{L_POST_DETAILS}</th>
    47 </tr>
    48 <tr>
    49         <td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS} | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td>
    50 </tr>
    51 <tr>
    52         <td class="row1"><b class="gen">{L_POST_SUBJECT}: </b></td>
     46        <th colspan="2" align="center"><!-- IF S_PM -->{L_PM}<!-- ELSE -->{L_POST_DETAILS}<!-- ENDIF --></th>
     47</tr>
     48<tr>
     49        <td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS}<!-- IF not S_PM --> | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ENDIF --><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td>
     50</tr>
     51<tr>
     52        <td class="row1"><b class="gen"><!-- IF S_PM -->{L_PM_SUBJECT}<!-- ELSE -->{L_POST_SUBJECT}<!-- ENDIF -->: </b></td>
    5353        <td class="row2"><span class="gen">{POST_SUBJECT}</span> <!-- IF S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF --> <!-- IF S_POST_REPORTED and not S_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td>
    5454</tr>
    5555<tr>
    56         <td class="row1" width="20%"><b class="gen">{L_POSTER}: </b></td>
     56        <td class="row1" width="20%"><b class="gen"><!-- IF S_PM -->{L_PM_FROM}<!-- ELSE -->{L_POSTER}<!-- ENDIF -->: </b></td>
    5757        <td class="row2" width="80%"><span class="gen"<!-- IF POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{POST_AUTHOR}</span><span class="gen"> &nbsp; [ <!-- IF U_POST_AUTHOR --><a href="{U_POST_AUTHOR}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_POST_AUTHOR --> | <!-- ENDIF --><a href="{U_MCP_USER_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_MCP_WARN_USER -->| <a href="{U_MCP_WARN_USER}">{L_WARN_USER}</a><!-- ENDIF --><!-- ENDIF --> ]</span></td>
    5858</tr>
    5959<!-- IF S_CAN_VIEWIP -->
    6060        <tr>
    61                 <td class="row1"><b class="gen">{L_THIS_POST_IP}: </b></td>
     61                <td class="row1"><b class="gen"><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->: </b></td>
    6262                <td class="row2"><span class="gen">
    6363                        <!-- IF U_WHOIS -->
     
    7070<!-- ENDIF -->
    7171<tr>
    72         <td class="row1"><b class="gen">{L_POSTED}: </b></td>
     72        <td class="row1"><b class="gen"><!-- IF S_PM -->{L_SENT_AT}<!-- ELSE -->{L_POSTED}<!-- ENDIF -->: </b></td>
    7373        <td class="row2"><span class="postdetails">{POST_DATE}</span></td>
    7474</tr>
     75<!-- IF S_TO_RECIPIENT -->
     76        <tr>
     77                <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_TO}:</b></td>
     78                <td class="row2 gen">
     79                <!-- BEGIN to_recipient -->
     80                        <!-- IF to_recipient.IS_GROUP --><span class="sep"><a href="{to_recipient.U_VIEW}">{to_recipient.NAME}</a></span><!-- ELSE -->{to_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
     81                <!-- END to_recipient -->
     82                </td>
     83        </tr>
     84<!-- ENDIF -->
     85
     86<!-- IF S_BCC_RECIPIENT -->
     87        <tr>
     88                <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_BCC}:</b></td>
     89                <td class="row2 gen">
     90                <!-- BEGIN bcc_recipient -->
     91                        <!-- IF bcc_recipient.IS_GROUP --><span class="sep"><a href="{bcc_recipient.U_VIEW}">{bcc_recipient.NAME}</a></span><!-- ELSE -->{bcc_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
     92                <!-- END bcc_recipient -->
     93                </td>
     94        </tr>
     95<!-- ENDIF -->
    7596<tr>
    7697        <th colspan="2" align="center">{L_PREVIEW}</th>
  • trunk/forum/styles/subsilver2/template/mcp_reports.html

    r400 r702  
    88</tr>
    99<tr>
    10         <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
     10        <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- IF not S_PM -->&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
    1111</tr>
    1212<tr>
     13        <!-- IF S_PM -->
     14        <th>&nbsp;{L_PM}&nbsp;</th>
     15        <th>&nbsp;{L_TO} &amp; {L_BCC}&nbsp;</th>
     16        <!-- ELSE -->
    1317        <th>&nbsp;{L_POST}&nbsp;</th>
    1418        <th>&nbsp;{L_AUTHOR}&nbsp;</th>
     19        <!-- ENDIF -->
    1520        <th>&nbsp;{L_REPORTER}&nbsp;</th>
    1621        <th>&nbsp;{L_REPORT_TIME}&nbsp;</th>
     
    2025
    2126        <!-- IF postrow.S_ROW_ is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
     27                <!-- IF S_PM -->
     28                <td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEW_DETAILS}">{postrow.PM_SUBJECT}</a></p>
     29                        <span class="gensmall">{L_PM_FROM}: {postrow.PM_AUTHOR_FULL}</span></td>
     30                <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><span class="gen">{postrow.RECIPIENTS}</span><br />
     31                        <span class="gensmall">{L_SENT_AT}: {postrow.PM_TIME}</span></td>
     32                <!-- ELSE -->
    2233                <td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p>
    2334                        <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td>
    2435                <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br />
    2536                        <span class="gensmall">{postrow.POST_TIME}</span></td>
     37                <!-- ENDIF -->
    2638                <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.REPORTER_FULL}</span></td>
    2739                <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.REPORT_TIME}</span><br />
  • trunk/forum/styles/subsilver2/template/mcp_topic.html

    r400 r702  
    6262</tr>
    6363<tr>
    64         <th nowrap="nowrap">{L_AUTHOR}</th>
    65         <th nowrap="nowrap">{L_MESSAGE}</th>
    66         <th nowrap="nowrap">{L_SELECT}</th>
     64        <th nowrap="nowrap" colspan="3">{L_TOPIC_REVIEW}: {TOPIC_TITLE}</th>
    6765</tr>
    6866<tr>
     
    8280                        </table>
    8381                </td>
    84                 <td rowspan="2" width="5%" align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></td>
     82                <td width="5%" align="center"><a href="{postrow.U_POST_DETAILS}">{INFO_IMG}</a></td>
    8583        </tr>
    8684
    8785        <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
    8886
    89                 <td valign="bottom">
    90                         <table width="100%" cellspacing="0" cellpadding="0" border="0">
    91                         <tr valign="middle">
    92                                 <td align="center"><span class="gensmall">[ <a href="{postrow.U_POST_DETAILS}">{L_POST_DETAILS}</a> ]</span></td>
    93                         </tr>
    94                         </table>
    95                 </td>
    96                 <td width="100%" valign="top">
     87                <td width="100%" valign="top" colspan="2">
    9788                        <table width="100%" cellspacing="0" cellpadding="2" border="0">
    9889                        <tr>
     
    121112                                        <tr valign="middle">
    122113                                                <td width="100%">
    123                                                         <!-- IF postrow.S_POST_UNAPPROVED and postrow.U_MCP_APPROVE -->{UNAPPROVED_IMG} <span class="postapprove"><a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><!-- ENDIF -->
    124                                                         <!-- IF postrow.S_POST_REPORTED and postrow.U_MCP_REPORT -->{REPORTED_IMG}<span class="postreported"><a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
     114                                                        <!-- IF postrow.S_POST_UNAPPROVED and postrow.U_MCP_APPROVE --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><br /><!-- ENDIF -->
     115                                                        <!-- IF postrow.S_POST_REPORTED and postrow.U_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
    125116                                                </td>
    126117                                                <td width="10" nowrap="nowrap">{postrow.MINI_POST_IMG}</td>
     
    132123                        </table>
    133124                </td>
     125                <td width="5%" align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></td>
    134126        </tr>
    135127        <tr>
  • trunk/forum/styles/subsilver2/template/mcp_warn_user.html

    r400 r702  
    99                <table cellspacing="1" cellpadding="2" border="0">
    1010                <tr>
    11                         <td class="gen" align="center"><!-- IF USER_COLOR --><b style="color: #{USER_COLOR}"><!-- ELSE --><b><!-- ENDIF -->{USERNAME}</b></td>
     11                        <td class="gen" align="center"><b>{USERNAME_FULL}</b></td>
    1212                </tr>
    1313                <!-- IF RANK_TITLE -->
  • trunk/forum/styles/subsilver2/template/memberlist_im.html

    r400 r702  
    1515        <tr>
    1616                <td class="row1"><b class="genmed">{L_IM_RECIPIENT}: </b></td>
    17                 <td class="row2"><span class="gen"><b>{USERNAME}</b><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM --> [ {IM_CONTACT} ]<!-- ENDIF --></span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td>
     17                <td class="row2"><span class="gen"><b>{USERNAME}</b><!-- IF S_SEND_ICQ or S_SEND_AIM or S_SEND_MSNM or S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --></span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td>
    1818        </tr>
    1919
     
    132132
    133133        </table>
    134         <a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
    135134{S_FORM_TOKEN}
    136135</form>
    137136
     137<a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
    138138
    139139<!-- INCLUDE simple_footer.html -->
  • trunk/forum/styles/subsilver2/template/memberlist_view.html

    r400 r702  
    5252                        <!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
    5353                                <tr>
    54                                         <td class="genmed" align="center">[ <!-- IF U_ADD_FRIEND and U_ADD_FOE--><a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a> | <a href="{U_ADD_FOE}">{L_ADD_FOE}</a><!-- ENDIF --><!-- IF U_REMOVE_FRIEND --><a href="{U_REMOVE_FRIEND}">{L_REMOVE_FRIEND}</a><!-- ENDIF --><!-- IF U_REMOVE_FOE --><a href="{U_REMOVE_FOE}">{L_REMOVE_FOE}</a><!-- ENDIF --> ]</td>
     54                                        <td class="genmed" align="center">[
     55                                                <!-- IF U_REMOVE_FRIEND -->
     56                                                        <a href="{U_REMOVE_FRIEND}">{L_REMOVE_FRIEND}</a>
     57                                                <!-- ELSEIF U_REMOVE_FOE -->
     58                                                        <a href="{U_REMOVE_FOE}">{L_REMOVE_FOE}</a>
     59                                                <!-- ELSE -->
     60                                                        <!-- IF U_ADD_FRIEND --><a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a><!-- ENDIF --><!-- IF U_ADD_FOE --><!-- IF U_ADD_FRIEND --> | <!-- ENDIF --><a href="{U_ADD_FOE}">{L_ADD_FOE}</a><!-- ENDIF -->
     61                                                <!-- ENDIF -->
     62                                        ]</td>
    5563                                </tr>
    5664                        <!-- ENDIF -->
     
    6775                                <td width="100%"><b class="gen">{VISITED}</b></td>
    6876                        </tr>
    69                         <!-- IF U_NOTES or U_WARN -->
     77                        <!-- IF S_WARNINGS -->
    7078                                <tr>
    7179                                        <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}: </td>
    72                                         <td width="100%"><b class="gen">{WARNINGS}</b><br /><span class="genmed">[ <a href="{U_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_WARN --> | <a href="{U_WARN}">{L_WARN_USER}</a> <!-- ENDIF -->]</span></td>
     80                                        <td width="100%"><b class="gen">{WARNINGS}</b><!-- IF U_NOTES or U_WARN --><br /><span class="genmed"> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]</span><!-- ENDIF --></td>
    7381                                </tr>
    7482                        <!-- ENDIF -->
     
    7785                                <td><b class="gen">{POSTS}</b><span class="genmed"><!-- IF POSTS_PCT --><br />[{POSTS_PCT} / {POSTS_DAY}]<!-- ENDIF -->
    7886                                <!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />[<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>]<!-- ELSEIF POSTS_IN_QUEUE --><br />[{L_POSTS_IN_QUEUE}]<!-- ENDIF -->
    79                                 <br /><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a></span></td>
     87                                <!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a><!-- ENDIF --></span></td>
    8088                        </tr>
    8189                        <!-- IF S_SHOW_ACTIVITY -->
     
    127135                        <tr>
    128136                                <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_JABBER}: </td>
    129                                 <td><!-- IF U_JABBER and S_JABBER_ENABLED --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td>
     137                                <td><!-- IF U_JABBER --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td>
    130138                        </tr>
    131139                        </table>
  • trunk/forum/styles/subsilver2/template/overall_header.html

    r400 r702  
    1212<meta name="keywords" content="" />
    1313<meta name="description" content="" />
     14<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    1415{META}
    1516<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
     17
     18<!-- IF S_ENABLE_FEEDS -->
     19        <!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
     20        <!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
     21        <!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
     22        <!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
     23        <!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" /><!-- ENDIF -->
     24        <!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
     25        <!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}" /><!-- ENDIF -->
     26<!-- ENDIF -->
    1627
    1728<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
     
    4051{
    4152        var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}');
    42         var perpage = '{PER_PAGE}';
     53        var per_page = '{PER_PAGE}';
    4354        var base_url = '{A_BASE_URL}';
    4455
    45         if (page !== null && !isNaN(page) && page > 0)
    46         {
    47                 document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * perpage);
     56        if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
     57        {
     58                if (base_url.indexOf('?') == -1)
     59                {
     60                        document.location.href = base_url + '?start=' + ((page - 1) * per_page);
     61                }
     62                else
     63                {
     64                        document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
     65                }
    4866        }
    4967}
     
    152170                                        <!-- IF S_USER_LOGGED_IN -->
    153171                                                <!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF -->
    154                                         <!-- ELSEIF S_REGISTER_ENABLED --> &nbsp;<a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a>
     172                                        <!-- ELSEIF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --> &nbsp;<a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a>
    155173                                        <!-- ENDIF -->
    156174                                <!-- ENDIF -->
     
    185203                <span style="float: {S_CONTENT_FLOW_BEGIN};"><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> | <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></span>
    186204                <!-- IF S_USER_LOGGED_IN -->
    187                 <span style="float: {S_CONTENT_FLOW_END};"><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
     205                <span style="float: {S_CONTENT_FLOW_END};"><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> | <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></span>
    188206                <!-- ENDIF -->
    189207        </p>
  • trunk/forum/styles/subsilver2/template/posting_body.html

    r400 r702  
    211211                <!-- INCLUDE posting_buttons.html -->
    212212                <tr>
    213                         <td valign="top" style="width: 100%;"><textarea name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" style="width: 98%;">{MESSAGE}</textarea></td>
     213                        <td valign="top" style="width: 100%;"><textarea name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" style="width: 98%;">{MESSAGE}</textarea></td>
    214214                        <!-- IF S_BBCODE_ALLOWED -->
    215215                        <td width="80" align="center" valign="top">
     
    250250                        <td class="gensmall">{URL_STATUS}</td>
    251251                </tr>
     252                <!-- ENDIF -->
    252253                <tr>
    253254                        <td class="gensmall">{SMILIES_STATUS}</td>
    254255                </tr>
    255                 <!-- ENDIF -->
    256256                </table>
    257257        </td>
     
    333333<!-- ENDIF -->
    334334
    335 <!-- IF S_CONFIRM_CODE -->
    336         <tr>
    337                 <th colspan="2" valign="middle">{L_POST_CONFIRMATION}</th>
    338         </tr>
    339         <tr>
    340                 <td class="row3" colspan="2"><span class="gensmall">{L_POST_CONFIRM_EXPLAIN}</span></td>
    341         </tr>
    342         <tr>
    343                 <td class="row1" colspan="2" align="center">
    344                         <input type="hidden" name="confirm_id" value="{CONFIRM_ID}" />
    345                         {CONFIRM_IMAGE}
    346                 </td>
    347         </tr>
    348         <tr>
    349                 <td class="row1"><b class="genmed">{L_CONFIRM_CODE}: </b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
    350                 <td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8" /></td>
    351         </tr>
    352 <!-- ENDIF -->
     335                <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
     336                <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
     337                <!-- ENDIF -->
     338
    353339
    354340<!-- IF S_SHOW_ATTACH_BOX or S_SHOW_POLL_BOX -->
  • trunk/forum/styles/subsilver2/template/posting_buttons.html

    r400 r702  
    5959                        <option value="85">{L_FONT_SMALL}</option>
    6060                        <option value="100" selected="selected">{L_FONT_NORMAL}</option>
    61                         <option value="150">{L_FONT_LARGE}</option>
    62                         <option value="200">{L_FONT_HUGE}</option>
     61                        <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 150 -->
     62                                <option value="150">{L_FONT_LARGE}</option>
     63                                <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 200 -->
     64                                        <option value="200">{L_FONT_HUGE}</option>
     65                                <!-- ENDIF -->
     66                        <!-- ENDIF -->
    6367                </select></span>
    6468<!-- ENDIF -->
  • trunk/forum/styles/subsilver2/template/posting_review.html

    r400 r702  
    2020
    2121                        <!-- IF post_review_row.S_ROW_COUNT is even --> <tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
     22                                <!-- IF post_review_row.S_IGNORE_POST -->
     23                                <td colspan="2">{post_review_row.L_IGNORE_POST}</td>
     24                                <!-- ELSE -->
    2225
    2326                                <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{post_review_row.POST_ID}"></a>
     
    8386                                        </table>
    8487                                </td>
     88                        <!-- ENDIF -->
    8589                        </tr>
    8690                        <tr>
  • trunk/forum/styles/subsilver2/template/posting_smilies.html

    r400 r702  
    1717                </tr>
    1818                <tr>
    19                         <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
     19                        <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br />{PAGINATION}<br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
    2020                </tr>
    2121                </table>
     
    2323</tr>
    2424</table>
    25 
    2625<!-- INCLUDE simple_footer.html -->
  • trunk/forum/styles/subsilver2/template/posting_topic_review.html

    r400 r702  
    1616                        <!-- IF topic_review_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
    1717
     18                                <!-- IF topic_review_row.S_IGNORE_POST -->
     19                                <td colspan="2">{topic_review_row.L_IGNORE_POST}</td>
     20                                <!-- ELSE -->
    1821                                <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{topic_review_row.POST_ID}"></a>
    1922                                        <table width="150" cellspacing="0">
     
    8285                                        </table>
    8386                                </td>
     87                                <!-- ENDIF -->
    8488                        </tr>
    8589                        <tr>
  • trunk/forum/styles/subsilver2/template/report_body.html

    r400 r702  
    55<table class="tablebg" width="100%" cellspacing="1">
    66<tr>
    7         <th colspan="2">{L_REPORT_POST}</th>
     7        <th colspan="2"><!-- IF S_REPORT_POST -->{L_REPORT_POST}<!-- ELSE -->{L_REPORT_MESSAGE}<!-- ENDIF --></th>
    88</tr>
    99<tr>
    10         <td class="row3" colspan="2"><span class="gensmall">{L_REPORT_POST_EXPLAIN}</span></td>
     10        <td class="row3" colspan="2"><span class="gensmall"><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></span></td>
    1111</tr>
    1212<tr>
  • trunk/forum/styles/subsilver2/template/search_results.html

    r400 r702  
    99<tr>
    1010        <td class="genmed"><!-- IF SEARCH_TOPIC -->{L_SEARCHED_TOPIC}: <a href="{U_SEARCH_TOPIC}"><b>{SEARCH_TOPIC}</b></a><br /><!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_SEARCHED_FOR}: <a href="{U_SEARCH_WORDS}"><b>{SEARCH_WORDS}</b></a><!-- ENDIF --><!-- IF IGNORED_WORDS --> {L_IGNORED_TERMS}: <b>{IGNORED_WORDS}</b><!-- ENDIF --></td>
    11         <td align="{S_CONTENT_FLOW_END}"><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}: </span><input type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td>
     11        <td align="{S_CONTENT_FLOW_END}"><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}: </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td>
    1212</tr>
    1313</table>
  • trunk/forum/styles/subsilver2/template/template.cfg

    r400 r702  
    33#
    44# @package phpBB3
    5 # @copyright (c) 2005 phpBB Group 
    6 # @license http://opensource.org/licenses/gpl-license.php GNU Public License 
     5# @copyright (c) 2005 phpBB Group
     6# @license http://opensource.org/licenses/gpl-license.php GNU Public License
    77#
    88#
     
    1212#
    1313# Values get trimmed, if you want to add a space in front or at the end of
    14 # the value, then enclose the value with single or double quotes. 
     14# the value, then enclose the value with single or double quotes.
    1515# Single and double quotes do not need to be escaped.
    1616#
    17 # 
     17#
    1818
    1919# General Information about this template
    2020name = subsilver2
    2121copyright = &copy; phpBB Group, 2003
    22 version = 3.0.4
     22version = 3.0.7
    2323
  • trunk/forum/styles/subsilver2/template/ucp_agreement.html

    r400 r702  
    11<!-- INCLUDE overall_header.html -->
    22
     3<!-- IF S_SHOW_COPPA or S_REGISTRATION -->
    34
     5<!-- IF S_LANG_OPTIONS -->
     6<script type="text/javascript">
     7// <![CDATA[
     8        /**
     9        * Change language
     10        */
     11        function change_language(lang_iso)
     12        {
     13                document.forms['register'].change_lang.value = lang_iso;
     14                document.forms['register'].submit();
     15        }
    416
    5 <!-- IF S_SHOW_COPPA or S_REGISTRATION -->
     17// ]]>
     18</script>
     19
     20        <form method="post" action="{S_UCP_ACTION}" id="register">
     21                <table width="100%" cellspacing="0">
     22                        <tr>
     23                                <td class="gensmall" align="{S_CONTENT_FLOW_END}">{L_LANGUAGE}: <select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></td>
     24                        </tr>
     25                </table>
     26                {S_HIDDEN_FIELDS}
     27        </form>
     28<!-- ENDIF -->
    629
    730        <form method="post" action="{S_UCP_ACTION}">
  • trunk/forum/styles/subsilver2/template/ucp_groups_manage.html

    r400 r702  
    6464        </tr>
    6565        <!-- IF not S_IN_AVATAR_GALLERY -->
    66                 <!-- IF S_CAN_UPLOAD -->
     66                <!-- IF S_UPLOAD_AVATAR_FILE -->
    6767                        <tr>
    6868                                <td class="row1" width="35%"><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></td>
    6969                                <td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></td>
    7070                        </tr>
     71                <!-- ENDIF -->
     72                <!-- IF S_UPLOAD_AVATAR_URL -->
    7173                        <tr>
    7274                                <td class="row1" width="35%"><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
     
    7476                        </tr>
    7577                <!-- ENDIF -->
     78                <!-- IF S_LINK_AVATAR -->
    7679                <tr>
    7780                        <td class="row1" width="35%"><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td>
     
    8285                        <td class="row2"><input name="width" type="text" id="width" size="3" value="{AVATAR_WIDTH}" /> <span>px X </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>px</span></td>
    8386                </tr>
     87                <!-- ENDIF -->
    8488                <!-- IF S_DISPLAY_GALLERY -->
    8589                        <tr>
     
    194198        <h1>{L_ADD_USERS}</h1>
    195199
    196         <p>{L_ADD_USERS_EXPLAIN}</p>
     200        <p>{L_ADD_USERS_UCP_EXPLAIN}</p>
    197201
    198202        <table class="tablebg" width="100%" cellspacing="1">
  • trunk/forum/styles/subsilver2/template/ucp_header.html

    r400 r702  
    3737                </tr>
    3838                <tr>
    39                         <td class="row2"><select name="group_list[]" multiple="true" size="5" style="width:150px">{S_GROUP_OPTIONS}</select></td>
     39                        <td class="row2"><select name="group_list[]" multiple="multiple" size="5" style="width:150px">{S_GROUP_OPTIONS}</select></td>
    4040                </tr>
    4141        <!-- ENDIF -->
  • trunk/forum/styles/subsilver2/template/ucp_main_drafts.html

    r400 r702  
    7070                        <!-- INCLUDE posting_buttons.html -->
    7171                        <tr>
    72                                 <td colspan="9"><textarea class="post" name="message" rows="10" cols="70" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{DRAFT_MESSAGE}</textarea></td>
     72                                <td colspan="9"><textarea class="post" name="message" rows="10" cols="70" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{DRAFT_MESSAGE}</textarea></td>
    7373                        </tr>
    7474                        <tr>
  • trunk/forum/styles/subsilver2/template/ucp_main_front.html

    r400 r702  
    4444                <tr>
    4545                        <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_TOTAL_POSTS}: </b></td>
    46                         <td><!-- IF POSTS_PCT --><b class="gen">{POSTS}</b><br /><span class="genmed">[{POSTS_PCT} / {POSTS_DAY}]<br /><a href="{U_SEARCH_SELF}">{L_SEARCH_YOUR_POSTS}</a></span><!-- ELSE --><b class="gen">{POSTS}<b><!-- ENDIF --></td>
     46                        <td><!-- IF POSTS_PCT --><b class="gen">{POSTS}</b><br /><span class="genmed">[{POSTS_PCT} / {POSTS_DAY}]<!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_SELF}">{L_SEARCH_YOUR_POSTS}</a><!-- ENDIF --></span><!-- ELSE --><b class="gen">{POSTS}<b><!-- ENDIF --></td>
    4747                </tr>
    4848                <!-- IF S_SHOW_ACTIVITY -->
  • trunk/forum/styles/subsilver2/template/ucp_pm_viewfolder.html

    r400 r702  
    3838</form>
    3939<!-- ELSE -->
    40        
     40
    4141        <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" border="0">
    4242        <!-- IF NUM_NOT_MOVED or NUM_REMOVED -->
     
    7575
    7676                        <span class="topictitle">
    77                                 {messagerow.ATTACH_ICON_IMG} 
     77                                {messagerow.ATTACH_ICON_IMG}
    7878                                <!-- IF messagerow.S_PM_DELETED -->
    7979                                        {L_MESSAGE_REMOVED_FROM_OUTBOX}<br />
     
    9393        <!-- BEGINELSE -->
    9494                <tr>
    95                         <td class="row1" colspan="{$COLSPAN}" height="30" align="center" valign="middle"><span class="gen">{L_NO_MESSAGES}</span></td>
     95                        <td class="row1" colspan="{$COLSPAN}" height="30" align="center" valign="middle"><span class="gen">
     96                        <!-- IF S_COMPOSE_PM_VIEW and S_NO_AUTH_SEND_MESSAGE -->
     97                                <!-- IF S_USER_NEW -->{L_USER_NEW_PERMISSION_DISALLOWED}<!-- ELSE -->{L_NO_AUTH_SEND_MESSAGE}<!-- ENDIF -->
     98                        <!-- ELSE -->
     99                                {L_NO_MESSAGES}
     100                        <!-- ENDIF -->
     101                        </span></td>
    96102                </tr>
    97103        <!-- END messagerow -->
  • trunk/forum/styles/subsilver2/template/ucp_pm_viewmessage.html

    r400 r702  
    9494                                <table width="100%" cellspacing="0">
    9595                                <tr valign="middle">
    96                                         <td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF U_DELETE --><a href="{U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF --></td>
     96                                        <td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF U_REPORT --><a href="{U_REPORT}">{REPORT_IMG}</a> <!-- ENDIF --><!-- IF U_DELETE --><a href="{U_DELETE}">{DELETE_IMG}</a> <!-- ENDIF --></td>
    9797                                </tr>
    9898                                </table>
  • trunk/forum/styles/subsilver2/template/ucp_pm_viewmessage_print.html

    r400 r702  
    8686                <td>
    8787                <!-- BEGIN to_recipient -->
    88                         <!-- IF to_recipient.COLOUR --><span style="color:{to_recipient.COLOUR}"><!-- ELSE --><span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->><!-- ENDIF -->{to_recipient.NAME}</span>&nbsp;
     88                        <span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->>{to_recipient.NAME}</span>&nbsp;
    8989                <!-- END to_recipient -->
    9090                </td>
  • trunk/forum/styles/subsilver2/template/ucp_profile_avatar.html

    r400 r702  
    4141        <tr>
    4242                <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_SIZE}: </b><br /><span class="gensmall">{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td>
    43                 <td class="row2"><input class="post" type="text" name="width" size="3" value="{AVATAR_WIDTH}" /> <span class="gen">px X </span> <input class="post" type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span class="gen">px</span></td>
     43                <td class="row2"><input class="post" type="text" name="width" size="3" value="{AVATAR_WIDTH}" /> <span class="gen">{L_PIXEL} &times; </span> <input class="post" type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span class="gen">{L_PIXEL}</span></td>
    4444        </tr>
    4545<!-- ENDIF -->
  • trunk/forum/styles/subsilver2/template/ucp_profile_signature.html

    r400 r702  
    2828                <!-- INCLUDE posting_buttons.html -->
    2929                <tr>
    30                         <td colspan="2"><textarea class="post" name="signature" rows="10" cols="76" style="width: 90%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{SIGNATURE}</textarea></td>
     30                        <td colspan="2"><textarea class="post" name="signature" rows="10" cols="76" style="width: 90%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{SIGNATURE}</textarea></td>
    3131                </tr>
    3232                <!-- IF S_BBCODE_ALLOWED -->
  • trunk/forum/styles/subsilver2/template/ucp_register.html

    r400 r702  
    3333        </tr>
    3434<!-- ENDIF -->
    35 <!-- IF .profile_fields -->
    36         <tr>
    37                 <td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
    38         </tr>
    39 <!-- ENDIF -->
    4035
    4136<tr>
     
    6762        <td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td>
    6863</tr>
     64<!-- IF .profile_fields -->
     65        <tr>
     66                <td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
     67        </tr>
    6968<!-- BEGIN profile_fields -->
    7069        <tr>
     
    7675                <td class="row2">{profile_fields.FIELD}<!-- IF profile_fields.ERROR --><br /><span class="gensmall error">{profile_fields.ERROR}</span><!-- ENDIF --></td>
    7776        </tr>
     77       
    7878<!-- END profile_fields -->
     79<!-- ENDIF -->
    7980
    80 <!-- IF S_CONFIRM_CODE -->
    81         <tr>
    82                 <th colspan="2" valign="middle">{L_CONFIRMATION}</th>
    83         </tr>
    84         <tr>
    85                 <td class="row3" colspan="2"><span class="gensmall">{L_CONFIRM_EXPLAIN}</span></td>
    86         </tr>
    87         <tr>
    88                 <td class="row1" colspan="2" align="center">{CONFIRM_IMG}</td>
    89         </tr>
    90         <tr>
    91                 <td class="row1"><b class="genmed">{L_CONFIRM_CODE}: </b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
    92                 <td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8" /></td>
    93         </tr>
    94 <!-- ENDIF -->
     81                <!-- IF CAPTCHA_TEMPLATE -->
     82                <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
     83                <!-- ENDIF -->
    9584
    9685<!-- IF S_COPPA -->
  • trunk/forum/styles/subsilver2/template/ucp_zebra_foes.html

    r400 r702  
    2525</tr>
    2626</table>
    27 <!-- TEST -->
    28 
    2927
    3028<!-- INCLUDE ucp_footer.html -->
  • trunk/forum/styles/subsilver2/template/viewforum_body.html

    r400 r702  
    112112        </table>
    113113
    114         <!-- IF not S_USER_LOGGED_IN -->
     114        <!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
    115115
    116116                <br /><br />
     
    126126                </tr>
    127127                </table>
    128                
     128                {S_LOGIN_REDIRECT}
    129129                </form>
    130130
     
    299299                                <td>&nbsp;&nbsp;</td>
    300300                                <td style="text-align: center;">{FOLDER_STICKY_IMG}</td>
    301                                 <td class="gensmall">{L_ICON_STICKY}</td>                       
     301                                <td class="gensmall">{L_ICON_STICKY}</td>
    302302                        </tr>
    303303                        <tr>
  • trunk/forum/styles/subsilver2/template/viewtopic_body.html

    r400 r702  
    119119                        </table>
    120120                        {S_HIDDEN_FIELDS}
    121                        
     121                        {S_FORM_TOKEN}
    122122                        </form>
    123                        
     123
    124124                </td>
    125125        </tr>
     
    156156                        </td>
    157157                </tr>
    158                
     158
    159159                <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
    160160
     
    179179                                <tr>
    180180                                        <td>{postrow.POSTER_AVATAR}</td>
     181                                </tr>
     182                        <!-- ENDIF -->
     183                        <!-- IF not (postrow.ONLINE_IMG or postrow.RANK_TITLE or postrow.RANK_IMG or postrow.POSTER_AVATAR) -->
     184                                <tr>
     185                                        <td></td>
    181186                                </tr>
    182187                        <!-- ENDIF -->
     
    206211                                                <table width="100%" cellspacing="0">
    207212                                                <tr>
    208                                                         <td class="gensmall"><!-- IF postrow.S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF --> <!-- IF postrow.S_POST_REPORTED --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td>
     213                                                        <td class="gensmall"><!-- IF postrow.S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><br /> <!-- ENDIF --> <!-- IF postrow.S_POST_REPORTED --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF --></td>
    209214                                                </tr>
    210215                                                </table>
     
    255260
    256261                                        <!-- IF postrow.BUMPED_MESSAGE -->
    257                                                 <span class="gensmall">{postrow.BUMPED_MESSAGE}</span>
     262                                                <span class="gensmall"><br /><br />{postrow.BUMPED_MESSAGE}</span>
    258263                                        <!-- ENDIF -->
    259264
     
    281286
    282287                        <td class="profile"><strong><a href="#wrapheader">{L_BACK_TO_TOP}</a></strong></td>
    283                         <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF postrow.U_PROFILE --><a href="{postrow.U_PROFILE}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_PM --><a href="{postrow.U_PM}">{PM_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF not S_IS_BOT --><!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- ENDIF -->&nbsp;</div></td>
     288                        <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_PM --><a href="{postrow.U_PM}">{PM_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF not S_IS_BOT --><!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- ENDIF -->&nbsp;</div></td>
    284289        <!-- ENDIF -->
    285290                </tr>
     
    320325
    321326<br clear="all" />
     327<!-- IF S_QUICK_REPLY -->
     328<!-- INCLUDE quickreply_editor.html -->
     329<!-- ENDIF -->
    322330
    323331<!-- INCLUDE breadcrumbs.html -->
  • trunk/forum/styles/subsilver2/template/viewtopic_print.html

    r400 r702  
    2525}
    2626
    27 .code,
    28 .quote {
     27.code, .codecontent,
     28.quote, .quotecontent {
     29        margin: 0 5px 0 5px;
     30        padding: 5px;
    2931        font-size: smaller;
    3032        border: black solid 1px;
     33}
     34
     35.quotetitle {
     36        color: black;
     37        display : block;
     38        font-weight: bold;
    3139}
    3240
     
    8492        <tr>
    8593                <td width="10%" nowrap="nowrap">{L_AUTHOR}:&nbsp;</td>
    86                 <td><b<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{postrow.POST_AUTHOR}</b> [ {postrow.POST_DATE} ]</td>
     94                <td><b>{postrow.POST_AUTHOR}</b> [ {postrow.POST_DATE} ]</td>
    8795        </tr>
    8896        <tr>
  • trunk/forum/styles/subsilver2/theme/stylesheet.css

    r400 r702  
    3535
    3636#wrapheader {
    37         min-height: 120px;
    3837        height: auto !important;
    39         height: 120px;
    40 /*      background-image: url('./images/background.gif');
    41         background-repeat: repeat-x;*/
    42 /*      padding: 0 25px 15px 25px;*/
    4338        padding: 0;
    4439}
     
    6358
    6459#logodesc {
    65         margin-bottom: 5px;
    66         padding: 5px 25px;
    67         background: #D9DFE4;
    68         border-bottom: 1px solid #4787A7;
     60        background-color: #C1CAD2;
     61        background-image: url('./images/background.gif');
     62        background-repeat: repeat-x;
     63        background-position: center bottom;
     64        padding: 0 25px 15px 25px;
    6965}
    7066
     
    228224.postapprove img, .postreported img {
    229225        vertical-align: bottom;
     226        padding-top: 5px;
    230227}
    231228
     
    383380/* Links
    384381 ------------ */
     382
     383/* Links adjustment to correctly display an order of rtl/ltr mixed content */
     384.rtl a {
     385        direction: rtl;
     386        unicode-bidi: embed;
     387}
     388
    385389a:link {
    386390        color: #006597;
  • trunk/forum/styles/subsilver2/theme/theme.cfg

    r400 r702  
    33#
    44# @package phpBB3
    5 # @copyright (c) 2005 phpBB Group 
    6 # @license http://opensource.org/licenses/gpl-license.php GNU Public License 
     5# @copyright (c) 2005 phpBB Group
     6# @license http://opensource.org/licenses/gpl-license.php GNU Public License
    77#
    88#
     
    1212#
    1313# Values get trimmed, if you want to add a space in front or at the end of
    14 # the value, then enclose the value with single or double quotes. 
     14# the value, then enclose the value with single or double quotes.
    1515# Single and double quotes do not need to be escaped.
    1616#
    1717# Available and used values:
    1818# parse_css_file
    19 # 
     19#
    2020
    2121# General Information about this theme
    2222name = subsilver2
    2323copyright = &copy; phpBB Group, 2003
    24 version = 3.0.4
     24version = 3.0.7
    2525
    2626# Some configuration options
    2727
    2828#
    29 # You have to turn this option on if you want to use the 
     29# You have to turn this option on if you want to use the
    3030# path template variables ({T_IMAGESET_PATH} for example) within
    3131# your css file.
  • trunk/forum/ucp.php

    r400 r702  
    33*
    44* @package ucp
    5 * @version $Id: ucp.php 8915 2008-09-23 13:30:52Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    128128                        'AGREEMENT_TEXT'                => sprintf($user->lang[$message], $config['sitename'], generate_board_url()),
    129129                        'U_BACK'                                => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'),
    130                         'L_BACK'                                => $user->lang['BACK_TO_LOGIN'])
    131                 );
     130                        'L_BACK'                                => $user->lang['BACK_TO_LOGIN'],
     131                ));
    132132
    133133                page_footer();
     
    144144                        foreach ($_COOKIE as $cookie_name => $cookie_data)
    145145                        {
     146                                // Only delete board cookies, no other ones...
     147                                if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0)
     148                                {
     149                                        continue;
     150                                }
     151
    146152                                $cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name);
    147153
     
    187193                $db->sql_freeresult($result);
    188194
    189                 if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'])
     195                if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'] || !check_link_hash(request_var('hash', ''), 'switchperm'))
    190196                {
    191197                        redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
     
    215221
    216222                $auth->acl_cache($user->data);
    217 
    218                 $sql = 'UPDATE ' . USERS_TABLE . "
    219                         SET user_perm_from = 0
    220                         WHERE user_id = " . $user->data['user_id'];
    221                 $db->sql_query($sql);
    222223
    223224                $sql = 'SELECT username
  • trunk/forum/viewforum.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: viewforum.php 9003 2008-10-11 18:23:12Z toonarmy $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    136136{
    137137        $template->assign_var('S_HAS_SUBFORUM', false);
    138         get_moderators($moderators, $forum_id);
     138        if ($config['load_moderators'])
     139        {
     140                get_moderators($moderators, $forum_id);
     141        }
    139142}
    140143
    141144// Dump out the page header and load viewforum template
    142 page_header($user->lang['VIEW_FORUM'] . ' - ' . $forum_data['forum_name']);
     145page_header($user->lang['VIEW_FORUM'] . ' - ' . $forum_data['forum_name'], true, $forum_id);
    143146
    144147$template->set_filenames(array(
     
    164167        $template->assign_vars(array(
    165168                'S_NO_READ_ACCESS'              => true,
    166                 'S_AUTOLOGIN_ENABLED'   => ($config['allow_autologin']) ? true : false,
    167                 'S_LOGIN_ACTION'                => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') . '&amp;redirect=' . urlencode(str_replace('&amp;', '&', build_url())),
    168169        ));
    169170
     
    177178        if (check_link_hash($token, 'global'))
    178179        {
    179                 markread('topics', $forum_id);
     180                // Add 0 to forums array to mark global announcements correctly
     181                markread('topics', array($forum_id, 0));
    180182        }
    181183        $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
     
    613615
    614616                // Generate all the URIs ...
    615                 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&amp;t=' . $topic_id);
    616 
    617                 $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
    618                 $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
     617                $view_topic_url_params = 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&amp;t=' . $topic_id;
     618                $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
     619
     620                $topic_unapproved = (!$row['topic_approved'] && $auth->acl_get('m_approve', (($row['forum_id']) ? $row['forum_id'] : $forum_id))) ? true : false;
     621                $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', (($row['forum_id']) ? $row['forum_id'] : $forum_id))) ? true : false;
    619622                $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$topic_id", true, $user->session_id) : '';
    620623
     
    665668                        'S_TOPIC_MOVED'                 => ($row['topic_status'] == ITEM_MOVED) ? true : false,
    666669
    667                         'U_NEWEST_POST'                 => $view_topic_url . '&amp;view=unread#unread',
    668                         'U_LAST_POST'                   => $view_topic_url . '&amp;p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'],
     670                        'U_NEWEST_POST'                 => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;view=unread') . '#unread',
     671                        'U_LAST_POST'                   => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&amp;p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'],
    669672                        'U_LAST_POST_AUTHOR'    => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']),
    670673                        'U_TOPIC_AUTHOR'                => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']),
  • trunk/forum/viewonline.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: viewonline.php 8705 2008-07-28 16:55:00Z Kellanved $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    140140                $view_online = $s_user_hidden = false;
    141141                $user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] . '" class="username-coloured"' : '';
    142                
     142
    143143                $username_full = ($row['user_type'] != USER_IGNORE) ? get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']) : '<span' . $user_colour . '>' . $row['username'] . '</span>';
    144144
     
    188188        }
    189189
    190         preg_match('#^([a-z/]+)#i', $row['session_page'], $on_page);
     190        preg_match('#^([a-z0-9/_-]+)#i', $row['session_page'], $on_page);
    191191        if (!sizeof($on_page))
    192192        {
     
    335335                'U_WHOIS'                       => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=whois&amp;s=' . $row['session_id']),
    336336                'U_FORUM_LOCATION'      => $location_url,
    337                
     337
    338338                'S_USER_HIDDEN'         => $s_user_hidden,
    339339                'S_GUEST'                       => ($row['user_id'] == ANONYMOUS) ? true : false,
  • trunk/forum/viewtopic.php

    r400 r702  
    33*
    44* @package phpBB3
    5 * @version $Id: viewtopic.php 9138 2008-11-30 16:53:36Z acydburn $
     5* @version $Id$
    66* @copyright (c) 2005 phpBB Group
    77* @license http://opensource.org/licenses/gpl-license.php GNU Public License
     
    2929$voted_id       = request_var('vote_id', array('' => 0));
    3030
     31$voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id;
     32
     33
    3134$start          = request_var('start', 0);
    3235$view           = request_var('view', '');
     
    4245$update         = request_var('update', false);
    4346
     47$s_can_vote = false;
    4448/**
    4549* @todo normalize?
     
    8387                                " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . "
    8488                                AND post_time > $topic_last_read
     89                                AND forum_id = $forum_id
    8590                        ORDER BY post_time ASC";
    8691                $result = $db->sql_query_limit($sql, 1);
     
    182187);
    183188
     189// Firebird handles two columns of the same name a little differently, this
     190// addresses that by forcing the forum_id to come from the forums table.
     191if ($db->sql_layer === 'firebird')
     192{
     193        $sql_array['SELECT'] = 'f.forum_id AS forum_id, ' . $sql_array['SELECT'];
     194}
     195
    184196// The FROM-Order is quite important here, else t.* columns can not be correctly bound.
    185197if ($post_id)
    186198{
     199        $sql_array['SELECT'] .= ', p.post_approved';
    187200        $sql_array['FROM'][POSTS_TABLE] = 'p';
    188201}
     
    232245else
    233246{
    234         $sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id" . ((!$auth->acl_get('m_approve', $forum_id)) ? ' AND p.post_approved = 1' : '');
     247        $sql_array['WHERE'] = "p.post_id = $post_id AND t.topic_id = p.topic_id";
    235248}
    236249
     
    260273$db->sql_freeresult($result);
    261274
     275// link to unapproved post or incorrect link
    262276if (!$topic_data)
    263277{
    264278        // If post_id was submitted, we try at least to display the topic as a last resort...
    265         if ($post_id && $forum_id && $topic_id)
    266         {
    267                 redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id"));
     279        if ($post_id && $topic_id)
     280        {
     281                redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id" . (($forum_id) ? "&amp;f=$forum_id" : '')));
    268282        }
    269283
     
    271285}
    272286
     287$forum_id = (int) $topic_data['forum_id'];
    273288// This is for determining where we are (page)
    274289if ($post_id)
    275290{
     291        // are we where we are supposed to be?
     292        if (!$topic_data['post_approved'] && !$auth->acl_get('m_approve', $topic_data['forum_id']))
     293        {
     294                // If post_id was submitted, we try at least to display the topic as a last resort...
     295                if ($topic_id)
     296                {
     297                        redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id" . (($forum_id) ? "&amp;f=$forum_id" : '')));
     298                }
     299
     300                trigger_error('NO_TOPIC');
     301        }
    276302        if ($post_id == $topic_data['topic_first_post_id'] || $post_id == $topic_data['topic_last_post_id'])
    277303        {
     
    304330}
    305331
    306 $forum_id = (int) $topic_data['forum_id'];
    307332$topic_id = (int) $topic_data['topic_id'];
    308 
    309333//
    310334$topic_replies = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] : $topic_data['topic_replies'];
     
    395419
    396420$sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']);
    397 $sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.post_time', 's' => 'p.post_subject');
     421$sort_by_sql = array('a' => array('u.username_clean', 'p.post_id'), 't' => 'p.post_time', 's' => array('p.post_subject', 'p.post_id'));
     422$join_user_sql = array('a' => true, 't' => false, 's' => false);
    398423
    399424$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
     
    550575// Moderators
    551576$forum_moderators = array();
    552 get_moderators($forum_moderators, $forum_id);
     577if ($config['load_moderators'])
     578{
     579        get_moderators($forum_moderators, $forum_id);
     580}
    553581
    554582// This is only used for print view so ...
     
    598626        'WARN_IMG'                      => $user->img('icon_user_warn', 'WARN_USER'),
    599627
    600         'S_IS_LOCKED'                   =>($topic_data['topic_status'] == ITEM_UNLOCKED) ? false : true,
     628        'S_IS_LOCKED'                   => ($topic_data['topic_status'] == ITEM_UNLOCKED && $topic_data['forum_status'] == ITEM_UNLOCKED) ? false : true,
    601629        'S_SELECT_SORT_DIR'     => $s_sort_dir,
    602630        'S_SELECT_SORT_KEY'     => $s_sort_key,
     
    605633        'S_TOPIC_ACTION'                => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start"),
    606634        'S_TOPIC_MOD'                   => ($topic_mod != '') ? '<select name="action" id="quick-mod-select">' . $topic_mod . '</select>' : '',
    607         'S_MOD_ACTION'                  => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;quickmod=1&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url)), true, $user->session_id),
     635        'S_MOD_ACTION'                  => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start&amp;quickmod=1&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url)), true, $user->session_id),
    608636
    609637        'S_VIEWTOPIC'                   => true,
     
    613641        'S_DISPLAY_POST_INFO'   => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
    614642        'S_DISPLAY_REPLY_INFO'  => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_reply', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false,
     643        'S_ENABLE_FEEDS_TOPIC'  => ($config['feed_topic'] && !phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $topic_data['forum_options'])) ? true : false,
    615644
    616645        'U_TOPIC'                               => "{$server_path}viewtopic.$phpEx?f=$forum_id&amp;t=$topic_id",
     
    680709        }
    681710
    682         $s_can_vote = (((!sizeof($cur_voted_id) && $auth->acl_get('f_vote', $forum_id)) ||
    683                 ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change'])) &&
     711        // Can not vote at all if no vote permission
     712        $s_can_vote = ($auth->acl_get('f_vote', $forum_id) &&
    684713                (($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) &&
    685714                $topic_data['topic_status'] != ITEM_LOCKED &&
    686                 $topic_data['forum_status'] != ITEM_LOCKED) ? true : false;
     715                $topic_data['forum_status'] != ITEM_LOCKED &&
     716                (!sizeof($cur_voted_id) ||
     717                ($auth->acl_get('f_votechg', $forum_id) && $topic_data['poll_vote_change']))) ? true : false;
    687718        $s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false;
    688719
     
    690721        {
    691722
    692                 if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id))
     723                if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id) || !check_form_key('posting'))
    693724                {
    694725                        $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start");
     
    703734                                $message = 'TOO_MANY_VOTE_OPTIONS';
    704735                        }
     736                        else if (in_array(VOTE_CONVERTED, $cur_voted_id))
     737                        {
     738                                $message = 'VOTE_CONVERTED';
     739                        }
    705740                        else
    706741                        {
    707                                 $message = 'VOTE_CONVERTED';
     742                                $message = 'FORM_INVALID';
    708743                        }
    709744
     
    859894$store_reverse = false;
    860895$sql_limit = $config['posts_per_page'];
     896$sql_sort_order = $direction = '';
    861897
    862898if ($start > $total_posts / 2)
     
    870906
    871907        // Select the sort order
    872         $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');
     908        $direction = (($sort_dir == 'd') ? 'ASC' : 'DESC');
    873909        $sql_start = max(0, $total_posts - $sql_limit - $start);
    874910}
     
    876912{
    877913        // Select the sort order
    878         $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
     914        $direction = (($sort_dir == 'd') ? 'DESC' : 'ASC');
    879915        $sql_start = $start;
     916}
     917
     918if (is_array($sort_by_sql[$sort_key]))
     919{
     920        $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction;
     921}
     922else
     923{
     924        $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction;
    880925}
    881926
     
    888933// Go ahead and pull all data for this topic
    889934$sql = 'SELECT p.post_id
    890         FROM ' . POSTS_TABLE . ' p' . (($sort_by_sql[$sort_key][0] == 'u') ? ', ' . USERS_TABLE . ' u': '') . "
     935        FROM ' . POSTS_TABLE . ' p' . (($join_user_sql[$sort_key]) ? ', ' . USERS_TABLE . ' u': '') . "
    891936        WHERE p.topic_id = $topic_id
    892937                " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . "
    893                 " . (($sort_by_sql[$sort_key][0] == 'u') ? 'AND u.user_id = p.poster_id': '') . "
     938                " . (($join_user_sql[$sort_key]) ? 'AND u.user_id = p.poster_id': '') . "
    894939                $limit_posts_time
    895940        ORDER BY $sql_sort_order";
     
    899944while ($row = $db->sql_fetchrow($result))
    900945{
    901         $post_list[$i] = $row['post_id'];
     946        $post_list[$i] = (int) $row['post_id'];
    902947        ($store_reverse) ? $i-- : $i++;
    903948}
     
    953998        }
    954999
    955         $poster_id = $row['poster_id'];
     1000        $poster_id = (int) $row['poster_id'];
    9561001
    9571002        // Does post have an attachment? If so, add it to the list
    9581003        if ($row['post_attachment'] && $config['allow_attachments'])
    9591004        {
    960                 $attach_list[] = $row['post_id'];
     1005                $attach_list[] = (int) $row['post_id'];
    9611006
    9621007                if ($row['post_approved'])
     
    10931138                                'jabber'                => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
    10941139                                'search'                => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&amp;sr=posts") : '',
     1140
     1141                                'author_full'           => get_username_string('full', $poster_id, $row['username'], $row['user_colour']),
     1142                                'author_colour'         => get_username_string('colour', $poster_id, $row['username'], $row['user_colour']),
     1143                                'author_username'       => get_username_string('username', $poster_id, $row['username'], $row['user_colour']),
     1144                                'author_profile'        => get_username_string('profile', $poster_id, $row['username'], $row['user_colour']),
    10951145                        );
    10961146
     
    11441194if ($config['load_cpf_viewtopic'])
    11451195{
    1146         include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
     1196        if (!class_exists('custom_profile'))
     1197        {
     1198                include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
     1199        }
    11471200        $cp = new custom_profile();
    11481201
    11491202        // Grab all profile fields from users in id cache for later use - similar to the poster cache
    1150         $profile_fields_cache = $cp->generate_profile_fields_template('grab', $id_cache);
     1203        $profile_fields_tmp = $cp->generate_profile_fields_template('grab', $id_cache);
     1204
     1205        // filter out fields not to be displayed on viewtopic. Yes, it's a hack, but this shouldn't break any MODs.
     1206        $profile_fields_cache = array();
     1207        foreach ($profile_fields_tmp as $profile_user_id => $profile_fields)
     1208        {
     1209                $profile_fields_cache[$profile_user_id] = array();
     1210                foreach ($profile_fields as $used_ident => $profile_field)
     1211                {
     1212                        if ($profile_field['data']['field_show_on_vt'])
     1213                        {
     1214                                $profile_fields_cache[$profile_user_id][$used_ident] = $profile_field;
     1215                        }
     1216                }
     1217        }
     1218        unset($profile_fields_tmp);
    11511219}
    11521220
     
    13821450                // post and only the topic poster and last poster are allowed to bump.
    13831451                // Admins and mods are bound to the above rules too...
    1384                 $l_bumped_by = '<br /><br />' . sprintf($user->lang['BUMPED_BY'], $user_cache[$topic_data['topic_bumper']]['username'], $user->format_date($topic_data['topic_last_post_time']));
     1452                $l_bumped_by = sprintf($user->lang['BUMPED_BY'], $user_cache[$topic_data['topic_bumper']]['username'], $user->format_date($topic_data['topic_last_post_time'], false, true));
    13851453        }
    13861454        else
     
    14051473        }
    14061474
     1475        $edit_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_edit', $forum_id) || (
     1476                $user->data['user_id'] == $poster_id &&
     1477                $auth->acl_get('f_edit', $forum_id) &&
     1478                !$row['post_edit_locked'] &&
     1479                ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])
     1480        )));
     1481
     1482        $delete_allowed = ($user->data['is_registered'] && ($auth->acl_get('m_delete', $forum_id) || (
     1483                $user->data['user_id'] == $poster_id &&
     1484                $auth->acl_get('f_delete', $forum_id) &&
     1485                $topic_data['topic_last_post_id'] == $row['post_id'] &&
     1486                ($row['post_time'] > time() - ($config['delete_time'] * 60) || !$config['delete_time']) &&
     1487                // we do not want to allow removal of the last post if a moderator locked it!
     1488                !$row['post_edit_locked']
     1489        )));
     1490
    14071491        //
    14081492        $postrow = array(
    1409                 'POST_AUTHOR_FULL'              => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
    1410                 'POST_AUTHOR_COLOUR'    => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
    1411                 'POST_AUTHOR'                   => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
    1412                 'U_POST_AUTHOR'                 => get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
     1493                'POST_AUTHOR_FULL'              => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_full'] : get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
     1494                'POST_AUTHOR_COLOUR'    => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_colour'] : get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
     1495                'POST_AUTHOR'                   => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_username'] : get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
     1496                'U_POST_AUTHOR'                 => ($poster_id != ANONYMOUS) ? $user_cache[$poster_id]['author_profile'] : get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
    14131497
    14141498                'RANK_TITLE'            => $user_cache[$poster_id]['rank_title'],
     
    14221506                'POSTER_AGE'            => $user_cache[$poster_id]['age'],
    14231507
    1424                 'POST_DATE'                     => $user->format_date($row['post_time']),
     1508                'POST_DATE'                     => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false),
    14251509                'POST_SUBJECT'          => $row['post_subject'],
    14261510                'MESSAGE'                       => $message,
     
    14381522                'S_ONLINE'                              => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false),
    14391523
    1440                 'U_EDIT'                        => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
     1524                'U_EDIT'                        => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
    14411525                'U_QUOTE'                       => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
    14421526                'U_INFO'                        => ($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) : '',
    1443                 'U_DELETE'                      => (!$user->data['is_registered']) ? '' : ((($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && !$row['post_edit_locked'] && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : ''),
     1527                'U_DELETE'                      => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&amp;f=$forum_id&amp;p={$row['post_id']}") : '',
    14441528
    14451529                'U_PROFILE'             => $user_cache[$poster_id]['profile'],
     
    15151599
    15161600// Update topic view and if necessary attachment view counters ... but only for humans and if this is the first 'page view'
    1517 if (isset($user->data['session_page']) && !$user->data['is_bot'] && strpos($user->data['session_page'], '&t=' . $topic_id) === false)
     1601if (isset($user->data['session_page']) && !$user->data['is_bot'] && (strpos($user->data['session_page'], '&t=' . $topic_id) === false || isset($user->data['session_created'])))
    15181602{
    15191603        $sql = 'UPDATE ' . TOPICS_TABLE . '
     
    15321616}
    15331617
     1618// Get last post time for all global announcements
     1619// to keep proper forums tracking
     1620if ($topic_data['topic_type'] == POST_GLOBAL)
     1621{
     1622        $sql = 'SELECT topic_last_post_time as forum_last_post_time
     1623                FROM ' . TOPICS_TABLE . '
     1624                WHERE forum_id = 0
     1625                ORDER BY topic_last_post_time DESC';
     1626        $result = $db->sql_query_limit($sql, 1);
     1627        $topic_data['forum_last_post_time'] = (int) $db->sql_fetchfield('forum_last_post_time');
     1628        $db->sql_freeresult($result);
     1629
     1630        $sql = 'SELECT mark_time as forum_mark_time
     1631                FROM ' . FORUMS_TRACK_TABLE . '
     1632                WHERE forum_id = 0
     1633                        AND user_id = ' . $user->data['user_id'];
     1634        $result = $db->sql_query($sql);
     1635        $topic_data['forum_mark_time'] = (int) $db->sql_fetchfield('forum_mark_time');
     1636        $db->sql_freeresult($result);
     1637}
     1638
    15341639// Only mark topic if it's currently unread. Also make sure we do not set topic tracking back if earlier pages are viewed.
    15351640if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id] && $max_post_time > $topic_tracking_info[$topic_id])
    15361641{
    1537         markread('topic', $forum_id, $topic_id, $max_post_time);
     1642        markread('topic', (($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_id, $max_post_time);
    15381643
    15391644        // Update forum info
    1540         $all_marked_read = update_forum_tracking_info($forum_id, $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
     1645        $all_marked_read = update_forum_tracking_info((($topic_data['topic_type'] == POST_GLOBAL) ? 0 : $forum_id), $topic_data['forum_last_post_time'], (isset($topic_data['forum_mark_time'])) ? $topic_data['forum_mark_time'] : false, false);
    15411646}
    15421647else
     
    15791684        }
    15801685}
     1686
     1687// let's set up quick_reply
     1688$s_quick_reply = false;
     1689if ($user->data['is_registered'] && $config['allow_quick_reply'] && ($topic_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) && $auth->acl_get('f_reply', $forum_id))
     1690{
     1691        // Quick reply enabled forum
     1692        $s_quick_reply = (($topic_data['forum_status'] == ITEM_UNLOCKED && $topic_data['topic_status'] == ITEM_UNLOCKED) || $auth->acl_get('m_edit', $forum_id)) ? true : false;
     1693}
     1694
     1695if ($s_can_vote || $s_quick_reply)
     1696{
     1697        add_form_key('posting');
     1698
     1699        if ($s_quick_reply)
     1700        {
     1701                $s_attach_sig   = $config['allow_sig'] && $user->optionget('attachsig') && $auth->acl_get('f_sigs', $forum_id) && $auth->acl_get('u_sig');
     1702                $s_smilies              = $config['allow_smilies'] && $user->optionget('smilies') && $auth->acl_get('f_smilies', $forum_id);
     1703                $s_bbcode               = $config['allow_bbcode'] && $user->optionget('bbcode') && $auth->acl_get('f_bbcode', $forum_id);
     1704                $s_notify               = $config['allow_topic_notify'] && ($user->data['user_notify'] || $s_watching_topic['is_watching']);
     1705
     1706                $qr_hidden_fields = array(
     1707                        'topic_cur_post_id'             => (int) $topic_data['topic_last_post_id'],
     1708                        'lastclick'                             => (int) time(),
     1709                        'topic_id'                              => (int) $topic_data['topic_id'],
     1710                        'forum_id'                              => (int) $forum_id,
     1711                );
     1712
     1713                // Originally we use checkboxes and check with isset(), so we only provide them if they would be checked
     1714                (!$s_bbcode)                                    ? $qr_hidden_fields['disable_bbcode'] = 1               : true;
     1715                (!$s_smilies)                                   ? $qr_hidden_fields['disable_smilies'] = 1              : true;
     1716                (!$config['allow_post_links'])  ? $qr_hidden_fields['disable_magic_url'] = 1    : true;
     1717                ($s_attach_sig)                                 ? $qr_hidden_fields['attach_sig'] = 1                   : true;
     1718                ($s_notify)                                             ? $qr_hidden_fields['notify'] = 1                               : true;
     1719                ($topic_data['topic_status'] == ITEM_LOCKED) ? $qr_hidden_fields['lock_topic'] = 1 : true;
     1720
     1721                $template->assign_vars(array(
     1722                        'S_QUICK_REPLY'                 => true,
     1723                        'U_QR_ACTION'                   => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;t=$topic_id"),
     1724                        'QR_HIDDEN_FIELDS'              => build_hidden_fields($qr_hidden_fields),
     1725                        'SUBJECT'                               => 'Re: ' . censor_text($topic_data['topic_title']),
     1726                ));
     1727        }
     1728}
     1729// now I have the urge to wash my hands :(
     1730
    15811731
    15821732// We overwrite $_REQUEST['f'] if there is no forum specified
     
    15881738}
    15891739
     1740// We need to do the same with the topic_id. See #53025.
     1741if (empty($_REQUEST['t']) && !empty($topic_id))
     1742{
     1743        $_REQUEST['t'] = $topic_id;
     1744}
     1745
    15901746// Output the page
    1591 page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title']);
     1747page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'], true, $forum_id);
    15921748
    15931749$template->set_filenames(array(
  • trunk/stat

    • Property svn:ignore set to
      stat.xml
Note: See TracChangeset for help on using the changeset viewer.