Changeset 702
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- 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 1 11 <Files "config.php"> 2 12 Order Allow,Deny -
trunk/forum/adm/index.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : index.php 8591 2008-06-04 11:40:53Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 132 132 'ICON_MOVE_UP_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_up_disabled.gif" alt="' . $user->lang['MOVE_UP'] . '" title="' . $user->lang['MOVE_UP'] . '" />', 133 133 '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'] . '" />', 135 135 'ICON_EDIT' => '<img src="' . $phpbb_admin_path . 'images/icon_edit.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', 136 136 'ICON_EDIT_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_edit_disabled.gif" alt="' . $user->lang['EDIT'] . '" title="' . $user->lang['EDIT'] . '" />', … … 264 264 $name = 'config[' . $config_key . ']'; 265 265 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 266 272 switch ($tpl_type[0]) 267 273 { … … 303 309 case 'select': 304 310 case 'custom': 305 311 306 312 $return = ''; 307 313 … … 342 348 $args = array($new[$config_key], $key); 343 349 } 344 350 345 351 $return = call_user_func_array($call, $args); 346 352 … … 378 384 $min = 1; 379 385 $max = 2; 380 386 381 387 foreach ($config_vars as $config_name => $config_definition) 382 388 { … … 385 391 continue; 386 392 } 387 393 388 394 if (!isset($config_definition['validate'])) 389 395 { 390 396 continue; 391 397 } 392 398 393 399 $validator = explode(':', $config_definition['validate']); 394 400 … … 549 555 { 550 556 global $user; 551 557 552 558 $column_types = array( 553 559 'BOOL' => array('php_type' => 'int', 'min' => 0, 'max' => 1), … … 556 562 'INT' => array('php_type' => 'int', 'min' => (int) 0x80000000, 'max' => (int) 0x7fffffff), 557 563 'TINT' => array('php_type' => 'int', 'min' => -128, 'max' => 127), 558 564 559 565 'VCHAR' => array('php_type' => 'string', 'min' => 0, 'max' => 255), 560 566 ); … … 583 589 break; 584 590 585 case 'int': 591 case 'int': 586 592 $min = (isset($column[1])) ? max($column[1],$type['min']) : $type['min']; 587 593 $max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max']; -
trunk/forum/adm/style/acp_ban.html
r400 r702 94 94 <dl> 95 95 <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> 97 97 </dl> 98 98 <dl> 99 99 <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"> </textarea></dd>100 <dd><textarea style="border: 0;" class="text full" readonly="readonly" name="unbanreason" id="unbanreason" rows="5" cols="80"> </textarea></dd> 101 101 </dl> 102 102 <dl> 103 103 <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"> </textarea></dd>104 <dd><textarea style="border: 0;" class="text full" readonly="readonly" name="unbangivereason" id="unbangivereason" rows="5" cols="80"> </textarea></dd> 105 105 </dl> 106 106 -
trunk/forum/adm/style/acp_captcha.html
r400 r702 19 19 </dl> 20 20 <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> 21 29 <dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}:</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt> 22 30 <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> 23 31 <label><input type="radio" class="radio" name="enable_post_confirm" value="0"<!-- IF not POST_ENABLE --> checked="checked"<!-- ENDIF --> /> {L_DISABLED}</label></dd> 24 32 </dl> 25 <!-- IF GD -->26 33 <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> 58 37 </dl> 59 38 </fieldset> 60 39 61 <fieldset class="submit-buttons"> 62 <legend>{L_SUBMIT}</legend> 63 <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" /> 64 <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> 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}" /> 65 <input class="button2" type="reset" id="form_reset" name="reset" value="{L_RESET}" /> 66 </p> 66 67 {S_FORM_TOKEN} 67 68 </fieldset> -
trunk/forum/adm/style/acp_database.html
r400 r702 71 71 <dl> 72 72 <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> 76 77 </dl> 77 78 <dl> -
trunk/forum/adm/style/acp_email.html
r400 r702 45 45 46 46 <p class="submit-buttons"> 47 <input class="button1" type="submit" id="submit" name="submit" value="{L_ EMAIL}" /> 47 <input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_EMAIL}" /> 48 48 <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" /> 49 49 </p> -
trunk/forum/adm/style/acp_forums.html
r400 r702 219 219 </dl> 220 220 <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> 221 226 <dt><label for="enable_indexing">{L_ENABLE_INDEXING}:</label><br /><span>{L_ENABLE_INDEXING_EXPLAIN}</span></dt> 222 227 <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> … … 445 450 <strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong> 446 451 <!-- 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 --> 448 453 </td> 449 454 <td style="vertical-align: top; width: 100px; text-align: right; white-space: nowrap;"> -
trunk/forum/adm/style/acp_groups.html
r400 r702 56 56 57 57 <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> 58 80 <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>73 81 <dl> 74 82 <dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}:</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt> … … 81 89 <dl> 82 90 <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" /> <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 --> <span style="background-color: #{GROUP_COLOUR}"> </span><!-- ENDIF --> <span>[ <a href="{U_SWATCH}" onclick="popup(this.href, 636, 150, '_swatch'); return false">{L_COLOUR_SWATCH}</a> ]</span></dd> 84 92 </dl> 85 93 <dl> … … 98 106 <!-- IF not S_IN_AVATAR_GALLERY --> 99 107 <!-- IF S_CAN_UPLOAD --> 100 <dl> 108 <dl> 101 109 <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt> 102 110 <dd><input type="file" id="uploadfile" name="uploadfile" /></dd> … … 113 121 <dl> 114 122 <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} × </span> <input type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd> 116 124 </dl> 117 125 <!-- IF S_DISPLAY_GALLERY --> 118 <dl> 126 <dl> 119 127 <dt><label>{L_AVATAR_GALLERY}:</label></dt> 120 128 <dd><input class="button2" type="submit" name="display_gallery" value="{L_DISPLAY_GALLERY}" /></dd> … … 133 141 <table cellspacing="1"> 134 142 <!-- BEGIN avatar_row --> 135 <tr> 143 <tr> 136 144 <!-- BEGIN avatar_column --> 137 145 <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> … … 147 155 </dl> 148 156 </fieldset> 149 157 150 158 <fieldset class="quick" style="margin-top: -15px;"> 151 159 <input class="button2" type="submit" name="cancel" value="{L_CANCEL}" /> 152 160 </fieldset> 153 161 154 162 <!-- ENDIF --> 155 163 </fieldset> … … 193 201 <!-- BEGIN leader --> 194 202 <!-- 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> 196 204 <td style="text-align: center;"><!-- IF leader.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td> 197 205 <td style="text-align: center;">{leader.JOINED}</td> … … 214 222 <!-- ELSE --> 215 223 <!-- 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> 217 225 <td style="text-align: center;"><!-- IF member.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td> 218 226 <td style="text-align: center;">{member.JOINED}</td> … … 232 240 <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> 233 241 </div> 234 <!-- ENDIF --> 242 <!-- ENDIF --> 235 243 236 244 <fieldset class="quick"> 237 245 <select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select> 238 246 <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> • <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> • <a href="#" onclick="marklist('list', 'mark', false); return false;">{L_UNMARK_ALL}</a></p> 240 248 </fieldset> 241 249 -
trunk/forum/adm/style/acp_icons.html
r400 r702 140 140 <td><input class="text post" type="text" size="3" name="add_height" id="add_height" value="{HEIGHT}" /></td> 141 141 <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> 145 145 </select></td> 146 146 <td><input type="checkbox" class="radio" name="add_additional_code" value="1" /></td> … … 244 244 <!-- ENDIF --> 245 245 <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 --> 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 --> 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 --> 248 248 <a href="{items.U_EDIT}">{ICON_EDIT}</a> <a href="{items.U_DELETE}">{ICON_DELETE}</a> 249 249 </td> … … 256 256 </tbody> 257 257 </table> 258 258 <div>{PAGINATION}</div> 259 259 <p class="quick"> 260 260 <input class="button2" name="add" type="submit" value="{L_ICON_ADD}" /> <input class="button2" type="submit" name="edit" value="{L_ICON_EDIT}" /> -
trunk/forum/adm/style/acp_inactive.html
r400 r702 13 13 <!-- IF PAGINATION --> 14 14 <div class="pagination"> 15 15 <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> 16 16 </div> 17 17 <!-- ENDIF --> … … 23 23 <th>{L_JOINED}</th> 24 24 <th>{L_INACTIVE_DATE}</th> 25 <th>{L_LAST_VISIT}</th> 25 26 <th>{L_INACTIVE_REASON}</th> 26 <th>{L_LAST_VISIT}</th>27 27 <th>{L_MARK}</th> 28 28 </tr> … … 32 32 <!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> 33 33 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> 39 45 <td> <input type="checkbox" class="radio" name="mark[]" value="{inactive.USER_ID}" /> </td> 40 46 </tr> … … 47 53 </table> 48 54 49 <fieldset class="display-options"> 50 {L_DISPLAY_LOG}: {S_LIMIT_DAYS} {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}: {S_LIMIT_DAYS} {L_SORT_BY}: {S_SORT_KEY} {S_SORT_DIR}<!-- IF PAGINATION --> 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 --> 55 63 <div class="pagination"> 56 64 <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> 57 65 </div> 58 66 <!-- ENDIF --> 59 67 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> • <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> • <a href="#" onclick="marklist('inactive', 'mark', false); return false;">{L_UNMARK_ALL}</a></p> 72 {S_FORM_TOKEN} 73 </fieldset> 68 74 69 75 </form> -
trunk/forum/adm/style/acp_jabber.html
r400 r702 39 39 </dl> 40 40 <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> 42 42 <dd><input type="password" id="jab_password" name="jab_password" value="{JAB_PASSWORD}" /></dd> 43 43 </dl> -
trunk/forum/adm/style/acp_logs.html
r400 r702 9 9 <form id="list" method="post" action="{U_ACTION}"> 10 10 11 <fieldset class="display-options" style="float: left"> 12 {L_SEARCH_KEYWORDS}: <input type="text" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> 13 </fieldset> 14 11 15 <!-- IF PAGINATION --> 12 <div class="pagination" >13 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> • <span>{PAGINATION}</span> 14 18 </div> 15 19 <!-- ENDIF --> 20 21 <div class="clearfix"> </div> 22 <div><br style="clear: both;" /></div> 16 23 17 24 <!-- IF .log --> … … 23 30 <th>{L_TIME}</th> 24 31 <th>{L_ACTION}</th> 25 <th>{L_MARK}</th> 32 <!-- IF S_CLEARLOGS --> 33 <th>{L_MARK}</th> 34 <!-- ENDIF --> 26 35 </tr> 27 36 </thead> … … 29 38 <!-- BEGIN log --> 30 39 <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> 31 32 40 <td> 33 41 {log.USERNAME} … … 39 47 <td style="text-align: center;">{log.DATE}</td> 40 48 <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 --> 42 52 </tr> 43 53 <!-- END log --> … … 45 55 </table> 46 56 57 <!-- IF PAGINATION --> 58 <div class="pagination"> 59 <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> 60 </div> 61 <!-- ENDIF --> 62 47 63 <!-- ELSE --> 48 49 64 <div class="errorbox"> 50 65 <p>{L_NO_ENTRIES}</p> 51 66 </div> 52 53 67 <!-- ENDIF --> 54 55 68 56 69 <fieldset class="display-options"> … … 60 73 </fieldset> 61 74 <hr /> 62 <!-- IF PAGINATION --> 63 <div class="pagination"> 64 <a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE}">{S_ON_PAGE}</a> • <span>{PAGINATION}</span> 65 </div> 66 <!-- ENDIF --> 75 67 76 <!-- IF S_SHOW_FORUMS --> 68 77 <fieldset class="quick"> … … 72 81 <!-- ENDIF --> 73 82 74 <!-- IF S_CLEARLOGS -->83 <!-- IF .log and S_CLEARLOGS --> 75 84 <fieldset class="quick"> 76 85 <input class="button2" type="submit" name="delall" value="{L_DELETE_ALL}" /> … … 80 89 <!-- ENDIF --> 81 90 82 83 91 </form> 84 92 -
trunk/forum/adm/style/acp_main.html
r400 r702 14 14 15 15 <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> · <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> · <a href="{U_VERSIONCHECK}">{L_MORE_INFORMATION}</a></p> 26 </div> 27 <!-- ENDIF --> 28 16 29 17 30 <!-- IF S_REMOVE_INSTALL --> … … 28 41 <!-- ENDIF --> 29 42 43 <!-- IF S_PHP_VERSION_OLD --> 44 <div class="errorbox notice"> 45 <p>{L_PHP_VERSION_OLD}</p> 46 </div> 47 <!-- ENDIF --> 48 30 49 <table cellspacing="1"> 31 50 <caption>{L_FORUM_STATS}</caption> … … 86 105 <tr> 87 106 <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> [ <a href="{U_VERSIONCHECK_FORCE}">{L_VERSIONCHECK_FORCE_UPDATE}</a> ] 109 </td> 89 110 <!-- IF S_TOTAL_ORPHAN --> 90 111 <td>{L_NUMBER_ORPHAN}: </td> … … 138 159 139 160 <!-- 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> 140 167 <form id="action_purge_cache_form" method="post" action="{U_ACTION}"> 141 168 <dl> … … 194 221 <th>{L_JOINED}</th> 195 222 <th>{L_INACTIVE_DATE}</th> 223 <th>{L_LAST_VISIT}</th> 196 224 <th>{L_INACTIVE_REASON}</th> 197 <th>{L_LAST_VISIT}</th>198 225 </tr> 199 226 </thead> … … 202 229 <!-- IF inactive.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> 203 230 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> 209 242 </tr> 210 243 <!-- BEGINELSE --> -
trunk/forum/adm/style/acp_permissions.html
r400 r702 4 4 5 5 <!-- IF S_INTRO --> 6 6 7 7 <h1>{L_ACP_PERMISSIONS}</h1> 8 8 … … 13 13 <!-- IF S_SELECT_VICTIM --> 14 14 15 <!-- IF U_BACK --><a href="{U_BACK}" style="float: {S_CONTENT_FLOW_END};">« {L_BACK}</a><!-- ENDIF --> 16 15 17 <h1>{L_TITLE}</h1> 16 18 17 19 <p>{L_EXPLAIN}</p> 18 20 19 21 <!-- IF S_FORUM_NAMES --> 20 22 <p><strong>{L_FORUMS}:</strong> {FORUM_NAMES}</p> … … 63 65 </fieldset> 64 66 </form> 65 67 66 68 <!-- ENDIF --> 67 69 … … 124 126 </dl> 125 127 </fieldset> 126 128 127 129 <fieldset class="quick"> 128 130 {S_HIDDEN_FIELDS} … … 155 157 156 158 <div style="float: {S_CONTENT_FLOW_END}; width: 48%"> 157 159 158 160 <!-- IF S_CAN_SELECT_GROUP --> 159 161 … … 169 171 </dl> 170 172 </fieldset> 171 173 172 174 <fieldset class="quick"> 173 175 {S_HIDDEN_FIELDS} … … 178 180 179 181 <form id="add_groups" method="post" action="{U_ACTION}"> 180 182 181 183 <fieldset> 182 184 <legend>{L_ADD_GROUPS}</legend> … … 200 202 201 203 <div style="float: {S_CONTENT_FLOW_BEGIN}; width: 48%;"> 202 204 203 205 <h1>{L_USERS}</h1> 204 206 … … 211 213 </dl> 212 214 </fieldset> 213 215 214 216 <fieldset class="quick"> 215 217 {S_HIDDEN_FIELDS} … … 241 243 242 244 <div style="float: {S_CONTENT_FLOW_END}; width: 48%"> 243 245 244 246 <h1>{L_USERGROUPS}</h1> 245 247 … … 252 254 </dl> 253 255 </fieldset> 254 256 255 257 <fieldset class="quick"> 256 258 {S_HIDDEN_FIELDS} … … 312 314 <!-- IF S_PERMISSION_DROPDOWN --> 313 315 <form id="pselect" method="post" action="{U_ACTION}"> 314 316 315 317 <fieldset class="quick" style="float: {S_CONTENT_FLOW_BEGIN};"> 316 318 {S_HIDDEN_FIELDS} 317 319 {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> 319 321 320 322 <input class="button2" type="submit" name="submit" value="{L_GO}" /> … … 348 350 349 351 <br /><br /> 350 352 351 353 </form> 352 354 -
trunk/forum/adm/style/acp_profile.html
r400 r702 55 55 <dt><label for="field_show_on_reg">{L_DISPLAY_AT_REGISTER}:</label><br /><span>{L_DISPLAY_AT_REGISTER_EXPLAIN}</span></dt> 56 56 <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> 57 61 </dl> 58 62 <dl> … … 128 132 <input class="button1" type="submit" name="prev" value="{L_PROFILE_BASIC_OPTIONS}" /> 129 133 </fieldset> 130 134 131 135 <fieldset class="quick" style="float: {S_CONTENT_FLOW_END};"> 132 136 {S_HIDDEN_FIELDS} … … 152 156 <input class="button1" type="submit" name="prev" value="{L_PROFILE_TYPE_OPTIONS}" /> 153 157 </fieldset> 154 158 155 159 <fieldset class="quick" style="float: {S_CONTENT_FLOW_END};"> 156 160 {S_HIDDEN_FIELDS} … … 158 162 {S_FORM_TOKEN} 159 163 </fieldset> 160 164 161 165 <!-- ENDIF --> 162 166 163 167 </form> 164 168 … … 195 199 <a href="{fields.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> 196 200 <!-- 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> 199 203 <!-- ELSEIF fields.S_LAST_ROW && not fields.S_FIRST_ROW --> 200 204 <a href="{fields.U_MOVE_UP}">{ICON_MOVE_UP}</a> 201 {ICON_MOVE_DOWN_DISABLED} 205 {ICON_MOVE_DOWN_DISABLED} 202 206 <!-- ENDIF --> 203 207 <!-- IF not fields.S_NEED_EDIT --> 204 <a href="{fields.U_EDIT}">{ICON_EDIT}</a> 208 <a href="{fields.U_EDIT}">{ICON_EDIT}</a> 205 209 <!-- ELSE --> 206 210 {ICON_EDIT_DISABLED} … … 210 214 211 215 </tr> 216 <!-- BEGINELSE --> 217 <tr class="row3"> 218 <td colspan="4">{L_ACP_NO_ITEMS}</td> 219 </tr> 212 220 <!-- END fields --> 213 221 </tbody> … … 215 223 216 224 <form id="profile_fields" method="post" action="{U_ACTION}"> 217 225 218 226 <fieldset class="quick"> 219 227 <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 32 32 <dt><label for="min_search_author_chars">{L_MIN_SEARCH_AUTHOR_CHARS}:</label><br /><span>{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}</span></dt> 33 33 <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> 34 38 </dl> 35 39 <dl> … … 131 135 </tbody> 132 136 </table> 133 137 134 138 <!-- ENDIF --> 135 139 136 140 <p class="quick"> 137 141 <!-- IF backend.S_INDEXED --> … … 143 147 {S_FORM_TOKEN} 144 148 </fieldset> 145 149 146 150 </form> 147 151 <!-- END backend --> -
trunk/forum/adm/style/acp_styles.html
r400 r702 21 21 <dl> 22 22 <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> 24 24 </dl> 25 25 … … 55 55 function update_image(newimage) 56 56 { 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'; 58 58 } 59 59 // ]]> … … 136 136 <dl> 137 137 <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> 139 139 </dl> 140 140 <dl> 141 141 <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> 143 143 </dl> 144 144 </div> … … 267 267 <p>{L_TEMPLATE_CACHE_EXPLAIN}</p> 268 268 269 <form name="acp_styles" method="post" action="{U_ACTION}">269 <form id="acp_styles" method="post" action="{U_ACTION}"> 270 270 <fieldset class="tabulated"> 271 271 <legend>{L_TEMPLATE_CACHE}</legend> … … 456 456 <dl> 457 457 <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> 459 459 </dl> 460 460 <dl> 461 461 <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> 463 463 </dl> 464 464 <!-- IF S_SUPERTEMPLATE --> 465 465 <dl> 466 466 <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> 468 468 </dl> 469 469 <!-- ENDIF --> … … 471 471 <dl> 472 472 <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> 474 474 </dl> 475 475 <dl> 476 476 <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> 478 478 </dl> 479 479 <dl> 480 480 <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> 482 482 </dl> 483 483 <!-- ENDIF --> -
trunk/forum/adm/style/acp_update.html
r400 r702 11 11 <!-- IF S_UP_TO_DATE and S_UP_TO_DATE_AUTO --> 12 12 <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> 14 14 </div> 15 15 <!-- ELSE --> 16 16 <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> 18 18 </div> 19 19 <!-- ENDIF --> -
trunk/forum/adm/style/acp_users.html
r400 r702 83 83 84 84 <!-- INCLUDE acp_users_feedback.html --> 85 86 <!-- ELSEIF S_WARNINGS --> 87 88 <!-- INCLUDE acp_users_warnings.html --> 85 89 86 90 <!-- ELSEIF S_PROFILE --> … … 132 136 <!-- IF group.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> 133 137 <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 --> <!-- 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 --> <!-- 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 --> <!-- ENDIF --></td> 136 140 <td><a href="{group.U_DELETE}">{L_GROUP_DELETE}</a></td> 137 141 </tr> -
trunk/forum/adm/style/acp_users_avatar.html
r400 r702 9 9 </dl> 10 10 <!-- IF not S_IN_AVATAR_GALLERY --> 11 <!-- IF S_ CAN_UPLOAD-->11 <!-- IF S_UPLOAD_FILE --> 12 12 <dl> 13 13 <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt> 14 14 <dd><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></dd> 15 15 </dl> 16 <!-- ENDIF --> 17 <!-- IF S_REMOTE_UPLOAD --> 16 18 <dl> 17 19 <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt> … … 26 28 <dl> 27 29 <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} × </span> <input type="text" name="height" size="3" value="{USER_AVATAR_HEIGHT}" /> <span>{L_PIXEL}</span></dd> 29 31 </dl> 30 32 <!-- ENDIF --> -
trunk/forum/adm/style/acp_users_overview.html
r400 r702 125 125 </dl> 126 126 </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 -->134 127 135 128 <p class="quick"> … … 142 135 </form> 143 136 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> 144 153 <!-- ENDIF --> -
trunk/forum/adm/style/acp_users_signature.html
r400 r702 94 94 </script> 95 95 </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> 97 97 <dd style="margin-left: 90px; margin-top: 5px;"> 98 98 <!-- IF S_BBCODE_ALLOWED --> -
trunk/forum/adm/style/admin.css
r400 r702 70 70 font-family: "Trebuchet MS", Helvetica, sans-serif; 71 71 font-size: 1.20em; 72 text-decoration: none; 73 line-height: 1.20em; 72 text-decoration: none; 73 line-height: 1.20em; 74 74 margin-top: 25px; 75 75 } … … 98 98 } 99 99 100 .small { 101 font-size: 0.85em; 100 .small { 101 font-size: 0.85em; 102 102 } 103 103 … … 120 120 .install-body p a { 121 121 font-weight: bold; 122 } 123 124 /* List items */ 125 ul, ol { 126 list-style-position: inside; 127 margin-left: 1em; 128 } 129 130 li { 131 display: list-item; 132 list-style-type: inherit; 122 133 } 123 134 … … 192 203 } 193 204 194 * html #main { 195 height: 350px; 205 * html #main { 206 height: 350px; 196 207 } 197 208 … … 305 316 } 306 317 307 span.corners-top, span.corners-bottom, 318 span.corners-top, span.corners-bottom, 308 319 span.corners-top span, span.corners-bottom span { 309 320 font-size: 1px; … … 784 795 fieldset.quick, p.quick { 785 796 margin: 0 0 5px; 786 padding: 5px 0 0; 797 padding: 5px 0 0; 787 798 border: none; 788 799 background-color: transparent; … … 837 848 838 849 /* Special case inputs */ 839 select#board_timezone, 850 select#board_timezone, 840 851 select#full_folder_action { 841 852 width: 95%; … … 1234 1245 1235 1246 /* 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 1237 1248 .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; 1242 1253 visibility: hidden; 1243 1254 }*/ … … 1306 1317 } 1307 1318 1308 /* Permission sections */ 1319 /* Permission sections */ 1309 1320 fieldset.permissions .permissions-simple { 1310 1321 text-align: left; … … 1517 1528 } 1518 1529 1519 .permissions-panel span.corners-top, .permissions-panel span.corners-bottom, 1530 .permissions-panel span.corners-top, .permissions-panel span.corners-bottom, 1520 1531 .permissions-panel span.corners-top span, .permissions-panel span.corners-bottom span { 1521 1532 font-size: 1px; … … 1595 1606 1596 1607 .permissions-panel th.row4 { 1597 background-image: none; 1608 background-image: none; 1598 1609 background-color: #E4E8EB; 1599 1610 color: #536482; … … 1603 1614 .permissions-panel th a:link, .permissions-panel th a:hover, .permissions-panel th a:visited { 1604 1615 display: block; 1605 color: #FFFFFF; 1606 text-decoration: underline; 1616 color: #FFFFFF; 1617 text-decoration: underline; 1607 1618 } 1608 1619 -
trunk/forum/adm/style/editor.js
r400 r702 17 17 18 18 var baseHeight; 19 window.onload = initInsertions;20 19 21 20 /** … … 260 259 function mozWrap(txtarea, open, close) 261 260 { 262 var selLength = txtarea.textLength;261 var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength; 263 262 var selStart = txtarea.selectionStart; 264 263 var selEnd = txtarea.selectionEnd; -
trunk/forum/adm/style/install_footer.html
r400 r702 3 3 </div> 4 4 <span class="corners-bottom"><span></span></span> 5 <div class="clear"></div> 5 6 </div> 6 7 </div> -
trunk/forum/adm/style/install_update.html
r400 r702 193 193 <form id="install_update" method="post" action="{U_UPDATE_ACTION}"> 194 194 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};">» <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> 200 248 <!-- ENDIF --> 201 202 <h2>{files.TITLE}</h2> 203 204 <!-- IF files.STATUS eq 'not_modified' --><div style="float: {S_CONTENT_FLOW_END};">» <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%;"> </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 --> <!-- 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 --> <!-- 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%;"> </dd> 335 </dl> 211 336 <!-- ELSE --> 212 337 <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' --> <!-- 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 --> <!-- 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 --> <!-- 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 --> <!-- 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> 279 353 <!-- ENDIF --> 280 < !-- END files -->281 282 </fieldset></div> 354 </fieldset> 355 <!-- END conflict --> 356 283 357 <!-- ENDIF --> 284 358 … … 321 395 <fieldset class="submit-buttons"> 322 396 {S_HIDDEN_FIELDS} 323 <input type="submit" class="button2" value="{L_C HECK_FILES_AGAIN}" name="check_again" /> <input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" />397 <input type="submit" class="button2" value="{L_CONTINUE_UPDATE}" name="check_again" /> <input type="submit" class="button1" value="{L_DOWNLOAD}" name="download" /> 324 398 </fieldset> 325 399 … … 372 446 <p>{L_CONNECTION_FAILED}<br />{ERROR_MSG}</p> 373 447 </div> 374 375 448 <!-- ENDIF --> 376 449 -
trunk/forum/adm/style/install_update_diff.html
r400 r702 16 16 function resize_panel() 17 17 { 18 var block = document.getElementById('codepanel'); 18 var block = document.getElementById('codepanel'); 19 19 var height; 20 20 21 21 if (window.innerHeight) 22 22 { … … 27 27 { 28 28 //whatever IE needs to do this 29 } 30 } 29 } 30 } 31 32 window.onresize = resize_panel; 33 31 34 // ]]> 32 35 </script> … … 49 52 <!-- IF DIFF_MODE neq 'side_by_side' and DIFF_MODE neq 'raw' --> 50 53 div#codepanel { 51 overflow: auto;52 54 width: 100%; 53 height: 350px;54 display: inline-block;55 55 } 56 56 <!-- ELSE --> 57 div#codepanel { 57 div#codepanel { 58 58 background-color: #eee; 59 } 60 <!-- ENDIF --> 61 62 <!-- IF DIFF_MODE neq 'unified' and DIFF_MODE neq 'side_by_side' --> 63 div#diff_content pre { 64 overflow: auto; 65 height: 414px; 66 width: 100% !important; 59 67 } 60 68 <!-- ENDIF --> … … 66 74 .file { 67 75 line-height: .7em; 76 overflow: auto; 77 height: 414px; 68 78 } 69 79 … … 140 150 table.hrdiff tbody td.old { 141 151 border-left: 1px solid #999; 142 border-right: 1px solid #999; 152 border-right: 1px solid #999; 143 153 } 144 154 table.hrdiff tbody td.new { 145 border-right: 1px solid #999; 155 border-right: 1px solid #999; 146 156 } 147 157 … … 204 214 </head> 205 215 206 207 216 <!-- IF DIFF_MODE neq 'side_by_side' and DIFF_MODE neq 'raw' --> 208 <body on resize="resize_panel();" onload="resize_panel();">217 <body onload="resize_panel();"> 209 218 <!-- ELSE --> 210 219 <body> … … 221 230 <!-- IF not S_DIFF_NEW_FILE --> 222 231 <p id="skip"><a href="#acp">{L_SKIP}</a></p> 223 <form method="post" >232 <form method="post" action=""> 224 233 <fieldset class="quick"> 225 234 <label for="diff_mode">{L_SELECT_DIFF_MODE}:</label> … … 230 239 </form> 231 240 <!-- 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 --> 232 245 </div> 233 246 234 247 <div id="page-body"> 235 248 <div id="acp"> … … 238 251 <div id="diff_content"> 239 252 <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 -->244 253 {DIFF_CONTENT} 245 254 </div> … … 249 258 </div> 250 259 </div> 251 260 252 261 253 262 <!-- INCLUDE simple_footer.html --> -
trunk/forum/adm/style/overall_footer.html
r400 r702 3 3 </div> 4 4 <span class="corners-bottom"><span></span></span> 5 <div class="clear"></div> 5 6 </div> 6 7 </div> -
trunk/forum/adm/style/overall_header.html
r400 r702 29 29 var page = prompt(jump_page, on_page); 30 30 31 if (page !== null && !isNaN(page) && page > 0) 32 { 33 document.location.href = base_url.replace(/&/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(/&/g, '&') + '&start=' + ((page - 1) * per_page); 40 } 34 41 } 35 42 } … … 188 195 <p>{L_LOGGED_IN_AS}<br /><strong>{USERNAME}</strong> [ <a href="{U_LOGOUT}">{L_LOGOUT}</a> ][ <a href="{U_ADM_LOGOUT}">{L_ADM_LOGOUT}</a> ] </p> 189 196 <ul> 197 <!-- DEFINE $LI_USED = 0 --> 190 198 <!-- BEGIN l_block1 --> 191 199 <!-- IF l_block1.S_SELECTED --> … … 194 202 <!-- IF .l_block1.l_block2.l_block3 --> 195 203 <li class="header">{l_block1.l_block2.L_TITLE}</li> 204 <!-- DEFINE $LI_USED = 1 --> 196 205 <!-- ENDIF --> 197 206 198 207 <!-- BEGIN l_block3 --> 199 208 <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 --> 200 210 <!-- END l_block3 --> 201 211 <!-- END l_block2 --> … … 203 213 <!-- ENDIF --> 204 214 <!-- END l_block1 --> 215 <!-- IF not $LI_USED --> 216 <li></li> 217 <!-- ENDIF --> 205 218 </ul> 206 219 </div> -
trunk/forum/adm/style/simple_header.html
r400 r702 40 40 var page = prompt(jump_page, on_page); 41 41 42 if (page !== null && !isNaN(page) && page > 0)42 if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) 43 43 { 44 document.location.href = base_url.replace(/&/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(/&/g, '&') + '&start=' + ((page - 1) * per_page); 51 } 45 52 } 46 53 } -
trunk/forum/common.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : common.php 8760 2008-08-15 19:46:51Z aptx$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 20 20 $starttime = $starttime[1] + $starttime[0]; 21 21 22 // Report all errors, except notices 23 error_reporting(E_ALL ^ E_NOTICE); 22 // Report all errors, except notices and deprecation messages 23 if (!defined('E_DEPRECATED')) 24 { 25 define('E_DEPRECATED', 8192); 26 } 27 error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED); 24 28 25 29 /* … … 173 177 174 178 // Load Extensions 175 if (!empty($load_extensions)) 179 // dl() is deprecated and disabled by default as of PHP 5.3. 180 if (!empty($load_extensions) && function_exists('dl')) 176 181 { 177 182 $load_extensions = explode(',', $load_extensions); -
trunk/forum/docs/AUTHORS
r400 r702 21 21 involved in phpBB. 22 22 23 phpBB Lead Developer : Acyd Burn (Meik Sievertsen)23 phpBB Lead Developer: naderman (Nils Adermann) 24 24 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) 25 phpBB 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 35 Contributions by: Brainy (Cullen Walsh) 36 leviatan21 (Gabriel Vazquez) 37 nickvergessen (Joas Schilling) 38 Raimon (Raimon Meuldijk) 39 rxu (Ruslan Uzdenov) 40 Xore (Robert Hetzler) 32 41 33 42 34 -- PreviousContributors --43 -- Former Contributors -- 35 44 36 phpBB Project Manager 37 45 phpBB Project Manager: theFinn (James Atkinson) [Founder - 04/2007] 46 SHS` (Jonathan Stanley) 38 47 39 phpBB Lead Developer :psoTFX (Paul S. Owen) [2001 - 09/2005]48 phpBB Lead Developer: psoTFX (Paul S. Owen) [2001 - 09/2005] 40 49 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 50 phpBB 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] 45 54 46 55 -- Copyrights -- 47 56 48 Visual Confirmation :Xore (Robert Hetzler)57 Visual Confirmation: Xore (Robert Hetzler) 49 58 50 59 Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group -
trunk/forum/docs/CHANGELOG.html
r400 r702 54 54 <li><a href="#changelog">Changelog</a> 55 55 <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> 56 60 <li><a href="#v303">Changes since 3.0.3</a></li> 57 61 <li><a href="#v302">Changes since 3.0.2</a></li> … … 84 88 85 89 <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 "How do I show an image below my username" 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 "All forums" 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 "px" 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 <= 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 "force_approved_state" 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 "All topics" feed into "New Topics" and "Active Topics" 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 < 5.2.0 about phpBB ending support.</li> 190 <li>[Change] Disallow deleting the last question of the Q&A CAPTCHA.</li> 191 <li>[Change] Tweak Q&A CAPTCHA garbage collection.</li> 192 <li>[Change] Show a proper preview for the Q&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 "auth=http".</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 "can change vote" 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 "View user notes" and "Warn user" 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 "force password change" 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 "Report details" 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 "Always show a scrollbar for short pages" 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 "Locked" button instead of "Reply" 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 ".php". (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 "topic does not exist" 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 "Add friend" and "Add foe" 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] "Post details" 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&A CAPTCHA</li> 370 <li>3D Wave (by Robert "Xore" 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 "Newly Registered Users" 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 "Newly Registered Users" 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 "PM Reply" and "PM Reply to all" 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 " 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 "display" (Bug #41385 - Patch by Eelke and fade2gray)</li> 444 <li>[Fix] Smilies in username are misparsed on [quote=""] (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 "store and download" 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] "Select all" 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> 87 513 88 514 <ul> … … 116 542 </ul> 117 543 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> 119 545 120 546 <ul> … … 215 641 </ul> 216 642 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> 218 644 219 645 <ul> … … 263 689 </ul> 264 690 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> 266 692 267 693 <ul> … … 334 760 </ul> 335 761 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> 337 763 338 764 <ul> … … 343 769 </ul> 344 770 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> 346 772 347 773 <ul> … … 378 804 </ul> 379 805 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> 381 807 382 808 <ul> … … 388 814 </ul> 389 815 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> 391 817 392 818 <ul> … … 451 877 </ul> 452 878 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> 454 880 455 881 <ul> … … 502 928 </ul> 503 929 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> 505 931 506 932 <ul> … … 611 1037 </ul> 612 1038 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> 614 1040 615 1041 <ul> … … 657 1083 </ul> 658 1084 659 <a name="v30rc1"></a><h3>1.x ii. Changes since 3.0.RC1</h3>1085 <a name="v30rc1"></a><h3>1.xv. Changes since 3.0.RC1</h3> 660 1086 661 1087 <ul> -
trunk/forum/docs/FAQ.html
r400 r702 54 54 <!-- add entry about common UTF8 problems (for example wrong uploading, editing) --> 55 55 <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> 57 57 <li><a href="#legal">I am having problems with the admin at a certain board, help!</a></li> 58 58 <li><a href="#legal">A board has ripped off my graphics/software/etc., stop them!</a></li> … … 63 63 <li><a href="#mail_language">My users are complaining that emails are not in their selected language!</a></li> 64 64 <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> 66 66 <li><a href="#gallery_avatars">I just cannot get gallery avatars to appear!</a></li> 67 67 <li><a href="#permissions">How do I use/set permissions?</a></li> … … 79 79 <hr /> 80 80 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> 82 82 83 83 <div class="paragraph"> … … 206 206 <hr /> 207 207 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> 209 209 210 210 <div class="paragraph"> -
trunk/forum/docs/INSTALL.html
r400 r702 140 140 <li>PostgreSQL 7.3+</li> 141 141 <li>SQLite 2.8.2+</li> 142 <li>Firebird 2. 0+</li>142 <li>Firebird 2.1+</li> 143 143 <li>MS SQL Server 2000 or above (directly or via ODBC)</li> 144 144 <li>Oracle</li> … … 274 274 <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> 275 275 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> 277 277 278 278 <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> … … 284 284 <p>The patch file package is for those wanting to update through the patch application, and being comfortable with it.</p> 285 285 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 < [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 < [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> 289 289 290 290 <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> … … 294 294 <a name="update_auto"></a><h3>4.iv. Automatic update package</h3> 295 295 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> 297 297 298 298 <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 242 242 243 243 <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> 245 245 </div> 246 246 </div></div> -
trunk/forum/docs/coding-guidelines.html
r400 r702 58 58 <li><a href="#fileheader">File Header</a></li> 59 59 <li><a href="#locations">File Locations</a></li> 60 <li><a href="#constants">Special Constants</a></li> 60 61 </ol> 61 62 </li> … … 69 70 </ol> 70 71 </li> 71 <li><a href="#styling">Styling</a> </li>72 <li><a href="#styling">Styling</a> 72 73 <ol style="list-style-type: lower-roman;"> 73 74 <li><a href="#cfgfiles">Style Config Files</a></li> … … 87 88 </ol> 88 89 </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> 89 96 <li><a href="#changes">Guidelines Changelog</a></li> 90 97 <li><a href="#disclaimer">Copyright and disclaimer</a></li> … … 119 126 120 127 <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> 122 129 123 130 <a name="fileheader"></a><h3>1.ii. File Header</h3> … … 197 204 <li><code>/includes/db/msssql.php</code><br />MSSQL Database Abstraction Layer</li> 198 205 <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> 200 207 <li><code>/includes/db/mysqli.php</code><br />MySQLi Database Abstraction Layer</li> 201 208 <li><code>/includes/db/oracle.php</code><br />Oracle Database Abstraction Layer</li> … … 218 225 </ul> 219 226 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> 232 PHPBB_MSG_HANDLER (overwrite message handler) 233 PHPBB_DB_NEW_LINK (overwrite new_link parameter for sql_connect) 234 PHPBB_ROOT_PATH (overwrite $phpbb_root_path) 235 PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path) 236 PHPBB_USE_BOARD_URL_PATH (use generate_board_url() for image paths instead of $phpbb_root_path) 237 PHPBB_DISABLE_ACP_EDITOR (disable ACP style editor for templates) 238 PHPBB_DISABLE_CONFIG_CHECK (disable ACP config.php writeable check) 239 240 PHPBB_ACM_MEMCACHE_PORT (overwrite memcached port, default is 11211) 241 PHPBB_ACM_MEMCACHE_COMPRESS (overwrite memcached compress setting, default is disabled) 242 PHPBB_ACM_MEMCACHE_HOST (overwrite memcached host name, default is localhost) 243 244 PHPBB_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 220 275 </div> 221 276 … … 1110 1165 1111 1166 <p>You will note in the 3.0 templates the major sources start with <code><!-- INCLUDE overall_header.html --></code> or <code><!-- INCLUDE simple_header.html --></code>, etc. In 2.0.x control of "which" 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 "menu" 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"><!-- INCLUDE {FILE_VAR} --></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"><!-- DEFINE $SOME_VAR = 'my_file.html' --></span> 1177 <span class="comment"><!-- INCLUDE {$SOME_VAR} --></span> 1178 </pre></div> 1112 1179 1113 1180 <h4>PHP</h4> … … 1464 1531 1465 1532 <fieldset class="submit-buttons"> 1466 <input type="reset" value="{L_RESET}" name="reset" class="button2" /> 1467 <input type="submit" name="action[add_warning]" value="{L_SUBMIT}" class="button1" /> 1533 <input type="reset" value="{L_RESET}" name="reset" class="button2" /> 1534 <input type="submit" name="action[add_warning]" value="{L_SUBMIT}" class="button1" /> 1468 1535 {S_FORM_TOKEN} 1469 </fieldset> 1470 </form> 1536 </fieldset> 1537 </form> 1471 1538 </pre></div><br /> 1472 1539 … … 2253 2320 <hr /> 2254 2321 2255 <a name="changes"></a><h2>7. Guidelines Changelog</h2> 2322 <a name="vcs"></a><h2>7. VCS Guidelines</h2> 2323 2256 2324 <div class="paragraph"> 2257 2325 <div class="inner"><span class="corners-top"><span></span></span> … … 2259 2327 <div class="content"> 2260 2328 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> 2359 Authorised 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> 2261 2387 2262 2388 <h3>Revision 8732</h3> … … 2331 2457 <hr /> 2332 2458 2333 <a name="disclaimer"></a><h2> 8. Copyright and disclaimer</h2>2459 <a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2> 2334 2460 2335 2461 <div class="paragraph"> … … 2350 2476 2351 2477 <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> 2353 2479 </div> 2354 2480 </div></div> -
trunk/forum/docs/hook_system.html
r400 r702 105 105 } 106 106 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; 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; 115 115 } 116 116 … … 388 388 PHPBB_ROOT_PATH (overwrite $phpbb_root_path) 389 389 PHPBB_ADMIN_PATH (overwrite $phpbb_admin_path) 390 </pre></div> 390 PHPBB_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 391 419 392 420 </div> … … 617 645 <div class="codebox"><pre> 618 646 not hooked 619 hooked 647 hooked 620 648 </pre></div> 621 649 … … 671 699 <div class="codebox"><pre> 672 700 not hooked 673 hooked 701 hooked 674 702 </pre></div> 675 703 … … 848 876 849 877 <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> 851 879 </div> 852 880 </div></div> -
trunk/forum/download/file.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : file.php 8792 2008-08-28 13:10:05Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 17 17 18 18 19 // Thank you sun. 19 // Thank you sun. 20 20 if (isset($_SERVER['CONTENT_TYPE'])) 21 21 { … … 61 61 $avatar_group = false; 62 62 $exit = false; 63 63 64 64 if ($filename[0] === 'g') 65 65 { … … 88 88 $exit = true; 89 89 } 90 91 90 91 92 92 if (!$exit) 93 93 { … … 250 250 } 251 251 252 $attachment['physical_filename'] = basename($attachment['physical_filename']);252 $attachment['physical_filename'] = utf8_basename($attachment['physical_filename']); 253 253 $display_cat = $extensions[$attachment['extension']]['display_cat']; 254 254 … … 267 267 $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename']; 268 268 } 269 else if (($display_cat == ATTACHMENT_CATEGORY_NONE || $display_cat == ATTACHMENT_CATEGORY_IMAGE) && !$attachment['is_orphan'])269 else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHMENT_CATEGORY_IMAGE*/) && !$attachment['is_orphan']) 270 270 { 271 271 // Update download count … … 279 279 { 280 280 wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']); 281 file_gc(); 281 282 } 282 283 else … … 376 377 else 377 378 { 378 header('HTTP/1.0 404 not found');379 header('HTTP/1.0 404 Not Found'); 379 380 } 380 381 } … … 464 465 // Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer. 465 466 $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'); 475 478 } 476 479 else 477 480 { 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 } 482 496 } 483 497 } … … 655 669 if ((strpos(strtolower($browser), 'msie 6.0') === false) && (strpos(strtolower($browser), 'msie 8.0') === false)) 656 670 { 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 661 676 header('Status: 304 Not Modified', true, 304); 662 677 } -
trunk/forum/faq.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : faq.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 39 39 40 40 // Pull the array data from the lang pack 41 $switch_column = $found_switch = false; 41 42 $help_blocks = array(); 42 43 foreach ($user->help as $help_ary) … … 44 45 if ($help_ary[0] == '--') 45 46 { 47 if ($help_ary[1] == '--') 48 { 49 $switch_column = true; 50 $found_switch = true; 51 continue; 52 } 53 46 54 $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 )); 49 58 59 if ($switch_column) 60 { 61 $switch_column = false; 62 } 50 63 continue; 51 64 } … … 59 72 // Lets build a page ... 60 73 $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'], 64 76 65 page_header($l_title); 77 'SWITCH_COLUMN_MANUALLY' => (!$found_switch) ? true : false, 78 )); 79 80 page_header($l_title, false); 66 81 67 82 $template->set_filenames(array( -
trunk/forum/includes/acm/acm_file.php
r400 r702 3 3 * 4 4 * @package acm 5 * @version $Id : acm_file.php 9076 2008-11-22 19:06:42Z acydburn$6 * @copyright (c) 2005 phpBB Group5 * @version $Id$ 6 * @copyright (c) 2005, 2009 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 8 8 * … … 45 45 function load() 46 46 { 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'); 58 48 } 59 49 … … 87 77 global $phpEx; 88 78 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')) 105 80 { 106 81 // Now, this occurred how often? ... phew, just tell the user then... 107 82 if (!@is_writable($this->cache_dir)) 108 83 { 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; 113 91 } 114 92 … … 130 108 } 131 109 110 $time = time(); 111 132 112 while (($entry = readdir($dir)) !== false) 133 113 { … … 137 117 } 138 118 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) 142 133 { 143 134 $this->remove_file($this->cache_dir . $entry); … … 155 146 foreach ($this->var_expires as $var_name => $expires) 156 147 { 157 if ( time() >$expires)148 if ($time >= $expires) 158 149 { 159 150 $this->destroy($var_name); … … 179 170 } 180 171 181 @include($this->cache_dir . "data{$var_name}.$phpEx"); 182 return (isset($data)) ? $data : false; 172 return $this->_read('data' . $var_name); 183 173 } 184 174 else … … 195 185 if ($var_name[0] == '_') 196 186 { 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); 214 188 } 215 189 else … … 286 260 } 287 261 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'))) 292 263 { 293 264 continue; 294 265 } 295 266 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 300 278 foreach ($table as $check_table) 301 279 { 302 280 // Better catch partial table names than no table names. ;) 303 if (strpos($ check_line, $check_table) !== false)281 if (strpos($query, $check_table) !== false) 304 282 { 305 $ found = true;283 $this->remove_file($this->cache_dir . $entry); 306 284 break; 307 285 } 308 }309 310 if ($found)311 {312 $this->remove_file($this->cache_dir . $entry);313 286 } 314 287 } … … 369 342 function sql_load($query) 370 343 { 371 global $phpEx;372 373 344 // Remove extra spaces and tabs 374 345 $query = preg_replace('/[\n\r\s\t]+/', ' ', $query); 346 347 if (($rowset = $this->_read('sql_' . md5($query))) === false) 348 { 349 return false; 350 } 351 375 352 $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; 394 354 $this->sql_row_pointer[$query_id] = 0; 395 355 … … 402 362 function sql_save($query, &$query_result, $ttl) 403 363 { 404 global $db , $phpEx;364 global $db; 405 365 406 366 // Remove extra spaces and tabs 407 367 $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); 430 690 431 691 if (!function_exists('phpbb_chmod')) … … 435 695 } 436 696 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; 459 700 } 460 701 461 702 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;505 703 } 506 704 -
trunk/forum/includes/acp/acp_attachments.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_attachments.php 9041 2008-11-02 11:19:12Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 125 125 'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 126 126 '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']), 128 128 'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), 129 129 'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'string', 'type' => 'text:20:200', 'explain' => true, 'append' => ' <span>[ <a href="' . $this->u_action . '&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']), 132 132 ) 133 133 ); … … 685 685 } 686 686 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']; 689 690 690 691 $img_path = $config['upload_icons_path']; … … 695 696 $imglist = filelist($phpbb_root_path . $img_path); 696 697 697 if ( sizeof($imglist))698 if (!empty($imglist[''])) 698 699 { 699 700 $imglist = array_values($imglist); … … 1004 1005 if ($files_added) 1005 1006 { 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); 1008 1009 } 1009 1010 } … … 1027 1028 'FILESIZE' => get_formatted_filesize($row['filesize']), 1028 1029 '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']), 1031 1032 'ATTACH_ID' => $row['attach_id'], 1032 1033 'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '', … … 1430 1431 { 1431 1432 // 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']; 1434 1436 1435 1437 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 3 3 * 4 4 * @package acp 5 * @version $Id : acp_ban.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 157 157 WHERE (ban_end >= ' . time() . " 158 158 OR ban_end = 0) 159 AND ban_ip <> ''"; 159 AND ban_ip <> '' 160 ORDER BY ban_ip"; 160 161 break; 161 162 … … 169 170 WHERE (ban_end >= ' . time() . " 170 171 OR ban_end = 0) 171 AND ban_email <> ''"; 172 AND ban_email <> '' 173 ORDER BY ban_email"; 172 174 break; 173 175 } … … 182 184 183 185 $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 } 185 202 186 203 $ban_reasons[$row['ban_id']] = $row['ban_reason']; -
trunk/forum/includes/acp/acp_bbcodes.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_bbcodes.php 8743 2008-08-12 16:03:18Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 125 125 case 'create': 126 126 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 204 212 { 205 213 $bbcode_id = NUM_CORE_BBCODES + 1; 206 214 } 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'; 207 228 } 208 229 else 209 230 { 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)); 225 244 } 226 245 else 227 246 { 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 } 241 257 242 258 break; … … 300 316 $bbcode_match = trim($bbcode_match); 301 317 $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 } 302 330 303 331 $fp_match = preg_quote($bbcode_match, '!'); … … 326 354 'SIMPLETEXT' => array( 327 355 '!([a-zA-Z0-9-+.,_ ]+)!' => "$1" 356 ), 357 'INTTEXT' => array( 358 ($utf8_pcre_properties) ? '!([\p{L}\p{N}\-+,_. ]+)!u' : '!([a-zA-Z0-9\-+,_. ]+)!u' => "$1" 328 359 ), 329 360 'IDENTIFIER' => array( … … 344 375 'TEXT' => '(.*?)', 345 376 'SIMPLETEXT' => '([a-zA-Z0-9-+.,_ ]+)', 377 'INTTEXT' => ($utf8_pcre_properties) ? '([\p{L}\p{N}\-+,_. ]+)' : '([a-zA-Z0-9\-+,_. ]+)', 346 378 'IDENTIFIER' => '([a-zA-Z0-9-_]+)', 347 379 'COLOR' => '([a-zA-Z]+|#[0-9abcdefABCDEF]+)', … … 351 383 $pad = 0; 352 384 $modifiers = 'i'; 385 $modifiers .= ($utf8 && $utf8_pcre_properties) ? 'u' : ''; 353 386 354 387 if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $bbcode_match, $m)) … … 399 432 400 433 $fp_match = '!' . $fp_match . '!' . $modifiers; 401 $sp_match = '!' . $sp_match . '!s' ;434 $sp_match = '!' . $sp_match . '!s' . (($utf8) ? 'u' : ''); 402 435 403 436 if (strpos($fp_match, 'e') !== false) -
trunk/forum/includes/acp/acp_board.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_board.php 8911 2008-09-23 13:03:33Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 30 30 global $db, $user, $auth, $template; 31 31 global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; 32 global $cache; 32 33 33 34 $user->add_lang('acp/board'); 34 35 35 36 $action = request_var('action', ''); 36 $submit = (isset($_POST['submit']) ) ? true : false;37 $submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false; 37 38 38 39 $form_key = 'acp_board'; … … 65 66 'legend2' => 'WARNINGS', 66 67 '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', 67 70 ) 68 71 ); … … 80 83 'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 81 84 '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), 82 86 'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 83 87 'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), … … 86 90 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 87 91 '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), 88 93 89 94 'legend2' => 'ACP_LOAD_SETTINGS', … … 94 99 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 95 100 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 101 102 'legend3' => 'ACP_SUBMIT_CHANGES', 96 103 ) 97 104 ); … … 109 116 'avatar_max_height' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => false, 'method' => false, 'explain' => false,), 110 117 118 'allow_avatar' => array('lang' => 'ALLOW_AVATARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 111 119 'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 112 120 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 113 121 '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), 114 123 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int:0', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), 115 124 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), … … 144 153 'auth_img_pm' => array('lang' => 'ALLOW_IMG_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 145 154 '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', 147 158 ) 148 159 ); … … 163 174 'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 164 175 '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), 165 177 166 178 '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),169 179 'bump_type' => false, 170 180 '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']), 171 182 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 172 183 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), … … 174 185 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false), 175 186 '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), 176 188 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0', 'type' => 'text:3:4', 'explain' => true), 177 189 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:2:127', 'type' => 'text:4:4', 'explain' => false), 178 190 '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), 179 192 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true), 180 193 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true), … … 183 196 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), 184 197 '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', 185 200 ) 186 201 ); … … 206 221 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), 207 222 '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', 208 225 ) 209 226 ); … … 219 236 220 237 '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), 221 240 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:1', 'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true), 222 241 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), … … 236 255 'coppa_mail' => array('lang' => 'COPPA_MAIL', 'validate' => 'string', 'type' => 'textarea:5:40', 'explain' => true), 237 256 '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), 238 287 ) 239 288 ); … … 280 329 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 281 330 'load_cpf_viewtopic' => array('lang' => 'LOAD_CPF_VIEWTOPIC', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 331 332 'legend4' => 'ACP_SUBMIT_CHANGES', 282 333 ) 283 334 ); … … 313 364 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true), 314 365 'script_path' => array('lang' => 'SCRIPT_PATH', 'validate' => 'script_path', 'type' => 'text::255', 'explain' => true), 366 367 'legend4' => 'ACP_SUBMIT_CHANGES', 315 368 ) 316 369 ); … … 361 414 'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true), 362 415 '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', 364 419 ) 365 420 ); … … 401 456 } 402 457 403 if ($config_name == 'auth_method' )458 if ($config_name == 'auth_method' || $config_name == 'feed_news_id' || $config_name == 'feed_exclude_id') 404 459 { 405 460 continue; … … 418 473 { 419 474 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'); 421 491 } 422 492 … … 795 865 796 866 /** 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 /** 797 881 * Select default dateformat 798 882 */ … … 831 915 <input type=\"text\" name=\"config[$key]\" id=\"$key\" value=\"$value\" maxlength=\"30\" />"; 832 916 } 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 833 986 } 834 987 -
trunk/forum/includes/acp/acp_captcha.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_captcha.php 8722 2008-07-29 15:13:13Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 30 30 $user->add_lang('acp/board'); 31 31 32 include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx); 33 $captchas = phpbb_captcha_factory::get_captcha_types(); 32 34 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); 39 38 40 if (isset($_GET['demo'])) 39 40 // Oh, they are just here for the view 41 if (isset($_GET['captcha_demo'])) 41 42 { 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)) 44 70 { 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)); 46 96 } 47 if ($config['captcha_gd'])97 else if ($submit) 48 98 { 49 include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx);99 trigger_error($user->lang['FORM_INVALID'] . adm_back_link()); 50 100 } 51 101 else 52 102 { 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 )); 54 128 } 55 $captcha = new captcha();56 $captcha->execute(gen_rand_string(mt_rand(5, 8)), time());57 exit;58 129 } 130 } 59 131 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; 65 138 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(); 70 142 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&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 .= "&$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(); 119 145 } 120 146 } -
trunk/forum/includes/acp/acp_database.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_database.php 8814 2008-09-04 12:01:47Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 28 28 global $cache, $db, $user, $auth, $template, $table_prefix; 29 29 global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; 30 30 31 31 $user->add_lang('acp/database'); 32 32 … … 83 83 84 84 @set_time_limit(1200); 85 @set_time_limit(0); 85 86 86 87 $time = time(); … … 142 143 143 144 case 'oracle': 144 $extractor->flush('TRUNCATE TABLE ' . $table_name . " \\\n");145 $extractor->flush('TRUNCATE TABLE ' . $table_name . "/\n"); 145 146 break; 146 147 … … 188 189 'U_ACTION' => $this->u_action . '&action=download' 189 190 )); 190 191 191 192 $available_methods = array('gzip' => 'zlib', 'bzip2' => 'bz2'); 192 193 … … 425 426 $dh = @opendir($dir); 426 427 428 $backup_files = array(); 429 427 430 if ($dh) 428 431 { … … 431 434 if (preg_match('#^backup_(\d{10,})_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) 432 435 { 433 $supported = in_array($matches[2], $methods); 434 435 if ($supported == 'true') 436 if (in_array($matches[2], $methods)) 436 437 { 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; 442 439 } 443 440 } 444 441 } 445 442 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 } 446 457 } 447 458 … … 509 520 header("Content-Type: $mimetype; name=\"$name\""); 510 521 header("Content-disposition: attachment; filename=$name"); 511 522 512 523 switch ($format) 513 524 { … … 528 539 } 529 540 } 530 541 531 542 if ($store == true) 532 543 { 533 544 global $phpbb_root_path; 534 545 $file = $phpbb_root_path . 'store/' . $filename . $ext; 535 546 536 547 $this->fp = $open($file, 'w'); 537 548 538 549 if (!$this->fp) 539 550 { 540 trigger_error(' Unable to write temporary file to storage folder', E_USER_ERROR);551 trigger_error('FILE_WRITE_FAIL', E_USER_ERROR); 541 552 } 542 553 } … … 546 557 { 547 558 static $close; 559 548 560 if ($this->store) 549 561 { … … 663 675 { 664 676 $fields_cnt = mysqli_num_fields($result); 665 677 666 678 // Get field information 667 679 $field = mysqli_fetch_fields($result); 668 680 $field_set = array(); 669 681 670 682 for ($j = 0; $j < $fields_cnt; $j++) 671 683 { … … 680 692 $query_len = 0; 681 693 $max_len = get_usable_memory(); 682 694 683 695 while ($row = mysqli_fetch_row($result)) 684 696 { … … 751 763 } 752 764 $field_set = array(); 753 765 754 766 for ($j = 0; $j < $fields_cnt; $j++) 755 767 { … … 967 979 } 968 980 $db->sql_freeresult($result); 969 981 970 982 foreach ($ar as $value) 971 983 { … … 1125 1137 } 1126 1138 $db->sql_freeresult($result); 1127 1139 1128 1140 $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 1129 1141 FROM pg_class c, pg_attribute a, pg_type t … … 1146 1158 AND d.adnum = " . $row['attnum']; 1147 1159 $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)) 1150 1164 { 1151 1165 unset($row['rowdefault']); … … 1153 1167 else 1154 1168 { 1155 $row['rowdefault'] = $db->sql_fetchfield('rowdefault', false, $def_res); 1156 } 1157 $db->sql_freeresult($def_res); 1169 $row['rowdefault'] = $def_row['rowdefault']; 1170 } 1158 1171 1159 1172 if ($row['type'] == 'bpchar') … … 1189 1202 $line .= ' NOT NULL'; 1190 1203 } 1191 1204 1192 1205 $lines[] = $line; 1193 1206 } … … 1389 1402 $sql_data .= "\nCREATE TABLE [$table_name] (\n"; 1390 1403 $rows = array(); 1391 1404 1392 1405 $text_flag = false; 1393 1406 1394 1407 $sql = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') as IS_IDENTITY 1395 1408 FROM INFORMATION_SCHEMA.COLUMNS 1396 1409 WHERE TABLE_NAME = '$table_name'"; 1397 1410 $result = $db->sql_query($sql); 1398 1411 1399 1412 while ($row = $db->sql_fetchrow($result)) 1400 1413 { 1401 1414 $line = "\t[{$row['COLUMN_NAME']}] [{$row['DATA_TYPE']}]"; 1402 1415 1403 1416 if ($row['DATA_TYPE'] == 'text') 1404 1417 { 1405 1418 $text_flag = true; 1406 1419 } 1407 1420 1408 1421 if ($row['IS_IDENTITY']) 1409 1422 { 1410 1423 $line .= ' IDENTITY (1 , 1)'; 1411 1424 } 1412 1425 1413 1426 if ($row['CHARACTER_MAXIMUM_LENGTH'] && $row['DATA_TYPE'] !== 'text') 1414 1427 { 1415 1428 $line .= ' (' . $row['CHARACTER_MAXIMUM_LENGTH'] . ')'; 1416 1429 } 1417 1430 1418 1431 if ($row['IS_NULLABLE'] == 'YES') 1419 1432 { … … 1424 1437 $line .= ' NOT NULL'; 1425 1438 } 1426 1439 1427 1440 if ($row['COLUMN_DEFAULT']) 1428 1441 { 1429 1442 $line .= ' DEFAULT ' . $row['COLUMN_DEFAULT']; 1430 1443 } 1431 1444 1432 1445 $rows[] = $line; 1433 1446 } 1434 1447 $db->sql_freeresult($result); 1435 1448 1436 1449 $sql_data .= implode(",\n", $rows); 1437 1450 $sql_data .= "\n) ON [PRIMARY]"; 1438 1451 1439 1452 if ($text_flag) 1440 1453 { 1441 1454 $sql_data .= " TEXTIMAGE_ON [PRIMARY]"; 1442 1455 } 1443 1456 1444 1457 $sql_data .= "\nGO\n\n"; 1445 1458 $rows = array(); 1446 1459 1447 1460 $sql = "SELECT CONSTRAINT_NAME, COLUMN_NAME 1448 1461 FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE … … 1464 1477 } 1465 1478 $db->sql_freeresult($result); 1466 1479 1467 1480 $index = array(); 1468 1481 $sql = "EXEC sp_statistics '$table_name'"; … … 1476 1489 } 1477 1490 $db->sql_freeresult($result); 1478 1491 1479 1492 foreach ($index as $index_name => $column_name) 1480 1493 { 1481 1494 $index[$index_name] = implode(', ', $column_name); 1482 1495 } 1483 1496 1484 1497 foreach ($index as $index_name => $columns) 1485 1498 { … … 1509 1522 $ident_set = false; 1510 1523 $sql_data = ''; 1511 1524 1512 1525 // Grab all of the data from current table. 1513 1526 $sql = "SELECT * … … 1603 1616 $ident_set = false; 1604 1617 $sql_data = ''; 1605 1618 1606 1619 // Grab all of the data from current table. 1607 1620 $sql = "SELECT * … … 1704 1717 global $db; 1705 1718 $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"; 1708 1720 $sql_data .= "\nCREATE TABLE $table_name (\n"; 1709 1721 … … 1720 1732 if ($row['data_type'] !== 'CLOB') 1721 1733 { 1722 if ($row['data_type'] !== 'VARCHAR2' )1734 if ($row['data_type'] !== 'VARCHAR2' && $row['data_type'] !== 'CHAR') 1723 1735 { 1724 1736 $line .= '(' . $row['data_precision'] . ')'; … … 1750 1762 $result = $db->sql_query($sql); 1751 1763 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 } 1757 1777 1758 1778 $sql = "SELECT A.CONSTRAINT_NAME, A.COLUMN_NAME … … 1763 1783 $result = $db->sql_query($sql); 1764 1784 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 } 1770 1798 1771 1799 $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 1776 1804 WHERE A.REFERENCED_TYPE = 'SEQUENCE' 1777 1805 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"; 1779 1808 $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"; 1783 1823 } 1784 1824 $db->sql_freeresult($result); … … 1790 1830 while ($row = $db->sql_fetchrow($result)) 1791 1831 { 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"; 1793 1833 } 1794 1834 $db->sql_freeresult($result); … … 1810 1850 foreach ($index as $index_name => $column_names) 1811 1851 { 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"; 1813 1853 } 1814 1854 $db->sql_freeresult($result); … … 1820 1860 global $db; 1821 1861 $ary_type = $ary_name = array(); 1822 1862 1823 1863 // Grab all of the data from current table. 1824 1864 $sql = "SELECT * … … 1843 1883 for ($i = 0; $i < $i_num_fields; $i++) 1844 1884 { 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])) 1848 1889 { 1849 1890 $str_quote = ''; … … 1874 1915 1875 1916 $schema_vals[$i] = $str_quote . $str_val . $str_quote; 1876 $schema_fields[$i] = '"' . $ary_name[$i] . "'";1917 $schema_fields[$i] = '"' . $ary_name[$i] . '"'; 1877 1918 } 1878 1919 1879 1920 // Take the ordered fields and their associated data and build it 1880 1921 // 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"; 1882 1923 1883 1924 $this->flush($sql_data); … … 1916 1957 global $db; 1917 1958 $ary_type = $ary_name = array(); 1918 1959 1919 1960 // Grab all of the data from current table. 1920 1961 $sql = "SELECT * … … 2198 2239 function sanitize_data_oracle($text) 2199 2240 { 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); 2202 2245 2203 2246 $val = array(); … … 2245 2288 $record = ''; 2246 2289 $delim_len = strlen($delim); 2247 2290 2248 2291 while (!$eof($fp)) 2249 2292 { -
trunk/forum/includes/acp/acp_email.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_email.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 109 109 trigger_error($user->lang['NO_USER'] . adm_back_link($this->u_action), E_USER_WARNING); 110 110 } 111 111 112 112 $i = $j = 0; 113 113 … … 122 122 if (($row['user_notify_type'] == NOTIFY_EMAIL && $row['user_email']) || 123 123 ($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']))) 125 125 { 126 126 if ($i == $max_chunk_size || $row['user_lang'] != $old_lang || $row['user_notify_type'] != $old_notify_type) … … 174 174 $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); 175 175 $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); 176 176 177 177 $messenger->subject(htmlspecialchars_decode($subject)); 178 178 $messenger->set_mail_priority($priority); … … 182 182 'MESSAGE' => htmlspecialchars_decode($message)) 183 183 ); 184 184 185 185 if (!($messenger->send($used_method))) 186 186 { … … 240 240 $select_list = '<option value="0"' . ((!$group_id) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>'; 241 241 $select_list .= group_select_options($group_id, $exclude); 242 242 243 243 $s_priority_options = '<option value="' . MAIL_LOW_PRIORITY . '">' . $user->lang['MAIL_LOW_PRIORITY'] . '</option>'; 244 244 $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 3 3 * 4 4 * @package acp 5 * @version $Id : acp_forums.php 8898 2008-09-19 17:07:13Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 140 140 'enable_prune' => request_var('enable_prune', false), 141 141 'enable_post_review' => request_var('enable_post_review', true), 142 'enable_quick_reply' => request_var('enable_quick_reply', false), 142 143 'prune_days' => request_var('prune_days', 7), 143 144 'prune_viewed' => request_var('prune_viewed', 7), … … 151 152 ); 152 153 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 153 160 // Use link_display_on_index setting if forum type is link 154 161 if ($forum_data['forum_type'] == FORUM_LINK) … … 163 170 } 164 171 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); 166 173 167 174 // Get data for forum rules if specified... … … 182 189 { 183 190 $forum_perm_from = request_var('forum_perm_from', 0); 191 $cache->destroy('sql', FORUMS_TABLE); 184 192 185 193 // 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')))) 188 196 { 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); 246 198 cache_moderators(); 247 199 } 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 */ 249 207 $auth->acl_clear_prefetch(); 250 $cache->destroy('sql', FORUMS_TABLE);251 208 252 209 $acl_url = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; … … 424 381 $forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0; 425 382 $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; 426 384 } 427 385 … … 485 443 'prune_viewed' => 7, 486 444 '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, 488 447 'forum_password' => '', 489 448 'forum_password_confirm'=> '', … … 561 520 WHERE forum_type = ' . FORUM_POST . " 562 521 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; 565 525 if ($db->sql_fetchrow($result)) 566 526 { 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; 570 528 } 571 529 $db->sql_freeresult($result); … … 584 542 $forums_list = make_forum_select($forum_data['parent_id'], $subforums_id); 585 543 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) 593 545 { 594 546 $template->assign_vars(array( … … 596 548 ); 597 549 } 598 $db->sql_freeresult($result);599 550 600 551 $template->assign_vars(array( 601 552 'S_HAS_SUBFORUMS' => ($forum_data['right_id'] - $forum_data['left_id'] > 1) ? true : false, 602 553 '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)) 603 560 ); 604 561 } … … 685 642 'S_DISPLAY_ACTIVE_TOPICS' => ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS) ? true : false, 686 643 '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, 687 645 '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, 688 646 )); … … 715 673 WHERE forum_type = ' . FORUM_POST . " 716 674 AND forum_id <> $forum_id"; 717 $result = $db->sql_query ($sql);675 $result = $db->sql_query_limit($sql, 1); 718 676 719 677 if ($db->sql_fetchrow($result)) … … 743 701 return; 744 702 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 = '&mode=setting_forum_local&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 . '&parent_id=' . $this->parent_id)); 726 } 727 728 break; 745 729 } 746 730 … … 807 791 808 792 $url = $this->u_action . "&parent_id=$this->parent_id&f={$row['forum_id']}"; 809 810 $forum_title = ($forum_type != FORUM_LINK) ? '<a href="' . $this->u_action . '&parent_id=' . $row['forum_id'] . '">' : '';811 $forum_title .= $row['forum_name'];812 $forum_title .= ($forum_type != FORUM_LINK) ? '</a>' : '';813 793 814 794 $template->assign_block_vars('forums', array( … … 889 869 function update_forum_data(&$forum_data) 890 870 { 891 global $db, $user, $cache ;871 global $db, $user, $cache, $phpbb_root_path; 892 872 893 873 $errors = array(); … … 926 906 array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data['forum_topics_per_page'], 'column_type' => 'TINT:0'), 927 907 ); 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 } 928 913 929 914 validate_range($range_test_ary, $errors); … … 943 928 $forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0; 944 929 $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; 945 931 946 932 // Unset data that are not database fields … … 953 939 unset($forum_data_sql['show_active']); 954 940 unset($forum_data_sql['enable_post_review']); 941 unset($forum_data_sql['enable_quick_reply']); 955 942 unset($forum_data_sql['forum_password_confirm']); 956 943 … … 1929 1916 adm_page_footer(); 1930 1917 } 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 = '&mode=setting_forum_local&forum_id[]=' . $forum_data['forum_id']; 1928 $action = append_sid($this->u_action . "&parent_id={$this->parent_id}&f={$forum_data['forum_id']}&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 . '&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 1931 1943 } 1932 1944 -
trunk/forum/includes/acp/acp_groups.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_groups.php 9053 2008-11-09 15:10:40Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 310 310 'max_recipients' => request_var('group_max_recipients', 0), 311 311 'founder_manage' => 0, 312 'skip_auth' => request_var('group_skip_auth', 0), 312 313 ); 313 314 … … 401 402 402 403 $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) 405 420 { 406 421 if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test])) 407 422 { 423 settype($submit_ary[$test], $type); 408 424 $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; 409 425 } … … 563 579 'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0, 564 580 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '', 565 581 'GROUP_SKIP_AUTH' => (!empty($group_row['group_skip_auth'])) ? ' checked="checked"' : '', 566 582 567 583 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], … … 592 608 'U_ACTION' => "{$this->u_action}&action=$action&g=$group_id", 593 609 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)), 594 ) 595 ); 610 )); 596 611 597 612 return; … … 608 623 609 624 // 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_pending625 $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 611 626 FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug 612 627 WHERE ug.group_id = $group_id … … 622 637 623 638 'USERNAME' => $row['username'], 639 'USERNAME_COLOUR' => $row['user_colour'], 624 640 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, 625 641 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', 626 642 'USER_POSTS' => $row['user_posts'], 627 'USER_ID' => $row['user_id'] )628 ) ;643 'USER_ID' => $row['user_id'], 644 )); 629 645 } 630 646 $db->sql_freeresult($result); … … 663 679 664 680 // 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_pending681 $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 666 682 FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug 667 683 WHERE ug.group_id = $group_id … … 688 704 689 705 'USERNAME' => $row['username'], 706 'USERNAME_COLOUR' => $row['user_colour'], 690 707 'S_GROUP_DEFAULT' => ($row['group_id'] == $group_id) ? true : false, 691 708 'JOINED' => ($row['user_regdate']) ? $user->format_date($row['user_regdate']) : ' - ', … … 764 781 'GROUP_NAME' => $group_name, 765 782 'TOTAL_MEMBERS' => $row['total_members'], 766 ) 767 ); 783 )); 768 784 } 769 785 } -
trunk/forum/includes/acp/acp_icons.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_icons.php 8974 2008-10-06 13:23:41Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 90 90 } 91 91 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 92 107 $_images[$path . $img]['file'] = $path . $img; 93 108 $_images[$path . $img]['width'] = $img_size[0]; … … 169 184 } 170 185 } 171 186 172 187 $sql = "SELECT * 173 188 FROM $table 174 189 ORDER BY {$fields}_order " . (($icon_id || $action == 'add') ? 'DESC' : 'ASC'); 175 190 $result = $db->sql_query($sql); 176 191 177 192 $data = array(); 178 193 $after = false; … … 181 196 $add_order_lists = array('', ''); 182 197 $display_count = 0; 183 198 184 199 while ($row = $db->sql_fetchrow($result)) 185 200 { … … 232 247 } 233 248 234 $colspan = (($mode == 'smilies') ? '7' : '5');249 $colspan = (($mode == 'smilies') ? 7 : 5); 235 250 $colspan += ($icon_id) ? 1 : 0; 236 251 $colspan += ($action == 'add') ? 2 : 0; 237 252 238 253 $template->assign_vars(array( 239 254 'S_EDIT' => true, 240 255 'S_SMILIES' => ($mode == 'smilies') ? true : false, 241 256 'S_ADD' => ($action == 'add') ? true : false, 242 257 243 258 'S_ORDER_LIST_DISPLAY' => $order_list . $order_lists[1], 244 259 'S_ORDER_LIST_UNDISPLAY' => $order_list . $order_lists[0], … … 287 302 288 303 'S_IMG_OPTIONS' => $smiley_options, 289 304 290 305 'S_ADD_ORDER_LIST_DISPLAY' => $add_order_list . $add_order_lists[1], 291 306 'S_ADD_ORDER_LIST_UNDISPLAY' => $add_order_list . $add_order_lists[0], 292 307 293 308 'IMG_SRC' => $phpbb_root_path . $img_path . '/' . $default_row['smiley_url'], 294 309 'IMG_PATH' => $img_path, … … 304 319 305 320 return; 306 321 307 322 break; 308 323 … … 312 327 // Get items to create/modify 313 328 $images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array(); 314 329 315 330 // Now really get the items 316 331 $image_id = (isset($_POST['id'])) ? request_var('id', array('' => 0)) : array(); … … 349 364 } 350 365 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 351 385 $icons_updated = 0; 352 386 $errors = array(); … … 368 402 $image_width[$image] = $img_size[0]; 369 403 $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 } 370 419 } 371 420 … … 427 476 $icons_updated++; 428 477 } 429 478 430 479 } 431 480 } 432 481 433 482 $cache->destroy('_icons'); 434 483 $cache->destroy('sql', $table); 435 484 436 485 $level = E_USER_NOTICE; 437 486 switch ($icons_updated) … … 441 490 $level = E_USER_WARNING; 442 491 break; 443 492 444 493 case 1: 445 494 $suc_lang = "{$lang}_ONE"; 446 495 break; 447 496 448 497 default: 449 498 $suc_lang = $lang; … … 496 545 } 497 546 498 499 547 // The user has already selected a smilies_pak file 500 548 if ($current == 'delete') … … 540 588 } 541 589 $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 } 542 599 } 543 600 … … 836 893 837 894 $spacer = false; 895 $pagination_start = request_var('start', 0); 896 897 $item_count = $this->item_count($table); 838 898 839 899 $sql = "SELECT * 840 900 FROM $table 841 901 ORDER BY {$fields}_order ASC"; 842 $result = $db->sql_query ($sql);902 $result = $db->sql_query_limit($sql, $config['smilies_per_page'], $pagination_start); 843 903 844 904 while ($row = $db->sql_fetchrow($result)) … … 856 916 'U_EDIT' => $this->u_action . '&action=edit&id=' . $row[$fields . '_id'], 857 917 'U_DELETE' => $this->u_action . '&action=delete&id=' . $row[$fields . '_id'], 858 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row[$fields . '_id'] ,859 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row[$fields . '_id'] )860 ) ;918 'U_MOVE_UP' => $this->u_action . '&action=move_up&id=' . $row[$fields . '_id'] . '&start=' . $pagination_start, 919 'U_MOVE_DOWN' => $this->u_action . '&action=move_down&id=' . $row[$fields . '_id'] . '&start=' . $pagination_start, 920 )); 861 921 862 922 if (!$spacer && !$row['display_on_posting']) … … 866 926 } 867 927 $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; 868 951 } 869 952 } -
trunk/forum/includes/acp/acp_inactive.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_inactive.php 8598 2008-06-04 15:37:06Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2006 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 52 52 add_form_key($form_key); 53 53 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 54 67 if ($submit && sizeof($mark)) 55 68 { … … 68 81 WHERE ' . $db->sql_in_set('user_id', $mark); 69 82 $result = $db->sql_query($sql); 70 83 71 84 $user_affected = array(); 72 85 while ($row = $db->sql_fetchrow($result)) … … 78 91 if ($action == 'activate') 79 92 { 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); 96 106 97 107 user_active_flip('activate', $mark); … … 101 111 include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); 102 112 103 $messenger = new messenger( );113 $messenger = new messenger(false); 104 114 105 115 foreach ($inactive_users as $row) … … 112 122 $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); 113 123 $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); 124 $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); 114 125 115 126 $messenger->assign_vars(array( … … 122 133 $messenger->save_queue(); 123 134 } 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 . "&$u_sort_param&start=$start"; 147 $u_action .= ($per_page != $config['topics_per_page']) ? "&users_per_page=$per_page" : ''; 148 149 redirect($u_action); 124 150 } 125 151 else if ($action == 'delete') … … 162 188 $sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type, user_regdate, user_actkey 163 189 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 165 195 $result = $db->sql_query($sql); 166 196 … … 171 201 172 202 $messenger = new messenger(); 173 $usernames = array();203 $usernames = $user_ids = array(); 174 204 175 205 do … … 180 210 $messenger->im($row['user_jabber'], $row['username']); 181 211 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 182 217 $messenger->assign_vars(array( 183 218 '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), 185 220 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey']) 186 221 ); … … 189 224 190 225 $usernames[] = $row['username']; 226 $user_ids[] = (int) $row['user_id']; 191 227 } 192 228 while ($row = $db->sql_fetchrow($result)); 193 229 194 230 $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); 195 238 196 239 add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames)); … … 198 241 } 199 242 $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 . "&$u_sort_param&start=$start"; 246 $u_action .= ($per_page != $config['topics_per_page']) ? "&users_per_page=$per_page" : ''; 247 248 redirect($u_action); 249 201 250 break; 202 251 } 203 252 } 204 253 205 // Sorting206 $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 213 254 // Define where and sort sql for use in displaying logs 214 255 $sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0; … … 218 259 $inactive_count = 0; 219 260 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); 221 262 222 263 foreach ($inactive as $row) … … 224 265 $template->assign_block_vars('inactive', array( 225 266 'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), 267 'REMINDED_DATE' => $user->format_date($row['user_reminded_time']), 226 268 'JOINED' => $user->format_date($row['user_regdate']), 227 269 'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']), 270 228 271 'REASON' => $row['inactive_reason'], 229 272 'USER_ID' => $row['user_id'], 230 'USERNAME' => $row['username'], 231 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&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&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&mode=overview&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']}&sr=posts") : '', 284 )); 233 285 } 234 286 … … 246 298 'S_SORT_KEY' => $s_sort_key, 247 299 '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 . "&$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 . "&$u_sort_param&users_per_page=$per_page", $inactive_count, $per_page, $start, true), 302 'USERS_PER_PAGE' => $per_page, 303 251 304 'U_ACTION' => $this->u_action . '&start=' . $start, 252 305 )); -
trunk/forum/includes/acp/acp_jabber.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_jabber.php 8990 2008-10-09 15:41:19Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 45 45 $this->page_title = 'ACP_JABBER_SETTINGS'; 46 46 47 $jab_enable = request_var('jab_enable', 48 $jab_host = request_var('jab_host', 49 $jab_port = request_var('jab_port', 50 $jab_username = request_var('jab_username', 51 $jab_password = request_var('jab_password', 52 $jab_package_size = request_var('jab_package_size', 53 $jab_use_ssl = request_var('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']); 54 54 55 55 $form_name = 'acp_jabber'; … … 89 89 { 90 90 // 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. 92 93 $sql_ary = array( 93 94 'user_notify_type' => NOTIFY_BOTH, … … 117 118 'L_JAB_SERVER_EXPLAIN' => sprintf($user->lang['JAB_SERVER_EXPLAIN'], '<a href="http://www.jabber.org/">', '</a>'), 118 119 'JAB_HOST' => $jab_host, 119 'JAB_PORT' => $jab_port,120 'JAB_PORT' => ($jab_port) ? $jab_port : '', 120 121 'JAB_USERNAME' => $jab_username, 121 122 'JAB_PASSWORD' => $jab_password, -
trunk/forum/includes/acp/acp_language.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_language.php 8780 2008-08-22 12:52:48Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 767 767 } 768 768 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 } 791 804 break; 792 805 … … 1108 1121 while (($file = readdir($dp)) !== false) 1109 1122 { 1123 if (!is_dir($phpbb_root_path . 'language/' . $file)) 1124 { 1125 continue; 1126 } 1127 1110 1128 if ($file[0] != '.' && file_exists("{$phpbb_root_path}language/$file/iso.txt")) 1111 1129 { … … 1255 1273 1256 1274 $non_static = array_shift($keys); 1257 $value = array_shift($keys);1275 $value = utf8_normalize_nfc(array_shift($keys)); 1258 1276 1259 1277 if (!$non_static) -
trunk/forum/includes/acp/acp_logs.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_logs.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 34 34 $action = request_var('action', ''); 35 35 $forum_id = request_var('f', 0); 36 $topic_id = request_var('t', 0); 36 37 $start = request_var('start', 0); 37 38 $deletemark = (!empty($_POST['delmarked'])) ? true : false; … … 105 106 $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); 106 107 108 $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); 109 $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; 110 107 111 $l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS']; 108 112 $l_title_explain = $user->lang['ACP_' . strtoupper($mode) . '_LOGS_EXPLAIN']; … … 124 128 $log_data = array(); 125 129 $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); 127 131 128 132 $template->assign_vars(array( … … 132 136 133 137 'S_ON_PAGE' => on_page($log_count, $config['topics_per_page'], $start), 134 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param ", $log_count, $config['topics_per_page'], $start, true),138 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start, true), 135 139 136 140 'S_LIMIT_DAYS' => $s_limit_days, … … 138 142 'S_SORT_DIR' => $s_sort_dir, 139 143 'S_CLEARLOGS' => $auth->acl_get('a_clearlogs'), 144 'S_KEYWORDS' => $keywords, 140 145 ) 141 146 ); -
trunk/forum/includes/acp/acp_main.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_main.php 9171 2008-12-04 14:53:04Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 97 97 $confirm = true; 98 98 $confirm_lang = 'PURGE_CACHE_CONFIRM'; 99 break; 100 case 'purge_sessions': 101 $confirm = true; 102 $confirm_lang = 'PURGE_SESSIONS_CONFIRM'; 99 103 break; 100 104 … … 342 346 add_log('admin', 'LOG_PURGE_CACHE'); 343 347 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; 344 394 } 345 395 } 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&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 )); 346 424 } 347 425 … … 436 514 'TOTAL_ORPHAN' => $total_orphan, 437 515 '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'], 439 517 'DATABASE_INFO' => $db->sql_server_info(), 440 518 'BOARD_VERSION' => $config['version'], … … 443 521 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'), 444 522 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'), 523 'U_VERSIONCHECK' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=update&mode=version_check'), 524 'U_VERSIONCHECK_FORCE' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=1&versioncheck_force=1'), 445 525 446 526 'S_ACTION_OPTIONS' => ($auth->acl_get('a_board')) ? true : false, … … 469 549 if ($auth->acl_get('a_user')) 470 550 { 551 $user->add_lang('memberlist'); 552 471 553 $inactive = array(); 472 554 $inactive_count = 0; … … 478 560 $template->assign_block_vars('inactive', array( 479 561 'INACTIVE_DATE' => $user->format_date($row['user_inactive_time']), 562 'REMINDED_DATE' => $user->format_date($row['user_reminded_time']), 480 563 'JOINED' => $user->format_date($row['user_regdate']), 481 564 'LAST_VISIT' => (!$row['user_lastvisit']) ? ' - ' : $user->format_date($row['user_lastvisit']), 565 482 566 'REASON' => $row['inactive_reason'], 483 567 'USER_ID' => $row['user_id'], 484 'USERNAME' => $row['username'], 485 'U_USER_ADMIN' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=users&mode=overview&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&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&mode=overview&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']}&sr=posts") : '', 579 )); 487 580 } 488 581 … … 500 593 501 594 // 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')) 503 596 { 504 597 $template->assign_var('S_REMOVE_INSTALL', true); 505 598 } 506 599 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)) 508 601 { 509 602 // World-Writable? (000x) 510 603 $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)); 511 610 } 512 611 -
trunk/forum/includes/acp/acp_permissions.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_permissions.php 8710 2008-07-29 13:35:49Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 24 24 var $u_action; 25 25 var $permission_dropdown; 26 26 27 27 function main($id, $mode) 28 28 { … … 55 55 return; 56 56 } 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 57 72 trigger_error('NO_MODE', E_USER_ERROR); 58 73 } … … 95 110 $db->sql_freeresult($result); 96 111 } 97 112 98 113 // Map usernames to ids and vice versa 99 114 if ($usernames) … … 113 128 } 114 129 unset($username); 115 130 116 131 // Build forum ids (of all forums are checked or subforum listing used) 117 132 if ($all_forums) … … 218 233 } 219 234 220 221 235 // Handle actions 222 236 if (strpos($mode, 'setting_') === 0 && $action) … … 225 239 { 226 240 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) 241 248 { 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 } 243 259 } 244 else if ($all_groups && sizeof($items['group_ids'])) 260 261 if (sizeof($user_id) || sizeof($group_id)) 245 262 { 246 $ group_id = $items['group_ids'];263 $this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id); 247 264 } 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 } 253 269 } 254 270 else 255 271 { 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 . '&type=' . $permission_type; 275 foreach ($forum_id as $fid) 276 { 277 $u_redirect .= '&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)); 257 300 } 258 301 break; … … 529 572 continue; 530 573 } 531 574 532 575 if ($branch_there) 533 576 { … … 540 583 return $s_options; 541 584 } 542 585 543 586 /** 544 587 * Build dropdown field for changing permission types … … 547 590 { 548 591 global $user, $auth; 549 592 550 593 $s_dropdown_options = ''; 551 594 foreach ($options as $setting) … … 627 670 trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); 628 671 } 629 672 630 673 $ug_id = $forum_id = 0; 631 674 … … 763 806 $this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids); 764 807 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 . '&forum_id[]=' . implode('&forum_id[]=', $forum_ids))); 811 } 812 else 813 { 814 trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); 815 } 766 816 } 767 817 … … 810 860 { 811 861 global $user, $db, $auth; 812 862 813 863 // User or group to be set? 814 864 $ug_type = (sizeof($user_id)) ? 'user' : 'group'; … … 830 880 $this->log_action($mode, 'del', $permission_type, $ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : array(0 => 0))); 831 881 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 . '&forum_id[]=' . implode('&forum_id[]=', $forum_id))); 885 } 886 else 887 { 888 trigger_error($user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); 889 } 833 890 } 834 891 … … 950 1007 WHERE ug.user_id = ' . $user_id . ' 951 1008 AND ug.user_pending = 0 1009 AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) 952 1010 ORDER BY g.group_type DESC, g.group_id DESC'; 953 1011 $result = $db->sql_query($sql); … … 1111 1169 1112 1170 /** 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 /** 1113 1222 * Get already assigned users/groups 1114 1223 */ … … 1151 1260 $sql_where = 'AND (' . $db->sql_in_set('a.auth_option_id', $option_ids) . ' OR ' . $db->sql_in_set('a.auth_role_id', $role_ids) . ')'; 1152 1261 } 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)) 1154 1267 { 1155 1268 $sql_where = 'AND ' . $db->sql_in_set('a.auth_option_id', $option_ids); -
trunk/forum/includes/acp/acp_profile.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_profile.php 9127 2008-11-26 19:58:35Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 370 370 'field_no_view' => 0, 371 371 'field_show_on_reg' => 0, 372 'field_show_on_vt' => 0, 372 373 'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)), 373 374 'lang_explain' => '', … … 380 381 // $exclude contains the data we gather in each step 381 382 $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'), 383 384 2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'), 384 385 3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options') … … 406 407 'field_required', 407 408 'field_show_on_reg', 409 'field_show_on_vt', 408 410 'field_show_profile', 409 411 'field_hide', … … 508 510 $var = request_var('field_default_value', 0); 509 511 }*/ 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 } 510 520 511 521 $cp->vars[$key] = $var; … … 722 732 'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false, 723 733 '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, 724 735 'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false, 725 736 'S_SHOW_PROFILE' => ($cp->vars['field_show_profile']) ? true : false, … … 923 934 case FIELD_TEXT: 924 935 case FIELD_STRING: 925 if ( $cp->vars['lang_default_value'])936 if (strlen($cp->vars['lang_default_value'])) 926 937 { 927 938 $options['lang_default_value'] = ($field_type == FIELD_STRING) ? 'string' : 'text'; … … 1037 1048 'field_required' => $cp->vars['field_required'], 1038 1049 'field_show_on_reg' => $cp->vars['field_show_on_reg'], 1050 'field_show_on_vt' => $cp->vars['field_show_on_vt'], 1039 1051 'field_hide' => $cp->vars['field_hide'], 1040 1052 'field_show_profile' => $cp->vars['field_show_profile'], … … 1540 1552 1541 1553 // 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) . '" '; 1543 1555 1544 1556 switch ($field_type) -
trunk/forum/includes/acp/acp_prune.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_prune.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 407 407 $where_sql .= ($count !== '') ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : ''; 408 408 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') 410 415 { 411 416 $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 3 3 * 4 4 * @package acp 5 * @version $Id : acp_ranks.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 40 40 $this->page_title = 'ACP_MANAGE_RANKS'; 41 41 42 $form_name = 'acp_ prune';42 $form_name = 'acp_ranks'; 43 43 add_form_key($form_name); 44 44 … … 169 169 $img = $path . $img; 170 170 171 if ( !in_array($img, $existing_imgs) || $action == 'edit')171 if ($ranks && $img == $ranks['rank_image']) 172 172 { 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; 189 175 } 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>'; 190 187 } 191 188 } -
trunk/forum/includes/acp/acp_search.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_search.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 64 64 'limit_search_load' => 'float', 65 65 'min_search_author_chars' => 'integer', 66 'max_num_search_keywords' => 'integer', 66 67 'search_store_results' => 'integer', 67 68 ); … … 217 218 'SEARCH_GUEST_INTERVAL' => (float) $config['search_anonymous_interval'], 218 219 'SEARCH_STORE_RESULTS' => (int) $config['search_store_results'], 220 'MAX_NUM_SEARCH_KEYWORDS' => (int) $config['max_num_search_keywords'], 219 221 220 222 'S_SEARCH_TYPES' => $search_options, … … 592 594 ksort($this->state); 593 595 594 set_config('search_indexing_state', implode(',', $this->state) );596 set_config('search_indexing_state', implode(',', $this->state), true); 595 597 } 596 598 -
trunk/forum/includes/acp/acp_styles.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_styles.php 9152 2008-12-02 16:49:59Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 38 38 $bitfield = new bitfield(); 39 39 $bitfield->set(0); 40 $bitfield->set(1); 41 $bitfield->set(2); 40 42 $bitfield->set(3); 43 $bitfield->set(4); 41 44 $bitfield->set(8); 42 45 $bitfield->set(9); … … 208 211 } 209 212 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') 217 214 { 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; 221 218 $db->sql_query($sql); 222 219 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)); 227 243 } 228 244 break; … … 628 644 while (($file = readdir($dp)) !== false) 629 645 { 646 if (!is_dir($phpbb_root_path . 'styles/' . $file)) 647 { 648 continue; 649 } 650 630 651 $subpath = ($mode != 'style') ? "$mode/" : ''; 631 652 if ($file[0] != '.' && file_exists("{$phpbb_root_path}styles/$file/$subpath$mode.cfg")) … … 732 753 if (!($fp = @fopen($file, 'wb'))) 733 754 { 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); 735 757 } 736 758 fwrite($fp, $template_data); … … 744 766 if (!$template_info['template_storedb']) 745 767 { 746 if ($ this->get_super('template', $template_id))768 if ($super = $this->get_super('template', $template_id)) 747 769 { 748 770 $this->store_in_db('template', $super['template_id']); … … 825 847 } 826 848 849 if (empty($filelist[''])) 850 { 851 trigger_error($user->lang['NO_TEMPLATE'] . adm_back_link($this->u_action), E_USER_WARNING); 852 } 853 827 854 // Now create the categories 828 855 $filelist_cats[''] = array(); … … 1022 1049 foreach ($file_ary as $file) 1023 1050 { 1024 $file 1051 $file = str_replace('/', '.', $file); 1025 1052 1026 1053 // perform some dirty guessing to get the path right. 1027 1054 // We assume that three dots in a row were '../' 1028 $tpl_file 1029 $tpl_file 1055 $tpl_file = str_replace('.', '/', $file); 1056 $tpl_file = str_replace('///', '../', $tpl_file); 1030 1057 1031 1058 $filename = "{$cache_prefix}_$file.html.$phpEx"; … … 1059 1086 } 1060 1087 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 } 1061 1093 1062 1094 $template->assign_block_vars('file', array( … … 1066 1098 'FILENAME' => $file, 1067 1099 '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")), 1069 1101 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime($file_tpl) : $filemtime[$file . '.html'])) 1070 1102 ); … … 1264 1296 } 1265 1297 1266 1267 1298 /** 1268 1299 * Edit imagesets … … 1276 1307 $this->page_title = 'EDIT_IMAGESET'; 1277 1308 1309 if (!$imageset_id) 1310 { 1311 trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($this->u_action), E_USER_WARNING); 1312 } 1313 1278 1314 $update = (isset($_POST['update'])) ? true : false; 1279 1315 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'); 1286 1317 $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; 1411 1446 } 1412 1447 … … 1530 1565 'NAME' => $imageset_name, 1531 1566 'A_NAME' => addslashes($imageset_name), 1567 'PATH' => $imageset_path, 1568 'A_PATH' => addslashes($imageset_path), 1532 1569 'ERROR' => !$valid_name, 1533 1570 'IMG_SRC' => ($image_found) ? '../styles/' . $imageset_path . '/imageset/' . $img_val : 'images/no_image.png', … … 2396 2433 } 2397 2434 2398 2399 2435 if ($mode == 'template') 2400 2436 { … … 2527 2563 trigger_error("Could not open {$phpbb_root_path}styles/$template_path$pathfile$file", E_USER_ERROR); 2528 2564 } 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 2530 2573 fclose($fp); 2574 2575 if (!$filesize) 2576 { 2577 // File is empty 2578 continue; 2579 } 2531 2580 2532 2581 if (preg_match_all('#<!-- INCLUDE (.*?\.html) -->#is', $template_data, $matches)) … … 3196 3245 $db->sql_freeresult($result); 3197 3246 3198 3199 3247 if ($row) 3200 3248 { … … 3211 3259 if (isset($cfg_data['inherit_from']) && $cfg_data['inherit_from']) 3212 3260 { 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 3214 3271 FROM $sql_from 3215 3272 WHERE {$mode}_name = '" . $db->sql_escape($cfg_data['inherit_from']) . "' … … 3226 3283 $inherit_id = $row["{$mode}_id"]; 3227 3284 $inherit_path = $row["{$mode}_path"]; 3285 $inherit_bf = ($mode === 'template') ? $row["bbcode_bitfield"] : false; 3228 3286 $cfg_data['store_db'] = $row["{$mode}_storedb"]; 3229 3287 $store_db = $row["{$mode}_storedb"]; … … 3234 3292 $inherit_id = 0; 3235 3293 $inherit_path = ''; 3236 }3237 3294 $inherit_bf = false; 3295 } 3238 3296 3239 3297 if (sizeof($error)) … … 3255 3313 { 3256 3314 $sql_ary['bbcode_bitfield'] = $cfg_data['template_bitfield']; 3315 } 3316 else if ($inherit_bf) 3317 { 3318 $sql_ary['bbcode_bitfield'] = $inherit_bf; 3257 3319 } 3258 3320 else … … 3502 3564 } 3503 3565 3504 3505 3566 $sql = "SELECT {$mode}_inherits_id 3506 3567 FROM $sql_from -
trunk/forum/includes/acp/acp_update.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_update.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 38 38 $errno = 0; 39 39 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); 41 41 42 42 if ($info === false) 43 43 { 44 trigger_error( $errstr, E_USER_WARNING);44 trigger_error('VERSIONCHECK_FAIL', E_USER_WARNING); 45 45 } 46 46 … … 49 49 50 50 $announcement_url = trim($info[1]); 51 $announcement_url = (strpos($announcement_url, '&') === false) ? str_replace('&', '&', $announcement_url) : $announcement_url; 51 52 $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update'); 52 53 … … 69 70 'S_VERSION_CHECK' => true, 70 71 'U_ACTION' => $this->u_action, 72 'U_VERSIONCHECK_FORCE' => append_sid($this->u_action . '&versioncheck_force=1'), 71 73 72 74 'LATEST_VERSION' => $latest_version, -
trunk/forum/includes/acp/acp_users.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_users.php 8831 2008-09-05 19:02:36Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 386 386 user_active_flip('flip', $user_id); 387 387 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 388 413 $message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED'; 389 414 $log = ($user_row['user_type'] == USER_INACTIVE) ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE'; … … 494 519 } 495 520 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 . '&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 } 496 571 break; 497 572 … … 651 726 652 727 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 . '&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; 653 750 } 654 751 … … 776 873 $sql_ary += array( 777 874 'user_email' => $update_email, 778 'user_email_hash' => crc32($update_email) . strlen($update_email)875 'user_email_hash' => phpbb_email_hash($update_email), 779 876 ); 780 877 … … 821 918 if ($user_id == $user->data['user_id']) 822 919 { 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 } 824 925 } 825 926 else … … 837 938 } 838 939 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'); 840 941 841 942 if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE)) 842 943 { 843 944 $quick_tool_ary['reactivate'] = 'FORCE'; 945 } 946 947 if ($user_row['user_new']) 948 { 949 $quick_tool_ary['leave_nr'] = 'LEAVE_NR'; 844 950 } 845 951 } … … 918 1024 'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '', 919 1025 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&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&u={$user_row['user_id']}&hash=" . generate_link_hash('switchperm')) : '', 921 1027 922 1028 'POSTS_IN_QUEUE' => $user_row['posts_in_queue'], … … 973 1079 $sql = 'DELETE FROM ' . LOG_TABLE . ' 974 1080 WHERE log_type = ' . LOG_USERS . " 1081 AND reportee_id = $user_id 975 1082 $where_sql"; 976 1083 $db->sql_query($sql); … … 1032 1139 ); 1033 1140 } 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 )); 1034 1289 1035 1290 break; … … 1136 1391 1137 1392 // 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); 1185 1394 1186 1395 trigger_error($user->lang['USER_PROFILE_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); … … 1208 1417 $now = getdate(); 1209 1418 $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++) 1211 1420 { 1212 1421 $selected = ($i == $data['bday_year']) ? ' selected="selected"' : ''; … … 1475 1684 } 1476 1685 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 1477 1697 // 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="" />'; 1479 1699 1480 1700 $display_gallery = (isset($_POST['display_gallery'])) ? true : false; … … 1489 1709 $template->assign_vars(array( 1490 1710 '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, 1495 1717 1496 1718 'AVATAR_IMAGE' => $avatar_img, … … 1550 1772 include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); 1551 1773 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; 1555 1777 $signature = utf8_normalize_nfc(request_var('signature', (string) $user_row['user_sig'], true)); 1556 1778 … … 1560 1782 { 1561 1783 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; 1562 1788 1563 1789 $message_parser = new parse_message($signature); … … 1578 1804 if (!sizeof($error) && $submit) 1579 1805 { 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 1580 1810 $sql_ary = array( 1581 1811 'user_sig' => (string) $message_parser->message, 1812 'user_options' => $user_row['user_options'], 1582 1813 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid, 1583 1814 'user_sig_bbcode_bitfield' => (string) $message_parser->bbcode_bitfield … … 1847 2078 1848 2079 $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); 1849 2090 } 1850 2091 else … … 1860 2101 1861 2102 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 . '&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; 1862 2126 } 1863 2127 … … 1952 2216 'U_DEMOTE_PROMOTE' => $this->u_action . '&action=' . (($data['group_leader']) ? 'demote' : 'promote') . "&u=$user_id&g=" . $data['group_id'], 1953 2217 'U_DELETE' => $this->u_action . "&action=delete&u=$user_id&g=" . $data['group_id'], 2218 'U_APPROVE' => ($group_type == 'pending') ? $this->u_action . "&action=approve&u=$user_id&g=" . $data['group_id'] : '', 1954 2219 1955 2220 'GROUP_NAME' => ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name'], 1956 2221 'L_DEMOTE_PROMOTE' => ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE'], 1957 2222 2223 'S_IS_MEMBER' => ($group_type != 'pending') ? true : false, 1958 2224 'S_NO_DEFAULT' => ($user_row['group_id'] != $data['group_id']) ? true : false, 1959 2225 'S_SPECIAL_GROUP' => ($group_type == 'special') ? true : false, -
trunk/forum/includes/acp/acp_words.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_words.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 24 24 { 25 25 var $u_action; 26 26 27 27 function main($id, $mode) 28 28 { … … 48 48 { 49 49 case 'edit': 50 50 51 $word_id = request_var('id', 0); 51 52 52 53 if (!$word_id) 53 54 { … … 74 75 'S_HIDDEN_FIELDS' => $s_hidden_fields) 75 76 ); 76 77 77 78 return; 78 79 … … 85 86 trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING); 86 87 } 88 87 89 $word_id = request_var('id', 0); 88 90 $word = utf8_normalize_nfc(request_var('word', '', true)); 89 91 $replacement = utf8_normalize_nfc(request_var('replacement', '', true)); 90 91 if ( !$word || !$replacement)92 93 if ($word === '' || $replacement === '') 92 94 { 93 95 trigger_error($user->lang['ENTER_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); -
trunk/forum/includes/acp/auth.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : auth.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 59 59 } 60 60 } 61 61 62 62 /** 63 63 * Get permission mask … … 141 141 } 142 142 143 143 144 144 $hold_ary[$userdata['user_id']] = array(); 145 145 foreach ($forum_ids as $f_id) … … 346 346 // Build js roles array (role data assignments) 347 347 $s_role_js_array = ''; 348 348 349 349 if (sizeof($roles)) 350 350 { … … 697 697 $cur_options = array(); 698 698 699 // Determine current options 699 700 $sql = 'SELECT auth_option, is_global, is_local 700 701 FROM ' . ACL_OPTIONS_TABLE . ' … … 704 705 while ($row = $db->sql_fetchrow($result)) 705 706 { 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'); 715 708 } 716 709 $db->sql_freeresult($result); … … 727 720 foreach ($option_ary as $option_value) 728 721 { 729 if (!in_array($option_value, $cur_options[$type])) 730 { 731 $new_options[$type][] = $option_value; 732 } 722 $new_options[$type][] = $option_value; 733 723 734 724 $flag = substr($option_value, 0, strpos($option_value, '_') + 1); 735 725 736 if (!in_array($flag, $ cur_options[$type]) && !in_array($flag, $new_options[$type]))726 if (!in_array($flag, $new_options[$type])) 737 727 { 738 728 $new_options[$type][] = $flag; … … 745 735 $options['local'] = array_diff($new_options['local'], $new_options['global']); 746 736 $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... 751 743 foreach ($options as $type => $option_ary) 752 744 { 753 745 foreach ($option_ary as $option) 754 746 { 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 } 764 784 765 785 $cache->destroy('_acl_options'); … … 803 823 $flag = key($auth); 804 824 $flag = substr($flag, 0, strpos($flag, '_') + 1); 805 825 806 826 // This ID (the any-flag) is set if one or more permissions are true... 807 827 $any_option_id = (int) $this->acl_options['id'][$flag]; … … 917 937 $flag = key($auth); 918 938 $flag = substr($flag, 0, strpos($flag, '_') + 1); 919 939 920 940 // Remove any-flag from auth ary 921 941 if (isset($auth[$flag])) … … 1068 1088 $where_sql[] = $db->sql_in_set('auth_option_id', array_map('intval', $option_id_ary)); 1069 1089 } 1070 1090 1071 1091 $sql = "DELETE FROM $table 1072 1092 WHERE " . implode(' AND ', $where_sql); … … 1091 1111 'S_NEVER' => ($cat_array['S_NEVER'] && !$cat_array['S_YES'] && !$cat_array['S_NO']) ? true : false, 1092 1112 'S_NO' => ($cat_array['S_NO'] && !$cat_array['S_NEVER'] && !$cat_array['S_YES']) ? true : false, 1093 1113 1094 1114 'CAT_NAME' => $user->lang['permission_cat'][$cat]) 1095 1115 ); … … 1180 1200 ); 1181 1201 } 1182 1202 1183 1203 $cat = $user->lang['acl_' . $permission]['cat']; 1184 1204 1185 1205 // Build our categories array 1186 1206 if (!isset($categories[$cat])) -
trunk/forum/includes/acp/info/acp_board.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_board.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 27 27 'post' => array('title' => 'ACP_POST_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), 28 28 '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')), 29 30 'registration' => array('title' => 'ACP_REGISTER_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')), 30 31 -
trunk/forum/includes/acp/info/acp_permissions.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : acp_permissions.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 25 25 26 26 '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')), 27 28 'setting_mod_local' => array('title' => 'ACP_FORUM_MODERATORS', 'auth' => 'acl_a_mauth && (acl_a_authusers || acl_a_authgroups)', 'cat' => array('ACP_FORUM_BASED_PERMISSIONS')), 28 29 '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 3 3 * 4 4 * @package acp 5 * @version $Id : acp_users.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 23 23 'overview' => array('title' => 'ACP_MANAGE_USERS', 'auth' => 'acl_a_user', 'cat' => array('ACP_CAT_USERS')), 24 24 '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')), 25 26 'profile' => array('title' => 'ACP_USER_PROFILE', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), 26 27 'prefs' => array('title' => 'ACP_USER_PREFS', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')), -
trunk/forum/includes/auth.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : auth.php 8985 2008-10-09 13:18:38Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 65 65 66 66 $cache->put('_acl_options', $this->acl_options); 67 $this->acl_cache($userdata);68 } 69 elseif (!trim($userdata['user_permissions']))67 } 68 69 if (!trim($userdata['user_permissions'])) 70 70 { 71 71 $this->acl_cache($userdata); … … 609 609 // Now grab group settings - non-role specific... 610 610 $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 . ' 612 612 WHERE a.auth_role_id = 0 ' . 613 613 (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') . ' 614 614 AND a.group_id = ug.group_id 615 AND g.group_id = ug.group_id 615 616 AND ug.user_pending = 0 617 AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) 616 618 ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " 617 619 $sql_forum … … 620 622 // Now grab group settings - role specific... 621 623 $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 . ' 623 625 WHERE a.auth_role_id = r.role_id ' . 624 626 (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') . ' 625 627 AND a.group_id = ug.group_id 628 AND g.group_id = ug.group_id 626 629 AND ug.user_pending = 0 630 AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) 627 631 ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " 628 632 $sql_forum … … 826 830 // Now grab group-specific permission settings 827 831 $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 829 833 WHERE a.group_id = ug.group_id 834 AND g.group_id = ug.group_id 830 835 AND ug.user_pending = 0 836 AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1) 831 837 AND ug.user_id = ' . $user_id; 832 838 $result = $db->sql_query($sql); -
trunk/forum/includes/auth/auth_apache.php
r400 r702 6 6 * 7 7 * @package login 8 * @version $Id : auth_apache.php 8602 2008-06-04 16:05:27Z naderman$8 * @version $Id$ 9 9 * @copyright (c) 2005 phpBB Group 10 10 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 105 105 ); 106 106 } 107 107 108 108 // Successful login... 109 109 return array( … … 218 218 'user_type' => USER_NORMAL, 219 219 'user_ip' => $user->ip, 220 'user_new' => ($config['new_member_post_limit']) ? 1 : 0, 220 221 ); 221 222 } … … 228 229 function validate_session_apache(&$user) 229 230 { 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; 239 247 } 240 248 -
trunk/forum/includes/auth/auth_db.php
r400 r702 8 8 * 9 9 * @package login 10 * @version $Id : auth_db.php 8479 2008-03-29 00:22:48Z naderman$10 * @version $Id$ 11 11 * @copyright (c) 2005 phpBB Group 12 12 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 63 63 ); 64 64 } 65 $show_captcha = $config['max_login_attempts'] && $row['user_login_attempts'] >= $config['max_login_attempts']; 65 66 66 67 // If there are too much login attempts, we need to check for an confirm image 67 68 // 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 { 73 71 // 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) 75 82 { 76 83 return array( … … 82 89 else 83 90 { 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 123 94 } 124 95 … … 142 113 143 114 // 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']))) 145 118 { 146 119 $hash = phpbb_hash($password_new_format); … … 227 200 // Give status about wrong password... 228 201 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', 231 204 'user_row' => $row, 232 205 ); -
trunk/forum/includes/auth/auth_ldap.php
r400 r702 7 7 * 8 8 * @package login 9 * @version $Id : auth_ldap.php 8479 2008-03-29 00:22:48Z naderman$9 * @version $Id$ 10 10 * @copyright (c) 2005 phpBB Group 11 11 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 64 64 $search = @ldap_search( 65 65 $ldap, 66 $config['ldap_base_dn'],66 htmlspecialchars_decode($config['ldap_base_dn']), 67 67 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'])), 69 71 0, 70 72 1 … … 86 88 } 87 89 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'])])) 89 91 { 90 92 return $user->lang['LDAP_NO_EMAIL']; … … 153 155 if ($config['ldap_user'] || $config['ldap_password']) 154 156 { 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']))) 156 158 { 157 159 return $user->lang['LDAP_NO_SERVER_CONNECTION']; … … 161 163 $search = @ldap_search( 162 164 $ldap, 163 $config['ldap_base_dn'],165 htmlspecialchars_decode($config['ldap_base_dn']), 164 166 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'])), 166 170 0, 167 171 1 … … 224 228 'username' => $username, 225 229 '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]) : '', 227 231 'group_id' => (int) $row['group_id'], 228 232 'user_type' => USER_NORMAL, 229 233 'user_ip' => $user->ip, 234 'user_new' => ($config['new_member_post_limit']) ? 1 : 0, 230 235 ); 231 236 … … 277 282 if ($config['ldap_user_filter']) 278 283 { 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})"; 280 286 } 281 287 return $filter; -
trunk/forum/includes/bbcode.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : bbcode.php 8953 2008-09-28 17:08:09Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 129 129 function bbcode_cache_init() 130 130 { 131 global $ user, $phpbb_root_path;131 global $phpbb_root_path, $template, $user; 132 132 133 133 if (empty($this->template_filename)) … … 135 135 $this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']); 136 136 $this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html'; 137 137 138 138 if (!@file_exists($this->template_filename)) 139 139 { … … 266 266 $this->bbcode_cache[$bbcode_id] = array( 267 267 '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), 269 269 ) 270 270 ); … … 361 361 // to replace all {VARS} to corresponding backreferences 362 362 // Note that backreferences are numbered from bbcode_match 363 if (preg_match_all('/\{(URL|LOCAL_URL|EMAIL|TEXT|SIMPLETEXT|I DENTIFIER|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)) 364 364 { 365 365 foreach ($m[0] as $i => $tok) … … 411 411 { 412 412 global $user; 413 413 414 414 $bbcode_hardtpl = array( 415 415 'b_open' => '<span style="font-weight: bold">', … … 529 529 { 530 530 $tpl = 'olist_open'; 531 $type = ' arabic-numbers';531 $type = 'decimal'; 532 532 } 533 533 else 534 534 { 535 535 $tpl = 'olist_open'; 536 $type = ' arabic-numbers';536 $type = 'decimal'; 537 537 } 538 538 -
trunk/forum/includes/cache.php
r400 r702 3 3 * 4 4 * @package acm 5 * @version $Id : cache.php 8691 2008-07-28 13:26:20Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 85 85 while ($row = $db->sql_fetchrow($result)) 86 86 { 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 88 96 $censors['replace'][] = $row['replacement']; 89 97 } -
trunk/forum/includes/captcha/captcha_gd.php
r400 r702 3 3 * 4 4 * @package VC 5 * @version $Id : captcha_gd.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2006 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 28 28 var $height = 96; 29 29 30 30 31 /** 31 32 * Create the image containing $code with a seed of $seed … … 34 35 { 35 36 global $config; 36 srand($seed);37 37 38 mt_srand($seed); 38 39 … … 53 54 54 55 // Generate code characters 55 $characters = $sizes = $bounding_boxes = array();56 $characters = $sizes = $bounding_boxes = $noise = array(); 56 57 $width_avail = $this->width - 15; 57 58 $code_len = strlen($code); 58 59 59 $captcha_bitmaps = $this->captcha_bitmaps(); 60 60 61 for ($i = 0; $i < $code_len; ++$i) 61 62 { … … 70 71 } 71 72 73 72 74 // Redistribute leftover x-space 73 75 $offset = array(); … … 99 101 } 100 102 } 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 } 102 131 $xoffset = 5; 103 132 for ($i = 0; $i < $code_len; ++$i) … … 110 139 $xoffset += $dimm[2]; 111 140 } 112 141 if ($config['captcha_gd_wave']) 142 { 143 $this->wave($img); 144 } 113 145 if ($config['captcha_gd_foreground_noise']) 114 146 { 115 147 $this->noise_line($img, 0, 0, $this->width, $this->height, $colour->get_resource('background'), $scheme, $bg_colours); 116 148 } 117 118 149 // Send image 119 150 header('Content-Type: image/png'); … … 124 155 125 156 /** 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 /** 126 189 * Noise line 127 190 */ … … 172 235 } 173 236 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 174 297 /** 175 298 * Return bitmaps … … 177 300 function captcha_bitmaps() 178 301 { 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 ); 179 1667 return array( 180 1668 'width' => 9, … … 182 1670 'data' => array( 183 1671 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 626 1699 '1' => array( 627 1700 array(0,0,0,1,1,0,0,0,0), -
trunk/forum/includes/constants.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : constants.php 9187 2008-12-12 14:47:03Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 26 26 27 27 // phpBB Version 28 define('PHPBB_VERSION', '3.0. 4');28 define('PHPBB_VERSION', '3.0.7-PL1'); 29 29 30 30 // QA-related … … 92 92 define('FORUM_FLAG_ACTIVE_TOPICS', 16); 93 93 define('FORUM_FLAG_POST_REVIEW', 32); 94 define('FORUM_FLAG_QUICK_REPLY', 64); 95 96 // Forum Options... sequential order. Modifications should begin at number 10 (number 29 is maximum) 97 define('FORUM_OPTION_FEED_NEWS', 1); 98 define('FORUM_OPTION_FEED_EXCLUDE', 2); 94 99 95 100 // Optional text flags … … 161 166 define('NUM_CORE_BBCODES', 12); 162 167 168 // Smiley hard limit 169 define('SMILEY_LIMIT', 1000); 170 163 171 // Magic url types 164 172 define('MAGIC_URL_EMAIL', 1); … … 185 193 @define('CHMOD_WRITE', 2); 186 194 @define('CHMOD_EXECUTE', 1); 195 196 // Captcha code length 197 define('CAPTCHA_MIN_CHARS', 4); 198 define('CAPTCHA_MAX_CHARS', 7); 187 199 188 200 // Additional constants -
trunk/forum/includes/db/db_tools.php
r400 r702 3 3 * 4 4 * @package dbal 5 * @version $Id : db_tools.php 8814 2008-09-04 12:01:47Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2007 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 31 31 var $sql_layer = ''; 32 32 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 */ 33 42 var $dbms_type_map = array( 34 43 'mysql_41' => array( … … 243 252 ); 244 253 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 */ 246 258 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 */ 247 264 var $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite'); 248 265 249 266 /** 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. 251 269 */ 252 270 var $return_statements = false; 253 271 254 272 /** 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) 257 279 { 258 280 $this->db = $db; 281 $this->return_statements = $return_statements; 259 282 260 283 // Determine mapping database type … … 289 312 break; 290 313 } 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); 291 564 } 292 565 … … 309 582 * ) 310 583 * 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) 312 585 */ 313 586 function perform_schema_changes($schema_changes) … … 319 592 320 593 $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 } 321 602 322 603 // Change columns? … … 327 608 foreach ($columns as $column_name => $column_data) 328 609 { 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) 332 632 { 333 633 $statements = array_merge($statements, $result); … … 344 644 foreach ($columns as $column_name => $column_data) 345 645 { 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) 352 709 { 353 710 $statements = array_merge($statements, $result); … … 358 715 } 359 716 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 394 717 // Add primary keys? 395 718 if (!empty($schema_changes['add_primary_keys'])) … … 397 720 foreach ($schema_changes['add_primary_keys'] as $table => $columns) 398 721 { 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) 402 729 { 403 730 $statements = array_merge($statements, $result); … … 440 767 } 441 768 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 442 910 if ($this->return_statements) 443 911 { … … 448 916 /** 449 917 * 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 * 450 922 * @return bool True if column exists, else false 451 923 */ … … 520 992 $sql = "SELECT column_name 521 993 FROM user_tab_columns 522 WHERE table_name = '{$table}'";994 WHERE LOWER(table_name) = '" . strtolower($table) . "'"; 523 995 $result = $this->db->sql_query($sql); 524 996 while ($row = $this->db->sql_fetchrow($result)) … … 538 1010 $sql = "SELECT RDB\$FIELD_NAME as FNAME 539 1011 FROM RDB\$RELATION_FIELDS 540 WHERE RDB\$RELATION_NAME = ' {$table}'";1012 WHERE RDB\$RELATION_NAME = '" . strtoupper($table) . "'"; 541 1013 $result = $this->db->sql_query($sql); 542 1014 while ($row = $this->db->sql_fetchrow($result)) … … 633 1105 { 634 1106 list($orig_column_type, $column_length) = explode(':', $column_data[0]); 635 636 1107 if (!is_array($this->dbms_type_map[$this->sql_layer][$orig_column_type . ':'])) 637 1108 { … … 692 1163 case 'firebird': 693 1164 $sql .= " {$column_type} "; 1165 $return_array['column_type_sql_type'] = " {$column_type} "; 694 1166 695 1167 if (!is_null($column_data[1])) 696 1168 { 697 1169 $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]}'") . ' '; 698 1171 } 699 1172 … … 704 1177 { 705 1178 $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; 706 1185 } 707 1186 … … 718 1197 if (strpos($column_data[1], '0x') === 0) 719 1198 { 720 $sql_default .= 'DEFAULT (' . $column_data[1] . ') '; 1199 $return_array['default'] = 'DEFAULT (' . $column_data[1] . ') '; 1200 $sql_default .= $return_array['default']; 721 1201 } 722 1202 else 723 1203 { 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]'; 727 1216 728 1217 $sql .= 'NOT NULL'; … … 730 1219 731 1220 $return_array['column_type_sql_default'] = $sql_default; 1221 732 1222 break; 733 1223 … … 764 1254 // Therefore in oracle we allow NULL's for all DEFAULT '' entries 765 1255 // 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)) 767 1257 { 768 1258 $sql .= ($column_data[1] === '') ? '' : 'NOT NULL'; 769 1259 } 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 770 1267 break; 771 1268 … … 775 1272 $sql .= " {$column_type} "; 776 1273 1274 $return_array['auto_increment'] = false; 777 1275 if (isset($column_data[2]) && $column_data[2] == 'auto_increment') 778 1276 { 779 1277 $default_val = "nextval('{$table_name}_seq')"; 1278 $return_array['auto_increment'] = true; 780 1279 } 781 1280 else if (!is_null($column_data[1])) … … 796 1295 $sql .= " CHECK ({$column_name} >= 0)"; 797 1296 } 1297 798 1298 break; 799 1299 800 1300 case 'sqlite': 1301 $return_array['primary_key_set'] = false; 801 1302 if (isset($column_data[2]) && $column_data[2] == 'auto_increment') 802 1303 { 803 1304 $sql .= ' INTEGER PRIMARY KEY'; 1305 $return_array['primary_key_set'] = true; 804 1306 } 805 1307 else … … 810 1312 $sql .= ' NOT NULL '; 811 1313 $sql .= (!is_null($column_data[1])) ? "DEFAULT '{$column_data[1]}'" : ''; 1314 812 1315 break; 813 1316 } … … 821 1324 * Add new column 822 1325 */ 823 function sql_column_add($table_name, $column_name, $column_data )1326 function sql_column_add($table_name, $column_name, $column_data, $inline = false) 824 1327 { 825 1328 $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data); … … 829 1332 { 830 1333 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']; 832 1335 break; 833 1336 … … 846 1349 847 1350 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 849 1374 break; 850 1375 851 1376 case 'sqlite': 1377 1378 if ($inline && $this->return_statements) 1379 { 1380 return $column_name . ' ' . $column_data['column_type_sql']; 1381 } 1382 852 1383 if (version_compare(sqlite_libversion(), '3.0') == -1) 853 1384 { … … 914 1445 * Drop column 915 1446 */ 916 function sql_column_remove($table_name, $column_name )1447 function sql_column_remove($table_name, $column_name, $inline = false) 917 1448 { 918 1449 $statements = array(); … … 921 1452 { 922 1453 case 'firebird': 923 $statements[] = 'ALTER TABLE "' . $table_name . '" DROP "' . $column_name. '"';1454 $statements[] = 'ALTER TABLE ' . $table_name . ' DROP "' . strtoupper($column_name) . '"'; 924 1455 break; 925 1456 … … 942 1473 943 1474 case 'sqlite': 1475 1476 if ($inline && $this->return_statements) 1477 { 1478 return $column_name; 1479 } 1480 944 1481 if (version_compare(sqlite_libversion(), '3.0') == -1) 945 1482 { … … 984 1521 $columns = implode(',', $column_list); 985 1522 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); 987 1524 988 1525 // create a new table and fill it up. destroy the temp one … … 1033 1570 1034 1571 /** 1035 * Add primary key1036 */ 1037 function sql_ create_primary_key($table_name, $column)1572 * Drop Table 1573 */ 1574 function sql_table_drop($table_name) 1038 1575 { 1039 1576 $statements = array(); 1040 1577 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 1041 1645 switch ($this->sql_layer) 1042 1646 { 1043 1647 case 'firebird': 1044 1648 case 'postgres': 1649 case 'mysql_40': 1650 case 'mysql_41': 1045 1651 $statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')'; 1046 1652 break; … … 1055 1661 break; 1056 1662 1057 case 'mysql_40':1058 case 'mysql_41':1059 $statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';1060 break;1061 1062 1663 case 'oracle': 1063 1664 $statements[] = 'ALTER TABLE ' . $table_name . 'add CONSTRAINT pk_' . $table_name . ' PRIMARY KEY (' . implode(', ', $column) . ')'; … … 1065 1666 1066 1667 case 'sqlite': 1668 1669 if ($inline && $this->return_statements) 1670 { 1671 return $column; 1672 } 1673 1067 1674 $sql = "SELECT sql 1068 1675 FROM sqlite_master … … 1205 1812 $sql = "SELECT LOWER(RDB\$INDEX_NAME) as index_name 1206 1813 FROM RDB\$INDICES 1207 WHERE RDB\$RELATION_NAME = " . strtoupper($table_name) . "1814 WHERE RDB\$RELATION_NAME = '" . strtoupper($table_name) . "' 1208 1815 AND RDB\$UNIQUE_FLAG IS NULL 1209 1816 AND RDB\$FOREIGN_KEY IS NULL"; … … 1232 1839 $sql = "SELECT index_name 1233 1840 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'; 1236 1845 break; 1237 1846 … … 1271 1880 * Change column type (not name!) 1272 1881 */ 1273 function sql_column_change($table_name, $column_name, $column_data )1882 function sql_column_change($table_name, $column_name, $column_data, $inline = false) 1274 1883 { 1275 1884 $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data); … … 1280 1889 case 'firebird': 1281 1890 // 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 } 1283 1900 break; 1284 1901 1285 1902 case 'mssql': 1286 1903 $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 } 1287 1925 break; 1288 1926 … … 1361 1999 case 'sqlite': 1362 2000 2001 if ($inline && $this->return_statements) 2002 { 2003 return $column_name . ' ' . $column_data['column_type_sql']; 2004 } 2005 1363 2006 $sql = "SELECT sql 1364 2007 FROM sqlite_master -
trunk/forum/includes/db/dbal.php
r400 r702 3 3 * 4 4 * @package dbal 5 * @version $Id : dbal.php 9178 2008-12-06 11:11:10Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 236 236 function sql_like_expression($expression) 237 237 { 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); 240 240 241 241 return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\''); … … 413 413 414 414 /** 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 /** 415 451 * Run more than one insert statement. 416 452 * … … 436 472 if (!is_array($_sql_ary)) 437 473 { 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)); 440 475 } 441 476 … … 448 483 } 449 484 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)); 451 486 } 452 487 else … … 459 494 } 460 495 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 } 462 502 } 463 503 } -
trunk/forum/includes/db/firebird.php
r400 r702 3 3 * 4 4 * @package dbal 5 * @version $Id : firebird.php 8967 2008-10-02 12:04:12Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 21 21 /** 22 22 * Firebird/Interbase Database Abstraction Layer 23 * Minimum Requirement is Firebird 2. 023 * Minimum Requirement is Firebird 2.1 24 24 * @package dbal 25 25 */ … … 73 73 } 74 74 75 return ($raw) ? '2. 0' : 'Firebird/Interbase';75 return ($raw) ? '2.1' : 'Firebird/Interbase'; 76 76 } 77 77 … … 447 447 } 448 448 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 449 459 /** 450 460 * return sql error array -
trunk/forum/includes/db/mysql.php
r400 r702 3 3 * 4 4 * @package dbal 5 * @version $Id : mysql.php 8815 2008-09-04 13:37:01Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 45 45 $this->sql_layer = 'mysql4'; 46 46 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); 48 48 49 49 if ($this->db_connect_id && $this->dbname != '') … … 52 52 { 53 53 // 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', '>=')) 55 55 { 56 56 @mysql_query("SET NAMES 'utf8'", $this->db_connect_id); … … 342 342 return $data; 343 343 } 344 344 345 345 /** 346 346 * return sql error array -
trunk/forum/includes/db/oracle.php
r400 r702 3 3 * 4 4 * @package dbal 5 * @version $Id : oracle.php 9175 2008-12-05 11:18:59Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 137 137 function _rewrite_where($where_clause) 138 138 { 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); 140 140 $out = ''; 141 141 foreach ($result as $val) … … 256 256 if (strlen($query) > 4000) 257 257 { 258 if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/s ', $query, $regs))258 if (preg_match('/^(INSERT INTO[^(]++)\\(([^()]+)\\) VALUES[^(]++\\((.*?)\\)$/sU', $query, $regs)) 259 259 { 260 260 if (strlen($regs[3]) > 4000) 261 261 { 262 262 $cols = explode(', ', $regs[2]); 263 263 264 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 } 264 313 265 314 $inserts = $vals[0]; … … 569 618 } 570 619 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 571 630 /** 572 631 * return sql error array -
trunk/forum/includes/db/postgres.php
r400 r702 3 3 * 4 4 * @package dbal 5 * @version $Id : postgres.php 8814 2008-09-04 12:01:47Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 27 27 { 28 28 var $last_query_text = ''; 29 29 30 30 /** 31 31 * Connect to server … … 56 56 $connect_string .= "host=$sqlserver "; 57 57 } 58 58 59 59 if ($port) 60 60 { … … 225 225 if ($total == 0) 226 226 { 227 $total = -1;227 $total = 'ALL'; 228 228 } 229 229 -
trunk/forum/includes/diff/diff.php
r400 r702 3 3 * 4 4 * @package diff 5 * @version $Id : diff.php 8765 2008-08-16 22:18:25Z aptx$5 * @version $Id$ 6 6 * @copyright (c) 2006 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 18 18 19 19 /** 20 * Code from pear.php.net, Text_Diff-1. 0.0 package20 * Code from pear.php.net, Text_Diff-1.1.0 package 21 21 * http://pear.php.net/package/Text_Diff/ 22 22 * … … 59 59 { 60 60 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; 61 107 } 62 108 … … 87 133 $rev->_edits = array(); 88 134 89 foreach ($this->_edits as $edit) 90 { 135 for ($i = 0, $size = sizeof($this->_edits); $i < $size; $i++) 136 { 137 $edit = $this->_edits[$i]; 91 138 $rev->_edits[] = $edit->reverse(); 92 139 } … … 102 149 function is_empty() 103 150 { 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 108 175 return false; 109 176 } 110 } 177 178 return false; 179 } 180 111 181 return true; 112 182 } … … 123 193 $lcs = 0; 124 194 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 127 199 if (is_a($edit, 'diff_op_copy')) 128 200 { … … 144 216 $lines = array(); 145 217 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 148 222 if ($edit->orig) 149 223 { … … 165 239 $lines = array(); 166 240 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 169 245 if ($edit->final) 170 246 { … … 217 293 $prevtype = null; 218 294 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 221 299 if ($prevtype == get_class($edit)) 222 300 { … … 415 493 * @param array $final2 The second version to compare to. 416 494 */ 417 function diff3(&$orig, &$final1, &$final2 )495 function diff3(&$orig, &$final1, &$final2, $preserve_cr = true) 418 496 { 419 497 $diff_engine = new diff_engine(); 420 498 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); 425 503 426 504 $this->_edits = $this->_diff3($diff_1, $diff_2); … … 428 506 429 507 /** 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. 431 530 * 432 531 * @param string $label1 the cvs file version/label from the original set of lines 433 532 * @param string $label2 the cvs file version/label from the new set of lines 434 533 * @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 returned436 * @param bool $merge_new if set to true the merged output will have the new file contents on a conflicting merge437 534 * 438 535 * @return mixed the merged output 439 536 */ 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') 441 538 { 442 539 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 }456 540 457 541 $label1 = (!empty($user->lang[$label1])) ? $user->lang[$label1] : $label1; … … 461 545 $lines = array(); 462 546 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 465 551 if ($edit->is_conflict()) 466 552 { 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); 475 559 $this->_conflicting_blocks++; 476 560 } … … 485 569 486 570 /** 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 /** 487 581 * Merge the output and use the new file code for conflicts 488 582 */ … … 491 585 $lines = array(); 492 586 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 495 591 if ($edit->is_conflict()) 496 592 { … … 513 609 $lines = array(); 514 610 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 517 615 if ($edit->is_conflict()) 518 616 { … … 535 633 $conflicts = array(); 536 634 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 539 639 if ($edit->is_conflict()) 540 640 { … … 660 760 if (!isset($this->_merged)) 661 761 { 762 // Prepare the arrays before we compare them. ;) 763 $this->solve_prepare(); 764 662 765 if ($this->final1 === $this->final2) 663 766 { … … 674 777 else 675 778 { 779 // The following tries to aggressively solve conflicts... 676 780 $this->_merged = false; 781 $this->solve_conflict(); 677 782 } 678 783 } … … 684 789 { 685 790 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; 686 1052 } 687 1053 } -
trunk/forum/includes/diff/engine.php
r400 r702 3 3 * 4 4 * @package diff 5 * @version $Id : engine.php 8765 2008-08-16 22:18:25Z aptx$5 * @version $Id$ 6 6 * @copyright (c) 2006 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 18 18 19 19 /** 20 * Code from pear.php.net, Text_Diff-1. 0.0 package20 * Code from pear.php.net, Text_Diff-1.1.0 package 21 21 * http://pear.php.net/package/Text_Diff/ (native engine) 22 22 * … … 50 50 class diff_engine 51 51 { 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 52 57 function diff(&$from_lines, &$to_lines, $preserve_cr = true) 53 58 { … … 86 91 for ($skip = 0; $skip < $n_from && $skip < $n_to; $skip++) 87 92 { 88 if ( $from_lines[$skip] !== $to_lines[$skip])93 if (trim($from_lines[$skip]) !== trim($to_lines[$skip])) 89 94 { 90 95 break; … … 99 104 for ($endskip = 0; --$xi > $skip && --$yi > $skip; $endskip++) 100 105 { 101 if ( $from_lines[$xi] !== $to_lines[$yi])106 if (trim($from_lines[$xi]) !== trim($to_lines[$yi])) 102 107 { 103 108 break; … … 109 114 for ($xi = $skip; $xi < $n_from - $endskip; $xi++) 110 115 { 111 $xhash[$from_lines[$xi]] = 1;116 if ($this->skip_whitespace_changes) $xhash[trim($from_lines[$xi])] = 1; else $xhash[$from_lines[$xi]] = 1; 112 117 } 113 118 114 119 for ($yi = $skip; $yi < $n_to - $endskip; $yi++) 115 120 { 116 $line = $to_lines[$yi];121 $line = ($this->skip_whitespace_changes) ? trim($to_lines[$yi]) : $to_lines[$yi]; 117 122 118 123 if (($this->ychanged[$yi] = empty($xhash[$line]))) … … 127 132 for ($xi = $skip; $xi < $n_from - $endskip; $xi++) 128 133 { 129 $line = $from_lines[$xi];134 $line = ($this->skip_whitespace_changes) ? trim($from_lines[$xi]) : $from_lines[$xi]; 130 135 131 136 if (($this->xchanged[$xi] = empty($yhash[$line]))) … … 141 146 142 147 // 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 } 145 163 146 164 // Compute the edit operations. -
trunk/forum/includes/diff/renderer.php
r400 r702 3 3 * 4 4 * @package diff 5 * @version $Id : renderer.php 8766 2008-08-16 22:24:54Z aptx$5 * @version $Id$ 6 6 * @copyright (c) 2006 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 18 18 19 19 /** 20 * Code from pear.php.net, Text_Diff-1. 0.0 package20 * Code from pear.php.net, Text_Diff-1.1.0 package 21 21 * http://pear.php.net/package/Text_Diff/ 22 22 * … … 537 537 function get_diff_content($diff) 538 538 { 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>'; 540 540 } 541 541 -
trunk/forum/includes/functions.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions.php 9153 2008-12-02 17:02:56Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 72 72 } 73 73 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)) 75 76 { 76 77 return (is_array($default)) ? array() : $default; 77 78 } 78 79 79 $var = $ _REQUEST[$var_name];80 $var = $GLOBALS[$super_global][$var_name]; 80 81 if (!is_array($default)) 81 82 { … … 166 167 167 168 /** 169 * Set dynamic config value with arithmetic operation. 170 */ 171 function 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 /** 168 200 * Generates an alphanumeric random string of given length 169 201 */ … … 201 233 /** 202 234 * 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 */ 243 function get_formatted_filesize($value, $string_only = true, $allowed_units = false) 205 244 { 206 245 global $user; 207 246 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']; 219 311 } 220 312 … … 461 553 462 554 /** 555 * Hashes an email address to a big integer 556 * 557 * @param string $email Email address 558 * 559 * @return string Unsigned Big Integer 560 */ 561 function phpbb_email_hash($email) 562 { 563 return sprintf('%u', crc32(strtolower($email))) . strlen($email); 564 } 565 566 /** 463 567 * Global function for chmodding directories and files for internal use 568 * 464 569 * 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. 466 571 * The function uses bit fields to build the permissions. 467 572 * The function sets the appropiate execute bit on directories. … … 476 581 * 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. 477 582 * 478 * @param $filenameThe file/directory to be chmodded479 * @param $permsPermissions to set480 * @return true on success, otherwise false481 * 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 482 587 * @author faw, phpBB Group 483 588 */ 484 589 function phpbb_chmod($filename, $perms = CHMOD_READ) 485 590 { 591 static $_chmod_info; 592 486 593 // Return if the file no longer exists. 487 594 if (!file_exists($filename)) … … 490 597 } 491 598 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']) 548 683 { 549 684 $php = 'other'; … … 565 700 switch ($php) 566 701 { 567 case null:568 702 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 571 703 $result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0)); 572 704 573 705 clearstatcache(); 574 706 575 if ( !is_null($php) || (is_readable($filename) && is_writable($filename)))707 if (is_readable($filename) && is_writable($filename)) 576 708 { 577 709 break; 578 710 } 579 */580 711 581 712 case 'group': … … 584 715 clearstatcache(); 585 716 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))) 587 718 { 588 719 break; … … 594 725 clearstatcache(); 595 726 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))) 597 728 { 598 729 break; … … 605 736 606 737 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 */ 749 function 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 } 607 799 } 608 800 … … 704 896 function is_absolute($path) 705 897 { 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; 707 899 } 708 900 … … 985 1177 { 986 1178 $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>'; 988 1180 } 989 1181 } … … 1048 1240 1049 1241 // Add 0 to forums array to mark global announcements correctly 1050 $forum_id[] = 0;1242 // $forum_id[] = 0; 1051 1243 1052 1244 if ($config['load_db_lastread'] && $user->data['is_registered']) … … 1066 1258 while ($row = $db->sql_fetchrow($result)) 1067 1259 { 1068 $sql_update[] = $row['forum_id'];1260 $sql_update[] = (int) $row['forum_id']; 1069 1261 } 1070 1262 $db->sql_freeresult($result); … … 1463 1655 1464 1656 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 */ 1669 function 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; 1465 1783 } 1466 1784 … … 1715 2033 1716 2034 $on_page = floor($start_item / $per_page) + 1; 1717 $url_delim = (strpos($base_url, '?') === false) ? '?' : '&';2035 $url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&'); 1718 2036 1719 2037 $page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href="' . $base_url . '">1</a>'; … … 1994 2312 1995 2313 // Determine which type of redirect we need to handle... 1996 $url_parts = parse_url($url);2314 $url_parts = @parse_url($url); 1997 2315 1998 2316 if ($url_parts === false) … … 2138 2456 2139 2457 // Remove previously added sid 2140 if (strpos($url, '?sid=') !== false) 2141 { 2142 $url = preg_replace('/(\?)sid=[a-z0-9]+(&|&)?/', '\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, '&sid=') !== false) 2149 { 2150 $url = preg_replace('/&sid=[a-z0-9]+(&)?/', '\1', $url); 2458 if (strpos($url, 'sid=') !== false) 2459 { 2460 // All kind of links 2461 $url = preg_replace('/(\?)?(&|&)?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(&|&)+?/", "$phpEx?", $url); 2151 2464 } 2152 2465 … … 2210 2523 2211 2524 $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('&', '&', $redirect); 2212 2537 } 2213 2538 … … 2373 2698 if ($check && $confirm) 2374 2699 { 2375 $user_id = request_var(' user_id', 0);2700 $user_id = request_var('confirm_uid', 0); 2376 2701 $session_id = request_var('sess', ''); 2377 2702 $confirm_key = request_var('confirm_key', ''); … … 2395 2720 2396 2721 $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 )); 2401 2726 2402 2727 // generate activation key … … 2409 2734 else 2410 2735 { 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); 2412 2737 } 2413 2738 … … 2457 2782 { 2458 2783 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 } 2459 2789 2460 2790 $err = ''; … … 2568 2898 case LOGIN_ERROR_ATTEMPTS: 2569 2899 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(); 2592 2903 2593 2904 $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&id=' . $confirm_id . '&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(), 2598 2906 )); 2599 2907 2600 2908 $err = $user->lang[$result['error_msg']]; 2601 2602 2909 break; 2603 2910 … … 2626 2933 } 2627 2934 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 2642 2935 // Assign credential for username/password pair 2643 2936 $credential = ($admin) ? md5(unique_id()) : false; 2644 2937 2645 2938 $s_hidden_fields = array( 2646 'redirect' => $redirect,2647 2939 'sid' => $user->session_id, 2648 2940 ); 2941 2942 if ($redirect) 2943 { 2944 $s_hidden_fields['redirect'] = $redirect; 2945 } 2649 2946 2650 2947 if ($admin) … … 2660 2957 2661 2958 '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') : '', 2663 2960 'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'), 2664 2961 'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'), 2665 2962 2666 2963 '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 directory2668 2964 'S_HIDDEN_FIELDS' => $s_hidden_fields, 2669 2965 … … 2749 3045 } 2750 3046 2751 page_header($user->lang['LOGIN'] );3047 page_header($user->lang['LOGIN'], false); 2752 3048 2753 3049 $template->assign_vars(array( 3050 'S_LOGIN_ACTION' => build_url(array('f')), 2754 3051 'S_HIDDEN_FIELDS' => build_hidden_fields(array('f' => $forum_data['forum_id']))) 2755 3052 ); … … 2870 3167 { 2871 3168 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 } 2872 3177 2873 3178 $args = func_get_args(); … … 3138 3443 3139 3444 // 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) 3141 3446 { 3142 3447 return; … … 3147 3452 { 3148 3453 $msg_text = $msg_long_text; 3454 } 3455 3456 if (!defined('E_DEPRECATED')) 3457 { 3458 define('E_DEPRECATED', 8192); 3149 3459 } 3150 3460 … … 3181 3491 $errfile = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $errfile); 3182 3492 $msg_text = str_replace(array(phpbb_realpath($phpbb_root_path), '\\'), array('', '/'), $msg_text); 3183 3184 3493 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"; 3185 3501 } 3186 3502 … … 3215 3531 } 3216 3532 } 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'); 3217 3544 3218 3545 garbage_collection(); … … 3294 3621 else 3295 3622 { 3296 page_header($msg_title );3623 page_header($msg_title, false); 3297 3624 } 3298 3625 } … … 3323 3650 exit_handler(); 3324 3651 break; 3652 3653 // PHP4 compatibility 3654 case E_DEPRECATED: 3655 return true; 3656 break; 3325 3657 } 3326 3658 … … 3332 3664 /** 3333 3665 * 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 3335 3668 * @return int The number of active distinct guest sessions 3336 3669 */ 3337 function obtain_guest_count($ forum_id = 0)3670 function obtain_guest_count($item_id = 0, $item = 'forum') 3338 3671 { 3339 3672 global $db, $config; 3340 3673 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; 3344 3677 } 3345 3678 else … … 3370 3703 $reading_sql; 3371 3704 } 3372 $result = $db->sql_query($sql , 60);3705 $result = $db->sql_query($sql); 3373 3706 $guests_online = (int) $db->sql_fetchfield('num_guests'); 3374 3707 $db->sql_freeresult($result); … … 3379 3712 /** 3380 3713 * 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 3382 3716 * @return array An array containing the ids of online, hidden and visible users, as well as statistical info 3383 3717 */ 3384 function obtain_users_online($ forum_id = 0)3718 function obtain_users_online($item_id = 0, $item = 'forum') 3385 3719 { 3386 3720 global $db, $config, $user; 3387 3721 3388 3722 $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; 3392 3726 } 3393 3727 … … 3403 3737 if ($config['load_online_guests']) 3404 3738 { 3405 $online_users['guests_online'] = obtain_guest_count($ forum_id);3739 $online_users['guests_online'] = obtain_guest_count($item_id, $item); 3406 3740 } 3407 3741 … … 3442 3776 * Uses the result of obtain_users_online to generate a localized, readable representation. 3443 3777 * @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 3445 3780 * @return array An array containing the string for output to the template 3446 3781 */ 3447 function obtain_users_online_string($online_users, $ forum_id = 0)3782 function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum') 3448 3783 { 3449 3784 global $config, $db, $user, $auth; 3450 3785 3451 3786 $user_online_link = $online_userlist = ''; 3787 // Need caps version of $item for language-strings 3788 $item_caps = strtoupper($item); 3452 3789 3453 3790 if (sizeof($online_users['online_users'])) … … 3484 3821 } 3485 3822 3486 if ($ forum_id === 0)3823 if ($item_id === 0) 3487 3824 { 3488 3825 $online_userlist = $user->lang['REGISTERED_USERS'] . ' ' . $online_userlist; … … 3490 3827 else if ($config['load_online_guests']) 3491 3828 { 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']; 3493 3830 $online_userlist = sprintf($l_online, $online_userlist, $online_users['guests_online']); 3494 3831 } 3495 3832 else 3496 3833 { 3497 $online_userlist = sprintf($user->lang['BROWSING_ FORUM'], $online_userlist);3834 $online_userlist = sprintf($user->lang['BROWSING_' . $item_caps], $online_userlist); 3498 3835 } 3499 3836 // Build online listing … … 3549 3886 } 3550 3887 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 */ 3895 function 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 */ 3909 function 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 */ 3930 function 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 } 3551 4024 3552 4025 /** 3553 4026 * Generate page header 3554 4027 */ 3555 function page_header($page_title = '', $display_online_list = true )4028 function page_header($page_title = '', $display_online_list = true, $item_id = 0, $item = 'forum') 3556 4029 { 3557 4030 global $db, $config, $template, $SID, $_SID, $user, $auth, $phpEx, $phpbb_root_path; … … 3589 4062 3590 4063 // 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 = ''; 3592 4065 3593 4066 if ($config['load_online'] && $config['load_online_time'] && $display_online_list) 3594 4067 { 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); 3599 4076 3600 4077 $l_online_users = $user_online_strings['l_online_users']; … … 3608 4085 } 3609 4086 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)); 3611 4088 3612 4089 $l_online_time = ($config['load_online_time'] == 1) ? 'VIEW_ONLINE_TIME' : 'VIEW_ONLINE_TIMES'; 3613 4090 $l_online_time = sprintf($user->lang[$l_online_time], $config['load_online_time']); 3614 }3615 else3616 {3617 $l_online_time = '';3618 4091 } 3619 4092 … … 3657 4130 } 3658 4131 } 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; 3659 4152 3660 4153 // Which timezone? … … 3685 4178 'S_USER_NEW_PRIVMSG' => $user->data['user_new_privmsg'], 3686 4179 'S_USER_UNREAD_PRIVMSG' => $user->data['user_unread_privmsg'], 4180 'S_USER_NEW' => $user->data['user_new'], 3687 4181 3688 4182 'SID' => $SID, … … 3690 4184 'SESSION_ID' => $user->session_id, 3691 4185 'ROOT_PATH' => $phpbb_root_path, 4186 'BOARD_URL' => $board_url, 3692 4187 3693 4188 'L_LOGIN_LOGOUT' => $l_login_logout, … … 3711 4206 'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'), 3712 4207 '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'), 3713 4209 'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'), 3714 4210 'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'), 3715 4211 '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'), 3716 4214 '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", 3717 4216 3718 4217 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, … … 3736 4235 'S_NEW_PM' => ($s_privmsg_new) ? 1 : 0, 3737 4236 '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&id=" . $user->theme['style_id'] . '&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('&', '&', 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'] . '&lang=' . $user->data['user_lang'], true, $user->session_id), 3752 4263 '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'], 3753 4277 3754 4278 'SITE_LOGO_IMG' => $user->img('site_logo'), … … 3785 4309 } 3786 4310 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); 3788 4312 3789 4313 if ($auth->acl_get('a_') && defined('DEBUG_EXTRA')) … … 3813 4337 3814 4338 // Call cron-type script 4339 $call_cron = false; 3815 4340 if (!defined('IN_CRON') && $run_cron && !$config['board_disable']) 3816 4341 { 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 { 3817 4361 $cron_type = ''; 3818 4362 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)) 3820 4364 { 3821 4365 // Process email queue 3822 4366 $cron_type = 'queue'; 3823 4367 } 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']) 3825 4369 { 3826 4370 // Tidy the cache 3827 4371 $cron_type = 'tidy_cache'; 3828 4372 } 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'])) 3830 4374 { 3831 4375 $cron_type = 'tidy_warnings'; 3832 4376 } 3833 else if ( time()- $config['database_gc'] > $config['database_last_gc'])4377 else if ($time_now - $config['database_gc'] > $config['database_last_gc']) 3834 4378 { 3835 4379 // Tidy the database 3836 4380 $cron_type = 'tidy_database'; 3837 4381 } 3838 else if ( time()- $config['search_gc'] > $config['search_last_gc'])4382 else if ($time_now - $config['search_gc'] > $config['search_last_gc']) 3839 4383 { 3840 4384 // Tidy the search 3841 4385 $cron_type = 'tidy_search'; 3842 4386 } 3843 else if ( time()- $config['session_gc'] > $config['session_last_gc'])4387 else if ($time_now - $config['session_gc'] > $config['session_last_gc']) 3844 4388 { 3845 4389 $cron_type = 'tidy_sessions'; -
trunk/forum/includes/functions_admin.php
r400 r702 3 3 * 4 4 * @package acp 5 * @version $Id : functions_admin.php 9065 2008-11-13 17:32:55Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 18 18 19 19 /** 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 */ 30 function recalc_nested_sets(&$new_id, $pkey, $table, $parent_id = 0, $where = array()) 22 31 { 23 32 global $db; 24 33 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'; 36 39 $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 } 38 59 $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_table45 SET left_id = left_id - $substract, right_id = right_id - $substract46 $sql_where";47 $db->sql_query($sql);48 }49 50 $sql = "SELECT $sql_id, parent_id, left_id, right_id51 FROM $sql_table52 $sql_where53 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_id61 FROM $sql_table62 $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_table74 SET left_id = left_id + 2, right_id = right_id + 275 $sql_where " . (($sql_where) ? 'AND' : 'WHERE') . "76 left_id > {$row['right_id']}";77 $db->sql_query($sql);78 79 $sql = "UPDATE $sql_table80 SET right_id = right_id + 281 $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 else89 {90 $sql = "SELECT MAX(right_id) AS right_id91 FROM $sql_table92 $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_table102 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);107 60 } 108 */109 61 110 62 /** … … 115 67 global $db, $user, $auth; 116 68 117 $acl = ($ignore_acl) ? '' : (($only_acl_post) ? 'f_post' : array('f_list', 'a_forum', 'a_forumadd', 'a_forumdel'));118 119 69 // This query is identical to the jumpbox one 120 $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id70 $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, forum_flags, forum_options, left_id, right_id 121 71 FROM ' . FORUMS_TABLE . ' 122 72 ORDER BY left_id ASC'; … … 147 97 $disabled = false; 148 98 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']))) 153 102 { 154 103 $disabled = true; 155 104 } 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; 160 113 } 161 114 … … 303 256 if ($acl_list == '' || ($acl_list != '' && $auth->acl_gets($acl_list, $row['forum_id']))) 304 257 { 305 $rowset[] = ($id_only) ? $row['forum_id'] : $row;258 $rowset[] = ($id_only) ? (int) $row['forum_id'] : $row; 306 259 } 307 260 } … … 356 309 357 310 /** 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 */ 322 function 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 /** 358 456 * Get physical file listing 359 457 */ 360 458 function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png') 361 459 { 362 $matches = array( );460 $matches = array($dir => array()); 363 461 364 462 // Remove initial / if present … … 620 718 if ($approved_topics) 621 719 { 622 set_config ('num_topics', $config['num_topics'] - $approved_topics, true);720 set_config_count('num_topics', $approved_topics * (-1), true); 623 721 } 624 722 … … 653 751 } 654 752 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); 656 770 } 657 771 … … 666 780 while ($row = $db->sql_fetchrow($result)) 667 781 { 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']; 672 786 673 787 if ($row['post_postcount'] && $post_count_sync && $row['post_approved']) … … 777 891 if ($approved_posts) 778 892 { 779 set_config ('num_posts', $config['num_posts'] - $approved_posts, true);893 set_config_count('num_posts', $approved_posts * (-1), true); 780 894 } 781 895 … … 800 914 global $db, $config; 801 915 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)) 803 923 { 804 924 $ids = array_unique($ids); … … 810 930 } 811 931 812 if (!sizeof($ids)) 813 { 814 return false; 815 } 932 $sql_where = ''; 816 933 817 934 switch ($mode) … … 820 937 case 'message': 821 938 $sql_id = 'post_msg_id'; 939 $sql_where = ' AND in_message = ' . ($mode == 'message' ? 1 : 0); 822 940 break; 823 941 … … 843 961 FROM ' . ATTACHMENTS_TABLE . ' 844 962 WHERE ' . $db->sql_in_set($sql_id, $ids); 963 964 $sql .= $sql_where; 965 845 966 $result = $db->sql_query($sql); 846 967 … … 868 989 $sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . ' 869 990 WHERE ' . $db->sql_in_set($sql_id, $ids); 991 992 $sql .= $sql_where; 993 870 994 $db->sql_query($sql); 871 995 $num_deleted = $db->sql_affectedrows(); … … 895 1019 if ($space_removed || $files_removed) 896 1020 { 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); 899 1023 } 900 1024 … … 916 1040 if (sizeof($post_ids)) 917 1041 { 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 } 922 1067 } 923 1068 … … 925 1070 if (sizeof($message_ids)) 926 1071 { 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 } 931 1097 } 932 1098 … … 1074 1240 $sql = 'SELECT COUNT(attach_id) AS num_entries 1075 1241 FROM ' . ATTACHMENTS_TABLE . " 1076 WHERE physical_filename = '" . $db->sql_escape( basename($filename)) . "'";1242 WHERE physical_filename = '" . $db->sql_escape(utf8_basename($filename)) . "'"; 1077 1243 $result = $db->sql_query($sql); 1078 1244 $num_entries = (int) $db->sql_fetchfield('num_entries'); … … 1085 1251 } 1086 1252 1087 $filename = ($mode == 'thumbnail') ? 'thumb_' . basename($filename) :basename($filename);1253 $filename = ($mode == 'thumbnail') ? 'thumb_' . utf8_basename($filename) : utf8_basename($filename); 1088 1254 return @unlink($phpbb_root_path . $config['upload_path'] . '/' . $filename); 1089 1255 } … … 1169 1335 { 1170 1336 case 'topic_moved': 1337 $db->sql_transaction('begin'); 1171 1338 switch ($db->sql_layer) 1172 1339 { … … 1205 1372 break; 1206 1373 } 1207 break; 1374 1375 $db->sql_transaction('commit'); 1376 break; 1208 1377 1209 1378 case 'topic_approved': 1379 1380 $db->sql_transaction('begin'); 1210 1381 switch ($db->sql_layer) 1211 1382 { … … 1243 1414 break; 1244 1415 } 1245 break; 1416 1417 $db->sql_transaction('commit'); 1418 break; 1246 1419 1247 1420 case 'post_reported': 1248 1421 $post_ids = $post_reported = array(); 1422 1423 $db->sql_transaction('begin'); 1249 1424 1250 1425 $sql = 'SELECT p.post_id, p.post_reported … … 1298 1473 $db->sql_query($sql); 1299 1474 } 1300 break; 1475 1476 $db->sql_transaction('commit'); 1477 break; 1301 1478 1302 1479 case 'topic_reported': … … 1307 1484 1308 1485 $topic_ids = $topic_reported = array(); 1486 1487 $db->sql_transaction('begin'); 1309 1488 1310 1489 $sql = 'SELECT DISTINCT(t.topic_id) … … 1340 1519 $db->sql_query($sql); 1341 1520 } 1342 break; 1521 1522 $db->sql_transaction('commit'); 1523 break; 1343 1524 1344 1525 case 'post_attachment': 1345 1526 $post_ids = $post_attachment = array(); 1527 1528 $db->sql_transaction('begin'); 1346 1529 1347 1530 $sql = 'SELECT p.post_id, p.post_attachment … … 1395 1578 $db->sql_query($sql); 1396 1579 } 1397 break; 1580 1581 $db->sql_transaction('commit'); 1582 break; 1398 1583 1399 1584 case 'topic_attachment': … … 1404 1589 1405 1590 $topic_ids = $topic_attachment = array(); 1591 1592 $db->sql_transaction('begin'); 1406 1593 1407 1594 $sql = 'SELECT DISTINCT(t.topic_id) … … 1437 1624 $db->sql_query($sql); 1438 1625 } 1439 break; 1626 1627 $db->sql_transaction('commit'); 1628 1629 break; 1440 1630 1441 1631 case 'forum': 1632 1633 $db->sql_transaction('begin'); 1442 1634 1443 1635 // 1: Get the list of all forums … … 1641 1833 } 1642 1834 } 1643 break; 1835 1836 $db->sql_transaction('commit'); 1837 break; 1644 1838 1645 1839 case 'topic': 1646 1840 $topic_data = $post_ids = $approved_unapproved_ids = $resync_forums = $delete_topics = $delete_posts = $moved_topics = array(); 1841 1842 $db->sql_transaction('begin'); 1647 1843 1648 1844 $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 … … 1968 2164 unset($topic_data); 1969 2165 2166 $db->sql_transaction('commit'); 2167 1970 2168 // if some topics have been resync'ed then resync parent forums 1971 2169 // except when we're only syncing a range, we don't want to sync forums during … … 1975 2173 sync('forum', 'forum_id', array_values($resync_forums), true, true); 1976 2174 } 1977 break;2175 break; 1978 2176 } 1979 2177 … … 2161 2359 // Remove users who have group memberships with DENY moderator permissions 2162 2360 $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', 2164 2362 2165 2363 'FROM' => array( 2166 2364 ACL_OPTIONS_TABLE => 'o', 2167 2365 USER_GROUP_TABLE => 'ug', 2168 ACL_GROUPS_TABLE => 'a' 2366 GROUPS_TABLE => 'g', 2367 ACL_GROUPS_TABLE => 'a', 2169 2368 ), 2170 2369 … … 2180 2379 OR r.auth_setting = ' . ACL_NEVER . ') 2181 2380 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) 2182 2383 AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . " 2183 2384 AND ug.user_pending = 0 … … 2299 2500 * View log 2300 2501 */ 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' )2502 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', $keywords = '') 2302 2503 { 2303 2504 global $db, $user, $auth, $phpEx, $phpbb_root_path, $phpbb_admin_path; … … 2316 2517 case 'mod': 2317 2518 $log_type = LOG_MOD; 2519 $sql_forum = ''; 2318 2520 2319 2521 if ($topic_id) 2320 2522 { 2321 $sql_forum = 'AND l.topic_id = ' . intval($topic_id);2523 $sql_forum = 'AND l.topic_id = ' . (int) $topic_id; 2322 2524 } 2323 2525 else if (is_array($forum_id)) … … 2325 2527 $sql_forum = 'AND ' . $db->sql_in_set('l.forum_id', array_map('intval', $forum_id)); 2326 2528 } 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; 2330 2532 } 2331 2533 break; … … 2348 2550 default: 2349 2551 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) . ')'; 2350 2587 } 2351 2588 … … 2355 2592 AND u.user_id = l.user_id 2356 2593 " . (($limit_days) ? "AND l.log_time >= $limit_days" : '') . " 2594 $sql_keywords 2357 2595 $sql_forum 2358 2596 ORDER BY $sort_by"; … … 2395 2633 if (!empty($row['log_data'])) 2396 2634 { 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; 2398 2637 2399 2638 if (isset($user->lang[$row['log_operation']])) … … 2418 2657 } 2419 2658 } 2420 else 2659 else if (!empty($log_data_ary)) 2421 2660 { 2422 2661 $log[$i]['action'] .= '<br />' . implode('', $log_data_ary); … … 2516 2755 2517 2756 $sql = 'SELECT COUNT(l.log_id) AS total_entries 2518 FROM ' . LOG_TABLE . " l2757 FROM ' . LOG_TABLE . ' l, ' . USERS_TABLE . " u 2519 2758 WHERE l.log_type = $log_type 2759 AND l.user_id = u.user_id 2520 2760 AND l.log_time >= $limit_days 2761 $sql_keywords 2521 2762 $sql_forum"; 2522 2763 $result = $db->sql_query($sql); … … 2661 2902 } 2662 2903 2663 $sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason2904 $sql = 'SELECT * 2664 2905 FROM ' . USERS_TABLE . ' 2665 2906 WHERE user_type = ' . USER_INACTIVE . … … 3030 3271 } 3031 3272 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 */ 3282 function 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 */ 3322 function 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 3032 3332 ?> -
trunk/forum/includes/functions_compress.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_compress.php 8780 2008-08-22 12:52:48Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 81 81 } 82 82 } 83 else 84 { 85 // $src does not exist 86 return false; 87 } 83 88 84 89 return true; … … 90 95 function add_custom_file($src, $filename) 91 96 { 97 if (!file_exists($src)) 98 { 99 return false; 100 } 101 92 102 $this->data($filename, file_get_contents($src), false, stat($src)); 93 103 return true; … … 156 166 function compress_zip($mode, $file) 157 167 { 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 } 159 174 } 160 175 -
trunk/forum/includes/functions_content.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_content.php 9184 2008-12-11 14:46:38Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 251 251 $text = preg_replace('/ +/', ' ', strtr($text, "\t\n\r\x0C ", ' ')); 252 252 253 // we need to turn the entities back into their original form, to not cut the message in between them 254 $entities = array('<', '>', '[', ']', '.', ':', ':'); 255 $characters = array('<', '>', '[', ']', '.', ':', ':'); 256 $text = str_replace($entities, $characters, $text); 257 253 258 $word_indizes = array(); 254 259 if (sizeof($words)) … … 262 267 if (preg_match('#(?:[^\w]|^)(' . $word . ')(?:[^\w]|$)#i', $text, $match)) 263 268 { 269 if (empty($match[1])) 270 { 271 continue; 272 } 273 264 274 $pos = utf8_strpos($text, $match[1]); 265 275 if ($pos !== false) … … 341 351 } 342 352 } 343 return $final_text;353 return str_replace($characters, $entities, $final_text); 344 354 } 345 355 } … … 347 357 if (!sizeof($words) || !sizeof($word_indizes)) 348 358 { 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)); 350 360 } 351 361 } … … 676 686 static $censors; 677 687 688 // Nothing to do? 689 if ($text === '') 690 { 691 return ''; 692 } 693 678 694 // We moved the word censor checks in here because we call this function quite often - and then only need to do the check once 679 695 if (!isset($censors) || !is_array($censors)) … … 724 740 else 725 741 { 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); 727 744 } 728 745 } … … 832 849 // Some basics... 833 850 $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']); 836 853 837 854 $upload_icon = ''; … … 849 866 } 850 867 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); 854 869 855 870 $comment = bbcode_nl2br(censor_text($attachment['attach_comment'])); … … 857 872 $block_array += array( 858 873 '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']), 862 877 'COMMENT' => $comment, 863 878 ); … … 951 966 'THUMB_IMAGE' => $thumbnail_link, 952 967 ); 968 969 $update_count[] = $attachment['attach_id']; 953 970 break; 954 971 … … 997 1014 'WIDTH' => $width, 998 1015 'HEIGHT' => $height, 1016 'U_VIEW_LINK' => $download_link . '&view=1', 999 1017 ); 1000 1018 … … 1089 1107 * @param int $max_length Maximum length of string (multibyte character count as 1 char / Html entity count as 1 char) 1090 1108 * @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. 1092 1111 * @param string $append String to be appended 1093 1112 */ 1094 function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = true, $append = '')1113 function truncate_string($string, $max_length = 60, $max_store_length = 255, $allow_reply = false, $append = '') 1095 1114 { 1096 1115 $chars = array(); … … 1127 1146 $string = implode('', $chars); 1128 1147 } 1129 while ( utf8_strlen($string) > $max_store_length || !sizeof($chars));1148 while (!empty($chars) && utf8_strlen($string) > $max_store_length); 1130 1149 } 1131 1150 … … 1160 1179 { 1161 1180 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&u={USER_ID}'); 1204 } 1205 1206 $profile_url = ($custom_profile_url !== false) ? $custom_profile_url . '&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&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 . '&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']); 1228 1262 } 1229 1263 -
trunk/forum/includes/functions_convert.php
r400 r702 3 3 * 4 4 * @package install 5 * @version $Id : functions_convert.php 8876 2008-09-18 14:26:56Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2006 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 206 206 /** 207 207 * Generate the email hash stored in the users table 208 * 209 * Note: Deprecated, calls should directly go to phpbb_email_hash() 208 210 */ 209 211 function gen_email_hash($email) 210 212 { 211 return (crc32(strtolower($email)) . strlen($email));213 return phpbb_email_hash($email); 212 214 } 213 215 … … 552 554 553 555 // 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); 555 557 556 558 if (!empty($convert->convertor[$config_var]) && strpos($source, $convert->convertor[$config_var]) !== 0) … … 568 570 if ($result['copied']) 569 571 { 570 $result['target'] = basename($target);572 $result['target'] = utf8_basename($target); 571 573 } 572 574 else 573 575 { 574 $result['target'] = ($use_target !== false) ? $result['orig_source'] : basename($target);576 $result['target'] = ($use_target !== false) ? $result['orig_source'] : utf8_basename($target); 575 577 } 576 578 … … 601 603 $thumb_dir = $convert->convertor['thumbnails'][0]; 602 604 $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']); 604 606 605 607 if (strpos($thumb_source, $convert->convertor['upload_path']) !== 0) … … 1233 1235 } 1234 1236 1237 if (isset($convert->config_schema['array_name'])) 1238 { 1239 unset($convert->config_schema['array_name']); 1240 } 1241 1235 1242 $convert_config = extract_variables_from_file($filename); 1236 1243 if (!empty($convert->config_schema['array_name'])) … … 1265 1272 1266 1273 $convert_config = get_config(); 1274 1267 1275 foreach ($schema['settings'] as $config_name => $src) 1268 1276 { … … 1275 1283 else 1276 1284 { 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 } 1279 1295 1280 1296 if ($config_value !== '') … … 1699 1715 'GLOBAL_MODERATORS' => array('00AA00', 1, 0), 1700 1716 'ADMINISTRATORS' => array('AA0000', 1, 1), 1701 'BOTS' => array('9E8DA7', 0, 0) 1717 'BOTS' => array('9E8DA7', 0, 0), 1718 'NEWLY_REGISTERED' => array('', 0, 0), 1702 1719 ); 1703 1720 … … 2257 2274 if (substr($trg, -1) == '/') 2258 2275 { 2259 $trg .= basename($src);2276 $trg .= utf8_basename($src); 2260 2277 } 2261 2278 $src_path = relative_base($src, $source_relative_path, __LINE__, __FILE__); -
trunk/forum/includes/functions_display.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_display.php 9082 2008-11-22 20:26:09Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 103 103 $forum_tracking_info = array(); 104 104 $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 105 118 while ($row = $db->sql_fetchrow($result)) 106 119 { … … 155 168 } 156 169 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; 157 172 $row['forum_topics'] = ($auth->acl_get('m_approve', $forum_id)) ? $row['forum_topics_real'] : $row['forum_topics']; 158 173 … … 211 226 { 212 227 $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; 213 233 } 214 234 … … 238 258 if ($mark_read == 'forums' || $mark_read == 'all') 239 259 { 240 $redirect = build_url( 'mark', 'hash');260 $redirect = build_url(array('mark', 'hash')); 241 261 $token = request_var('hash', ''); 242 262 if (check_link_hash($token, 'global')) … … 249 269 else 250 270 { 271 // Add 0 to forums array to mark global announcements correctly 272 $forum_ids[] = 0; 251 273 markread('topics', $forum_ids); 252 274 $message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>'); … … 300 322 301 323 $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 } 302 330 303 331 $folder_image = $folder_alt = $l_subforums = ''; … … 429 457 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 430 458 '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, 431 460 432 461 'FORUM_ID' => $row['forum_id'], … … 452 481 'L_MODERATOR_STR' => $l_moderator, 453 482 483 'U_UNAPPROVED_TOPICS' => ($row['forum_id_unapproved_topics']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=unapproved_topics&f=' . $row['forum_id_unapproved_topics']) : '', 454 484 'U_VIEWFORUM' => $u_viewforum, 455 485 'U_LAST_POSTER' => get_username_string('profile', $row['forum_last_poster_id'], $row['forum_last_poster_name'], $row['forum_last_poster_colour']), … … 474 504 'S_HAS_SUBFORUM' => ($visible_forums) ? true : false, 475 505 '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 )); 478 509 479 510 if ($return_moderators) … … 515 546 function generate_forum_nav(&$forum_data) 516 547 { 517 global $db, $user, $template, $auth ;548 global $db, $user, $template, $auth, $config; 518 549 global $phpEx, $phpbb_root_path; 519 550 … … 562 593 'FORUM_ID' => $forum_data['forum_id'], 563 594 '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 )); 566 599 567 600 return; … … 659 692 global $config, $template, $db, $phpbb_root_path, $phpEx, $user, $auth; 660 693 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(); 669 695 670 696 if ($forum_id !== false) … … 675 701 } 676 702 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); 684 705 } 685 706 … … 702 723 ), 703 724 704 'WHERE' => "m.display_on_index = 1 $forum_sql",725 'WHERE' => 'm.display_on_index = 1', 705 726 ); 706 727 728 // We query every forum here because for caching we should not have any parameter. 707 729 $sql = $db->sql_build_query('SELECT', $sql_array); 708 730 $result = $db->sql_query($sql, 3600); … … 710 732 while ($row = $db->sql_fetchrow($result)) 711 733 { 734 $f_id = (int) $row['forum_id']; 735 736 if (!isset($forum_id_ary[$f_id])) 737 { 738 continue; 739 } 740 712 741 if (!empty($row['user_id'])) 713 742 { 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']); 715 744 } 716 745 else … … 720 749 if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) 721 750 { 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>'; 723 752 } 724 753 else 725 754 { 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&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&g=' . $row['group_id']) . '">' . $group_name . '</a>'; 727 756 } 728 757 } … … 847 876 function display_custom_bbcodes() 848 877 { 849 global $db, $template ;878 global $db, $template, $user; 850 879 851 880 // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing) … … 861 890 while ($row = $db->sql_fetchrow($result)) 862 891 { 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 863 898 $template->assign_block_vars('custom_tags', array( 864 899 'BBCODE_NAME' => "'[{$row['bbcode_tag']}]', '[/" . str_replace('=', '', $row['bbcode_tag']) . "]'", … … 1195 1230 * @param string $avatar_height Height of users avatar 1196 1231 * @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 1197 1233 * 1198 1234 * @return string Avatar image 1199 1235 */ 1200 function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR' )1236 function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false) 1201 1237 { 1202 1238 global $user, $config, $phpbb_root_path, $phpEx; 1203 1239 1204 if (empty($avatar) || !$avatar_type )1240 if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config)) 1205 1241 { 1206 1242 return ''; … … 1212 1248 { 1213 1249 case AVATAR_UPLOAD: 1250 if (!$config['allow_avatar_upload'] && !$ignore_config) 1251 { 1252 return ''; 1253 } 1214 1254 $avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar="; 1215 1255 break; 1216 1256 1217 1257 case AVATAR_GALLERY: 1258 if (!$config['allow_avatar_local'] && !$ignore_config) 1259 { 1260 return ''; 1261 } 1218 1262 $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/'; 1219 1263 break; 1264 1265 case AVATAR_REMOTE: 1266 if (!$config['allow_avatar_remote'] && !$ignore_config) 1267 { 1268 return ''; 1269 } 1270 break; 1220 1271 } 1221 1272 -
trunk/forum/includes/functions_install.php
r400 r702 3 3 * 4 4 * @package install 5 * @version $Id : functions_install.php 8507 2008-04-20 04:57:29Z davidmj$5 * @version $Id$ 6 6 * @copyright (c) 2006 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 22 22 function can_load_dll($dll) 23 23 { 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; 25 38 } 26 39 … … 176 189 { 177 190 global $lang; 178 191 179 192 $available_dbms = get_available_dbms(false, false, $only_20x_options); 180 193 $dbms_options = ''; … … 397 410 else 398 411 { 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'; 401 414 $result = $db->sql_query($sql); 402 if (!$result) // This can only fail if char_lengthis not defined415 if (!$result) // This can only fail if BIN_AND is not defined 403 416 { 404 417 $error[] = $lang['INST_ERR_DB_NO_FIREBIRD']; … … 441 454 } 442 455 break; 443 456 444 457 case 'oracle': 445 458 if ($unicode_check) … … 463 476 } 464 477 break; 465 478 466 479 case 'postgres': 467 480 if ($unicode_check) -
trunk/forum/includes/functions_jabber.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_jabber.php 8979 2008-10-08 12:44:23Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2007 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 477 477 else if (in_array('PLAIN', $methods) && ($this->session['ssl'] || !empty($this->session['tls']))) 478 478 { 479 // http://www.ietf.org/rfc/rfc4616.txt (PLAIN SASL Mechanism) 479 480 $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) . 481 482 '</auth>'); 482 483 } -
trunk/forum/includes/functions_messenger.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_messenger.php 9078 2008-11-22 19:55:00Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 28 28 var $mail_priority = MAIL_NORMAL_PRIORITY; 29 29 var $use_queue = true; 30 31 var $tpl_obj = NULL; 30 32 var $tpl_msg = array(); 33 var $eol = "\n"; 31 34 32 35 /** … … 39 42 $this->use_queue = (!$config['email_package_size']) ? false : $use_queue; 40 43 $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; 41 48 } 42 49 … … 58 65 global $config; 59 66 67 if (!trim($address)) 68 { 69 return; 70 } 71 60 72 $pos = isset($this->addresses['to']) ? sizeof($this->addresses['to']) : 0; 61 73 … … 78 90 function cc($address, $realname = '') 79 91 { 92 if (!trim($address)) 93 { 94 return; 95 } 96 80 97 $pos = isset($this->addresses['cc']) ? sizeof($this->addresses['cc']) : 0; 81 98 $this->addresses['cc'][$pos]['email'] = trim($address); … … 88 105 function bcc($address, $realname = '') 89 106 { 107 if (!trim($address)) 108 { 109 return; 110 } 111 90 112 $pos = isset($this->addresses['bcc']) ? sizeof($this->addresses['bcc']) : 0; 91 113 $this->addresses['bcc'][$pos]['email'] = trim($address); … … 99 121 { 100 122 // IM-Addresses could be empty 101 if (! $address)123 if (!trim($address)) 102 124 { 103 125 return; … … 152 174 * Set email template to use 153 175 */ 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; 157 179 158 180 if (!trim($template_file)) 159 181 { 160 trigger_error('No template file set', E_USER_ERROR);182 trigger_error('No template file for emailing set.', E_USER_ERROR); 161 183 } 162 184 163 185 if (!trim($template_lang)) 164 186 { 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 165 190 $template_lang = basename($config['default_lang']); 166 191 } 167 192 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 = ''; 186 225 187 226 return true; … … 193 232 function assign_vars($vars) 194 233 { 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); 196 250 } 197 251 … … 204 258 205 259 // 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); 215 286 216 287 // We now try and pull a subject from the email body ... if it exists, … … 310 381 global $config; 311 382 383 // We could use keys here, but we won't do this for 3.0.x to retain backwards compatibility 312 384 $headers = array(); 313 385 … … 335 407 $headers[] = 'X-Priority: ' . $this->mail_priority; 336 408 $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'; 338 410 $headers[] = 'X-MimeOLE: phpBB3'; 339 411 $headers[] = 'X-phpBB-Origin: phpbb://' . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()); 340 412 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 works342 // if using \n.343 344 413 if (sizeof($this->extra_headers)) 345 414 { 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; 350 419 } 351 420 … … 360 429 { 361 430 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; 362 438 } 363 439 … … 382 458 $this->from = '<' . $config['board_contact'] . '>'; 383 459 } 460 461 $encode_eol = ($config['smtp_delivery']) ? "\r\n" : $this->eol; 384 462 385 463 // Build to, cc and bcc strings … … 394 472 foreach ($address_ary as $which_ary) 395 473 { 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']); 397 475 } 398 476 } … … 413 491 else 414 492 { 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); 418 494 } 419 495 … … 452 528 if (empty($this->addresses['im'])) 453 529 { 454 return false; 530 // Send was successful. ;) 531 return true; 455 532 } 456 533 … … 520 597 var $package_size = 0; 521 598 var $cache_file = ''; 599 var $eol = "\n"; 522 600 523 601 /** … … 530 608 $this->data = array(); 531 609 $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; 532 614 } 533 615 … … 652 734 else 653 735 { 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); 657 737 } 658 738 … … 705 785 { 706 786 @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?>"); 708 788 @flock($fp, LOCK_UN); 709 789 fclose($fp); 710 790 711 phpbb_chmod($this->cache_file, CHMOD_ WRITE);791 phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE); 712 792 } 713 793 } … … 746 826 { 747 827 @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?>"); 749 829 @flock($fp, LOCK_UN); 750 830 fclose($fp); 751 831 752 phpbb_chmod($this->cache_file, CHMOD_ WRITE);832 phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE); 753 833 } 754 834 } … … 758 838 * Replacement or substitute for PHP's mail command 759 839 */ 760 function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '')840 function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false) 761 841 { 762 842 global $config, $user; … … 765 845 $message = preg_replace("#(?<!\r)\n#si", "\r\n", $message); 766 846 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 } 777 855 778 856 // Ok this is rather confusing all things considered, 779 857 // but we have to grab bcc and cc headers and treat them differently 780 858 // 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) 785 862 { 786 863 if (strpos(strtolower($header), 'cc:') === 0 || strpos(strtolower($header), 'bcc:') === 0) 787 864 { 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)); 794 871 } 795 872 … … 947 1024 948 1025 // Now any custom headers.... 949 $smtp->server_send("$headers\r\n"); 1026 if ($headers !== false) 1027 { 1028 $smtp->server_send("$headers\r\n"); 1029 } 950 1030 951 1031 // Ok now we are ready for the message... … … 1068 1148 1069 1149 $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 } 1071 1168 1072 1169 // If we are authenticating through pop-before-smtp, we … … 1406 1503 * 1407 1504 * 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) 1408 1507 */ 1409 function mail_encode($str )1508 function mail_encode($str, $eol = "\r\n") 1410 1509 { 1411 1510 // define start delimimter, end delimiter and spacer 1412 1511 $start = "=?UTF-8?B?"; 1413 1512 $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; 1417 1517 $encoded_str = base64_encode($str); 1418 1518 … … 1426 1526 if (strlen($str) === utf8_strlen($str)) 1427 1527 { 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; 1429 1529 } 1430 1530 … … 1442 1542 } 1443 1543 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)); 1448 1548 } 1449 1549 1550 /** 1551 * Wrapper for sending out emails with the PHP's mail function 1552 */ 1553 function 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 1450 1571 ?> -
trunk/forum/includes/functions_posting.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_posting.php 9166 2008-12-03 16:40:53Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 25 25 global $phpEx, $phpbb_root_path; 26 26 27 $start = request_var('start', 0); 28 27 29 if ($mode == 'window') 28 30 { … … 45 47 page_header($user->lang['SMILIES']); 46 48 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 47 61 $template->set_filenames(array( 48 62 'body' => 'posting_smilies.html') 63 ); 64 65 $template->assign_var('PAGINATION', 66 generate_pagination(append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&f=' . $forum_id), 67 $smiley_count, $config['smilies_per_page'], $start, true) 49 68 ); 50 69 } … … 65 84 } 66 85 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 } 74 102 75 103 $smilies = array(); … … 85 113 if (sizeof($smilies)) 86 114 { 115 $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $phpbb_root_path; 116 87 117 foreach ($smilies as $row) 88 118 { … … 90 120 'SMILEY_CODE' => $row['code'], 91 121 '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'], 93 123 'SMILEY_WIDTH' => $row['smiley_width'], 94 124 'SMILEY_HEIGHT' => $row['smiley_height'], … … 615 645 616 646 // 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) 618 648 { 619 649 return false; … … 630 660 } 631 661 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) . '"'); 633 663 634 664 if (file_exists($destination)) … … 657 687 658 688 case IMG_JPG: 689 @ini_set('gd.jpeg_ignore_warning', 1); 659 690 $image = @imagecreatefromjpeg($source); 660 691 break; … … 667 698 $image = @imagecreatefromwbmp($source); 668 699 break; 700 } 701 702 if (empty($image)) 703 { 704 return false; 669 705 } 670 706 … … 752 788 foreach ($attachment_data as $i => $attachment) 753 789 { 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>'; 755 791 } 756 792 … … 786 822 { 787 823 $hidden = ''; 788 $attach_row['real_filename'] = basename($attach_row['real_filename']);824 $attach_row['real_filename'] = utf8_basename($attach_row['real_filename']); 789 825 790 826 foreach ($attach_row as $key => $value) … … 796 832 797 833 $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'])), 800 836 'FILE_COMMENT' => $attach_row['attach_comment'], 801 837 'ATTACH_ID' => $attach_row['attach_id'], … … 819 855 * Load Drafts 820 856 */ 821 function load_drafts($topic_id = 0, $forum_id = 0, $id = 0 )857 function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $msg_id = 0) 822 858 { 823 859 global $user, $db, $template, $auth; … … 912 948 // Either display as PM draft if forum_id and topic_id are empty or if access to the forums has been denied afterwards... 913 949 $link_pm = true; 914 $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&d={$draft['draft_id']}" );950 $insert_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=compose&d={$draft['draft_id']}" . (($pm_action) ? "&action=$pm_action" : '') . (($msg_id) ? "&p=$msg_id" : '')); 915 951 } 916 952 … … 945 981 " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . ' 946 982 ' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . ' 983 ' . (($mode == 'post_review_edit') ? " AND p.post_id = $cur_post_id" : '') . ' 947 984 ORDER BY p.post_time '; 948 985 $sql .= ($mode == 'post_review') ? 'ASC' : 'DESC'; … … 963 1000 } 964 1001 1002 // Handle 'post_review_edit' like 'post_review' from now on 1003 if ($mode == 'post_review_edit') 1004 { 1005 $mode = 'post_review'; 1006 } 1007 965 1008 $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', 967 1010 968 1011 'FROM' => array( 969 1012 USERS_TABLE => 'u', 970 1013 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 ) 971 1021 ), 972 1022 … … 1061 1111 $post_subject = censor_text($post_subject); 1062 1112 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&t=$topic_id&p={$row['post_id']}&view=show#p{$row['post_id']}"); 1115 1063 1116 $template->assign_block_vars($mode . '_row', array( 1064 1117 'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), … … 1068 1121 1069 1122 '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>') : '', 1070 1126 1071 1127 'POST_SUBJECT' => $post_subject, … … 1114 1170 if (!$topic_notification && !$forum_notification) 1115 1171 { 1116 trigger_error(' WRONG_NOTIFICATION_MODE');1172 trigger_error('NO_MODE'); 1117 1173 } 1118 1174 … … 1502 1558 } 1503 1559 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 1504 1575 // $sql_data[USERS_TABLE] = ($data['post_postcount']) ? 'user_posts = user_posts - 1' : ''; 1505 1576 … … 1553 1624 /** 1554 1625 * Submit Post 1626 * @todo Split up and create lightweight, simple API for this. 1555 1627 */ 1556 function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true )1628 function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true, $update_search_index = true) 1557 1629 { 1558 1630 global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path; … … 1606 1678 1607 1679 // 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 1608 1681 $post_approval = 1; 1609 1682 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 1613 1687 $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; 1614 1694 } 1615 1695 … … 1726 1806 'topic_poster' => (int) $user->data['user_id'], 1727 1807 'topic_time' => $current_time, 1808 'topic_last_view_time' => $current_time, 1728 1809 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 1729 1810 'icon_id' => $data['icon_id'], … … 1739 1820 if (isset($poll['poll_options']) && !empty($poll['poll_options'])) 1740 1821 { 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 1741 1834 $sql_data[TOPICS_TABLE]['sql'] = array_merge($sql_data[TOPICS_TABLE]['sql'], array( 1742 1835 'poll_title' => $poll['poll_title'], 1743 'poll_start' => ($poll['poll_start']) ? $poll['poll_start'] : $current_time,1836 'poll_start' => $poll_start, 1744 1837 'poll_max_options' => $poll['poll_max_options'], 1745 'poll_length' => ($poll['poll_length'] * 86400),1838 'poll_length' => $poll_length, 1746 1839 'poll_vote_change' => $poll['poll_vote_change']) 1747 1840 ); … … 1761 1854 1762 1855 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 1764 1863 $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' : ''); 1765 1864 … … 1772 1871 case 'edit_topic': 1773 1872 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 } 1774 1887 1775 1888 $sql_data[TOPICS_TABLE]['sql'] = array( … … 1782 1895 'topic_time_limit' => ($topic_type == POST_STICKY || $topic_type == POST_ANNOUNCE) ? ($data['topic_time_limit'] * 86400) : 0, 1783 1896 '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, 1785 1898 '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, 1787 1900 'poll_vote_change' => (isset($poll['poll_vote_change'])) ? $poll['poll_vote_change'] : 0, 1901 'topic_last_view_time' => $current_time, 1788 1902 1789 1903 'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0), … … 1811 1925 $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - ' . ($topic_row['topic_replies'] + 1); 1812 1926 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); 1815 1929 1816 1930 // Only decrement this post, since this is the one non-approved now … … 1829 1943 if (!$post_approval && $data['post_approved']) 1830 1944 { 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; 1832 1946 $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - 1'; 1833 1947 1834 set_config ('num_posts', $config['num_posts'] -1, true);1948 set_config_count('num_posts', -1, true); 1835 1949 1836 1950 if ($auth->acl_get('f_postcount', $data['forum_id'])) … … 2073 2187 { 2074 2188 // 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']))) 2076 2190 { 2077 2191 continue; … … 2099 2213 if ($space_taken && $files_added) 2100 2214 { 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); 2103 2217 } 2104 2218 } … … 2333 2447 if ($post_mode == 'post') 2334 2448 { 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); 2337 2451 } 2338 2452 2339 2453 if ($post_mode == 'reply') 2340 2454 { 2341 set_config ('num_posts', $config['num_posts'] +1, true);2455 set_config_count('num_posts', 1, true); 2342 2456 } 2343 2457 } … … 2377 2491 2378 2492 // Index message contents 2379 if ($update_ message&& $data['enable_indexing'])2493 if ($update_search_index && $data['enable_indexing']) 2380 2494 { 2381 2495 // Select the search method and do some additional checks to ensure it can actually be utilised … … 2412 2526 $db->sql_query($sql); 2413 2527 } 2414 else if ( $data['notify_set'] && !$data['notify'])2528 else if (($config['email_enable'] || $config['jab_enable']) && $data['notify_set'] && !$data['notify']) 2415 2529 { 2416 2530 $sql = 'DELETE FROM ' . TOPICS_WATCH_TABLE . ' … … 2429 2543 // Mark this topic as read 2430 2544 // 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()); 2432 2546 2433 2547 // … … 2437 2551 FROM ' . FORUMS_TRACK_TABLE . ' 2438 2552 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']); 2440 2554 $result = $db->sql_query($sql); 2441 2555 $f_mark_time = (int) $db->sql_fetchfield('mark_time'); … … 2450 2564 { 2451 2565 // 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 } 2455 2578 $result = $db->sql_query($sql); 2456 2579 $forum_last_post_time = (int) $db->sql_fetchfield('forum_last_post_time'); 2457 2580 $db->sql_freeresult($result); 2458 2581 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); 2460 2583 } 2461 2584 -
trunk/forum/includes/functions_privmsgs.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_privmsgs.php 8993 2008-10-10 17:38:17Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 895 895 case 'delete_marked': 896 896 897 global $auth; 898 899 if (!$auth->acl_get('u_pm_delete')) 900 { 901 trigger_error('NO_AUTH_DELETE_MESSAGE'); 902 } 903 897 904 if (confirm_box(true)) 898 905 { … … 1146 1153 $sql = 'SELECT user_id, username, user_colour 1147 1154 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); 1150 1156 $result = $db->sql_query($sql); 1151 1157 … … 1351 1357 AND ug.user_pending = 0 1352 1358 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 . ')' . 1354 1360 $sql_allow_pm; 1355 1361 $result = $db->sql_query($sql); … … 1357 1363 while ($row = $db->sql_fetchrow($result)) 1358 1364 { 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 1359 1371 $field = ($data['address_list']['g'][$row['group_id']] == 'to') ? 'to' : 'bcc'; 1360 1372 $recipients[$row['user_id']] = $field; … … 1406 1418 'bbcode_uid' => $data['bbcode_uid'], 1407 1419 'to_address' => implode(':', $to), 1408 'bcc_address' => implode(':', $bcc) 1420 'bcc_address' => implode(':', $bcc), 1421 'message_reported' => 0, 1409 1422 ); 1410 1423 break; … … 1546 1559 { 1547 1560 // 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']))) 1549 1562 { 1550 1563 continue; … … 1572 1585 if ($space_taken && $files_added) 1573 1586 { 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); 1576 1589 } 1577 1590 } … … 1692 1705 global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode; 1693 1706 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 1694 1723 // Get History Messages (could be newer) 1695 1724 $sql = 'SELECT t.*, p.*, u.* … … 1697 1726 WHERE t.msg_id = p.msg_id 1698 1727 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) . " 1700 1730 AND t.user_id = $user_id"; 1731 1732 // We no longer need those. 1733 unset($recipients); 1701 1734 1702 1735 if (!$message_row['root_level']) … … 1764 1797 $next_history_pm = $previous_history_pm = $prev_id = 0; 1765 1798 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 1768 1807 $author_id = $row['author_id']; 1769 1808 $folder_id = (int) $row['folder_id']; … … 1776 1815 $decoded_message = false; 1777 1816 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) 1779 1818 { 1780 1819 $decoded_message = $message; … … 1796 1835 if ($id == $msg_id) 1797 1836 { 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; 1800 1838 $previous_history_pm = $prev_id; 1801 1839 } … … 1820 1858 'MSG_ID' => $row['msg_id'], 1821 1859 'U_VIEW_MESSAGE' => "$url&f=$folder_id&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&mode=compose&action=quote&f=" . $folder_id . "&p=" . $row['msg_id'] : '',1860 'U_QUOTE' => (!$in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=" . $folder_id . "&p=" . $row['msg_id'] : '', 1823 1861 'U_POST_REPLY_PM' => ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $row['msg_id'] : '') 1824 1862 ); 1825 unset($rowset[$i d]);1863 unset($rowset[$i]); 1826 1864 $prev_id = $id; 1827 1865 } … … 1859 1897 } 1860 1898 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 */ 1908 function 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&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 1861 1988 ?> -
trunk/forum/includes/functions_profile_fields.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_profile_fields.php 9127 2008-11-26 19:58:35Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 40 40 { 41 41 case 'register': 42 // If the field is required we show it on the registration page and do not show hidden fields43 $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'; 44 44 break; 45 45 … … 93 93 switch ($field_type) 94 94 { 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 {107 95 case FIELD_DATE: 108 96 $field_validate = explode('-', $field_value); … … 134 122 135 123 case FIELD_BOOL: 124 $field_value = (bool) $field_value; 125 136 126 if (!$field_value && $field_data['field_required']) 137 127 { … … 141 131 142 132 case FIELD_INT: 143 if ( empty($field_value)&& !$field_data['field_required'])133 if (trim($field_value) === '' && !$field_data['field_required']) 144 134 { 145 135 return false; 146 136 } 137 138 $field_value = (int) $field_value; 147 139 148 140 if ($field_value < $field_data['field_minlen']) … … 157 149 158 150 case FIELD_DROPDOWN: 151 $field_value = (int) $field_value; 152 159 153 if ($field_value == $field_data['field_novalue'] && $field_data['field_required']) 160 154 { … … 165 159 case FIELD_STRING: 166 160 case FIELD_TEXT: 167 if ( empty($field_value)&& !$field_data['field_required'])161 if (trim($field_value) === '' && !$field_data['field_required']) 168 162 { 169 163 return false; 170 164 } 171 else if ( empty($field_value)&& $field_data['field_required'])165 else if (trim($field_value) === '' && $field_data['field_required']) 172 166 { 173 167 return 'FIELD_REQUIRED'; … … 260 254 261 255 /** 262 * Submit profile field 256 * Submit profile field for validation 263 257 * @access public 264 258 */ … … 271 265 { 272 266 case 'register': 273 // If the field is required we show it on the registration page and do not show hidden fields274 $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'; 275 269 break; 276 270 … … 351 345 352 346 /** 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 /** 353 407 * Assign fields to template, used for viewprofile, viewtopic and memberlist (if load setting is enabled) 354 408 * 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 … … 455 509 { 456 510 case 'int': 457 if ($value == '')511 if ($value === '') 458 512 { 459 513 return NULL; … … 571 625 else 572 626 { 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])) 574 628 { 575 629 $value = NULL; … … 585 639 } 586 640 587 return (is_null($value) ) ? '' : (int) $value;641 return (is_null($value) || $value === '') ? '' : (int) $value; 588 642 } 589 643 else -
trunk/forum/includes/functions_template.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_template.php 8813 2008-09-04 11:52:01Z aptx$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 129 129 $code = preg_replace('#<!-- PHP -->.*?<!-- ENDPHP -->#s', '<!-- PHP -->', $code); 130 130 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); 132 132 $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); 134 134 135 135 preg_match_all('#<!-- INCLUDEPHP ([a-zA-Z0-9\_\-\+\./]+) -->#', $code, $matches); … … 194 194 case 'INCLUDE': 195 195 $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 196 222 $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 } 198 229 break; 199 230 … … 221 252 } 222 253 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 223 261 // There will be a number of occasions where we switch into and out of 224 262 // PHP mode instantaneously. Rather than "burden" the parser with this 225 263 // 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; 229 270 } 230 271 … … 254 295 if (strpos($text_blocks, '{L_') !== false) 255 296 { 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); 257 298 } 258 299 … … 261 302 if (strpos($text_blocks, '{LA_') !== false) 262 303 { 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); 264 305 } 265 306 266 307 // 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); 269 310 270 311 return; … … 592 633 function compile_tag_include($tag_args) 593 634 { 635 // Process dynamic includes 636 if ($tag_args[0] == '$') 637 { 638 return "if (isset($tag_args)) { \$this->_tpl_include($tag_args); }"; 639 } 640 594 641 return "\$this->_tpl_include('$tag_args');"; 595 642 } … … 601 648 function compile_tag_include_php($tag_args) 602 649 { 603 return " include('" . $tag_args . "');";650 return "\$this->_php_include('$tag_args');"; 604 651 } 605 652 … … 749 796 $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx; 750 797 798 $data = "<?php if (!defined('IN_PHPBB')) exit;" . ((strpos($data, '<?php') === 0) ? substr($data, 5) : ' ?>' . $data); 799 751 800 if ($fp = @fopen($filename, 'wb')) 752 801 { … … 756 805 @fclose($fp); 757 806 758 phpbb_chmod($filename, CHMOD_ WRITE);807 phpbb_chmod($filename, CHMOD_READ | CHMOD_WRITE); 759 808 } 760 809 -
trunk/forum/includes/functions_transfer.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_transfer.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 207 207 208 208 $this->_chdir($directory); 209 $result = $this->_ls( '');209 $result = $this->_ls(); 210 210 211 211 if ($result !== false && is_array($result)) … … 317 317 } 318 318 319 // login to the server 320 if (!@ftp_login($this->connection, $this->username, $this->password)) 321 { 322 return 'ERR_UNABLE_TO_LOGIN'; 323 } 324 319 325 // attempt to turn pasv mode on 320 326 @ftp_pasv($this->connection, true); 321 322 // login to the server323 if (!@ftp_login($this->connection, $this->username, $this->password))324 {325 return 'ERR_UNABLE_TO_LOGIN';326 }327 327 328 328 // change to the root directory … … 461 461 function _ls($dir = './') 462 462 { 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; 464 495 } 465 496 … … 707 738 while (!@feof($this->data_connection)) 708 739 { 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 } 710 746 } 711 747 $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 } 712 780 713 781 return $list; … … 792 860 $response .= $result; 793 861 } 794 while (substr($res ponse, 3, 1) != ' ');862 while (substr($result, 3, 1) !== ' '); 795 863 796 864 if (!preg_match('#^[123]#', $response)) -
trunk/forum/includes/functions_upload.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_upload.php 8783 2008-08-23 17:23:40Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 59 59 $this->filename = $upload_ary['tmp_name']; 60 60 $this->filesize = $upload_ary['size']; 61 $name = trim( htmlspecialchars(basename($upload_ary['name'])));61 $name = trim(utf8_htmlspecialchars(utf8_basename($upload_ary['name']))); 62 62 $this->realname = $this->uploadname = (STRIP) ? stripslashes($name) : $name; 63 63 $this->mimetype = $upload_ary['type']; … … 291 291 $upload_mode = (@ini_get('open_basedir') || @ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') ? 'move' : 'copy'; 292 292 $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); 294 294 295 295 // Check if the file already exist, else there is something wrong... … … 314 314 { 315 315 $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); 316 return false;317 316 } 318 317 } 319 320 @unlink($this->filename);321 318 322 319 break; … … 329 326 { 330 327 $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); 331 return false;332 328 } 333 329 } 334 335 @unlink($this->filename);336 330 337 331 break; … … 342 336 { 343 337 $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); 344 return false;345 338 } 346 @unlink($this->filename);347 339 348 340 break; 341 } 342 343 // Remove temporary filename 344 @unlink($this->filename); 345 346 if (sizeof($this->error)) 347 { 348 return false; 349 349 } 350 350 … … 418 418 if ($this->upload->max_filesize && ($this->get('filesize') > $this->upload->max_filesize || $this->filesize == 0)) 419 419 { 420 $size_lang = ($this->upload->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->upload->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES'] );421 420 $max_filesize = get_formatted_filesize($this->upload->max_filesize, false); 422 421 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']); 424 423 425 424 return false; … … 595 594 if ($file->get('filename') == 'none') 596 595 { 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]); 598 608 return $file; 599 609 } … … 625 635 if ($filedata === false) 626 636 { 627 $_FILES[$form_name]['name'] = basename($source_file);637 $_FILES[$form_name]['name'] = utf8_basename($source_file); 628 638 $_FILES[$form_name]['size'] = 0; 629 639 $mimetype = ''; … … 671 681 if ($file->get('filename') == 'none') 672 682 { 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]); 674 695 return $file; 675 696 } … … 726 747 727 748 $url['path'] = implode('', $url['path']); 728 $upload_ary['name'] = basename($url['path']) . (($ext) ? '.' . $ext : '');749 $upload_ary['name'] = utf8_basename($url['path']) . (($ext) ? '.' . $ext : ''); 729 750 $filename = $url['path']; 730 751 $filesize = 0; … … 819 840 { 820 841 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]); 822 854 break; 823 855 824 856 case 2: 825 $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);826 857 $max_filesize = get_formatted_filesize($this->max_filesize, false); 827 858 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']); 829 860 break; 830 861 … … 859 890 if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0)) 860 891 { 861 $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']);862 892 $max_filesize = get_formatted_filesize($this->max_filesize, false); 863 893 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']); 865 895 } 866 896 -
trunk/forum/includes/functions_user.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : functions_user.php 8949 2008-09-26 21:29:05Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 172 172 'user_pass_convert' => 0, 173 173 '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']), 175 175 'group_id' => $user_row['group_id'], 176 176 'user_type' => $user_row['user_type'], … … 188 188 'user_regdate' => time(), 189 189 '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, 191 193 192 194 'user_inactive_reason' => 0, … … 276 278 group_set_user_default($user_row['group_id'], array($user_id), false); 277 279 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 278 310 // 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) 280 312 { 281 313 set_config('newest_user_id', $user_id, true); 282 314 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); 284 316 285 317 $sql = 'SELECT group_colour … … 420 452 SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = '' 421 453 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"; 422 459 $db->sql_query($sql); 423 460 … … 491 528 $db->sql_transaction('begin'); 492 529 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); 494 531 495 532 foreach ($table_ary as $table) … … 501 538 502 539 $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); 503 567 504 568 // Remove any undelivered mails... … … 570 634 if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE) 571 635 { 572 set_config ('num_users', $config['num_users'] -1, true);636 set_config_count('num_users', -1, true); 573 637 } 574 638 … … 651 715 if ($deactivated) 652 716 { 653 set_config ('num_users', $config['num_users'] - $deactivated, true);717 set_config_count('num_users', $deactivated * (-1), true); 654 718 } 655 719 656 720 if ($activated) 657 721 { 658 set_config ('num_users', $config['num_users'] +$activated, true);722 set_config_count('num_users', $activated, true); 659 723 } 660 724 … … 895 959 } 896 960 } 897 else 961 962 if (empty($banlist_ary)) 898 963 { 899 964 trigger_error('NO_IPS_DEFINED'); … … 968 1033 while ($row = $db->sql_fetchrow($result)); 969 1034 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 971 1046 unset($banlist_ary_tmp); 972 1047 } … … 1051 1126 $log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_'; 1052 1127 1053 // Add to moderator and admin log1128 // Add to moderator log, admin log and user notes 1054 1129 add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log); 1055 1130 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 } 1056 1138 1057 1139 $cache->destroy('sql', BANLIST_TABLE); … … 1092 1174 { 1093 1175 case 'user': 1094 $sql = 'SELECT u.username AS unban_info 1176 $sql = 'SELECT u.username AS unban_info, u.user_id 1095 1177 FROM ' . USERS_TABLE . ' u, ' . BANLIST_TABLE . ' b 1096 1178 WHERE ' . $db->sql_in_set('b.ban_id', $unban_sql) . ' … … 1113 1195 1114 1196 $l_unban_list = ''; 1197 $user_ids_ary = array(); 1115 1198 while ($row = $db->sql_fetchrow($result)) 1116 1199 { 1117 1200 $l_unban_list .= (($l_unban_list != '') ? ', ' : '') . $row['unban_info']; 1201 if ($mode == 'user') 1202 { 1203 $user_ids_ary[] = $row['user_id']; 1204 } 1118 1205 } 1119 1206 $db->sql_freeresult($result); … … 1123 1210 $db->sql_query($sql); 1124 1211 1125 // Add to moderator and admin log1212 // Add to moderator log, admin log and user notes 1126 1213 add_log('admin', 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list); 1127 1214 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 } 1128 1222 } 1129 1223 … … 1135 1229 /** 1136 1230 * Whois facility 1231 * 1232 * @link http://tools.ietf.org/html/rfc3912 RFC3912: WHOIS Protocol Specification 1137 1233 */ 1138 1234 function user_ipwhois($ip) … … 1147 1243 } 1148 1244 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 1156 1245 if (($fsk = @fsockopen('whois.arin.net', 43))) 1157 1246 { 1158 fputs($fsk, "$ip\n"); 1247 // CRLF as per RFC3912 1248 fputs($fsk, "$ip\r\n"); 1159 1249 while (!feof($fsk)) 1160 1250 { … … 1164 1254 } 1165 1255 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; 1182 1288 } 1183 1289 … … 1415 1521 else if ($mbstring) 1416 1522 { 1417 $regex = '[-\]_+ [[:upper:][:lower:][:digit:]]+';1523 $regex = '[-\]_+ \[[:upper:][:lower:][:digit:]]+'; 1418 1524 } 1419 1525 else … … 1440 1546 else if ($mbstring) 1441 1547 { 1442 $matches = array(); 1443 mb_ereg_search_init('^' . $username . '$', $regex, $matches); 1548 mb_ereg_search_init($username, '^' . $regex . '$'); 1444 1549 if (!mb_ereg_search()) 1445 1550 { … … 1623 1728 $sql = 'SELECT user_email_hash 1624 1729 FROM ' . USERS_TABLE . " 1625 WHERE user_email_hash = " . (crc32($email) . strlen($email));1730 WHERE user_email_hash = " . $db->sql_escape(phpbb_email_hash($email)); 1626 1731 $result = $db->sql_query($sql); 1627 1732 $row = $db->sql_fetchrow($result); … … 2057 2162 { 2058 2163 $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), 2061 2166 'name' => ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $sub_file))), 2062 2167 ); … … 2345 2450 2346 2451 $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'); 2365 2455 2366 2456 // Check data. Limit group name length. … … 2400 2490 if (sizeof($group_attributes)) 2401 2491 { 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); 2410 2494 } 2411 2495 … … 2432 2516 remove_default_avatar($group_id, $user_ary); 2433 2517 } 2518 2434 2519 if (isset($sql_ary['group_rank']) && !$sql_ary['group_rank']) 2435 2520 { … … 2447 2532 WHERE group_id = $group_id"; 2448 2533 $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 } 2449 2560 } 2450 2561 else … … 2457 2568 { 2458 2569 $group_id = $db->sql_nextid(); 2570 2459 2571 if (isset($sql_ary['group_avatar_type']) && $sql_ary['group_avatar_type'] == AVATAR_UPLOAD) 2460 2572 { … … 2467 2579 if (sizeof($group_attributes)) 2468 2580 { 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])) 2472 2585 { 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; 2480 2587 } 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]; 2481 2596 } 2482 2597 } … … 2682 2797 if ($default) 2683 2798 { 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); 2685 2800 } 2686 2801 … … 2695 2810 } 2696 2811 2697 $log = ($leader) ? 'LOG_MODS_ADDED' : 'LOG_USERS_ADDED';2812 $log = ($leader) ? 'LOG_MODS_ADDED' : (($pending) ? 'LOG_USERS_PENDING' : 'LOG_USERS_ADDED'); 2698 2813 2699 2814 add_log('admin', $log, $group_name, implode(', ', $username_ary)); … … 2714 2829 function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false) 2715 2830 { 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 } 2719 2841 2720 2842 // We need both username and user_id info … … 2780 2902 while ($row = $db->sql_fetchrow($result)) 2781 2903 { 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']])) 2783 2905 { 2784 2906 $temp_ary[$row['user_id']] = $row['group_id']; … … 2787 2909 $db->sql_freeresult($result); 2788 2910 2911 // sql_where_ary holds the new default groups and their users 2789 2912 $sql_where_ary = array(); 2790 2913 foreach ($temp_ary as $uid => $gid) … … 2820 2943 $log = 'LOG_GROUP_REMOVE'; 2821 2944 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 } 2823 2949 2824 2950 group_update_listings($group_id); … … 3010 3136 3011 3137 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 3012 3159 $sql = 'SELECT user_id, group_id FROM ' . USERS_TABLE . ' 3013 3160 WHERE ' . $db->sql_in_set('user_id', $user_id_ary, false, true); … … 3098 3245 function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false) 3099 3246 { 3100 global $ db;3247 global $cache, $db; 3101 3248 3102 3249 if (empty($user_id_ary)) … … 3198 3345 group_update_listings($group_id); 3199 3346 } 3347 3348 // Because some tables/caches use usercolour-specific data we need to purge this here. 3349 $cache->destroy('sql', MODERATOR_CACHE_TABLE); 3200 3350 } 3201 3351 … … 3214 3364 $db->sql_freeresult($result); 3215 3365 3216 if (!$row )3366 if (!$row || ($row['group_type'] == GROUP_SPECIAL && empty($user->lang))) 3217 3367 { 3218 3368 return ''; … … 3357 3507 } 3358 3508 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 */ 3516 function 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 3359 3582 ?> -
trunk/forum/includes/mcp/mcp_front.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_front.php 9029 2008-10-18 18:44:41Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 35 35 36 36 $template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false); 37 37 38 38 if (!empty($forum_list)) 39 39 { … … 120 120 } 121 121 122 $s_hidden_fields = build_hidden_fields(array( 123 'redirect' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main' . (($forum_id) ? '&f=' . $forum_id : '')) 124 )); 125 122 126 $template->assign_vars(array( 127 'S_HIDDEN_FIELDS' => $s_hidden_fields, 123 128 'S_MCP_QUEUE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"), 124 129 )); … … 153 158 FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p 154 159 WHERE r.post_id = p.post_id 160 AND r.pm_id = 0 155 161 AND r.report_closed = 0 156 162 AND p.forum_id IN (0, ' . implode(', ', $forum_list) . ')'; … … 182 188 183 189 'WHERE' => 'r.post_id = p.post_id 190 AND r.pm_id = 0 184 191 AND r.report_closed = 0 185 192 AND r.reason_id = rr.reason_id … … 241 248 ); 242 249 } 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'] . "&i=pm_reports&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 ); 243 340 } 244 341 } -
trunk/forum/includes/mcp/mcp_logs.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_logs.php 9029 2008-10-18 18:44:41Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 165 165 $sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC'); 166 166 167 $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); 168 $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; 169 167 170 // Grab log data 168 171 $log_data = array(); 169 172 $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); 171 174 172 175 $template->assign_vars(array( 173 176 'PAGE_NUMBER' => on_page($log_count, $config['topics_per_page'], $start), 174 177 'TOTAL' => ($log_count == 1) ? $user->lang['TOTAL_LOG'] : sprintf($user->lang['TOTAL_LOGS'], $log_count), 175 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param ", $log_count, $config['topics_per_page'], $start),178 'PAGINATION' => generate_pagination($this->u_action . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start), 176 179 177 180 'L_TITLE' => $user->lang['MCP_LOGS'], … … 183 186 'S_SELECT_SORT_DAYS' => $s_limit_days, 184 187 'S_LOGS' => ($log_count > 0), 188 'S_KEYWORDS' => $keywords, 185 189 ) 186 190 ); … … 189 193 { 190 194 $data = array(); 191 195 192 196 $checks = array('viewtopic', 'viewforum'); 193 197 foreach ($checks as $check) -
trunk/forum/includes/mcp/mcp_main.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_main.php 8950 2008-09-27 10:59:25Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 569 569 $additional_msg = $user->lang['FORUM_NOT_POSTABLE']; 570 570 } 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))) 572 572 { 573 573 $additional_msg = $user->lang['USER_CANNOT_POST']; … … 595 595 $leave_shadow = (isset($_POST['move_leave_shadow'])) ? true : false; 596 596 597 $topics_moved = sizeof($topic_ids);598 $topics_authed_moved = 0;599 597 $forum_sync_data = array(); 600 598 … … 602 600 $forum_sync_data[$to_forum_id] = $forum_data; 603 601 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 604 620 foreach ($topic_data as $topic_id => $topic_info) 605 621 { 606 if ($topic_info['topic_approved'] == '1')622 if ($topic_info['topic_approved']) 607 623 { 608 624 $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 } 609 640 } 610 641 } … … 612 643 $db->sql_transaction('begin'); 613 644 614 $sql = 'SELECT SUM(t.topic_replies + t.topic_approved) as topic_posts615 FROM ' . TOPICS_TABLE . ' t616 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 621 645 $sync_sql = array(); 622 646 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; 627 650 } 628 651 629 652 if ($topics_authed_moved) 630 653 { 631 $sync_sql[$to_forum_id][] 632 } 633 634 $sync_sql[$to_forum_id][] 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; 635 658 636 659 // Move topics, but do not resync yet … … 693 716 $db->sql_query('INSERT INTO ' . TOPICS_TABLE . $db->sql_build_array('INSERT', $shadow)); 694 717 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--; 697 721 } 698 722 } 699 723 unset($topic_data); 700 724 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; 706 738 } 707 739 … … 782 814 foreach ($data as $topic_id => $row) 783 815 { 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 } 785 824 } 786 825 … … 866 905 foreach ($post_data as $id => $row) 867 906 { 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); 869 909 } 870 910 … … 930 970 else 931 971 { 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 932 977 meta_refresh(3, $redirect); 933 978 trigger_error($success_msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>') . '<br /><br />' . implode('<br /><br />', $return_link)); … … 1028 1073 'poll_title' => (string) $topic_row['poll_title'], 1029 1074 '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'], 1031 1078 ); 1032 1079 … … 1130 1177 'is_orphan' => (int) $attach_row['is_orphan'], 1131 1178 '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']), 1134 1181 'download_count' => (int) $attach_row['download_count'], 1135 1182 'attach_comment' => (string) $attach_row['attach_comment'], … … 1190 1237 1191 1238 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); 1194 1241 1195 1242 foreach ($new_topic_id_list as $topic_id => $new_topic_id) -
trunk/forum/includes/mcp/mcp_notes.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_notes.php 8598 2008-06-04 15:37:06Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 194 194 $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC'); 195 195 196 $keywords = utf8_normalize_nfc(request_var('keywords', '', true)); 197 $keywords_param = !empty($keywords) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; 198 196 199 $log_data = array(); 197 200 $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); 199 202 200 203 if ($log_count) … … 220 223 'S_SELECT_SORT_KEY' => $s_sort_key, 221 224 'S_SELECT_SORT_DAYS' => $s_limit_days, 225 'S_KEYWORDS' => $keywords, 222 226 223 227 'L_TITLE' => $user->lang['MCP_NOTES_USER'], 224 228 225 'PAGE_NUMBER' => on_page($log_count, $config[' posts_per_page'], $start),226 'PAGINATION' => generate_pagination($this->u_action . "& st=$st&sk=$sk&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 . "&$u_sort_param$keywords_param", $log_count, $config['topics_per_page'], $start), 227 231 'TOTAL_REPORTS' => ($log_count == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $log_count), 228 232 229 'USERNAME' => $userrow['username'],230 'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '',231 233 'RANK_TITLE' => $rank_title, 232 234 'JOINED' => $user->format_date($userrow['user_regdate']), 233 235 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0, 234 236 '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']), 235 242 236 243 'AVATAR_IMG' => $avatar_img, -
trunk/forum/includes/mcp/mcp_queue.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_queue.php 9133 2008-11-30 12:03:43Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 106 106 $template->assign_vars(array( 107 107 'S_TOPIC_REVIEW' => true, 108 'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'], 108 109 'TOPIC_TITLE' => $post_info['topic_title']) 109 110 ); … … 492 493 493 494 $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(); 498 497 499 498 foreach ($post_info as $post_id => $post_data) 500 499 { 500 if ($post_data['post_approved']) 501 { 502 $post_approved_list[] = $post_id; 503 continue; 504 } 505 501 506 $topic_id_list[$post_data['topic_id']] = 1; 502 507 … … 518 523 if ($post_data['forum_id']) 519 524 { 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' => 0525 );526 }527 528 525 $total_topics++; 529 $forum_topics_posts[$post_data['forum_id']]['forum_topics']++;530 526 } 531 527 $topic_approve_sql[] = $post_data['topic_id']; … … 540 536 else 541 537 { 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 548 538 $approve_log[] = array( 549 539 'type' => 'post', … … 556 546 if ($post_data['forum_id']) 557 547 { 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' => 0563 );564 }565 566 548 $total_posts++; 567 $forum_topics_posts[$post_data['forum_id']]['forum_posts']++;568 549 569 550 // Increment by topic_replies if we approve a topic... … … 572 553 { 573 554 $total_posts += $post_data['topic_replies']; 574 $forum_topics_posts[$post_data['forum_id']]['forum_posts'] += $post_data['topic_replies'];575 555 } 576 556 } 577 557 578 558 $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]]); 585 565 } 586 566 … … 601 581 } 602 582 583 unset($topic_approve_sql, $post_approve_sql); 584 603 585 foreach ($approve_log as $log_data) 604 586 { 605 587 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_replies614 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 }632 588 } 633 589 … … 653 609 if ($total_topics) 654 610 { 655 set_config ('num_topics', $config['num_topics'] +$total_topics, true);611 set_config_count('num_topics', $total_topics, true); 656 612 } 657 613 658 614 if ($total_posts) 659 615 { 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); 670 621 unset($topic_id_list, $forum_id_list); 671 622 … … 734 685 else 735 686 { 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'; 737 688 } 738 689 } … … 846 797 if (confirm_box(true)) 847 798 { 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 855 803 foreach ($post_info as $post_id => $post_data) 856 804 { 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'], 885 839 ); 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)) 931 856 { 932 857 if (!function_exists('delete_posts')) … … 936 861 937 862 // 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)); 939 866 940 867 foreach ($disapprove_log as $log_data) … … 943 870 } 944 871 } 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);954 872 955 873 $messenger = new messenger(); … … 980 898 // Load up the language pack 981 899 $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); 983 901 984 902 // If we find the reason in this language pack use it … … 1019 937 $messenger->save_queue(); 1020 938 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'; 1024 942 } 1025 943 else 1026 944 { 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'; 1028 946 } 1029 947 } -
trunk/forum/includes/mcp/mcp_reports.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_reports.php 9015 2008-10-14 18:29:50Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 78 78 AND rr.reason_id = r.reason_id 79 79 AND r.user_id = u.user_id 80 AND r.pm_id = 0 80 81 ORDER BY report_closed ASC'; 81 82 $result = $db->sql_query_limit($sql, 1); … … 116 117 $template->assign_vars(array( 117 118 'S_TOPIC_REVIEW' => true, 119 'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'], 118 120 'TOPIC_TITLE' => $post_info['topic_title']) 119 121 ); … … 150 152 if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id'])) 151 153 { 152 $extensions = $cache->obtain_attach_extensions($post_info['forum_id']);153 154 154 $sql = 'SELECT * 155 155 FROM ' . ATTACHMENTS_TABLE . ' 156 156 WHERE post_msg_id = ' . $post_id . ' 157 157 AND in_message = 0 158 ORDER BY filetime DESC , post_msg_id ASC';158 ORDER BY filetime DESC'; 159 159 $result = $db->sql_query($sql); 160 160 … … 259 259 unset($forum_list_read); 260 260 261 if ($topic_id && $forum_id)261 if ($topic_id) 262 262 { 263 263 $topic_info = get_topic_data(array($topic_id)); … … 268 268 } 269 269 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 } 276 279 } 277 280 … … 330 333 331 334 $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)) : ''; 333 336 334 337 if ($mode == 'reports') … … 347 350 AND r.post_id = p.post_id 348 351 " . (($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' : '') . ' 350 353 ' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . " 351 354 AND t.topic_id = p.topic_id 355 AND r.pm_id = 0 352 356 $limit_time_sql 353 357 ORDER BY $sort_order_sql"; … … 372 376 AND u.user_id = p.poster_id 373 377 AND ru.user_id = r.user_id 378 AND r.pm_id = 0 374 379 ORDER BY ' . $sort_order_sql; 375 380 $result = $db->sql_query($sql); … … 426 431 'TOPIC_ID' => $topic_id, 427 432 '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), 429 434 ) 430 435 ); … … 439 444 * Closes a report 440 445 */ 441 function close_report($report_id_list, $mode, $action )446 function close_report($report_id_list, $mode, $action, $pm = false) 442 447 { 443 global $db, $template, $user, $config ;448 global $db, $template, $user, $config, $auth; 444 449 global $phpEx, $phpbb_root_path; 445 450 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; 449 459 $result = $db->sql_query($sql); 450 460 … … 452 462 while ($row = $db->sql_fetchrow($result)) 453 463 { 454 $post_id_list[] = $row[ 'post_id'];464 $post_id_list[] = $row[$id_column]; 455 465 } 456 466 $post_id_list = array_unique($post_id_list); 457 467 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 } 461 481 } 462 482 … … 465 485 $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&mode=reports'); 466 486 } 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')) . '&mode=pm_reports'); 490 } 467 491 else if ($action == 'close' && !request_var('r', 0)) 468 492 { 469 $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode= reports');493 $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&mode=' . $module); 470 494 } 471 495 else … … 478 502 479 503 $s_hidden_fields = build_hidden_fields(array( 480 'i' => 'reports',504 'i' => $module, 481 505 'mode' => $mode, 482 506 'report_id_list' => $report_id_list, … … 487 511 if (confirm_box(true)) 488 512 { 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_type492 FROM '. REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u513 $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 493 517 WHERE ' . $db->sql_in_set('r.report_id', $report_id_list) . ' 494 518 ' . (($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; 496 520 $result = $db->sql_query($sql); 497 521 … … 504 528 if (!$report['report_closed']) 505 529 { 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 } 508 536 } 509 537 … … 520 548 $close_report_topics = array_unique($close_report_topics); 521 549 522 if ( sizeof($close_report_posts))550 if (!$pm && sizeof($close_report_posts)) 523 551 { 524 552 // Get a list of topics that still contain reported posts … … 559 587 if (sizeof($close_report_posts)) 560 588 { 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); 572 594 $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 } 573 616 } 574 617 } … … 580 623 foreach ($reports as $report) 581 624 { 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 } 583 633 } 584 634 … … 595 645 } 596 646 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']); 600 650 601 651 $messenger->to($reporter['user_email'], $reporter['username']); 602 652 $messenger->im($reporter['user_jabber'], $reporter['username']); 603 653 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 } 610 671 611 672 $messenger->send($reporter['user_notify_type']); 612 673 } 613 674 } 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 621 685 unset($notify_reporters, $post_info, $reports); 622 686 623 687 $messenger->save_queue(); 624 688 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'; 626 690 } 627 691 else 628 692 { 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); 630 694 } 631 695 … … 640 704 { 641 705 meta_refresh(3, $redirect); 706 642 707 $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 }647 708 $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) . '&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) . '&f=' . current($forum_ids)) . '">', '</a>') . '<br /><br />'; 720 } 721 } 722 653 723 trigger_error($user->lang[$success_msg] . '<br /><br />' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "<a href=\"$redirect\">", '</a>')); 654 724 } -
trunk/forum/includes/mcp/mcp_topic.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_topic.php 9030 2008-10-19 18:32:11Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 107 107 if ($total == -1) 108 108 { 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 } 110 117 } 111 118 … … 260 267 $s_topic_icons = false; 261 268 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'])) 263 270 { 264 271 include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); … … 302 309 'ACTION' => $action, 303 310 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'), 306 314 307 315 'S_MCP_ACTION' => "$url&i=$id&mode=$mode&action=$action&start=$start", … … 502 510 503 511 // Update forum statistics 504 set_config ('num_topics', $config['num_topics'] +1, true);512 set_config_count('num_topics', 1, true); 505 513 506 514 // Link back to both topics -
trunk/forum/includes/mcp/mcp_warn.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp_warn.php 9002 2008-10-11 17:01:43Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 205 205 $sql = 'SELECT u.*, p.* 206 206 FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u 207 WHERE p ost_id = $post_id207 WHERE p.post_id = $post_id 208 208 AND u.user_id = p.poster_id"; 209 209 $result = $db->sql_query($sql); … … 421 421 'U_POST_ACTION' => $this->u_action, 422 422 423 'USERNAME' => $user_row['username'],424 'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',425 423 'RANK_TITLE' => $rank_title, 426 424 'JOINED' => $user->format_date($user_row['user_regdate']), 427 425 'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0, 428 426 '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']), 429 432 430 433 'AVATAR_IMG' => $avatar_img, -
trunk/forum/includes/message_parser.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : message_parser.php 9034 2008-10-24 00:49:30Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 119 119 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#iUe' => "\$this->bbcode_img('\$1')")), 120 120 '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')")), 122 122 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")), 123 123 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#ise' => "\$this->bbcode_parse_list('\$0')")), … … 696 696 * [quote="[quote]test[/quote]"]test[/quote] (correct: parsed - Username displayed as [quote]test[/quote]) 697 697 * #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) 698 699 */ 699 700 … … 706 707 707 708 // To let the parser not catch tokens within quote_username quotes we encode them before we start this... 708 $in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']' ), array('[', ']'), '\$1') . '"]'", $in);709 $in = preg_replace('#quote="(.*?)"\]#ie', "'quote="' . str_replace(array('[', ']', '\\\"'), array('[', ']', '\"'), '\$1') . '"]'", $in); 709 710 710 711 $tok = ']'; … … 859 860 while ($in); 860 861 862 $out .= $buffer; 863 861 864 if (sizeof($close_tags)) 862 865 { … … 1050 1053 // Init BBCode UID 1051 1054 $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; 1057 1056 } 1058 1057 … … 1064 1063 global $config, $db, $user; 1065 1064 1066 $mode = ($mode != 'post') ? 'sig' : 'post';1067 1068 1065 $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 } 1069 1074 1070 1075 $this->allow_img_bbcode = $allow_img_bbcode; … … 1091 1096 $this->message = preg_replace($match, $replace, trim($this->message)); 1092 1097 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']); 1101 1114 return (!$update_this_message) ? $return_message : $this->warn_msg; 1102 1115 } 1103 }1104 1105 // Check for "empty" message1106 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;1110 1116 } 1111 1117 … … 1150 1156 $num_urls += preg_match_all('#\<!-- ([lmwe]) --\>.*?\<!-- \1 --\>#', $this->message, $matches); 1151 1157 } 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; 1152 1166 } 1153 1167 … … 1299 1313 1300 1314 // (assertion) 1301 $match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)';1315 $match[] = preg_quote($row['code'], '#'); 1302 1316 $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILIES_PATH}/' . $row['smiley_url'] . '" alt="' . $row['code'] . '" title="' . $row['emotion'] . '" /><!-- s' . $row['code'] . ' -->'; 1303 1317 } … … 1309 1323 if ($max_smilies) 1310 1324 { 1311 $num_matches = preg_match_all('# ' . implode('|', $match) . '#', $this->message, $matches);1325 $num_matches = preg_match_all('#(?<=^|[\n .])(?:' . implode('|', $match) . ')(?![^<>]*>)#', $this->message, $matches); 1312 1326 unset($matches); 1313 1327 … … 1320 1334 1321 1335 // 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)); 1323 1337 } 1324 1338 } … … 1613 1627 $bbcode_bitfield = $this->bbcode_bitfield; 1614 1628 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'); 1616 1630 1617 1631 $bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield)); … … 1636 1650 $this->warn_msg[] = $user->lang['POLL_TITLE_TOO_LONG']; 1637 1651 } 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'); 1639 1653 if (strlen($poll['poll_title']) > 255) 1640 1654 { -
trunk/forum/includes/search/fulltext_mysql.php
r400 r702 3 3 * 4 4 * @package search 5 * @version $Id : fulltext_mysql.php 8814 2008-09-04 12:01:47Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 119 119 function split_keywords(&$keywords, $terms) 120 120 { 121 global $config ;121 global $config, $user; 122 122 123 123 if ($terms == 'all') … … 166 166 preg_match_all('#(?:[^\w*"()]|^)([+\-|]?(?:[\w*"()]+\'?)*[\w*"()])(?:[^\w*"()]|$)#u', $split_keywords, $matches); 167 167 $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))); 168 174 } 169 175 … … 319 325 * 320 326 * @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 331 338 * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered 332 339 * @param int $start indicates the first index of the page … … 336 343 * @access public 337 344 */ 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) 339 346 { 340 347 global $config, $db; … … 435 442 $sql_from = ($join_topic) ? TOPICS_TABLE . ' t, ' : ''; 436 443 $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 } 438 457 439 458 $sql_where_options = $sql_sort_join; … … 442 461 $sql_where_options .= (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; 443 462 $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; 445 464 $sql_where_options .= ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; 446 465 $sql_where_options .= $sql_match_where; … … 455 474 while ($row = $db->sql_fetchrow($result)) 456 475 { 457 $id_ary[] = $row[$field];476 $id_ary[] = (int) $row[$field]; 458 477 } 459 478 $db->sql_freeresult($result); … … 490 509 * Performs a search on an author's posts without caring about message contents. Depends on display specific params 491 510 * 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) 498 530 { 499 531 global $config, $db; … … 517 549 implode(',', $ex_fid_ary), 518 550 implode(',', $m_approve_fid_ary), 519 implode(',', $author_ary) 551 implode(',', $author_ary), 552 $author_name, 520 553 ))); 521 554 … … 530 563 531 564 // 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 } 533 574 $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; 534 575 $sql_topic_id = ($topic_id) ? ' AND p.topic_id = ' . (int) $topic_id : ''; … … 610 651 while ($row = $db->sql_fetchrow($result)) 611 652 { 612 $id_ary[] = $row[$field];653 $id_ary[] = (int) $row[$field]; 613 654 } 614 655 $db->sql_freeresult($result); -
trunk/forum/includes/search/fulltext_native.php
r400 r702 3 3 * 4 4 * @package search 5 * @version $Id : fulltext_native.php 9173 2008-12-04 17:01:39Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 82 82 function split_keywords($keywords, $terms) 83 83 { 84 global $db, $user ;84 global $db, $user, $config; 85 85 86 86 $keywords = trim($this->cleanup($keywords, '+-|()*')); … … 168 168 169 169 $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 } 170 177 171 178 // $keywords input format: each word separated by a space, words in a bracket are not separated … … 196 203 $sql = 'SELECT word_id, word_text, word_common 197 204 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'; 199 207 $result = $db->sql_query($sql); 200 208 … … 371 379 } 372 380 373 sort($this->must_contain_ids);374 sort($this->must_not_contain_ids);375 sort($this->must_exclude_one_ids);376 377 381 if (!empty($this->search_query)) 378 382 { … … 386 390 * 387 391 * @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 398 403 * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered 399 404 * @param int $start indicates the first index of the page … … 403 408 * @access public 404 409 */ 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) 406 411 { 407 412 global $config, $db; … … 413 418 } 414 419 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 415 428 // generate a search_key from all the options to identify the results 416 429 $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), 420 433 $type, 421 434 $fields, … … 426 439 implode(',', $ex_fid_ary), 427 440 implode(',', $m_approve_fid_ary), 428 implode(',', $author_ary) 441 implode(',', $author_ary), 442 $author_name, 429 443 ))); 430 444 … … 617 631 if (sizeof($author_ary)) 618 632 { 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; 620 643 } 621 644 … … 639 662 $sql_array_count = $sql_array; 640 663 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 641 672 switch ($db->sql_layer) 642 673 { … … 645 676 646 677 // 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']; 648 679 $is_mysql = true; 649 680 … … 694 725 break; 695 726 } 696 727 697 728 if ($left_join_topics) 698 729 { 699 $sql_array['LEFT_JOIN'][ $left_join_topics] = array(730 $sql_array['LEFT_JOIN'][] = array( 700 731 'FROM' => array(TOPICS_TABLE => 't'), 701 732 'ON' => 'p.topic_id = t.topic_id' … … 714 745 while ($row = $db->sql_fetchrow($result)) 715 746 { 716 $id_ary[] = $row[(($type == 'posts') ? 'post_id' : 'topic_id')];747 $id_ary[] = (int) $row[(($type == 'posts') ? 'post_id' : 'topic_id')]; 717 748 } 718 749 $db->sql_freeresult($result); … … 726 757 if (!$total_results && $is_mysql) 727 758 { 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 728 769 $sql = 'SELECT FOUND_ROWS() as total_results'; 729 770 $result = $db->sql_query($sql); … … 749 790 * @param string $type contains either posts or topics depending on what should be searched for 750 791 * @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 759 801 * @param array &$id_ary passed by reference, to be filled with ids for the page specified by $start and $per_page, should be ordered 760 802 * @param int $start indicates the first index of the page … … 764 806 * @access public 765 807 */ 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) 767 809 { 768 810 global $config, $db; … … 786 828 implode(',', $ex_fid_ary), 787 829 implode(',', $m_approve_fid_ary), 788 implode(',', $author_ary) 830 implode(',', $author_ary), 831 $author_name, 789 832 ))); 790 833 … … 799 842 800 843 // 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 } 802 853 $sql_fora = (sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : ''; 803 854 $sql_time = ($sort_days) ? ' AND p.post_time >= ' . (time() - ($sort_days * 86400)) : ''; … … 849 900 case 'mysql4': 850 901 case 'mysqli': 851 $select = 'SQL_CALC_FOUND_ROWS ' . $select;902 // $select = 'SQL_CALC_FOUND_ROWS ' . $select; 852 903 $is_mysql = true; 853 904 break; … … 936 987 while ($row = $db->sql_fetchrow($result)) 937 988 { 938 $id_ary[] = $row[$field];989 $id_ary[] = (int) $row[$field]; 939 990 } 940 991 $db->sql_freeresult($result); … … 942 993 if (!$total_results && $is_mysql) 943 994 { 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 944 1001 $sql = 'SELECT FOUND_ROWS() as total_results'; 945 1002 $result = $db->sql_query($sql); … … 1111 1168 // Get unique words from the above arrays 1112 1169 $unique_add_words = array_unique(array_merge($words['add']['post'], $words['add']['title'])); 1113 1170 1114 1171 // We now have unique arrays of all words to be added and removed and 1115 1172 // individual arrays of added and removed words for text and title. What -
trunk/forum/includes/session.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : session.php 9170 2008-12-04 12:56:12Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 214 214 $this->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : ''; 215 215 $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']) : ''; 217 217 218 218 $this->host = $this->extract_current_hostname(); … … 222 222 if ($config['forwarded_for_check']) 223 223 { 224 $this->forwarded_for = preg_replace('# , +#', ', ', $this->forwarded_for);224 $this->forwarded_for = preg_replace('#[ ]{2,}#', ' ', str_replace(array(',', ' '), ' ', $this->forwarded_for)); 225 225 226 226 // split the list of IPs 227 $ips = explode(' ,', $this->forwarded_for);227 $ips = explode(' ', $this->forwarded_for); 228 228 foreach ($ips as $ip) 229 229 { … … 268 268 // Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests 269 269 // 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 271 292 $this->load = false; 272 293 … … 397 418 $db->sql_query($sql); 398 419 } 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 } 399 425 } 400 426 … … 481 507 foreach (explode(',', $row['bot_ip']) as $bot_ip) 482 508 { 509 $bot_ip = trim($bot_ip); 510 511 if (!$bot_ip) 512 { 513 continue; 514 } 515 483 516 if (strpos($this->ip, $bot_ip) === 0) 484 517 { … … 595 628 else 596 629 { 597 $ips = explode(' ,', $this->forwarded_for);630 $ips = explode(' ', $this->forwarded_for); 598 631 $ips[] = $this->ip; 599 632 $this->check_ban($this->data['user_id'], $ips); … … 720 753 // $db->sql_return_on_error(false); 721 754 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 722 764 $this->session_id = $this->data['session_id'] = md5(unique_id()); 723 765 … … 876 918 function session_gc() 877 919 { 878 global $db, $config ;920 global $db, $config, $phpbb_root_path, $phpEx; 879 921 880 922 $batch_size = 10; … … 934 976 $db->sql_query($sql); 935 977 } 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']); 937 985 } 938 986 939 987 return; 940 988 } 941 942 function confirm_gc($type = 0)943 {944 global $db, $config;945 946 $sql = 'SELECT DISTINCT c.session_id947 FROM ' . CONFIRM_TABLE . ' c948 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 do957 {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 972 989 973 990 /** … … 1205 1222 1206 1223 $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=', 1208 1225 ); 1209 1226 … … 1339 1356 global $config, $db; 1340 1357 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; 1342 1359 1343 1360 $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' … … 1345 1362 $db->sql_query($sql); 1346 1363 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 1347 1381 // Let's also clear any current sessions for the specified user_id 1348 1382 // If it's the current user then we'll leave this session intact 1349 1383 $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) . "'" : ''; 1351 1385 1352 1386 $sql = 'DELETE FROM ' . SESSIONS_TABLE . " … … 1356 1390 // We're changing the password of the current user and they have a key 1357 1391 // 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']) 1359 1393 { 1360 1394 $this->set_login_key($user_id); … … 1369 1403 function validate_referer($check_script_path = false) 1370 1404 { 1405 global $config; 1406 1371 1407 // no referer - nothing to validate, user's fault for turning it off (we only check on POST; so meta can't be the reason) 1372 1408 if (empty($this->referer) || empty($this->host)) … … 1378 1414 $ref = substr($this->referer, strpos($this->referer, '://') + 3); 1379 1415 1380 if (!(stripos($ref, $host) === 0) )1416 if (!(stripos($ref, $host) === 0) && (!$config['force_server_vars'] || !(stripos($ref, $config['server_name']) === 0))) 1381 1417 { 1382 1418 return false; … … 1436 1472 var $img_array = array(); 1437 1473 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); 1440 1476 var $keyvalues = array(); 1441 1477 … … 1528 1564 $lang = &$this->lang; 1529 1565 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) 1531 1570 { 1532 1571 die('Language file ' . $this->lang_path . $this->lang_name . "/common.$phpEx" . " couldn't be opened."); … … 1536 1575 unset($lang_set); 1537 1576 1538 if (!empty($_GET['style']) && $auth->acl_get('a_styles') )1577 if (!empty($_GET['style']) && $auth->acl_get('a_styles') && !defined('ADMIN_START')) 1539 1578 { 1540 1579 global $SID, $_EXTRA_URL; … … 1658 1697 $this->img_lang = (file_exists($phpbb_root_path . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . $this->lang_name)) ? $this->lang_name : $config['default_lang']; 1659 1698 1660 $sql = 'SELECT image_name, image_filename, image_lang, image_height, image_width 1699 // Same query in style.php 1700 $sql = 'SELECT * 1661 1701 FROM ' . STYLES_IMAGESET_DATA_TABLE . ' 1662 1702 WHERE imageset_id = ' . $this->theme['imageset_id'] . " … … 1757 1797 // Disable board if the install/ directory is still present 1758 1798 // 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')) 1760 1800 { 1761 1801 // Adjust the message slightly according to the permissions … … 1774 1814 if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) 1775 1815 { 1776 header('HTTP/1.1 503 Service Unavailable'); 1816 if ($this->data['is_bot']) 1817 { 1818 header('HTTP/1.1 503 Service Unavailable'); 1819 } 1777 1820 1778 1821 $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; … … 1790 1833 if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) 1791 1834 { 1792 header('HTTP/1.1 503 Service Unavailable'); 1835 if ($this->data['is_bot']) 1836 { 1837 header('HTTP/1.1 503 Service Unavailable'); 1838 } 1793 1839 trigger_error('BOARD_UNAVAILABLE'); 1794 1840 } … … 1828 1874 // Does the user need to change their password? If so, redirect to the 1829 1875 // 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)) 1831 1877 { 1832 1878 if (strpos($this->page['query_string'], 'mode=reg_details') === false && $this->page['page_name'] != "ucp.$phpEx") … … 2001 2047 } 2002 2048 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) 2004 2081 { 2005 2082 trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR); … … 2037 2114 $date_cache[$format] = array( 2038 2115 'is_short' => strpos($format, '|'), 2039 'zone_offset' => $this->timezone + $this->dst,2040 2116 'format_short' => substr($format, 0, strpos($format, '|')) . '||' . substr(strrchr($format, '|'), 1), 2041 2117 'format_long' => str_replace('|', '', $format), … … 2050 2126 } 2051 2127 2128 // Zone offset 2129 $zone_offset = $this->timezone + $this->dst; 2130 2052 2131 // Show date <= 1 hour ago as 'xx min ago' 2053 // A small tolerence is given for times in the future and times in the futurebut 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' 2054 2133 if ($delta <= 3600 && ($delta >= -5 || (($now / 60) % 60) == (($gmepoch / 60) % 60)) && $date_cache[$format]['is_short'] !== false && !$forcedate && isset($this->lang['datetime']['AGO'])) 2055 2134 { … … 2059 2138 if (!$midnight) 2060 2139 { 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)) 2066 2145 { 2067 2146 $day = false; … … 2082 2161 if ($day !== false) 2083 2162 { 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']); 2089 2168 } 2090 2169 … … 2156 2235 } 2157 2236 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']; 2159 2241 $img_data['width'] = $this->img_array[$img]['image_width']; 2160 2242 $img_data['height'] = $this->img_array[$img]['image_height']; … … 2229 2311 } 2230 2312 } 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 } 2231 2343 } 2232 2344 -
trunk/forum/includes/template.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : template.php 8943 2008-09-26 13:09:56Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group, sections (c) 2001 ispi of Lincoln Inc 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 40 40 var $files_template = array(); 41 41 var $inherit_root = ''; 42 var $orig_tpl_storedb; 43 var $orig_tpl_inherits_id; 42 44 43 45 // this will hash handle names to the compiled/uncompiled code for that handle. … … 56 58 $this->root = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template'; 57 59 $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 59 74 if ($user->theme['template_inherits_id']) 60 75 { … … 76 91 * @access public 77 92 */ 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 } 81 102 82 103 $this->root = $template_path; 83 104 $this->cachepath = $phpbb_root_path . 'cache/ctpl_' . str_replace('_', '-', $template_name) . '_'; 84 105 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 85 127 return true; 86 128 } … … 106 148 $this->filename[$handle] = $filename; 107 149 $this->files[$handle] = $this->root . '/' . $filename; 108 150 109 151 if ($this->inherit_root) 110 152 { … … 112 154 } 113 155 } 114 156 115 157 return true; 116 158 } … … 123 165 { 124 166 $this->_tpldata = array('.' => array(0 => array())); 167 $this->_rootref = &$this->_tpldata['.'][0]; 125 168 } 126 169 … … 210 253 return true; 211 254 } 212 255 213 256 /** 214 257 * Load a compiled template if possible, if not, recompile it … … 219 262 global $user, $phpEx, $config; 220 263 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 221 275 $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 224 278 $recompile = false; 225 279 if (!file_exists($filename) || @filesize($filename) === 0) … … 237 291 $recompile = (@filemtime($filename) < filemtime($this->files[$handle])) ? true : false; 238 292 } 239 293 240 294 // Recompile page if the original template is newer, otherwise load the compiled version 241 295 if (!$recompile) … … 250 304 include($phpbb_root_path . 'includes/functions_template.' . $phpEx); 251 305 } 252 306 253 307 // Inheritance - we point to another template file for this one. Equality is also used for store_db 254 308 if (isset($user->theme['template_inherits_id']) && $user->theme['template_inherits_id'] && !file_exists($this->files[$handle])) … … 257 311 $this->files_template[$handle] = $user->theme['template_inherits_id']; 258 312 } 259 313 260 314 $compile = new template_compile($this); 261 315 … … 283 337 } 284 338 $ids[] = $user->theme['template_id']; 285 339 286 340 foreach ($ids as $id) 287 341 { … … 291 345 AND (template_filename = '" . $db->sql_escape($this->filename[$handle]) . "' 292 346 OR template_included " . $db->sql_like_expression($db->any_char . $this->filename[$handle] . ':' . $db->any_char) . ')'; 293 347 294 348 $result = $db->sql_query($sql); 295 349 while ($row = $db->sql_fetchrow($result)) … … 299 353 $db->sql_freeresult($result); 300 354 } 301 355 302 356 if (sizeof($rows)) 303 357 { … … 327 381 $this->files_template[$row['template_filename']] = $user->theme['template_id']; 328 382 } 329 383 330 384 if ($force_reload || $row['template_mtime'] < filemtime($file)) 331 385 { … … 469 523 unset($this->_tpldata[$blockname][($s_row_count - 1)]['S_LAST_ROW']); 470 524 } 471 525 472 526 // Add a new iteration to this block with the variable assignments we were given. 473 527 $this->_tpldata[$blockname][] = $vararray; … … 512 566 return false; 513 567 } 514 568 515 569 // Change key to zero (change first position) if false and to last position if true 516 570 if ($key === false || $key === true) … … 615 669 } 616 670 } 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 } 617 690 } 618 691 -
trunk/forum/includes/ucp/ucp_activate.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_activate.php 9067 2008-11-21 13:21:53Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 57 57 } 58 58 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 59 71 $update_password = ($user_row['user_newpasswd']) ? true : false; 60 72 … … 73 85 WHERE user_id = ' . $user_row['user_id']; 74 86 $db->sql_query($sql); 87 88 add_log('user', $user_row['user_id'], 'LOG_USER_NEW_PASSWORD', $user_row['username']); 75 89 } 76 90 -
trunk/forum/includes/ucp/ucp_attachments.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_attachments.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 185 185 'U_SORT_DOWNLOADS' => $this->u_action . "&sk=e&sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), 186 186 'U_SORT_POST_TIME' => $this->u_action . "&sk=f&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), 187 'U_SORT_TOPIC_TITLE' => $this->u_action . "&sk=g&sd=" . (($sort_key == ' f' && $sort_dir == 'a') ? 'd' : 'a'),187 'U_SORT_TOPIC_TITLE' => $this->u_action . "&sk=g&sd=" . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), 188 188 189 189 'S_DISPLAY_MARK_ALL' => ($num_attachments) ? true : false, -
trunk/forum/includes/ucp/ucp_confirm.php
r400 r702 3 3 * 4 4 * @package VC 5 * @version $Id : ucp_confirm.php 8655 2008-06-13 19:39:01Z acydburn$6 * @copyright (c) 2005 phpBB Group5 * @version $Id$ 6 * @copyright (c) 2005 2008 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 8 8 * … … 38 38 global $db, $user, $phpbb_root_path, $config, $phpEx; 39 39 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(); 76 44 77 45 garbage_collection(); -
trunk/forum/includes/ucp/ucp_groups.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_groups.php 9067 2008-11-21 13:21:53Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 42 42 { 43 43 case 'membership': 44 44 45 45 $this->page_title = 'UCP_USERGROUPS_MEMBER'; 46 46 … … 341 341 ); 342 342 343 $group_id_ary[] = $row['group_id'];343 $group_id_ary[] = (int) $row['group_id']; 344 344 } 345 345 $db->sql_freeresult($result); … … 415 415 $action = (isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''); 416 416 $group_id = request_var('g', 0); 417 417 418 418 include($phpbb_root_path . 'includes/functions_display.' . $phpEx); 419 419 … … 439 439 trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . $return_page, E_USER_WARNING); 440 440 } 441 441 442 442 $group_name = $group_row['group_name']; 443 443 $group_type = $group_row['group_type']; 444 444 445 445 $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="" />'; 446 446 … … 451 451 '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']), 452 452 'GROUP_TYPE' => $group_row['group_type'], 453 453 454 454 'AVATAR' => $avatar_img, 455 455 'AVATAR_IMAGE' => $avatar_img, … … 605 605 // group. This prevents existing group members being updated if no changes 606 606 // were made. 607 607 608 608 $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])) 613 625 { 626 settype($submit_ary[$test], $type); 614 627 $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; 615 628 } … … 676 689 $display_gallery = (isset($_POST['display_gallery'])) ? true : false; 677 690 678 if ($config['allow_avatar _local'] && $display_gallery)691 if ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery) 679 692 { 680 693 avatar_gallery($category, $avatar_select, 4); 681 694 } 682 683 $avatars_enabled = ($c an_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; 684 697 685 698 $template->assign_vars(array( 686 699 'S_EDIT' => true, 687 700 '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"' : '', 690 702 'S_ERROR' => (sizeof($error)) ? true : false, 691 703 'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false, 692 704 '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, 694 706 '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, 695 711 696 712 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', … … 698 714 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, 699 715 'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0, 700 716 701 717 'GROUP_DESC' => $group_desc_data['text'], 702 718 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], … … 840 856 841 857 'U_ACTION' => $this->u_action . "&g=$group_id", 858 'S_UCP_ACTION' => $this->u_action . "&g=$group_id", 842 859 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=usernames'), 843 860 )); … … 897 914 { 898 915 $start = 0; 899 916 900 917 do 901 918 { … … 949 966 } 950 967 968 // redirect to last screen 969 redirect($this->u_action . '&action=list&g=' . $group_id); 970 951 971 break; 952 972 … … 995 1015 } 996 1016 1017 // redirect to last screen 1018 redirect($this->u_action . '&action=list&g=' . $group_id); 1019 997 1020 break; 998 1021 … … 1028 1051 1029 1052 $default = request_var('default', 0); 1030 1053 1031 1054 if (confirm_box(true)) 1032 1055 { -
trunk/forum/includes/ucp/ucp_main.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_main.php 9136 2008-11-30 14:36:59Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 634 634 function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array()) 635 635 { 636 global $user, $db, $template, $config, $ auth, $phpbb_root_path, $phpEx;636 global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx; 637 637 638 638 $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE; 639 639 $start = request_var('start', 0); 640 641 // Grab icons 642 $icons = $cache->obtain_icons(); 640 643 641 644 $sql_array = array( … … 777 780 topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); 778 781 779 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); 782 $view_topic_url_params = "f=$forum_id&t=$topic_id"; 783 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params); 780 784 781 785 // Send vars to template … … 810 814 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 811 815 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 816 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], 812 817 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', 813 818 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', … … 819 824 'S_UNREAD_TOPIC' => $unread_topic, 820 825 821 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread',822 'U_LAST_POST' => $view_topic_url . '&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 . '&view=unread') . '#unread', 827 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 823 828 'U_VIEW_TOPIC' => $view_topic_url, 824 829 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), -
trunk/forum/includes/ucp/ucp_pm.php
r400 r702 2 2 /** 3 3 * @package ucp 4 * @version $Id : ucp_pm.php 8521 2008-04-21 13:20:13Z acydburn$4 * @version $Id$ 5 5 * @copyright (c) 2005 phpBB Group 6 6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 120 120 if (!$auth->acl_get('u_sendpm')) 121 121 { 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; 123 130 } 124 131 -
trunk/forum/includes/ucp/ucp_pm_compose.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_pm_compose.php 9168 2008-12-03 16:48:06Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 47 47 $lastclick = request_var('lastclick', 0); 48 48 49 // Reply to all triggered (quote/reply) 50 $reply_to_all = request_var('reply_to_all', 0); 51 49 52 // Do NOT use request_var or specialchars here 50 53 $address_list = isset($_REQUEST['address_list']) ? $_REQUEST['address_list'] : array(); … … 85 88 redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm')); 86 89 } 90 91 // Since viewtopic.php language entries are used in several modes, 92 // we include the language file here 93 $user->add_lang('viewtopic'); 87 94 88 95 // Output PM_TO box if message composing … … 311 318 if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview) 312 319 { 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) 314 322 { 315 323 $address_list = array('u' => array($post['author_id'] => 'to')); … … 317 325 else 318 326 { 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 320 328 $address_list = rebuild_header(array('to' => $post['to_address'])); 321 329 … … 440 448 441 449 // 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) 443 451 { 444 452 // We try to include every previously listed member from the TO Header … … 632 640 if ($load && $drafts) 633 641 { 634 load_drafts(0, 0, $id );642 load_drafts(0, 0, $id, $action, $msg_id); 635 643 } 636 644 … … 747 755 if (!sizeof($error) && $preview) 748 756 { 749 $user->add_lang('viewtopic');750 757 $preview_message = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false); 751 758 … … 761 768 $parse_sig->bbcode_bitfield = $preview_signature_bitfield; 762 769 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']); 764 771 $preview_signature = $parse_sig->message; 765 772 unset($parse_sig); … … 805 812 806 813 // 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; 808 815 809 816 $message_parser->decode_message($bbcode_uid); … … 851 858 $forward_text[] = $user->lang['FWD_ORIGINAL_MESSAGE']; 852 859 $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)); 854 861 $forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text); 855 862 $forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to'])); … … 1040 1047 'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 1041 1048 'URL_STATUS' => ($url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 1049 'MAX_FONT_SIZE' => (int) $config['max_post_font_size'], 1042 1050 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['PM']), 1043 1051 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', … … 1125 1133 1126 1134 // 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 1128 1138 $username_list = request_var('username_list', '', true); 1129 1139 if ($username_list) … … 1139 1149 global $refresh, $submit, $preview; 1140 1150 1141 $refresh = $preview =true;1151 $refresh = true; 1142 1152 $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 } 1143 1159 } 1144 1160 -
trunk/forum/includes/ucp/ucp_pm_options.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_pm_options.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 109 109 $db->sql_query($sql); 110 110 $msg = $user->lang['FOLDER_ADDED']; 111 } 112 else 113 { 114 $msg = $user->lang['FOLDER_NAME_EMPTY']; 111 115 } 112 116 } … … 634 638 { 635 639 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 } 636 653 637 654 $s_rule_options = ''; … … 640 657 foreach ($check_ary as $value => $_check) 641 658 { 659 if (isset($exclude[$value])) 660 { 661 continue; 662 } 642 663 $s_rule_options .= '<option value="' . $value . '"' . (($value == $rule_option) ? ' selected="selected"' : '') . '>' . $rule_lang[$value] . '</option>'; 643 664 } -
trunk/forum/includes/ucp/ucp_pm_viewfolder.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_pm_viewfolder.php 8795 2008-08-29 11:50:01Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 66 66 $mark_options = array('mark_important', 'delete_marked'); 67 67 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 68 74 $s_mark_options = ''; 69 75 foreach ($mark_options as $mark_option) … … 116 122 if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) 117 123 { 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&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']); 190 125 } 191 192 $data = array();193 126 194 127 foreach ($folder_info['pm_list'] as $message_id) … … 268 201 { 269 202 // Build Recipient List if in outbox/sentbox 270 $address = array(); 203 204 $address_temp = $address = $data = array(); 205 271 206 if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) 272 207 { 273 208 foreach ($folder_info['rowset'] as $message_id => $row) 274 209 { 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(); 276 212 } 277 213 } … … 297 233 foreach ($_types as $ug_type) 298 234 { 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])) 300 236 { 237 if (!isset($address[$message_id][$ug_type])) 238 { 239 $address[$message_id][$ug_type] = array(); 240 } 301 241 if ($ug_type == 'u') 302 242 { … … 311 251 WHERE '; 312 252 } 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]))); 314 254 315 255 $result = $db->sql_query($sql); … … 317 257 while ($info_row = $db->sql_fetchrow($result)) 318 258 { 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']]); 321 261 } 322 262 $db->sql_freeresult($result); … … 324 264 } 325 265 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 326 276 decode_message($message_row['message_text'], $message_row['bbcode_uid']); 327 277 328 278 $data[] = array( 329 279 'subject' => censor_text($row['message_subject']), 330 280 '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), 332 283 'to' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? $address[$message_id] : '', 333 284 'message' => $message_row['message_text'] … … 457 408 { 458 409 $sort_by_text = array('t' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); 459 $sort_by_sql = array('t' => 'p.m sg_id', 's' => 'p.message_subject');410 $sort_by_sql = array('t' => 'p.message_time', 's' => array('p.message_subject', 'p.message_time')); 460 411 } 461 412 else 462 413 { 463 414 $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')); 465 416 } 466 417 … … 503 454 'TOTAL_MESSAGES' => (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)), 504 455 505 'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'P M_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'), 508 459 509 460 'S_SELECT_SORT_DIR' => $s_sort_dir, … … 512 463 'S_TOPIC_ICONS' => ($config['enable_pm_icons']) ? true : false, 513 464 514 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '', 465 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '', 515 466 'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id" . (($start !== 0) ? "&start=$start" : '')), 516 467 )); … … 532 483 533 484 // 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'; 535 486 $sql_start = max(0, $pm_count - $sql_limit - $start); 536 487 } … … 538 489 { 539 490 // 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'; 541 492 $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; 542 503 } 543 504 -
trunk/forum/includes/ucp/ucp_pm_viewmessage.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_pm_viewmessage.php 9174 2008-12-04 19:58:42Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 30 30 $folder_id = (int) $folder_id; 31 31 $author_id = (int) $message_row['author_id']; 32 $view = request_var('view', ''); 32 33 33 34 // Not able to view message, it was deleted by the sender … … 169 170 $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'); 170 171 172 // Number of "to" recipients 173 $num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match); 174 171 175 $template->assign_vars(array( 172 176 'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), … … 179 183 'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '', 180 184 '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'], 182 186 'AUTHOR_FROM' => (!empty($user_info['user_from'])) ? $user_info['user_from'] : '', 183 187 … … 190 194 'QUOTE_IMG' => $user->img('icon_post_quote', $user->lang['POST_QUOTE_PM']), 191 195 'REPLY_IMG' => $user->img('button_pm_reply', $user->lang['POST_REPLY_PM']), 196 'REPORT_IMG' => $user->img('icon_post_report', 'REPORT_PM'), 192 197 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['POST_EDIT_PM']), 193 198 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['PM']), 194 199 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']), 196 201 'SUBJECT' => $message_row['message_subject'], 197 202 'MESSAGE' => $message, … … 210 215 'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '', 211 216 'U_EMAIL' => $user_info['email'], 217 'U_REPORT' => ($config['allow_pm_report']) ? append_sid("{$phpbb_root_path}report.$phpEx", "pm=" . $message_row['msg_id']) : '', 212 218 'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=$folder_id&p=" . $message_row['msg_id'] : '', 213 219 '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&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '', 214 220 'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '', 221 'U_POST_REPLY_ALL' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&reply_to_all=1&p=" . $message_row['msg_id'] : '', 215 222 'U_PREVIOUS_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=previous", 216 223 'U_NEXT_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=next", 224 225 'U_PM_ACTION' => $url . '&mode=compose&f=' . $folder_id . '&p=' . $message_row['msg_id'], 217 226 218 227 'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false, … … 220 229 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, 221 230 'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)), 231 'S_PM_RECIPIENTS' => $num_recipients, 222 232 223 233 'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '', … … 287 297 if ($row) 288 298 { 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; 290 300 } 291 301 } -
trunk/forum/includes/ucp/ucp_prefs.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_prefs.php 8990 2008-10-09 15:41:19Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 283 283 'S_DISABLE_CENSORS' => $data['wordcensor'], 284 284 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, 286 286 287 287 'S_TOPIC_SORT_DAYS' => $s_limit_topic_days, -
trunk/forum/includes/ucp/ucp_profile.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_profile.php 8990 2008-10-09 15:41:19Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 111 111 'username_clean' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'], 112 112 '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'], 114 114 'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? phpbb_hash($data['new_password']) : $user->data['user_password'], 115 115 'user_passchg' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0, … … 134 134 $message = 'PROFILE_UPDATED'; 135 135 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)) 137 137 { 138 138 $message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN'; … … 350 350 $data['notify'] = $user->data['user_notify_type']; 351 351 352 if ( !$config['jab_enable'] || !$data['jabber'] || !@extension_loaded('xml'))352 if ($data['notify'] == NOTIFY_IM && (!$config['jab_enable'] || !$data['jabber'] || !@extension_loaded('xml'))) 353 353 { 354 354 // User has not filled in a jabber address (Or one of the modules is disabled or jabber is disabled) 355 355 // Disable notify by Jabber now for this user. 356 $data['notify'] = NOTIFY_ BOTH;356 $data['notify'] = NOTIFY_EMAIL; 357 357 } 358 358 … … 381 381 382 382 // 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); 402 384 403 385 meta_refresh(3, $this->u_action); … … 475 457 include($phpbb_root_path . 'includes/functions_display.' . $phpEx); 476 458 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; 480 462 481 463 $signature = utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true)); … … 486 468 { 487 469 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; 488 474 489 475 if (!sizeof($error)) … … 506 492 if (!sizeof($error) && $submit) 507 493 { 494 $user->optionset('sig_bbcode', $enable_bbcode); 495 $user->optionset('sig_smilies', $enable_smilies); 496 $user->optionset('sig_links', $enable_urls); 497 508 498 $sql_ary = array( 509 499 'user_sig' => (string) $message_parser->message, 500 'user_options' => $user->data['user_options'], 510 501 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid, 511 502 'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield … … 550 541 'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 551 542 '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'], 552 544 553 545 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']), … … 573 565 $category = basename(request_var('category', '')); 574 566 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; 576 568 577 569 add_form_key('ucp_avatar'); … … 596 588 } 597 589 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 598 601 $template->assign_vars(array( 599 602 '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), 601 604 'AVATAR_SIZE' => $config['avatar_filesize'], 602 605 603 606 'U_GALLERY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&mode=avatar&display_gallery=1'), 604 607 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"' : '', 606 609 607 610 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024), 608 611 )); 609 612 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']) 611 614 { 612 615 avatar_gallery($category, $avatar_select, 4); 613 616 } 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; 617 620 618 621 $template->assign_vars(array( … … 621 624 622 625 '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, 625 628 'S_LINK_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false, 626 629 'S_DISPLAY_GALLERY' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false) -
trunk/forum/includes/ucp/ucp_register.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_register.php 8782 2008-08-23 17:20:55Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 38 38 include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); 39 39 40 $confirm_id = request_var('confirm_id', '');41 40 $coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false; 42 41 $agreed = (!empty($_POST['agreed'])) ? 1 : 0; … … 54 53 } 55 54 56 57 55 if ($change_lang || $user_lang != $config['default_lang']) 58 56 { … … 69 67 } 70 68 71 $user->lang_name = $ lang = $use_lang;69 $user->lang_name = $user_lang = $use_lang; 72 70 $user->lang = array(); 71 $user->data['user_lang'] = $user->lang_name; 73 72 $user->add_lang(array('common', 'ucp')); 74 73 } … … 80 79 } 81 80 81 82 82 $cp = new custom_profile(); 83 83 84 84 $error = $cp_data = $cp_error = array(); 85 86 85 87 86 if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable'])) … … 90 89 $add_coppa = ($coppa !== false) ? '&coppa=' . $coppa : ''; 91 90 92 $s_hidden_fields = ($confirm_id) ? array('confirm_id' => $confirm_id) : array(); 91 $s_hidden_fields = array( 92 'change_lang' => $change_lang, 93 ); 93 94 94 95 // If we change the language, we want to pass on some more possible parameter. … … 100 101 'email' => strtolower(request_var('email', '')), 101 102 'email_confirm' => strtolower(request_var('email_confirm', '')), 102 'confirm_code' => request_var('confirm_code', ''),103 'confirm_id' => request_var('confirm_id', ''),104 103 'lang' => $user->lang_name, 105 104 'tz' => request_var('tz', (float) $config['board_timezone']), 106 105 )); 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); 108 120 109 121 if ($coppa === false && $config['coppa_enable']) … … 114 126 115 127 $template->assign_vars(array( 128 'S_LANG_OPTIONS' => (sizeof($lang_row) > 1) ? language_select($user_lang) : '', 116 129 'L_COPPA_NO' => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday), 117 130 'L_COPPA_YES' => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday), … … 128 141 { 129 142 $template->assign_vars(array( 143 'S_LANG_OPTIONS' => (sizeof($lang_row) > 1) ? language_select($user_lang) : '', 130 144 'L_TERMS_OF_USE' => sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()), 131 145 … … 137 151 ); 138 152 } 153 unset($lang_row); 139 154 140 155 $this->tpl_name = 'ucp_agreement'; 141 156 return; 142 157 } 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 } 144 167 145 168 // Try to manually determine the timezone and adjust the dst if the server date/time complies with the default setting +/- 1 … … 168 191 'email' => strtolower(request_var('email', '')), 169 192 'email_confirm' => strtolower(request_var('email_confirm', '')), 170 'confirm_code' => request_var('confirm_code', ''),171 193 'lang' => basename(request_var('lang', $user->lang_name)), 172 194 'tz' => request_var('tz', (float) $timezone), … … 188 210 array('email')), 189 211 'email_confirm' => array('string', false, 6, 60), 190 'confirm_code' => array('string', !$config['enable_confirm'], 5, 8),191 212 'tz' => array('num', false, -14, 14), 192 213 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), 193 214 )); 215 194 216 if (!check_form_key('ucp_register')) 195 217 { 196 218 $error[] = $user->lang['FORM_INVALID']; 197 219 } 220 198 221 // Replace "error" strings with their real, localised form 199 222 $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); 200 223 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 201 238 // DNSBL check 202 239 if ($config['check_dnsbl']) … … 210 247 // validate custom profile fields 211 248 $cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error); 212 213 // Visual Confirmation handling214 $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 else223 {224 $sql = 'SELECT code225 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 else244 {245 $error[] = $user->lang['CONFIRM_CODE_WRONG'];246 $wrong_confirm = true;247 }248 }249 else250 {251 $error[] = $user->lang['CONFIRM_CODE_WRONG'];252 $wrong_confirm = true;253 }254 }255 }256 249 257 250 if (!sizeof($error)) … … 327 320 ); 328 321 322 if ($config['new_member_post_limit']) 323 { 324 $user_row['user_new'] = 1; 325 } 326 329 327 // Register user... 330 328 $user_id = user_add($user_row, $cp_data); … … 334 332 { 335 333 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(); 336 340 } 337 341 … … 441 445 $s_hidden_fields['coppa'] = $coppa; 442 446 } 447 448 if ($config['enable_confirm']) 449 { 450 $s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields()); 451 } 443 452 $s_hidden_fields = build_hidden_fields($s_hidden_fields); 444 445 453 $confirm_image = ''; 446 454 447 455 // Visual Confirmation - Show images 448 449 456 if ($config['enable_confirm']) 450 457 { 451 if ($change_lang) 452 { 453 $str = '&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&id=' . $confirm_id . '&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 )); 505 461 } 506 462 … … 525 481 'EMAIL' => $data['email'], 526 482 '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 530 484 'L_REG_COND' => $l_reg_cond, 531 485 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), … … 534 488 'S_LANG_OPTIONS' => language_select($data['lang']), 535 489 '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, 537 492 'S_COPPA' => $coppa, 538 493 'S_HIDDEN_FIELDS' => $s_hidden_fields, 539 494 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), 540 ) 541 ); 495 )); 542 496 543 497 // -
trunk/forum/includes/ucp/ucp_remind.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_remind.php 8977 2008-10-06 14:04:33Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 39 39 $sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason 40 40 FROM ' . USERS_TABLE . " 41 WHERE user_email = '" . $db->sql_escape($email) . "'41 WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "' 42 42 AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; 43 43 $result = $db->sql_query($sql); -
trunk/forum/includes/ucp/ucp_resend.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_resend.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 46 46 $sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_inactive_reason 47 47 FROM ' . USERS_TABLE . " 48 WHERE user_email = '" . $db->sql_escape($email) . "'48 WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "' 49 49 AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; 50 50 $result = $db->sql_query($sql); … … 134 134 $messenger->im($row['user_jabber'], $row['username']); 135 135 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 136 141 $messenger->assign_vars(array( 137 142 'USERNAME' => htmlspecialchars_decode($user_row['username']), … … 147 152 meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); 148 153 149 $message = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? $user->lang['AC IVATION_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']; 150 155 $message .= '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); 151 156 trigger_error($message); -
trunk/forum/includes/ucp/ucp_zebra.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_zebra.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 53 53 if (confirm_box(true)) 54 54 { 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 55 67 if ($data['add']) 56 68 { … … 125 137 $user_id_ary[] = $row['user_id']; 126 138 } 139 else if ($row['user_id'] != ANONYMOUS) 140 { 141 $error[] = $user->lang['NOT_ADDED_' . $l_mode . '_BOTS']; 142 } 127 143 else 128 144 { … … 183 199 } 184 200 } 185 }186 else if (sizeof($data['usernames']))187 {188 // Force integer values189 $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;197 201 } 198 202 -
trunk/forum/includes/utf/utf_tools.php
r400 r702 3 3 * 4 4 * @package utf 5 * @version $Id : utf_tools.php 8510 2008-04-20 05:16:42Z davidmj$5 * @version $Id$ 6 6 * @copyright (c) 2006 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 71 71 $len = strlen($str); 72 72 $ret = ''; 73 73 74 74 while ($pos < $len) 75 75 { … … 253 253 { 254 254 $ar = explode($needle, $str); 255 255 256 256 if (sizeof($ar) > 1) 257 257 { … … 528 528 } 529 529 else 530 { 530 { 531 531 // offset == 0; just anchor the pattern 532 532 $op = '^'; … … 561 561 $lx = (int) ($length / 65535); 562 562 $ly = $length % 65535; 563 563 564 564 // negative length requires a captured group 565 565 // of length characters … … 633 633 return array($str); 634 634 } 635 635 636 636 preg_match_all('/.{' . $split_len . '}|[^\x00]{1,' . $split_len . '}$/us', $str, $ar); 637 637 return $ar[0]; … … 1918 1918 } 1919 1919 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 */ 1930 function 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 */ 1956 function 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 1920 1995 ?> -
trunk/forum/index.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : index.php 8987 2008-10-09 14:17:02Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 85 85 { 86 86 $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 . ')'; 91 94 $result = $db->sql_query($sql); 92 95 -
trunk/forum/language/en/acp/ban.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : ban.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 49 49 'BAN_GIVE_REASON' => 'Reason shown to the banned', 50 50 '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)" 51 53 52 54 'EMAIL_BAN' => 'Ban one or more e-mail addresses', … … 68 70 69 71 'PERMANENT' => 'Permanent', 70 72 71 73 'UNTIL' => 'Until', 72 74 'USER_BAN' => 'Ban one or more usernames', … … 76 78 'USER_UNBAN' => 'Un-ban or un-exclude usernames', 77 79 '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 80 80 )); 81 81 -
trunk/forum/language/en/acp/board.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : board.php 9037 2008-10-26 10:52:43Z acydburn$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 71 71 'ALLOW_NO_CENSORS_EXPLAIN' => 'Users can choose to disable the automatic word censoring of posts and private messages.', 72 72 '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', 73 78 'ALLOW_SIG' => 'Allow signatures', 74 79 'ALLOW_SIG_BBCODE' => 'Allow BBCode in user signatures', … … 88 93 '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.', 89 94 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.', 90 97 'ALLOW_LOCAL' => 'Enable gallery avatars', 91 98 'ALLOW_REMOTE' => 'Enable remote avatars', 92 99 '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.', 93 102 'ALLOW_UPLOAD' => 'Enable avatar uploading', 94 103 'AVATAR_GALLERY_PATH' => 'Avatar gallery path', … … 141 150 '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.', 142 151 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 148 152 '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.', 152 158 'DISPLAY_LAST_EDITED' => 'Display last edited time information', 153 159 'DISPLAY_LAST_EDITED_EXPLAIN' => 'Choose if the last edited by information to be displayed on posts.', … … 167 173 'MAX_POST_URLS' => 'Maximum links per post', 168 174 '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.', 169 177 'POSTING' => 'Posting', 170 178 'POSTS_PER_PAGE' => 'Posts per page', … … 173 181 'SMILIES_LIMIT' => 'Maximum smilies per post', 174 182 'SMILIES_LIMIT_EXPLAIN' => 'Maximum number of smilies in a post. Set to 0 for unlimited smilies.', 183 'SMILIES_PER_PAGE' => 'Smilies per page', 175 184 'TOPICS_PER_PAGE' => 'Topics per page', 176 185 )); … … 198 207 'ACP_REGISTER_SETTINGS_EXPLAIN' => 'Here you are able to define registration and profile related settings.', 199 208 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 202 216 'ACC_ADMIN' => 'By Admin', 203 217 'ACC_DISABLE' => 'Disable', … … 232 246 )); 233 247 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 234 288 // Visual Confirmation Settings 235 289 $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.', 238 293 'CAPTCHA_GD' => 'GD CAPTCHA', 294 'CAPTCHA_GD_3D' => 'GD 3D Captcha', 239 295 'CAPTCHA_GD_FOREGROUND_NOISE' => 'GD CAPTCHA foreground noise', 240 296 'CAPTCHA_GD_EXPLAIN' => 'Use GD to make a more advanced CAPTCHA.', … … 244 300 'CAPTCHA_GD_Y_GRID' => 'GD CAPTCHA background noise y-axis', 245 301 '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', 247 312 '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 249 322 'VISUAL_CONFIRM_POST' => 'Enable visual confirmation for guest postings', 250 323 'VISUAL_CONFIRM_POST_EXPLAIN' => 'Requires anonymous users to enter a random code matching an image to help prevent mass postings.', 251 324 'VISUAL_CONFIRM_REG' => 'Enable visual confirmation for registrations', 252 325 '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.', 253 328 )); 254 329 … … 318 393 'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s.', 319 394 '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>', 321 396 'LDAP_PORT' => 'LDAP server port', 322 397 '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.', … … 336 411 337 412 '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.', 339 414 'FORCE_SERVER_VARS' => 'Force server URL settings', 340 415 'FORCE_SERVER_VARS_EXPLAIN' => 'If set to yes the server settings defined here will be used in favour of the automatically determined values.', … … 423 498 'EMAIL_SIG_EXPLAIN' => 'This text will be attached to all e-mails the board sends.', 424 499 '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>', 426 501 'SMTP_AUTH_METHOD' => 'Authentication method for SMTP', 427 502 'SMTP_AUTH_METHOD_EXPLAIN' => 'Only used if a username/password is set, ask your provider if you are unsure which method to use.', … … 430 505 'SMTP_LOGIN' => 'LOGIN', 431 506 '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>', 433 508 'SMTP_PLAIN' => 'PLAIN', 434 509 'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP', … … 453 528 '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.', 454 529 '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>', 455 531 'JAB_PORT' => 'Jabber port', 456 532 'JAB_PORT_EXPLAIN' => 'Leave blank unless you know it is not port 5222.', -
trunk/forum/language/en/acp/common.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : common.php 9049 2008-11-05 22:03:16Z toonarmy$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 89 89 'ACP_FORUM_MODERATORS' => 'Forum moderators', 90 90 'ACP_FORUM_PERMISSIONS' => 'Forum permissions', 91 'ACP_FORUM_PERMISSIONS_COPY' => 'Copy forum permissions', 91 92 'ACP_FORUM_ROLES' => 'Forum roles', 92 93 … … 149 150 'ACP_RESTORE' => 'Restore', 150 151 152 'ACP_FEED' => 'Feed management', 153 'ACP_FEED_SETTINGS' => 'Feed settings', 154 151 155 'ACP_SEARCH' => 'Search configuration', 152 156 'ACP_SEARCH_INDEX' => 'Search index', … … 154 158 155 159 'ACP_SECURITY_SETTINGS' => 'Security settings', 160 'ACP_SEND_STATISTICS' => 'Send statistical information', 156 161 'ACP_SERVER_CONFIGURATION' => 'Server configuration', 157 162 'ACP_SERVER_SETTINGS' => 'Server settings', … … 161 166 'ACP_STYLE_MANAGEMENT' => 'Style management', 162 167 'ACP_STYLES' => 'Styles', 168 169 'ACP_SUBMIT_CHANGES' => 'Submit changes', 163 170 164 171 'ACP_TEMPLATES' => 'Templates', … … 182 189 'ACP_USER_SECURITY' => 'User security', 183 190 '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', 186 194 'ACP_VC_CAPTCHA_DISPLAY' => 'CAPTCHA image preview', 187 195 'ACP_VERSION_CHECK' => 'Check for updates', … … 202 210 'ADMIN_PANEL' => 'Administration Control Panel', 203 211 204 'ADM_LOGOUT' => 'ACP 212 'ADM_LOGOUT' => 'ACP Logout', 205 213 'ADM_LOGGED_OUT' => 'Successfully logged out from Administration Control Panel', 206 214 … … 242 250 'MANAGE' => 'Manage', 243 251 'MENU_TOGGLE' => 'Hide or display the side menu', 252 'MORE' => 'More', // Not used at the moment 253 'MORE_INFORMATION' => 'More information »', 244 254 'MOVE_DOWN' => 'Move down', 245 255 'MOVE_UP' => 'Move up', … … 258 268 'PERMISSIONS_TRANSFERRED' => 'Permissions transferred', 259 269 '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',261 270 'PROCEED_TO_ACP' => '%sProceed to the ACP%s', 262 271 … … 268 277 'SELECT_OPTION' => 'Select option', 269 278 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', 274 285 275 286 'UCP' => 'User Control Panel', … … 329 340 'NUMBER_ORPHAN' => 'Orphan attachments', 330 341 342 'PHP_VERSION_OLD' => 'The version of PHP on this server will no longer be supported by future versions of phpBB. %sDetails%s', 343 331 344 'POSTS_PER_DAY' => 'Posts per day', 332 345 … … 334 347 'PURGE_CACHE_CONFIRM' => 'Are you sure you wish to purge the cache?', 335 348 '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.', 336 353 337 354 'RESET_DATE' => 'Reset board’s start date', … … 358 375 'USERS_PER_DAY' => 'Users per day', 359 376 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', 363 382 364 383 'WELCOME_PHPBB' => 'Welcome to phpBB', … … 385 404 'SORT_REASON' => 'Reason', 386 405 'SORT_REG_DATE' => 'Registration date', 406 'SORT_LAST_REMINDER'=> 'Last reminded', 407 'SORT_REMINDER' => 'Reminder sent', 387 408 388 409 '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.', 389 422 )); 390 423 … … 465 498 'LOG_CONFIG_POST' => '<strong>Altered post settings</strong>', 466 499 'LOG_CONFIG_REGISTRATION' => '<strong>Altered user registration settings</strong>', 500 'LOG_CONFIG_FEED' => '<strong>Altered syndication feeds settings</strong>', 467 501 'LOG_CONFIG_SEARCH' => '<strong>Altered search settings</strong>', 468 502 'LOG_CONFIG_SECURITY' => '<strong>Altered security settings</strong>', … … 470 504 'LOG_CONFIG_SETTINGS' => '<strong>Altered board settings</strong>', 471 505 'LOG_CONFIG_SIGNATURE' => '<strong>Altered signature settings</strong>', 472 'LOG_CONFIG_VISUAL' => '<strong>Altered visual confirmationsettings</strong>',506 'LOG_CONFIG_VISUAL' => '<strong>Altered antibot settings</strong>', 473 507 474 508 'LOG_APPROVE_TOPIC' => '<strong>Approved topic</strong><br />» %s', 475 509 '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', 477 511 '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', 479 513 'LOG_FORK' => '<strong>Copied topic</strong><br />» from %s', 480 514 'LOG_LOCK' => '<strong>Locked topic</strong><br />» %s', … … 482 516 'LOG_MERGE' => '<strong>Merged posts</strong> into topic<br />» %s', 483 517 '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', 484 520 'LOG_POST_APPROVED' => '<strong>Approved post</strong><br />» %s', 485 521 'LOG_POST_DISAPPROVED' => '<strong>Disapproved post “%1$s” with the following reason</strong><br />» %2$s', … … 512 548 513 549 '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', 514 551 'LOG_FORUM_DEL_FORUM' => '<strong>Deleted forum</strong><br />» %s', 515 552 'LOG_FORUM_DEL_FORUMS' => '<strong>Deleted forum and its subforums</strong><br />» %s', 516 553 'LOG_FORUM_DEL_MOVE_FORUMS' => '<strong>Deleted forum and moved subforums</strong> to %1$s<br />» %2$s', 517 554 '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', 519 556 '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', 523 560 'LOG_FORUM_EDIT' => '<strong>Edited forum details</strong><br />» %s', 524 561 'LOG_FORUM_MOVE_DOWN' => '<strong>Moved forum</strong> %1$s <strong>below</strong> %2$s', 525 562 'LOG_FORUM_MOVE_UP' => '<strong>Moved forum</strong> %1$s <strong>above</strong> %2$s', 526 563 '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', 527 566 528 567 'LOG_GROUP_CREATED' => '<strong>New usergroup created</strong><br />» %s', … … 534 573 'LOG_GROUP_UPDATED' => '<strong>Usergroup details updated</strong><br />» %s', 535 574 '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', 536 576 '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', 538 580 539 581 'LOG_IMAGESET_ADD_DB' => '<strong>Added new imageset to database</strong><br />» %s', … … 604 646 605 647 'LOG_PURGE_CACHE' => '<strong>Purged cache</strong>', 648 'LOG_PURGE_SESSIONS' => '<strong>Purged sessions</strong>', 649 606 650 607 651 'LOG_RANK_ADDED' => '<strong>Added new rank</strong><br />» %s', … … 655 699 'LOG_USER_DEL_ATTACH' => '<strong>Removed all attachments made by the user</strong><br />» %s', 656 700 'LOG_USER_DEL_AVATAR' => '<strong>Removed user avatar</strong><br />» %s', 701 'LOG_USER_DEL_OUTBOX' => '<strong>Emptied user outbox</strong><br />» %s', 657 702 'LOG_USER_DEL_POSTS' => '<strong>Removed all posts made by the user</strong><br />» %s', 658 703 'LOG_USER_DEL_SIG' => '<strong>Removed user signature</strong><br />» %s', … … 661 706 'LOG_USER_NEW_PASSWORD' => '<strong>Changed user password</strong><br />» %s', 662 707 '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 663 710 'LOG_USER_UPDATE_EMAIL' => '<strong>User “%1$s” changed e-mail</strong><br />» from “%2$s” to “%3$s”', 664 711 'LOG_USER_UPDATE_NAME' => '<strong>Changed username</strong><br />» from “%1$s” to “%2$s”', … … 684 731 'LOG_USER_GROUP_RESIGN' => '<strong>User resigned membership from group</strong><br />» %s', 685 732 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 686 737 'LOG_WORD_ADD' => '<strong>Added word censor</strong><br />» %s', 687 738 'LOG_WORD_DELETE' => '<strong>Deleted word censor</strong><br />» %s', -
trunk/forum/language/en/acp/database.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : database.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 55 55 56 56 'FILE_TYPE' => 'File type', 57 'FILE_WRITE_FAIL' => 'Unable to write file to storage folder.', 57 58 'FULL_BACKUP' => 'Full', 58 59 -
trunk/forum/language/en/acp/forums.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : forums.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 45 45 'AUTO_PRUNE_VIEWED_EXPLAIN' => 'Number of days since topic was viewed after which topic is removed.', 46 46 47 'CONTINUE' => 'Continue', 47 48 '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.', 48 50 '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.', 49 51 '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.', 50 53 'CREATE_FORUM' => 'Create new forum', 51 54 … … 63 66 'ENABLE_POST_REVIEW' => 'Enable post review', 64 67 '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.', 65 70 'ENABLE_RECENT' => 'Display active topics', 66 71 'ENABLE_RECENT_EXPLAIN' => 'If set to yes topics made to this forum will be shown in the active topics list.', … … 82 87 'FORUM_IMAGE' => 'Forum image', 83 88 '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', 84 90 '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>.', 85 91 'FORUM_LINK_TRACK' => 'Track link redirects', … … 94 100 'FORUM_PASSWORD_UNSET' => 'Remove forum password', 95 101 '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 encryptionand should be changed.',102 'FORUM_PASSWORD_OLD' => 'The forum password is using an old hashing method and should be changed.', 97 103 'FORUM_PASSWORD_MISMATCH' => 'The passwords you entered did not match.', 98 104 'FORUM_PRUNE_SETTINGS' => 'Forum prune settings', -
trunk/forum/language/en/acp/groups.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : groups.php 8911 2008-09-23 13:03:33Z acydburn$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 89 89 'GROUP_MAX_RECIPIENTS' => 'Maximum number of allowed recipients per private message', 90 90 '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', 91 92 'GROUP_PROMOTE' => 'Promote to group leader', 92 93 'GROUP_RANK' => 'Group rank', … … 95 96 'GROUP_REQUEST' => 'Request', 96 97 '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.', 97 100 'GROUP_TYPE' => 'Group type', 98 101 'GROUP_TYPE_EXPLAIN' => 'This determines which users can join or view this group.', 99 102 'GROUP_UPDATED' => 'Group preferences updated successfully.', 100 103 101 104 'GROUP_USERS_ADDED' => 'New users added to group successfully.', 102 105 'GROUP_USERS_EXIST' => 'The selected users are already members.', -
trunk/forum/language/en/acp/language.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : language.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 38 38 $lang = array_merge($lang, array( 39 39 '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 (*).', 41 41 42 42 'EMAIL_FILES' => 'E-mail templates', -
trunk/forum/language/en/acp/permissions.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : permissions.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 51 51 <h2>Permission Masks</h2> 52 52 <p>These are used to view the effective permissions assigned to Users, Moderators (Local and Global), Administrators or Forums.</p> 53 53 54 54 <br /> 55 55 … … 72 72 'ACL_TYPE_LOCAL_M_' => 'Forum Moderator permissions', 73 73 'ACL_TYPE_LOCAL_F_' => 'Forum permissions', 74 74 75 75 'ACL_NO' => 'No', 76 76 'ACL_VIEW' => 'Viewing permissions', … … 81 81 '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.', 82 82 '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.', 83 84 '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.', 84 85 'ACP_GROUPS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to groups.', 85 86 '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 it ’s 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 it ’s 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 it ’s 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 it ’s 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.', 90 91 'ACP_USERS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to users.', 91 92 '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.', … … 110 111 'AUTH_UPDATED' => 'Permissions have been updated.', 111 112 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 112 119 'CREATE_ROLE' => 'Create role', 113 120 'CREATE_ROLE_FROM' => 'Use settings from…', … … 165 172 'ROLE_FORUM_READONLY' => 'Read Only Access', 166 173 'ROLE_FORUM_STANDARD' => 'Standard Access', 174 'ROLE_FORUM_NEW_MEMBER' => 'Newly registered User', 167 175 'ROLE_MOD_FULL' => 'Full Moderator', 168 176 'ROLE_MOD_QUEUE' => 'Queue Moderator', … … 174 182 'ROLE_USER_NOPM' => 'No Private Messages', 175 183 'ROLE_USER_STANDARD' => 'Standard Features', 184 'ROLE_USER_NEW_MEMBER' => 'Newly registered User', 185 176 186 177 187 'ROLE_DESCRIPTION_ADMIN_FORUM' => 'Can access the forum management and forum permission settings.', … … 188 198 'ROLE_DESCRIPTION_FORUM_READONLY' => 'Can read the forum, but cannot create new topics or reply to posts.', 189 199 '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.', 190 201 'ROLE_DESCRIPTION_MOD_FULL' => 'Can use all moderating features, including banning.', 191 202 'ROLE_DESCRIPTION_MOD_QUEUE' => 'Can use the Moderation Queue to validate and edit posts, but nothing else.', … … 197 208 'ROLE_DESCRIPTION_USER_NOPM' => 'Has a limited feature set, and is not allowed to use Private Messages.', 198 209 '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 200 212 '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.', 201 213 'ROLE_DESCRIPTION_LONG' => 'The role description is too long, please limit it to 4000 characters.', … … 242 254 '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', 243 255 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>.', 245 257 'TRACE_USER_KEPT' => 'The user’s permission is <samp>NO</samp> so the old total value is kept.', 246 258 '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 4 4 * 5 5 * @package language 6 * @version $Id : permissions_phpbb.php 8911 2008-09-23 13:03:33Z acydburn$6 * @version $Id$ 7 7 * @copyright (c) 2005 phpBB Group 8 8 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 122 122 'acl_u_pm_attach' => array('lang' => 'Can attach files in private messages', 'cat' => 'pm'), 123 123 'acl_u_pm_download' => array('lang' => 'Can download files in private messages', 'cat' => 'pm'), 124 'acl_u_pm_bbcode' => array('lang' => 'Can postBBCode in private messages', 'cat' => 'pm'),125 'acl_u_pm_smilies' => array('lang' => 'Can postsmilies in private messages', 'cat' => 'pm'),126 'acl_u_pm_img' => array('lang' => 'Can post imagesin private messages', 'cat' => 'pm'),127 'acl_u_pm_flash' => array('lang' => 'Can post Flashin 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'), 128 128 129 129 'acl_u_sendemail' => array('lang' => 'Can send e-mails', 'cat' => 'misc'), … … 152 152 'acl_f_download' => array('lang' => 'Can download files', 'cat' => 'content'), 153 153 'acl_f_sigs' => array('lang' => 'Can use signatures', 'cat' => 'content'), 154 'acl_f_bbcode' => array('lang' => 'Can postBBCode', 'cat' => 'content'),155 'acl_f_smilies' => array('lang' => 'Can postsmilies', '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'), 158 158 159 159 'acl_f_edit' => array('lang' => 'Can edit own posts', 'cat' => 'actions'), -
trunk/forum/language/en/acp/posting.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : posting.php 8743 2008-08-12 16:03:18Z Kellanved$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 42 42 'ADD_BBCODE' => 'Add a new BBCode', 43 43 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 44 47 'BBCODE_ADDED' => 'BBCode added successfully.', 45 48 'BBCODE_EDITED' => 'BBCode edited successfully.', … … 69 72 'TOKEN' => 'Token', 70 73 '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><STRINGNAME></em>} where <em><STRINGNAME></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>',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><STRINGNAME></em>} where <em><STRINGNAME></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>', 72 75 'TOKEN_DEFINITION' => 'What can it be?', 73 76 'TOO_MANY_BBCODES' => 'You cannot create any more BBCodes. Please remove one or more BBCodes then try again.', 74 77 75 78 '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.', 77 80 '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.', 78 82 'IDENTIFIER' => 'Characters from the latin alphabet (A-Z), numbers, hyphen and underscore', 79 83 'NUMBER' => 'Any series of digits', 80 84 '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, "http://"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.', 82 86 'LOCAL_URL' => 'A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol.', 83 87 '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>' … … 181 185 'SMILIES_WIDTH' => 'Smiley width', 182 186 187 'TOO_MANY_SMILIES' => 'Limit of %d smilies reached.', 188 183 189 'WRONG_PAK_TYPE' => 'The specified package does not contain the appropriate data.', 184 190 )); … … 186 192 // Word censors 187 193 $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 beallowed 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.', 189 195 'ADD_WORD' => 'Add new word', 190 196 … … 218 224 'RANK_IMAGE' => 'Rank image', 219 225 '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)', 220 227 'RANK_MINIMUM' => 'Minimum posts', 221 228 'RANK_REMOVED' => 'The rank was successfully deleted.', -
trunk/forum/language/en/acp/profile.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : profile.php 9128 2008-11-26 20:10:29Z acydburn$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 67 67 'DISPLAY_AT_REGISTER' => 'Display on registration screen', 68 68 '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', 70 72 '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.', 71 73 'DROPDOWN_ENTRIES_EXPLAIN' => 'Enter your options now, every option in one line.', -
trunk/forum/language/en/acp/prune.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : prune.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 38 38 // User pruning 39 39 $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.', 41 41 42 42 '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!', 44 44 'DELETE_USERS' => 'Delete', 45 45 'DELETE_USER_POSTS' => 'Delete pruned user posts', … … 48 48 'JOINED_EXPLAIN' => 'Enter a date in <kbd>YYYY-MM-DD</kbd> format.', 49 49 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.', 51 51 52 52 'PRUNE_USERS_LIST' => 'Users to be pruned', … … 54 54 'PRUNE_USERS_LIST_DEACTIVATE' => 'With the selected critera for pruning users the following accounts will be deactivated.', 55 55 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.', 57 57 58 58 'USER_DEACTIVATE_SUCCESS' => 'The selected users have been deactivated successfully.', -
trunk/forum/language/en/acp/search.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : search.php 9126 2008-11-26 19:17:52Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 73 73 'MAX_SEARCH_CHARS' => 'Max characters indexed by search', 74 74 '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.', 75 77 'MIN_SEARCH_CHARS' => 'Min characters indexed by search', 76 78 '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 5 5 * 6 6 * @package language 7 * @version $Id : styles.php 9046 2008-11-02 16:19:11Z acydburn$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 393 393 'TEMPLATE_LOCATION_EXPLAIN' => 'Images are always stored on the filesystem.', 394 394 '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.', 395 396 'TEMPLATE_REFRESHED' => 'Template refreshed successfully.', 396 397 -
trunk/forum/language/en/acp/users.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : users.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 78 78 79 79 'NO_SPECIAL_RANK' => 'No special rank assigned', 80 'NO_WARNINGS' => 'No warnings.', 80 81 'NOT_MANAGE_FOUNDER' => 'You tried to manage a user with founder status. Only founders are allowed to manage other founders.', 81 82 … … 103 104 'USER_ADMIN_DEL_ATTACH' => 'Delete all attachments', 104 105 'USER_ADMIN_DEL_AVATAR' => 'Delete avatar', 106 'USER_ADMIN_DEL_OUTBOX' => 'Empty PM outbox', 105 107 'USER_ADMIN_DEL_POSTS' => 'Delete all posts', 106 108 'USER_ADMIN_DEL_SIG' => 'Delete signature', 107 109 'USER_ADMIN_EXPLAIN' => 'Here you can change your users information and certain specific options.', 108 110 'USER_ADMIN_FORCE' => 'Force reactivation', 111 'USER_ADMIN_LEAVE_NR' => 'Remove from Newly Registered', 109 112 'USER_ADMIN_MOVE_POSTS' => 'Move all posts', 110 113 'USER_ADMIN_SIG_REMOVED' => 'Successfully removed signature from user account.', 111 114 '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.', 112 116 '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.', 113 118 'USER_CUSTOM_PROFILE_FIELDS' => 'Custom profile fields', 114 119 'USER_DELETED' => 'User deleted successfully.', … … 117 122 'USER_GROUP_PENDING' => 'Groups user is in pending mode', 118 123 'USER_GROUP_SPECIAL' => 'Pre-defined groups user is a member of', 124 'USER_LIFTED_NR' => 'Successfully removed the user’s newly registered status.', 119 125 '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.', 120 128 'USER_OVERVIEW_UPDATED' => 'User details updated.', 121 129 'USER_POSTS_DELETED' => 'Successfully removed all posts made by this user.', … … 127 135 'USER_RANK_UPDATED' => 'User rank updated.', 128 136 'USER_SIG_UPDATED' => 'User signature successfully updated.', 137 'USER_WARNING_LOG_DELETED' => 'No information available. Possibly the log entry has been deleted.', 129 138 'USER_TOOLS' => 'Basic tools', 130 139 )); -
trunk/forum/language/en/common.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : common.php 9162 2008-12-03 11:18:31Z acydburn$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 88 88 'AVATAR_PARTIAL_UPLOAD' => 'The specified file was only partially uploaded.', 89 89 '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.', 91 91 'AVATAR_URL_INVALID' => 'The URL you specified is invalid.', 92 92 'AVATAR_URL_NOT_FOUND' => 'The file specified could not be found.', … … 159 159 160 160 'EDIT_POST' => 'Edit post', 161 'EMAIL' => 'E-mail', 161 'EMAIL' => 'E-mail', // Short form for EMAIL_ADDRESS 162 162 'EMAIL_ADDRESS' => 'E-mail address', 163 163 'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending e-mail at <strong>Line %1$s</strong>. Response: %2$s.', … … 229 229 230 230 'GENERAL_ERROR' => 'General Error', 231 'GB' => 'GB', 232 'GIB' => 'GiB', 231 233 'GO' => 'Go', 232 234 'GOTO_PAGE' => 'Go to page', … … 249 251 'G_REGISTERED_COPPA' => 'Registered COPPA users', 250 252 'G_GLOBAL_MODERATORS' => 'Global moderators', 253 'G_NEWLY_REGISTERED' => 'Newly registered users', 251 254 252 255 'HIDDEN_USERS_ONLINE' => '%d hidden users online', … … 382 385 'NO_POSTS' => 'No posts', 383 386 '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.', 384 389 'NO_SUBJECT' => 'No subject specified', // Used for posts having no subject defined but displayed within management pages. 385 390 'NO_SUCH_SEARCH_MODULE' => 'The specified search backend doesn’t exist.', … … 413 418 'PAGE_OF' => 'Page <strong>%1$d</strong> of <strong>%2$d</strong>', 414 419 'PASSWORD' => 'Password', 420 'PIXEL' => 'px', 415 421 'PLAY_QUICKTIME_FILE' => 'Play Quicktime file', 416 422 'PM' => 'PM', … … 485 491 'RETURN_TOPIC' => '%sReturn to the topic last visited%s', 486 492 'RETURN_TO' => 'Return to', 493 'FEED' => 'Feed', 494 'FEED_NEWS' => 'News', 495 'FEED_TOPICS_ACTIVE' => 'Active Topics', 496 'FEED_TOPICS_NEW' => 'New Topics', 487 497 'RULES_ATTACH_CAN' => 'You <strong>can</strong> post attachments in this forum', 488 498 'RULES_ATTACH_CANNOT' => 'You <strong>cannot</strong> post attachments in this forum', … … 516 526 'SEARCH_TOPIC' => 'Search this topic…', 517 527 'SEARCH_UNANSWERED' => 'View unanswered posts', 528 'SEARCH_UNREAD' => 'View unread posts', 518 529 'SECONDS' => 'Seconds', 519 530 'SELECT' => 'Select', … … 521 532 'SELECT_DESTINATION_FORUM' => 'Please select a destination forum', 522 533 'SELECT_FORUM' => 'Select a forum', 523 'SEND_EMAIL' => 'E-mail', 534 'SEND_EMAIL' => 'E-mail', // Used for submit buttons 524 535 'SEND_EMAIL_USER' => 'E-mail', // Used as: {L_SEND_EMAIL_USER} {USERNAME} -> E-mail UserX 525 536 'SEND_PRIVATE_MESSAGE' => 'Send private message', … … 534 545 'SORT_LOCATION' => 'Location', 535 546 'SORT_RANK' => 'Rank', 547 'SORT_POSTS' => 'Posts', 536 548 'SORT_TOPIC_TITLE' => 'Topic title', 537 549 'SORT_USERNAME' => 'Username', … … 597 609 'TOPIC' => 'Topic', 598 610 'TOPICS' => 'Topics', 611 'TOPICS_UNAPPROVED' => 'At least one topic in this forum has not been approved.', 599 612 'TOPIC_ICON' => 'Topic icon', 600 613 'TOPIC_LOCKED' => 'This topic is locked, you cannot edit posts or make further replies.', … … 642 655 'USERS' => 'Users', 643 656 '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.', 644 659 645 660 '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 3 3 Hello {USERNAME}, 4 4 5 Your account on "{SITENAME}" has now been activated, you may login using the username and password you received in a previous e-mail. 5 Your account on "{SITENAME}" has now been activated, you may login using the username you received in a previous e-mail. 6 7 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. 6 8 7 9 {EMAIL_SIG} -
trunk/forum/language/en/email/admin_welcome_inactive.txt
r400 r702 7 7 ---------------------------- 8 8 Username: {USERNAME} 9 Password: {PASSWORD}10 9 11 10 Board URL: {U_BOARD} 12 11 ---------------------------- 13 12 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.13 Your 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. 15 14 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 thisaccount.15 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. 17 16 18 17 Thank you for registering. -
trunk/forum/language/en/email/coppa_resend_inactive.txt
r400 r702 3 3 {WELCOME_MSG} 4 4 5 In compliance with the COPPA your account is currently inactive.5 In compliance with the COPPA, your account is currently inactive. 6 6 7 Please print this message outand have your parent or guardian sign and date it. Then fax it to:7 Please print this message and have your parent or guardian sign and date it. Then fax it to: 8 8 9 9 {FAX_INFO} … … 34 34 35 35 36 Once the administrator has received the above form via fax or regular mail your account will be activated.36 Once the administrator has received the above form via fax or regular mail, your account will be activated. 37 37 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 thisaccount.38 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. 39 39 40 40 Thank you for registering. -
trunk/forum/language/en/email/coppa_welcome_inactive.txt
r400 r702 3 3 {WELCOME_MSG} 4 4 5 In compliance with the COPPA your account is currently inactive.5 In compliance with the COPPA, your account is currently inactive. 6 6 7 Please print this message outand have your parent or guardian sign and date it. Then fax it to:7 Please print this message and have your parent or guardian sign and date it. Then fax it to: 8 8 9 9 {FAX_INFO} … … 17 17 18 18 Username: {USERNAME} 19 Password: {PASSWORD}20 19 E-mail: {EMAIL_ADDRESS} 21 20 … … 35 34 36 35 37 Once the administrator has received the above form via fax or regular mail your account will be activated.36 Once the administrator has received the above form via fax or regular mail, your account will be activated. 38 37 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 thisaccount.38 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. 40 39 41 40 Thank you for registering. -
trunk/forum/language/en/email/installed.txt
r400 r702 5 5 You have successfully installed phpBB on your server. 6 6 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.7 This 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. 8 8 9 9 ---------------------------- 10 10 Username: {USERNAME} 11 Password: {PASSWORD}12 11 13 12 Board URL: {U_BOARD} 14 13 ---------------------------- 15 14 16 Useful information on your phpBB installationcan be found in the docs folder of your installation and on phpBB.com's support page - http://www.phpbb.com/support/15 Useful 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/ 17 16 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.17 In 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. 19 18 20 19 {EMAIL_SIG} -
trunk/forum/language/en/email/newtopic_notify.txt
r400 r702 3 3 Hello {USERNAME}, 4 4 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.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 the forum, no more notifications will be sent until you visit the forum. 6 6 7 7 {U_FORUM} -
trunk/forum/language/en/email/user_reactivate_account.txt
r400 r702 10 10 ---------------------------- 11 11 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 thisaccount.12 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. 13 13 14 14 Please visit the following link to reactivate your account: -
trunk/forum/language/en/email/user_remind_inactive.txt
r400 r702 3 3 Hello {USERNAME}, 4 4 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. 5 This 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: 6 6 7 7 {U_ACTIVATE} -
trunk/forum/language/en/email/user_resend_inactive.txt
r400 r702 9 9 ---------------------------- 10 10 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 thisaccount.11 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. 12 12 13 Your account is currently inactive. You cannot use it until you visit the following link:13 Please visit the following link in order to activate your account: 14 14 15 15 {U_ACTIVATE} -
trunk/forum/language/en/email/user_welcome.txt
r400 r702 7 7 ---------------------------- 8 8 Username: {USERNAME} 9 Password: {PASSWORD}10 9 11 10 Board URL: {U_BOARD} 12 11 ---------------------------- 13 12 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 thisaccount.13 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. 15 14 16 15 Thank you for registering. -
trunk/forum/language/en/email/user_welcome_inactive.txt
r400 r702 7 7 ---------------------------- 8 8 Username: {USERNAME} 9 Password: {PASSWORD}10 9 11 10 Board URL: {U_BOARD} 12 11 ---------------------------- 13 12 14 Your account is currently inactive. You cannot use it until you visit the following link:13 Please visit the following link in order to activate your account: 15 14 16 15 {U_ACTIVATE} 17 16 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 thisaccount.17 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. 19 18 20 19 Thank you for registering. -
trunk/forum/language/en/help_bbcode.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : help_bbcode.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 77 77 array( 78 78 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 => '--' 80 85 ), 81 86 array( -
trunk/forum/language/en/help_faq.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : help_faq.php 8896 2008-09-19 16:59:40Z acydburn$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 96 96 ), 97 97 array( 98 0 => 'How do I show an image belowmy 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.' 100 100 ), 101 101 array( … … 117 117 array( 118 118 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 di gression. 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.' 120 120 ), 121 121 array( … … 202 202 0 => 'What are topic icons?', 203 203 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 => '--' 204 209 ), 205 210 array( -
trunk/forum/language/en/install.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : install.php 9177 2008-12-05 11:36:51Z acydburn$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 134 134 'DB_PORT' => 'Database server port', 135 135 '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.', 136 137 'DB_USERNAME' => 'Database username', 137 138 'DB_TEST' => 'Test connection', … … 167 168 'FILLING_TABLE' => 'Filling table <strong>%s</strong>', 168 169 '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 169 173 'FINAL_STEP' => 'Process final step', 170 174 'FORUM_ADDRESS' => 'Board address', … … 185 189 'INSTALL_CONGRATS' => 'Congratulations!', 186 190 '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> 188 192 <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 onto 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> 190 194 <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>', 192 196 'INSTALL_INTRO' => 'Welcome to Installation', 193 197 … … 209 213 <li>PostgreSQL 7.3+</li> 210 214 <li>SQLite 2.8.2+</li> 211 <li>Firebird 2. 0+</li>215 <li>Firebird 2.1+</li> 212 216 <li>MS SQL Server 2000 or above (directly or via ODBC)</li> 213 217 <li>Oracle</li> … … 231 235 '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.', 232 236 '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.', 234 238 '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.', 235 239 '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.', … … 269 273 'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:<br />»<strong>%s</strong>.', 270 274 '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>.', 271 277 272 278 'NAMING_CONFLICT' => 'Naming conflict: %s and %s are both aliases<br /><br />%s', … … 363 369 // Updater 364 370 $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&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&redirect=adm/index.php%3Fi=send_statistics%26mode=send_statistics">Send statistics</a> module in your ACP.', 366 372 'ARCHIVE_FILE' => 'Source file within archive', 367 373 … … 382 388 'CONTINUE_UPDATE_NOW' => 'Continue the update process now', // Shown within the database update script at the end if called from the updater 383 389 'CONTINUE_UPDATE' => 'Continue update now', // Shown after file upload to indicate the update process is not yet finished 384 'CURRENT_FILE' => 'Begin ning of current original file',390 'CURRENT_FILE' => 'Begin of Conflict - Original File code before update', 385 391 'CURRENT_VERSION' => 'Current version', 386 392 … … 392 398 'DIFF_INLINE' => 'Inline', 393 399 'DIFF_RAW' => 'Raw unified diff', 394 'DIFF_SEP_EXPLAIN' => ' End of current original file / Beginning of new updatedfile',400 'DIFF_SEP_EXPLAIN' => 'Code block used within the updated/new file', 395 401 'DIFF_SIDE_BY_SIDE' => 'Side by Side', 396 402 'DIFF_UNIFIED' => 'Unified diff', … … 400 406 'DOWNLOAD_AS' => 'Download as', 401 407 'DOWNLOAD_UPDATE_METHOD_BUTTON' => 'Download modified files archive (recommended)', 408 'DOWNLOAD_CONFLICTS' => 'Download conflicts for this file', 409 'DOWNLOAD_CONFLICTS_EXPLAIN' => 'Search for <<< to spot conflicts', 402 410 'DOWNLOAD_UPDATE_METHOD' => 'Download modified files archive', 403 411 '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.', … … 444 452 'MERGE_NO_MERGE_NEW_OPTION' => 'Do not merge - use new file', 445 453 '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)', 448 456 'MERGE_SELECT_ERROR' => 'Conflicting file merge modes are not correctly selected.', 449 457 'MERGING_FILES' => 'Merging differences', 450 458 'MERGING_FILES_EXPLAIN' => 'Currently collecting final file changes.<br /><br />Please wait until phpBB has completed all operations on changed files.', 451 459 452 'NEW_FILE' => 'End of new updated file',460 'NEW_FILE' => 'End of Conflict', 453 461 'NEW_USERNAME' => 'New username', 454 462 'NO_AUTH_UPDATE' => 'Not authorised to update', … … 463 471 'NOTICE' => 'Notice', 464 472 '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.', 466 474 467 475 '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.', … … 556 564 'USER_INACTIVE' => 'Inactive user', 557 565 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', 566 575 567 576 'WRONG_INFO_FILE_FORMAT' => 'Wrong info file format', -
trunk/forum/language/en/mcp.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : mcp.php 8940 2008-09-26 11:25:04Z toonarmy$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 47 47 'ALL_REPORTS' => 'All reports', 48 48 'ALREADY_REPORTED' => 'This post has already been reported.', 49 'ALREADY_REPORTED_PM' => 'This private message has already been reported.', 49 50 'ALREADY_WARNED' => 'A warning has already been issued for this post.', 50 51 'APPROVE' => 'Approve', … … 59 60 'CAN_LEAVE_BLANK' => 'This can be left blank.', 60 61 '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?', 61 66 'CLOSE_REPORT' => 'Close report', 62 67 'CLOSE_REPORT_CONFIRM' => 'Are you sure you want to close the selected report?', … … 64 69 'CLOSE_REPORTS_CONFIRM' => 'Are you sure you want to close the selected reports?', 65 70 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?', 66 75 'DELETE_POSTS' => 'Delete posts', 67 76 'DELETE_POSTS_CONFIRM' => 'Are you sure you want to delete these posts?', … … 107 116 'LATEST_LOGS' => 'Latest 5 logged actions', 108 117 'LATEST_REPORTED' => 'Latest 5 reports', 118 'LATEST_REPORTED_PMS' => 'Latest 5 PM reports', 109 119 'LATEST_UNAPPROVED' => 'Latest 5 posts awaiting approval', 110 120 'LATEST_WARNING_TIME' => 'Latest warning issued', … … 171 181 'MCP_POST_REPORTS' => 'Reports issued on this post', 172 182 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', 174 191 'MCP_REPORT_DETAILS' => 'Report details', 175 192 'MCP_REPORTS_CLOSED' => 'Closed reports', … … 233 250 'OTHER_USERS' => 'Other users posting from this IP', 234 251 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', 235 261 'POSTER' => 'Poster', 236 262 'POSTS_APPROVED_SUCCESS' => 'The selected posts have been approved.', … … 265 291 'REPORT_DETAILS' => 'Report details', 266 292 '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>', 268 294 'REPORT_NOTIFY' => 'Notify me', 269 295 'REPORT_NOTIFY_EXPLAIN' => 'Informs you when your report is dealt with.', … … 276 302 'RETURN_NEW_FORUM' => '%sGo to the new forum%s', 277 303 'RETURN_NEW_TOPIC' => '%sGo to the new topic%s', 304 'RETURN_PM' => '%sReturn to the private message%s', 278 305 'RETURN_POST' => '%sReturn to the post%s', 279 306 'RETURN_QUEUE' => '%sReturn to the queue%s', … … 303 330 '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.', 304 331 332 'THIS_PM_IP' => 'IP for this private message', 305 333 'THIS_POST_IP' => 'IP for this post', 306 334 'TOPICS_APPROVED_SUCCESS' => 'The selected topics have been approved.', … … 347 375 348 376 'VIEW_DETAILS' => 'View details', 377 'VIEW_PM' => 'View private message', 349 378 'VIEW_POST' => 'View post', 350 379 … … 366 395 ), 367 396 'DESCRIPTION' => array( 368 'WAREZ' => 'The postcontains links to illegal or pirated software.',369 'SPAM' => 'The reported posthas the only purpose to advertise for a website or another product.',370 'OFF_TOPIC' => 'The reported postis off topic.',371 'OTHER' => 'The reported postdoes 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.', 372 401 ) 373 402 ), -
trunk/forum/language/en/memberlist.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : memberlist.php 8574 2008-05-29 13:59:47Z Kellanved$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 82 82 'IM_MSNM' => 'Please note that you need Windows Messenger installed to use this.', 83 83 '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.', 85 85 'IM_NAME' => 'Your Name', 86 86 'IM_NO_DATA' => 'There is no suitable contact information for this user.', … … 91 91 'IM_SENT_JABBER' => 'Your message to %1$s has been sent successfully.', 92 92 'IM_USER' => 'Send an instant message', 93 93 94 94 'LAST_ACTIVE' => 'Last active', 95 95 'LESS_THAN' => 'Less than', … … 135 135 'USER_BAN' => 'Banning', 136 136 '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 ), 137 141 'USER_ONLINE' => 'Online', 138 142 'USER_PRESENCE' => 'Board presence', -
trunk/forum/language/en/posting.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : posting.php 8555 2008-05-15 14:10:11Z Kellanved$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 142 142 'PARTIAL_UPLOAD' => 'The uploaded file was only partially uploaded.', 143 143 '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.', 145 145 'PLACE_INLINE' => 'Place inline', 146 146 'POLL_DELETE' => 'Delete poll', … … 168 168 'POST_NORMAL' => 'Normal', 169 169 '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.', 170 172 '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.', 171 173 'POST_STORED' => 'This message has been posted successfully.', … … 185 187 'STICKY_ANNOUNCE_TIME_LIMIT'=> 'Sticky/Announcement time limit', 186 188 '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.', 188 190 'STYLES_TIP' => 'Tip: Styles can be applied quickly to selected text.', 189 191 190 192 '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.', 191 194 'TOO_FEW_POLL_OPTIONS' => 'You must enter at least two poll options.', 192 195 'TOO_MANY_ATTACHMENTS' => 'Cannot add another attachment, %d is the maximum.', -
trunk/forum/language/en/search.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : search.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 54 54 55 55 '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.', 56 59 57 60 '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 5 5 * 6 6 * @package language 7 * @version $Id : search_synonyms.php 8479 2008-03-29 00:22:48Z naderman$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 27 27 'anemic' => 'anaemic', 28 28 'anesthesia' => 'anaesthesia', 29 'ap pologize' => 'appologise',29 'apologize' => 'apologise', 30 30 'archean' => 'archaean', 31 31 'archeology' => 'archaeology', -
trunk/forum/language/en/ucp.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : ucp.php 9162 2008-12-03 11:18:31Z acydburn$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 80 80 'ADD_RULE' => 'Add rule', 81 81 '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.', 82 83 'ADMIN_EMAIL' => 'Administrators can e-mail me information', 83 84 'AGREE' => 'I agree to these terms', … … 93 94 'AVATAR_GALLERY' => 'Local gallery', 94 95 'AVATAR_GENERAL_UPLOAD_ERROR' => 'Could not upload avatar to %s.', 96 'AVATAR_NOT_ALLOWED' => 'Your avatar cannot be displayed because avatars have been disallowed.', 95 97 'AVATAR_PAGE' => 'Page', 98 'AVATAR_TYPE_NOT_ALLOWED' => 'Your current avatar cannot be displayed because its type has been disallowed.', 96 99 97 100 'BACK_TO_DRAFTS' => 'Back to saved drafts', … … 123 126 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing your e-mail address.', 124 127 '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 125 131 'CONFIRM_PASSWORD' => 'Confirm password', 126 132 'CONFIRM_PASSWORD_EXPLAIN' => 'You only need to confirm your password if you changed it above.', … … 195 201 'FOLDER_ADDED' => 'Folder successfully added.', 196 202 'FOLDER_MESSAGE_STATUS' => '%1$d from %2$d messages stored', 203 'FOLDER_NAME_EMPTY' => 'You must enter a name for this folder.', 197 204 'FOLDER_NAME_EXIST' => 'Folder <strong>%s</strong> already exists.', 198 205 'FOLDER_OPTIONS' => 'Folder options', … … 271 278 'NOTIFY_ON_PM' => 'Notify me on new private messages', 272 279 '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.', 273 281 'NOT_ADDED_FRIENDS_FOES' => 'You cannot add users to your friends list who are on your foes list.', 274 282 'NOT_ADDED_FRIENDS_SELF' => 'You cannot add yourself to the friends list.', 275 283 'NOT_ADDED_FOES_MOD_ADMIN' => 'You cannot add administrators and moderators to your foes list.', 276 284 '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.', 277 286 'NOT_ADDED_FOES_FRIENDS' => 'You cannot add users to your foes list who are on your friends list.', 278 287 'NOT_ADDED_FOES_SELF' => 'You cannot add yourself to the foes list.', … … 326 335 'PASSWORD' => 'Password', 327 336 'PASSWORD_ACTIVATED' => 'Your new password has been activated.', 328 'PASSWORD_UPDATED' => ' Your password has been sent successfully to your originale-mail address.',337 'PASSWORD_UPDATED' => 'A new password was sent to your registered e-mail address.', 329 338 'PERMISSIONS_RESTORED' => 'Successfully restored original permissions.', 330 339 '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.', … … 344 353 'POST_FORWARD_PM' => 'Forward message', 345 354 'POST_NEW_PM' => 'Compose message', 346 'POST_PM_LOCKED' => 'Private messaging is locked ',355 'POST_PM_LOCKED' => 'Private messaging is locked.', 347 356 'POST_PM_POST' => 'Quote post', 348 357 'POST_QUOTE_PM' => 'Quote message', … … 366 375 'RENAME_FOLDER' => 'Rename folder', 367 376 'REPLIED_MESSAGE' => 'Replied to message', 377 'REPLY_TO_ALL' => 'Reply to sender and all recipients.', 378 'REPORT_PM' => 'Report private message', 368 379 'RESIGN_SELECTED' => 'Resign selected', 369 380 'RETURN_FOLDER' => '%1$sReturn to previous folder%2$s', … … 415 426 'UCP_MAIN_SUBSCRIBED' => 'Manage subscriptions', 416 427 417 'UCP_MSNM' => ' MSN Messenger',428 'UCP_MSNM' => 'WL/MSN Messenger', 418 429 'UCP_NO_ATTACHMENTS' => 'You have posted no files.', 419 430 … … 450 461 'UCP_ZEBRA_FOES' => 'Manage foes', 451 462 'UCP_ZEBRA_FRIENDS' => 'Manage friends', 463 'UNDISCLOSED_RECIPIENT' => 'Undisclosed Recipient', 452 464 'UNKNOWN_FOLDER' => 'Unknown folder', 453 465 'UNWATCH_MARKED' => 'Unwatch marked', -
trunk/forum/language/en/viewtopic.php
r400 r702 5 5 * 6 6 * @package language 7 * @version $Id : viewtopic.php 8775 2008-08-21 15:41:12Z Kellanved$7 * @version $Id$ 8 8 * @copyright (c) 2005 phpBB Group 9 9 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 49 49 50 50 'CODE' => 'Code', 51 'COLLAPSE_QR' => 'Hide Quick Reply', 51 52 52 53 'DELETE_TOPIC' => 'Delete topic', … … 60 61 'FILE_NOT_FOUND_404' => 'The file <strong>%s</strong> does not exist.', 61 62 'FORK_TOPIC' => 'Copy topic', 62 63 'FULL_EDITOR' => 'Full Editor', 64 63 65 'LINKAGE_FORBIDDEN' => 'You are not authorised to view, download or link from/to this site.', 64 66 'LOGIN_NOTIFY_TOPIC' => 'You have been notified about this topic, please login to view it.', … … 87 89 88 90 'QUICK_MOD' => 'Quick-mod tools', 91 'QUICKREPLY' => 'Quick Reply', 89 92 'QUOTE' => 'Quote', 90 93 … … 92 95 'RETURN_POST' => '%sReturn to the post%s', 93 96 97 'SHOW_QR' => 'Quick Reply', 94 98 'SUBMIT_VOTE' => 'Submit vote', 95 99 -
trunk/forum/mcp.php
r400 r702 3 3 * 4 4 * @package mcp 5 * @version $Id : mcp.php 9015 2008-10-14 18:29:50Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 78 78 $topic_id = request_var('t', 0); 79 79 $forum_id = request_var('f', 0); 80 $report_id = request_var('r', 0); 80 81 $user_id = request_var('u', 0); 81 82 $username = utf8_normalize_nfc(request_var('username', '', true)); … … 171 172 172 173 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 173 180 $module->set_active('logs', 'topic_logs'); 174 181 break; … … 206 213 } 207 214 208 if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' )215 if ($mode == '' || $mode == 'reports' || $mode == 'reports_closed' || $mode == 'pm_reports' || $mode == 'pm_reports_closed' || $mode == 'pm_report_details') 209 216 { 210 217 $module->set_display('reports', 'report_details', false); 218 } 219 220 if ($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); 211 223 } 212 224 … … 318 330 function extra_url() 319 331 { 320 global $forum_id, $topic_id, $post_id, $ user_id;332 global $forum_id, $topic_id, $post_id, $report_id, $user_id; 321 333 322 334 $url_extra = ''; … … 325 337 $url_extra .= ($post_id) ? "&p=$post_id" : ''; 326 338 $url_extra .= ($user_id) ? "&u=$user_id" : ''; 339 $url_extra .= ($report_id) ? "&r=$report_id" : ''; 327 340 328 341 return $url_extra; … … 559 572 560 573 /** 574 * Get simple pm data 575 */ 576 function 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 /** 561 613 * sorting in mcp 562 614 * 563 615 * @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 564 619 */ 565 620 function 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') … … 609 664 $default_key = 't'; 610 665 $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'; 617 674 618 675 if ($min_time) … … 638 695 break; 639 696 697 case 'pm_reports': 698 case 'pm_reports_closed': 640 699 case 'reports': 641 700 case 'reports_closed': 642 $type = 'reports'; 701 $pm = (strpos($mode, 'pm_') === 0) ? true : false; 702 703 $type = ($pm) ? 'pm_reports' : 'reports'; 643 704 $default_key = 't'; 644 705 $default_dir = 'd'; … … 647 708 if ($topic_id) 648 709 { 649 $where_sql .= ' p.topic_id = ' . $topic_id ;710 $where_sql .= ' p.topic_id = ' . $topic_id . ' AND '; 650 711 } 651 712 else if ($forum_id) 652 713 { 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 '; 654 724 } 655 725 else 656 726 { 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"; 663 737 } 664 738 else 665 739 { 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 } 674 746 break; 675 747 … … 712 784 $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']); 713 785 $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'); 714 792 break; 715 793 -
trunk/forum/memberlist.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : memberlist.php 9156 2008-12-02 18:48:25Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 431 431 $user_id = (int) $member['user_id']; 432 432 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 433 438 // 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'; 440 444 $result = $db->sql_query($sql); 441 445 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 442 489 $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); 448 498 449 499 // What colour is the zebra … … 501 551 $poster_avatar = get_user_avatar($member['user_avatar'], $member['user_avatar_type'], $member['user_avatar_width'], $member['user_avatar_height']); 502 552 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)); 504 578 505 579 // Custom Profile Fields … … 511 585 $profile_fields = $cp->generate_profile_fields_template('grab', $user_id); 512 586 $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 accessible516 $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);528 587 } 529 588 … … 574 633 'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '', 575 634 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&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&u={$user_id}&hash=" . generate_link_hash('switchperm')) : '', 636 637 'S_USER_NOTES' => ($user_notes_enabled) ? true : false, 638 'S_WARN_USER' => ($warn_user_enabled) ? true : false, 578 639 '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&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',580 'U_ADD_FOE' => (!$f oe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '',581 'U_REMOVE_FRIEND' => ($friend ) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '',582 'U_REMOVE_FOE' => ($foe ) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '',640 'U_ADD_FRIEND' => (!$friend && !$foe && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', 641 'U_ADD_FOE' => (!$friend && !$foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', 642 'U_REMOVE_FRIEND' => ($friend && $friends_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', 643 'U_REMOVE_FOE' => ($foe && $foes_enabled) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&mode=foes&usernames[]=' . $user_id) : '', 583 644 )); 584 645 … … 891 952 892 953 $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 ) 894 958 ); 895 959 … … 963 1027 $search_group_id = request_var('search_group_id', 0); 964 1028 1029 // when using these, make sure that we actually have values defined in $find_key_match 965 1030 $joined_select = request_var('joined_select', 'lt'); 966 1031 $active_select = request_var('active_select', 'lt'); 967 1032 $count_select = request_var('count_select', 'eq'); 1033 968 1034 $joined = explode('-', request_var('joined', '')); 969 1035 $active = explode('-', request_var('active', '')); … … 1003 1069 $sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', $db->any_char, $msn)) . ' ' : ''; 1004 1070 $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])) : ''; 1008 1074 $sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : ''; 1009 1075 … … 1236 1302 'active' => array('active', ''), 1237 1303 'count' => (request_var('count', '') !== '') ? array('count', 0) : array('count', ''), 1238 'ip domain'=> array('ip', ''),1304 'ip' => array('ip', ''), 1239 1305 'first_char' => array('first_char', ''), 1240 1306 ); … … 1520 1586 1521 1587 // Output the page 1522 page_header($page_title );1588 page_header($page_title, false); 1523 1589 1524 1590 $template->set_filenames(array( … … 1532 1598 * Prepare profile data 1533 1599 */ 1534 function show_profile($data )1600 function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false) 1535 1601 { 1536 1602 global $config, $auth, $template, $user, $phpEx, $phpbb_root_path; … … 1618 1684 'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false, 1619 1685 1686 'S_WARNINGS' => ($auth->acl_getf_global('m_') || $auth->acl_get('m_warn')) ? true : false, 1687 1620 1688 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=posts") : '', 1621 'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '',1622 'U_WARN' => $auth->acl_get('m_warn') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&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&mode=user_notes&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&mode=warn_user&u=' . $user_id, true, $user->session_id) : '', 1623 1691 '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&mode=compose&u=' . $user_id) : '', 1624 1692 'U_EMAIL' => $email, 1625 1693 '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']) : '', 1626 1695 'U_ICQ' => ($data['user_icq']) ? 'http://www.icq.com/people/webmsg.php?to=' . urlencode($data['user_icq']) : '', 1627 1696 'U_AIM' => ($data['user_aim'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&action=aim&u=' . $user_id) : '', -
trunk/forum/posting.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : posting.php 9048 2008-11-04 15:54:43Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 40 40 $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false; 41 41 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; 43 43 $mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', ''); 44 44 … … 46 46 $current_time = time(); 47 47 48 49 48 // Was cancel pressed? If so then redirect to the appropriate page 50 49 if ($cancel || ($current_time - $lastclick < 2 && $submit)) 51 50 { 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 . '&' : ''; 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"))); 53 53 redirect($redirect); 54 54 } … … 75 75 } 76 76 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 77 87 $sql = 'SELECT f.*, t.* 78 88 FROM ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . " f 79 89 WHERE t.topic_id = $topic_id 80 90 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'); 82 93 break; 83 94 … … 90 101 trigger_error('NO_POST'); 91 102 } 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; 92 113 93 114 $sql = 'SELECT f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield … … 97 118 AND u.user_id = p.poster_id 98 119 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'); 100 122 break; 101 123 … … 143 165 } 144 166 167 // Not able to reply to unapproved posts/topics 168 // TODO: add more descriptive language key 169 if ($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 145 174 if ($mode == 'popup') 146 175 { … … 150 179 151 180 $user->setup(array('posting', 'mcp', 'viewtopic'), $post_data['forum_style']); 181 182 if ($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 } 152 188 153 189 // Use post_row values in favor of submitted ones... … … 343 379 344 380 $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']) : ''; 345 382 $post_data['post_subject'] = (in_array($mode, array('quote', 'edit'))) ? $post_data['post_subject'] : ((isset($post_data['topic_title'])) ? $post_data['topic_title'] : ''); 346 383 $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; … … 467 504 // HTML, BBCode, Smilies, Images and Flash status 468 505 $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; 470 507 $img_status = ($bbcode_status && $auth->acl_get('f_img', $forum_id)) ? true : false; 471 508 $url_status = ($config['allow_post_links']) ? true : false; 472 509 $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; 474 511 475 512 // Save Draft … … 517 554 ); 518 555 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 519 597 confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields); 520 598 } … … 565 643 } 566 644 567 $solved_captcha = false;568 645 569 646 if ($submit || $preview || $refresh) … … 579 656 $post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL)); 580 657 $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 } 582 663 583 664 $post_data['enable_bbcode'] = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; … … 647 728 $post_data['poll_option_text'] = utf8_normalize_nfc(request_var('poll_option_text', '', true)); 648 729 $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; 650 731 } 651 732 … … 674 755 $message_md5 = md5($message_parser->message); 675 756 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 676 789 // Check checksum ... don't re-parse message if the same 677 790 $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'])); 678 794 679 795 // Parse message … … 742 858 if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply'))) 743 859 { 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; 763 869 } 764 870 } … … 887 993 $db->sql_freeresult($result); 888 994 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))) 890 996 { 891 997 $to_forum_id = 0; … … 999 1105 } 1000 1106 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'])) 1005 1117 { 1006 1118 meta_refresh(10, $redirect_url); … … 1129 1241 if ($mode == 'quote' && !$submit && !$preview && !$refresh) 1130 1242 { 1131 $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n"; 1243 if ($config['allow_bbcode']) 1244 { 1245 $message_parser->message = '[quote="' . $post_data['quote_username'] . '"]' . censor_text(trim($message_parser->message)) . "[/quote]\n"; 1246 } 1247 else 1248 { 1249 $offset = 0; 1250 $quote_string = "> "; 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, ">") !== 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 } 1132 1263 } 1133 1264 … … 1158 1289 // Forum moderators? 1159 1290 $moderators = array(); 1160 get_moderators($moderators, $forum_id); 1291 if ($config['load_moderators']) 1292 { 1293 get_moderators($moderators, $forum_id); 1294 } 1161 1295 1162 1296 // Generate smiley listing … … 1219 1353 generate_forum_rules($post_data); 1220 1354 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. 1356 if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === false) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote')) 1357 { 1245 1358 1246 1359 $template->assign_vars(array( 1247 1360 'S_CONFIRM_CODE' => true, 1248 'CONFIRM_ID' => $confirm_id, 1249 'CONFIRM_IMAGE' => '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&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(), 1251 1362 )); 1252 1363 } … … 1256 1367 $s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', $draft_id) . '" />' : ''; 1257 1368 1369 if ($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 1258 1377 // 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 ); 1378 if (isset($captcha) && $captcha->is_solved() !== false) 1379 { 1380 $s_hidden_fields .= build_hidden_fields($captcha->get_hidden_fields()); 1265 1381 } 1266 1382 … … 1287 1403 'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 1288 1404 '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'], 1289 1406 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), 1290 1407 'POST_DATE' => ($post_data['post_time']) ? $user->format_date($post_data['post_time']) : '', … … 1303 1420 'S_DISPLAY_USERNAME' => (!$user->data['is_registered'] || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS)) ? true : false, 1304 1421 '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, 1306 1423 'S_BBCODE_ALLOWED' => $bbcode_status, 1307 1424 'S_BBCODE_CHECKED' => ($bbcode_checked) ? ' checked="checked"' : '', … … 1341 1458 $template->assign_vars(array( 1342 1459 '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)), 1344 1461 '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))), 1345 1462 'S_POLL_DELETE_CHECKED' => (!empty($poll_delete)) ? true : false, … … 1362 1479 1363 1480 // Output page ... 1364 page_header($page_title );1481 page_header($page_title, false); 1365 1482 1366 1483 $template->set_filenames(array( … … 1390 1507 ($forum_style) ? $user->setup('posting', $forum_style) : $user->setup('posting'); 1391 1508 1392 page_header($user->lang['PROGRESS_BAR'] );1509 page_header($user->lang['PROGRESS_BAR'], false); 1393 1510 1394 1511 $template->set_filenames(array( … … 1415 1532 1416 1533 // 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']))) 1418 1535 { 1419 1536 $s_hidden_fields = build_hidden_fields(array( … … 1439 1556 1440 1557 $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']; 1441 1559 1442 1560 if ($next_post_id === false) 1443 1561 { 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); 1445 1563 1446 1564 $meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"); … … 1449 1567 else 1450 1568 { 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); 1452 1570 1453 1571 $meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&p=$next_post_id") . "#p$next_post_id"; -
trunk/forum/report.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : report.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 25 25 $forum_id = request_var('f', 0); 26 26 $post_id = request_var('p', 0); 27 $pm_id = request_var('pm', 0); 27 28 $reason_id = request_var('reason_id', 0); 28 29 $report_text = utf8_normalize_nfc(request_var('report_text', '', true)); … … 31 32 $submit = (isset($_POST['submit'])) ? true : false; 32 33 33 if (!$post_id )34 if (!$post_id && (!$pm_id || !$config['allow_pm_report'])) 34 35 { 35 36 trigger_error('NO_POST_SELECTED'); 36 37 } 37 38 38 $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&p=$post_id") . "#p$post_id"; 39 if ($post_id) 40 { 41 $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&p=$post_id") . "#p$post_id"; 42 $pm_id = 0; 43 } 44 else 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 } 39 50 40 51 // Has the report been cancelled? … … 44 55 } 45 56 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); 57 if ($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 } 107 else 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 } 92 131 } 93 132 … … 110 149 'reason_id' => (int) $reason_id, 111 150 'post_id' => $post_id, 151 'pm_id' => $pm_id, 112 152 'user_id' => (int) $user->data['user_id'], 113 153 'user_notify' => (int) $user_notify, … … 121 161 $report_id = $db->sql_nextid(); 122 162 123 if ( !$report_data['post_reported'])163 if ($post_id) 124 164 { 125 165 $sql = 'UPDATE ' . POSTS_TABLE . ' … … 127 167 WHERE post_id = ' . $post_id; 128 168 $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; 137 187 $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']; 138 207 } 139 208 140 209 meta_refresh(3, $redirect_url); 141 210 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>'); 143 212 trigger_error($message); 144 213 } … … 147 216 display_reasons($reason_id); 148 217 218 $page_title = ($pm_id) ? $user->lang['REPORT_MESSAGE'] : $user->lang['REPORT_POST']; 219 149 220 $template->assign_vars(array( 221 'S_REPORT_POST' => ($pm_id) ? false : true, 150 222 'REPORT_TEXT' => $report_text, 151 'S_REPORT_ACTION' => append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&p=' . $post_id ),223 'S_REPORT_ACTION' => append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&p=' . $post_id . '&pm=' . $pm_id), 152 224 153 225 'S_NOTIFY' => $user_notify, … … 158 230 159 231 // Start output of page 160 page_header($ user->lang['REPORT_POST']);232 page_header($page_title); 161 233 162 234 $template->set_filenames(array( -
trunk/forum/search.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : search.php 9040 2008-11-01 19:00:50Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 48 48 $search_forum = request_var('fid', array(0)); 49 49 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 54 if ($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 65 if ($search_id == 'unreadposts' && !$config['load_anon_lastread'] && !$user->data['is_registered']) 66 { 67 login_box('', $user->lang['LOGIN_EXPLAIN_UNREADSEARCH']); 68 } 69 50 70 // Is user able to search? Has search been disabled? 51 71 if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$config['load_search']) … … 85 105 $id_ary = array(); 86 106 87 // egosearch is an author search88 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 98 107 // If we are looking for authors get their ids 99 108 $author_id_ary = array(); 109 $sql_author_match = ''; 100 110 if ($author_id) 101 111 { … … 114 124 FROM ' . USERS_TABLE . " 115 125 WHERE $sql_where 116 AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')';126 AND user_type <> " . USER_IGNORE; 117 127 $result = $db->sql_query_limit($sql, 100); 118 128 … … 122 132 } 123 133 $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 } 124 150 125 151 if (!sizeof($author_id_ary)) … … 156 182 $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'] . ')' : ""; 157 183 158 $sql = 'SELECT f.forum_id, f.forum_name, f.parent_id, f.forum_type, f.right_id, f.forum_password, f a.user_id184 $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 159 185 FROM ' . FORUMS_TABLE . ' f 160 186 LEFT JOIN ' . FORUMS_ACCESS_TABLE . " fa ON (fa.forum_id = f.forum_id … … 169 195 { 170 196 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')) 171 204 { 172 205 $ex_fid_ary[] = (int) $row['forum_id']; … … 308 341 $last_post_time = ''; 309 342 } 310 311 343 312 344 if ($sort_key == 'a') … … 342 374 break; 343 375 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 344 404 case 'newposts': 345 405 $l_search_title = $user->lang['SEARCH_NEW']; … … 373 433 ' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . " 374 434 $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 */ 375 449 $field = 'topic_id'; 376 450 } … … 396 470 while ($row = $db->sql_fetchrow($result)) 397 471 { 398 $id_ary[] = $row[$field];472 $id_ary[] = (int) $row[$field]; 399 473 } 400 474 $db->sql_freeresult($result); … … 416 490 if (!empty($search->search_query)) 417 491 { 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); 419 493 } 420 494 else if (sizeof($author_id_ary)) 421 495 { 422 496 $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); 424 498 } 425 499 … … 471 545 472 546 $u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit))); 473 $u_show_results = ($show_results != 'posts') ? '&sr=' . $show_results : '';547 $u_show_results = '&sr=' . $show_results; 474 548 $u_search_forum = implode('&fid%5B%5D=', $search_forum); 475 549 476 550 $u_search = append_sid("{$phpbb_root_path}search.$phpEx", $u_sort_param . $u_show_results); 477 551 $u_search .= ($search_id) ? '&search_id=' . $search_id : ''; 478 $u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($ search->search_query)) : '';552 $u_search .= ($u_hilit) ? '&keywords=' . urlencode(htmlspecialchars_decode($keywords)) : ''; 479 553 $u_search .= ($search_terms != 'all') ? '&terms=' . $search_terms : ''; 480 554 $u_search .= ($topic_id) ? '&t=' . $topic_id : ''; … … 582 656 while ($row = $db->sql_fetchrow($result)) 583 657 { 658 $row['forum_id'] = (int) $row['forum_id']; 659 $row['topic_id'] = (int) $row['topic_id']; 660 584 661 if ($row['topic_status'] == ITEM_MOVED) 585 662 { … … 768 845 } 769 846 770 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$u_forum_id&t=$result_topic_id" . (($u_hilit) ? "&hilit=$u_hilit" : '')); 847 $view_topic_url_params = "f=$u_forum_id&t=$result_topic_id" . (($u_hilit) ? "&hilit=$u_hilit" : ''); 848 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params); 771 849 772 850 $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies']; … … 826 904 'S_POSTS_UNAPPROVED' => $posts_unapproved, 827 905 828 'U_LAST_POST' => $view_topic_url . '&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 . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 829 907 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 830 908 '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 . '&view=unread#unread',909 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread', 832 910 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=reports&t=' . $result_topic_id, true, $user->session_id), 833 911 'U_MCP_QUEUE' => $u_mcp_queue, … … 930 1008 page_footer(); 931 1009 } 932 933 1010 934 1011 // Search forum -
trunk/forum/style.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : style.php 8780 2008-08-22 12:52:48Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 16 16 $phpEx = substr(strrchr(__FILE__, '.'), 1); 17 17 18 // Report all errors, except notices 19 error_reporting(E_ALL ^ E_NOTICE); 18 // Report all errors, except notices and deprecation messages 19 if (!defined('E_DEPRECATED')) 20 { 21 define('E_DEPRECATED', 8192); 22 } 23 error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED); 20 24 21 25 require($phpbb_root_path . 'config.' . $phpEx); … … 32 36 33 37 // Load Extensions 34 if (!empty($load_extensions) )38 if (!empty($load_extensions) && function_exists('dl')) 35 39 { 36 40 $load_extensions = explode(',', $load_extensions); … … 92 96 if (!$user) 93 97 { 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; 96 101 $user = array('user_id' => ANONYMOUS); 97 102 } … … 119 124 $user_image_lang = (file_exists($phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $user['user_lang'])) ? $user['user_lang'] : $config['default_lang']; 120 125 126 // Same query in session.php 121 127 $sql = 'SELECT * 122 128 FROM ' . STYLES_IMAGESET_DATA_TABLE . ' 123 129 WHERE imageset_id = ' . $theme['imageset_id'] . " 124 AND image_filename <> '' 130 AND image_filename <> '' 125 131 AND image_lang IN ('" . $db->sql_escape($user_image_lang) . "', '')"; 126 132 $result = $db->sql_query($sql, 3600); … … 258 264 $replace[] = $imgs[$img]['src']; 259 265 break; 260 266 261 267 case 'WIDTH': 262 268 $replace[] = $imgs[$img]['width']; 263 269 break; 264 270 265 271 case 'HEIGHT': 266 272 $replace[] = $imgs[$img]['height']; -
trunk/forum/styles/prosilver/imageset/imageset.cfg
r400 r702 3 3 # 4 4 # @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 7 7 # 8 8 # … … 12 12 # 13 13 # 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. 15 15 # Single and double quotes do not need to be escaped. 16 16 # 17 # 17 # 18 18 19 19 # General Information about this style 20 20 name = prosilver 21 21 copyright = © phpBB Group, 2007 22 version = 3.0. 422 version = 3.0.7 23 23 24 24 # Images 25 25 img_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 = 26 img_poll_left = 27 img_poll_center = 28 img_poll_right = 29 img_icon_friend = 30 img_icon_foe = 31 31 32 32 img_forum_link = forum_link.gif*27*27 … … 112 112 img_icon_topic_unapproved = icon_topic_unapproved.gif*14*16 113 113 114 img_icon_user_profile = 114 img_icon_user_profile = 115 115 116 116 img_icon_user_warn = icon_user_warn.gif*20*20 -
trunk/forum/styles/prosilver/style.cfg
r400 r702 3 3 # 4 4 # @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 7 7 # 8 8 # … … 12 12 # 13 13 # 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. 15 15 # Single and double quotes do not need to be escaped. 16 16 # 17 # 17 # 18 18 19 19 # General Information about this style 20 20 name = prosilver 21 21 copyright = © phpBB Group, 2007 22 version = 3.0. 422 version = 3.0.7 -
trunk/forum/styles/prosilver/template/attachment.html
r400 r702 62 62 <!-- ELSEIF _file.S_FLASH_FILE --> 63 63 <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}" /> 65 65 <param name="play" value="true" /> 66 66 <param name="loop" value="true" /> … … 68 68 <param name="allowScriptAccess" value="never" /> 69 69 <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> 71 71 </object> 72 72 <!-- ELSEIF _file.S_QUICKTIME_FILE --> -
trunk/forum/styles/prosilver/template/drafts.html
r400 r702 11 11 </div> 12 12 13 <div class=" forumbg">13 <div class="<!-- IF not S_PRIVMSGS -->forumbg<!-- ELSE -->panel<!-- ENDIF -->"> 14 14 <div class="inner"><span class="corners-top"><span></span></span> 15 15 … … 22 22 </li> 23 23 </ul> 24 <ul class="topiclist topics">24 <ul class="topiclist<!-- IF not S_PRIVMSGS --> topics<!-- ELSE --> cplist<!-- ENDIF -->"> 25 25 26 26 <!-- BEGIN draftrow --> -
trunk/forum/styles/prosilver/template/editor.js
r400 r702 8 8 var theSelection = false; 9 9 10 var bbcodeEnabled = true; 10 11 // Check for Browser & Platform for PC & IE specific bits 11 12 // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html … … 15 16 var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1)); 16 17 var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); 17 18 18 var baseHeight; 19 onload_functions.push('initInsertions()');20 19 21 20 /** … … 252 251 if (theSelection) 253 252 { 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 } 255 265 } 256 266 … … 258 268 } 259 269 270 function 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 } 260 306 /** 261 307 * From http://www.massless.org/mozedit/ … … 263 309 function mozWrap(txtarea, open, close) 264 310 { 265 var selLength = txtarea.textLength;311 var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength; 266 312 var selStart = txtarea.selectionStart; 267 313 var selEnd = txtarea.selectionEnd; … … 278 324 279 325 txtarea.value = s1 + open + s2 + close + s3; 280 txtarea.selectionStart = sel End + open.length + close.length;281 txtarea.selectionEnd = txtarea.selectionStart;326 txtarea.selectionStart = selStart + open.length; 327 txtarea.selectionEnd = selEnd + open.length; 282 328 txtarea.focus(); 283 329 txtarea.scrollTop = scrollTop; -
trunk/forum/styles/prosilver/template/faq_body.html
r400 r702 8 8 <div class="column1"> 9 9 <!-- 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) --> 11 11 </div> 12 12 -
trunk/forum/styles/prosilver/template/forum_fn.js
r400 r702 24 24 var page = prompt(jump_page, on_page); 25 25 26 if (page !== null && !isNaN(page) && page > 0) 27 { 28 document.location.href = base_url.replace(/&/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(/&/g, '&') + '&start=' + ((page - 1) * per_page); 35 } 29 36 } 30 37 } … … 201 208 else 202 209 { 210 // workaround for bug # 42885 211 if (window.opera && e.innerHTML.substring(e.innerHTML.length - 4) == '<BR>') 212 { 213 e.innerHTML = e.innerHTML + ' '; 214 } 215 203 216 var r = document.createRange(); 204 217 r.selectNodeContents(e); … … 256 269 obj.Play(); 257 270 } 271 272 /** 273 * Check if the nodeName of elem is name 274 * @author jQuery 275 */ 276 function 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 */ 285 function 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 */ 300 function 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 320 var in_autocomplete = false; 321 var last_key_entered = ''; 322 323 /** 324 * Check event key 325 */ 326 function 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 */ 356 function 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 */ 396 function 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 */ 438 var jquery_present = typeof jQuery == 'function'; -
trunk/forum/styles/prosilver/template/forumlist_body.html
r400 r702 28 28 <dl class="icon" style="background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;"> 29 29 <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 30 32 <!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF --> 31 33 <a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br /> … … 42 44 <dd class="posts">{forumrow.POSTS} <dfn>{L_POSTS}</dfn></dd> 43 45 <dd class="lastpost"><span> 46 <!-- IF forumrow.U_UNAPPROVED_TOPICS --><a href="{forumrow.U_UNAPPROVED_TOPICS}">{UNAPPROVED_IMG}</a><!-- ENDIF --> 44 47 <!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} 45 48 <!-- 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 /> <!-- ENDIF --></span> -
trunk/forum/styles/prosilver/template/index_body.html
r400 r702 7 7 <ul class="linklist"> 8 8 <!-- IF S_DISPLAY_SEARCH --> 9 <li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_USER_LOGGED_IN --> • <a href="{U_SEARCH_ NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> • <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 --> • <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a> • <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> • <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li> 10 10 <!-- ENDIF --> 11 11 <!-- 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 --> … … 19 19 <h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a><!-- IF S_REGISTER_ENABLED --> • <a href="{U_REGISTER}">{L_REGISTER}</a><!-- ENDIF --></h3> 20 20 <fieldset class="quick-login"> 21 <label for="username">{L_USERNAME}:</label> <input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" /> 21 <label for="username">{L_USERNAME}:</label> <input type="text" name="username" id="username" size="10" class="inputbox" title="{L_USERNAME}" /> 22 22 <label for="password">{L_PASSWORD}:</label> <input type="password" name="password" id="password" size="10" class="inputbox" title="{L_PASSWORD}" /> 23 23 <!-- IF S_AUTOLOGIN_ENABLED --> … … 25 25 <!-- ENDIF --> 26 26 <input type="submit" name="login" value="{L_LOGIN}" class="button2" /> 27 {S_LOGIN_REDIRECT} 27 28 </fieldset> 28 29 </form> -
trunk/forum/styles/prosilver/template/login_body.html
r400 r702 7 7 <div class="content"> 8 8 <h2><!-- IF LOGIN_EXPLAIN -->{LOGIN_EXPLAIN}<!-- ELSE -->{L_LOGIN}<!-- ENDIF --></h2> 9 9 10 10 <fieldset <!-- IF not S_CONFIRM_CODE -->class="fields1"<!-- ELSE -->class="fields2"<!-- ENDIF -->> 11 11 <!-- IF LOGIN_ERROR --><div class="error">{LOGIN_ERROR}</div><!-- ENDIF --> … … 22 22 <!-- ENDIF --> 23 23 </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} --> 31 27 <!-- ENDIF --> 32 33 28 <!-- IF S_DISPLAY_FULL_LOGIN --> 34 29 <dl> … … 37 32 </dl> 38 33 <!-- ENDIF --> 34 39 35 <dl> 40 36 <dt> </dt> 41 37 <dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="6" value="{L_LOGIN}" class="button1" /></dd> 42 38 </dl> 43 39 {S_LOGIN_REDIRECT} 44 40 </fieldset> 45 41 </div> 46 42 <span class="corners-bottom"><span></span></span></div> 47 43 </div> 44 48 45 49 46 <!-- IF not S_ADMIN_AUTH and S_REGISTER_ENABLED --> -
trunk/forum/styles/prosilver/template/login_forum.html
r400 r702 25 25 <dd>{S_HIDDEN_FIELDS}<input type="submit" name="login" id="login" class="button1" value="{L_LOGIN}" tabindex="2" /></dd> 26 26 </dl> 27 {S_LOGIN_REDIRECT} 27 28 </fieldset> 28 29 -
trunk/forum/styles/prosilver/template/mcp_forum.html
r400 r702 36 36 <li class="row<!-- IF topicrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF --><!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ENDIF -->"> 37 37 <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 -->> 39 39 <!-- IF topicrow.S_SELECT_TOPIC --><a href="{topicrow.U_SELECT_TOPIC}" class="topictitle">[ {L_SELECT_MERGE} ]</a> <!-- ENDIF --> 40 40 <a href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a> -
trunk/forum/styles/prosilver/template/mcp_front.html
r400 r702 52 52 <!-- IF .unapproved --> 53 53 <fieldset class="display-actions"> 54 {S_HIDDEN_FIELDS} 54 55 <input class="button2" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /> 55 56 <input class="button1" type="submit" name="action[approve]" value="{L_APPROVE}" /> … … 101 102 <!-- ENDIF --> 102 103 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} » {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 103 145 <!-- IF S_SHOW_LOGS --> 104 146 <div class="panel"> -
trunk/forum/styles/prosilver/template/mcp_logs.html
r400 r702 9 9 10 10 <ul class="linklist"> 11 <li class="leftside"> 12 {L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> 13 </li> 11 14 <li class="rightside pagination"> 12 15 <!-- IF TOTAL -->{TOTAL} <!-- ENDIF --> … … 72 75 <input class="button2" type="submit" name="action[del_all]" value="{L_DELETE_ALL}" /> 73 76 <input class="button1" type="submit" value="{L_DELETE_MARKED}" name="action[del_marked]" /> 74 77 75 78 <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> 76 79 </fieldset> -
trunk/forum/styles/prosilver/template/mcp_notes_user.html
r400 r702 8 8 <div class="inner"><span class="corners-top"><span></span></span> 9 9 10 <h3> <!-- IF USER_COLOR --><span style="color: #{USER_COLOR}">{USERNAME}</span><!-- ELSE -->{USERNAME}<!-- ENDIF --></h3>10 <h3>{USERNAME_FULL}</h3> 11 11 12 12 <div> … … 43 43 44 44 <fieldset class="submit-buttons"> 45 {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" /> 45 {S_HIDDEN_FIELDS}<input type="reset" value="{L_RESET}" name="reset" class="button2" /> 46 46 <input type="submit" name="action[add_feedback]" value="{L_SUBMIT}" class="button1" /> 47 47 {S_FORM_TOKEN} … … 49 49 50 50 <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> 52 52 53 53 <ul class="linklist"> 54 <li class="leftside"> 55 {L_SEARCH_KEYWORDS}: <input type="text" class="inputbox autowidth" name="keywords" value="{S_KEYWORDS}" /> <input type="submit" class="button2" name="filter" value="{L_SEARCH}" /> 56 </li> 54 57 <li class="rightside pagination"> 55 58 <!-- IF TOTAL_REPORTS -->{TOTAL_REPORTS} <!-- ENDIF --> … … 91 94 <!-- IF NEXT_PAGE --><a href="{NEXT_PAGE}" class="right-box {S_CONTENT_FLOW_END}">{L_NEXT}</a><!-- ENDIF --> 92 95 <!-- 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> 95 98 <input type="submit" name="sort" value="{L_GO}" class="button2" /> 96 99 </fieldset> … … 106 109 107 110 <span class="corners-bottom"><span></span></span></div> 108 </div> 111 </div> 109 112 110 113 <!-- IF S_CLEAR_ALLOWED --> … … 115 118 116 119 <fieldset class="display-actions"> 117 <div><a href="#" onclick="marklist('mcp', 'marknote', true); return false;">{L_MARK_ALL}</a> • <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> • <a href="#" onclick="marklist('mcp', 'marknote', false); return false;">{L_UNMARK_ALL}</a></div> 118 121 </fieldset> 119 122 <!-- ENDIF --> -
trunk/forum/styles/prosilver/template/mcp_post.html
r400 r702 2 2 3 3 <!-- IF S_MCP_REPORT --> 4 <!-- IF S_PM --> 5 <h2>{L_PM_REPORT_DETAILS}</h2> 6 <!-- ELSE --> 4 7 <h2>{L_REPORT_DETAILS}</h2> 8 <!-- ENDIF --> 5 9 6 10 <div id="report" class="panel"> … … 9 13 <div class="postbody"> 10 14 <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} « {REPORT_DATE}</p> 12 16 <!-- IF not S_POST_REPORTED --> 13 17 <p class="rules">{L_REPORT_CLOSED}</p> … … 52 56 53 57 <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 --> <!-- 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 --> <!-- END bcc_recipient --><!-- ENDIF --> 64 </p> 65 <!-- ELSE --> 54 66 <p class="author">{MINI_POST_IMG} {L_POSTED} {L_POST_BY_AUTHOR} {POST_AUTHOR_FULL} » {POST_DATE}</p> 67 <!-- ENDIF --> 55 68 56 69 <!-- IF S_POST_UNAPPROVED --> … … 91 104 <!-- IF S_MCP_REPORT and S_CAN_VIEWIP --> 92 105 <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 --> 94 107 <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 -->) 95 108 <!-- ELSE --> … … 153 166 <div class="inner"><span class="corners-top"><span></span></span> 154 167 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> 156 169 157 170 <span class="corners-bottom"><span></span></span></div> … … 172 185 173 186 <!-- 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} « {usernotes.REPORT_AT}</strong></span> 175 188 <!-- IF S_CLEAR_ALLOWED --><div class="right-box"><input type="checkbox" name="marknote[]" value="{usernotes.ID}" /></div><!-- ENDIF --> 176 189 <div class="postbody">{usernotes.ACTION}</div> … … 212 225 213 226 <!-- 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 --> « {reports.REPORT_TIME}</strong></span> 215 228 <p><em>{reports.REASON_TITLE}: {reports.REASON_DESC}</em><!-- IF reports.REPORT_TEXT --><br />{reports.REPORT_TEXT}<!-- ENDIF --></p> 216 229 <!-- END reports --> -
trunk/forum/styles/prosilver/template/mcp_reports.html
r400 r702 3 3 <form id="mcp" method="post" action="{S_MCP_ACTION}"> 4 4 5 <!-- IF not S_PM --> 5 6 <fieldset class="forum-selection"> 6 7 <label for="fo">{L_FORUM}: <select name="f" id="fo">{S_FORUM_OPTIONS}</select></label> … … 8 9 {S_FORM_TOKEN} 9 10 </fieldset> 11 <!-- ENDIF --> 10 12 11 13 <h2>{L_TITLE}</h2> … … 27 29 <dl> 28 30 <dt>{L_VIEW_DETAILS}</dt> 29 <dd class="moderation"><span>{L_REPORTER} & {L_FORUM}</span></dd>31 <dd class="moderation"><span>{L_REPORTER}<!-- IF not S_PM --> & {L_FORUM}<!-- ENDIF --></span></dd> 30 32 <dd class="mark">{L_MARK}</dd> 31 33 </dl> … … 37 39 <li class="row<!-- IF postrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->"> 38 40 <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} » {postrow.PM_TIME}</span><br /> 45 <span>{L_MESSAGE_TO} {postrow.RECIPIENTS}</span> 46 </dt> 47 <dd class="moderation"> 48 <span>{postrow.REPORTER_FULL} « {postrow.REPORT_TIME}</span> 49 </dd> 50 <!-- ELSE --> 39 51 <dt> 40 52 <a href="{postrow.U_VIEW_DETAILS}" class="topictitle">{postrow.POST_SUBJECT}</a> {postrow.ATTACH_ICON_IMG}<br /> … … 42 54 </dt> 43 55 <dd class="moderation"> 44 <span>{postrow.REPORTER_FULL} {L_REPORTED_ON_DATE}{postrow.REPORT_TIME}<br />56 <span>{postrow.REPORTER_FULL} « {postrow.REPORT_TIME}<br /> 45 57 {L_FORUM}: <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a></span> 46 58 </dd> 59 <!-- ENDIF --> 47 60 <dd class="mark"><input type="checkbox" name="report_id_list[]" value="{postrow.REPORT_ID}" /></dd> 48 61 </dl> -
trunk/forum/styles/prosilver/template/mcp_topic.html
r400 r702 107 107 108 108 <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> 110 110 111 111 <h3><a href="{postrow.U_POST_DETAILS}">{postrow.POST_SUBJECT}</a></h3> … … 114 114 <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED --> 115 115 <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 --> 117 117 <!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF --> 118 118 </p> … … 161 161 </select> 162 162 <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> 164 164 {S_HIDDEN_FIELDS} 165 165 {S_FORM_TOKEN} -
trunk/forum/styles/prosilver/template/mcp_warn_user.html
r400 r702 8 8 <div class="inner"><span class="corners-top"><span></span></span> 9 9 10 <h3> <!-- IF USER_COLOR --><span style="color: #{USER_COLOR}">{USERNAME}</span><!-- ELSE -->{USERNAME}<!-- ENDIF --></h3>10 <h3>{USERNAME_FULL}</h3> 11 11 12 12 <div> -
trunk/forum/styles/prosilver/template/memberlist_body.html
r400 r702 132 132 <tr class="<!-- IF memberrow.S_ROW_COUNT is even -->bg1<!-- ELSE -->bg2<!-- ENDIF -->"> 133 133 <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 />[ <a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a> ]<!-- 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 --> <!-- 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 --> <!-- ENDIF --></td> 136 136 <td>{memberrow.JOINED}</td> 137 137 <!-- IF S_VIEWONLINE --><td>{memberrow.VISITED} </td><!-- ENDIF --> -
trunk/forum/styles/prosilver/template/memberlist_im.html
r400 r702 8 8 <div class="panel bg2"> 9 9 <div class="inner"><span class="corners-top"><span></span></span> 10 10 11 11 <p>{L_SEND_IM_EXPLAIN}</p> 12 12 … … 14 14 <dl class="fields2"> 15 15 <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> 17 17 </dl> 18 18 … … 82 82 <span class="corners-bottom"><span></span></span></div> 83 83 </div> 84 <a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>85 84 </form> 85 86 <a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a> 86 87 87 88 <script type="text/javascript"> -
trunk/forum/styles/prosilver/template/memberlist_view.html
r400 r702 35 35 <!-- BEGIN custom_fields --><dt>{custom_fields.PROFILE_FIELD_NAME}:</dt> <dd>{custom_fields.PROFILE_FIELD_VALUE}</dd><!-- END custom_fields --> 36 36 <!-- IF S_USER_LOGGED_IN and S_ZEBRA --> 37 <!-- IF U_ADD_FRIEND and U_ADD_FOE--> 38 <dt> </dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd> 39 <dt> </dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd> 37 <!-- IF U_REMOVE_FRIEND --> 38 <dt> </dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd> 39 <!-- ELSEIF U_REMOVE_FOE --> 40 <dt> </dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd> 40 41 <!-- ELSE --> 41 <!-- IF U_REMOVE_FRIEND --> 42 <dt> </dt> <dd><a href="{U_REMOVE_FRIEND}"><strong>{L_REMOVE_FRIEND}</strong></a></dd> 43 <!-- ELSE --> 44 <dt> </dt> <dd><a href="{U_REMOVE_FOE}"><strong>{L_REMOVE_FOE}</strong></a></dd> 42 <!-- IF U_ADD_FRIEND --> 43 <dt> </dt> <dd><a href="{U_ADD_FRIEND}"><strong>{L_ADD_FRIEND}</strong></a></dd> 44 <!-- ENDIF --> 45 <!-- IF U_ADD_FOE --> 46 <dt> </dt> <dd><a href="{U_ADD_FOE}"><strong>{L_ADD_FOE}</strong></a></dd> 45 47 <!-- ENDIF --> 46 48 <!-- ENDIF --> … … 60 62 <!-- IF U_EMAIL --><dt>{L_EMAIL_ADDRESS}:</dt> <dd><a href="{U_EMAIL}">{L_SEND_EMAIL_USER} {USERNAME}</a></dd><!-- ENDIF --> 61 63 <!-- 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 --> 64 65 <!-- 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 --> 65 66 <!-- 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 --> … … 67 68 <!-- 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 --> 68 69 <!-- 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 --> 70 71 <!-- NOTE: Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. --> 71 72 <dt>{postrow.PROFILE_FIELD1_NAME}:</dt> <dd>{postrow.PROFILE_FIELD1_VALUE}</dd> … … 79 80 <dt>{L_JOINED}:</dt> <dd>{JOINED}</dd> 80 81 <dt>{L_VISITED}:</dt> <dd>{VISITED}</dd> 81 <!-- IF U_NOTES or U_WARN-->82 <!-- IF S_WARNINGS --> 82 83 <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> 84 85 <!-- ENDIF --> 85 86 <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 --> 87 88 <!-- IF POSTS_PCT --><br />({POSTS_PCT} / {POSTS_DAY})<!-- ENDIF --> 88 89 <!-- 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 12 12 <meta name="keywords" content="" /> 13 13 <meta name="description" content="" /> 14 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 14 15 {META} 15 16 <title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- 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}&t={S_TOPIC_ID}" /><!-- ENDIF --> 26 <!-- ENDIF --> 16 27 17 28 <!-- … … 19 30 Based on style: prosilver (this is the default phpBB3 style) 20 31 Original author: Tom Beddard ( http://www.subBlue.com/ ) 21 Modified by: 22 32 Modified by: 33 23 34 NOTE: This page was generated by phpBB, the free open-source bulletin board package. 24 35 The phpBB Group is not responsible for the content of this page and forum. For more information … … 103 114 <h1>{SITENAME}</h1> 104 115 <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> 106 117 </div> 107 118 … … 110 121 <form action="{U_SEARCH}" method="post" id="search"> 111 122 <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}';" /> 113 124 <input class="button2" value="{L_SEARCH}" type="submit" /><br /> 114 125 <a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_SEARCH_HIDDEN_FIELDS} … … 127 138 <li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li> 128 139 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> 130 141 131 142 <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF --> … … 138 149 <ul class="linklist leftside"> 139 150 <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 --> • 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 --> • 142 154 <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a> 155 <!-- ENDIF --> 143 156 <!-- IF U_RESTORE_PERMISSIONS --> • 144 157 <a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a> … … 152 165 <!-- IF not S_IS_BOT --> 153 166 <!-- 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> 156 169 <!-- ENDIF --> 157 170 </ul> … … 164 177 <a name="start_here"></a> 165 178 <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"> 169 181 <div class="inner"><span class="corners-top"><span></span></span> 170 182 <strong>{L_INFORMATION}:</strong> {L_BOARD_DISABLED} -
trunk/forum/styles/prosilver/template/posting_buttons.html
r400 r702 94 94 <option value="85">{L_FONT_SMALL}</option> 95 95 <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 --> 98 102 </select> 99 103 <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 1 7 <fieldset class="fields1"> 2 8 <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF --> … … 62 68 <div class="column2"> 63 69 <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> 65 71 </dl> 66 72 </div> … … 89 95 90 96 <!-- IF not S_PRIVMSGS and S_DISPLAY_USERNAME --> 91 <dl >97 <dl style="clear: left;"> 92 98 <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> 94 100 </dl> 95 101 <!-- ENDIF --> … … 100 106 <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> 101 107 </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 --> 109 112 <!-- ENDIF --> 110 113 … … 129 132 {FLASH_STATUS}<br /> 130 133 {URL_STATUS}<br /> 131 {SMILIES_STATUS}132 <!-- ENDIF -->134 <!-- ENDIF --> 135 {SMILIES_STATUS} 133 136 <!-- ENDIF --> 134 137 <!-- IF S_EDIT_DRAFT || S_DISPLAY_REVIEW --> … … 140 143 141 144 <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> 143 146 </div> 144 147 </fieldset> … … 161 164 <dl> 162 165 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> 165 168 <dd><a href="{attach_row.U_VIEW_ATTACHMENT}" class="{S_CONTENT_FLOW_END}">{attach_row.FILENAME}</a></dd> 166 169 <dd style="margin-top: 5px;"> … … 185 188 {S_HIDDEN_ADDRESS_FIELD} 186 189 {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;" /> <!-- ENDIF -->188 <!-- IF S_SAVE_ALLOWED --><input type="submit" accesskey="k" tabindex=" 8" name="save" value="{L_SAVE}" class="button2" /> <!-- ENDIF -->190 <!-- IF S_HAS_DRAFTS --><input type="submit" accesskey="d" tabindex="8" name="load" value="{L_LOAD}" class="button2" onclick="load_draft = true;" /> <!-- ENDIF --> 191 <!-- IF S_SAVE_ALLOWED --><input type="submit" accesskey="k" tabindex="7" name="save" value="{L_SAVE}" class="button2" /> <!-- ENDIF --> 189 192 <input type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" class="button1"<!-- IF not S_PRIVMSGS --> onclick="document.getElementById('postform').action += '#preview';"<!-- ENDIF --> /> 190 <input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1 " /> 193 <input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1 default-submit-action" /> 191 194 192 195 </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"> 2 2 <div class="inner"><span class="corners-top"><span></span></span> 3 3 … … 20 20 </div> 21 21 22 <div class="post <!-- IF S_PRIVMSGS --> pm<!-- ELSE --> bg2<!-- ENDIF -->">22 <div class="post bg2"> 23 23 <div class="inner"><span class="corners-top"><span></span></span> 24 24 … … 27 27 <div class="postbody"> 28 28 <h3>{L_PREVIEW}: {PREVIEW_SUBJECT}</h3> 29 29 30 30 <div class="content">{PREVIEW_MESSAGE}</div> 31 31 32 32 <!-- IF .attachment --> 33 33 <dl class="attachbox"> … … 38 38 </dl> 39 39 <!-- ENDIF --> 40 40 41 41 <!-- IF PREVIEW_SIGNATURE --><div class="signature">{PREVIEW_SIGNATURE}</div><!-- ENDIF --> 42 42 </div> -
trunk/forum/styles/prosilver/template/posting_review.html
r400 r702 4 4 5 5 <!-- 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"> 7 8 <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 --> 8 14 9 <div class="postbody" >15 <div class="postbody" id="ppr{post_review_row.POST_ID}"> 10 16 <h3><a href="#ppr{post_review_row.POST_ID}">{post_review_row.POST_SUBJECT}</a></h3> 11 17 <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> » {post_review_row.POST_DATE}</p> -
trunk/forum/styles/prosilver/template/posting_smilies.html
r400 r702 13 13 <div class="inner"><span class="corners-top"><span></span></span> 14 14 <!-- BEGIN smiley --> 15 <a href="#" onclick="in sert_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> 16 16 <!-- END smiley --> 17 17 18 18 <span class="corners-bottom"><span></span></span></div> 19 19 </div> 20 <div>{PAGINATION}</div> 20 21 <a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a> 21 22 -
trunk/forum/styles/prosilver/template/posting_topic_review.html
r400 r702 6 6 7 7 <div id="topicreview"> 8 <script type="text/javascript"> 9 // <![CDATA[ 10 bbcodeEnabled = {S_BBCODE_ALLOWED}; 11 // ]]> 12 </script> 8 13 <!-- 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 --> 9 20 <div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->"> 10 21 <div class="inner"><span class="corners-top"><span></span></span> 22 <!-- ENDIF --> 11 23 12 24 <div class="postbody" id="pr{topic_review_row.POST_ID}"> -
trunk/forum/styles/prosilver/template/search_results.html
r400 r702 19 19 <!-- IF SEARCH_IN_RESULTS --> 20 20 <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" />22 21 <input class="button2" type="submit" name="submit" value="{L_SEARCH}" /> 23 22 <!-- ENDIF --> … … 140 139 <!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY --> 141 140 <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> 143 142 <!-- ENDIF --> 144 143 </fieldset> -
trunk/forum/styles/prosilver/template/simple_header.html
r400 r702 18 18 // <![CDATA[ 19 19 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'; 20 25 var onload_functions = new Array(); 21 26 var onunload_functions = new Array(); … … 44 49 </script> 45 50 <script type="text/javascript" src="{T_TEMPLATE_PATH}/styleswitcher.js"></script> 51 <script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script> 46 52 47 53 <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 1 1 2 function fontsizeup( )2 function fontsizeup(event) 3 3 { 4 // Skip tabs; 9 being the ASCII code for a tab 5 if (event && getKeyCode(event) == 9) 6 { 7 return true; 8 } 9 4 10 var active = getActiveStyleSheet(); 5 11 … … 30 36 break; 31 37 } 38 39 return false; 32 40 } 33 41 34 function fontsizedown( )42 function fontsizedown(event) 35 43 { 36 active = getActiveStyleSheet(); 44 // Skip tabs 45 if (event && getKeyCode(event) == 9) 46 { 47 return true; 48 } 49 50 var active = getActiveStyleSheet(); 37 51 38 52 switch (active) … … 61 75 break; 62 76 } 77 78 return false; 79 } 80 81 function 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; 63 95 } 64 96 -
trunk/forum/styles/prosilver/template/template.cfg
r400 r702 3 3 # 4 4 # @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 7 7 # 8 8 # … … 12 12 # 13 13 # 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. 15 15 # Single and double quotes do not need to be escaped. 16 16 # 17 # 17 # 18 18 19 19 # General Information about this template 20 20 name = prosilver 21 21 copyright = © phpBB Group, 2007 22 version = 3.0. 422 version = 3.0.7 23 23 24 24 # Defining a different template bitfield -
trunk/forum/styles/prosilver/template/ucp_agreement.html
r400 r702 1 1 <!-- INCLUDE overall_header.html --> 2 2 3 <!-- IF S_SHOW_COPPA or S_REGISTRATION --> 3 4 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 --> 5 30 6 31 <form method="post" action="{S_UCP_ACTION}" id="agreement"> -
trunk/forum/styles/prosilver/template/ucp_avatar_options.html
r400 r702 14 14 </dl> 15 15 16 <!-- IF S_UPLOAD_AVATAR_FILE or S_CAN_UPLOAD-->16 <!-- IF S_UPLOAD_AVATAR_FILE --> 17 17 <dl> 18 18 <dt><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></dt> … … 21 21 <!-- ENDIF --> 22 22 23 <!-- IF S_UPLOAD_AVATAR_URL or S_EDIT-->23 <!-- IF S_UPLOAD_AVATAR_URL --> 24 24 <dl> 25 25 <dt><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></dt> … … 28 28 <!-- ENDIF --> 29 29 30 <!-- IF S_LINK_AVATAR or S_EDIT-->30 <!-- IF S_LINK_AVATAR --> 31 31 <dl> 32 32 <dt><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></dt> … … 36 36 <dt><label for="width">{L_LINK_REMOTE_SIZE}:</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt> 37 37 <dd> 38 <label for="width"><input type="text" name="width" id="width" size="3" value="{AVATAR_WIDTH}" class="inputbox autowidth" /> px</label> × 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> × 39 <label for="height"><input type="text" name="height" id="height" size="3" value="{AVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label> 40 40 </dd> 41 41 </dl> 42 42 <!-- ENDIF --> 43 43 </fieldset> 44 44 45 45 <!-- IF S_IN_AVATAR_GALLERY --> 46 46 <span class="corners-bottom"><span></span></span></div> … … 51 51 52 52 <h3>{L_AVATAR_GALLERY}</h3> 53 53 54 54 <fieldset> 55 55 <label for="category">{L_AVATAR_CATEGORY}: <select name="category" id="category">{S_CAT_OPTIONS}</select></label> … … 64 64 <!-- END avatar_column --><!-- END avatar_row --> 65 65 </div> 66 66 67 67 <!-- ENDIF --> 68 68 -
trunk/forum/styles/prosilver/template/ucp_groups_manage.html
r400 r702 171 171 <h3>{L_ADD_USERS}</h3> 172 172 173 <p>{L_ADD_USERS_ EXPLAIN}</p>173 <p>{L_ADD_USERS_UCP_EXPLAIN}</p> 174 174 175 175 <fieldset> -
trunk/forum/styles/prosilver/template/ucp_main_bookmarks.html
r400 r702 33 33 <!-- ELSE --> 34 34 <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}"> 36 36 <!-- 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> 37 37 <!-- 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 34 34 <dt>{L_JOINED}:</dt> <dd>{JOINED}</dd> 35 35 <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> 37 37 <!-- 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 --> 38 38 <!-- 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 53 53 <li class="row<!-- IF topicrow.S_TOPIC_REPORTED --> reported<!-- ELSEIF topicrow.S_ROW_COUNT is odd --> bg1<!-- ELSE --> bg2<!-- ENDIF -->"> 54 54 <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}"> 56 56 <!-- 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> 57 57 <!-- 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 18 18 19 19 <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 /> 21 21 {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> 23 23 <div id="message_{history_row.MSG_ID}" style="display: none;">{history_row.DECODED_MESSAGE}</div> 24 24 </div> -
trunk/forum/styles/prosilver/template/ucp_pm_message_header.html
r400 r702 1 1 <h2>{L_TITLE}<!-- IF CUR_FOLDER_NAME -->: {CUR_FOLDER_NAME}<!-- ENDIF --></h2> 2 2 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 -->"> 6 4 <div class="inner"><span class="corners-top"><span></span></span> 7 5 8 6 <!-- IF FOLDER_STATUS and FOLDER_MAX_MESSAGES neq 0 --><p>{FOLDER_STATUS}</p><!-- ENDIF --> 9 10 7 8 <!-- IF U_POST_REPLY_PM or U_POST_NEW_TOPIC or U_FORWARD_PM --> 11 9 <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> 13 11 <!-- 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 --> 14 12 <!-- 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 --> 15 13 </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}">» {L_REPLY_TO_ALL}</a></div> 16 17 <!-- ENDIF --> 17 18 19 <!-- ENDIF --> 20 18 21 <!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE --> 19 <ul class="linklist ">22 <ul class="linklist pm-return-to"> 20 23 <li class="rightside pagination"> 21 24 <!-- IF S_VIEW_MESSAGE --><a class="{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO} {CUR_FOLDER_NAME}</a><!-- ENDIF --> … … 27 30 </ul> 28 31 <!-- 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 3 3 <!-- IF not PROMPT --> 4 4 <!-- INCLUDE ucp_pm_message_header.html --> 5 <div class="panel pm-panel-message"><div> 5 6 <!-- ENDIF --> 6 7 7 8 8 <!-- IF PROMPT --> … … 84 84 </ul> 85 85 <!-- 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> 87 93 <!-- ENDIF --> 88 94 -
trunk/forum/styles/prosilver/template/ucp_pm_viewmessage.html
r400 r702 1 <!-- INCLUDE ucp_header.html -->1 <!-- INCLUDE ucp_header.html --> 2 2 3 3 <!-- INCLUDE ucp_pm_message_header.html --> 4 4 5 <span class="corners-bottom"><span></span></span></div>6 </div>7 5 8 6 <!-- 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"> 10 8 <!-- IF U_VIEW_PREVIOUS_HISTORY --><a href="{U_VIEW_PREVIOUS_HISTORY}" class="left-box {S_CONTENT_FLOW_BEGIN}">{L_VIEW_PREVIOUS_HISTORY}</a><!-- ENDIF --> 11 9 <!-- IF U_VIEW_NEXT_HISTORY --><a href="{U_VIEW_NEXT_HISTORY}" class="right-box {S_CONTENT_FLOW_END}">{L_VIEW_NEXT_HISTORY}</a><!-- ENDIF --> … … 14 12 15 13 16 <div id="post-{MESSAGE_ID}" class="p ostpm<!-- 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> 18 16 19 17 <div class="postbody"> 20 18 21 <!-- IF U_DELETE or U_EDIT or U_QUOTE -->19 <!-- IF U_DELETE or U_EDIT or U_QUOTE or U_REPORT --> 22 20 <ul class="profile-icons"> 23 21 <!-- 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 --> 24 22 <!-- 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 --> 25 24 <!-- 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 --> 26 25 </ul> … … 68 67 <!-- IF RANK_IMG --><dd>{RANK_IMG}</dd><!-- ENDIF --> 69 68 <dd> </dd> 70 < !-- IF AUTHOR_POSTS --><dd><strong>{L_POSTS}:</strong> {AUTHOR_POSTS}</dd><!-- ENDIF -->69 <dd><strong>{L_POSTS}:</strong> {AUTHOR_POSTS}</dd> 71 70 <!-- IF AUTHOR_JOINED --><dd><strong>{L_JOINED}:</strong> {AUTHOR_JOINED}</dd><!-- ENDIF --> 72 71 <!-- IF AUTHOR_FROM --><dd><strong>{L_LOCATION}:</strong> {AUTHOR_FROM}</dd><!-- ENDIF --> … … 76 75 <ul class="profile-icons"> 77 76 <!-- 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 --> 79 78 <!-- IF U_WWW --><li class="web-icon"><a href="{U_WWW}" title="{L_VISIT_WEBSITE}: {U_WWW}"><span>{L_WEBSITE}</span></a></li><!-- ENDIF --> 80 79 <!-- 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 84 84 <td> 85 85 <!-- 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> 86 <span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->>{to_recipient.NAME}</span> 87 87 <!-- END to_recipient --> 88 88 </td> -
trunk/forum/styles/prosilver/template/ucp_profile_signature.html
r400 r702 9 9 <div class="inner"><span class="corners-top"><span></span></span> 10 10 <h3>{L_SIGNATURE_PREVIEW}</h3> 11 <div class="postbody pm">11 <div class="postbody"> 12 12 <div class="signature" style="border-top:none; margin-top: 0; ">{SIGNATURE_PREVIEW}</div> 13 13 </div> … … 34 34 <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> 35 35 <!-- ENDIF --> 36 36 37 37 </fieldset> 38 38 … … 42 42 <fieldset class="submit-buttons"> 43 43 {S_HIDDEN_FIELDS} 44 <input type="reset" name="reset" value="{L_RESET}" class="button2" /> 45 <input type="submit" name="preview" value="{L_PREVIEW}" class="button2" /> 44 <input type="reset" name="reset" value="{L_RESET}" class="button2" /> 45 <input type="submit" name="preview" value="{L_PREVIEW}" class="button2" /> 46 46 <input type="submit" name="submit" value="{L_SUBMIT}" class="button1" /> 47 47 {S_FORM_TOKEN} -
trunk/forum/styles/prosilver/template/ucp_register.html
r400 r702 11 11 document.forms['register'].submit.click(); 12 12 } 13 14 <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_REFRESH --> 15 onload_functions.push('apply_onkeypress_event()'); 16 <!-- ENDIF --> 13 17 14 18 // ]]> … … 27 31 <dl><dd><strong>{L_REG_COND}</strong></dd></dl> 28 32 <!-- ENDIF --> 29 <!-- IF .profile_fields -->30 <dl><dd><strong>{L_ITEMS_REQUIRED}</strong></dd></dl>31 <!-- ENDIF -->32 33 33 <dl> 34 34 <dt><label for="username">{L_USERNAME}:</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt> … … 56 56 <dl> 57 57 <dt><label for="lang">{L_LANGUAGE}:</label></dt> 58 <dd><select name="lang" id="lang" onchange="change_language(this.value); return false;" t itle="{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> 59 59 </dl> 60 60 <dl> 61 61 <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> 63 63 </dl> 64 65 <!-- IF .profile_fields --> 66 <dl><dd><strong>{L_ITEMS_REQUIRED}</strong></dd></dl> 64 67 65 68 <!-- BEGIN profile_fields --> … … 71 74 </dl> 72 75 <!-- END profile_fields --> 76 <!-- ENDIF --> 77 73 78 </fieldset> 74 75 <!-- IF S_CONFIRM_CODE -->76 79 <span class="corners-bottom"><span></span></span></div> 77 80 </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} --> 93 84 <!-- ENDIF --> 94 85 95 86 <!-- IF S_COPPA --> 96 <span class="corners-bottom"><span></span></span></div> 97 </div> 87 98 88 99 89 <div class="panel"> … … 103 93 104 94 <p>{L_COPPA_EXPLAIN}</p> 105 <!-- ENDIF -->106 107 95 <span class="corners-bottom"><span></span></span></div> 108 96 </div> 97 <!-- ENDIF --> 109 98 110 99 <div class="panel"> … … 114 103 {S_HIDDEN_FIELDS} 115 104 <input type="reset" value="{L_RESET}" name="reset" class="button2" /> 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" /> 117 106 {S_FORM_TOKEN} 118 107 </fieldset> -
trunk/forum/styles/prosilver/template/viewforum_body.html
r400 r702 4 4 5 5 <!-- IF FORUM_DESC or MODERATORS or U_MCP --> 6 < p>6 <div> 7 7 <!-- 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> 11 11 <!-- ENDIF --> 12 12 … … 76 76 </div> 77 77 78 <!-- IF not S_USER_LOGGED_IN -->78 <!-- IF not S_USER_LOGGED_IN and not S_IS_BOT --> 79 79 80 80 <form action="{S_LOGIN_ACTION}" method="post"> … … 101 101 <dd><input type="submit" name="login" tabindex="5" value="{L_LOGIN}" class="button1" /></dd> 102 102 </dl> 103 {S_LOGIN_REDIRECT} 103 104 </fieldset> 104 105 </div> -
trunk/forum/styles/prosilver/template/viewtopic_body.html
r400 r702 3 3 <h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2> 4 4 <!-- 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 --> 6 6 7 7 <!-- IF MODERATORS or U_MCP --> … … 115 115 <!-- BEGIN postrow --> 116 116 <!-- 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 -->"> 118 118 <div class="inner"><span class="corners-top"><span></span></span> 119 119 … … 124 124 125 125 <!-- 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 --> 127 127 <ul class="profile-icons"> 128 128 <!-- 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 --> … … 141 141 <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_REPORTED --> 142 142 <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 --> 144 144 <!-- IF postrow.S_POST_REPORTED -->{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}"><strong>{L_POST_REPORTED}</strong></a><!-- ENDIF --> 145 145 </p> … … 164 164 <!-- ENDIF --> 165 165 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 --> 167 167 <!-- IF postrow.SIGNATURE --><div id="sig{postrow.POST_ID}" class="signature">{postrow.SIGNATURE}</div><!-- ENDIF --> 168 168 <!-- ENDIF --> … … 201 201 <ul class="profile-icons"> 202 202 <!-- 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 --> 204 204 <!-- 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 --> 205 205 <!-- 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 --> … … 223 223 <hr class="divider" /> 224 224 <!-- END postrow --> 225 225 <!-- IF S_QUICK_REPLY --> 226 <!-- INCLUDE quickreply_editor.html --> 227 <!-- ENDIF --> 226 228 <!-- IF S_NUM_POSTS > 1 or PREVIOUS_PAGE --> 227 229 <form id="viewtopic" method="post" action="{S_TOPIC_ACTION}"> -
trunk/forum/styles/prosilver/template/viewtopic_print.html
r400 r702 12 12 <meta name="keywords" content="" /> 13 13 <meta name="description" content="" /> 14 <meta name="robots" CONTENT="noindex" />14 <meta name="robots" content="noindex" /> 15 15 {META} 16 16 <title>{SITENAME} • {PAGE_TITLE}</title> … … 26 26 <h1>{SITENAME}</h1> 27 27 <p>{SITE_DESCRIPTION}<br /><a href="{U_FORUM}">{U_FORUM}</a></p> 28 28 29 29 <h2>{TOPIC_TITLE}</h2> 30 30 <p><a href="{U_TOPIC}">{U_TOPIC}</a></p> … … 37 37 <h3>{postrow.POST_SUBJECT}</h3> 38 38 <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> 40 40 <div class="content">{postrow.MESSAGE}</div> 41 41 </div> -
trunk/forum/styles/prosilver/theme/bidi.css
r400 r702 226 226 } 227 227 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 228 234 .rtl a.top { 229 235 float: left; … … 235 241 } 236 242 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 237 257 /** 238 258 * content.css 239 259 */ 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 240 270 .rtl ul.topiclist dt { 241 271 float: right; … … 348 378 .rtl blockquote { 349 379 margin: 0.5em 25px 0 1px; 380 background-position: 99% 8px; 350 381 } 351 382 352 383 .rtl blockquote blockquote { 353 384 /* Nested quotes */ 354 margin: 0.5em 15px 0 1px; 385 margin: 0.5em 15px 0 1px; 355 386 } 356 387 … … 720 751 */ 721 752 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 460 460 background-image: url("{T_THEME_PATH}/images/quote.gif"); 461 461 border-color:#DBDBCE; 462 } 463 464 .rtl blockquote { 465 background-image: url("{T_THEME_PATH}/images/quote_rtl.gif"); 462 466 } 463 467 … … 787 791 } 788 792 793 .rtl #navigation a { 794 background-image: url("{T_THEME_PATH}/images/bg_menu_rtl.gif"); 795 background-position: 0 100%; 796 } 797 789 798 #navigation a:hover { 799 background-image: none; 790 800 background-color: #aabac6; 791 801 color: #BC2A4D; … … 862 872 /* PM Message history */ 863 873 .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; 865 881 } 866 882 … … 883 899 } 884 900 885 pmlist li.pm_foe_colour, .pm_foe_colour {901 .pmlist li.pm_foe_colour, .pm_foe_colour { 886 902 border-color: #000000; 887 903 } … … 907 923 border-color: #666666; 908 924 background-color: #FAFAFA; 925 color: #000; 909 926 } 910 927 -
trunk/forum/styles/prosilver/theme/common.css
r400 r702 11 11 font-size: 100%; 12 12 /* 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%; 15 14 } 16 15 … … 398 397 table.table1 .mark { text-align: center; width: 7%; } 399 398 table.table1 .info { text-align: left; width: 30%; } 400 table.table1 .info div { width: 100%; white-space: no wrap; overflow: hidden; }399 table.table1 .info div { width: 100%; white-space: normal; overflow: hidden; } 401 400 table.table1 .autocol { line-height: 2em; white-space: nowrap; } 402 401 table.table1 thead .autocol { padding-left: 1em; } … … 600 599 } 601 600 602 div.rules ul {601 div.rules ul, div.rules ol { 603 602 margin-left: 20px; 604 603 } … … 612 611 p.rules img { 613 612 vertical-align: middle; 613 padding-top: 5px; 614 614 } 615 615 -
trunk/forum/styles/prosilver/theme/content.css
r400 r702 45 45 ul.topiclist dfn { 46 46 /* Labels for post/view counts */ 47 display: none; 47 position: absolute; 48 left: -999px; 49 width: 990px; 48 50 } 49 51 … … 131 133 } 132 134 135 /* List in forum description */ 136 dl.icon dt ol, 137 dl.icon dt ul { 138 list-style-position: inside; 139 margin-left: 1em; 140 } 141 142 dl.icon dt li { 143 display: list-item; 144 list-style-type: inherit; 145 } 146 133 147 dd.lastpost { 134 148 width: 25%; … … 281 295 } 282 296 297 .post-ignore .postbody { 298 display: none; 299 } 300 283 301 /* Content container styles 284 302 ----------------------------------------*/ … … 290 308 font-size: 1em; 291 309 color: #333333; 310 padding-bottom: 1px; 292 311 } 293 312 -
trunk/forum/styles/prosilver/theme/cp.css
r400 r702 347 347 #pm-menu { 348 348 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; 349 377 } 350 378 -
trunk/forum/styles/prosilver/theme/forms.css
r400 r702 317 317 font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; 318 318 color: #000; 319 background: #FAFAFA none repeat-x top ;319 background: #FAFAFA none repeat-x top left; 320 320 } 321 321 -
trunk/forum/styles/prosilver/theme/links.css
r400 r702 1 1 /* proSilver Link Styles 2 2 ---------------------------------------- */ 3 4 /* Links adjustment to correctly display an order of rtl/ltr mixed content */ 5 a { 6 direction: ltr; 7 unicode-bidi: embed; 8 } 3 9 4 10 a:link { color: #898989; text-decoration: none; } … … 199 205 background-position: 100% 60%; 200 206 } 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 */ 216 a.feed-icon-forum { 217 float: right; 218 margin: 3px; 219 } -
trunk/forum/styles/prosilver/theme/print.css
r400 r702 26 26 27 27 img, .noprint, #sub-header, #sub-footer, .navbar, .box1, .divider, .signature { display: none; } 28 /* Display smilies (Bug #47265) */ 29 .content img { 30 display: inline; 31 } 28 32 29 33 /* Container for the main body */ … … 109 113 110 114 /* Quote */ 111 .postquote {115 .postquote, blockquote { 112 116 font-size: 85%; 113 117 margin: 1em 18% 1em 4%; … … 121 125 .postquote span { display: block; } 122 126 .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 */ 134 ol, ul { 135 margin-left: 15pt 136 } 124 137 125 138 /* Misc page elements */ -
trunk/forum/styles/prosilver/theme/theme.cfg
r400 r702 3 3 # 4 4 # @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 7 7 # 8 8 # … … 12 12 # 13 13 # 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. 15 15 # Single and double quotes do not need to be escaped. 16 16 # 17 17 # Available and used values: 18 18 # parse_css_file 19 # 19 # 20 20 21 21 # General Information about this theme 22 22 name = prosilver 23 23 copyright = © phpBB Group, 2007 24 version = 3.0. 424 version = 3.0.7 25 25 26 26 # Some configuration options 27 27 28 28 # 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 30 30 # path template variables ({T_IMAGESET_PATH} for example) within 31 31 # your css file. -
trunk/forum/styles/prosilver/theme/tweaks.css
r400 r702 68 68 } 69 69 70 * html li.row dl.icon dt { 71 height: 35px; 72 overflow: visible; 73 } 74 70 75 * html #search-box { 71 76 width: 25%; … … 83 88 } 84 89 90 * html .forumbg table.table1 { 91 margin: 0 -2px 0px -1px; 92 } -
trunk/forum/styles/subsilver2/imageset/imageset.cfg
r400 r702 3 3 # 4 4 # @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 7 7 # 8 8 # … … 12 12 # 13 13 # 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. 15 15 # Single and double quotes do not need to be escaped. 16 16 # … … 20 20 name = subsilver2 21 21 copyright = © phpBB Group, 2003 22 version = 3.0. 422 version = 3.0.7 23 23 24 # Images 24 # Images 25 25 img_site_logo = site_logo.gif*94*170 26 26 img_upload_bar = upload_bar.gif*16*280 27 27 img_poll_left = poll_left.gif*12*4 28 img_poll_center = poll_center.gif*12* 28 img_poll_center = poll_center.gif*12*1 29 29 img_poll_right = poll_right.gif*12*4 30 30 img_icon_friend = … … 82 82 img_global_unread_locked_mine = announce_unread_locked_mine.gif*18*19 83 83 84 img_subforum_read = 85 img_subforum_unread = 84 img_subforum_read = 85 img_subforum_unread = 86 86 87 87 img_pm_read = topic_read.gif*18*19 -
trunk/forum/styles/subsilver2/style.cfg
r400 r702 3 3 # 4 4 # @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 7 7 # 8 8 # … … 12 12 # 13 13 # 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. 15 15 # Single and double quotes do not need to be escaped. 16 16 # 17 # 17 # 18 18 19 19 # General Information about this style 20 20 name = subsilver2 21 21 copyright = © 2005 phpBB Group 22 version = 3.0. 422 version = 3.0.7 -
trunk/forum/styles/subsilver2/template/editor.js
r400 r702 17 17 18 18 var baseHeight; 19 window.onload = initInsertions;20 19 21 20 /** … … 263 262 function mozWrap(txtarea, open, close) 264 263 { 265 var selLength = txtarea.textLength;264 var selLength = (typeof(txtarea.textLength) == 'undefined') ? txtarea.value.length : txtarea.textLength; 266 265 var selStart = txtarea.selectionStart; 267 266 var selEnd = txtarea.selectionEnd; … … 278 277 279 278 txtarea.value = s1 + open + s2 + close + s3; 280 txtarea.selectionStart = sel End + open.length + close.length;281 txtarea.selectionEnd = txtarea.selectionStart;279 txtarea.selectionStart = selStart + open.length; 280 txtarea.selectionEnd = selEnd + open.length; 282 281 txtarea.focus(); 283 282 txtarea.scrollTop = scrollTop; -
trunk/forum/styles/subsilver2/template/forumlist_body.html
r400 r702 20 20 <td class="row1"> 21 21 <!-- 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> 23 23 <!-- ENDIF --> 24 24 <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a> 25 25 <p class="forumdesc">{forumrow.FORUM_DESC}</p> 26 <!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->27 26 </td> 28 27 <!-- IF forumrow.CLICKS --> … … 43 42 <td class="row1" width="100%"> 44 43 <!-- 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> 46 45 <!-- ENDIF --> 47 46 <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a> … … 53 52 <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}</p> 54 53 <!-- ENDIF --> 55 <!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF -->56 54 </td> 57 55 <td class="row2" align="center"><p class="topicdetails">{forumrow.TOPICS}</p></td> … … 59 57 <td class="row2" align="center" nowrap="nowrap"> 60 58 <!-- 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> <!-- ENDIF -->{forumrow.LAST_POST_TIME}</p> 62 60 <p class="topicdetails">{forumrow.LAST_POSTER_FULL} 63 61 <!-- 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 68 68 </table> 69 69 70 <!-- IF not S_USER_LOGGED_IN -->70 <!-- IF not S_USER_LOGGED_IN and not S_IS_BOT --> 71 71 <br clear="all" /> 72 72 73 73 <form method="post" action="{S_LOGIN_ACTION}"> 74 74 75 75 <table class="tablebg" width="100%" cellspacing="1"> 76 76 <tr> … … 81 81 </tr> 82 82 </table> 83 {S_LOGIN_REDIRECT} 83 84 {S_FORM_TOKEN} 84 85 </form> -
trunk/forum/styles/subsilver2/template/login_body.html
r400 r702 66 66 </tr> 67 67 68 <!-- IF S_CONFIRM_CODE -->68 <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE --> 69 69 </table> 70 70 <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} --> 87 73 <!-- ENDIF --> 74 88 75 <tr> 89 76 <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> … … 91 78 </table> 92 79 {S_FORM_TOKEN} 93 80 {S_LOGIN_REDIRECT} 94 81 </form> 95 82 -
trunk/forum/styles/subsilver2/template/login_forum.html
r400 r702 33 33 </table> 34 34 {S_FORM_TOKEN} 35 {S_LOGIN_REDIRECT} 35 36 </form> 36 37 -
trunk/forum/styles/subsilver2/template/mcp_ban.html
r400 r702 85 85 <tr> 86 86 <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> 88 88 </tr> 89 89 <tr> 90 90 <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"> </textarea></td>91 <td class="row2"><textarea style="border: 0; width: 100%" name="unbanreason" readonly="readonly" rows="5" cols="80"> </textarea></td> 92 92 </tr> 93 93 <tr> 94 94 <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"> </textarea></td>95 <td class="row2"><textarea style="border: 0; width: 100%" name="unbangivereason" readonly="readonly" rows="5" cols="80"> </textarea></td> 96 96 </tr> 97 97 <tr> -
trunk/forum/styles/subsilver2/template/mcp_front.html
r400 r702 36 36 <!-- ENDIF --> 37 37 <tr> 38 <td class="cat" colspan="6" align="center"> <input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" /> <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}" /> <input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /></td> 39 39 </tr> 40 40 </table> … … 86 86 <!-- ENDIF --> 87 87 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> {L_PM_SUBJECT} </th> 95 <th> {L_PM_FROM} </th> 96 <th> {L_TO} & {L_BCC} </th> 97 <th> {L_SENT_AT} </th> 98 <th> {L_REPORTER} </th> 99 <th> {L_REPORT_TIME} </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 88 125 <!-- IF S_SHOW_LOGS --> 89 126 <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 23 23 <!-- END log --> 24 24 <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}" /> <input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td> 26 </tr> 27 <tr align="center"> 25 28 <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> 26 29 </tr> -
trunk/forum/styles/subsilver2/template/mcp_notes_user.html
r400 r702 11 11 <table cellspacing="1" cellpadding="2" border="0"> 12 12 <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> 14 14 </tr> 15 15 <!-- IF RANK_TITLE --> … … 55 55 <!-- IF S_USER_NOTES --> 56 56 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}" /> <input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td> 59 </tr> 57 60 <tr align="center"> 58 61 <td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}:</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td> -
trunk/forum/styles/subsilver2/template/mcp_post.html
r400 r702 6 6 <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> 7 7 <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> 9 9 </tr> 10 10 <tr> … … 44 44 <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg"> 45 45 <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> 53 53 <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> 54 54 </tr> 55 55 <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> 57 57 <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"> [ <!-- 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> 58 58 </tr> 59 59 <!-- IF S_CAN_VIEWIP --> 60 60 <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> 62 62 <td class="row2"><span class="gen"> 63 63 <!-- IF U_WHOIS --> … … 70 70 <!-- ENDIF --> 71 71 <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> 73 73 <td class="row2"><span class="postdetails">{POST_DATE}</span></td> 74 74 </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} <!-- 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} <!-- ENDIF --> 92 <!-- END bcc_recipient --> 93 </td> 94 </tr> 95 <!-- ENDIF --> 75 96 <tr> 76 97 <th colspan="2" align="center">{L_PREVIEW}</th> -
trunk/forum/styles/subsilver2/template/mcp_reports.html
r400 r702 8 8 </tr> 9 9 <tr> 10 <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}:</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <b>{L_ONLY_TOPIC}</b> <!-- 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} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- IF not S_PM --> <span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" /> <b>{L_ONLY_TOPIC}</b> <!-- ENDIF --><!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td> 11 11 </tr> 12 12 <tr> 13 <!-- IF S_PM --> 14 <th> {L_PM} </th> 15 <th> {L_TO} & {L_BCC} </th> 16 <!-- ELSE --> 13 17 <th> {L_POST} </th> 14 18 <th> {L_AUTHOR} </th> 19 <!-- ENDIF --> 15 20 <th> {L_REPORTER} </th> 16 21 <th> {L_REPORT_TIME} </th> … … 20 25 21 26 <!-- 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 --> 22 33 <td style="padding: 4px;"><p class="topictitle"><a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p> 23 34 <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> 24 35 <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br /> 25 36 <span class="gensmall">{postrow.POST_TIME}</span></td> 37 <!-- ENDIF --> 26 38 <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.REPORTER_FULL}</span></td> 27 39 <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 62 62 </tr> 63 63 <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> 67 65 </tr> 68 66 <tr> … … 82 80 </table> 83 81 </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> 85 83 </tr> 86 84 87 85 <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> 88 86 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"> 97 88 <table width="100%" cellspacing="0" cellpadding="2" border="0"> 98 89 <tr> … … 121 112 <tr valign="middle"> 122 113 <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 --> 125 116 </td> 126 117 <td width="10" nowrap="nowrap">{postrow.MINI_POST_IMG}</td> … … 132 123 </table> 133 124 </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> 134 126 </tr> 135 127 <tr> -
trunk/forum/styles/subsilver2/template/mcp_warn_user.html
r400 r702 9 9 <table cellspacing="1" cellpadding="2" border="0"> 10 10 <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> 12 12 </tr> 13 13 <!-- IF RANK_TITLE --> -
trunk/forum/styles/subsilver2/template/memberlist_im.html
r400 r702 15 15 <tr> 16 16 <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> 18 18 </tr> 19 19 … … 132 132 133 133 </table> 134 <a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>135 134 {S_FORM_TOKEN} 136 135 </form> 137 136 137 <a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a> 138 138 139 139 <!-- INCLUDE simple_footer.html --> -
trunk/forum/styles/subsilver2/template/memberlist_view.html
r400 r702 52 52 <!-- IF S_USER_LOGGED_IN and S_ZEBRA --> 53 53 <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> 55 63 </tr> 56 64 <!-- ENDIF --> … … 67 75 <td width="100%"><b class="gen">{VISITED}</b></td> 68 76 </tr> 69 <!-- IF U_NOTES or U_WARN-->77 <!-- IF S_WARNINGS --> 70 78 <tr> 71 79 <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> 73 81 </tr> 74 82 <!-- ENDIF --> … … 77 85 <td><b class="gen">{POSTS}</b><span class="genmed"><!-- IF POSTS_PCT --><br />[{POSTS_PCT} / {POSTS_DAY}]<!-- ENDIF --> 78 86 <!-- 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> 80 88 </tr> 81 89 <!-- IF S_SHOW_ACTIVITY --> … … 127 135 <tr> 128 136 <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> 130 138 </tr> 131 139 </table> -
trunk/forum/styles/subsilver2/template/overall_header.html
r400 r702 12 12 <meta name="keywords" content="" /> 13 13 <meta name="description" content="" /> 14 <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> 14 15 {META} 15 16 <title>{SITENAME} • <!-- IF S_IN_MCP -->{L_MCP} • <!-- ELSEIF S_IN_UCP -->{L_UCP} • <!-- 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}&t={S_TOPIC_ID}" /><!-- ENDIF --> 26 <!-- ENDIF --> 16 27 17 28 <link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" /> … … 40 51 { 41 52 var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}'); 42 var per page = '{PER_PAGE}';53 var per_page = '{PER_PAGE}'; 43 54 var base_url = '{A_BASE_URL}'; 44 55 45 if (page !== null && !isNaN(page) && page > 0) 46 { 47 document.location.href = base_url.replace(/&/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(/&/g, '&') + '&start=' + ((page - 1) * per_page); 65 } 48 66 } 49 67 } … … 152 170 <!-- IF S_USER_LOGGED_IN --> 153 171 <!-- IF S_DISPLAY_PM --> <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 --> <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) --> <a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a> 155 173 <!-- ENDIF --> 156 174 <!-- ENDIF --> … … 185 203 <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> 186 204 <!-- 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> 188 206 <!-- ENDIF --> 189 207 </p> -
trunk/forum/styles/subsilver2/template/posting_body.html
r400 r702 211 211 <!-- INCLUDE posting_buttons.html --> 212 212 <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> 214 214 <!-- IF S_BBCODE_ALLOWED --> 215 215 <td width="80" align="center" valign="top"> … … 250 250 <td class="gensmall">{URL_STATUS}</td> 251 251 </tr> 252 <!-- ENDIF --> 252 253 <tr> 253 254 <td class="gensmall">{SMILIES_STATUS}</td> 254 255 </tr> 255 <!-- ENDIF -->256 256 </table> 257 257 </td> … … 333 333 <!-- ENDIF --> 334 334 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 353 339 354 340 <!-- IF S_SHOW_ATTACH_BOX or S_SHOW_POLL_BOX --> -
trunk/forum/styles/subsilver2/template/posting_buttons.html
r400 r702 59 59 <option value="85">{L_FONT_SMALL}</option> 60 60 <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 --> 63 67 </select></span> 64 68 <!-- ENDIF --> -
trunk/forum/styles/subsilver2/template/posting_review.html
r400 r702 20 20 21 21 <!-- 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 --> 22 25 23 26 <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{post_review_row.POST_ID}"></a> … … 83 86 </table> 84 87 </td> 88 <!-- ENDIF --> 85 89 </tr> 86 90 <tr> -
trunk/forum/styles/subsilver2/template/posting_smilies.html
r400 r702 17 17 </tr> 18 18 <tr> 19 <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="in sert_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> 20 20 </tr> 21 21 </table> … … 23 23 </tr> 24 24 </table> 25 26 25 <!-- INCLUDE simple_footer.html --> -
trunk/forum/styles/subsilver2/template/posting_topic_review.html
r400 r702 16 16 <!-- IF topic_review_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> 17 17 18 <!-- IF topic_review_row.S_IGNORE_POST --> 19 <td colspan="2">{topic_review_row.L_IGNORE_POST}</td> 20 <!-- ELSE --> 18 21 <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{topic_review_row.POST_ID}"></a> 19 22 <table width="150" cellspacing="0"> … … 82 85 </table> 83 86 </td> 87 <!-- ENDIF --> 84 88 </tr> 85 89 <tr> -
trunk/forum/styles/subsilver2/template/report_body.html
r400 r702 5 5 <table class="tablebg" width="100%" cellspacing="1"> 6 6 <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> 8 8 </tr> 9 9 <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> 11 11 </tr> 12 12 <tr> -
trunk/forum/styles/subsilver2/template/search_results.html
r400 r702 9 9 <tr> 10 10 <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> 12 12 </tr> 13 13 </table> -
trunk/forum/styles/subsilver2/template/template.cfg
r400 r702 3 3 # 4 4 # @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 7 7 # 8 8 # … … 12 12 # 13 13 # 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. 15 15 # Single and double quotes do not need to be escaped. 16 16 # 17 # 17 # 18 18 19 19 # General Information about this template 20 20 name = subsilver2 21 21 copyright = © phpBB Group, 2003 22 version = 3.0. 422 version = 3.0.7 23 23 -
trunk/forum/styles/subsilver2/template/ucp_agreement.html
r400 r702 1 1 <!-- INCLUDE overall_header.html --> 2 2 3 <!-- IF S_SHOW_COPPA or S_REGISTRATION --> 3 4 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 } 4 16 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 --> 6 29 7 30 <form method="post" action="{S_UCP_ACTION}"> -
trunk/forum/styles/subsilver2/template/ucp_groups_manage.html
r400 r702 64 64 </tr> 65 65 <!-- IF not S_IN_AVATAR_GALLERY --> 66 <!-- IF S_ CAN_UPLOAD-->66 <!-- IF S_UPLOAD_AVATAR_FILE --> 67 67 <tr> 68 68 <td class="row1" width="35%"><label for="uploadfile">{L_UPLOAD_AVATAR_FILE}:</label></td> 69 69 <td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_MAX_FILESIZE}" /><input type="file" id="uploadfile" name="uploadfile" /></td> 70 70 </tr> 71 <!-- ENDIF --> 72 <!-- IF S_UPLOAD_AVATAR_URL --> 71 73 <tr> 72 74 <td class="row1" width="35%"><label for="uploadurl">{L_UPLOAD_AVATAR_URL}:</label><br /><span>{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td> … … 74 76 </tr> 75 77 <!-- ENDIF --> 78 <!-- IF S_LINK_AVATAR --> 76 79 <tr> 77 80 <td class="row1" width="35%"><label for="remotelink">{L_LINK_REMOTE_AVATAR}:</label><br /><span>{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td> … … 82 85 <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> 83 86 </tr> 87 <!-- ENDIF --> 84 88 <!-- IF S_DISPLAY_GALLERY --> 85 89 <tr> … … 194 198 <h1>{L_ADD_USERS}</h1> 195 199 196 <p>{L_ADD_USERS_ EXPLAIN}</p>200 <p>{L_ADD_USERS_UCP_EXPLAIN}</p> 197 201 198 202 <table class="tablebg" width="100%" cellspacing="1"> -
trunk/forum/styles/subsilver2/template/ucp_header.html
r400 r702 37 37 </tr> 38 38 <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> 40 40 </tr> 41 41 <!-- ENDIF --> -
trunk/forum/styles/subsilver2/template/ucp_main_drafts.html
r400 r702 70 70 <!-- INCLUDE posting_buttons.html --> 71 71 <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> 73 73 </tr> 74 74 <tr> -
trunk/forum/styles/subsilver2/template/ucp_main_front.html
r400 r702 44 44 <tr> 45 45 <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> 47 47 </tr> 48 48 <!-- IF S_SHOW_ACTIVITY --> -
trunk/forum/styles/subsilver2/template/ucp_pm_viewfolder.html
r400 r702 38 38 </form> 39 39 <!-- ELSE --> 40 40 41 41 <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" border="0"> 42 42 <!-- IF NUM_NOT_MOVED or NUM_REMOVED --> … … 75 75 76 76 <span class="topictitle"> 77 {messagerow.ATTACH_ICON_IMG} 77 {messagerow.ATTACH_ICON_IMG} 78 78 <!-- IF messagerow.S_PM_DELETED --> 79 79 {L_MESSAGE_REMOVED_FROM_OUTBOX}<br /> … … 93 93 <!-- BEGINELSE --> 94 94 <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> 96 102 </tr> 97 103 <!-- END messagerow --> -
trunk/forum/styles/subsilver2/template/ucp_pm_viewmessage.html
r400 r702 94 94 <table width="100%" cellspacing="0"> 95 95 <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> 97 97 </tr> 98 98 </table> -
trunk/forum/styles/subsilver2/template/ucp_pm_viewmessage_print.html
r400 r702 86 86 <td> 87 87 <!-- 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> 88 <span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->>{to_recipient.NAME}</span> 89 89 <!-- END to_recipient --> 90 90 </td> -
trunk/forum/styles/subsilver2/template/ucp_profile_avatar.html
r400 r702 41 41 <tr> 42 42 <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} × </span> <input class="post" type="text" name="height" size="3" value="{AVATAR_HEIGHT}" /> <span class="gen">{L_PIXEL}</span></td> 44 44 </tr> 45 45 <!-- ENDIF --> -
trunk/forum/styles/subsilver2/template/ucp_profile_signature.html
r400 r702 28 28 <!-- INCLUDE posting_buttons.html --> 29 29 <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> 31 31 </tr> 32 32 <!-- IF S_BBCODE_ALLOWED --> -
trunk/forum/styles/subsilver2/template/ucp_register.html
r400 r702 33 33 </tr> 34 34 <!-- 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 -->40 35 41 36 <tr> … … 67 62 <td class="row2"><select name="tz">{S_TZ_OPTIONS}</select></td> 68 63 </tr> 64 <!-- IF .profile_fields --> 65 <tr> 66 <td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td> 67 </tr> 69 68 <!-- BEGIN profile_fields --> 70 69 <tr> … … 76 75 <td class="row2">{profile_fields.FIELD}<!-- IF profile_fields.ERROR --><br /><span class="gensmall error">{profile_fields.ERROR}</span><!-- ENDIF --></td> 77 76 </tr> 77 78 78 <!-- END profile_fields --> 79 <!-- ENDIF --> 79 80 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 --> 95 84 96 85 <!-- IF S_COPPA --> -
trunk/forum/styles/subsilver2/template/ucp_zebra_foes.html
r400 r702 25 25 </tr> 26 26 </table> 27 <!-- TEST -->28 29 27 30 28 <!-- INCLUDE ucp_footer.html --> -
trunk/forum/styles/subsilver2/template/viewforum_body.html
r400 r702 112 112 </table> 113 113 114 <!-- IF not S_USER_LOGGED_IN -->114 <!-- IF not S_USER_LOGGED_IN and not S_IS_BOT --> 115 115 116 116 <br /><br /> … … 126 126 </tr> 127 127 </table> 128 128 {S_LOGIN_REDIRECT} 129 129 </form> 130 130 … … 299 299 <td> </td> 300 300 <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> 302 302 </tr> 303 303 <tr> -
trunk/forum/styles/subsilver2/template/viewtopic_body.html
r400 r702 119 119 </table> 120 120 {S_HIDDEN_FIELDS} 121 121 {S_FORM_TOKEN} 122 122 </form> 123 123 124 124 </td> 125 125 </tr> … … 156 156 </td> 157 157 </tr> 158 158 159 159 <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> 160 160 … … 179 179 <tr> 180 180 <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> 181 186 </tr> 182 187 <!-- ENDIF --> … … 206 211 <table width="100%" cellspacing="0"> 207 212 <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> 209 214 </tr> 210 215 </table> … … 255 260 256 261 <!-- IF postrow.BUMPED_MESSAGE --> 257 <span class="gensmall"> {postrow.BUMPED_MESSAGE}</span>262 <span class="gensmall"><br /><br />{postrow.BUMPED_MESSAGE}</span> 258 263 <!-- ENDIF --> 259 264 … … 281 286 282 287 <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};"> <!-- IF postrow.U_P ROFILE --><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 --> </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 --> </div></td>288 <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"> <!-- 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 --> </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 --> </div></td> 284 289 <!-- ENDIF --> 285 290 </tr> … … 320 325 321 326 <br clear="all" /> 327 <!-- IF S_QUICK_REPLY --> 328 <!-- INCLUDE quickreply_editor.html --> 329 <!-- ENDIF --> 322 330 323 331 <!-- INCLUDE breadcrumbs.html --> -
trunk/forum/styles/subsilver2/template/viewtopic_print.html
r400 r702 25 25 } 26 26 27 .code, 28 .quote { 27 .code, .codecontent, 28 .quote, .quotecontent { 29 margin: 0 5px 0 5px; 30 padding: 5px; 29 31 font-size: smaller; 30 32 border: black solid 1px; 33 } 34 35 .quotetitle { 36 color: black; 37 display : block; 38 font-weight: bold; 31 39 } 32 40 … … 84 92 <tr> 85 93 <td width="10%" nowrap="nowrap">{L_AUTHOR}: </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> 87 95 </tr> 88 96 <tr> -
trunk/forum/styles/subsilver2/theme/stylesheet.css
r400 r702 35 35 36 36 #wrapheader { 37 min-height: 120px;38 37 height: auto !important; 39 height: 120px;40 /* background-image: url('./images/background.gif');41 background-repeat: repeat-x;*/42 /* padding: 0 25px 15px 25px;*/43 38 padding: 0; 44 39 } … … 63 58 64 59 #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; 69 65 } 70 66 … … 228 224 .postapprove img, .postreported img { 229 225 vertical-align: bottom; 226 padding-top: 5px; 230 227 } 231 228 … … 383 380 /* Links 384 381 ------------ */ 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 385 389 a:link { 386 390 color: #006597; -
trunk/forum/styles/subsilver2/theme/theme.cfg
r400 r702 3 3 # 4 4 # @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 7 7 # 8 8 # … … 12 12 # 13 13 # 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. 15 15 # Single and double quotes do not need to be escaped. 16 16 # 17 17 # Available and used values: 18 18 # parse_css_file 19 # 19 # 20 20 21 21 # General Information about this theme 22 22 name = subsilver2 23 23 copyright = © phpBB Group, 2003 24 version = 3.0. 424 version = 3.0.7 25 25 26 26 # Some configuration options 27 27 28 28 # 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 30 30 # path template variables ({T_IMAGESET_PATH} for example) within 31 31 # your css file. -
trunk/forum/ucp.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp.php 8915 2008-09-23 13:30:52Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 128 128 'AGREEMENT_TEXT' => sprintf($user->lang[$message], $config['sitename'], generate_board_url()), 129 129 '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 )); 132 132 133 133 page_footer(); … … 144 144 foreach ($_COOKIE as $cookie_name => $cookie_data) 145 145 { 146 // Only delete board cookies, no other ones... 147 if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0) 148 { 149 continue; 150 } 151 146 152 $cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name); 147 153 … … 187 193 $db->sql_freeresult($result); 188 194 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')) 190 196 { 191 197 redirect(append_sid("{$phpbb_root_path}index.$phpEx")); … … 215 221 216 222 $auth->acl_cache($user->data); 217 218 $sql = 'UPDATE ' . USERS_TABLE . "219 SET user_perm_from = 0220 WHERE user_id = " . $user->data['user_id'];221 $db->sql_query($sql);222 223 223 224 $sql = 'SELECT username -
trunk/forum/viewforum.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : viewforum.php 9003 2008-10-11 18:23:12Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 136 136 { 137 137 $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 } 139 142 } 140 143 141 144 // Dump out the page header and load viewforum template 142 page_header($user->lang['VIEW_FORUM'] . ' - ' . $forum_data['forum_name'] );145 page_header($user->lang['VIEW_FORUM'] . ' - ' . $forum_data['forum_name'], true, $forum_id); 143 146 144 147 $template->set_filenames(array( … … 164 167 $template->assign_vars(array( 165 168 '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') . '&redirect=' . urlencode(str_replace('&', '&', build_url())),168 169 )); 169 170 … … 177 178 if (check_link_hash($token, 'global')) 178 179 { 179 markread('topics', $forum_id); 180 // Add 0 to forums array to mark global announcements correctly 181 markread('topics', array($forum_id, 0)); 180 182 } 181 183 $redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id); … … 613 615 614 616 // Generate all the URIs ... 615 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&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) . '&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; 619 622 $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&t=$topic_id", true, $user->session_id) : ''; 620 623 … … 665 668 'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false, 666 669 667 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread',668 'U_LAST_POST' => $view_topic_url . '&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 . '&view=unread') . '#unread', 671 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 669 672 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 670 673 '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 3 3 * 4 4 * @package phpBB3 5 * @version $Id : viewonline.php 8705 2008-07-28 16:55:00Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 140 140 $view_online = $s_user_hidden = false; 141 141 $user_colour = ($row['user_colour']) ? ' style="color:#' . $row['user_colour'] . '" class="username-coloured"' : ''; 142 142 143 143 $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>'; 144 144 … … 188 188 } 189 189 190 preg_match('#^([a-z /]+)#i', $row['session_page'], $on_page);190 preg_match('#^([a-z0-9/_-]+)#i', $row['session_page'], $on_page); 191 191 if (!sizeof($on_page)) 192 192 { … … 335 335 'U_WHOIS' => append_sid("{$phpbb_root_path}viewonline.$phpEx", 'mode=whois&s=' . $row['session_id']), 336 336 'U_FORUM_LOCATION' => $location_url, 337 337 338 338 'S_USER_HIDDEN' => $s_user_hidden, 339 339 'S_GUEST' => ($row['user_id'] == ANONYMOUS) ? true : false, -
trunk/forum/viewtopic.php
r400 r702 3 3 * 4 4 * @package phpBB3 5 * @version $Id : viewtopic.php 9138 2008-11-30 16:53:36Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 29 29 $voted_id = request_var('vote_id', array('' => 0)); 30 30 31 $voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id; 32 33 31 34 $start = request_var('start', 0); 32 35 $view = request_var('view', ''); … … 42 45 $update = request_var('update', false); 43 46 47 $s_can_vote = false; 44 48 /** 45 49 * @todo normalize? … … 83 87 " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND post_approved = 1') . " 84 88 AND post_time > $topic_last_read 89 AND forum_id = $forum_id 85 90 ORDER BY post_time ASC"; 86 91 $result = $db->sql_query_limit($sql, 1); … … 182 187 ); 183 188 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. 191 if ($db->sql_layer === 'firebird') 192 { 193 $sql_array['SELECT'] = 'f.forum_id AS forum_id, ' . $sql_array['SELECT']; 194 } 195 184 196 // The FROM-Order is quite important here, else t.* columns can not be correctly bound. 185 197 if ($post_id) 186 198 { 199 $sql_array['SELECT'] .= ', p.post_approved'; 187 200 $sql_array['FROM'][POSTS_TABLE] = 'p'; 188 201 } … … 232 245 else 233 246 { 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"; 235 248 } 236 249 … … 260 273 $db->sql_freeresult($result); 261 274 275 // link to unapproved post or incorrect link 262 276 if (!$topic_data) 263 277 { 264 278 // 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&t=$topic_id"));279 if ($post_id && $topic_id) 280 { 281 redirect(append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=$topic_id" . (($forum_id) ? "&f=$forum_id" : ''))); 268 282 } 269 283 … … 271 285 } 272 286 287 $forum_id = (int) $topic_data['forum_id']; 273 288 // This is for determining where we are (page) 274 289 if ($post_id) 275 290 { 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) ? "&f=$forum_id" : ''))); 298 } 299 300 trigger_error('NO_TOPIC'); 301 } 276 302 if ($post_id == $topic_data['topic_first_post_id'] || $post_id == $topic_data['topic_last_post_id']) 277 303 { … … 304 330 } 305 331 306 $forum_id = (int) $topic_data['forum_id'];307 332 $topic_id = (int) $topic_data['topic_id']; 308 309 333 // 310 334 $topic_replies = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] : $topic_data['topic_replies']; … … 395 419 396 420 $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); 398 423 399 424 $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; … … 550 575 // Moderators 551 576 $forum_moderators = array(); 552 get_moderators($forum_moderators, $forum_id); 577 if ($config['load_moderators']) 578 { 579 get_moderators($forum_moderators, $forum_id); 580 } 553 581 554 582 // This is only used for print view so ... … … 598 626 'WARN_IMG' => $user->img('icon_user_warn', 'WARN_USER'), 599 627 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, 601 629 'S_SELECT_SORT_DIR' => $s_sort_dir, 602 630 'S_SELECT_SORT_KEY' => $s_sort_key, … … 605 633 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"), 606 634 '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&t=$topic_id& quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id),635 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id&start=$start&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id), 608 636 609 637 'S_VIEWTOPIC' => true, … … 613 641 'S_DISPLAY_POST_INFO' => ($topic_data['forum_type'] == FORUM_POST && ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS)) ? true : false, 614 642 '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, 615 644 616 645 'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&t=$topic_id", … … 680 709 } 681 710 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) && 684 713 (($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0) && 685 714 $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; 687 718 $s_display_results = (!$s_can_vote || ($s_can_vote && sizeof($cur_voted_id)) || $view == 'viewpoll') ? true : false; 688 719 … … 690 721 { 691 722 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')) 693 724 { 694 725 $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"); … … 703 734 $message = 'TOO_MANY_VOTE_OPTIONS'; 704 735 } 736 else if (in_array(VOTE_CONVERTED, $cur_voted_id)) 737 { 738 $message = 'VOTE_CONVERTED'; 739 } 705 740 else 706 741 { 707 $message = ' VOTE_CONVERTED';742 $message = 'FORM_INVALID'; 708 743 } 709 744 … … 859 894 $store_reverse = false; 860 895 $sql_limit = $config['posts_per_page']; 896 $sql_sort_order = $direction = ''; 861 897 862 898 if ($start > $total_posts / 2) … … 870 906 871 907 // 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'); 873 909 $sql_start = max(0, $total_posts - $sql_limit - $start); 874 910 } … … 876 912 { 877 913 // 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'); 879 915 $sql_start = $start; 916 } 917 918 if (is_array($sort_by_sql[$sort_key])) 919 { 920 $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; 921 } 922 else 923 { 924 $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; 880 925 } 881 926 … … 888 933 // Go ahead and pull all data for this topic 889 934 $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': '') . " 891 936 WHERE p.topic_id = $topic_id 892 937 " . ((!$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': '') . " 894 939 $limit_posts_time 895 940 ORDER BY $sql_sort_order"; … … 899 944 while ($row = $db->sql_fetchrow($result)) 900 945 { 901 $post_list[$i] = $row['post_id'];946 $post_list[$i] = (int) $row['post_id']; 902 947 ($store_reverse) ? $i-- : $i++; 903 948 } … … 953 998 } 954 999 955 $poster_id = $row['poster_id'];1000 $poster_id = (int) $row['poster_id']; 956 1001 957 1002 // Does post have an attachment? If so, add it to the list 958 1003 if ($row['post_attachment'] && $config['allow_attachments']) 959 1004 { 960 $attach_list[] = $row['post_id'];1005 $attach_list[] = (int) $row['post_id']; 961 1006 962 1007 if ($row['post_approved']) … … 1093 1138 'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&action=jabber&u=$poster_id") : '', 1094 1139 'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&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']), 1095 1145 ); 1096 1146 … … 1144 1194 if ($config['load_cpf_viewtopic']) 1145 1195 { 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 } 1147 1200 $cp = new custom_profile(); 1148 1201 1149 1202 // 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); 1151 1219 } 1152 1220 … … 1382 1450 // post and only the topic poster and last poster are allowed to bump. 1383 1451 // 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)); 1385 1453 } 1386 1454 else … … 1405 1473 } 1406 1474 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 1407 1491 // 1408 1492 $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']), 1413 1497 1414 1498 'RANK_TITLE' => $user_cache[$poster_id]['rank_title'], … … 1422 1506 'POSTER_AGE' => $user_cache[$poster_id]['age'], 1423 1507 1424 'POST_DATE' => $user->format_date($row['post_time'] ),1508 'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false), 1425 1509 'POST_SUBJECT' => $row['post_subject'], 1426 1510 'MESSAGE' => $message, … … 1438 1522 'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false), 1439 1523 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&f=$forum_id&p={$row['post_id']}") : ''),1524 'U_EDIT' => ($edit_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '', 1441 1525 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', 1442 1526 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&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&f=$forum_id&p={$row['post_id']}") : ''),1527 'U_DELETE' => ($delete_allowed) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=delete&f=$forum_id&p={$row['post_id']}") : '', 1444 1528 1445 1529 'U_PROFILE' => $user_cache[$poster_id]['profile'], … … 1515 1599 1516 1600 // 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)1601 if (isset($user->data['session_page']) && !$user->data['is_bot'] && (strpos($user->data['session_page'], '&t=' . $topic_id) === false || isset($user->data['session_created']))) 1518 1602 { 1519 1603 $sql = 'UPDATE ' . TOPICS_TABLE . ' … … 1532 1616 } 1533 1617 1618 // Get last post time for all global announcements 1619 // to keep proper forums tracking 1620 if ($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 1534 1639 // Only mark topic if it's currently unread. Also make sure we do not set topic tracking back if earlier pages are viewed. 1535 1640 if (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]) 1536 1641 { 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); 1538 1643 1539 1644 // 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); 1541 1646 } 1542 1647 else … … 1579 1684 } 1580 1685 } 1686 1687 // let's set up quick_reply 1688 $s_quick_reply = false; 1689 if ($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 1695 if ($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&f=$forum_id&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 1581 1731 1582 1732 // We overwrite $_REQUEST['f'] if there is no forum specified … … 1588 1738 } 1589 1739 1740 // We need to do the same with the topic_id. See #53025. 1741 if (empty($_REQUEST['t']) && !empty($topic_id)) 1742 { 1743 $_REQUEST['t'] = $topic_id; 1744 } 1745 1590 1746 // Output the page 1591 page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'] );1747 page_header($user->lang['VIEW_TOPIC'] . ' - ' . $topic_data['topic_title'], true, $forum_id); 1592 1748 1593 1749 $template->set_filenames(array( -
trunk/stat
-
Property svn:ignore
set to
stat.xml
-
Property svn:ignore
set to
Note:
See TracChangeset
for help on using the changeset viewer.