|
From: Jon O. <jon...@us...> - 2005-12-09 23:22:12
|
Update of /cvsroot/mxbb/core/modules/mx_coreblocks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9047/modules/mx_coreblocks Modified Files: mx_blockcp.php mx_login.php mx_search.php Log Message: - phpbb_stats per page - updated schemas - site search optimization (in progress) - code cleanup in index.php, common.php and page_header.php - gzip fixes in progress Index: mx_login.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_coreblocks/mx_login.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mx_login.php 23 Oct 2005 18:48:21 -0000 1.9 --- mx_login.php 9 Dec 2005 23:22:04 -0000 1.10 *************** *** 40,44 **** )); ! $template->assign_block_vars('switch_user_logged_out', array()); $template->pparse('body_login'); --- 40,63 ---- )); ! // ! // Login box? ! // ! if ( !$userdata['session_logged_in'] ) ! { ! $template->assign_block_vars('switch_user_logged_out', array()); ! ! // ! // Allow autologin? ! // ! if (!isset($board_config['allow_autologin']) || $board_config['allow_autologin'] ) ! { ! $template->assign_block_vars('switch_allow_autologin', array()); ! } ! } ! else ! { ! $template->assign_block_vars('switch_user_logged_in', array()); ! } ! $template->pparse('body_login'); Index: mx_blockcp.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_coreblocks/mx_blockcp.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_blockcp.php 30 Oct 2005 19:01:36 -0000 1.7 --- mx_blockcp.php 9 Dec 2005 23:22:04 -0000 1.8 *************** *** 20,26 **** define( 'IN_PORTAL', 1 ); - $mx_root_path = "./../../"; - include($mx_root_path . 'extension.inc'); include($mx_root_path . 'common.' . $phpEx); --- 20,24 ---- *************** *** 32,37 **** include_once($phpbb_root_path . "includes/functions_post.$phpEx"); // required by mx_generate_smilies - $view_page = false; - // // Start session management --- 30,33 ---- *************** *** 39,43 **** $userdata = session_pagestart($user_ip, '-999'); mx_init_userprefs($userdata); - // // End session management --- 35,38 ---- *************** *** 258,262 **** $mx_blockcp->generate_cp($block_id, $new_block); ! $page_title = $lang['Block_admin']; include( $mx_root_path . 'includes/page_header.' . $phpEx ); --- 253,257 ---- $mx_blockcp->generate_cp($block_id, $new_block); ! $mx_page->page_title = $lang['Block_admin']; include( $mx_root_path . 'includes/page_header.' . $phpEx ); Index: mx_search.php =================================================================== RCS file: /cvsroot/mxbb/core/modules/mx_coreblocks/mx_search.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mx_search.php 1 Oct 2005 14:10:45 -0000 1.7 --- mx_search.php 9 Dec 2005 23:22:04 -0000 1.8 *************** *** 318,325 **** // Look up data ... ! if ( $search_results != '' ) { $sql = "SELECT * FROM " . PAGE_TABLE; - if ( !( $result = $db->sql_query( $sql ) ) ) { --- 318,327 ---- // Look up data ... ! if ( count($search_ids) > 0 ) { + // + // Get all pages with view access + // $sql = "SELECT * FROM " . PAGE_TABLE; if ( !( $result = $db->sql_query( $sql ) ) ) { *************** *** 327,332 **** } - $searchset = ''; while ( $page_row = $db->sql_fetchrow( $result )) { --- 329,334 ---- } + $valid_page_ids = ''; while ( $page_row = $db->sql_fetchrow( $result )) { *************** *** 337,344 **** if ( $page_auth_ary[auth_view] ) { ! $searchset[] = $page_row['page_id']; } } $valid_page_ids = implode( ', ', $searchset ); --- 339,360 ---- if ( $page_auth_ary[auth_view] ) { ! $valid_page_ids[] = $page_row['page_id']; } } + // + // Now find the associated pages + // + $page_ids = array(); + foreach($search_ids as $key => $block_id) + { + $temp_page_id = get_page_id($block_id); + if (in_array($temp_page_id, $valid_page_ids)) + { + $page_ids[$block_id] = $temp_page_id; + } + } + + /* $valid_page_ids = implode( ', ', $searchset ); *************** *** 412,415 **** --- 428,432 ---- $replacement_word = array(); obtain_word_list( $orig_word, $replacement_word ); + */ } *************** *** 417,426 **** // Output header ! $page_title = $lang['Search']; include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! $template->set_filenames( array( 'body' => 'mx_search_results.tpl' ) ! ); $total_match_count = count( $searchset ); --- 434,442 ---- // Output header ! $mx_page->page_title = $lang['Search']; include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! $template->set_filenames( array( 'body' => 'mx_search_results.tpl' ) ); $total_match_count = count( $searchset ); *************** *** 428,434 **** $l_search_matches = ( $total_match_count == 1 ) ? sprintf( $lang['Found_search_match'], $total_match_count ) : sprintf( $lang['Found_search_matches'], $total_match_count ); ! $template->assign_vars( array( 'L_SEARCH_MATCHES' => $l_search_matches, ! 'L_ARTICLE' => $lang['Mx_Page'] ) ! ); $highlight_active = ''; --- 444,451 ---- $l_search_matches = ( $total_match_count == 1 ) ? sprintf( $lang['Found_search_match'], $total_match_count ) : sprintf( $lang['Found_search_matches'], $total_match_count ); ! $template->assign_vars( array( ! 'L_SEARCH_MATCHES' => $l_search_matches, ! 'L_ARTICLE' => $lang['Mx_Page'] ) ! ); $highlight_active = ''; *************** *** 519,528 **** // Output the basic page ! $page_title = $lang['Search']; include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! $template->set_filenames( array( 'body' => 'mx_search_body.tpl' ) ! ); $template->assign_vars( array( 'L_SEARCH_QUERY' => $lang['Search_query'], --- 536,544 ---- // Output the basic page ! $mx_page->page_title = $lang['Search']; include( $mx_root_path . 'includes/page_header.' . $phpEx ); ! $template->set_filenames( array( 'body' => 'mx_search_body.tpl' ) ); $template->assign_vars( array( 'L_SEARCH_QUERY' => $lang['Search_query'], |