punbb-1.3.3/admin/bans.php |
punbb-1.3.6/admin/bans.php |
24: require FORUM_ROOT.'lang/'.$forum_user['language'].'/admin_common.php'; | 24: require FORUM_ROOT.'lang/'.$forum_user['language'].'/admin_common.php'; |
25: require FORUM_ROOT.'lang/'.$forum_user['language'].'/admin_bans.php'; | 25: require FORUM_ROOT.'lang/'.$forum_user['language'].'/admin_bans.php'; |
26: | 26: |
27: | |
28: // Add/edit a ban (stage 1) | 27: // Add/edit a ban (stage 1) |
29: if (isset($_REQUEST['add_ban']) || isset($_GET['edit_ban'])) | 28: if (isset($_REQUEST['add_ban']) || isset($_GET['edit_ban'])) |
30: { | 29: { |
384: | 383: |
385: // Setup the form | 384: // Setup the form |
386: $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0; | 385: $forum_page['group_count'] = $forum_page['item_count'] = $forum_page['fld_count'] = 0; |
387: $forum_page['form_action'] = forum_link($forum_url['admin_bans']).'?action=more'; | 386: $forum_page['form_action'] = forum_link($forum_url['admin_bans']).'&action=more'; |
388: | 387: |
389: $forum_page['hidden_fields'] = array( | 388: $forum_page['hidden_fields'] = array( |
390: 'csrf_token' => '<input type="hidden" name="csrf_token" value="'.generate_form_token($forum_page['form_action']).'" />' | 389: 'csrf_token' => '<input type="hidden" name="csrf_token" value="'.generate_form_token($forum_page['form_action']).'" />' |
400: $forum_page['crumbs'][] = array($lang_admin_common['Bans'], forum_link($forum_url['admin_bans'])); | 399: $forum_page['crumbs'][] = array($lang_admin_common['Bans'], forum_link($forum_url['admin_bans'])); |
401: | 400: |
402: | 401: |
| 402: // Fetch user count |
| 403: $query = array( |
| 404: 'SELECT' => 'COUNT(id)', |
| 405: 'FROM' => 'bans' |
| 406: ); |
| 407: |
| 408: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
| 409: $forum_page['num_bans'] = $forum_db->result($result); |
| 410: $forum_page['num_pages'] = ceil($forum_page['num_bans'] / $forum_user['disp_topics']); |
| 411: $forum_page['page'] = (!isset($_GET['p']) || !is_numeric($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $forum_page['num_pages']) ? 1 : intval($_GET['p']); |
| 412: $forum_page['start_from'] = $forum_user['disp_topics'] * ($forum_page['page'] - 1); |
| 413: $forum_page['finish_at'] = min(($forum_page['start_from'] + $forum_user['disp_topics']), ($forum_page['num_bans'])); |
| 414: |
| 415: // Generate paging |
| 416: $forum_page['page_post']['paging']='<p class="paging"><span class="pages">'.$lang_common['Pages'].'</span> '.paginate($forum_page['num_pages'], $forum_page['page'], $forum_url['admin_bans'], $lang_common['Paging separator'], null, true).'</p>'; |
| 417: |
| 418: // Navigation links for header and page numbering for title/meta description |
| 419: if ($forum_page['page'] < $forum_page['num_pages']) |
| 420: { |
| 421: $forum_page['nav']['last'] = '<link rel="last" href="'.forum_sublink($forum_url['admin_bans'], $forum_url['page'], $forum_page['num_pages']).'" title="'.$lang_common['Page'].' '.$forum_page['num_pages'].'" />'; |
| 422: $forum_page['nav']['next'] = '<link rel="next" href="'.forum_sublink($forum_url['admin_bans'], $forum_url['page'], ($forum_page['page'] + 1)).'" title="'.$lang_common['Page'].' '.($forum_page['page'] + 1).'" />'; |
| 423: } |
| 424: if ($forum_page['page'] > 1) |
| 425: { |
| 426: $forum_page['nav']['prev'] = '<link rel="prev" href="'.forum_sublink($forum_url['admin_bans'], $forum_url['page'], ($forum_page['page'] - 1)).'" title="'.$lang_common['Page'].' '.($forum_page['page'] - 1).'" />'; |
| 427: $forum_page['nav']['first'] = '<link rel="first" href="'.forum_link($forum_url['admin_bans']).'" title="'.$lang_common['Page'].' 1" />'; |
| 428: } |
| 429: |
403: ($hook = get_hook('aba_pre_header_load')) ? eval($hook) : null; | 430: ($hook = get_hook('aba_pre_header_load')) ? eval($hook) : null; |
404: | 431: |
405: define('FORUM_PAGE_SECTION', 'users'); | 432: define('FORUM_PAGE_SECTION', 'users'); |
449: <div class="main-content main-frm"> | 476: <div class="main-content main-frm"> |
450: <?php | 477: <?php |
451: | 478: |
452: if (!empty($forum_bans)) | 479: if ($forum_page['num_bans'] > 0) |
453: { | 480: { |
454: | 481: |
455: ?> | 482: ?> |
456: <div class="ct-group"> | 483: <div class="ct-group"> |
457: <?php | 484: <?php |
458: | 485: |
| 486: // Grab the bans |
| 487: $query = array( |
| 488: 'SELECT' => 'b.*, u.username AS ban_creator_username', |
| 489: 'FROM' => 'bans AS b', |
| 490: 'JOINS' => array( |
| 491: array( |
| 492: 'LEFT JOIN' => 'users AS u', |
| 493: 'ON' => 'u.id=b.ban_creator' |
| 494: ) |
| 495: ), |
| 496: 'ORDER BY' => 'b.id', |
| 497: 'LIMIT' => $forum_page['start_from'].', '.$forum_page['finish_at'] |
| 498: ); |
| 499: |
| 500: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
| 501: |
459: $forum_page['item_num'] = 0; | 502: $forum_page['item_num'] = 0; |
460: foreach ($forum_bans as $ban_key => $cur_ban) | 503: while ($cur_ban = $forum_db->fetch_assoc($result)) |
461: { | 504: { |
462: $forum_page['ban_info'] = array(); | 505: $forum_page['ban_info'] = array(); |
463: $forum_page['ban_creator'] = ($cur_ban['ban_creator_username'] != '') ? '<a href="'.forum_link($forum_url['user'], $cur_ban['ban_creator']).'">'.forum_htmlencode($cur_ban['ban_creator_username']).'</a>' : $lang_admin_common['Unknown']; | 506: $forum_page['ban_creator'] = ($cur_ban['ban_creator_username'] != '') ? '<a href="'.forum_link($forum_url['user'], $cur_ban['ban_creator']).'">'.forum_htmlencode($cur_ban['ban_creator_username']).'</a>' : $lang_admin_common['Unknown']; |
484: <div class="ct-box"> | 527: <div class="ct-box"> |
485: <div class="ct-legend"> | 528: <div class="ct-legend"> |
486: <h3 class=""><span><?php printf($lang_admin_bans['Current ban head'], $forum_page['ban_creator']) ?></span></h3> | 529: <h3 class=""><span><?php printf($lang_admin_bans['Current ban head'], $forum_page['ban_creator']) ?></span></h3> |
487: <p><?php printf($lang_admin_bans['Edit or remove'], '<a href="'.forum_link($forum_url['admin_bans']).'?edit_ban='.$cur_ban['id'].'">'.$lang_admin_bans['Edit ban'].'</a>', '<a href="'.forum_link($forum_url['admin_bans']).'?del_ban='.$cur_ban['id'].'&csrf_token='.generate_form_token('del_ban'.$cur_ban['id']).'">'.$lang_admin_bans['Remove ban'].'</a>') ?></p> | 530: <p><?php printf($lang_admin_bans['Edit or remove'], '<a href="'.forum_link($forum_url['admin_bans']).'&edit_ban='.$cur_ban['id'].'">'.$lang_admin_bans['Edit ban'].'</a>', '<a href="'.forum_link($forum_url['admin_bans']).'&del_ban='.$cur_ban['id'].'&csrf_token='.generate_form_token('del_ban'.$cur_ban['id']).'">'.$lang_admin_bans['Remove ban'].'</a>') ?></p> |
488: </div> | 531: </div> |
489: <?php if (!empty($forum_page['ban_info'])): ?> | 532: <?php if (!empty($forum_page['ban_info'])): ?> |
490: <ul> | 533: <ul> |
punbb-1.3.3/admin/install.php |
punbb-1.3.6/admin/install.php |
4: * | 4: * |
5: * Used to actually install PunBB. | 5: * Used to actually install PunBB. |
6: * | 6: * |
7: * @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org | 7: * @copyright (C) 2008-2011 PunBB, partially based on code (C) 2008-2009 FluxBB.org |
8: * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher | 8: * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher |
9: * @package PunBB | 9: * @package PunBB |
10: */ | 10: */ |
11: | 11: |
12: | 12: |
13: define('FORUM_VERSION', '1.3.3'); | 13: define('FORUM_VERSION', '1.3.6'); |
14: define('FORUM_DB_REVISION', 4); | 14: define('FORUM_DB_REVISION', 4); |
15: define('MIN_PHP_VERSION', '4.3.0'); | 15: define('MIN_PHP_VERSION', '4.3.0'); |
16: define('MIN_MYSQL_VERSION', '4.1.2'); | 16: define('MIN_MYSQL_VERSION', '4.1.2'); |
62: if (!file_exists(FORUM_ROOT.'lang/'.$language.'/install.php')) | 62: if (!file_exists(FORUM_ROOT.'lang/'.$language.'/install.php')) |
63: exit('The language pack you have chosen doesn\'t seem to exist or is corrupt. Please recheck and try again.'); | 63: exit('The language pack you have chosen doesn\'t seem to exist or is corrupt. Please recheck and try again.'); |
64: | 64: |
65: // Load the language file | 65: // Load the language files |
66: require FORUM_ROOT.'lang/'.$language.'/install.php'; | 66: require FORUM_ROOT.'lang/'.$language.'/install.php'; |
67: | 67: require FORUM_ROOT.'lang/'.$language.'/admin_settings.php'; |
68: | 68: |
69: if (isset($_POST['generate_config'])) | 69: if (isset($_POST['generate_config'])) |
70: { | 70: { |
84: exit; | 84: exit; |
85: } | 85: } |
86: | 86: |
87: header('Content-Type: text/xml; charset=utf-8'); | 87: header('Content-Type: text/html; charset=utf-8'); |
88: | 88: |
89: if (!isset($_POST['form_sent'])) | 89: if (!isset($_POST['form_sent'])) |
90: { | 90: { |
92: $dual_mysql = false; | 92: $dual_mysql = false; |
93: $db_extensions = array(); | 93: $db_extensions = array(); |
94: if (function_exists('mysqli_connect')) | 94: if (function_exists('mysqli_connect')) |
| 95: { |
95: $db_extensions[] = array('mysqli', 'MySQL Improved'); | 96: $db_extensions[] = array('mysqli', 'MySQL Improved'); |
| 97: } |
| 98: |
96: if (function_exists('mysql_connect')) | 99: if (function_exists('mysql_connect')) |
97: { | 100: { |
98: $db_extensions[] = array('mysql', 'MySQL Standard'); | 101: $db_extensions[] = array('mysql', 'MySQL Standard'); |
216: <div class="sf-set set1"> | 219: <div class="sf-set set1"> |
217: <div class="sf-box text required"> | 220: <div class="sf-box text required"> |
218: <label for="fld2"><span><?php echo $lang_install['Database server'] ?> <em><?php echo $lang_install['Required'] ?></em></span> <small><?php echo $lang_install['Database server help'] ?></small></label><br /> | 221: <label for="fld2"><span><?php echo $lang_install['Database server'] ?> <em><?php echo $lang_install['Required'] ?></em></span> <small><?php echo $lang_install['Database server help'] ?></small></label><br /> |
219: <span class="fld-input"><input id="fld2" type="text" name="req_db_host" value="localhost" size="50" maxlength="100" /></span> | 222: <span class="fld-input"><input id="fld2" type="text" name="req_db_host" value="localhost" size="35" maxlength="100" /></span> |
220: </div> | 223: </div> |
221: </div> | 224: </div> |
222: <div class="sf-set set2"> | 225: <div class="sf-set set2"> |
276: <div class="sf-set set4"> | 279: <div class="sf-set set4"> |
277: <div class="sf-box text required"> | 280: <div class="sf-box text required"> |
278: <label for="fld10"><span><?php echo $lang_install['Admin e-mail'] ?> <em><?php echo $lang_install['Required'] ?></em></span> <small><?php echo $lang_install['E-mail address help'] ?></small></label><br /> | 281: <label for="fld10"><span><?php echo $lang_install['Admin e-mail'] ?> <em><?php echo $lang_install['Required'] ?></em></span> <small><?php echo $lang_install['E-mail address help'] ?></small></label><br /> |
279: <span class="fld-input"><input id="fld10" type="text" name="req_email" size="50" maxlength="80" /></span> | 282: <span class="fld-input"><input id="fld10" type="text" name="req_email" size="35" maxlength="80" /></span> |
280: </div> | 283: </div> |
281: </div> | 284: </div> |
282: </fieldset> | 285: </fieldset> |
297: <div class="sf-set set1"> | 300: <div class="sf-set set1"> |
298: <div class="sf-box text"> | 301: <div class="sf-box text"> |
299: <label for="fld11"><span><?php echo $lang_install['Board title'] ?></span></label><br /> | 302: <label for="fld11"><span><?php echo $lang_install['Board title'] ?></span></label><br /> |
300: <span class="fld-input"><input id="fld11" type="text" name="board_title" size="50" maxlength="255" /></span> | 303: <span class="fld-input"><input id="fld11" type="text" name="board_title" size="35" maxlength="255" /></span> |
301: </div> | 304: </div> |
302: </div> | 305: </div> |
303: <div class="sf-set set2"> | 306: <div class="sf-set set2"> |
304: <div class="sf-box text"> | 307: <div class="sf-box text"> |
305: <label for="fld12"><span><?php echo $lang_install['Board description'] ?></span></label><br /> | 308: <label for="fld12"><span><?php echo $lang_install['Board description'] ?></span></label><br /> |
306: <span class="fld-input"><input id="fld12" type="text" name="board_descrip" size="50" maxlength="255" /></span> | 309: <span class="fld-input"><input id="fld12" type="text" name="board_descrip" size="35" maxlength="255" /></span> |
307: </div> | 310: </div> |
308: </div> | 311: </div> |
309: <div class="sf-set set3"> | 312: <div class="sf-set set3"> |
310: <div class="sf-box text required"> | 313: <div class="sf-box text required"> |
311: <label for="fld13"><span><?php echo $lang_install['Base URL'] ?> <em><?php echo $lang_install['Required'] ?></em></span> <small><?php echo $lang_install['Base URL help'] ?></small></label><br /> | 314: <label for="fld13"><span><?php echo $lang_install['Base URL'] ?> <em><?php echo $lang_install['Required'] ?></em></span> <small><?php echo $lang_install['Base URL help'] ?></small></label><br /> |
312: <span class="fld-input"><input id="fld13" type="text" name="req_base_url" value="<?php echo $base_url_guess ?>" size="60" maxlength="100" /></span> | 315: <span class="fld-input"><input id="fld13" type="text" name="req_base_url" value="<?php echo $base_url_guess ?>" size="35" maxlength="100" /></span> |
313: </div> | 316: </div> |
314: </div> | 317: </div> |
315: <?php | 318: <?php |
473: { | 476: { |
474: $mysql_info = $forum_db->get_version(); | 477: $mysql_info = $forum_db->get_version(); |
475: if (version_compare($mysql_info['version'], MIN_MYSQL_VERSION, '<')) | 478: if (version_compare($mysql_info['version'], MIN_MYSQL_VERSION, '<')) |
476: error(sprintf($lang_install['Invalid MySQL version'], $mysql_version, MIN_MYSQL_VERSION)); | 479: error(sprintf($lang_install['Invalid MySQL version'], forum_htmlencode($mysql_info['version']), MIN_MYSQL_VERSION)); |
477: } | 480: } |
478: | 481: |
479: // Validate prefix | 482: // Validate prefix |
1020: 'PRIMARY KEY' => array('id'), | 1023: 'PRIMARY KEY' => array('id'), |
1021: 'INDEXES' => array( | 1024: 'INDEXES' => array( |
1022: 'topic_id_idx' => array('topic_id'), | 1025: 'topic_id_idx' => array('topic_id'), |
1023: 'multi_idx' => array('poster_id', 'topic_id') | 1026: 'multi_idx' => array('poster_id', 'topic_id'), |
| 1027: 'posted_idx' => array('posted') |
1024: ) | 1028: ) |
1025: ); | 1029: ); |
1026: | 1030: |
1602: 'o_date_format' => "'Y-m-d'", | 1606: 'o_date_format' => "'Y-m-d'", |
1603: 'o_check_for_updates' => "'$check_for_updates'", | 1607: 'o_check_for_updates' => "'$check_for_updates'", |
1604: 'o_check_for_versions' => "'$check_for_updates'", | 1608: 'o_check_for_versions' => "'$check_for_updates'", |
1605: 'o_timeout_visit' => "'1800'", | 1609: 'o_timeout_visit' => "'5400'", |
1606: 'o_timeout_online' => "'300'", | 1610: 'o_timeout_online' => "'300'", |
1607: 'o_redirect_delay' => "'1'", | 1611: 'o_redirect_delay' => "'1'", |
1608: 'o_show_version' => "'0'", | 1612: 'o_show_version' => "'0'", |
1655: 'o_rules' => "'0'", | 1659: 'o_rules' => "'0'", |
1656: 'o_rules_message' => "'".$lang_install['Default rules']."'", | 1660: 'o_rules_message' => "'".$lang_install['Default rules']."'", |
1657: 'o_maintenance' => "'0'", | 1661: 'o_maintenance' => "'0'", |
1658: 'o_maintenance_message' => "'".$lang_install['Default maint message']."'", | 1662: 'o_maintenance_message' => "'".$lang_admin_settings['Maintenance message default']."'", |
1659: 'o_default_dst' => "'0'", | 1663: 'o_default_dst' => "'0'", |
1660: 'p_message_bbcode' => "'1'", | 1664: 'p_message_bbcode' => "'1'", |
1661: 'p_message_img_tag' => "'1'", | 1665: 'p_message_img_tag' => "'1'", |
1746: | 1750: |
1747: | 1751: |
1748: $alerts = array(); | 1752: $alerts = array(); |
| 1753: |
1749: // Check if the cache directory is writable | 1754: // Check if the cache directory is writable |
1750: if (!is_writable('./cache/')) | 1755: if (!is_writable(FORUM_ROOT.'cache/')) |
1751: $alerts[] = '<li><span>'.$lang_install['No cache write'].'</span></li>'; | 1756: $alerts[] = '<li><span>'.$lang_install['No cache write'].'</span></li>'; |
1752: | 1757: |
1753: // Check if default avatar directory is writable | 1758: // Check if default avatar directory is writable |
1754: if (!is_writable('./img/avatars/')) | 1759: if (!is_writable(FORUM_ROOT.'img/avatars/')) |
1755: $alerts[] = '<li><span>'.$lang_install['No avatar write'].'</span></li>'; | 1760: $alerts[] = '<li><span>'.$lang_install['No avatar write'].'</span></li>'; |
1756: | 1761: |
1757: // Check if we disabled uploading avatars because file_uploads was disabled | 1762: // Check if we disabled uploading avatars because file_uploads was disabled |
1843: <p><?php echo $lang_install['Success welcome'] ?></p> | 1848: <p><?php echo $lang_install['Success welcome'] ?></p> |
1844: </div> | 1849: </div> |
1845: | 1850: |
1846: <?php | |
1847: ?> | |
1848: | |
1849: <div id="brd-main" class="main basic"> | 1851: <div id="brd-main" class="main basic"> |
1850: | 1852: |
1851: <div class="main-head"> | 1853: <div class="main-head"> |
1853: </div> | 1855: </div> |
1854: | 1856: |
1855: <div class="main-content main-frm"> | 1857: <div class="main-content main-frm"> |
1856: <?php | 1858: <?php if (!empty($alerts)): ?> |
| 1859: <div class="ct-box error-box"> |
| 1860: <p class="warn"><strong><?php echo $lang_install['Warning'] ?></strong></p> |
| 1861: <ul> |
| 1862: <?php echo implode("\n\t\t\t\t", $alerts)."\n" ?> |
| 1863: </ul> |
| 1864: </div> |
| 1865: <?php endif; |
1857: | 1866: |
1858: if (!$written) | 1867: if (!$written) |
1859: { | 1868: { |
1863: <p class="warn"><?php echo $lang_install['No write info 1'] ?></p> | 1872: <p class="warn"><?php echo $lang_install['No write info 1'] ?></p> |
1864: <p class="warn"><?php printf($lang_install['No write info 2'], '<a href="'.FORUM_ROOT.'index.php">'.$lang_install['Go to index'].'</a>') ?></p> | 1873: <p class="warn"><?php printf($lang_install['No write info 2'], '<a href="'.FORUM_ROOT.'index.php">'.$lang_install['Go to index'].'</a>') ?></p> |
1865: </div> | 1874: </div> |
1866: <?php if (!empty($alerts)): ?> | |
1867: <div class="ct-box error-box"> | |
1868: <p class="warn"><strong><?php echo $lang_install['Warning'] ?></strong></p> | |
1869: <ul> | |
1870: <?php echo implode("\n\t\t\t\t", $alerts)."\n" ?> | |
1871: </ul> | |
1872: </div> | |
1873: <?php endif; ?> | |
1874: <form class="frm-form" method="post" accept-charset="utf-8" action="install.php"> | 1875: <form class="frm-form" method="post" accept-charset="utf-8" action="install.php"> |
1875: <div class="hidden"> | 1876: <div class="hidden"> |
1876: <input type="hidden" name="generate_config" value="1" /> | 1877: <input type="hidden" name="generate_config" value="1" /> |
punbb-1.3.3/admin/users.php |
punbb-1.3.6/admin/users.php |
812: } | 812: } |
813: | 813: |
814: | 814: |
815: else if (isset($_POST['find_user'])) | 815: else if (isset($_GET['find_user'])) |
816: { | 816: { |
817: $form = $_POST['form']; | 817: $form = isset($_GET['form']) ? $_GET['form'] : array(); |
818: $form['username'] = $_POST['username']; | 818: |
| 819: // trim() all elements in $form |
| 820: $form = array_map('forum_trim', $form); |
| 821: $conditions = $query_str = array(); |
819: | 822: |
820: //Check up for order_by and direction values | 823: //Check up for order_by and direction values |
821: $order_by = isset($_POST['order_by']) ? forum_trim($_POST['order_by']) : null; | 824: $order_by = isset($_GET['order_by']) ? forum_trim($_GET['order_by']) : null; |
822: $direction = isset($_POST['direction']) ? forum_trim($_POST['direction']) : null; | 825: $direction = isset($_GET['direction']) ? forum_trim($_GET['direction']) : null; |
823: if ($order_by == null || $direction == null) | 826: if ($order_by == null || $direction == null) |
824: message($lang_common['Bad request']); | 827: message($lang_common['Bad request']); |
| 828: |
825: if (!in_array($order_by, array('username', 'email', 'num_posts', 'num_posts', 'registered')) || !in_array($direction, array('ASC', 'DESC'))) | 829: if (!in_array($order_by, array('username', 'email', 'num_posts', 'num_posts', 'registered')) || !in_array($direction, array('ASC', 'DESC'))) |
826: message($lang_common['Bad request']); | 830: message($lang_common['Bad request']); |
827: | 831: |
828: ($hook = get_hook('aus_find_user_selected')) ? eval($hook) : null; | 832: ($hook = get_hook('aus_find_user_selected')) ? eval($hook) : null; |
829: | 833: |
830: // forum_trim() all elements in $form | 834: $query_str[] = 'order_by='.$order_by; |
831: $form = array_map('trim', $form); | 835: $query_str[] = 'direction='.$direction; |
832: $conditions = array(); | 836: |
833: | 837: $posts_greater = isset($_GET['posts_greater']) ? forum_trim($_GET['posts_greater']) : ''; |
834: $posts_greater = forum_trim($_POST['posts_greater']); | 838: $posts_less = isset($_GET['posts_less']) ? forum_trim($_GET['posts_less']) : ''; |
835: $posts_less = forum_trim($_POST['posts_less']); | 839: $last_post_after = isset($_GET['last_post_after']) ? forum_trim($_GET['last_post_after']) : ''; |
836: $last_post_after = forum_trim($_POST['last_post_after']); | 840: $last_post_before = isset($_GET['last_post_before']) ? forum_trim($_GET['last_post_before']) : ''; |
837: $last_post_before = forum_trim($_POST['last_post_before']); | 841: $registered_after = isset($_GET['registered_after']) ? forum_trim($_GET['registered_after']) : ''; |
838: $registered_after = forum_trim($_POST['registered_after']); | 842: $registered_before = isset($_GET['registered_before']) ? forum_trim($_GET['registered_before']) : ''; |
839: $registered_before = forum_trim($_POST['registered_before']); | 843: $user_group = isset($_GET['user_group']) ? intval($_GET['user_group']) : -1; |
840: $user_group = $_POST['user_group']; | 844: |
| 845: $query_str[] = 'user_group='.$user_group; |
841: | 846: |
842: if ((!empty($posts_greater) || !empty($posts_less)) && !ctype_digit($posts_greater.$posts_less)) | 847: if ((!empty($posts_greater) || !empty($posts_less)) && !ctype_digit($posts_greater.$posts_less)) |
843: message($lang_admin_users['Non numeric value message']); | 848: message($lang_admin_users['Non numeric value message']); |
844: | 849: |
845: // Try to convert date/time to timestamps | 850: // Try to convert date/time to timestamps |
846: if ($last_post_after != '') | 851: if ($last_post_after != '') |
847: $last_post_after = strtotime($last_post_after); | 852: { |
848: if ($last_post_before != '') | 853: $query_str[] = 'last_post_after='.$last_post_after; |
849: $last_post_before = strtotime($last_post_before); | |
850: if ($registered_after != '') | |
851: $registered_after = strtotime($registered_after); | |
852: if ($registered_before != '') | |
853: $registered_before = strtotime($registered_before); | |
854: | 854: |
855: if ($last_post_after == -1 || $last_post_before == -1 || $registered_after == -1 || $registered_before == -1) | 855: $last_post_after = strtotime($last_post_after); |
856: message($lang_admin_users['Invalid date/time message']); | 856: if ($last_post_after === false || $last_post_after == -1) |
| 857: message($lang_admin_users['Invalid date/time message']); |
857: | 858: |
858: if ($last_post_after != '') | |
859: $conditions[] = 'u.last_post>'.$last_post_after; | 859: $conditions[] = 'u.last_post>'.$last_post_after; |
| 860: } |
860: if ($last_post_before != '') | 861: if ($last_post_before != '') |
| 862: { |
| 863: $query_str[] = 'last_post_before='.$last_post_before; |
| 864: |
| 865: $last_post_before = strtotime($last_post_before); |
| 866: if ($last_post_before === false || $last_post_before == -1) |
| 867: message($lang_admin_users['Invalid date/time message']); |
| 868: |
861: $conditions[] = 'u.last_post<'.$last_post_before; | 869: $conditions[] = 'u.last_post<'.$last_post_before; |
| 870: } |
862: if ($registered_after != '') | 871: if ($registered_after != '') |
| 872: { |
| 873: $query_str[] = 'registered_after='.$registered_after; |
| 874: |
| 875: $registered_after = strtotime($registered_after); |
| 876: if ($registered_after === false || $registered_after == -1) |
| 877: message($lang_admin_users['Invalid date/time message']); |
| 878: |
863: $conditions[] = 'u.registered>'.$registered_after; | 879: $conditions[] = 'u.registered>'.$registered_after; |
| 880: } |
864: if ($registered_before != '') | 881: if ($registered_before != '') |
| 882: { |
| 883: $query_str[] = 'registered_before='.$registered_before; |
| 884: |
| 885: $registered_before = strtotime($registered_before); |
| 886: if ($registered_before === false || $registered_before == -1) |
| 887: message($lang_admin_users['Invalid date/time message']); |
| 888: |
865: $conditions[] = 'u.registered<'.$registered_before; | 889: $conditions[] = 'u.registered<'.$registered_before; |
| 890: } |
866: | 891: |
867: $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE'; | 892: $like_command = ($db_type == 'pgsql') ? 'ILIKE' : 'LIKE'; |
868: foreach ($form as $key => $input) | 893: foreach ($form as $key => $input) |
869: { | 894: { |
870: if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note'))) | 895: if ($input != '' && in_array($key, array('username', 'email', 'title', 'realname', 'url', 'jabber', 'icq', 'msn', 'aim', 'yahoo', 'location', 'signature', 'admin_note'))) |
| 896: { |
871: $conditions[] = 'u.'.$forum_db->escape($key).' '.$like_command.' \''.$forum_db->escape(str_replace('*', '%', $input)).'\''; | 897: $conditions[] = 'u.'.$forum_db->escape($key).' '.$like_command.' \''.$forum_db->escape(str_replace('*', '%', $input)).'\''; |
| 898: $query_str[] = 'form%5B'.$key.'%5D='.urlencode($input); |
| 899: } |
872: } | 900: } |
873: | 901: |
874: if ($posts_greater != '') | 902: if ($posts_greater != '') |
| 903: { |
| 904: $query_str[] = 'posts_greater='.$posts_greater; |
875: $conditions[] = 'u.num_posts>'.$posts_greater; | 905: $conditions[] = 'u.num_posts>'.$posts_greater; |
| 906: } |
876: if ($posts_less != '') | 907: if ($posts_less != '') |
| 908: { |
| 909: $query_str[] = 'posts_less='.$posts_less; |
877: $conditions[] = 'u.num_posts<'.$posts_less; | 910: $conditions[] = 'u.num_posts<'.$posts_less; |
| 911: } |
878: | 912: |
879: if ($user_group != 'all') | 913: if ($user_group > -1) |
880: $conditions[] = 'u.group_id='.intval($user_group); | 914: $conditions[] = 'u.group_id='.intval($user_group); |
881: | 915: |
882: if (empty($conditions)) | 916: if (empty($conditions)) |
883: message($lang_admin_users['No search terms message']); | 917: message($lang_admin_users['No search terms message']); |
884: | 918: |
885: | |
886: // Load the misc.php language file | 919: // Load the misc.php language file |
887: require FORUM_ROOT.'lang/'.$forum_user['language'].'/misc.php'; | 920: require FORUM_ROOT.'lang/'.$forum_user['language'].'/misc.php'; |
888: | 921: |
889: // Find any users matching the conditions | 922: // Fetch user count |
890: $query = array( | 923: $query = array( |
891: 'SELECT' => 'u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title', | 924: 'SELECT' => 'COUNT(id)', |
892: 'FROM' => 'users AS u', | 925: 'FROM' => 'users AS u', |
893: 'JOINS' => array( | 926: 'JOINS' => array( |
894: array( | 927: array( |
896: 'ON' => 'g.g_id=u.group_id' | 929: 'ON' => 'g.g_id=u.group_id' |
897: ) | 930: ) |
898: ), | 931: ), |
899: 'WHERE' => 'u.id>1 AND '.implode(' AND ', $conditions), | 932: 'WHERE' => 'u.id>1 AND '.implode(' AND ', $conditions) |
900: 'ORDER BY' => $order_by.' '.$direction | |
901: ); | 933: ); |
902: | 934: |
903: ($hook = get_hook('aus_find_user_qr_find_users')) ? eval($hook) : null; | 935: ($hook = get_hook('aus_find_user_qr_count_find_users')) ? eval($hook) : null; |
904: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); | |
905: $forum_page['num_users'] = $forum_db->num_rows($result); | |
906: | 936: |
| 937: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
| 938: $forum_page['num_users'] = $forum_db->result($result); |
| 939: $forum_page['num_pages'] = ceil($forum_page['num_users'] / $forum_user['disp_topics']); |
| 940: $forum_page['page'] = (!isset($_GET['p']) || !is_numeric($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $forum_page['num_pages']) ? 1 : $_GET['p']; |
| 941: $forum_page['start_from'] = $forum_user['disp_topics'] * ($forum_page['page'] - 1); |
| 942: $forum_page['finish_at'] = min(($forum_page['start_from'] + $forum_user['disp_topics']), ($forum_page['num_users'])); |
907: | 943: |
908: // Setup breadcrumbs | 944: // Setup breadcrumbs |
909: $forum_page['crumbs'] = array( | 945: $forum_page['crumbs'] = array( |
915: $forum_page['crumbs'][] = array($lang_admin_common['Searches'], forum_link($forum_url['admin_users'])); | 951: $forum_page['crumbs'][] = array($lang_admin_common['Searches'], forum_link($forum_url['admin_users'])); |
916: $forum_page['crumbs'][] = $lang_admin_users['User search results']; | 952: $forum_page['crumbs'][] = $lang_admin_users['User search results']; |
917: | 953: |
| 954: // Generate paging |
| 955: $forum_page['page_post']['paging'] = '<p class="paging"><span class="pages">'.$lang_common['Pages'].'</span> '.paginate($forum_page['num_pages'], $forum_page['page'], $forum_url['admin_users'].'?find_user=&'.implode('&', $query_str), $lang_common['Paging separator'], null, true).'</p>'; |
| 956: |
918: ($hook = get_hook('aus_find_user_pre_header_load')) ? eval($hook) : null; | 957: ($hook = get_hook('aus_find_user_pre_header_load')) ? eval($hook) : null; |
919: | 958: |
920: define('FORUM_PAGE_SECTION', 'users'); | 959: define('FORUM_PAGE_SECTION', 'users'); |
961: <tbody> | 1000: <tbody> |
962: <?php | 1001: <?php |
963: | 1002: |
| 1003: // Find any users matching the conditions |
| 1004: $query = array( |
| 1005: 'SELECT' => 'u.id, u.username, u.email, u.title, u.num_posts, u.admin_note, g.g_id, g.g_user_title', |
| 1006: 'FROM' => 'users AS u', |
| 1007: 'JOINS' => array( |
| 1008: array( |
| 1009: 'LEFT JOIN' => 'groups AS g', |
| 1010: 'ON' => 'g.g_id=u.group_id' |
| 1011: ) |
| 1012: ), |
| 1013: 'WHERE' => 'u.id>1 AND '.implode(' AND ', $conditions), |
| 1014: 'ORDER BY' => $order_by.' '.$direction, |
| 1015: 'LIMIT' => $forum_page['start_from'].', '.$forum_page['finish_at'] |
| 1016: ); |
| 1017: |
| 1018: ($hook = get_hook('aus_find_user_qr_find_users')) ? eval($hook) : null; |
| 1019: |
| 1020: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
| 1021: |
964: if ($forum_page['num_users'] > 0) | 1022: if ($forum_page['num_users'] > 0) |
965: { | 1023: { |
966: $forum_page['item_count'] = 0; | 1024: $forum_page['item_count'] = 0; |
1107: <h2 class="hn"><span><?php echo $lang_admin_users['Search head'] ?></span></h2> | 1165: <h2 class="hn"><span><?php echo $lang_admin_users['Search head'] ?></span></h2> |
1108: </div> | 1166: </div> |
1109: <div class="main-content main-frm"> | 1167: <div class="main-content main-frm"> |
1110: <form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo forum_link($forum_url['admin_users']) ?>?action=find_user"> | 1168: <form class="frm-form" method="get" accept-charset="utf-8" action="<?php echo forum_link($forum_url['admin_users']) ?>"> |
1111: <div class="hidden"> | 1169: <div class="hidden"> |
1112: <input type="hidden" name="csrf_token" value="<?php echo generate_form_token(forum_link($forum_url['admin_users']).'?action=find_user') ?>" /> | 1170: <input type="hidden" name="csrf_token" value="<?php echo generate_form_token(forum_link($forum_url['admin_users']).'?action=find_user') ?>" /> |
1113: </div> | 1171: </div> |
1121: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1179: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1122: <div class="sf-box text"> | 1180: <div class="sf-box text"> |
1123: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Username label'] ?></span></label><br /> | 1181: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Username label'] ?></span></label><br /> |
1124: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="username" size="25" maxlength="25" /></span> | 1182: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[username]" size="35" maxlength="25" /></span> |
1125: </div> | 1183: </div> |
1126: </div> | 1184: </div> |
1127: <?php ($hook = get_hook('aus_search_form_pre_user_title')) ? eval($hook) : null; ?> | 1185: <?php ($hook = get_hook('aus_search_form_pre_user_title')) ? eval($hook) : null; ?> |
1128: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1186: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1129: <div class="sf-box text"> | 1187: <div class="sf-box text"> |
1130: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Title label'] ?></span></label><br /> | 1188: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Title label'] ?></span></label><br /> |
1131: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[title]" size="30" maxlength="50" /></span> | 1189: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[title]" size="35" maxlength="50" /></span> |
1132: </div> | 1190: </div> |
1133: </div> | 1191: </div> |
1134: <?php ($hook = get_hook('aus_search_form_pre_realname')) ? eval($hook) : null; ?> | 1192: <?php ($hook = get_hook('aus_search_form_pre_realname')) ? eval($hook) : null; ?> |
1135: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1193: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1136: <div class="sf-box text"> | 1194: <div class="sf-box text"> |
1137: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Real name label'] ?></span></label><br /> | 1195: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Real name label'] ?></span></label><br /> |
1138: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[realname]" size="30" maxlength="40" /></span> | 1196: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[realname]" size="35" maxlength="40" /></span> |
1139: </div> | 1197: </div> |
1140: </div> | 1198: </div> |
1141: <?php ($hook = get_hook('aus_search_form_pre_location')) ? eval($hook) : null; ?> | 1199: <?php ($hook = get_hook('aus_search_form_pre_location')) ? eval($hook) : null; ?> |
1142: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1200: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1143: <div class="sf-box text"> | 1201: <div class="sf-box text"> |
1144: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Location label'] ?></span></label><br /> | 1202: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Location label'] ?></span></label><br /> |
1145: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[location]" size="30" maxlength="30" /></span> | 1203: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[location]" size="35" maxlength="30" /></span> |
1146: </div> | 1204: </div> |
1147: </div> | 1205: </div> |
1148: <?php ($hook = get_hook('aus_search_form_pre_signature')) ? eval($hook) : null; ?> | 1206: <?php ($hook = get_hook('aus_search_form_pre_signature')) ? eval($hook) : null; ?> |
1156: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1214: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1157: <div class="sf-box text"> | 1215: <div class="sf-box text"> |
1158: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Admin note label'] ?></span></label><br /> | 1216: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Admin note label'] ?></span></label><br /> |
1159: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[admin_note]" size="30" maxlength="30" /></span> | 1217: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[admin_note]" size="35" maxlength="30" /></span> |
1160: </div> | 1218: </div> |
1161: </div> | 1219: </div> |
1162: <?php ($hook = get_hook('aus_search_form_pre_user_details_fieldset_end')) ? eval($hook) : null; ?> | 1220: <?php ($hook = get_hook('aus_search_form_pre_user_details_fieldset_end')) ? eval($hook) : null; ?> |
1170: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1228: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1171: <div class="sf-box text"> | 1229: <div class="sf-box text"> |
1172: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['E-mail address label'] ?></span></label><br /> | 1230: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['E-mail address label'] ?></span></label><br /> |
1173: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[email]" size="30" maxlength="80" /></span> | 1231: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[email]" size="35" maxlength="80" /></span> |
1174: </div> | 1232: </div> |
1175: </div> | 1233: </div> |
1176: <?php ($hook = get_hook('aus_search_form_pre_website')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1234: <?php ($hook = get_hook('aus_search_form_pre_website')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1182: <?php ($hook = get_hook('aus_search_form_pre_jabber')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1240: <?php ($hook = get_hook('aus_search_form_pre_jabber')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1183: <div class="sf-box text"> | 1241: <div class="sf-box text"> |
1184: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Jabber label'] ?></span></label><br /> | 1242: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['Jabber label'] ?></span></label><br /> |
1185: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[jabber]" size="30" maxlength="80" /></span> | 1243: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[jabber]" size="35" maxlength="80" /></span> |
1186: </div> | 1244: </div> |
1187: </div> | 1245: </div> |
1188: <?php ($hook = get_hook('aus_search_form_pre_icq')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1246: <?php ($hook = get_hook('aus_search_form_pre_icq')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1194: <?php ($hook = get_hook('aus_search_form_pre_msn')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1252: <?php ($hook = get_hook('aus_search_form_pre_msn')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1195: <div class="sf-box text"> | 1253: <div class="sf-box text"> |
1196: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['MSN Messenger label'] ?></span></label><br /> | 1254: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['MSN Messenger label'] ?></span></label><br /> |
1197: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[msn]" size="30" maxlength="80" /></span> | 1255: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[msn]" size="35" maxlength="80" /></span> |
1198: </div> | 1256: </div> |
1199: </div> | 1257: </div> |
1200: <?php ($hook = get_hook('aus_search_form_pre_aim')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1258: <?php ($hook = get_hook('aus_search_form_pre_aim')) ? eval($hook) : null; ?> <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1303: <div class="sf-box select"> | 1361: <div class="sf-box select"> |
1304: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['User group label'] ?></span></label><br /> | 1362: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_admin_users['User group label'] ?></span></label><br /> |
1305: <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="user_group"> | 1363: <span class="fld-input"><select id="fld<?php echo $forum_page['fld_count'] ?>" name="user_group"> |
1306: <option value="all" selected="selected"><?php echo $lang_admin_users['All groups'] ?></option> | 1364: <option value="-1" selected="selected"><?php echo $lang_admin_users['All groups'] ?></option> |
1307: <option value="<?php echo FORUM_UNVERIFIED ?>"><?php echo $lang_admin_users['Unverified users'] ?></option> | 1365: <option value="<?php echo FORUM_UNVERIFIED ?>"><?php echo $lang_admin_users['Unverified users'] ?></option> |
1308: <?php | 1366: <?php |
1309: | 1367: |
punbb-1.3.3/extern.php |
punbb-1.3.6/extern.php |
128: echo "\t\t\t".'<title><![CDATA['.escape_cdata($item['title']).']]></title>'."\n"; | 128: echo "\t\t\t".'<title><![CDATA['.escape_cdata($item['title']).']]></title>'."\n"; |
129: echo "\t\t\t".'<link>'.$item['link'].'</link>'."\n"; | 129: echo "\t\t\t".'<link>'.$item['link'].'</link>'."\n"; |
130: echo "\t\t\t".'<description><![CDATA['.escape_cdata($item['description']).']]></description>'."\n"; | 130: echo "\t\t\t".'<description><![CDATA['.escape_cdata($item['description']).']]></description>'."\n"; |
131: echo "\t\t\t".'<author><![CDATA['.(isset($item['author']['email']) ? escape_cdata($item['author']['email']) : 'dummy@example.com').' ('.escape_cdata($item['author']['name']).')]]></author>'."\n"; | 131: echo "\t\t\t".'<author><![CDATA['.(isset($item['author']['email']) ? escape_cdata($item['author']['email']) : 'null@example.com').' ('.escape_cdata($item['author']['name']).')]]></author>'."\n"; |
132: echo "\t\t\t".'<pubDate>'.gmdate('r', $item['pubdate']).'</pubDate>'."\n"; | 132: echo "\t\t\t".'<pubDate>'.gmdate('r', $item['pubdate']).'</pubDate>'."\n"; |
133: echo "\t\t\t".'<guid>'.$item['link'].'</guid>'."\n"; | 133: echo "\t\t\t".'<guid>'.$item['link'].'</guid>'."\n"; |
134: | 134: |
335: 'JOINS' => array( | 335: 'JOINS' => array( |
336: array( | 336: array( |
337: 'INNER JOIN' => 'users AS u', | 337: 'INNER JOIN' => 'users AS u', |
338: 'ON' => 'u.id = p.poster_id' | 338: 'ON' => 'u.id = p.poster_id' |
339: ) | 339: ) |
340: ), | 340: ), |
341: 'WHERE' => 'p.topic_id='.$tid, | 341: 'WHERE' => 'p.topic_id='.$tid, |
342: 'ORDER BY' => 'p.posted DESC', | 342: 'ORDER BY' => 'p.posted DESC', |
343: 'LIMIT' => $show | 343: 'LIMIT' => $show |
344: ); | 344: ); |
345: | |
346: ($hook = get_hook('ex_qr_get_posts')) ? eval($hook) : null; | 345: ($hook = get_hook('ex_qr_get_posts')) ? eval($hook) : null; |
347: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); | 346: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
| 347: |
348: while ($cur_post = $forum_db->fetch_assoc($result)) | 348: while ($cur_post = $forum_db->fetch_assoc($result)) |
349: { | 349: { |
350: if ($forum_config['o_censoring'] == '1') | 350: if ($forum_config['o_censoring'] == '1') |
401: | 401: |
402: if (count($fids) == 1) | 402: if (count($fids) == 1) |
403: { | 403: { |
404: // Fetch forum name | 404: // Fetch forum name |
405: $query = array( | 405: $query = array( |
406: 'SELECT' => 'f.forum_name', | 406: 'SELECT' => 'f.forum_name', |
407: 'FROM' => 'forums AS f', | 407: 'FROM' => 'forums AS f', |
408: 'JOINS' => array( | 408: 'JOINS' => array( |
409: array( | 409: array( |
410: 'LEFT JOIN' => 'forum_perms AS fp', | 410: 'LEFT JOIN' => 'forum_perms AS fp', |
411: 'ON' => '(fp.forum_id=f.id AND fp.group_id='.$forum_user['g_id'].')' | 411: 'ON' => '(fp.forum_id=f.id AND fp.group_id='.$forum_user['g_id'].')' |
412: ) | 412: ) |
413: ), | 413: ), |
414: 'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fids[0] | 414: 'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1) AND f.id='.$fids[0] |
415: ); | 415: ); |
416: | 416: |
417: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); | 417: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
418: if ($forum_db->num_rows($result)) | 418: if ($forum_db->num_rows($result)) |
419: $forum_name = $lang_common['Title separator'].$forum_db->result($result); | 419: $forum_name = $lang_common['Title separator'].$forum_db->result($result); |
420: } | 420: } |
421: } | 421: } |
422: | 422: |
441: | 441: |
442: // Fetch $show topics | 442: // Fetch $show topics |
443: $query = array( | 443: $query = array( |
444: 'SELECT' => 't.id, t.poster, t.subject, t.last_post, t.last_poster, p.message, p.hide_smilies, u.email_setting, u.email, p.poster_id, p.poster_email', | 444: 'SELECT' => 't.id, t.poster, t.posted, t.subject, p.message, p.hide_smilies, u.email_setting, u.email, p.poster_id, p.poster_email', |
445: 'FROM' => 'topics AS t', | 445: 'FROM' => 'topics AS t', |
446: 'JOINS' => array( | 446: 'JOINS' => array( |
447: array( | 447: array( |
448: 'INNER JOIN' => 'posts AS p', | 448: 'INNER JOIN' => 'posts AS p', |
449: 'ON' => 'p.id=t.first_post_id' | 449: 'ON' => 'p.id = t.first_post_id' |
450: ), | 450: ), |
451: array( | 451: array( |
452: 'INNER JOIN' => 'users AS u', | 452: 'INNER JOIN' => 'users AS u', |
453: 'ON' => 'u.id = p.poster_id' | 453: 'ON' => 'u.id = p.poster_id' |
454: ), | 454: ), |
455: array( | 455: array( |
456: 'LEFT JOIN' => 'forum_perms AS fp', | 456: 'LEFT JOIN' => 'forum_perms AS fp', |
457: 'ON' => '(fp.forum_id=t.forum_id AND fp.group_id='.$forum_user['g_id'].')' | 457: 'ON' => '(fp.forum_id = t.forum_id AND fp.group_id = '.$forum_user['g_id'].')' |
458: ) | 458: ) |
459: ), | 459: ), |
460: 'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL', | 460: 'WHERE' => '(fp.read_forum IS NULL OR fp.read_forum = 1) AND t.moved_to IS NULL', |
461: 'ORDER BY' => 't.last_post DESC', | 461: 'ORDER BY' => 't.posted DESC', |
462: 'LIMIT' => $show | 462: 'LIMIT' => $show |
463: ); | 463: ); |
464: | 464: |
483: 'link' => forum_link($forum_url['topic_new_posts'], array($cur_topic['id'], sef_friendly($cur_topic['subject']))), | 483: 'link' => forum_link($forum_url['topic_new_posts'], array($cur_topic['id'], sef_friendly($cur_topic['subject']))), |
484: 'description' => $cur_topic['message'], | 484: 'description' => $cur_topic['message'], |
485: 'author' => array( | 485: 'author' => array( |
486: 'name' => $cur_topic['last_poster'] | 486: 'name' => $cur_topic['poster'] |
487: ), | 487: ), |
488: 'pubdate' => $cur_topic['last_post'] | 488: 'pubdate' => $cur_topic['posted'] |
489: ); | 489: ); |
490: | 490: |
491: if ($cur_topic['poster_id'] > 1) | 491: if ($cur_topic['poster_id'] > 1) |
punbb-1.3.3/include/dblayer/mysqli_innodb.php |
punbb-1.3.6/include/dblayer/mysqli_innodb.php |
| 1: <?php |
| 2: /** |
| 3: * A database layer class supporting transactions that relies on the MySQLi PHP extension. |
| 4: * |
| 5: * @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org |
| 6: * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher |
| 7: * @package PunBB |
| 8: */ |
| 9: |
| 10: |
| 11: // Make sure we have built in support for MySQL |
| 12: if (!function_exists('mysqli_connect')) |
| 13: exit('This PHP environment doesn\'t have Improved MySQL (mysqli) support built in. Improved MySQL support is required if you want to use a MySQL 4.1 (or later) database to run this forum. Consult the PHP documentation for further assistance.'); |
| 14: |
| 15: |
| 16: class DBLayer |
| 17: { |
| 18: var $prefix; |
| 19: var $link_id; |
| 20: var $query_result; |
| 21: |
| 22: var $saved_queries = array(); |
| 23: var $num_queries = 0; |
| 24: var $in_transaction = 0; |
| 25: |
| 26: var $datatype_transformations = array( |
| 27: '/^SERIAL$/' => 'INT(10) UNSIGNED AUTO_INCREMENT' |
| 28: ); |
| 29: |
| 30: |
| 31: function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $foo) |
| 32: { |
| 33: $this->prefix = $db_prefix; |
| 34: |
| 35: // Was a custom port supplied with $db_host? |
| 36: if (strpos($db_host, ':') !== false) |
| 37: list($db_host, $db_port) = explode(':', $db_host); |
| 38: |
| 39: if (isset($db_port)) |
| 40: $this->link_id = @mysqli_connect($db_host, $db_username, $db_password, $db_name, $db_port); |
| 41: else |
| 42: $this->link_id = @mysqli_connect($db_host, $db_username, $db_password, $db_name); |
| 43: |
| 44: if (!$this->link_id) |
| 45: error('Unable to connect to MySQL and select database. MySQL reported: '.mysqli_connect_error(), __FILE__, __LINE__); |
| 46: |
| 47: // Setup the client-server character set (UTF-8) |
| 48: if (!defined('FORUM_NO_SET_NAMES')) |
| 49: $this->set_names('utf8'); |
| 50: |
| 51: return $this->link_id; |
| 52: } |
| 53: |
| 54: |
| 55: function start_transaction() |
| 56: { |
| 57: ++$this->in_transaction; |
| 58: |
| 59: mysqli_query($this->link_id, 'START TRANSACTION'); |
| 60: return; |
| 61: } |
| 62: |
| 63: |
| 64: function end_transaction() |
| 65: { |
| 66: --$this->in_transaction; |
| 67: |
| 68: mysqli_query($this->link_id, 'COMMIT'); |
| 69: return; |
| 70: } |
| 71: |
| 72: |
| 73: function query($sql, $unbuffered = false) |
| 74: { |
| 75: if (strlen($sql) > 140000) |
| 76: exit('Insane query. Aborting.'); |
| 77: |
| 78: if (defined('FORUM_SHOW_QUERIES')) |
| 79: $q_start = get_microtime(); |
| 80: |
| 81: $this->query_result = @mysqli_query($this->link_id, $sql); |
| 82: |
| 83: if ($this->query_result) |
| 84: { |
| 85: if (defined('FORUM_SHOW_QUERIES')) |
| 86: $this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start)); |
| 87: |
| 88: ++$this->num_queries; |
| 89: |
| 90: return $this->query_result; |
| 91: } |
| 92: else |
| 93: { |
| 94: if (defined('FORUM_SHOW_QUERIES')) |
| 95: $this->saved_queries[] = array($sql, 0); |
| 96: |
| 97: // Rollback transaction |
| 98: if ($this->in_transaction) |
| 99: mysqli_query($this->link_id, 'ROLLBACK'); |
| 100: |
| 101: --$this->in_transaction; |
| 102: |
| 103: return false; |
| 104: } |
| 105: } |
| 106: |
| 107: |
| 108: function result($query_id = 0, $row = 0, $col = 0) |
| 109: { |
| 110: if ($query_id) |
| 111: { |
| 112: if ($row) |
| 113: @mysqli_data_seek($query_id, $row); |
| 114: |
| 115: $cur_row = @mysqli_fetch_row($query_id); |
| 116: return $cur_row[$col]; |
| 117: } |
| 118: else |
| 119: return false; |
| 120: } |
| 121: |
| 122: |
| 123: function fetch_assoc($query_id = 0) |
| 124: { |
| 125: return ($query_id) ? @mysqli_fetch_assoc($query_id) : false; |
| 126: } |
| 127: |
| 128: |
| 129: function fetch_row($query_id = 0) |
| 130: { |
| 131: return ($query_id) ? @mysqli_fetch_row($query_id) : false; |
| 132: } |
| 133: |
| 134: |
| 135: function num_rows($query_id = 0) |
| 136: { |
| 137: return ($query_id) ? @mysqli_num_rows($query_id) : false; |
| 138: } |
| 139: |
| 140: |
| 141: function affected_rows() |
| 142: { |
| 143: return ($this->link_id) ? @mysqli_affected_rows($this->link_id) : false; |
| 144: } |
| 145: |
| 146: |
| 147: function insert_id() |
| 148: { |
| 149: return ($this->link_id) ? @mysqli_insert_id($this->link_id) : false; |
| 150: } |
| 151: |
| 152: |
| 153: function get_num_queries() |
| 154: { |
| 155: return $this->num_queries; |
| 156: } |
| 157: |
| 158: |
| 159: function get_saved_queries() |
| 160: { |
| 161: return $this->saved_queries; |
| 162: } |
| 163: |
| 164: |
| 165: function free_result($query_id = false) |
| 166: { |
| 167: return ($query_id) ? @mysqli_free_result($query_id) : false; |
| 168: } |
| 169: |
| 170: |
| 171: function escape($str) |
| 172: { |
| 173: return is_array($str) ? '' : mysqli_real_escape_string($this->link_id, $str); |
| 174: } |
| 175: |
| 176: |
| 177: function error() |
| 178: { |
| 179: $result['error_sql'] = @current(@end($this->saved_queries)); |
| 180: $result['error_no'] = @mysqli_errno($this->link_id); |
| 181: $result['error_msg'] = @mysqli_error($this->link_id); |
| 182: |
| 183: return $result; |
| 184: } |
| 185: |
| 186: |
| 187: function close() |
| 188: { |
| 189: if ($this->link_id) |
| 190: { |
| 191: if ($this->query_result) |
| 192: @mysqli_free_result($this->query_result); |
| 193: |
| 194: return @mysqli_close($this->link_id); |
| 195: } |
| 196: else |
| 197: return false; |
| 198: } |
| 199: |
| 200: |
| 201: function set_names($names) |
| 202: { |
| 203: return $this->query('SET NAMES \''.$this->escape($names).'\''); |
| 204: } |
| 205: |
| 206: |
| 207: function get_version() |
| 208: { |
| 209: $result = $this->query('SELECT VERSION()'); |
| 210: |
| 211: return array( |
| 212: 'name' => 'MySQL Improved (InnoDB)', |
| 213: 'version' => preg_replace('/^([^-]+).*$/', '\\1', $this->result($result)) |
| 214: ); |
| 215: } |
| 216: |
| 217: |
| 218: function table_exists($table_name, $no_prefix = false) |
| 219: { |
| 220: $result = $this->query('SHOW TABLES LIKE \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\''); |
| 221: return $this->num_rows($result) > 0; |
| 222: } |
| 223: |
| 224: |
| 225: function field_exists($table_name, $field_name, $no_prefix = false) |
| 226: { |
| 227: $result = $this->query('SHOW COLUMNS FROM '.($no_prefix ? '' : $this->prefix).$table_name.' LIKE \''.$this->escape($field_name).'\''); |
| 228: return $this->num_rows($result) > 0; |
| 229: } |
| 230: |
| 231: |
| 232: function index_exists($table_name, $index_name, $no_prefix = false) |
| 233: { |
| 234: $exists = false; |
| 235: |
| 236: $result = $this->query('SHOW INDEX FROM '.($no_prefix ? '' : $this->prefix).$table_name); |
| 237: while ($cur_index = $this->fetch_assoc($result)) |
| 238: { |
| 239: if ($cur_index['Key_name'] == ($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) |
| 240: { |
| 241: $exists = true; |
| 242: break; |
| 243: } |
| 244: } |
| 245: |
| 246: return $exists; |
| 247: } |
| 248: |
| 249: |
| 250: function create_table($table_name, $schema, $no_prefix = false) |
| 251: { |
| 252: if ($this->table_exists($table_name, $no_prefix)) |
| 253: return; |
| 254: |
| 255: $query = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name." (\n"; |
| 256: |
| 257: // Go through every schema element and add it to the query |
| 258: foreach ($schema['FIELDS'] as $field_name => $field_data) |
| 259: { |
| 260: $field_data['datatype'] = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_data['datatype']); |
| 261: |
| 262: $query .= $field_name.' '.$field_data['datatype']; |
| 263: |
| 264: if (isset($field_data['collation'])) |
| 265: $query .= 'CHARACTER SET utf8 COLLATE utf8_'.$field_data['collation']; |
| 266: |
| 267: if (!$field_data['allow_null']) |
| 268: $query .= ' NOT NULL'; |
| 269: |
| 270: if (isset($field_data['default'])) |
| 271: $query .= ' DEFAULT '.$field_data['default']; |
| 272: |
| 273: $query .= ",\n"; |
| 274: } |
| 275: |
| 276: // If we have a primary key, add it |
| 277: if (isset($schema['PRIMARY KEY'])) |
| 278: $query .= 'PRIMARY KEY ('.implode(',', $schema['PRIMARY KEY']).'),'."\n"; |
| 279: |
| 280: // Add unique keys |
| 281: if (isset($schema['UNIQUE KEYS'])) |
| 282: { |
| 283: foreach ($schema['UNIQUE KEYS'] as $key_name => $key_fields) |
| 284: $query .= 'UNIQUE KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$key_name.'('.implode(',', $key_fields).'),'."\n"; |
| 285: } |
| 286: |
| 287: // Add indexes |
| 288: if (isset($schema['INDEXES'])) |
| 289: { |
| 290: foreach ($schema['INDEXES'] as $index_name => $index_fields) |
| 291: $query .= 'KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.'('.implode(',', $index_fields).'),'."\n"; |
| 292: } |
| 293: |
| 294: // We remove the last two characters (a newline and a comma) and add on the ending |
| 295: $query = substr($query, 0, strlen($query) - 2)."\n".') ENGINE = '.(isset($schema['ENGINE']) ? $schema['ENGINE'] : 'InnoDB').' CHARACTER SET utf8'; |
| 296: |
| 297: $this->query($query) or error(__FILE__, __LINE__); |
| 298: } |
| 299: |
| 300: |
| 301: function drop_table($table_name, $no_prefix = false) |
| 302: { |
| 303: if (!$this->table_exists($table_name, $no_prefix)) |
| 304: return; |
| 305: |
| 306: $this->query('DROP TABLE '.($no_prefix ? '' : $this->prefix).$table_name) or error(__FILE__, __LINE__); |
| 307: } |
| 308: |
| 309: |
| 310: function add_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false) |
| 311: { |
| 312: if ($this->field_exists($table_name, $field_name, $no_prefix)) |
| 313: return; |
| 314: |
| 315: $field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type); |
| 316: |
| 317: if ($default_value !== null && !is_int($default_value) && !is_float($default_value)) |
| 318: $default_value = '\''.$this->escape($default_value).'\''; |
| 319: |
| 320: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) or error(__FILE__, __LINE__); |
| 321: } |
| 322: |
| 323: |
| 324: function alter_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false) |
| 325: { |
| 326: if (!$this->field_exists($table_name, $field_name, $no_prefix)) |
| 327: return; |
| 328: |
| 329: $field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type); |
| 330: |
| 331: if ($default_value !== null && !is_int($default_value) && !is_float($default_value)) |
| 332: $default_value = '\''.$this->escape($default_value).'\''; |
| 333: |
| 334: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' MODIFY '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) or error(__FILE__, __LINE__); |
| 335: } |
| 336: |
| 337: |
| 338: function drop_field($table_name, $field_name, $no_prefix = false) |
| 339: { |
| 340: if (!$this->field_exists($table_name, $field_name, $no_prefix)) |
| 341: return; |
| 342: |
| 343: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP '.$field_name) or error(__FILE__, __LINE__); |
| 344: } |
| 345: |
| 346: |
| 347: function add_index($table_name, $index_name, $index_fields, $unique = false, $no_prefix = false) |
| 348: { |
| 349: if ($this->index_exists($table_name, $index_name, $no_prefix)) |
| 350: return; |
| 351: |
| 352: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.($unique ? 'UNIQUE ' : '').'INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.' ('.implode(',', $index_fields).')') or error(__FILE__, __LINE__); |
| 353: } |
| 354: |
| 355: |
| 356: function drop_index($table_name, $index_name, $no_prefix = false) |
| 357: { |
| 358: if (!$this->index_exists($table_name, $index_name, $no_prefix)) |
| 359: return; |
| 360: |
| 361: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) or error(__FILE__, __LINE__); |
| 362: } |
| 363: } |
punbb-1.3.3/include/dblayer/mysql_innodb.php |
punbb-1.3.6/include/dblayer/mysql_innodb.php |
| 1: <?php |
| 2: /** |
| 3: * A database layer class supporting transactions that relies on the MySQL PHP extension. |
| 4: * |
| 5: * @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org |
| 6: * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher |
| 7: * @package PunBB |
| 8: */ |
| 9: |
| 10: |
| 11: // Make sure we have built in support for MySQL |
| 12: if (!function_exists('mysql_connect')) |
| 13: exit('This PHP environment doesn\'t have MySQL support built in. MySQL support is required if you want to use a MySQL database to run this forum. Consult the PHP documentation for further assistance.'); |
| 14: |
| 15: |
| 16: class DBLayer |
| 17: { |
| 18: var $prefix; |
| 19: var $link_id; |
| 20: var $query_result; |
| 21: var $in_transaction = 0; |
| 22: |
| 23: var $saved_queries = array(); |
| 24: var $num_queries = 0; |
| 25: |
| 26: var $datatype_transformations = array( |
| 27: '/^SERIAL$/' => 'INT(10) UNSIGNED AUTO_INCREMENT' |
| 28: ); |
| 29: |
| 30: |
| 31: function DBLayer($db_host, $db_username, $db_password, $db_name, $db_prefix, $p_connect) |
| 32: { |
| 33: $this->prefix = $db_prefix; |
| 34: |
| 35: if ($p_connect) |
| 36: $this->link_id = @mysql_pconnect($db_host, $db_username, $db_password); |
| 37: else |
| 38: $this->link_id = @mysql_connect($db_host, $db_username, $db_password); |
| 39: |
| 40: if ($this->link_id) |
| 41: { |
| 42: if (!@mysql_select_db($db_name, $this->link_id)) |
| 43: error('Unable to select database. MySQL reported: '.mysql_error(), __FILE__, __LINE__); |
| 44: } |
| 45: else |
| 46: error('Unable to connect to MySQL server. MySQL reported: '.mysql_error(), __FILE__, __LINE__); |
| 47: |
| 48: // Setup the client-server character set (UTF-8) |
| 49: if (!defined('FORUM_NO_SET_NAMES')) |
| 50: $this->set_names('utf8'); |
| 51: |
| 52: return $this->link_id; |
| 53: } |
| 54: |
| 55: |
| 56: function start_transaction() |
| 57: { |
| 58: ++$this->in_transaction; |
| 59: |
| 60: mysql_query('START TRANSACTION', $this->link_id); |
| 61: return; |
| 62: } |
| 63: |
| 64: |
| 65: function end_transaction() |
| 66: { |
| 67: --$this->in_transaction; |
| 68: |
| 69: mysql_query('COMMIT', $this->link_id); |
| 70: return; |
| 71: } |
| 72: |
| 73: |
| 74: function query($sql, $unbuffered = false) |
| 75: { |
| 76: if (strlen($sql) > 140000) |
| 77: exit('Insane query. Aborting.'); |
| 78: |
| 79: if (defined('FORUM_SHOW_QUERIES')) |
| 80: $q_start = get_microtime(); |
| 81: |
| 82: if ($unbuffered) |
| 83: $this->query_result = @mysql_unbuffered_query($sql, $this->link_id); |
| 84: else |
| 85: $this->query_result = @mysql_query($sql, $this->link_id); |
| 86: |
| 87: if ($this->query_result) |
| 88: { |
| 89: if (defined('FORUM_SHOW_QUERIES')) |
| 90: $this->saved_queries[] = array($sql, sprintf('%.5f', get_microtime() - $q_start)); |
| 91: |
| 92: ++$this->num_queries; |
| 93: |
| 94: return $this->query_result; |
| 95: } |
| 96: else |
| 97: { |
| 98: if (defined('FORUM_SHOW_QUERIES')) |
| 99: $this->saved_queries[] = array($sql, 0); |
| 100: |
| 101: // Rollback transaction |
| 102: if ($this->in_transaction) |
| 103: mysql_query('ROLLBACK', $this->link_id); |
| 104: |
| 105: --$this->in_transaction; |
| 106: |
| 107: return false; |
| 108: } |
| 109: } |
| 110: |
| 111: |
| 112: function result($query_id = 0, $row = 0, $col = 0) |
| 113: { |
| 114: return ($query_id) ? @mysql_result($query_id, $row, $col) : false; |
| 115: } |
| 116: |
| 117: |
| 118: function fetch_assoc($query_id = 0) |
| 119: { |
| 120: return ($query_id) ? @mysql_fetch_assoc($query_id) : false; |
| 121: } |
| 122: |
| 123: |
| 124: function fetch_row($query_id = 0) |
| 125: { |
| 126: return ($query_id) ? @mysql_fetch_row($query_id) : false; |
| 127: } |
| 128: |
| 129: |
| 130: function num_rows($query_id = 0) |
| 131: { |
| 132: return ($query_id) ? @mysql_num_rows($query_id) : false; |
| 133: } |
| 134: |
| 135: |
| 136: function affected_rows() |
| 137: { |
| 138: return ($this->link_id) ? @mysql_affected_rows($this->link_id) : false; |
| 139: } |
| 140: |
| 141: |
| 142: function insert_id() |
| 143: { |
| 144: return ($this->link_id) ? @mysql_insert_id($this->link_id) : false; |
| 145: } |
| 146: |
| 147: |
| 148: function get_num_queries() |
| 149: { |
| 150: return $this->num_queries; |
| 151: } |
| 152: |
| 153: |
| 154: function get_saved_queries() |
| 155: { |
| 156: return $this->saved_queries; |
| 157: } |
| 158: |
| 159: |
| 160: function free_result($query_id = false) |
| 161: { |
| 162: return ($query_id) ? @mysql_free_result($query_id) : false; |
| 163: } |
| 164: |
| 165: |
| 166: function escape($str) |
| 167: { |
| 168: if (is_array($str)) |
| 169: return ''; |
| 170: else if (function_exists('mysql_real_escape_string')) |
| 171: return mysql_real_escape_string($str, $this->link_id); |
| 172: else |
| 173: return mysql_escape_string($str); |
| 174: } |
| 175: |
| 176: |
| 177: function error() |
| 178: { |
| 179: $result['error_sql'] = @current(@end($this->saved_queries)); |
| 180: $result['error_no'] = @mysql_errno($this->link_id); |
| 181: $result['error_msg'] = @mysql_error($this->link_id); |
| 182: |
| 183: return $result; |
| 184: } |
| 185: |
| 186: |
| 187: function close() |
| 188: { |
| 189: if ($this->link_id) |
| 190: { |
| 191: if ($this->query_result) |
| 192: @mysql_free_result($this->query_result); |
| 193: |
| 194: return @mysql_close($this->link_id); |
| 195: } |
| 196: else |
| 197: return false; |
| 198: } |
| 199: |
| 200: |
| 201: function set_names($names) |
| 202: { |
| 203: return $this->query('SET NAMES \''.$this->escape($names).'\''); |
| 204: } |
| 205: |
| 206: |
| 207: function get_version() |
| 208: { |
| 209: $result = $this->query('SELECT VERSION()'); |
| 210: |
| 211: return array( |
| 212: 'name' => 'MySQL Standard (InnoDB)', |
| 213: 'version' => preg_replace('/^([^-]+).*$/', '\\1', $this->result($result)) |
| 214: ); |
| 215: } |
| 216: |
| 217: |
| 218: function table_exists($table_name, $no_prefix = false) |
| 219: { |
| 220: $result = $this->query('SHOW TABLES LIKE \''.($no_prefix ? '' : $this->prefix).$this->escape($table_name).'\''); |
| 221: return $this->num_rows($result) > 0; |
| 222: } |
| 223: |
| 224: |
| 225: function field_exists($table_name, $field_name, $no_prefix = false) |
| 226: { |
| 227: $result = $this->query('SHOW COLUMNS FROM '.($no_prefix ? '' : $this->prefix).$table_name.' LIKE \''.$this->escape($field_name).'\''); |
| 228: return $this->num_rows($result) > 0; |
| 229: } |
| 230: |
| 231: |
| 232: function index_exists($table_name, $index_name, $no_prefix = false) |
| 233: { |
| 234: $exists = false; |
| 235: |
| 236: $result = $this->query('SHOW INDEX FROM '.($no_prefix ? '' : $this->prefix).$table_name); |
| 237: while ($cur_index = $this->fetch_assoc($result)) |
| 238: { |
| 239: if ($cur_index['Key_name'] == ($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) |
| 240: { |
| 241: $exists = true; |
| 242: break; |
| 243: } |
| 244: } |
| 245: |
| 246: return $exists; |
| 247: } |
| 248: |
| 249: |
| 250: function create_table($table_name, $schema, $no_prefix = false) |
| 251: { |
| 252: if ($this->table_exists($table_name, $no_prefix)) |
| 253: return; |
| 254: |
| 255: $query = 'CREATE TABLE '.($no_prefix ? '' : $this->prefix).$table_name." (\n"; |
| 256: |
| 257: // Go through every schema element and add it to the query |
| 258: foreach ($schema['FIELDS'] as $field_name => $field_data) |
| 259: { |
| 260: $field_data['datatype'] = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_data['datatype']); |
| 261: |
| 262: $query .= $field_name.' '.$field_data['datatype']; |
| 263: |
| 264: if (isset($field_data['collation'])) |
| 265: $query .= 'CHARACTER SET utf8 COLLATE utf8_'.$field_data['collation']; |
| 266: |
| 267: if (!$field_data['allow_null']) |
| 268: $query .= ' NOT NULL'; |
| 269: |
| 270: if (isset($field_data['default'])) |
| 271: $query .= ' DEFAULT '.$field_data['default']; |
| 272: |
| 273: $query .= ",\n"; |
| 274: } |
| 275: |
| 276: // If we have a primary key, add it |
| 277: if (isset($schema['PRIMARY KEY'])) |
| 278: $query .= 'PRIMARY KEY ('.implode(',', $schema['PRIMARY KEY']).'),'."\n"; |
| 279: |
| 280: // Add unique keys |
| 281: if (isset($schema['UNIQUE KEYS'])) |
| 282: { |
| 283: foreach ($schema['UNIQUE KEYS'] as $key_name => $key_fields) |
| 284: $query .= 'UNIQUE KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$key_name.'('.implode(',', $key_fields).'),'."\n"; |
| 285: } |
| 286: |
| 287: // Add indexes |
| 288: if (isset($schema['INDEXES'])) |
| 289: { |
| 290: foreach ($schema['INDEXES'] as $index_name => $index_fields) |
| 291: $query .= 'KEY '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.'('.implode(',', $index_fields).'),'."\n"; |
| 292: } |
| 293: |
| 294: // We remove the last two characters (a newline and a comma) and add on the ending |
| 295: $query = substr($query, 0, strlen($query) - 2)."\n".') ENGINE = '.(isset($schema['ENGINE']) ? $schema['ENGINE'] : 'InnoDB').' CHARACTER SET utf8'; |
| 296: |
| 297: $this->query($query) or error(__FILE__, __LINE__); |
| 298: } |
| 299: |
| 300: |
| 301: function drop_table($table_name, $no_prefix = false) |
| 302: { |
| 303: if (!$this->table_exists($table_name, $no_prefix)) |
| 304: return; |
| 305: |
| 306: $this->query('DROP TABLE '.($no_prefix ? '' : $this->prefix).$table_name) or error(__FILE__, __LINE__); |
| 307: } |
| 308: |
| 309: |
| 310: function add_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false) |
| 311: { |
| 312: if ($this->field_exists($table_name, $field_name, $no_prefix)) |
| 313: return; |
| 314: |
| 315: $field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type); |
| 316: |
| 317: if ($default_value !== null && !is_int($default_value) && !is_float($default_value)) |
| 318: $default_value = '\''.$this->escape($default_value).'\''; |
| 319: |
| 320: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) or error(__FILE__, __LINE__); |
| 321: } |
| 322: |
| 323: |
| 324: function alter_field($table_name, $field_name, $field_type, $allow_null, $default_value = null, $after_field = null, $no_prefix = false) |
| 325: { |
| 326: if (!$this->field_exists($table_name, $field_name, $no_prefix)) |
| 327: return; |
| 328: |
| 329: $field_type = preg_replace(array_keys($this->datatype_transformations), array_values($this->datatype_transformations), $field_type); |
| 330: |
| 331: if ($default_value !== null && !is_int($default_value) && !is_float($default_value)) |
| 332: $default_value = '\''.$this->escape($default_value).'\''; |
| 333: |
| 334: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' MODIFY '.$field_name.' '.$field_type.($allow_null ? ' ' : ' NOT NULL').($default_value !== null ? ' DEFAULT '.$default_value : ' ').($after_field != null ? ' AFTER '.$after_field : '')) or error(__FILE__, __LINE__); |
| 335: } |
| 336: |
| 337: |
| 338: function drop_field($table_name, $field_name, $no_prefix = false) |
| 339: { |
| 340: if (!$this->field_exists($table_name, $field_name, $no_prefix)) |
| 341: return; |
| 342: |
| 343: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP '.$field_name) or error(__FILE__, __LINE__); |
| 344: } |
| 345: |
| 346: |
| 347: function add_index($table_name, $index_name, $index_fields, $unique = false, $no_prefix = false) |
| 348: { |
| 349: if ($this->index_exists($table_name, $index_name, $no_prefix)) |
| 350: return; |
| 351: |
| 352: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' ADD '.($unique ? 'UNIQUE ' : '').'INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name.' ('.implode(',', $index_fields).')') or error(__FILE__, __LINE__); |
| 353: } |
| 354: |
| 355: |
| 356: function drop_index($table_name, $index_name, $no_prefix = false) |
| 357: { |
| 358: if (!$this->index_exists($table_name, $index_name, $no_prefix)) |
| 359: return; |
| 360: |
| 361: $this->query('ALTER TABLE '.($no_prefix ? '' : $this->prefix).$table_name.' DROP INDEX '.($no_prefix ? '' : $this->prefix).$table_name.'_'.$index_name) or error(__FILE__, __LINE__); |
| 362: } |
| 363: } |
punbb-1.3.3/include/functions.php |
punbb-1.3.6/include/functions.php |
2: /** | 2: /** |
3: * Loads common functions used throughout the site. | 3: * Loads common functions used throughout the site. |
4: * | 4: * |
5: * @copyright (C) 2008-2009 PunBB, partially based on code (C) 2008-2009 FluxBB.org | 5: * @copyright (C) 2008-2011 PunBB, partially based on code (C) 2008-2009 FluxBB.org |
6: * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher | 6: * @license http://www.gnu.org/licenses/gpl.html GPL version 2 or higher |
7: * @package PunBB | 7: * @package PunBB |
8: */ | 8: */ |
404: if ($type == FORUM_FT_DATETIME || $type == FORUM_FT_TIME) | 404: if ($type == FORUM_FT_DATETIME || $type == FORUM_FT_TIME) |
405: $formatted_time .= gmdate($time_format, $timestamp); | 405: $formatted_time .= gmdate($time_format, $timestamp); |
406: | 406: |
| 407: ($hook = get_hook('fn_format_time_end')) ? eval($hook) : null; |
| 408: |
407: return $formatted_time; | 409: return $formatted_time; |
408: } | 410: } |
409: | 411: |
555: | 557: |
556: | 558: |
557: // Generate a string with numbered links (for multipage scripts) | 559: // Generate a string with numbered links (for multipage scripts) |
558: function paginate($num_pages, $cur_page, $link, $separator, $args = null) | 560: function paginate($num_pages, $cur_page, $link, $separator, $args = null, $is_default_scheme = null) |
559: { | 561: { |
560: global $forum_url, $lang_common; | 562: global $forum_url, $lang_common; |
561: | 563: |
| 564: if ($is_default_scheme == null) |
| 565: $forum_url_page = $forum_url['page']; |
| 566: else |
| 567: { |
| 568: $forum_url_page = '&p=$1'; |
| 569: unset($forum_url['insertion_find']); |
| 570: } |
| 571: |
562: $pages = array(); | 572: $pages = array(); |
563: $link_to_all = false; | 573: $link_to_all = false; |
564: | 574: |
574: } | 584: } |
575: | 585: |
576: if ($num_pages <= 1) | 586: if ($num_pages <= 1) |
577: $pages = array('<strong class="first-item">1</strong>'); | 587: $pages = array('<strong class="first-item">'.forum_number_format(1).'</strong>'); |
578: else | 588: else |
579: { | 589: { |
580: // Add a previous page link | 590: // Add a previous page link |
581: if ($num_pages > 1 && $cur_page > 1) | 591: if ($num_pages > 1 && $cur_page > 1) |
582: $pages[] = '<a'.(empty($pages) ? ' class="first-item"' : '').' href="'.forum_sublink($link, $forum_url['page'], ($cur_page - 1), $args).'">'.$lang_common['Previous'].'</a>'; | 592: $pages[] = '<a'.(empty($pages) ? ' class="first-item"' : '').' href="'.forum_sublink($link, $forum_url_page, ($cur_page - 1), $args).'">'.$lang_common['Previous'].'</a>'; |
583: | 593: |
584: if ($cur_page > 3) | 594: if ($cur_page > 3) |
585: { | 595: { |
586: $pages[] = '<a'.(empty($pages) ? ' class="first-item"' : '').' href="'.forum_sublink($link, $forum_url['page'], 1, $args).'">1</a>'; | 596: $pages[] = '<a'.(empty($pages) ? ' class="first-item"' : '').' href="'.forum_sublink($link, $forum_url_page, 1, $args).'">'.forum_number_format(1).'</a>'; |
587: | 597: |
588: if ($cur_page > 5) | 598: if ($cur_page > 5) |
589: $pages[] = '<span>'.$lang_common['Spacer'].'</span>'; | 599: $pages[] = '<span>'.$lang_common['Spacer'].'</span>'; |
594: if ($current < 1 || $current > $num_pages) | 604: if ($current < 1 || $current > $num_pages) |
595: continue; | 605: continue; |
596: else if ($current != $cur_page || $link_to_all) | 606: else if ($current != $cur_page || $link_to_all) |
597: $pages[] = '<a'.(empty($pages) ? ' class="first-item" ' : '').' href="'.forum_sublink($link, $forum_url['page'], $current, $args).'">'.forum_number_format($current).'</a>'; | 607: $pages[] = '<a'.(empty($pages) ? ' class="first-item" ' : '').' href="'.forum_sublink($link, $forum_url_page, $current, $args).'">'.forum_number_format($current).'</a>'; |
598: else | 608: else |
599: $pages[] = '<strong'.(empty($pages) ? ' class="first-item"' : '').'>'.forum_number_format($current).'</strong>'; | 609: $pages[] = '<strong'.(empty($pages) ? ' class="first-item"' : '').'>'.forum_number_format($current).'</strong>'; |
600: | 610: |
603: if ($cur_page != ($num_pages-3) && $cur_page != ($num_pages-4)) | 613: if ($cur_page != ($num_pages-3) && $cur_page != ($num_pages-4)) |
604: $pages[] = '<span>'.$lang_common['Spacer'].'</span>'; | 614: $pages[] = '<span>'.$lang_common['Spacer'].'</span>'; |
605: | 615: |
606: $pages[] = '<a'.(empty($pages) ? ' class="first-item" ' : '').' href="'.forum_sublink($link, $forum_url['page'], $num_pages, $args).'">'.forum_number_format($num_pages).'</a>'; | 616: $pages[] = '<a'.(empty($pages) ? ' class="first-item" ' : '').' href="'.forum_sublink($link, $forum_url_page, $num_pages, $args).'">'.forum_number_format($num_pages).'</a>'; |
607: } | 617: } |
608: | 618: |
609: // Add a next page link | 619: // Add a next page link |
610: if ($num_pages > 1 && !$link_to_all && $cur_page < $num_pages) | 620: if ($num_pages > 1 && !$link_to_all && $cur_page < $num_pages) |
611: $pages[] = '<a'.(empty($pages) ? ' class="first-item" ' : '').' href="'.forum_sublink($link, $forum_url['page'], ($cur_page + 1), $args).'">'.$lang_common['Next'].'</a>'; | 621: $pages[] = '<a'.(empty($pages) ? ' class="first-item" ' : '').' href="'.forum_sublink($link, $forum_url_page, ($cur_page + 1), $args).'">'.$lang_common['Next'].'</a>'; |
612: } | 622: } |
613: | 623: |
614: ($hook = get_hook('fn_paginate_end')) ? eval($hook) : null; | 624: ($hook = get_hook('fn_paginate_end')) ? eval($hook) : null; |
749: global $forum_config, $forum_user; | 759: global $forum_config, $forum_user; |
750: static $lang_url_replace, $forum_reserved_strings; | 760: static $lang_url_replace, $forum_reserved_strings; |
751: | 761: |
752: if (!isset($lang_replace)) | 762: if (!isset($lang_url_replace)) |
753: require FORUM_ROOT.'lang/'.$forum_user['language'].'/url_replace.php'; | 763: require FORUM_ROOT.'lang/'.$forum_user['language'].'/url_replace.php'; |
754: | 764: |
755: if (!isset($forum_reserved_strings)) | 765: if (!isset($forum_reserved_strings)) |
772: foreach ($forum_reserved_strings as $match => $replace) | 782: foreach ($forum_reserved_strings as $match => $replace) |
773: if ($str == $match) | 783: if ($str == $match) |
774: return $replace; | 784: return $replace; |
| 785: else if ($match != '') |
| 786: $str = str_replace($match, $replace, $str); |
775: | 787: |
776: return $str; | 788: return $str; |
777: } | 789: } |
937: function get_scheme_packs() | 949: function get_scheme_packs() |
938: { | 950: { |
939: $schemes = array(); | 951: $schemes = array(); |
940: | 952: |
941: if($handle = opendir(FORUM_ROOT.'include/url')) | 953: if($handle = opendir(FORUM_ROOT.'include/url')) |
942: { | 954: { |
943: while (false !== ($dirname = readdir($handle))) | 955: while (false !== ($dirname = readdir($handle))) |
959: function get_style_packs() | 971: function get_style_packs() |
960: { | 972: { |
961: $styles = array(); | 973: $styles = array(); |
962: | 974: |
963: if($handle = opendir(FORUM_ROOT.'style')) | 975: if($handle = opendir(FORUM_ROOT.'style')) |
964: { | 976: { |
965: while (false !== ($dirname = readdir($handle))) | 977: while (false !== ($dirname = readdir($handle))) |
1457: if ($cur_ban['username'] != '' && utf8_strtolower($forum_user['username']) == utf8_strtolower($cur_ban['username'])) | 1469: if ($cur_ban['username'] != '' && utf8_strtolower($forum_user['username']) == utf8_strtolower($cur_ban['username'])) |
1458: $is_banned = true; | 1470: $is_banned = true; |
1459: | 1471: |
| 1472: if ($cur_ban['email'] != '' && $forum_user['email'] == $cur_ban['email']) |
| 1473: $is_banned = true; |
| 1474: |
1460: if ($cur_ban['ip'] != '') | 1475: if ($cur_ban['ip'] != '') |
1461: { | 1476: { |
1462: $cur_ban_ips = explode(' ', $cur_ban['ip']); | 1477: $cur_ban_ips = explode(' ', $cur_ban['ip']); |
1539: else | 1554: else |
1540: { | 1555: { |
1541: // If the entry is older than "o_timeout_visit", update last_visit for the user in question, then delete him/her from the online list | 1556: // If the entry is older than "o_timeout_visit", update last_visit for the user in question, then delete him/her from the online list |
1542: if ($cur_user['idle'] != '0') | 1557: if ($cur_user['logged'] < ($now - $forum_config['o_timeout_visit'])) |
1543: { | 1558: { |
1544: $query = array( | 1559: $query = array( |
1545: 'UPDATE' => 'users', | 1560: 'UPDATE' => 'users', |
2657: <div class="ct-box info-box"> | 2672: <div class="ct-box info-box"> |
2658: <p><?php echo $lang_common['CSRF token mismatch'] ?></p> | 2673: <p><?php echo $lang_common['CSRF token mismatch'] ?></p> |
2659: </div> | 2674: </div> |
2660: <form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action'] ?>"> | 2675: <form class="frm-form" method="post" accept-charset="utf-8" action="<?php echo forum_htmlencode($forum_page['form_action']) ?>"> |
2661: <div class="hidden"> | 2676: <div class="hidden"> |
2662: <?php echo implode("\n\t\t\t\t", $forum_page['hidden_fields'])."\n" ?> | 2677: <?php echo implode("\n\t\t\t\t", $forum_page['hidden_fields'])."\n" ?> |
2663: </div> | 2678: </div> |
2777: | 2792: |
2778: | 2793: |
2779: // START SUBST - <!-- forum_head --> | 2794: // START SUBST - <!-- forum_head --> |
| 2795: |
2780: ob_start(); | 2796: ob_start(); |
2781: | 2797: |
2782: ?> | 2798: require FORUM_ROOT.'style/'.$forum_user['style'].'/'.$forum_user['style'].'.php'; |
2783: <title><?php echo $lang_common['Maintenance'].$lang_common['Title separator'].forum_htmlencode($forum_config['o_board_title']) ?></title> | |
2784: <link rel="stylesheet" type="text/css" media="screen" href="<?php echo $base_url ?>/style/<?php echo $forum_user['style'] ?>/<?php echo $forum_user['style'].'.css' ?>" /> | |
2785: <link rel="stylesheet" type="text/css" media="screen" href="<?php echo $base_url ?>/style/<?php echo $forum_user['style'] ?>/<?php echo $forum_user['style'].'_cs.css' ?>" /> | |
2786: <!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="<?php echo $base_url ?>/style/<?php echo $forum_user['style'] ?>/<?php echo $forum_user['style'].'_fix.css' ?>" /><![endif]--> | |
2787: <!--[if IE 7]><link rel="stylesheet" type="text/css" href="<?php echo $base_url ?>/style/<?php echo $forum_user['style'] ?>/<?php echo $forum_user['style'].'_fix7.css' ?>" /><![endif]--> | |
2788: <?php | |
2789: | 2799: |
2790: $tpl_temp = forum_trim(ob_get_contents()); | 2800: $tpl_temp = forum_trim(ob_get_contents()); |
2791: $tpl_maint = str_replace('<!-- forum_head -->', $tpl_temp, $tpl_maint); | 2801: $tpl_maint = str_replace('<!-- forum_head -->', $tpl_temp, $tpl_maint); |
2797: ob_start(); | 2807: ob_start(); |
2798: | 2808: |
2799: ?> | 2809: ?> |
2800: <div id="brd-maint" class="main basic"> | |
2801: | |
2802: <div class="main-head"> | 2810: <div class="main-head"> |
2803: <h1 class="hn"><span><?php echo $lang_common['Maintenance mode'] ?></span></h1> | 2811: <h1 class="hn"><span><?php echo $lang_common['Maintenance mode'] ?></span></h1> |
2804: </div> | 2812: </div> |
2807: <?php echo $message."\n" ?> | 2815: <?php echo $message."\n" ?> |
2808: </div> | 2816: </div> |
2809: </div> | 2817: </div> |
2810: | |
2811: </div> | |
2812: <?php | 2818: <?php |
2813: | 2819: |
2814: $tpl_temp = "\t".forum_trim(ob_get_contents()); | 2820: $tpl_temp = "\t".forum_trim(ob_get_contents()); |
3064: | 3070: |
3065: exit; | 3071: exit; |
3066: } | 3072: } |
| 3073: |
| 3074: // Check the text is CAPSED |
| 3075: function check_is_all_caps($text) |
| 3076: { |
| 3077: return (bool)/**/(utf8_strtoupper($text) == $text && utf8_strtolower($text) != $text); |
| 3078: } |
3067: | 3079: |
punbb-1.3.3/include/parser.php |
punbb-1.3.6/include/parser.php |
44: if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false) | 44: if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false) |
45: { | 45: { |
46: list($inside, $outside) = split_text($text, '[code]', '[/code]', $errors); | 46: list($inside, $outside) = split_text($text, '[code]', '[/code]', $errors); |
47: $text = implode("\0", $outside); | 47: $text = implode("\xc1", $outside); |
48: } | 48: } |
49: | 49: |
50: // Tidy up lists | 50: // Tidy up lists |
51: $pattern = array('/\[list(?:=([1a\*]))?\]((?>(?:(?!\[list(?:=(?:[1a\*]))\]|\[\/list\]).+?)|(?R))*)\[\/list\]/ems'); | 51: $pattern = array('%\[list(?:=([1a*]))?+\]((?:(?>.*?(?=\[list(?:=[1a*])?+\]|\[/list\]))|(?R))*)\[/list\]%ise'); |
52: $replace = array('preparse_list_tag(\'$2\', \'$1\', $errors)'); | 52: $replace = array('preparse_list_tag(\'$2\', \'$1\', $errors)'); |
53: $text = preg_replace($pattern, $replace, $text); | 53: $text = preg_replace($pattern, $replace, $text); |
54: | 54: |
60: // If we split up the message before we have to concatenate it together again (code tags) | 60: // If we split up the message before we have to concatenate it together again (code tags) |
61: if (isset($inside)) | 61: if (isset($inside)) |
62: { | 62: { |
63: $outside = explode("\0", $text); | 63: $outside = explode("\xc1", $text); |
64: $text = ''; | 64: $text = ''; |
65: | 65: |
66: $num_tokens = count($outside); | 66: $num_tokens = count($outside); |
520: | 520: |
521: if (strpos($content,'[list') !== false) | 521: if (strpos($content,'[list') !== false) |
522: { | 522: { |
523: $pattern = array('/\[list(?:=([1a\*]))?\]((?>(?:(?!\[list(?:=(?:[1a\*]))\]|\[\/list\]).+?)|(?R))*)\[\/list\]/ems'); | 523: $pattern = array('%\[list(?:=([1a*]))?+\]((?:(?>.*?(?=\[list(?:=[1a*])?+\]|\[/list\]))|(?R))*)\[/list\]%ise'); |
524: $replace = array('preparse_list_tag(\'$2\', \'$1\', $errors)'); | 524: $replace = array('preparse_list_tag(\'$2\', \'$1\', $errors)'); |
525: $content = preg_replace($pattern, $replace, $content); | 525: $content = preg_replace($pattern, $replace, $content); |
526: } | 526: } |
592: | 592: |
593: // Ok, not very pretty :-) | 593: // Ok, not very pretty :-) |
594: if (!$bbcode) | 594: if (!$bbcode) |
595: $link = ($link == '' || $link == $url) ? ((utf8_strlen($url) > 55) ? utf8_substr($url, 0 , 39).' … '.utf8_substr($url, -10) : $url) : stripslashes($link); | 595: $link = ($link == '' || $link == $url) ? ((utf8_strlen($url) > 55) ? utf8_substr($url, 0 , 39).' … '.utf8_substr($url, -10) : $url) : stripslashes($link); |
596: | 596: |
597: $return = ($hook = get_hook('ps_handle_url_tag_end')) ? eval($hook) : null; | 597: $return = ($hook = get_hook('ps_handle_url_tag_end')) ? eval($hook) : null; |
598: if ($return != null) | 598: if ($return != null) |
649: | 649: |
650: if (strpos($content,'[list') !== false) | 650: if (strpos($content,'[list') !== false) |
651: { | 651: { |
652: $pattern = array('/\[list(?:=([1a\*]))?\]((?>(?:(?!\[list(?:=(?:[1a\*]))\]|\[\/list\]).+?)|(?R))*)\[\/list\]/ems'); | 652: $pattern = array('%\[list(?:=([1a*]))?+\]((?:(?>.*?(?=\[list(?:=[1a*])?+\]|\[/list\]))|(?R))*)\[/list\]%ise'); |
653: $replace = array('handle_list_tag(\'$2\', \'$1\')'); | 653: $replace = array('handle_list_tag(\'$2\', \'$1\')'); |
654: $content = preg_replace($pattern, $replace, $content); | 654: $content = preg_replace($pattern, $replace, $content); |
655: } | 655: } |
688: | 688: |
689: if (!$is_signature) | 689: if (!$is_signature) |
690: { | 690: { |
691: $pattern[] = '/\[list(?:=([1a\*]))?\]((?>(?:(?!\[list(?:=(?:[1a\*]))\]|\[\/list\]).+?)|(?R))*)\[\/list\]/ems'; | 691: $pattern[] = '%\[list(?:=([1a*]))?+\]((?:(?>.*?(?=\[list(?:=[1a*])?+\]|\[/list\]))|(?R))*)\[/list\]%ise'; |
692: $replace[] = 'handle_list_tag(\'$2\', \'$1\')'; | 692: $replace[] = 'handle_list_tag(\'$2\', \'$1\')'; |
693: } | 693: } |
694: | 694: |
752: { | 752: { |
753: $text = ' '.$text; | 753: $text = ' '.$text; |
754: | 754: |
755: $text = preg_replace('#(?<=[\s\]\)])(<)?(\[)?(\()?([\'"]?)(https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^\s\[]*[^\s.,?!\[;:-]?)?)\4(?(3)(\)))(?(2)(\]))(?(1)(>))(?![^\s]*\[/(?:url|img)\])#ie', 'stripslashes(\'$1$2$3$4\').handle_url_tag(\'$5://$6\', \'$5://$6\', true).stripslashes(\'$4$10$11$12\')', $text); | 755: $text = preg_replace('#(?<=[\s\]\)])(<)?(\[)?(\()?([\'"]?)(https?|ftp|news){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^\s\[]*[^\s.,?!\[;:-])?)\4(?(3)(\)))(?(2)(\]))(?(1)(>))(?![^\s]*\[/(?:url|img)\])#ie', 'stripslashes(\'$1$2$3$4\').handle_url_tag(\'$5://$6\', \'$5://$6\', true).stripslashes(\'$4$10$11$12\')', $text); |
756: $text = preg_replace('#(?<=[\s\]\)])(<)?(\[)?(\()?([\'"]?)(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^\s\[]*[^\s.,?!\[;:-])?)\4(?(3)(\)))(?(2)(\]))(?(1)(>))(?![^\s]*\[/(?:url|img)\])#ie', 'stripslashes(\'$1$2$3$4\').handle_url_tag(\'$5.$6\', \'$5.$6\', true).stripslashes(\'$4$10$11$12\')', $text); | 756: $text = preg_replace('#(?<=[\s\]\)])(<)?(\[)?(\()?([\'"]?)(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^\s\[]*[^\s.,?!\[;:-])?)\4(?(3)(\)))(?(2)(\]))(?(1)(>))(?![^\s]*\[/(?:url|img)\])#ie', 'stripslashes(\'$1$2$3$4\').handle_url_tag(\'$5.$6\', \'$5.$6\', true).stripslashes(\'$4$10$11$12\')', $text); |
757: | 757: |
758: return substr($text, 1); | 758: return substr($text, 1); |
813: if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false) | 813: if (strpos($text, '[code]') !== false && strpos($text, '[/code]') !== false) |
814: { | 814: { |
815: list($inside, $outside) = split_text($text, '[code]', '[/code]', $errors); | 815: list($inside, $outside) = split_text($text, '[code]', '[/code]', $errors); |
816: $text = implode("\0", $outside); | 816: $text = implode("\xc1", $outside); |
817: } | 817: } |
818: | 818: |
819: $return = ($hook = get_hook('ps_parse_message_post_split')) ? eval($hook) : null; | 819: $return = ($hook = get_hook('ps_parse_message_post_split')) ? eval($hook) : null; |
842: // If we split up the message before we have to concatenate it together again (code tags) | 842: // If we split up the message before we have to concatenate it together again (code tags) |
843: if (isset($inside)) | 843: if (isset($inside)) |
844: { | 844: { |
845: $outside = explode("\0", $text); | 845: $outside = explode("\xc1", $text); |
846: $text = ''; | 846: $text = ''; |
847: | 847: |
848: $num_tokens = count($outside); | 848: $num_tokens = count($outside); |
punbb-1.3.3/lang/English/admin_settings.php |
punbb-1.3.6/lang/English/admin_settings.php |
24: 'Setup timeouts' => 'Default timeouts and redirect delay', | 24: 'Setup timeouts' => 'Default timeouts and redirect delay', |
25: 'Setup timeouts legend' => 'Timeout defaults', | 25: 'Setup timeouts legend' => 'Timeout defaults', |
26: 'Visit timeout label' => 'Visit timeout', | 26: 'Visit timeout label' => 'Visit timeout', |
27: 'Visit timeout help' => 'Seconds idle before last visit data is updated', | 27: 'Visit timeout help' => 'Seconds idle before user is logged out', |
28: 'Online timeout label' => 'Online timeout', | 28: 'Online timeout label' => 'Online timeout', |
29: 'Online timeout help' => 'Seconds idle before being removed from the online users list', | 29: 'Online timeout help' => 'Seconds idle before being removed from the online users list', |
30: 'Redirect time label' => 'Redirect wait', | 30: 'Redirect time label' => 'Redirect wait', |
51: 'Setup links legend' => 'Menu items', | 51: 'Setup links legend' => 'Menu items', |
52: 'Enter links label' => 'Enter your links', | 52: 'Enter links label' => 'Enter your links', |
53: 'Error no board title' => 'You must enter a board title.', | 53: 'Error no board title' => 'You must enter a board title.', |
54: 'Error timeout value' => 'The value of "Timeout online" must be smaller than the value of "Timeout visit".', | 54: 'Error timeout value' => 'The value of "Online timeout" must be smaller than the value of "Visit timeout".', |
55: | 55: |
56: | 56: |
57: // Features section | 57: // Features section |
78: 'Guest posting' => 'Guest posting', | 78: 'Guest posting' => 'Guest posting', |
79: 'Guest posting label' => 'Guests must supply e-mail addresses when posting.', | 79: 'Guest posting label' => 'Guests must supply e-mail addresses when posting.', |
80: 'User has posted' => 'User has posted', | 80: 'User has posted' => 'User has posted', |
81: 'User has posted label' => 'Display a dot in front of topics to indicate to a user that they have posted in that topic earlier. Disable if you are experiencing high server load.', | 81: 'User has posted label' => 'Display a dot in front of topics to indicate to a user that they have posted in that topic earlier. Disable if you are experiencing high server load. Ignore for SQLite.', |
82: 'Topic views' => 'Topic views', | 82: 'Topic views' => 'Topic views', |
83: 'Topic views label' => 'Keep track of the number of views a topic has. Disable if you are experiencing high server load in a busy forum.', | 83: 'Topic views label' => 'Keep track of the number of views a topic has. Disable if you are experiencing high server load in a busy forum.', |
84: 'User post count' => 'User post count', | 84: 'User post count' => 'User post count', |
164: 'Allow form e-mail label' => 'Hide e-mail address but allow e-mail via the forum.', | 164: 'Allow form e-mail label' => 'Hide e-mail address but allow e-mail via the forum.', |
165: 'Disallow form e-mail label' => 'Hide e-mail address and disallow e-mail via the forum.', | 165: 'Disallow form e-mail label' => 'Hide e-mail address and disallow e-mail via the forum.', |
166: 'Registration rules' => 'Forum rules (enable and compose forum rules)', | 166: 'Registration rules' => 'Forum rules (enable and compose forum rules)', |
167: 'Registration rules info' => 'You may require new users to agree to a set of rules when registering. The rules will always be available through a link in the navigation table at the top of every page. You may enable the use of rules and then compose your rules below.', | 167: 'Registration rules info' => 'You may require new users to agree to a set of rules when registering. The rules will always be available through a link in the navigation menu at the top of every page. You may enable the use of rules and then compose your rules below.', |
168: 'Registration rules legend' => 'Forum rules', | 168: 'Registration rules legend' => 'Forum rules', |
169: 'Require rules' => 'Use rules', | 169: 'Require rules' => 'Use rules', |
170: 'Require rules label' => 'Users must agree to forum rules before registering.', | 170: 'Require rules label' => 'Users must agree to forum rules before registering.', |
196: | 196: |
197: // Maintenance section | 197: // Maintenance section |
198: 'Maintenance head' => 'Setup maintenance message and activate maintenance mode', | 198: 'Maintenance head' => 'Setup maintenance message and activate maintenance mode', |
199: 'Maintenance mode info' => '<strong>IMPORTANT!</strong> Putting the board into maintenance mode means it will only be available to administrators. This should be used if the board needs to taken down temporarily for maintenance.', | 199: 'Maintenance mode info' => '<strong>IMPORTANT!</strong> Putting the board into maintenance mode means it will only be available to administrators. This should be used if the board needs to be taken down temporarily for maintenance.', |
200: 'Maintenance mode warn' => '<strong>WARNING!</strong> DO NOT LOGOUT when the board is in maintenance mode. You will not be able to login again.', | 200: 'Maintenance mode warn' => '<strong>WARNING!</strong> DO NOT LOGOUT when the board is in maintenance mode. You will not be able to login again.', |
201: 'Maintenance legend' => 'Maintenance', | 201: 'Maintenance legend' => 'Maintenance', |
202: 'Maintenance mode' => 'Maintenance mode', | 202: 'Maintenance mode' => 'Maintenance mode', |
punbb-1.3.3/misc.php |
punbb-1.3.6/misc.php |
154: message($lang_common['No permission']); | 154: message($lang_common['No permission']); |
155: | 155: |
156: $recipient_id = intval($_GET['email']); | 156: $recipient_id = intval($_GET['email']); |
| 157: |
157: if ($recipient_id < 2) | 158: if ($recipient_id < 2) |
158: message($lang_common['Bad request']); | 159: message($lang_common['Bad request']); |
159: | 160: |
170: ); | 171: ); |
171: | 172: |
172: ($hook = get_hook('mi_email_qr_get_form_email_data')) ? eval($hook) : null; | 173: ($hook = get_hook('mi_email_qr_get_form_email_data')) ? eval($hook) : null; |
| 174: |
173: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); | 175: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
| 176: |
174: if (!$forum_db->num_rows($result)) | 177: if (!$forum_db->num_rows($result)) |
175: message($lang_common['Bad request']); | 178: message($lang_common['Bad request']); |
176: | 179: |
179: if ($email_setting == 2 && !$forum_user['is_admmod']) | 182: if ($email_setting == 2 && !$forum_user['is_admmod']) |
180: message($lang_misc['Form e-mail disabled']); | 183: message($lang_misc['Form e-mail disabled']); |
181: | 184: |
| 185: if ($recipient_email == '') |
| 186: message($lang_common['Bad request']); |
182: | 187: |
183: if (isset($_POST['form_sent'])) | 188: if (isset($_POST['form_sent'])) |
184: { | 189: { |
367: { | 372: { |
368: ($hook = get_hook('mi_report_form_submitted')) ? eval($hook) : null; | 373: ($hook = get_hook('mi_report_form_submitted')) ? eval($hook) : null; |
369: | 374: |
| 375: // Start with a clean slate |
| 376: $errors = array(); |
| 377: |
370: // Flood protection | 378: // Flood protection |
371: if ($forum_user['last_email_sent'] != '' && (time() - $forum_user['last_email_sent']) < $forum_user['g_email_flood'] && (time() - $forum_user['last_email_sent']) >= 0) | 379: if ($forum_user['last_email_sent'] != '' && (time() - $forum_user['last_email_sent']) < $forum_user['g_email_flood'] && (time() - $forum_user['last_email_sent']) >= 0) |
372: message(sprintf($lang_misc['Report flood'], $forum_user['g_email_flood'])); | 380: message(sprintf($lang_misc['Report flood'], $forum_user['g_email_flood'])); |
376: if ($reason == '') | 384: if ($reason == '') |
377: message($lang_misc['No reason']); | 385: message($lang_misc['No reason']); |
378: | 386: |
379: // Get some info about the topic we're reporting | 387: if (strlen($reason) > FORUM_MAX_POSTSIZE_BYTES) |
380: $query = array( | |
381: 'SELECT' => 't.id, t.subject, t.forum_id', | |
382: 'FROM' => 'posts AS p', | |
383: 'JOINS' => array( | |
384: array( | |
385: 'INNER JOIN' => 'topics AS t', | |
386: 'ON' => 't.id=p.topic_id' | |
387: ) | |
388: ), | |
389: 'WHERE' => 'p.id='.$post_id | |
390: ); | |
391: | |
392: ($hook = get_hook('mi_report_qr_get_topic_data')) ? eval($hook) : null; | |
393: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); | |
394: if (!$forum_db->num_rows($result)) | |
395: message($lang_common['Bad request']); | |
396: | |
397: list($topic_id, $subject, $forum_id) = $forum_db->fetch_row($result); | |
398: | |
399: ($hook = get_hook('mi_report_pre_reports_sent')) ? eval($hook) : null; | |
400: | |
401: // Should we use the internal report handling? | |
402: if ($forum_config['o_report_method'] == 0 || $forum_config['o_report_method'] == 2) | |
403: { | 388: { |
| 389: $errors[] = sprintf($lang_misc['Too long reason'], forum_number_format(strlen($reason)), forum_number_format(FORUM_MAX_POSTSIZE_BYTES)); |
| 390: } |
| 391: |
| 392: if (empty($errors)) { |
| 393: // Get some info about the topic we're reporting |
404: $query = array( | 394: $query = array( |
405: 'INSERT' => 'post_id, topic_id, forum_id, reported_by, created, message', | 395: 'SELECT' => 't.id, t.subject, t.forum_id', |
406: 'INTO' => 'reports', | 396: 'FROM' => 'posts AS p', |
407: 'VALUES' => $post_id.', '.$topic_id.', '.$forum_id.', '.$forum_user['id'].', '.time().', \''.$forum_db->escape($reason).'\'' | 397: 'JOINS' => array( |
| 398: array( |
| 399: 'INNER JOIN' => 'topics AS t', |
| 400: 'ON' => 't.id=p.topic_id' |
| 401: ) |
| 402: ), |
| 403: 'WHERE' => 'p.id='.$post_id |
408: ); | 404: ); |
409: | 405: |
410: ($hook = get_hook('mi_report_add_report')) ? eval($hook) : null; | 406: ($hook = get_hook('mi_report_qr_get_topic_data')) ? eval($hook) : null; |
411: $forum_db->query_build($query) or error(__FILE__, __LINE__); | 407: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
412: } | 408: if (!$forum_db->num_rows($result)) |
| 409: message($lang_common['Bad request']); |
413: | 410: |
414: // Should we e-mail the report? | 411: list($topic_id, $subject, $forum_id) = $forum_db->fetch_row($result); |
415: if ($forum_config['o_report_method'] == 1 || $forum_config['o_report_method'] == 2) | 412: |
416: { | 413: ($hook = get_hook('mi_report_pre_reports_sent')) ? eval($hook) : null; |
417: // We send it to the complete mailing-list in one swoop | 414: |
418: if ($forum_config['o_mailing_list'] != '') | 415: // Should we use the internal report handling? |
| 416: if ($forum_config['o_report_method'] == 0 || $forum_config['o_report_method'] == 2) |
419: { | 417: { |
420: $mail_subject = 'Report('.$forum_id.') - \''.$subject.'\''; | 418: $query = array( |
421: $mail_message = 'User \''.$forum_user['username'].'\' has reported the following message:'."\n".forum_link($forum_url['post'], $post_id)."\n\n".'Reason:'."\n".$reason; | 419: 'INSERT' => 'post_id, topic_id, forum_id, reported_by, created, message', |
| 420: 'INTO' => 'reports', |
| 421: 'VALUES' => $post_id.', '.$topic_id.', '.$forum_id.', '.$forum_user['id'].', '.time().', \''.$forum_db->escape($reason).'\'' |
| 422: ); |
422: | 423: |
423: if (!defined('FORUM_EMAIL_FUNCTIONS_LOADED')) | 424: ($hook = get_hook('mi_report_add_report')) ? eval($hook) : null; |
424: require FORUM_ROOT.'include/email.php'; | 425: $forum_db->query_build($query) or error(__FILE__, __LINE__); |
| 426: } |
425: | 427: |
426: ($hook = get_hook('mi_report_modify_message')) ? eval($hook) : null; | 428: // Should we e-mail the report? |
| 429: if ($forum_config['o_report_method'] == 1 || $forum_config['o_report_method'] == 2) |
| 430: { |
| 431: // We send it to the complete mailing-list in one swoop |
| 432: if ($forum_config['o_mailing_list'] != '') |
| 433: { |
| 434: $mail_subject = 'Report('.$forum_id.') - \''.$subject.'\''; |
| 435: $mail_message = 'User \''.$forum_user['username'].'\' has reported the following message:'."\n".forum_link($forum_url['post'], $post_id)."\n\n".'Reason:'."\n".$reason; |
| 436: |
| 437: if (!defined('FORUM_EMAIL_FUNCTIONS_LOADED')) |
| 438: require FORUM_ROOT.'include/email.php'; |
427: | 439: |
428: forum_mail($forum_config['o_mailing_list'], $mail_subject, $mail_message); | 440: ($hook = get_hook('mi_report_modify_message')) ? eval($hook) : null; |
| 441: |
| 442: forum_mail($forum_config['o_mailing_list'], $mail_subject, $mail_message); |
| 443: } |
429: } | 444: } |
430: } | |
431: | 445: |
432: // Set last_email_sent time to prevent flooding | 446: // Set last_email_sent time to prevent flooding |
433: $query = array( | 447: $query = array( |
434: 'UPDATE' => 'users', | 448: 'UPDATE' => 'users', |
435: 'SET' => 'last_email_sent='.time(), | 449: 'SET' => 'last_email_sent='.time(), |
436: 'WHERE' => 'id='.$forum_user['id'] | 450: 'WHERE' => 'id='.$forum_user['id'] |
437: ); | 451: ); |
438: | 452: |
439: ($hook = get_hook('mi_report_qr_update_last_email_sent')) ? eval($hook) : null; | 453: ($hook = get_hook('mi_report_qr_update_last_email_sent')) ? eval($hook) : null; |
440: $forum_db->query_build($query) or error(__FILE__, __LINE__); | 454: $forum_db->query_build($query) or error(__FILE__, __LINE__); |
441: | 455: |
442: ($hook = get_hook('mi_report_pre_redirect')) ? eval($hook) : null; | 456: ($hook = get_hook('mi_report_pre_redirect')) ? eval($hook) : null; |
443: | 457: |
444: redirect(forum_link($forum_url['post'], $post_id), $lang_misc['Report redirect']); | 458: redirect(forum_link($forum_url['post'], $post_id), $lang_misc['Report redirect']); |
| 459: } |
445: } | 460: } |
446: | 461: |
447: // Setup form | 462: // Setup form |
480: <div id="req-msg" class="req-warn ct-box error-box"> | 495: <div id="req-msg" class="req-warn ct-box error-box"> |
481: <p class="important"><?php printf($lang_common['Required warn'], '<em>'.$lang_common['Required'].'</em>') ?></p> | 496: <p class="important"><?php printf($lang_common['Required warn'], '<em>'.$lang_common['Required'].'</em>') ?></p> |
482: </div> | 497: </div> |
| 498: <?php |
| 499: // If there were any errors, show them |
| 500: if (!empty($errors)) { |
| 501: $forum_page['errors'] = array(); |
| 502: foreach ($errors as $cur_error) { |
| 503: $forum_page['errors'][] = '<li class="warn"><span>'.$cur_error.'</span></li>'; |
| 504: } |
| 505: |
| 506: ($hook = get_hook('mi_pre_report_errors')) ? eval($hook) : null; |
| 507: ?> |
| 508: <div class="ct-box error-box"> |
| 509: <h2 class="warn hn"><?php echo $lang_misc['Report errors'] ?></h2> |
| 510: <ul class="error-list"> |
| 511: <?php echo implode("\n\t\t\t\t", $forum_page['errors'])."\n" ?> |
| 512: </ul> |
| 513: </div> |
| 514: <?php |
| 515: } |
| 516: ?> |
483: <form id="afocus" class="frm-form" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action'] ?>"> | 517: <form id="afocus" class="frm-form" method="post" accept-charset="utf-8" action="<?php echo $forum_page['form_action'] ?>"> |
484: <div class="hidden"> | 518: <div class="hidden"> |
485: <?php echo implode("\n\t\t\t\t", $forum_page['hidden_fields'])."\n" ?> | 519: <?php echo implode("\n\t\t\t\t", $forum_page['hidden_fields'])."\n" ?> |
punbb-1.3.3/post.php |
punbb-1.3.6/post.php |
124: $errors[] = $lang_post['No subject']; | 124: $errors[] = $lang_post['No subject']; |
125: else if (utf8_strlen($subject) > 70) | 125: else if (utf8_strlen($subject) > 70) |
126: $errors[] = $lang_post['Too long subject']; | 126: $errors[] = $lang_post['Too long subject']; |
127: else if ($forum_config['p_subject_all_caps'] == '0' && utf8_strtoupper($subject) == $subject && !$forum_page['is_admmod']) | 127: else if ($forum_config['p_subject_all_caps'] == '0' && check_is_all_caps($subject) && !$forum_page['is_admmod']) |
128: $errors[] = $lang_post['All caps subject']; | 128: $errors[] = $lang_post['All caps subject']; |
129: } | 129: } |
130: | 130: |
168: | 168: |
169: if (strlen($message) > FORUM_MAX_POSTSIZE_BYTES) | 169: if (strlen($message) > FORUM_MAX_POSTSIZE_BYTES) |
170: $errors[] = sprintf($lang_post['Too long message'], forum_number_format(strlen($message)), forum_number_format(FORUM_MAX_POSTSIZE_BYTES)); | 170: $errors[] = sprintf($lang_post['Too long message'], forum_number_format(strlen($message)), forum_number_format(FORUM_MAX_POSTSIZE_BYTES)); |
171: else if ($forum_config['p_message_all_caps'] == '0' && utf8_strtoupper($message) == $message && !$forum_page['is_admmod']) | 171: else if ($forum_config['p_message_all_caps'] == '0' && check_is_all_caps($message) && !$forum_page['is_admmod']) |
172: $errors[] = $lang_post['All caps message']; | 172: $errors[] = $lang_post['All caps message']; |
173: | 173: |
174: // Validate BBCode syntax | 174: // Validate BBCode syntax |
265: | 265: |
266: list($q_poster, $q_message) = $forum_db->fetch_row($result); | 266: list($q_poster, $q_message) = $forum_db->fetch_row($result); |
267: | 267: |
| 268: ($hook = get_hook('po_modify_quote_info')) ? eval($hook) : null; |
| 269: |
268: if ($forum_config['p_message_bbcode'] == '1') | 270: if ($forum_config['p_message_bbcode'] == '1') |
269: { | 271: { |
270: // If username contains a square bracket, we add "" or '' around it (so we know when it starts and ends) | 272: // If username contains a square bracket, we add "" or '' around it (so we know when it starts and ends) |
546: if (!defined('FORUM_PARSER_LOADED')) | 548: if (!defined('FORUM_PARSER_LOADED')) |
547: require FORUM_ROOT.'include/parser.php'; | 549: require FORUM_ROOT.'include/parser.php'; |
548: | 550: |
| 551: // Get the amount of posts in the topic |
| 552: $query = array( |
| 553: 'SELECT' => 'count(p.id)', |
| 554: 'FROM' => 'posts AS p', |
| 555: 'WHERE' => 'topic_id='.$tid |
| 556: ); |
| 557: |
| 558: ($hook = get_hook('po_topic_review_qr_get_post_count')) ? eval($hook) : null; |
| 559: $result = $forum_db->query_build($query) or error(__FILE__, __LINE__); |
| 560: $forum_page['total_post_count'] = $forum_db->result($result, 0); |
| 561: |
549: // Get posts to display in topic review | 562: // Get posts to display in topic review |
550: $query = array( | 563: $query = array( |
551: 'SELECT' => 'p.id, p.poster, p.message, p.hide_smilies, p.posted', | 564: 'SELECT' => 'p.id, p.poster, p.message, p.hide_smilies, p.posted', |
552: 'FROM' => 'posts AS p', | 565: 'FROM' => 'posts AS p', |
553: 'WHERE' => 'topic_id='.$tid, | 566: 'WHERE' => 'topic_id='.$tid, |
554: 'ORDER BY' => 'id DESC', | 567: 'ORDER BY' => 'id DESC', |
555: 'LIMIT' => $forum_config['o_topic_review'] | 568: 'LIMIT' => $forum_config['o_topic_review'] |
556: ); | 569: ); |
557: | 570: |
558: ($hook = get_hook('po_topic_review_qr_get_topic_review_posts')) ? eval($hook) : null; | 571: ($hook = get_hook('po_topic_review_qr_get_topic_review_posts')) ? eval($hook) : null; |
572: { | 585: { |
573: ++$forum_page['item_count']; | 586: ++$forum_page['item_count']; |
574: | 587: |
575: // Generate the post heading | |
576: $forum_page['post_ident'] = array( | |
577: 'num' => '<span class="post-num">'.forum_number_format($forum_page['item_count']).'</span>', | |
578: 'link' => '<span class="post-link">'.sprintf($lang_post['Post posted'], '<a class="permalink" rel="bookmark" title="'.$lang_post['Permalink post'].'" href="'.forum_link($forum_url['post'], $cur_post['id']).'">'.format_time($cur_post['posted']).'</a>').'</span>' | |
579: ); | |
580: | |
581: ($hook = get_hook('po_topic_review_pre_item_indent_merge')) ? eval($hook) : null; | |
582: | |
583: $forum_page['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']); | 588: $forum_page['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']); |
584: | 589: |
585: // Generate the post heading | 590: // Generate the post heading |
586: $forum_page['post_ident'] = array(); | 591: $forum_page['post_ident'] = array(); |
587: $forum_page['post_ident']['num'] = '<span class="post-num">'.forum_number_format($forum_page['item_count']).'</span>'; | 592: $forum_page['post_ident']['num'] = '<span class="post-num">'.forum_number_format($forum_page['total_post_count'] - $forum_page['item_count'] + 1).'</span>'; |
588: $forum_page['post_ident']['byline'] = '<span class="post-byline">'.sprintf($lang_post['Post byline'], '<strong>'.forum_htmlencode($cur_post['poster']).'</strong>').'</span>'; | 593: $forum_page['post_ident']['byline'] = '<span class="post-byline">'.sprintf($lang_post['Post byline'], '<strong>'.forum_htmlencode($cur_post['poster']).'</strong>').'</span>'; |
589: $forum_page['post_ident']['link'] = '<span class="post-link"><a class="permalink" rel="bookmark" title="'.$lang_post['Permalink post'].'" href="'.forum_link($forum_url['post'], $cur_post['id']).'">'.format_time($cur_post['posted']).'</a></span>'; | 594: $forum_page['post_ident']['link'] = '<span class="post-link"><a class="permalink" rel="bookmark" title="'.$lang_post['Permalink post'].'" href="'.forum_link($forum_url['post'], $cur_post['id']).'">'.format_time($cur_post['posted']).'</a></span>'; |
590: | 595: |
punbb-1.3.3/profile.php |
punbb-1.3.6/profile.php |
176: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 176: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
177: <div class="sf-box text required"> | 177: <div class="sf-box text required"> |
178: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['New password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Password help'] ?></small></label><br /> | 178: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['New password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Password help'] ?></small></label><br /> |
179: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password1" size="35" value="<?php echo(isset($_POST['req_new_password1']) ? ($_POST['req_new_password1']) : ''); ?>"/></span><br /> | 179: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password1" size="35" value="<?php echo(isset($_POST['req_new_password1']) ? forum_htmlencode($_POST['req_new_password1']) : ''); ?>"/></span><br /> |
180: </div> | 180: </div> |
181: </div> | 181: </div> |
182: <?php ($hook = get_hook('pf_change_pass_key_pre_new_password_confirm')) ? eval($hook) : null; ?> | 182: <?php ($hook = get_hook('pf_change_pass_key_pre_new_password_confirm')) ? eval($hook) : null; ?> |
183: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 183: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
184: <div class="sf-box text required"> | 184: <div class="sf-box text required"> |
185: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Confirm new password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Confirm password help'] ?></small></label><br /> | 185: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Confirm new password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Confirm password help'] ?></small></label><br /> |
186: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password2" size="35" value="<?php echo(isset($_POST['req_new_password2']) ? ($_POST['req_new_password2']) : ''); ?>"/></span><br /> | 186: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password2" size="35" value="<?php echo(isset($_POST['req_new_password2']) ? forum_htmlencode($_POST['req_new_password2']) : ''); ?>"/></span><br /> |
187: </div> | 187: </div> |
188: </div> | 188: </div> |
189: <?php ($hook = get_hook('pf_change_pass_key_pre_fieldset_end')) ? eval($hook) : null; ?> | 189: <?php ($hook = get_hook('pf_change_pass_key_pre_fieldset_end')) ? eval($hook) : null; ?> |
336: <fieldset class="frm-group group<?php echo ++$forum_page['group_count'] ?>"> | 336: <fieldset class="frm-group group<?php echo ++$forum_page['group_count'] ?>"> |
337: <legend class="group-legend"><strong><?php echo $lang_common['Required information'] ?></strong></legend> | 337: <legend class="group-legend"><strong><?php echo $lang_common['Required information'] ?></strong></legend> |
338: <?php ($hook = get_hook('pf_change_pass_normal_pre_old_password')) ? eval($hook) : null; ?> | 338: <?php ($hook = get_hook('pf_change_pass_normal_pre_old_password')) ? eval($hook) : null; ?> |
339: <?php if (!$forum_user['is_admmod']): ?> | 339: <?php if (!$forum_user['is_admmod'] || $forum_user['id'] == $id): ?> |
340: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 340: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
341: <div class="sf-box text required"> | 341: <div class="sf-box text required"> |
342: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Old password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Old password help'] ?></small></label><br /> | 342: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Old password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Old password help'] ?></small></label><br /> |
343: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_old_password" size="35" value="<?php echo(isset($_POST['req_old_password']) ? ($_POST['req_old_password']) : ''); ?>"/></span> | 343: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_old_password" size="35" value="<?php echo(isset($_POST['req_old_password']) ? forum_htmlencode($_POST['req_old_password']) : ''); ?>"/></span> |
344: </div> | 344: </div> |
345: </div> | 345: </div> |
346: <?php endif; ($hook = get_hook('pf_change_pass_normal_pre_new_password')) ? eval($hook) : null; ?> | 346: <?php endif; ($hook = get_hook('pf_change_pass_normal_pre_new_password')) ? eval($hook) : null; ?> |
347: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 347: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
348: <div class="sf-box text required"> | 348: <div class="sf-box text required"> |
349: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['New password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Password help'] ?></small></label><br /> | 349: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['New password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Password help'] ?></small></label><br /> |
350: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password1" size="35" value="<?php echo(isset($_POST['req_new_password1']) ? ($_POST['req_new_password1']) : ''); ?>"/></span><br /> | 350: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password1" size="35" value="<?php echo(isset($_POST['req_new_password1']) ? forum_htmlencode($_POST['req_new_password1']) : ''); ?>"/></span><br /> |
351: </div> | 351: </div> |
352: </div> | 352: </div> |
353: <?php ($hook = get_hook('pf_change_pass_normal_pre_new_password_confirm')) ? eval($hook) : null; ?> | 353: <?php ($hook = get_hook('pf_change_pass_normal_pre_new_password_confirm')) ? eval($hook) : null; ?> |
354: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 354: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
355: <div class="sf-box text required"> | 355: <div class="sf-box text required"> |
356: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Confirm new password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Confirm password help'] ?></small></label><br /> | 356: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Confirm new password'] ?> <em><?php echo $lang_common['Required'] ?></em></span> <small><?php echo $lang_profile['Confirm password help'] ?></small></label><br /> |
357: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password2" size="35" value="<?php echo(isset($_POST['req_new_password2']) ? ($_POST['req_new_password2']) : ''); ?>"/></span><br /> | 357: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_new_password2" size="35" value="<?php echo(isset($_POST['req_new_password2']) ? forum_htmlencode($_POST['req_new_password2']) : ''); ?>"/></span><br /> |
358: </div> | 358: </div> |
359: </div> | 359: </div> |
360: <?php ($hook = get_hook('pf_change_pass_normal_pre_fieldset_end')) ? eval($hook) : null; ?> | 360: <?php ($hook = get_hook('pf_change_pass_normal_pre_fieldset_end')) ? eval($hook) : null; ?> |
610: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 610: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
611: <div class="sf-box text required"> | 611: <div class="sf-box text required"> |
612: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Password'] ?> <em><?php echo $lang_common['Required'] ?></em></span></label><br /> | 612: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Password'] ?> <em><?php echo $lang_common['Required'] ?></em></span></label><br /> |
613: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_password" size="25" value="<?php echo(isset($_POST['req_password']) ? ($_POST['req_password']) : ''); ?>"/></span> | 613: <span class="fld-input"><input type="password" id="fld<?php echo $forum_page['fld_count'] ?>" name="req_password" size="25" value="<?php echo(isset($_POST['req_password']) ? forum_htmlencode($_POST['req_password']) : ''); ?>"/></span> |
614: </div> | 614: </div> |
615: </div> | 615: </div> |
616: <?php ($hook = get_hook('pf_change_email_normal_pre_fieldset_end')) ? eval($hook) : null; ?> | 616: <?php ($hook = get_hook('pf_change_email_normal_pre_fieldset_end')) ? eval($hook) : null; ?> |
847: | 847: |
848: ($hook = get_hook('pf_ban_user_selected')) ? eval($hook) : null; | 848: ($hook = get_hook('pf_ban_user_selected')) ? eval($hook) : null; |
849: | 849: |
850: redirect(forum_link($forum_url['admin_bans']).'?add_ban='.$id, $lang_profile['Ban redirect']); | 850: redirect(forum_link($forum_url['admin_bans']).'&add_ban='.$id, $lang_profile['Ban redirect']); |
851: } | 851: } |
852: | 852: |
853: | 853: |
957: $form['dst'] = (isset($form['dst'])) ? 1 : 0; | 957: $form['dst'] = (isset($form['dst'])) ? 1 : 0; |
958: $form['time_format'] = (isset($form['time_format'])) ? intval($form['time_format']) : 0; | 958: $form['time_format'] = (isset($form['time_format'])) ? intval($form['time_format']) : 0; |
959: $form['date_format'] = (isset($form['date_format'])) ? intval($form['date_format']) : 0; | 959: $form['date_format'] = (isset($form['date_format'])) ? intval($form['date_format']) : 0; |
| 960: $form['timezone'] = (isset($form['timezone'])) ? floatval($form['timezone']) : $forum_config['o_default_timezone']; |
| 961: |
| 962: // Validate timezone |
| 963: if (($form['timezone'] > 14.0) || ($form['timezone'] < -12.0)) { |
| 964: message($lang_common['Bad request']); |
| 965: } |
960: | 966: |
961: $form['email_setting'] = intval($form['email_setting']); | 967: $form['email_setting'] = intval($form['email_setting']); |
962: if ($form['email_setting'] < 0 && $form['email_setting'] > 2) $form['email_setting'] = 1; | 968: if ($form['email_setting'] < 0 || $form['email_setting'] > 2) $form['email_setting'] = 1; |
963: | 969: |
964: if ($forum_config['o_subscriptions'] == '1') | 970: if ($forum_config['o_subscriptions'] == '1') |
965: { | 971: { |
1012: if (substr_count($form['signature'], "\n") > ($forum_config['p_sig_lines'] - 1)) | 1018: if (substr_count($form['signature'], "\n") > ($forum_config['p_sig_lines'] - 1)) |
1013: $errors[] = sprintf($lang_profile['Sig too many lines'], forum_number_format($forum_config['p_sig_lines'])); | 1019: $errors[] = sprintf($lang_profile['Sig too many lines'], forum_number_format($forum_config['p_sig_lines'])); |
1014: | 1020: |
1015: if ($form['signature'] != '' && $forum_config['p_sig_all_caps'] == '0' && utf8_strtoupper($form['signature']) == $form['signature'] && !$forum_user['is_admmod']) | 1021: if ($form['signature'] != '' && $forum_config['p_sig_all_caps'] == '0' && check_is_all_caps($form['signature']) && !$forum_user['is_admmod']) |
1016: $form['signature'] = utf8_ucwords(utf8_strtolower($form['signature'])); | 1022: $form['signature'] = utf8_ucwords(utf8_strtolower($form['signature'])); |
1017: | 1023: |
1018: // Validate BBCode syntax | 1024: // Validate BBCode syntax |
1828: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1834: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1829: <div class="sf-box text"> | 1835: <div class="sf-box text"> |
1830: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Website'] ?></span></label><br /> | 1836: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Website'] ?></span></label><br /> |
1831: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[url]" value="<?php echo(isset($form['url']) ? forum_htmlencode($form['url']) : forum_htmlencode($user['url'])) ?>" size="50" maxlength="80" /></span> | 1837: <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="form[url]" value="<?php echo(isset($form['url']) ? forum_htmlencode($form['url']) : forum_htmlencode($user['url'])) ?>" size="35" maxlength="80" /></span> |
1832: </div> | 1838: </div> |
1833: </div> | 1839: </div> |
1834: <?php ($hook = get_hook('pf_change_details_identity_pre_jabber')) ? eval($hook) : null; ?> | 1840: <?php ($hook = get_hook('pf_change_details_identity_pre_jabber')) ? eval($hook) : null; ?> |
1835: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1841: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1836: <div class="sf-box text"> | 1842: <div class="sf-box text"> |
1837: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Jabber'] ?></span></label><br /> | 1843: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Jabber'] ?></span></label><br /> |
1838: <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="form[jabber]" value="<?php echo(isset($form['jabber']) ? forum_htmlencode($form['jabber']) : forum_htmlencode($user['jabber'])) ?>" size="40" maxlength="80" /></span> | 1844: <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="form[jabber]" value="<?php echo(isset($form['jabber']) ? forum_htmlencode($form['jabber']) : forum_htmlencode($user['jabber'])) ?>" size="35" maxlength="80" /></span> |
1839: </div> | 1845: </div> |
1840: </div> | 1846: </div> |
1841: <?php ($hook = get_hook('pf_change_details_identity_pre_icq')) ? eval($hook) : null; ?> | 1847: <?php ($hook = get_hook('pf_change_details_identity_pre_icq')) ? eval($hook) : null; ?> |
1849: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> | 1855: <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>"> |
1850: <div class="sf-box text"> | 1856: <div class="sf-box text"> |
1851: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['MSN'] ?></span></label><br /> | 1857: <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['MSN'] ?></span></label><br /> |
1852: <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="form[msn]" value="<?php echo(isset($form['msn']) ? forum_htmlencode($form['msn']) : forum_htmlencode($user['msn'])) ?>" size="40" maxlength="80" /></span> | 1858: <span class="fld-input"><input id="fld<?php echo $forum_page['fld_count'] ?>" type="text" name="form[msn]" value="<?php echo(isset($form['msn']) ? forum_htmlencode($form['msn']) : forum_htmlencode($user['msn'])) ?>" size="35" maxlength="80" /></span> |
1853: </div> | 1859: </div> |
1854: </div> | 1860: </div> |
1855: <?php ($hook = get_hook('pf_change_details_identity_pre_aim')) ? eval($hook) : null; ?> | 1861: <?php ($hook = get_hook('pf_change_details_identity_pre_aim')) ? eval($hook) : null; ?> |
2256: $forum_page['crumbs'] = array( | 2262: $forum_page['crumbs'] = array( |
2257: array($forum_config['o_board_title'], forum_link($forum_url['index'])), | 2263: array($forum_config['o_board_title'], forum_link($forum_url['index'])), |
2258: array(sprintf($lang_profile['Users profile'], $user['username']), forum_link($forum_url['user'], $id)), | 2264: array(sprintf($lang_profile['Users profile'], $user['username']), forum_link($forum_url['user'], $id)), |
2259: array($lang_profile['Section signature'],forum_link($forum_url['profile_signature'], $id)) | 2265: array($lang_profile['Section signature'], forum_link($forum_url['profile_signature'], $id)) |
2260: ); | 2266: ); |
2261: | 2267: |
2262: // Setup the form | 2268: // Setup the form |
2308: | 2314: |
2309: ?> | 2315: ?> |
2310: <div class="ct-box error-box"> | 2316: <div class="ct-box error-box"> |
2311: <h2 class="warn hn"><?php echo $lang_profile['Profile update errors'] ?></h3> | 2317: <h2 class="warn hn"><?php echo $lang_profile['Profile update errors'] ?></h2> |
2312: <ul class="error-list"> | 2318: <ul class="error-list"> |
2313: <?php echo implode("\n\t\t\t\t\t", $forum_page['errors'])."\n" ?> | 2319: <?php echo implode("\n\t\t\t\t\t", $forum_page['errors'])."\n" ?> |
2314: </ul> | 2320: </ul> |
2513: $forum_page['user_management'] = array(); | 2519: $forum_page['user_management'] = array(); |
2514: | 2520: |
2515: if ($forum_user['g_moderator'] == '1') | 2521: if ($forum_user['g_moderator'] == '1') |
2516: $forum_page['user_management']['ban'] = '<div class="ct-set set'.++$forum_page['item_count'].'">'."\n\t\t\t\t".'<div class="ct-box">'."\n\t\t\t\t\t".'<h3 class="ct-legend hn">'.$lang_profile['Ban user'].'</h3>'."\n\t\t\t\t".'<p><a href="'.forum_link($forum_url['admin_bans']).'?add_ban='.$id.'">'.$lang_profile['Ban user info'].'</a></p>'."\n\t\t\t\t".'</div>'."\n\t\t\t".'</div>'; | 2522: $forum_page['user_management']['ban'] = '<div class="ct-set set'.++$forum_page['item_count'].'">'."\n\t\t\t\t".'<div class="ct-box">'."\n\t\t\t\t\t".'<h3 class="ct-legend hn">'.$lang_profile['Ban user'].'</h3>'."\n\t\t\t\t".'<p><a href="'.forum_link($forum_url['admin_bans']).'&add_ban='.$id.'">'.$lang_profile['Ban user info'].'</a></p>'."\n\t\t\t\t".'</div>'."\n\t\t\t".'</div>'; |
2517: else if ($forum_user['g_moderator'] != '1' && $user['g_id'] != FORUM_ADMIN ) | 2523: else if ($forum_user['g_moderator'] != '1' && $user['g_id'] != FORUM_ADMIN ) |
2518: { | 2524: { |
2519: $forum_page['user_management']['ban'] = '<div class="ct-set set'.++$forum_page['item_count'].'">'."\n\t\t\t\t".'<div class="ct-box">'."\n\t\t\t\t\t".'<h3 class="ct-legend hn">'.$lang_profile['Ban user'].'</h3>'."\n\t\t\t\t".'<p><a href="'.forum_link($forum_url['admin_bans']).'?add_ban='.$id.'">'.$lang_profile['Ban user info'].'</a></p>'."\n\t\t\t\t".'</div>'."\n\t\t\t".'</div>'; | 2525: $forum_page['user_management']['ban'] = '<div class="ct-set set'.++$forum_page['item_count'].'">'."\n\t\t\t\t".'<div class="ct-box">'."\n\t\t\t\t\t".'<h3 class="ct-legend hn">'.$lang_profile['Ban user'].'</h3>'."\n\t\t\t\t".'<p><a href="'.forum_link($forum_url['admin_bans']).'&add_ban='.$id.'">'.$lang_profile['Ban user info'].'</a></p>'."\n\t\t\t\t".'</div>'."\n\t\t\t".'</div>'; |
2520: $forum_page['user_management']['delete'] = '<div class="ct-set set'.++$forum_page['item_count'].'">'."\n\t\t\t\t".'<div class="ct-box">'."\n\t\t\t\t\t".'<h3 class="ct-legend hn">'.$lang_profile['Delete user'].'</h3>'."\n\t\t\t\t".'<p><a href="'.forum_link($forum_url['delete_user'], $id).'">'.$lang_profile['Delete user info'].'</a></p>'."\n\t\t\t\t".'</div>'."\n\t\t\t".'</div>'; | 2526: $forum_page['user_management']['delete'] = '<div class="ct-set set'.++$forum_page['item_count'].'">'."\n\t\t\t\t".'<div class="ct-box">'."\n\t\t\t\t\t".'<h3 class="ct-legend hn">'.$lang_profile['Delete user'].'</h3>'."\n\t\t\t\t".'<p><a href="'.forum_link($forum_url['delete_user'], $id).'">'.$lang_profile['Delete user info'].'</a></p>'."\n\t\t\t\t".'</div>'."\n\t\t\t".'</div>'; |
2521: } | 2527: } |
2522: | 2528: |