You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(95) |
Apr
(270) |
May
(111) |
Jun
|
Jul
|
Aug
(64) |
Sep
(130) |
Oct
(319) |
Nov
(17) |
Dec
(191) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(53) |
Feb
|
Mar
|
Apr
|
May
(6) |
Jun
(387) |
Jul
(102) |
Aug
(247) |
Sep
(120) |
Oct
(1) |
Nov
(8) |
Dec
(21) |
| 2007 |
Jan
(38) |
Feb
(36) |
Mar
|
Apr
(32) |
May
(135) |
Jun
(523) |
Jul
(192) |
Aug
(103) |
Sep
(533) |
Oct
(77) |
Nov
(23) |
Dec
(203) |
| 2008 |
Jan
(312) |
Feb
(1193) |
Mar
(404) |
Apr
(67) |
May
(62) |
Jun
(497) |
Jul
(297) |
Aug
(110) |
Sep
(335) |
Oct
(256) |
Nov
(50) |
Dec
(118) |
| 2009 |
Jan
(67) |
Feb
(10) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(10) |
Jul
(61) |
Aug
|
Sep
(16) |
Oct
(45) |
Nov
(12) |
Dec
(14) |
| 2010 |
Jan
(30) |
Feb
|
Mar
|
Apr
(4) |
May
|
Jun
|
Jul
(7) |
Aug
(7) |
Sep
(5) |
Oct
(5) |
Nov
|
Dec
|
| 2011 |
Jan
(7) |
Feb
(3) |
Mar
(89) |
Apr
(11) |
May
(5) |
Jun
|
Jul
(8) |
Aug
(1) |
Sep
(2) |
Oct
|
Nov
(2) |
Dec
(89) |
| 2012 |
Jan
(7) |
Feb
(1) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(42) |
Nov
(1) |
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(19) |
Apr
(90) |
May
(38) |
Jun
(235) |
Jul
(38) |
Aug
(10) |
Sep
|
Oct
(29) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(6) |
May
(52) |
Jun
|
Jul
(7) |
Aug
|
Sep
(17) |
Oct
|
Nov
|
Dec
|
|
From: Markus P. <mar...@us...> - 2005-04-26 00:08:31
|
Update of /cvsroot/mxbb/core/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23647/templates/subSilver Modified Files: overall_header.tpl Log Message: Fixed site search block. Index: overall_header.tpl =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/overall_header.tpl,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** overall_header.tpl 19 Apr 2005 22:15:21 -0000 1.17 --- overall_header.tpl 26 Apr 2005 00:08:17 -0000 1.18 *************** *** 76,85 **** else if (document.search_block.search_engine.value == 'site') { ! window.open('{U_PORTAL_ROOT_PATH}mx_search.php?mode=results&search_keywords=' + document.search_block.search_keywords.value + '&search_terms=all', '_self', ''); return false; } else if (document.search_block.search_engine.value == 'kb') { ! window.open('{U_PORTAL_ROOT_PATH}modules/mx_kb/kb_search.php?mode=results&search_keywords=' + document.search_block.search_keywords.value + '&search_terms=all', '_self', ''); return false; } --- 76,85 ---- else if (document.search_block.search_engine.value == 'site') { ! window.open('{U_SEARCH_SITE}&search_keywords=' + document.search_block.search_keywords.value, '_self', ''); return false; } else if (document.search_block.search_engine.value == 'kb') { ! window.open('{U_SEARCH_KB}&search_keywords=' + document.search_block.search_keywords.value, '_self', ''); return false; } |
|
From: Markus P. <mar...@us...> - 2005-04-25 23:56:39
|
Update of /cvsroot/mxbb/core/modules/mx_coreblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17977/modules/mx_coreblocks Modified Files: mx_multiple_blocks.php mx_search.php Log Message: Fixed a couple of things and added mouseover effect to pagination. Index: mx_multiple_blocks.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_coreblocks/mx_multiple_blocks.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mx_multiple_blocks.php 20 Apr 2005 00:20:16 -0000 1.8 --- mx_multiple_blocks.php 25 Apr 2005 23:56:08 -0000 1.9 *************** *** 187,191 **** // echo $module_root_path.$block_file; // ! $template = new mx_Template($template->root, $board_config, $db); include($module_root_path . $block_x_file); --- 187,191 ---- // echo $module_root_path.$block_file; // ! $template = new mx_Template($template->root); include($module_root_path . $block_x_file); Index: mx_search.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_coreblocks/mx_search.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mx_search.php 17 Mar 2005 11:30:36 -0000 1.3 --- mx_search.php 25 Apr 2005 23:56:09 -0000 1.4 *************** *** 466,470 **** // $kb_cat = get_info(BLOCK_TABLE, 'block_id', $searchset[$i]['block_id'] ); ! $temp_url = !empty($searchset[$i]['menu_name']) ? append_sid( $mx_root_path . 'index.php?page=' . $page_id . '&dynamic_block=' . $searchset[$i]['block_id'] ) : append_sid( $mx_root_path . 'index.php?page=' . $page_id ); $category = '<a href="' . $temp_url . '" class="name">' .$searchset[$i]['block_title'] . '</a>' . ( !empty($searchset[$i]['menu_name']) ? ' (' . $searchset[$i]['menu_name'] . ')': '' ); --- 466,470 ---- // $kb_cat = get_info(BLOCK_TABLE, 'block_id', $searchset[$i]['block_id'] ); ! $temp_url = !empty($searchset[$i]['menu_name']) ? append_sid( PORTAL_URL . 'index.php?page=' . $page_id . '&dynamic_block=' . $searchset[$i]['block_id'] ) : append_sid( PORTAL_URL . 'index.php?page=' . $page_id ); $category = '<a href="' . $temp_url . '" class="name">' .$searchset[$i]['block_title'] . '</a>' . ( !empty($searchset[$i]['menu_name']) ? ' (' . $searchset[$i]['menu_name'] . ')': '' ); *************** *** 478,482 **** } ! $article_author = '<a href="' . append_sid( $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $searchset[$i]['user_id'] ) . '" class="name">'; $article_author .= $searchset[$i]['username']; $article_author .= '</a>'; --- 478,482 ---- } ! $article_author = '<a href="' . append_sid(PHPBB_URL . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $searchset[$i]['user_id']) . '" class="name">'; $article_author .= $searchset[$i]['username']; $article_author .= '</a>'; |
|
From: Markus P. <mar...@us...> - 2005-04-25 23:56:39
|
Update of /cvsroot/mxbb/core/templates/subSilver In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17977/templates/subSilver Modified Files: mx_addon.css Log Message: Fixed a couple of things and added mouseover effect to pagination. Index: mx_addon.css =================================================================== RCS file: /cvsroot/mxbb/core/templates/subSilver/mx_addon.css,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** mx_addon.css 6 Mar 2005 01:10:16 -0000 1.5 --- mx_addon.css 25 Apr 2005 23:56:09 -0000 1.6 *************** *** 30,33 **** --- 30,50 ---- } + /* This is the border around numbers in pagination */ + .mx_pagination, .mx_pagination_sele, .mx_pagination_over { + padding-left: 2px; + padding-right: 2px; + border-top: 1px solid #B0B0B0; + border-right: 1px solid #B0B0B0; + border-bottom: 1px solid #B0B0B0; + border-left: 1px solid #B0B0B0; + text-decoration: none; + } + .mx_pagination_sele { + background-color: #E0E0E0; + } + .mx_pagination_over { + background-color: #F0F0F0; + } + /* These are the main mx column styles */ td.leftcol { |
|
From: Markus P. <mar...@us...> - 2005-04-25 23:56:33
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17977/includes Modified Files: mx_functions.php mx_functions_phpbb.php Log Message: Fixed a couple of things and added mouseover effect to pagination. Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mx_functions_phpbb.php 25 Apr 2005 12:07:20 -0000 1.8 --- mx_functions_phpbb.php 25 Apr 2005 23:56:08 -0000 1.9 *************** *** 602,608 **** } ! $previous_string = $use_next_symbol ? '«' : $lang['Previous']; ! $next_string = $use_previous_symbol ? '»' : $lang['Next']; ! $on_page = floor($start_item / $per_page) + 1; --- 602,610 ---- } ! $previous_string = $use_next_symbol ? '«' : $lang['Previous']; ! $next_string = $use_previous_symbol ? '»' : $lang['Next']; ! ! $class = 'class="mx_pagination" onmouseover="if(this.className){this.className=\'mx_pagination_over\';}" onmouseout="if(this.className){this.className=\'mx_pagination\';}"'; ! $on_page = floor($start_item / $per_page) + 1; *************** *** 614,618 **** for($i = 1; $i < $init_page_max + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max ) { --- 616,620 ---- for($i = 1; $i < $init_page_max + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b class="mx_pagination_sele">' . $i . '</b>' : '<a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max ) { *************** *** 632,636 **** for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { ! $page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max + 1 ) { --- 634,638 ---- for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { ! $page_string .= ($i == $on_page) ? '<b class="mx_pagination_sele">' . $i . '</b>' : '<a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $init_page_max + 1 ) { *************** *** 648,652 **** for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if( $i < $total_pages ) { --- 650,654 ---- for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b class="mx_pagination_sele">' . $i . '</b>' : '<a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if( $i < $total_pages ) { *************** *** 660,664 **** for($i = 1; $i < $total_pages + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $total_pages ) { --- 662,666 ---- for($i = 1; $i < $total_pages + 1; $i++) { ! $page_string .= ( $i == $on_page ) ? '<b class="mx_pagination_sele">' . $i . '</b>' : '<a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>'; if ( $i < $total_pages ) { *************** *** 672,681 **** if ( $on_page > 1 ) { ! $page_string = ' <a href="' . append_sid($base_url . "&".$name_id."=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $previous_string . '</a> ' . $page_string; } if ( $on_page < $total_pages ) { ! $page_string .= ' <a href="' . append_sid($base_url . "&".$name_id."=" . ( $on_page * $per_page ) ) . '">' . $next_string . '</a>'; } --- 674,683 ---- if ( $on_page > 1 ) { ! $page_string = ' <a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $previous_string . '</a> ' . $page_string; } if ( $on_page < $total_pages ) { ! $page_string .= ' <a '.$class.' href="' . append_sid($base_url . "&".$name_id."=" . ( $on_page * $per_page ) ) . '">' . $next_string . '</a>'; } Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** mx_functions.php 25 Apr 2005 20:50:04 -0000 1.40 --- mx_functions.php 25 Apr 2005 23:56:08 -0000 1.41 *************** *** 34,37 **** --- 34,38 ---- * - mx_url * - mx_this_url + * - mx_session_start * - post_icons * - get_page_id *************** *** 443,459 **** $numargs = func_num_args(); ! $url = $PHP_SELF . '?' . $_SERVER['QUERY_STRING']; ! $url = parse_url( $url ); $url_array = array(); ! if ( ! empty( $url['query'] ) ) { ! $url_array = explode( "&", $url['query'] ); } $arg_list = func_get_args(); // Check for each option if exists in the parameter list ! for ( $i = 0; $i < $numargs; $i++ ) { $option = $arg_list[$i]; --- 444,460 ---- $numargs = func_num_args(); ! $url = $PHP_SELF . '?' . $HTTP_SERVER_VARS['QUERY_STRING']; ! $url = parse_url($url); $url_array = array(); ! if( ! empty($url['query']) ) { ! $url_array = explode('&', $url['query']); } $arg_list = func_get_args(); // Check for each option if exists in the parameter list ! for( $i = 0; $i < $numargs; $i++ ) { $option = $arg_list[$i]; *************** *** 462,478 **** // If not exists in the parameter list then add the parameter $opt_fund = false; ! for ( $j = 0; $j < count( $url_array ); $j++ ) { ! $tmp = explode( "=", $url_array[$j] ); ! if ( $option == $tmp[0] ) { ! $url_array[$j] = $option . "=" . $value ; $opt_fund = true; } } ! if ( !$opt_fund ) { ! $next = count( $url_array ); ! $url_array[$next] = $option . "=" . $value ; } } --- 463,479 ---- // If not exists in the parameter list then add the parameter $opt_fund = false; ! for( $j = 0; $j < count($url_array); $j++ ) { ! $tmp = explode('=', $url_array[$j]); ! if( $option == $tmp[0] ) { ! $url_array[$j] = $option . '=' . $value ; $opt_fund = true; } } ! if( !$opt_fund ) { ! $next = count($url_array); ! $url_array[$next] = $option . '=' . $value ; } } *************** *** 480,492 **** $url = $url[path]; // Build the parameter list ! if ( ! strpos( $url, "?" ) ) { ! $url .= "?"; } ! $url .= implode( '&' , $url_array ); /* for ($j = 0; $j < count($url_array); $j++) { ! if ( $j < count($url_array) -1 ) { $url .= $url_array[$j] . "&" ; --- 481,493 ---- $url = $url[path]; // Build the parameter list ! if( !strpos($url, '?') ) { ! $url .= '?'; } ! $url .= implode('&', $url_array); /* for ($j = 0; $j < count($url_array); $j++) { ! if( $j < count($url_array) -1 ) { $url .= $url_array[$j] . "&" ; *************** *** 498,504 **** } */ ! $url = str_replace( '?&', "?", $url ); ! $url = str_replace( '.php&', ".php?", $url ); ! return ( $url ); } --- 499,505 ---- } */ ! $url = str_replace('?&', '?', $url); ! $url = str_replace('.php&', ".php?", $url); ! return $url; } *************** *** 508,516 **** | ...function based on original function written by Markus :-) \********************************************************************************/ ! function mx_this_url( $args = '', $force_standalone_mode = false, $file = '' ) { global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; ! if ( $force_standalone_mode ) { $mxurl = ( $file == '' ? "./" : $file . '/' ) . ( $args == '' ? '' : '?' . $args ); --- 509,517 ---- | ...function based on original function written by Markus :-) \********************************************************************************/ ! function mx_this_url($args = '', $force_standalone_mode = false, $file = '') { global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; ! if( $force_standalone_mode ) { $mxurl = ( $file == '' ? "./" : $file . '/' ) . ( $args == '' ? '' : '?' . $args ); *************** *** 519,523 **** { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if ( is_numeric( $page_id ) ) { $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : '&' . $args ); --- 520,524 ---- { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if( is_numeric($page_id) ) { $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : '&' . $args ); |
|
From: Markus P. <mar...@us...> - 2005-04-25 23:56:33
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17977 Modified Files: index.php Log Message: Fixed a couple of things and added mouseover effect to pagination. Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/index.php,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** index.php 25 Apr 2005 12:02:42 -0000 1.35 --- index.php 25 Apr 2005 23:56:07 -0000 1.36 *************** *** 85,96 **** $is_auth_ary = page_auth(AUTH_VIEW, $userdata, $page_row['page_auth_view'], $page_row['page_auth_view_group']); ! if ( !$is_auth_ary['auth_view'] && $userdata['session_logged_in'] ) ! { ! $message = empty($lang['Page_Not_Authorised']) ? "Sorry, but you don't have privilege to access this page." : $lang['Page_Not_Authorised']; ! mx_message_die(GENERAL_MESSAGE, $message, '', __LINE__, __FILE__, ''); ! } ! elseif ( !$is_auth_ary['auth_view'] && !$userdata['session_logged_in'] ) { ! mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=" . mx_this_url(), true)); } --- 85,99 ---- $is_auth_ary = page_auth(AUTH_VIEW, $userdata, $page_row['page_auth_view'], $page_row['page_auth_view_group']); ! if( !$is_auth_ary['auth_view'] ) { ! if( $userdata['session_logged_in'] ) ! { ! $message = empty($lang['Page_Not_Authorised']) ? "Sorry, but you don't have privilege to access this page." : $lang['Page_Not_Authorised']; ! mx_message_die(GENERAL_MESSAGE, $message); ! } ! else ! { ! mx_redirect(append_sid($mx_root_path . "login.$phpEx?redirect=" . mx_this_url(), true)); ! } } *************** *** 103,107 **** // Initialize template // ! $layouttemplate = new mx_Template($template->root, $board_config, $db); $layouttemplate->set_filenames(array( --- 106,110 ---- // Initialize template // ! $layouttemplate = new mx_Template($template->root); $layouttemplate->set_filenames(array( |
|
From: Markus P. <mar...@us...> - 2005-04-25 22:17:09
|
Update of /cvsroot/mxbb/core/modules/mx_statistics/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26612 Modified Files: mx_statistics.tpl Log Message: Fixed template for statistics blocks. Index: mx_statistics.tpl =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_statistics/templates/mx_statistics.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mx_statistics.tpl 25 Apr 2005 22:07:09 -0000 1.4 --- mx_statistics.tpl 25 Apr 2005 22:16:37 -0000 1.5 *************** *** 1,105 **** ! <table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> ! <tr> ! <td class="catHead" align="center" colspan="4"> ! <span class="cattitle">{L_ADMIN_STATISTICS}</span> ! </td> ! </tr> ! <tr> ! <th width="25%" class="thCornerL" align="center"><strong>{L_STATISTIC}</strong></td> ! <th width="25%" class="thTop" align="center"><strong>{L_VALUE}</strong></td> ! <th width="25%" class="thTop" align="center"><strong>{L_STATISTIC}</strong></td> ! <th width="25%" class="thCornerR" align="center"><strong>{L_VALUE}</strong></td> ! </tr> ! ! <!-- BEGIN adminrow --> ! <tr> ! <td class="row2" align="center"><span class="gen">{adminrow.STATISTIC}</span></td> ! <td class="row1" width="25%" align="center"><span class="gen">{adminrow.VALUE}</span></td> ! <td class="row2" align="center"><span class="gen">{adminrow.STATISTIC2}</span></td> ! <td class="row1" width="25%" align="center"><span class="gen">{adminrow.VALUE2}</span></td> ! </tr> ! <!-- END adminrow --> ! </table> ! <br /> ! <table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> ! <tr> ! <td class="catHead" align="center" colspan="5"> ! <span class="cattitle">{L_TOP_POSTERS}</span> ! </td> ! </tr> ! <tr> ! <th class="thCornerL" align="center"><strong>{L_RANK}</strong></th> ! <th class="thTop" align="center" width="10%"><strong>{L_USERNAME}</strong></th> ! <th class="thTop" align="center" width="10%"><strong>{L_POSTS}</strong></th> ! <th class="thTop" align="center" width="10%"><strong>{L_PERCENTAGE}</strong></th> ! <th class="thCornerR" align="center" width="50%"><strong>{L_GRAPH}</strong></th> ! </tr> ! <!-- BEGIN users --> ! <tr> ! <td class="{users.CLASS}" align="left" width="10%"><span class="gen">{users.RANK}</span></td> ! <td class="{users.CLASS}" align="left" width="10%"><span class="gen"><a href="{users.URL}">{users.USERNAME}</a></span></td> ! <td class="{users.CLASS}" align="center" width="10%"><span class="gen">{users.POSTS}</span></td> ! <td class="{users.CLASS}" align="center" width="10%"><span class="gen">{users.PERCENTAGE}%</span></td> ! <td class="{users.CLASS}" align="left" width="50%"> ! <table cellspacing="0" cellpadding="0" border="0" align="left"> ! <tr> ! <td align="right"><img src="{LEFT_GRAPH_IMAGE}" width="4" height="12" /></td> ! </tr> ! </table> ! <table cellspacing="0" cellpadding="0" border="0" align="left" width="{users.BAR}%"> ! <tr> ! <td><img src="{GRAPH_IMAGE}" width="100%" height="12" /></td> ! </tr> ! </table> ! <table cellspacing="0" cellpadding="0" border="0" align="left"> ! <tr> ! <td align="left"><img src="{RIGHT_GRAPH_IMAGE}" width="4" height="12" /></td> ! </tr> ! </table> ! </td> ! </tr> ! <!-- END users --> ! </table> ! <br /> ! <table width="100%" border="0" cellspacing="5" cellpadding="0"> ! <tr> ! <td valign="top" width="50%"> ! <table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> ! <tr> ! <td class="catHead" align="center" colspan="3"><span class="cattitle">{L_MOST_VIEWED}</span></td> ! </tr> ! <tr> ! <th colspan="1" class="thCornerL" align="left"><strong>{L_RANK}</strong></th> ! <th class="thTop" align="center"><strong>{L_VIEWS}</strong></th> ! <th class="thCornerR" align="center"><strong>{L_TOPIC}</strong></th> ! <!-- BEGIN topicviews --> ! <tr> ! <td class="{topicviews.CLASS}" align="left" width="5%"><span class="gen">{topicviews.RANK}</span></td> ! <td class="{topicviews.CLASS}" align="center" width="20%"><span class="gen">{topicviews.VIEWS}</span></td> ! <td class="{topicviews.CLASS}" align="left"><span class="gen"><a href="{topicviews.URL}">{topicviews.TITLE}</a></span></td> ! </tr> ! <!-- END topicviews --> ! </table> ! </td> ! <td valign="top" width="50%"> ! <table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> ! <tr> ! <td class="catHead" align="center" colspan="3" height="28"> <span class="cattitle">{L_MOST_ACTIVE}</span> ! </td> ! </tr> ! <tr> ! <th colspan="1" class="thCornerL" align="left"><strong>{L_RANK}</strong></th> ! <th class="thTop" align="center"><strong>{L_REPLIES}</strong></th> ! <th class="thCornerR" align="center"><strong>{L_TOPIC}</strong></th> ! </tr> ! <!-- BEGIN topicreplies --> ! <tr> ! <td class="{topicreplies.CLASS}" align="left" width="5%"><span class="gen">{topicreplies.RANK}</span></td> ! <td class="{topicreplies.CLASS}" align="center" width="20%"><span class="gen">{topicreplies.REPLIES}</span></td> ! <td class="{topicreplies.CLASS}" align="left"><span class="gen"><a href="{topicreplies.URL}">{topicreplies.TITLE}</a></span></td> ! </tr> ! <!-- END topicreplies --> ! </table> ! </td> ! </tr> ! </table> --- 1,104 ---- ! <table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> ! <tr> ! <td class="catHead" align="center" colspan="4"> ! <span class="cattitle">{L_ADMIN_STATISTICS}</span> ! </td> ! </tr> ! <tr> ! <th width="25%" class="thCornerL" align="center"><strong>{L_STATISTIC}</strong></td> ! <th width="25%" class="thTop" align="center"><strong>{L_VALUE}</strong></td> ! <th width="25%" class="thTop" align="center"><strong>{L_STATISTIC}</strong></td> ! <th width="25%" class="thCornerR" align="center"><strong>{L_VALUE}</strong></td> ! </tr> ! <!-- BEGIN adminrow --> ! <tr> ! <td class="row2" align="center"><span class="gen">{adminrow.STATISTIC}</span></td> ! <td class="row1" width="25%" align="center"><span class="gen">{adminrow.VALUE}</span></td> ! <td class="row2" align="center"><span class="gen">{adminrow.STATISTIC2}</span></td> ! <td class="row1" width="25%" align="center"><span class="gen">{adminrow.VALUE2}</span></td> ! </tr> ! <!-- END adminrow --> ! </table> ! <br clear="all" /> ! <table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> ! <tr> ! <td class="catHead" align="center" colspan="5"> ! <span class="cattitle">{L_TOP_POSTERS}</span> ! </td> ! </tr> ! <tr> ! <th class="thCornerL" align="center"><strong>{L_RANK}</strong></th> ! <th class="thTop" align="center" width="10%"><strong>{L_USERNAME}</strong></th> ! <th class="thTop" align="center" width="10%"><strong>{L_POSTS}</strong></th> ! <th class="thTop" align="center" width="10%"><strong>{L_PERCENTAGE}</strong></th> ! <th class="thCornerR" align="center" width="50%"><strong>{L_GRAPH}</strong></th> ! </tr> ! <!-- BEGIN users --> ! <tr> ! <td class="{users.CLASS}" align="left" width="10%"><span class="gen">{users.RANK}</span></td> ! <td class="{users.CLASS}" align="left" width="10%"><span class="gen"><a href="{users.URL}">{users.USERNAME}</a></span></td> ! <td class="{users.CLASS}" align="center" width="10%"><span class="gen">{users.POSTS}</span></td> ! <td class="{users.CLASS}" align="center" width="10%"><span class="gen">{users.PERCENTAGE}%</span></td> ! <td class="{users.CLASS}" align="left" width="50%"> ! <table cellspacing="0" cellpadding="0" border="0" align="left"> ! <tr> ! <td align="right"><img src="{LEFT_GRAPH_IMAGE}" width="4" height="12" /></td> ! </tr> ! </table> ! <table cellspacing="0" cellpadding="0" border="0" align="left" width="{users.BAR}%"> ! <tr> ! <td><img src="{GRAPH_IMAGE}" width="100%" height="12" /></td> ! </tr> ! </table> ! <table cellspacing="0" cellpadding="0" border="0" align="left"> ! <tr> ! <td align="left"><img src="{RIGHT_GRAPH_IMAGE}" width="4" height="12" /></td> ! </tr> ! </table> ! </td> ! </tr> ! <!-- END users --> ! </table> ! <br clear="all" /> ! <table width="100%" border="0" cellspacing="0" cellpadding="0"> ! <tr> ! <td valign="top" width="50%" style="padding-right:2px;"> ! <table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> ! <tr> ! <td class="catHead" align="center" colspan="3"><span class="cattitle">{L_MOST_VIEWED}</span></td> ! </tr> ! <tr> ! <th colspan="1" class="thCornerL" align="left"><strong>{L_RANK}</strong></th> ! <th class="thTop" align="center"><strong>{L_VIEWS}</strong></th> ! <th class="thCornerR" align="center"><strong>{L_TOPIC}</strong></th> ! </tr> ! <!-- BEGIN topicviews --> ! <tr> ! <td class="{topicviews.CLASS}" align="left" width="5%"><span class="gen">{topicviews.RANK}</span></td> ! <td class="{topicviews.CLASS}" align="center" width="20%"><span class="gen">{topicviews.VIEWS}</span></td> ! <td class="{topicviews.CLASS}" align="left"><span class="gen"><a href="{topicviews.URL}">{topicviews.TITLE}</a></span></td> ! </tr> ! <!-- END topicviews --> ! </table> ! </td> ! <td valign="top" width="50%" style="padding-left:2px;"> ! <table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> ! <tr> ! <td class="catHead" align="center" colspan="3" height="28"> <span class="cattitle">{L_MOST_ACTIVE}</span></td> ! </tr> ! <tr> ! <th colspan="1" class="thCornerL" align="left"><strong>{L_RANK}</strong></th> ! <th class="thTop" align="center"><strong>{L_REPLIES}</strong></th> ! <th class="thCornerR" align="center"><strong>{L_TOPIC}</strong></th> ! </tr> ! <!-- BEGIN topicreplies --> ! <tr> ! <td class="{topicreplies.CLASS}" align="left" width="5%"><span class="gen">{topicreplies.RANK}</span></td> ! <td class="{topicreplies.CLASS}" align="center" width="20%"><span class="gen">{topicreplies.REPLIES}</span></td> ! <td class="{topicreplies.CLASS}" align="left"><span class="gen"><a href="{topicreplies.URL}">{topicreplies.TITLE}</a></span></td> ! </tr> ! <!-- END topicreplies --> ! </table> ! </td> ! </tr> ! </table> \ No newline at end of file |
|
From: Markus P. <mar...@us...> - 2005-04-25 22:07:21
|
Update of /cvsroot/mxbb/core/modules/mx_statistics/templates In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21170 Modified Files: mx_statistics.tpl Log Message: Fixed double line-break in between statistics blocks. Index: mx_statistics.tpl =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_statistics/templates/mx_statistics.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mx_statistics.tpl 9 Jan 2005 21:52:39 -0000 1.3 --- mx_statistics.tpl 25 Apr 2005 22:07:09 -0000 1.4 *************** *** 22,26 **** </table> <br /> - <br /> <table border="0" cellpadding="4" cellspacing="1" class="forumline" width="100%"> <tr> --- 22,25 ---- *************** *** 63,67 **** </table> <br /> - <br /> <table width="100%" border="0" cellspacing="5" cellpadding="0"> <tr> --- 62,65 ---- |
|
From: Markus P. <mar...@us...> - 2005-04-25 22:05:14
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20048 Modified Files: page_tail.php Log Message: Fixed typo in page_tail. Index: page_tail.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_tail.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** page_tail.php 20 Apr 2005 00:20:15 -0000 1.14 --- page_tail.php 25 Apr 2005 22:04:49 -0000 1.15 *************** *** 63,67 **** 'U_EDIT_NAV' => $edit_nav_icon_url, 'ADMIN_OPTIONS' => $lang['Show_admin_options'], ! 'MX_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? '2' . PORTAL_VERSION : '', 'PHPBB_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? '2' . $board_config['version'] : '', 'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', --- 63,67 ---- 'U_EDIT_NAV' => $edit_nav_icon_url, 'ADMIN_OPTIONS' => $lang['Show_admin_options'], ! 'MX_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? PORTAL_VERSION : '', 'PHPBB_VERSION' => ($userdata['user_level'] == ADMIN && $userdata['user_id'] != ANONYMOUS) ? '2' . $board_config['version'] : '', 'TRANSLATION_INFO' => ( isset($lang['TRANSLATION_INFO']) ) ? $lang['TRANSLATION_INFO'] : '', |
|
From: Markus P. <mar...@us...> - 2005-04-25 21:49:02
|
Update of /cvsroot/mxbb/core/modules/mx_coreblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11245 Modified Files: mx_forum.php Log Message: Fixed Forum block (from movement to modules/mx_coreblocks folder). Index: mx_forum.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_coreblocks/mx_forum.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mx_forum.php 19 Apr 2005 20:43:21 -0000 1.6 --- mx_forum.php 25 Apr 2005 21:48:36 -0000 1.7 *************** *** 25,29 **** { define('IN_PORTAL', 1); ! $mx_root_path = './'; $include_page_tail = 1; --- 25,29 ---- { define('IN_PORTAL', 1); ! $mx_root_path = '../../'; $include_page_tail = 1; *************** *** 276,280 **** $template->assign_vars(array( ! 'BLOCK_SIZE' => $block_size, 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, --- 276,280 ---- $template->assign_vars(array( ! 'BLOCK_SIZE' => ( !empty($block_size) ? $block_size : '100%' ), 'U_PHPBB_ROOT_PATH' => PHPBB_URL, 'TEMPLATE_ROOT_PATH' => TEMPLATE_ROOT_PATH, *************** *** 305,309 **** 'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'], ! 'U_MARK_READ' => append_sid(PORTAL_URL . "mx_forum.$phpEx?mark=forums")) ); --- 305,309 ---- 'L_MARK_FORUMS_READ' => $lang['Mark_all_forums'], ! 'U_MARK_READ' => append_sid(PORTAL_URL . "modules/mx_coreblocks/mx_forum.$phpEx?mark=forums")) ); |
|
From: Markus P. <mar...@us...> - 2005-04-25 21:33:07
|
Update of /cvsroot/mxbb/core/modules/mx_coreblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3946 Modified Files: mx_poll.php Log Message: Fixed small bug in Poll block. Index: mx_poll.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_coreblocks/mx_poll.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** mx_poll.php 19 Apr 2005 21:02:53 -0000 1.18 --- mx_poll.php 25 Apr 2005 21:32:41 -0000 1.19 *************** *** 166,170 **** { $block_rows[$block]['show_title'] = 0; ! $block_rows[$block]['show_block'] = 0; return; //message_die(GENERAL_ERROR, "Could not obtain vote data for this topic", '', __LINE__, __FILE__, $sql); } --- 166,170 ---- { $block_rows[$block]['show_title'] = 0; ! $block_rows[$block]['show_block'] = 0; return; //message_die(GENERAL_ERROR, "Could not obtain vote data for this topic", '', __LINE__, __FILE__, $sql); } *************** *** 184,187 **** --- 184,189 ---- if ( !($result = $db->sql_query($sql)) ) { + $block_rows[$block]['show_title'] = 0; + $block_rows[$block]['show_block'] = 0; return; //message_die(GENERAL_ERROR, "Could not obtain user vote data for this topic", '', __LINE__, __FILE__, $sql); } *************** *** 297,305 **** $template->pparse('pollbox'); } ! } ! else ! { ! $block_rows[$block]['show_title'] = 0; ! $block_rows[$block]['show_block'] = 0; } --- 299,307 ---- $template->pparse('pollbox'); } ! else ! { ! $block_rows[$block]['show_title'] = 0; ! $block_rows[$block]['show_block'] = 0; ! } } |
|
From: Markus P. <mar...@us...> - 2005-04-25 20:55:14
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17096 Modified Files: mx_auth.php Log Message: Fixed typo in get_auth_forum(). Index: mx_auth.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_auth.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_auth.php 25 Apr 2005 01:27:20 -0000 1.7 --- mx_auth.php 25 Apr 2005 20:55:06 -0000 1.8 *************** *** 364,368 **** // passing AUTH_LIST_ALL will load info for all forums at once. // ! if( $mode = 'kb' ) { include_once($mx_root_path . 'modules/mx_kb/includes/functions_kb_auth.' . $phpEx); --- 364,368 ---- // passing AUTH_LIST_ALL will load info for all forums at once. // ! if( $mode == 'kb' ) { include_once($mx_root_path . 'modules/mx_kb/includes/functions_kb_auth.' . $phpEx); |
|
From: Markus P. <mar...@us...> - 2005-04-25 20:50:36
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14283/admin Modified Files: page_header_admin.php Log Message: Fixed usage of mx_session_start(); Index: page_header_admin.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/page_header_admin.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** page_header_admin.php 19 Apr 2005 21:36:37 -0000 1.7 --- page_header_admin.php 25 Apr 2005 20:50:04 -0000 1.8 *************** *** 30,33 **** --- 30,39 ---- define('HEADER_INC', true); + /********** + NOTE: + + The following code related to GZIP initialization has been moved to + the new mx_session_start() function, declared in mx_functions.php + // // gzip_compression *************** *** 63,66 **** --- 69,73 ---- } } + **********/ $template->set_filenames(array( |
|
From: Markus P. <mar...@us...> - 2005-04-25 20:50:35
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14283/includes Modified Files: mx_functions.php page_header.php Log Message: Fixed usage of mx_session_start(); Index: page_header.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/page_header.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** page_header.php 19 Apr 2005 23:36:24 -0000 1.18 --- page_header.php 25 Apr 2005 20:50:05 -0000 1.19 *************** *** 29,32 **** --- 29,38 ---- define('HEADER_INC', true); + /********** + NOTE: + + The following code related to GZIP initialization has been moved to + the new mx_session_start() function, declared in mx_functions.php + // // gzip_compression *************** *** 62,65 **** --- 68,72 ---- } } + **********/ // Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** mx_functions.php 25 Apr 2005 01:27:20 -0000 1.39 --- mx_functions.php 25 Apr 2005 20:50:04 -0000 1.40 *************** *** 532,535 **** --- 532,600 ---- /********************************************************************************\ + | PHP Sessions Management + | If necessary, GZIP initialization should be done before session_start(). + \********************************************************************************/ + function mx_session_start() + { + global $board_config, $HTTP_SERVER_VARS, $do_gzip_compress; + + // + // Prevent from doing the job more than once. + // + static $_been_here_before = false; + + if ( $_been_here_before ) + { + return; + } + $_been_here_before = true; + + // + // gzip_compression + // + + // + // declared in common.php, just before calling mx_session_start. ;-) + // + // $do_gzip_compress = FALSE; + + if ( $board_config['gzip_compress'] ) + { + $phpver = phpversion(); + + $useragent = (isset($HTTP_SERVER_VARS['HTTP_USER_AGENT'])) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT'); + + if ( $phpver >= '4.0.4pl1' && ( strstr($useragent,'compatible') || strstr($useragent,'Gecko') ) ) + { + if ( extension_loaded('zlib') ) + { + ob_end_clean(); + ob_start('ob_gzhandler'); + } + } + else if ( $phpver > '4.0' ) + { + if ( strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip') ) + { + if ( extension_loaded('zlib') ) + { + $do_gzip_compress = TRUE; + ob_start(); + ob_implicit_flush(0); + + header('Content-Encoding: gzip'); + } + } + } + } + + // + // Initialize PHP session + // + session_start(); + + } + + /********************************************************************************\ | Generate icon lists | Snatched frompafilDB |
|
From: Markus P. <mar...@us...> - 2005-04-25 12:19:17
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24336/admin Modified Files: admin_mx_gen_cache.php Log Message: Fixed usage of mx_session_start(); Index: admin_mx_gen_cache.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/admin_mx_gen_cache.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** admin_mx_gen_cache.php 3 Apr 2005 16:45:15 -0000 1.14 --- admin_mx_gen_cache.php 25 Apr 2005 12:18:44 -0000 1.15 *************** *** 57,61 **** else { - @session_start(); $HTTP_SESSION_VARS['cache_read'] = false; $cache_dir = $mx_root_path . 'cache/'; --- 57,60 ---- |
|
From: Markus P. <mar...@us...> - 2005-04-25 12:19:17
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24336 Modified Files: common.php Log Message: Fixed usage of mx_session_start(); Index: common.php =================================================================== RCS file: /cvsroot/mxbb/core/common.php,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** common.php 25 Apr 2005 01:40:00 -0000 1.32 --- common.php 25 Apr 2005 12:18:43 -0000 1.33 *************** *** 26,30 **** define('IN_PHPBB', 1); ! @session_start(); // ================================================================================ --- 26,30 ---- define('IN_PHPBB', 1); ! // ================================================================================ *************** *** 270,273 **** --- 270,281 ---- } + + // + // Initialize GZIP handler (if necessary) and PHP sessions + // + $do_gzip_compress = FALSE; + mx_session_start(); // Note: this needs $board_config populated! + + //++ MX System // |
|
From: Markus P. <mar...@us...> - 2005-04-25 12:11:20
|
Update of /cvsroot/mxbb/core/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20676/admin Modified Files: index.php Log Message: Fixed ViewOnline extension for mxBB Portal Pages Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/admin/index.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.php 9 Jan 2005 21:55:44 -0000 1.4 --- index.php 25 Apr 2005 12:10:43 -0000 1.5 *************** *** 25,47 **** */ ! define( 'IN_PORTAL', 1 ); ! $mx_root_path = '../'; // Load default header - $no_page_header = true; - - require( './pagestart.php' ); [...1338 lines suppressed...] ! // ! $template->set_filenames(array( ! "body" => "admin/index_frameset.tpl") ! ); ! $template->assign_vars(array( ! "S_FRAME_NAV" => append_sid("index.$phpEx?pane=left"), ! "S_FRAME_MAIN" => append_sid("index.$phpEx?pane=right")) ! ); ! header ("Expires: " . gmdate("D, d M Y H:i:s", time()) . " GMT"); ! header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); ! $template->pparse("body"); $db->sql_close(); exit; + } |
|
From: Markus P. <mar...@us...> - 2005-04-25 12:07:30
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19498 Modified Files: mx_functions_phpbb.php Log Message: Fixed ViewOnline extension for mxBB Portal Pages Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_functions_phpbb.php 24 Apr 2005 21:33:36 -0000 1.7 --- mx_functions_phpbb.php 25 Apr 2005 12:07:20 -0000 1.8 *************** *** 534,537 **** --- 534,590 ---- // + // ViewOnline extension for mxBB Portal Pages... + // + function mx_get_viewonline_info($session_page) + { + global $db, $lang, $phpEx; + + // + // Cache Page Information in static variables. + // + static $mx_pages_data = false, $mx_pages_count = 0; + + // + // Prevent from reading pages information more than once. + // + if( $pages_data === false ) + { + $sql = "SELECT page_id, page_name FROM " . PAGE_TABLE . " ORDER BY page_id"; + if( !($result = $db->sql_query($sql)) ) + { + $mx_pages_count = 0; + } + else + { + $mx_pages_count = $db->sql_numrows($result); + $mx_pages_data = $db->sql_fetchrowset($result); + } + } + + // + // Compute Page Identifier + // + $page_id = MX_PORTAL_PAGES_OFFSET - $session_page; + + // + // Return array($location, $location_url) OR false when page not found. + // + if( $page_id > 0 && $mx_pages_count > 0 ) + { + for( $i = 0; $i < $mx_pages_count; $i++ ) + { + if( $mx_pages_data[$i]['page_id'] == $page_id ) + { + return array( + $lang['Page'] . ': ' . $mx_pages_data[$i]['page_name'], + PORTAL_URL . "index.$phpEx?page=" . $mx_pages_data[$i]['page_id'] + ); + } + } + } + return false; + } + + // // Pagination routine, generates // page number sequence |
|
From: Markus P. <mar...@us...> - 2005-04-25 12:03:17
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17112 Modified Files: mx_constants.php Log Message: Fixed ViewOnline extension for mxBB Portal Pages Index: mx_constants.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_constants.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mx_constants.php 25 Apr 2005 01:27:20 -0000 1.13 --- mx_constants.php 25 Apr 2005 12:03:05 -0000 1.14 *************** *** 25,28 **** --- 25,34 ---- // + // ViewOnline extension for mxBB Portal Pages + // + define('MX_PORTAL_PAGES_OFFSET', -100000); + + + // // mxBB Core table names // |
|
From: Markus P. <mar...@us...> - 2005-04-25 12:02:55
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16608 Modified Files: index.php Log Message: Fixed ViewOnline extension for mxBB Portal Pages Index: index.php =================================================================== RCS file: /cvsroot/mxbb/core/index.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** index.php 20 Apr 2005 00:20:13 -0000 1.34 --- index.php 25 Apr 2005 12:02:42 -0000 1.35 *************** *** 40,44 **** // Start session management // ! $userdata = session_pagestart($user_ip, - ( 1000 + $page_id )); mx_init_userprefs($userdata); --- 40,44 ---- // Start session management // ! $userdata = session_pagestart($user_ip, (MX_PORTAL_PAGES_OFFSET - $page_id)); mx_init_userprefs($userdata); |
|
From: Markus P. <mar...@us...> - 2005-04-25 01:55:06
|
Update of /cvsroot/mxbb/core/modules/mx_statistics In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1082 Modified Files: mx_statistics.php Log Message: Fix: prevent statistics block from sending page footer in block mode. Index: mx_statistics.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_statistics/mx_statistics.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mx_statistics.php 9 Jan 2005 21:52:38 -0000 1.8 --- mx_statistics.php 25 Apr 2005 01:54:57 -0000 1.9 *************** *** 35,39 **** // End session management ! $block = false; } else --- 35,39 ---- // End session management ! $is_block = false; } else *************** *** 46,50 **** $title = $block_config[$block_id]['block_title']; ! $block = true; } --- 46,50 ---- $title = $block_config[$block_id]['block_title']; ! $is_block = true; } *************** *** 432,436 **** $page_title = $lang['Statistics']; ! if ( !$block ) { include( $mx_root_path . 'includes/page_header.' . $phpEx ); --- 432,436 ---- $page_title = $lang['Statistics']; ! if ( !$is_block ) { include( $mx_root_path . 'includes/page_header.' . $phpEx ); *************** *** 439,443 **** $template->pparse( "body" ); ! if ( !$block ) { include( $mx_root_path . 'includes/page_tail.' . $phpEx ); --- 439,443 ---- $template->pparse( "body" ); ! if ( !$is_block ) { include( $mx_root_path . 'includes/page_tail.' . $phpEx ); |
|
From: Markus P. <mar...@us...> - 2005-04-25 01:40:20
|
Update of /cvsroot/mxbb/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25930 Modified Files: common.php Log Message: Added basic support for CH210 (ported from 2.7.6) Index: common.php =================================================================== RCS file: /cvsroot/mxbb/core/common.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** common.php 20 Apr 2005 00:20:13 -0000 1.31 --- common.php 25 Apr 2005 01:40:00 -0000 1.32 *************** *** 9,15 **** * description : * ------------------------------------------------------------------------- ! * copyright : (C) 2001 The phpBB Group ! * email : su...@ph... ! * * $Id$ */ --- 9,13 ---- * description : * ------------------------------------------------------------------------- ! * * $Id$ */ *************** *** 22,33 **** */ ! if ( !defined( 'IN_PORTAL' ) ) { ! die( "Hacking attempt" ); } ! define( 'IN_PHPBB', 1 ); @session_start(); error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables set_magic_quotes_runtime(0); // Disable magic_quotes_runtime --- 20,36 ---- */ ! if ( !defined('IN_PORTAL') ) { ! die("Hacking attempt"); } ! define('IN_PHPBB', 1); @session_start(); + // ================================================================================ + // The following code is based on common.php from phpBB 2.0.14 + // ================================================================================ + + // error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables set_magic_quotes_runtime(0); // Disable magic_quotes_runtime *************** *** 59,62 **** --- 62,68 ---- // we can validate later with isset($test[$var]) (no in_array()) $test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL); + //+MOD: Added by mxBB + $test['mx_root_path'] = NULL; + //-MOD: Added by mxBB // Loop through each input array *************** *** 78,81 **** --- 84,90 ---- // PHP4+ path $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path'); + //+MOD: Added by mxBB + $not_unset[] = 'mx_root_path'; + //-MOD: Added by mxBB // Not only will array_merge give a warning if a parameter *************** *** 100,104 **** unset($$var); } - unset($$var); } --- 109,112 ---- *************** *** 134,138 **** if( is_array($HTTP_POST_VARS) ) ! { while( list($k, $v) = each($HTTP_POST_VARS) ) { if( is_array($HTTP_POST_VARS[$k]) ) --- 142,147 ---- if( is_array($HTTP_POST_VARS) ) ! { ! while( list($k, $v) = each($HTTP_POST_VARS) ) { if( is_array($HTTP_POST_VARS[$k]) ) *************** *** 173,180 **** } // Define some basic configuration arrays this also prevents // malicious rewriting of language and otherarray values via // URI params ! $board_config = array(); $userdata = array(); --- 182,190 ---- } + // // Define some basic configuration arrays this also prevents // malicious rewriting of language and otherarray values via // URI params ! // $board_config = array(); $userdata = array(); *************** *** 183,278 **** $lang = array(); $nav_links = array(); ! $gen_simple_header = false; $mxbb_footer_addup = array(); ! @include_once( $mx_root_path . 'config.' . $phpEx ); ! if ( !defined( "MX_INSTALLED" ) ) { ! header( "Location: install/mx_install.$phpEx" ); exit; } ! str_replace( "//", "/", $phpbb_root_path ); ! include_once( $mx_root_path . 'config.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/constants.' . $phpEx ); ! include_once( $mx_root_path . 'includes/template.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/sessions.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/auth.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/db.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/functions_selects.' . $phpEx ); ! include_once( $phpbb_root_path . 'includes/bbcode.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_constants.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_functions.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_functions_phpbb.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_auth.' . $phpEx ); ! include_once( $mx_root_path . 'includes/mx_cache.' . $phpEx ); - // Changed my mind to make this a session var. one more query (see directly below) to make it all more foolproof ;) - /* - if ( !empty( $HTTP_SESSION_VARS['mx_config'] ) ) - { - $portal_config = $HTTP_SESSION_VARS['mx_config']; - } - else - { - $portal_config = get_info( PORTAL_TABLE, 'portal_id', 1 ); - $HTTP_SESSION_VARS['mx_config'] = $portal_config; - } - */ ! $portal_config = get_info( PORTAL_TABLE, 'portal_id', 1 ); ! define( 'PHPBB_URL', $portal_config['portal_phpbb_url'] ); ! define( 'PORTAL_URL', $portal_config['portal_url'] ); ! define( 'PORTAL_VERSION', $portal_config['portal_version'] ); // instatiate the mx_request_vars class ! $mx_request_vars = new mx_request_vars(); - // Obtain and encode users IP // I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as // private range IP's appearing instead of the guilty routable IP, tough, don't // even bother complaining ... go scream and shout at the idiots out there who feel // "clever" is doing harm rather than good ... karma is a great thing ... :) ! $client_ip = ( !empty( $HTTP_SERVER_VARS['REMOTE_ADDR'] ) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty( $HTTP_ENV_VARS['REMOTE_ADDR'] ) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR ); ! $user_ip = encode_ip( $client_ip ); ! // Setup forum wide options, if this fails // then we output a CRITICAL_ERROR since // basic forum information is not available ! ! $sql = "SELECT * ! FROM " . CONFIG_TABLE; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql ); } ! ! while ( $row = $db->sql_fetchrow( $result ) ) { ! $board_config[$row['config_name']] = $row['config_value']; } ! if ( file_exists( $phpbb_root_path . 'attach_mod' ) ) { ! include_once( $phpbb_root_path . 'attach_mod/attachment_mod.' . $phpEx ); } ! if ( file_exists( 'install' ) || file_exists( 'contrib' ) ) { ! mx_message_die( GENERAL_MESSAGE, 'Please ensure both the install/ and contrib/ directories are deleted' ); } // Show 'Board is disabled' message if needed. ! ! if ( $board_config['board_disable'] && !defined( "IN_ADMIN" ) && !defined( "IN_LOGIN" ) ) { ! mx_message_die( GENERAL_MESSAGE, 'Board_disable', 'Information' ); } --- 193,312 ---- $lang = array(); $nav_links = array(); ! $gen_simple_header = FALSE; $mxbb_footer_addup = array(); ! @include_once($mx_root_path . 'config.' . $phpEx); ! if( !defined('MX_INSTALLED') ) { ! header("Location: install/mx_install.$phpEx"); exit; } ! str_replace("//", "/", $phpbb_root_path); ! include_once($mx_root_path . 'config.' . $phpEx); ! include_once($phpbb_root_path . 'includes/constants.' . $phpEx); ! include_once($mx_root_path . 'includes/template.' . $phpEx); ! include_once($phpbb_root_path . 'includes/sessions.' . $phpEx); ! include_once($phpbb_root_path . 'includes/auth.' . $phpEx); ! include_once($phpbb_root_path . 'includes/functions.' . $phpEx); ! include_once($phpbb_root_path . 'includes/db.' . $phpEx); ! include_once($phpbb_root_path . 'includes/functions_selects.' . $phpEx); ! include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_constants.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_functions.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_functions_phpbb.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_auth.' . $phpEx); ! include_once($mx_root_path . 'includes/mx_cache.' . $phpEx); ! $portal_config = get_info(PORTAL_TABLE, 'portal_id', 1); ! define('PHPBB_URL', $portal_config['portal_phpbb_url']); ! define('PORTAL_URL', $portal_config['portal_url']); ! define('PORTAL_VERSION', $portal_config['portal_version']); + // // instatiate the mx_request_vars class ! // $mx_request_vars = new mx_request_vars(); + // + // Obtain and encode users IP + // // I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as // private range IP's appearing instead of the guilty routable IP, tough, don't // even bother complaining ... go scream and shout at the idiots out there who feel // "clever" is doing harm rather than good ... karma is a great thing ... :) + // + $client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') ); + $user_ip = encode_ip($client_ip); ! // // Setup forum wide options, if this fails // then we output a CRITICAL_ERROR since // basic forum information is not available ! // ! if( @file_exists($phpbb_root_path . 'includes/class_config.' . $phpEx) && ! @file_exists($phpbb_root_path . 'includes/class_groups.' . $phpEx) ) { ! include($mx_root_path . 'includes/mx_functions_ch.'.$phpEx); } ! else { ! $sql = "SELECT * ! FROM " . CONFIG_TABLE; ! if( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql); ! } ! ! while ( $row = $db->sql_fetchrow($result) ) ! { ! $board_config[$row['config_name']] = $row['config_value']; ! } } ! //++ MX System ! // ! // if ( $language ) ! // { ! // $board_config['default_lang'] = $language; ! // setcookie('default_lang', $language, (time()+21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); ! // } ! // elseif ( isset($HTTP_COOKIE_VARS['default_lang']) ) ! // { ! // $board_config['default_lang'] = $HTTP_COOKIE_VARS['default_lang']; ! // } ! // if ( $style ) ! // { ! // $board_config['default_style'] = $style; ! // setcookie('default_style', $style, (time()+21600), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); ! // } ! // elseif ( isset($HTTP_COOKIE_VARS['default_style']) ) ! // { ! // $board_config['default_style'] = $HTTP_COOKIE_VARS['default_style']; ! // } ! // ! //-- MX System ! ! if( file_exists($phpbb_root_path . 'attach_mod') ) { ! include_once($phpbb_root_path . 'attach_mod/attachment_mod.' . $phpEx); } ! if( file_exists('install') || file_exists('contrib') ) { ! mx_message_die(GENERAL_MESSAGE, 'Please ensure both the install/ and contrib/ directories are deleted'); } + // // Show 'Board is disabled' message if needed. ! // ! if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") ) { ! mx_message_die(GENERAL_MESSAGE, 'Board_disable', 'Information'); } |
|
From: Markus P. <mar...@us...> - 2005-04-25 01:40:11
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25930/includes Added Files: mx_functions_ch.php Log Message: Added basic support for CH210 (ported from 2.7.6) --- NEW FILE: mx_functions_ch.php --- <?php /*************************************************************************** * mx_functions_ch.php * ------------------- * begin : March, 2005 * copyright : (C) 2002 mxBB-Portal * email : su...@mx... * * $Id: mx_functions_ch.php,v 1.1 2005/04/25 01:40:01 markus_petrux Exp $ * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License', or * ('at your option) any later version. * ***************************************************************************/ // // This code is part of common.php in Categories Hierarchy 2.1.0 // $starttime = microtime(); $trc_loc_start = $trc_loc_end = 0; // include basic classes def include($phpbb_root_path . 'includes/class_config.' . $phpEx); include($phpbb_root_path . 'includes/class_groups.' . $phpEx); // get config $config = new config_class(); if ( !$config->read() ) { define('RUN_CH_INSTALL', true); } $board_config = &$config->data; // let's run the upgrade script if ( !defined('IN_LOGIN') && !defined('IN_INSTALL') && (($config->data['mod_cat_hierarchy'] != '2.1.0f') || defined('RUN_CH_INSTALL')) ) { header('Location: '.$phpbb_root_path.'install_cat/install.' . $phpEx . (empty($SID) ? '' : '?' . $SID)); exit; } // user objects include($config->url('includes/class_user')); include($config->url('includes/class_auth')); // instantiate some objects $user = new user(); $censored_words = new words(); $icons = new icons(); $navigation = new navigation(); $themes = ''; $smilies = new smilies(); // People never read achievement messages after after having seen "Succesfull !", tss tss :) if ( file_exists($phpbb_root_path.'install_cat') && !defined('IN_LOGIN') && !defined('IN_INSTALL') ) { message_die(GENERAL_MESSAGE, 'Please ensure the install_cat/ directory is deleted'); } // messages queue $message_queue = ''; @include($config->url('includes/class_message')); $message_queue = !defined('CH_message_queue') ? '' : new message_queue(); ?> |
|
From: Markus P. <mar...@us...> - 2005-04-25 01:27:30
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20130 Modified Files: mx_auth.php mx_cache.php mx_constants.php mx_functions.php Log Message: Massive code cleanup in the includes folder. Also optimized code in several functions. Index: mx_cache.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_cache.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mx_cache.php 3 Apr 2005 16:45:15 -0000 1.3 --- mx_cache.php 25 Apr 2005 01:27:20 -0000 1.4 *************** *** 13,17 **** */ ! /** * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by --- 13,17 ---- */ ! /** * This program is free software; you can redistribute it and/or modify [...1072 lines suppressed...] { $HTTP_SESSION_VARS['block_' . $block_id][$param_row[parameter_name]] = $param_row; *************** *** 657,662 **** } } ! return $block_config; } ?> \ No newline at end of file --- 685,691 ---- } } ! return $block_config; } + ?> \ No newline at end of file Index: mx_constants.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_constants.php,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** mx_constants.php 6 Mar 2005 09:22:52 -0000 1.12 --- mx_constants.php 25 Apr 2005 01:27:20 -0000 1.13 *************** *** 19,54 **** */ ! if ( !defined( 'IN_PORTAL' ) ) { ! die( "Hacking attempt" ); } - // Page numbers for session handling ! // Table names ! define( 'PORTAL_TABLE', $mx_table_prefix . 'portal' ); ! define( 'MENU_NAV_TABLE', $mx_table_prefix . 'menu_nav' ); ! define( 'MENU_CAT_TABLE', $mx_table_prefix . 'menu_categories' ); ! define( 'MODULE_TABLE', $mx_table_prefix . 'module' ); ! define( 'FUNCTION_TABLE', $mx_table_prefix . 'function' ); ! define( 'PARAMETER_TABLE', $mx_table_prefix . 'parameter' ); ! define( 'PARAMETER_OPTION_TABLE', $mx_table_prefix . 'parameter_option' ); ! define( 'PAGE_TABLE' , $mx_table_prefix . 'page' ); ! define( 'COLUMN_TABLE' , $mx_table_prefix . 'column' ); ! define( 'COLUMN_BLOCK_TABLE', $mx_table_prefix . 'column_block' ); ! define( 'BLOCK_TABLE', $mx_table_prefix . 'block' ); ! define( 'BLOCK_SYSTEM_PARAMETER_TABLE', $mx_table_prefix . 'block_system_parameter' ); ! define( 'BLOCK_USER_PARAMETER_TABLE', $mx_table_prefix . 'block_user_parameter' ); ! define( 'COLUMN_TEMPLATES' , $mx_table_prefix . 'column_templates' ); ! define( 'PAGE_TEMPLATES' , $mx_table_prefix . 'page_templates' ); ! define( 'MX_MATCH_TABLE' , $mx_table_prefix . 'wordmatch' ); ! define( 'MX_WORD_TABLE' , $mx_table_prefix . 'wordlist' ); ! define( 'MX_SEARCH_TABLE' , $mx_table_prefix . 'search_results' ); ! define( 'AUTH_ANONYMOUS', 9 ); $current_template_images = $current_template_path . "/images"; --- 19,58 ---- */ ! if ( !defined('IN_PORTAL') ) { ! die("Hacking attempt"); } ! // ! // mxBB Core table names ! // ! define('PORTAL_TABLE', $mx_table_prefix . 'portal'); ! define('MENU_NAV_TABLE', $mx_table_prefix . 'menu_nav'); ! define('MENU_CAT_TABLE', $mx_table_prefix . 'menu_categories'); ! define('MODULE_TABLE', $mx_table_prefix . 'module'); ! define('FUNCTION_TABLE', $mx_table_prefix . 'function'); ! define('PARAMETER_TABLE', $mx_table_prefix . 'parameter'); ! define('PARAMETER_OPTION_TABLE', $mx_table_prefix . 'parameter_option'); ! define('PAGE_TABLE' , $mx_table_prefix . 'page'); ! define('COLUMN_TABLE' , $mx_table_prefix . 'column'); ! define('COLUMN_BLOCK_TABLE', $mx_table_prefix . 'column_block'); ! define('BLOCK_TABLE', $mx_table_prefix . 'block'); ! define('BLOCK_SYSTEM_PARAMETER_TABLE', $mx_table_prefix . 'block_system_parameter'); ! define('BLOCK_USER_PARAMETER_TABLE', $mx_table_prefix . 'block_user_parameter'); ! define('COLUMN_TEMPLATES' , $mx_table_prefix . 'column_templates'); ! define('PAGE_TEMPLATES' , $mx_table_prefix . 'page_templates'); ! define('MX_MATCH_TABLE' , $mx_table_prefix . 'wordmatch'); ! define('MX_WORD_TABLE' , $mx_table_prefix . 'wordlist'); ! define('MX_SEARCH_TABLE' , $mx_table_prefix . 'search_results'); ! // ! // Other common constants and definitions. ! // ! define('AUTH_ANONYMOUS', 9); $current_template_images = $current_template_path . "/images"; Index: mx_auth.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_auth.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mx_auth.php 13 Apr 2005 21:23:25 -0000 1.6 --- mx_auth.php 25 Apr 2005 01:27:20 -0000 1.7 *************** *** 25,72 **** * - page_auth * - menu_auth - * - mx_auth_check_user (from auth.php - validated for phpbb 2.0.10) * - get_auth_forum ! * - mx_auth_group_cache */ - - /* - $type's accepted (pre-pend with AUTH_): - VIEW, READ, POST, REPLY, EDIT, DELETE, STICKY, ANNOUNCE, VOTE, POLLCREATE - - Possible options ($type/module_id combinations): - - * If you include a type and module_id then a specific lookup will be done and - the single result returned - - * If you set type to AUTH_ALL and specify a module_id an array of all auth types - will be returned - - * If you provide a module_id a specific lookup on that module will be done - - * If you set module_id to AUTH_LIST_ALL and specify a type an array listing the - results for all modules will be returned - - * If you set module_id to AUTH_LIST_ALL and type to AUTH_ALL a multidimensional - array containing the auth permissions for all types and all modules for that - user is returned - - All results are returned as associative arrays, even when a single auth type is - specified. ! If available you can send an array (either one or two dimensional) containing the ! module auth levels, this will prevent the auth function having to do its own ! lookup ! */ ! function block_auth( $type, $module_id, $userdata, $f_access = '', $f_access_group = '' ) { global $db, $lang; ! switch ( $type ) { // case AUTH_ALL: // $a_sql = 'a.auth_view, a.auth_edit, a.auth_delete'; // $a_sql_groups = 'a.auth_view_group, a.auth_edit_group, a.auth_delete_group'; ! // $auth_fields = array( 'auth_view', 'auth_edit', 'auth_delete' ); ! // $auth_fields_groups = array( 'auth_view_group', 'auth_edit_group', 'auth_delete_group' ); // break; --- 25,72 ---- * - page_auth * - menu_auth * - get_auth_forum ! * - mx_auth_group ! * - mx_get_groups */ ! /********************************************************************************\ ! | $type's accepted (pre-pend with AUTH_): ! | VIEW, READ, POST, REPLY, EDIT, DELETE, STICKY, ANNOUNCE, VOTE, POLLCREATE ! | ! | Possible options ($type/module_id combinations): ! | ! | * If you include a type and module_id then a specific lookup will be done and ! | the single result returned ! | ! | * If you set type to AUTH_ALL and specify a module_id an array of all auth types ! | will be returned ! | ! | * If you provide a module_id a specific lookup on that module will be done ! | ! | * If you set module_id to AUTH_LIST_ALL and specify a type an array listing the ! | results for all modules will be returned ! | ! | * If you set module_id to AUTH_LIST_ALL and type to AUTH_ALL a multidimensional ! | array containing the auth permissions for all types and all modules for that ! | user is returned ! | ! | All results are returned as associative arrays, even when a single auth type is ! | specified. ! | ! | If available you can send an array (either one or two dimensional) containing the ! | module auth levels, this will prevent the auth function having to do its own ! | lookup ! \********************************************************************************/ ! function block_auth($type, $module_id, $userdata, $f_access = '', $f_access_group = '') { global $db, $lang; ! switch( $type ) { // case AUTH_ALL: // $a_sql = 'a.auth_view, a.auth_edit, a.auth_delete'; // $a_sql_groups = 'a.auth_view_group, a.auth_edit_group, a.auth_delete_group'; ! // $auth_fields = array('auth_view', 'auth_edit', 'auth_delete'); ! // $auth_fields_groups = array('auth_view_group', 'auth_edit_group', 'auth_delete_group'); // break; *************** *** 74,79 **** $a_sql = 'a.auth_view'; $a_sql_groups = 'a.auth_view_group'; ! $auth_fields = array( 'auth_view' ); ! $auth_fields_groups = array( 'auth_view_group' ); break; --- 74,79 ---- $a_sql = 'a.auth_view'; $a_sql_groups = 'a.auth_view_group'; ! $auth_fields = array('auth_view'); ! $auth_fields_groups = array('auth_view_group'); break; *************** *** 81,86 **** $a_sql = 'a.auth_edit'; $a_sql_groups = 'a.auth_edit_group'; ! $auth_fields = array( 'auth_edit' ); ! $auth_fields_groups = array( 'auth_edit_group' ); break; --- 81,86 ---- $a_sql = 'a.auth_edit'; $a_sql_groups = 'a.auth_edit_group'; ! $auth_fields = array('auth_edit'); ! $auth_fields_groups = array('auth_edit_group'); break; *************** *** 88,93 **** $a_sql = 'a.auth_delete'; $a_sql_groups = 'a.auth_delete_group'; ! $auth_fields = array( 'auth_delete' ); ! $auth_fields_groups = array( 'auth_delete_group' ); break; --- 88,93 ---- $a_sql = 'a.auth_delete'; $a_sql_groups = 'a.auth_delete_group'; ! $auth_fields = array('auth_delete'); ! $auth_fields_groups = array('auth_delete_group'); break; *************** *** 96,102 **** } ! if ( $module_id == 0 ) { ! if ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) { $auth_user[$auth_fields[0]] = 1; --- 96,102 ---- } ! if( $module_id == 0 ) { ! if( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) { $auth_user[$auth_fields[0]] = 1; *************** *** 111,156 **** } ! $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? true : 0; $auth_user = array(); ! for( $i = 0; $i < count( $auth_fields ); $i++ ) { $key = $auth_fields[$i]; $key_groups = $auth_fields_groups[$i]; // If the user is logged on and the module type is either ALL or REG then the user has access // If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions // to do whatever it is they want to do ... to do this we pull relevant information for the // user (and any groups they belong to) // Now we compare the users access level against the modules. We assume here that a moderator // and admin automatically have access to an ACL module, similarly we assume admins meet an // auth requirement of MOD $value = $f_access[$key]; // $value_groups = $f_access_group[$key_groups]; $value_groups = $f_access_group; ! switch ( $value ) { case AUTH_ALL: ! $auth_user[$key] = true; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? true : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: ! $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? true : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_ACL: // PRIVATE ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group( $value_groups ) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group( $f_access_group['auth_moderator_group'] ) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; --- 111,160 ---- } ! $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user = array(); ! for( $i = 0; $i < count($auth_fields); $i++ ) { $key = $auth_fields[$i]; $key_groups = $auth_fields_groups[$i]; + // // If the user is logged on and the module type is either ALL or REG then the user has access + // // If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions // to do whatever it is they want to do ... to do this we pull relevant information for the // user (and any groups they belong to) + // // Now we compare the users access level against the modules. We assume here that a moderator // and admin automatically have access to an ACL module, similarly we assume admins meet an // auth requirement of MOD + // $value = $f_access[$key]; // $value_groups = $f_access_group[$key_groups]; $value_groups = $f_access_group; ! switch( $value ) { case AUTH_ALL: ! $auth_user[$key] = TRUE; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: ! $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_ACL: // PRIVATE ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group($value_groups) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group($f_access_group['auth_moderator_group']) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; *************** *** 166,176 **** } } // Is user a moderator? ! $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_auth_group( $f_access_group['auth_moderator_group'] ) || $is_admin : 0; return $auth_user; } ! function page_auth( $type, $userdata, $f_access = '', $f_access_group = '' ) { global $db, $lang; --- 170,186 ---- } } + + // // Is user a moderator? ! // ! $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_auth_group($f_access_group['auth_moderator_group']) || $is_admin : 0; return $auth_user; } ! /********************************************************************************\ ! | ! \********************************************************************************/ ! function page_auth($type, $userdata, $f_access = '', $f_access_group = '') { global $db, $lang; *************** *** 178,220 **** $a_sql = 'a.auth_view'; $a_sql_groups = 'a.auth_view_group'; ! $auth_fields = array( 'auth_view' ); ! $auth_fields_groups = array( 'auth_view_group' ); ! ! $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? true : 0; $auth_user = array(); ! for( $i = 0; $i < count( $auth_fields ); $i++ ) { $key = $auth_fields[$i]; $key_groups = $auth_fields_groups[$i]; ! $value = $f_access[$key]; // $value_groups = $f_access_group[$key_groups]; $value_groups = $f_access_group; ! ! switch ( $value ) { case AUTH_ALL: ! $auth_user[$key] = true; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? true : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: ! $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? true : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; ! case AUTH_ACL: // PRIVATE ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group( $value_groups ) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group( $f_access_group['auth_moderator_group'] ) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; --- 188,230 ---- $a_sql = 'a.auth_view'; $a_sql_groups = 'a.auth_view_group'; ! $auth_fields = array('auth_view'); ! $auth_fields_groups = array('auth_view_group'); ! ! $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user = array(); ! for( $i = 0; $i < count($auth_fields); $i++ ) { $key = $auth_fields[$i]; $key_groups = $auth_fields_groups[$i]; ! $value = $f_access[$key]; // $value_groups = $f_access_group[$key_groups]; $value_groups = $f_access_group; ! ! switch( $value ) { case AUTH_ALL: ! $auth_user[$key] = TRUE; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: ! $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; ! case AUTH_ACL: // PRIVATE ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group($value_groups) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group($f_access_group['auth_moderator_group']) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; *************** *** 230,299 **** } } // Is user a moderator? ! $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_auth_group( $f_access_group['auth_moderator_group'] ) || $is_admin : 0; return $auth_user; } ! // ************************************************************************** ! function menu_auth( $type, $menu_id, $userdata, $f_access = '', $f_access_group = '' ) { global $db, $lang; ! switch ( $type ) { case AUTH_ALL: $a_sql = 'a.auth_view'; ! $auth_fields = array( 'auth_view' ); break; case AUTH_VIEW: $a_sql = 'a.auth_view'; ! $auth_fields = array( 'auth_view' ); break; default: break; ! } // If f_access has been passed, or auth is needed to return an array of menus // then we need to pull the auth information on the given menu (or all menus) ! $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? true : 0; $auth_user = array(); ! for( $i = 0; $i < count( $auth_fields ); $i++ ) { $key = $auth_fields[$i]; // If the user is logged on and the menu type is either ALL or REG then the user has access // If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions // to do whatever it is they want to do ... to do this we pull relevant information for the // user (and any groups they belong to) // Now we compare the users access level against the menus. We assume here that a moderator // and admin automatically have access to an ACL menu, similarly we assume admins meet an // auth requirement of MOD $value = $f_access[$key]; ! switch ( $value ) { case AUTH_ALL: ! $auth_user[$key] = true; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? true : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: ! $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? true : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_ACL: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group( $f_access_group ) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group( $f_access_group ) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; --- 240,323 ---- } } + + // // Is user a moderator? ! // ! $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_auth_group($f_access_group['auth_moderator_group']) || $is_admin : 0; return $auth_user; } ! ! /********************************************************************************\ ! | ! \********************************************************************************/ ! function menu_auth($type, $menu_id, $userdata, $f_access = '', $f_access_group = '') { global $db, $lang; ! switch( $type ) { case AUTH_ALL: $a_sql = 'a.auth_view'; ! $auth_fields = array('auth_view'); break; case AUTH_VIEW: $a_sql = 'a.auth_view'; ! $auth_fields = array('auth_view'); break; default: break; ! } ! ! // // If f_access has been passed, or auth is needed to return an array of menus // then we need to pull the auth information on the given menu (or all menus) ! // ! $is_admin = ( $userdata['user_level'] == ADMIN && $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user = array(); ! for( $i = 0; $i < count($auth_fields); $i++ ) { $key = $auth_fields[$i]; + + // // If the user is logged on and the menu type is either ALL or REG then the user has access + // // If the type if ACL, MOD or ADMIN then we need to see if the user has specific permissions // to do whatever it is they want to do ... to do this we pull relevant information for the // user (and any groups they belong to) + // // Now we compare the users access level against the menus. We assume here that a moderator // and admin automatically have access to an ACL menu, similarly we assume admins meet an // auth requirement of MOD + // $value = $f_access[$key]; ! switch( $value ) { case AUTH_ALL: ! $auth_user[$key] = TRUE; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_REG: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Registered_Users']; break; case AUTH_ANONYMOUS: ! $auth_user[$key] = ( ! $userdata['session_logged_in'] ) ? TRUE : 0; $auth_user[$key . '_type'] = $lang['Auth_Anonymous_users']; break; case AUTH_ACL: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group($f_access_group) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Users_granted_access']; break; case AUTH_MOD: ! $auth_user[$key] = ( $userdata['session_logged_in'] ) ? mx_auth_group($f_access_group) || $is_admin : 0; $auth_user[$key . '_type'] = $lang['Auth_Moderators']; break; *************** *** 309,464 **** } } // Is user a moderator? ! // $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_auth_group( $f_access_group ) || $is_admin : 0; return $auth_user; } ! // New optimized get_auth_forum ! // Credits to Markus_Petrux :-) ! function get_auth_forum( $mode = 'phpbb' ) { global $userdata, $mx_root_path, $phpEx; ! switch ( $mode ) { ! case 'phpbb': ! ! // Try to reuse auth_view query result. ! $userdata_key = 'mx_get_auth_forum' . $userdata['user_id']; ! if ( !empty( $userdata[$userdata_key] ) ) ! { ! $auth_data_sql = $userdata[$userdata_key]; ! return $auth_data_sql; ! } ! // Now, this tries to optimize DB access involved in auth(), ! // passing AUTH_LIST_ALL will load info for all forums at once. ! $is_auth_ary = auth( AUTH_VIEW, AUTH_LIST_ALL, $userdata ); ! // Loop through the list of forums to retrieve the ids for ! // those with AUTH_VIEW allowed. ! $auth_data_sql = ''; ! foreach( $is_auth_ary as $fid => $is_auth_row ) ! { ! if ( $is_auth_row['auth_view'] ) ! { ! $auth_data_sql .= ( $auth_data_sql != '' ) ? ', ' . $fid : $fid; ! } ! } ! ! if ( empty( $auth_data_sql ) ) ! { ! $auth_data_sql = -1; ! } ! $userdata[$userdata_key] = $auth_data_sql; ! return $auth_data_sql; ! break; ! ! case 'kb': ! ! // Try to reuse auth_view query result. ! $userdata_key = 'mx_get_auth_kb' . $userdata['user_id']; ! if ( !empty( $userdata[$userdata_key] ) ) ! { ! $auth_data_sql = $userdata[$userdata_key]; ! return $auth_data_sql; ! } ! // Now, this tries to optimize DB access involved in auth(), ! // passing AUTH_LIST_ALL will load info for all forums at once. ! ! include_once( $mx_root_path . 'modules/mx_kb/includes/functions_kb_auth.' . $phpEx ); ! $is_auth_ary = kb_auth( AUTH_VIEW, AUTH_LIST_ALL, $userdata ); ! // Loop through the list of forums to retrieve the ids for ! // those with AUTH_VIEW allowed. ! $auth_data_sql = ''; ! foreach( $is_auth_ary as $fid => $is_auth_row ) ! { ! if ( $is_auth_row['auth_view'] ) ! { ! $auth_data_sql .= ( $auth_data_sql != '' ) ? ', ' . $fid : $fid; ! } ! } ! ! if ( empty( $auth_data_sql ) ) ! { ! $auth_data_sql = -1; ! } ! $userdata[$userdata_key] = $auth_data_sql; ! return $auth_data_sql; ! break; ! default: ! //nothing ! break; ! } ! } ! // Validates if user belongs to group included in group_ids list ! // Also, adds all usergroups to userdata array ! function mx_auth_group( $group_ids = '', $group_mod_mode = false ) { global $userdata, $db; ! ! if ( $group_ids == '' ) { return false; } ! $group_ids_array = explode(",", $group_ids); ! ! // Try to reuse usergroups result. ! if ( $group_mod_mode ) ! { ! $userdata_key = 'mx_usergroups_mod' . $userdata['user_id']; ! if ( empty( $userdata[$userdata_key] ) ) ! { ! // Check if user is group moderator.. ! $sql = "SELECT gr.group_id ! FROM " . GROUPS_TABLE . " gr, ! " . USER_GROUP_TABLE . " ugr ! WHERE gr.group_id = ugr.group_id ! AND gr.group_moderator = '" . $userdata['user_id'] . "' ! AND ugr.user_pending = '0' "; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! message_die( GENERAL_ERROR, "Could not query group rights information", '', '', '', '' ); ! } ! ! $group_row = $db->sql_fetchrowset( $result ); ! ! $userdata[$userdata_key_mod] = $group_row; ! } ! } ! else { ! $userdata_key = 'mx_usergroups' . $userdata['user_id']; ! ! if ( empty( $userdata[$userdata_key] ) ) { ! // Check if user is member of the proper group.. ! $sql = "SELECT group_id FROM " . USER_GROUP_TABLE . " WHERE user_id='" . $userdata['user_id'] . "' AND user_pending = 0"; ! ! if ( !( $result = $db->sql_query( $sql ) ) ) ! { ! message_die( GENERAL_ERROR, "Could not query group rights information", '', '', '', '' ); ! } ! ! $group_row = $db->sql_fetchrowset( $result ); ! ! $userdata[$userdata_key] = $group_row; ! } } ! ! for ( $i = 0; $i < count( $userdata[$userdata_key] ); $i++ ) { ! if ( in_array( $userdata[$userdata_key][$i]['group_id'], $group_ids_array ) ) { ! $is_member = true; ! return $is_member; } ! } ! ! return false; } ?> \ No newline at end of file --- 333,478 ---- } } + + // // Is user a moderator? ! // ! // $auth_user['auth_mod'] = ( $userdata['session_logged_in'] ) ? mx_auth_group($f_access_group) || $is_admin : 0; return $auth_user; } ! /********************************************************************************\ ! | New optimized get_auth_forum ! | Credits to Markus_Petrux :-) ! \********************************************************************************/ ! function get_auth_forum($mode = 'phpbb') { global $userdata, $mx_root_path, $phpEx; ! // ! // Try to reuse auth_view query result. ! // ! $userdata_key = 'mx_get_auth_' . $mode . $userdata['user_id']; ! if( !empty($userdata[$userdata_key]) ) { ! $auth_data_sql = $userdata[$userdata_key]; ! return $auth_data_sql; ! } ! ! // ! // Now, this tries to optimize DB access involved in auth(), ! // passing AUTH_LIST_ALL will load info for all forums at once. ! // ! if( $mode = 'kb' ) ! { ! include_once($mx_root_path . 'modules/mx_kb/includes/functions_kb_auth.' . $phpEx); ! $auth_func = 'kb_auth'; ! } ! else ! { ! $auth_func = 'auth'; ! } ! $is_auth_ary = $auth_func(AUTH_VIEW, AUTH_LIST_ALL, $userdata); ! ! // ! // Loop through the list of forums to retrieve the ids for ! // those with AUTH_VIEW allowed. ! // ! $auth_data_sql = ''; ! foreach( $is_auth_ary as $fid => $is_auth_row ) ! { ! if( $is_auth_row['auth_view'] ) ! { ! $auth_data_sql .= ( $auth_data_sql != '' ) ? ', ' . $fid : $fid; ! } ! } ! ! if( empty($auth_data_sql) ) ! { ! $auth_data_sql = -1; ! } ! ! $userdata[$userdata_key] = $auth_data_sql; ! return $auth_data_sql; } ! /********************************************************************************\ ! | Validates if user belongs to group included in group_ids list ! | Also, adds all usergroups to userdata array ! \********************************************************************************/ ! function mx_auth_group($group_ids = '', $group_mod_mode = false) { global $userdata, $db; ! ! if( empty($group_ids) ) { return false; } ! // ! // Try to reuse group_id results. ! // ! $userdata_key = 'mx_usergroups' . ( $group_mod_mode ? '_mod' : '' ) . $userdata['user_id']; ! if( empty($userdata[$userdata_key]) ) { ! if( $group_mod_mode ) // Get the groups the user is moderator of. { ! $sql = "SELECT group_id FROM " . GROUPS_TABLE . " ! WHERE group_moderator = '" . $userdata['user_id'] . "' AND group_single_user = 0"; ! } ! else // Get the groups the user is member of. ! { ! $sql = "SELECT group_id FROM " . USER_GROUP_TABLE . " ! WHERE user_id = '" . $userdata['user_id'] . "' AND user_pending = 0"; ! } ! if ( !($result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not query group rights information"); ! } ! $userdata[$userdata_key] = $db->sql_fetchrowset($result); } ! ! $group_ids_array = explode(',', $group_ids); ! ! for( $i = 0; $i < count($userdata[$userdata_key]); $i++ ) { ! if( in_array($userdata[$userdata_key][$i]['group_id'], $group_ids_array) ) { ! return true; } ! } ! return false; ! } ! ! /********************************************************************************\ ! | ! \********************************************************************************/ ! function mx_get_groups($sel_id, $field_entry = 'auth_view_group') ! { ! global $db, $lang; ! ! $sql = "SELECT group_id, group_name ! FROM " . GROUPS_TABLE . " ! WHERE group_single_user <> " . TRUE . " ! ORDER BY group_name"; ! ! if( !($result = $db->sql_query($sql)) ) ! { ! message_die(GENERAL_ERROR, "Couldn't get list of groups", '', __LINE__, __FILE__, $sql); ! } ! ! $grouplist = '<select name="'.$field_entry.'">'; ! $grouplist .= '<option value="0">' . $lang['Select_group'] . '</option>'; ! ! while( $row = $db->sql_fetchrow($result) ) ! { ! $selected = ( $sel_id == $row['group_id'] ? ' selected="selected"' : '' ); ! $grouplist .= '<option value="' .$row['group_id'] . '"' . $selected . '>' . $row['group_name'] . '</option>'; ! } ! ! $grouplist .= '</select>'; ! return $grouplist; } + ?> \ No newline at end of file Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** mx_functions.php 24 Apr 2005 21:33:36 -0000 1.38 --- mx_functions.php 25 Apr 2005 01:27:20 -0000 1.39 *************** *** 36,40 **** * - post_icons * - get_page_id - * - mx_get_groups * - mx_add_search_words * - mx_remove_search_post --- 36,39 ---- *************** *** 48,54 **** */ ! // ****************************************************************** ! // ! // ****************************************************************** function get_info($table, $idfield = '', $id = 0, $idfield2 = '', $id2 = 0) { --- 47,53 ---- */ ! /********************************************************************************\ ! | ! \********************************************************************************/ function get_info($table, $idfield = '', $id = 0, $idfield2 = '', $id2 = 0) { *************** *** 68,74 **** } ! // ****************************************************************** ! // ! // ****************************************************************** function get_old_items($table, $idfield = '', $id = 0, $idfield2 = '', $item_ids = array()) { --- 67,73 ---- } ! /********************************************************************************\ ! | ! \********************************************************************************/ function get_old_items($table, $idfield = '', $id = 0, $idfield2 = '', $item_ids = array()) { *************** *** 94,100 **** } ! // ****************************************************************** ! // ! // ****************************************************************** function get_exists($table, $idfield = '', $id = 0) { --- 93,99 ---- } ! /********************************************************************************\ ! | ! \********************************************************************************/ function get_exists($table, $idfield = '', $id = 0) { *************** *** 115,121 **** } ! // ****************************************************************** ! // ! // ****************************************************************** function get_list($name_select, $table, $idfield, $namefield, $id, $select = false, $idfield2 = '' , $id2 = '') { --- 114,120 ---- } ! /********************************************************************************\ ! | ! \********************************************************************************/ function get_list($name_select, $table, $idfield, $namefield, $id, $select = false, $idfield2 = '' , $id2 = '') { *************** *** 151,157 **** } ! // ****************************************************************** ! // ! // ****************************************************************** function get_mx_select_list($type = 'includex', $id, $name_select) { --- 150,156 ---- } ! /********************************************************************************\ ! | ! \********************************************************************************/ function get_mx_select_list($type = 'includex', $id, $name_select) { *************** *** 178,192 **** } ! /* function get_list_formatted() ! --------------------------------------------------------------------------------------------------------------- ! This function creates a drop down select menu, either for pages, functions or blocks. ! The block dropdown may also be filtered for specific functions (by passing the function file) ! ! $type: 'page_list', 'function_list', 'block_list' or 'dyn_block_list' (core 2.8) ! $id: selected id ! $name_select: the name id for the select form ! $function_file: for filtering blocklists ! --------------------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------------------- */ function get_list_formatted($type, $id, $name_select = '', $function_file = '') { --- 177,191 ---- } ! /********************************************************************************\ ! | function get_list_formatted() ! | ------------------------------------------------------------------------------- ! | This function creates a drop down select menu, either for pages, functions or blocks. ! | The block dropdown may also be filtered for specific functions (by passing the function file) ! | ! | $type: 'page_list', 'function_list', 'block_list' or 'dyn_block_list' (core 2.8) ! | $id: selected id ! | $name_select: the name id for the select form ! | $function_file: for filtering blocklists ! \********************************************************************************/ function get_list_formatted($type, $id, $name_select = '', $function_file = '') { *************** *** 314,320 **** } ! // ****************************************************************** ! // ! // ****************************************************************** function get_list_static($name_select, $row, $id) { --- 313,319 ---- } ! /********************************************************************************\ ! | ! \********************************************************************************/ function get_list_static($name_select, $row, $id) { *************** *** 333,339 **** } ! // ****************************************************************** ! // ! // ****************************************************************** function get_list_multiple($name_select, $table, $idfield, $namefield, $id_list, $select) { --- 332,338 ---- } ! /********************************************************************************\ ! | ! \********************************************************************************/ function get_list_multiple($name_select, $table, $idfield, $namefield, $id_list, $select) { *************** *** 370,376 **** } ! // ****************************************************************** ! // ! // ****************************************************************** function get_list_opt($name_select, $table, $idfield, $namefield, $id, $select) { --- 369,375 ---- } ! /********************************************************************************\ ! | ! \********************************************************************************/ function get_list_opt($name_select, $table, $idfield, $namefield, $id, $select) { *************** *** 405,411 **** } ! // ****************************************************************** ! // Pick a poll list combo, ! // ****************************************************************** function poll_select($default_poll, $select_name = 'Poll_Topic_id') { --- 404,410 ---- } ! /********************************************************************************\ ! | Pick a poll list combo ! \********************************************************************************/ function poll_select($default_poll, $select_name = 'Poll_Topic_id') { *************** *** 435,441 **** } ! // ****************************************************************** ! // ! // ****************************************************************** function mx_url() { --- 434,440 ---- } ! /********************************************************************************\ ! | ! \********************************************************************************/ function mx_url() { *************** *** 504,512 **** } ! // ****************************************************************** ! // MX add-on ! // Generate paths for page and standalone mode ! // ...function based on original function written by Markus :-) ! // ****************************************************************** function mx_this_url( $args = '', $force_standalone_mode = false, $file = '' ) { --- 503,511 ---- } ! /********************************************************************************\ ! | MX add-on ! | Generate paths for page and standalone mode ! | ...function based on original function written by Markus :-) ! \********************************************************************************/ function mx_this_url( $args = '', $force_standalone_mode = false, $file = '' ) { *************** *** 532,537 **** } ! // Generate icon lists ! // Snatched frompafilDB function post_icons( $icon_dir = '', $file_posticon = '', $modules_path = '' ) { --- 531,538 ---- } ! /********************************************************************************\ ! | Generate icon lists ! | Snatched frompafilDB ! \********************************************************************************/ function post_icons( $icon_dir = '', $file_posticon = '', $modules_path = '' ) { *************** *** 590,602 **** } ! /* function get_page_id() ! --------------------------------------------------------------------------------------------------------------- ! This function fill find the page on which a block is located, provided a block_id. First instance found is returned. ! Eg: get_page_id( $block_id ) ! ! If no block_id is available you can find the page provided the function file. First instance found is returned. ! Eg: get_page_id( 'dload.php', true ) ! --------------------------------------------------------------------------------------------------------------- ! --------------------------------------------------------------------------------------------------------------- */ function get_page_id($search_item, $use_function_file = false) { --- 591,605 ---- } ! /********************************************************************************\ ! | function get_page_id() ! | ------------------------------------------------------------------------------- ! | This function fill find the page on which a block is located, provided a block_id. ! | First instance found is returned. ! | Eg: get_page_id( $block_id ) ! | ! | If no block_id is available you can find the page provided the function file. ! | First instance found is returned. ! | Eg: get_page_id('dload.php', true) ! \********************************************************************************/ function get_page_id($search_item, $use_function_file = false) { *************** *** 668,700 **** } - function mx_get_groups($sel_id, $field_entry = 'auth_view_group') - { - global $db, $lang; ! $sql = "SELECT group_id, group_name ! FROM " . GROUPS_TABLE . " ! WHERE group_single_user <> " . TRUE . " ! ORDER BY group_name"; ! ! if( !($result = $db->sql_query($sql)) ) ! { ! message_die(GENERAL_ERROR, "Couldn't get list of groups", '', __LINE__, __FILE__, $sql); ! } ! ! $grouplist = '<select name="'.$field_entry.'">'; ! $grouplist .= '<option value="0">' . $lang['Select_group'] . '</option>'; ! ! while( $row = $db->sql_fetchrow($result) ) ! { ! $selected = ( $sel_id == $row['group_id'] ? ' selected="selected"' : '' ); ! $grouplist .= '<option value="' .$row['group_id'] . '"' . $selected . '>' . $row['group_name'] . '</option>'; ! } ! ! $grouplist .= '</select>'; ! return $grouplist; ! } ! ! ! // Add search words for blocks function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_mode = 'mx') { --- 671,678 ---- } ! /********************************************************************************\ ! | Add search words for blocks ! \********************************************************************************/ function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_mode = 'mx') { *************** *** 873,876 **** --- 851,857 ---- } + /********************************************************************************\ + | + \********************************************************************************/ function mx_remove_search_post($post_id_sql, $mx_mode = 'mx') { *************** *** 974,977 **** --- 955,961 ---- } + /********************************************************************************\ + | + \********************************************************************************/ function qsort_multiarray($array, $num = 0, $order = 'ASC', $left = 0, $right = -1) { *************** *** 1012,1015 **** --- 996,1002 ---- } + /********************************************************************************\ + | + \********************************************************************************/ function compose_mx_copy() { *************** *** 1044,1051 **** ! // -------------------------------------------------------------------------------- ! // Class: mx_request_vars ! // Encapsulate several functions related to GET/POST variables. ! // // --- 1031,1038 ---- ! /********************************************************************************\ ! | Class: mx_request_vars ! | Encapsulate several functions related to GET/POST variables. ! \********************************************************************************/ // |
|
From: Markus P. <mar...@us...> - 2005-04-24 21:33:46
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31294 Modified Files: mx_functions.php mx_functions_phpbb.php Log Message: Massive code cleanup in the includes folder. Also optimized code in several functions. Index: mx_functions_phpbb.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_phpbb.php,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** mx_functions_phpbb.php 16 Apr 2005 01:55:03 -0000 1.6 --- mx_functions_phpbb.php 24 Apr 2005 21:33:36 -0000 1.7 *************** *** 29,33 **** * - mx_message_die (from functions.php) * - mx_block_message (a message_die kind of function for blocks) ! * - mx_redirect (from functions_post.php) */ --- 29,34 ---- * - mx_message_die (from functions.php) * - mx_block_message (a message_die kind of function for blocks) ! * - mx_redirect (from functions.php) ! * - mx_generate_pagination (from functions.php) */ *************** *** 63,114 **** // Convert the bbcode to html // ! function mx_decode( $bbtext, $bbcode_uid ) { ! global $board_config; ! ! $mytext = stripslashes( $bbtext ); ! $mytext = bbencode_second_pass( $mytext, $bbcode_uid ); ! ! $smilies_path = $board_config['smilies_path']; ! $board_config['smilies_path'] = PHPBB_URL . $board_config['smilies_path']; ! $mytext = smilies_pass( $mytext ); ! $board_config['smilies_path'] = $smilies_path; ! ! $mytext = str_replace( "\n", "\n<br />\n", $mytext ); ! $mytext = make_clickable( $mytext ); ! return $mytext; } - // Old mx_decode function - // function mx_decode($message, $bbcode_uid ) { - // $message = preg_replace('#(<)([\/]?.*?)(>)#is', "<\\2>", $message); - // $message = bbencode_second_pass($message, $bbcode_uid) ; - // $message = preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); - // $message = make_clickable($message); - // $message = mx_smilies_pass($message); - // $message = str_replace("\n", "\n<br />\n", $message); - // $message = str_replace("\'","'",$message); - // return($message); - // } // Initialise user settings on page load ! function mx_init_userprefs( $userdata ) { global $board_config, $theme, $images; ! global $template, $lang, $phpEx, $mx_root_path, $phpbb_root_path; if ( $userdata['user_id'] != ANONYMOUS ) { ! if ( !empty( $userdata['user_lang'] ) ) { $board_config['default_lang'] = $userdata['user_lang']; } ! if ( !empty( $userdata['user_dateformat'] ) ) { $board_config['default_dateformat'] = $userdata['user_dateformat']; } ! if ( isset( $userdata['user_timezone'] ) ) { $board_config['board_timezone'] = $userdata['user_timezone']; --- 64,98 ---- // Convert the bbcode to html // ! function mx_decode($bbtext, $bbcode_uid) { ! $mytext = stripslashes($bbtext); ! $mytext = bbencode_second_pass($mytext, $bbcode_uid); ! $mytext = mx_smilies_pass($mytext); ! $mytext = str_replace("\n", "\n<br />\n", $mytext); ! $mytext = make_clickable($mytext); return $mytext; } + // // Initialise user settings on page load ! function mx_init_userprefs($userdata) { global $board_config, $theme, $images; ! global $template, $lang, $phpEx, $phpbb_root_path, $mx_root_path; ! global $nav_links; if ( $userdata['user_id'] != ANONYMOUS ) { ! if ( !empty($userdata['user_lang'])) { $board_config['default_lang'] = $userdata['user_lang']; } ! if ( !empty($userdata['user_dateformat']) ) { $board_config['default_dateformat'] = $userdata['user_dateformat']; } ! if ( isset($userdata['user_timezone']) ) { $board_config['board_timezone'] = $userdata['user_timezone']; *************** *** 116,150 **** } ! if ( !file_exists( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { $board_config['default_lang'] = 'english'; } ! if ( file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { ! include( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); } ! if ( file_exists( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ) ) { ! include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); } ! if ( defined( 'IN_ADMIN' ) ) { ! if ( !file_exists( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) || !file_exists( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ) ) { $board_config['default_lang'] = 'english'; } ! ! include( $phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); ! include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx ); } // Set up style if ( !$board_config['override_user_style'] ) { if ( $userdata['user_id'] != ANONYMOUS && $userdata['user_style'] > 0 ) { ! if ( $theme = mx_setup_style( $userdata['user_style'] ) ) { return; --- 100,136 ---- } ! if ( !file_exists($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) ) { $board_config['default_lang'] = 'english'; } ! if ( file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) ) { ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); } ! if ( file_exists($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx) ) { ! include($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx); } ! if ( defined('IN_ADMIN') ) { ! if( !file_exists($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx) || !file_exists($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx) ) { $board_config['default_lang'] = 'english'; } ! include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); ! include($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx); } + + // // Set up style + // if ( !$board_config['override_user_style'] ) { if ( $userdata['user_id'] != ANONYMOUS && $userdata['user_style'] > 0 ) { ! if ( $theme = mx_setup_style($userdata['user_style']) ) { return; *************** *** 153,185 **** } ! $theme = mx_setup_style( $board_config['default_style'] ); // Mozilla navigation bar // Default items that should be valid on all pages. // Defined here to correctly assign the Language Variables // and be able to change the variables within code. ! $nav_links['top'] = array ( 'url' => append_sid( $phpbb_root_path . 'index.' . $phpEx ), ! 'title' => sprintf( $lang['Forum_Index'], $board_config['sitename'] ) ! ); ! $nav_links['search'] = array ( 'url' => append_sid( $phpbb_root_path . 'search.' . $phpEx ), ! 'title' => $lang['Search'] ! ); ! $nav_links['help'] = array ( 'url' => append_sid( $phpbb_root_path . 'faq.' . $phpEx ), ! 'title' => $lang['FAQ'] ! ); ! $nav_links['author'] = array ( 'url' => append_sid( $phpbb_root_path . 'memberlist.' . $phpEx ), ! 'title' => $lang['Memberlist'] ! ); return; } ! function mx_setup_style( $style, $only_template = false ) { ! global $db, $board_config, $template, $images, $mx_root_path, $phpbb_root_path; $sql = "SELECT * FROM " . THEMES_TABLE . " WHERE themes_id = $style"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { $style = 1; --- 139,178 ---- } ! $theme = mx_setup_style($board_config['default_style']); ! ! // // Mozilla navigation bar // Default items that should be valid on all pages. // Defined here to correctly assign the Language Variables // and be able to change the variables within code. ! // ! $nav_links['top'] = array ( ! 'url' => append_sid($phpbb_root_path . 'index.' . $phpEx), ! 'title' => sprintf($lang['Forum_Index'], $board_config['sitename']) ! ); ! $nav_links['search'] = array ( ! 'url' => append_sid($phpbb_root_path . 'search.' . $phpEx), ! 'title' => $lang['Search'] ! ); ! $nav_links['help'] = array ( ! 'url' => append_sid($phpbb_root_path . 'faq.' . $phpEx), ! 'title' => $lang['FAQ'] ! ); ! $nav_links['author'] = array ( ! 'url' => append_sid($phpbb_root_path . 'memberlist.' . $phpEx), ! 'title' => $lang['Memberlist'] ! ); return; } ! function mx_setup_style($style, $only_template = false) { ! global $db, $board_config, $template, $images, $phpbb_root_path, $mx_root_path; $sql = "SELECT * FROM " . THEMES_TABLE . " WHERE themes_id = $style"; ! if ( !($result = $db->sql_query($sql)) ) { $style = 1; *************** *** 187,208 **** FROM " . THEMES_TABLE . " WHERE themes_id = $style"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( CRITICAL_ERROR, 'Could not query database for theme info' ); } } ! if ( !( $row = $db->sql_fetchrow( $result ) ) ) { ! mx_message_die( CRITICAL_ERROR, "Could not get theme data for themes_id [$style]" ); } $template_path = 'templates/' ; $template_name = $row['template_name'] ; // MX FIX for uninstalled themes ... use subSilver instead ! if ( !file_exists( $mx_root_path . $template_path . $template_name . '/mx_login.tpl' ) ) { ! $template_path = 'templates/' ; ! $template_name = 'subSilver' ; $style = 1; --- 180,202 ---- FROM " . THEMES_TABLE . " WHERE themes_id = $style"; ! if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(CRITICAL_ERROR, 'Could not query database for theme info'); } } ! if ( !($row = $db->sql_fetchrow($result)) ) { ! mx_message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]"); } $template_path = 'templates/' ; $template_name = $row['template_name'] ; + // MX FIX for uninstalled themes ... use subSilver instead ! if ( !file_exists($mx_root_path . $template_path . $template_name . '/mx_login.tpl') ) { ! $template_path = 'templates/'; ! $template_name = 'subSilver'; $style = 1; *************** *** 210,227 **** FROM " . THEMES_TABLE . " WHERE themes_id = $style"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { ! mx_message_die( CRITICAL_ERROR, 'Could not query database for theme info' ); } ! if ( !( $row = $db->sql_fetchrow( $result ) ) ) { ! mx_message_die( CRITICAL_ERROR, "Could not get theme data for themes_id [$style]" ); } ! $template = new mx_Template( $mx_root_path . $template_path . $template_name, $board_config, $db ); } else { ! $template = new mx_Template( $mx_root_path . $template_path . $template_name, $board_config, $db ); } --- 204,221 ---- FROM " . THEMES_TABLE . " WHERE themes_id = $style"; ! if ( !($result = $db->sql_query($sql)) ) { ! mx_message_die(CRITICAL_ERROR, 'Could not query database for theme info'); } ! if ( !($row = $db->sql_fetchrow($result)) ) { ! mx_message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]"); } ! $template = new mx_Template($mx_root_path . $template_path . $template_name); } else { ! $template = new mx_Template($mx_root_path . $template_path . $template_name); } *************** *** 230,285 **** return $row; } // call when only_template is false. ! define( 'TEMPLATE_ROOT_PATH', $template_path . $template_name . '/' ); if ( $template ) { $current_template_path = $template_path . $template_name; ! if ( file_exists( $mx_root_path . $template_path . $template_name . '/' . $template_name . '.cfg' ) ) ! { ! @include( $mx_root_path . $template_path . $template_name . '/' . $template_name . '.cfg' ); ! } ! else { ! @include( $phpbb_root_path . $template_path . $template_name . '/' . $template_name . '.cfg' ); } ! if ( !defined( 'TEMPLATE_CONFIG' ) ) ! { ! mx_message_die( CRITICAL_ERROR, "Could not open $template_name template config file", '', __LINE__, __FILE__ ); ! } ! $img_lang = ( file_exists( $phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'] ) ) ? $board_config['default_lang'] : 'english'; ! while ( list( $key, $value ) = @each( $images ) ) { ! if ( !is_array( $value ) ) { ! $images[$key] = str_replace( '{LANG}', 'lang_' . $img_lang, $value ); } } } return $row; } // This is general replacement for die(), allows templated // output in users (or default) language, etc. // $msg_code can be one of these constants: // GENERAL_MESSAGE : Use for any simple text message, eg. results // of an operation, authorisation failures, etc. // GENERAL ERROR : Use for any error which occurs _AFTER_ the // common.php include and session code, ie. most errors in // pages/functions // CRITICAL_MESSAGE : Used when basic config data is available but // a session may not exist, eg. banned users // CRITICAL_ERROR : Used when config data cannot be obtained, eg // no database connection. Should _not_ be used in 99.5% of cases ! function mx_message_die( $msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '' ) { ! global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $mx_root_path, $nav_links, $gen_simple_header, $images; ! global $userdata, $user_ip, $session_length, $page_title; $sql_store = $sql; // Get SQL error if we are debugging. Do this as soon as possible to prevent // subsequent queries from overwriting the status of sql_error() if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) { --- 224,296 ---- return $row; } + + // // call when only_template is false. ! // ! define('TEMPLATE_ROOT_PATH', $template_path . $template_name . '/'); if ( $template ) { $current_template_path = $template_path . $template_name; + @include($phpbb_root_path . $template_path . $template_name . '/' . $template_name . '.cfg'); ! if ( !defined('TEMPLATE_CONFIG') ) { ! mx_message_die(CRITICAL_ERROR, "Could not open $template_name template config file", '', __LINE__, __FILE__); } ! $img_lang = ( file_exists($phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang']) ) ? $board_config['default_lang'] : 'english'; ! while( list($key, $value) = @each($images) ) { ! if ( !is_array($value) ) { ! $images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value); } } } + return $row; } + + // // This is general replacement for die(), allows templated // output in users (or default) language, etc. + // // $msg_code can be one of these constants: + // // GENERAL_MESSAGE : Use for any simple text message, eg. results // of an operation, authorisation failures, etc. + // // GENERAL ERROR : Use for any error which occurs _AFTER_ the // common.php include and session code, ie. most errors in // pages/functions + // // CRITICAL_MESSAGE : Used when basic config data is available but // a session may not exist, eg. banned users + // // CRITICAL_ERROR : Used when config data cannot be obtained, eg // no database connection. Should _not_ be used in 99.5% of cases ! // ! function mx_message_die($msg_code, $msg_text = '', $msg_title = '', $err_line = '', $err_file = '', $sql = '') { ! global $db, $template, $board_config, $theme, $lang, $phpEx, $phpbb_root_path, $nav_links, $gen_simple_header, $images, $mx_root_path; ! global $userdata, $user_ip, $session_length; ! global $mx_starttime; ! ! if(defined('HAS_DIED')) ! { ! die("message_die() was called multiple times. This isn't supposed to happen. Was message_die() used in page_tail.php?"); ! } ! ! define('HAS_DIED', 1); ! $sql_store = $sql; + + // // Get SQL error if we are debugging. Do this as soon as possible to prevent // subsequent queries from overwriting the status of sql_error() + // if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) { *************** *** 304,347 **** } ! if ( empty( $userdata ) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) ) { ! $userdata = session_pagestart( $user_ip, PAGE_INDEX ); ! mx_init_userprefs( $userdata ); } // If the header hasn't been output then do it ! if ( !defined( 'HEADER_INC' ) && $msg_code != CRITICAL_ERROR ) { ! if ( empty( $lang ) ) { ! if ( !empty( $board_config['default_lang'] ) ) { ! include( $mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx ); } else { ! include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); } } ! if ( empty( $template ) ) { ! $template = new mx_Template( $mx_root_path . 'templates/' . $board_config['board_template'] ); } ! if ( empty( $theme ) ) { ! $theme = setup_style( $board_config['default_style'] ); ! } // Load the Page Header ! if ( !defined( 'IN_ADMIN' ) ) { ! include( $mx_root_path . 'includes/page_header.' . $phpEx ); } else { ! include( $mx_root_path . 'admin/page_header_admin.' . $phpEx ); } } ! switch ( $msg_code ) { case GENERAL_MESSAGE: --- 315,364 ---- } ! if( empty($userdata) && ( $msg_code == GENERAL_MESSAGE || $msg_code == GENERAL_ERROR ) ) { ! $userdata = session_pagestart($user_ip, PAGE_INDEX); ! mx_init_userprefs($userdata); } + + // // If the header hasn't been output then do it ! // ! if ( !defined('HEADER_INC') && $msg_code != CRITICAL_ERROR ) { ! if ( empty($lang) ) { ! if ( !empty($board_config['default_lang']) ) { ! include($mx_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.'.$phpEx); } else { ! include($mx_root_path . 'language/lang_english/lang_main.'.$phpEx); } } ! if ( empty($template) ) { ! $template = new mx_Template($mx_root_path . 'templates/' . $board_config['board_template']); } ! if ( empty($theme) ) { ! $theme = mx_setup_style($board_config['default_style']); ! } ! ! // // Load the Page Header ! // ! if ( !defined('IN_ADMIN') ) { ! include($mx_root_path . 'includes/page_header.'.$phpEx); } else { ! include($mx_root_path . 'admin/page_header_admin.'.$phpEx); } } ! switch($msg_code) { case GENERAL_MESSAGE: *************** *** 372,378 **** case CRITICAL_ERROR: // Critical errors mean we cannot rely on _ANY_ DB information being // available so we're going to dump out a simple echo'd statement ! include( $mx_root_path . 'language/lang_english/lang_main.' . $phpEx ); if ( $msg_text == '' ) --- 389,397 ---- case CRITICAL_ERROR: + // // Critical errors mean we cannot rely on _ANY_ DB information being // available so we're going to dump out a simple echo'd statement ! // ! include($mx_root_path . 'language/lang_english/lang_main.'.$phpEx); if ( $msg_text == '' ) *************** *** 387,393 **** --- 406,415 ---- break; } + + // // Add on DEBUG info if we've enabled debug mode and this is an error. This // prevents debug info being output for general messages should DEBUG be // set TRUE by accident (preventing confusion for the end user!) + // if ( DEBUG && ( $msg_code == GENERAL_ERROR || $msg_code == CRITICAL_ERROR ) ) { *************** *** 400,430 **** if ( $msg_code != CRITICAL_ERROR ) { ! if ( !empty( $lang[$msg_text] ) ) { $msg_text = $lang[$msg_text]; } ! if ( !defined( 'IN_ADMIN' ) ) { ! $template->set_filenames( array( 'message_body' => 'message_body.tpl' ) ! ); } else { ! $template->set_filenames( array( 'message_body' => 'admin/admin_message_body.tpl' ) ! ); ! } ! $template->assign_vars( array( 'MESSAGE_TITLE' => $msg_title, ! 'MESSAGE_TEXT' => $msg_text ) ); ! $template->pparse( 'message_body' ); ! if ( !defined( 'IN_ADMIN' ) ) { ! include( $mx_root_path . 'includes/page_tail.' . $phpEx ); } else { ! include( $mx_root_path . 'admin/page_footer_admin.' . $phpEx ); } } --- 422,456 ---- if ( $msg_code != CRITICAL_ERROR ) { ! if ( !empty($lang[$msg_text]) ) { $msg_text = $lang[$msg_text]; } ! if ( !defined('IN_ADMIN') ) { ! $template->set_filenames(array( ! 'message_body' => 'message_body.tpl') ! ); } else { ! $template->set_filenames(array( ! 'message_body' => 'admin/admin_message_body.tpl') ); ! } ! $template->assign_vars(array( ! 'MESSAGE_TITLE' => $msg_title, ! 'MESSAGE_TEXT' => $msg_text) ! ); ! $template->pparse('message_body'); ! ! if ( !defined('IN_ADMIN') ) { ! include($mx_root_path . 'includes/page_tail.'.$phpEx); } else { ! include($mx_root_path . 'admin/page_footer_admin.'.$phpEx); } } *************** *** 456,500 **** } ! // MX - Redeclarations of functions from function.php ! function mx_redirect( $url, $redirect_msg = '', $redirect_link = '' ) { global $db, $lang; ! if ( $redirect_msg == '' ) { $redirect_msg = $lang['Page_Not_Authorised']; } ! if ( $redirect_link == '' ) { $redirect_link = $lang['Redirect_login']; } ! if ( !defined( 'HEADER_INC' ) ) { ! if ( !empty($db) ) ! { ! $db->sql_close(); ! } ! if ( strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r") ) ! { ! message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.'); ! } ! // Redirect via an HTML form for PITA webservers ! if ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ! { ! header('Refresh: 0; URL=' . PORTAL_URL . $url); ! echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="refresh" content="0; url=' . PORTAL_URL . $url . '"><title>Redirect</title></head><body><div align="center">If your browser does not support meta redirection please click <a href="' . PORTAL_URL . $url . '">HERE</a> to be redirected</div></body></html>'; ! exit; ! } ! // Behave as per HTTP/1.1 spec for others ! header('Location: ' . PORTAL_URL . $url); ! exit; } ! else { ! $message = $redirect_msg . '<br /><br />' . sprintf($redirect_link, '<a href="' . $url . '">', "</a>") . '<br /><br />'; ! mx_message_die(GENERAL_MESSAGE, $message); } } --- 482,534 ---- } ! ! function mx_redirect($url, $redirect_msg = '', $redirect_link = '') { global $db, $lang; ! if ( empty($redirect_msg) ) { $redirect_msg = $lang['Page_Not_Authorised']; } ! if ( empty($redirect_link) ) { $redirect_link = $lang['Redirect_login']; } ! if ( defined('HEADER_INC') ) { ! $message = $redirect_msg . '<br /><br />' . sprintf($redirect_link, '<a href="' . PORTAL_URL . $url . '">', "</a>") . '<br /><br />'; ! mx_message_die(GENERAL_MESSAGE, $message); ! } ! // ! // Save any possible changes made in session variables, otherwise we will loose them. ! // See comments here: ! // http://www.php.net/session ! // http://www.php.net/session_write_close ! // ! @session_write_close(); ! @session_start(); ! ! if ( !empty($db) ) ! { ! $db->sql_close(); } ! ! if ( strstr(urldecode($url), "\n") || strstr(urldecode($url), "\r") ) { ! mx_message_die(GENERAL_ERROR, 'Tried to redirect to potentially insecure url.'); ! } ! // Redirect via an HTML form for PITA webservers ! if ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ! { ! header('Refresh: 0; URL=' . PORTAL_URL . $url); ! echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><meta http-equiv="refresh" content="0; url=' . PORTAL_URL . $url . '"><title>Redirect</title></head><body><div align="center">If your browser does not support meta redirection please click <a href="' . PORTAL_URL . $url . '">HERE</a> to be redirected</div></body></html>'; ! exit; } + + // Behave as per HTTP/1.1 spec for others + header('Location: ' . PORTAL_URL . $url); + exit; } *************** *** 503,507 **** // page number sequence // Only difference from standard phpbb function is you can use more settings ! function mx_generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE, $use_next_symbol = false,$use_previous_symbol = false,$add_preinfo_text = TRUE, $name_id = 'start') { --- 537,541 ---- // page number sequence // Only difference from standard phpbb function is you can use more settings ! // function mx_generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE, $use_next_symbol = false,$use_previous_symbol = false,$add_preinfo_text = TRUE, $name_id = 'start') { Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** mx_functions.php 19 Apr 2005 21:52:43 -0000 1.37 --- mx_functions.php 24 Apr 2005 21:33:36 -0000 1.38 *************** *** 49,113 **** // ****************************************************************** // ****************************************************************** ! function get_info( $table, $idfield = "", $id = 0, $idfield2 = "", $id2 = 0 ) { global $db; ! $sql = "SELECT * FROM $table ! WHERE $idfield = '$id' "; ! $sql .= ($idfield2 != "" && $id2 != "") ? "AND $idfield2 = '$id2' " : ""; [...1136 lines suppressed...] } ! ! $module = $db->sql_fetchrowset($result); ! ! $mx_module_copy = '<h1>' . $lang['mx_copy'] . '</h1><hr /><br />'; ! $mx_module_copy .= $lang['mx_copy_text'] . '<br /><br />'; ! $mx_module_copy .= $lang['mx_modules_text'] . '<br />'; ! ! for( $i = 0; $i < count($module); $i++ ) { ! if( !empty($module[$i]['module_version']) ) { $mx_module_copy .= '<br />' . $module[$i]['module_version'] . ', ' . $module[$i]['module_copy']; } } ! ! $mx_module_copy = $mx_module_copy . '<br /><br /><hr />'; ! mx_message_die(GENERAL_MESSAGE, $mx_module_copy, 'Modules info and copyrights'); } |
|
From: Jon O. <jon...@us...> - 2005-04-21 20:55:51
|
Update of /cvsroot/mxbb/mx_pafiledb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31188/modules/mx_pafiledb Modified Files: db_install.php db_upgrade.php dload.php dload_lists.php pafiledb.pak Log Message: updating for pafiledb 2.0.1 Index: db_upgrade.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/db_upgrade.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** db_upgrade.php 11 Apr 2005 20:00:18 -0000 1.7 --- db_upgrade.php 21 Apr 2005 20:55:42 -0000 1.8 *************** *** 49,53 **** // For compatibility with core 2.7.+ ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); if ( MXBB_27x ) --- 49,53 ---- // For compatibility with core 2.7.+ ! define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.php' ) ); if ( MXBB_27x ) Index: pafiledb.pak =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb.pak,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pafiledb.pak 12 Apr 2005 19:32:56 -0000 1.8 --- pafiledb.pak 21 Apr 2005 20:55:42 -0000 1.9 *************** *** 18,22 **** parameter=+:57=+:156=+:num_of_rows=+:Number=+:3=+: option=+:0=+:0=+:0=+:endoflist=+: ! parameter=+:57=+:157=+:target_block=+:Function=+:0=+:get_list_formatted("block_list","{parameter_value}","{parameter_id}[]", "dload_lists.php") option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 --- 18,22 ---- parameter=+:57=+:156=+:num_of_rows=+:Number=+:3=+: option=+:0=+:0=+:0=+:endoflist=+: ! parameter=+:57=+:157=+:target_block=+:Function=+:0=+:get_list_formatted("block_list","{parameter_value}","{parameter_id}[]", "dload.php") option=+:0=+:0=+:0=+:endoflist=+: parameter=+:0=+:0=+:0=+:endoflist=+:0=+:0 Index: db_install.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/db_install.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** db_install.php 11 Apr 2005 17:55:39 -0000 1.13 --- db_install.php 21 Apr 2005 20:55:42 -0000 1.14 *************** *** 48,52 **** // For compatibility with core 2.7.+ ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); if ( MXBB_27x ) --- 48,52 ---- // For compatibility with core 2.7.+ ! define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.php' ) ); if ( MXBB_27x ) Index: dload.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/dload.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dload.php 11 Apr 2005 17:55:40 -0000 1.9 --- dload.php 21 Apr 2005 20:55:42 -0000 1.10 *************** *** 85,89 **** global $images; } ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); } --- 85,89 ---- global $images; } ! define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.php' ) ); } Index: dload_lists.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/dload_lists.php,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dload_lists.php 12 Apr 2005 19:32:56 -0000 1.8 --- dload_lists.php 21 Apr 2005 20:55:42 -0000 1.9 *************** *** 94,98 **** define( 'MXBB_MODULE', true ); ! define( 'MXBB_27x', file_exists( $mx_root_path . 'more_smilies.php' ) ); include_once( $module_root_path . 'pafiledb/includes/pafiledb_constants.' . $phpEx ); --- 94,98 ---- define( 'MXBB_MODULE', true ); ! define( 'MXBB_27x', file_exists( $mx_root_path . 'mx_login.php' ) ); include_once( $module_root_path . 'pafiledb/includes/pafiledb_constants.' . $phpEx ); |