|
From: Jon O. <jon...@us...> - 2008-05-21 22:08:07
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv26229 Modified Files: Tag: core28x mx_functions.php Log Message: Trimmed the get_page_id() function a bit, to find also default dynamic blocks and making the query a bit more limited Index: mx_functions.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions.php,v retrieving revision 1.72.2.5 retrieving revision 1.72.2.6 diff -C2 -d -r1.72.2.5 -r1.72.2.6 *** mx_functions.php 3 May 2008 19:11:22 -0000 1.72.2.5 --- mx_functions.php 21 May 2008 22:07:59 -0000 1.72.2.6 *************** *** 791,795 **** } - if( empty($p_row['page_id']) ) { --- 791,794 ---- *************** *** 821,825 **** foreach($block_ids_array as $key => $block_id) { ! if ($block_id = $search_item) { $p_row = $temp_row; --- 820,868 ---- foreach($block_ids_array as $key => $block_id) { ! if ($block_id == $search_item) ! { ! $p_row = $temp_row; ! continue; ! } ! } ! ! if (!empty($p_row['page_id'])) ! { ! continue; ! } ! } ! $db->sql_freeresult($result); ! } ! ! if( empty($p_row['page_id']) ) ! { ! // ! // Find if block is a default dynamic block (desperate try) ! // ! $sql = "SELECT pag.page_id, pag.page_name, pag.page_desc, sys.parameter_value ! FROM " . COLUMN_BLOCK_TABLE . " bct, ! " . PAGE_TABLE . " pag, ! " . COLUMN_TABLE . " col, ! " . BLOCK_SYSTEM_PARAMETER_TABLE . " sys, ! " . PARAMETER_TABLE . " par ! WHERE pag.page_id = col.page_id ! AND bct.column_id = col.column_id ! AND bct.block_id = sys.block_id ! AND sys.parameter_id = par.parameter_id ! AND par.parameter_name = 'default_block_id' ! ORDER BY sys.block_id"; ! ! if( !($p_result = $db->sql_query($sql)) ) ! { ! mx_message_die(GENERAL_ERROR, "Could not query column list", '', __LINE__, __FILE__, $sql); ! } ! ! while( $temp_row = $db->sql_fetchrow($p_result) ) ! { ! $block_ids_array = explode(',' , $temp_row['parameter_value']); ! ! foreach($block_ids_array as $key => $block_id) ! { ! if ($block_id == $search_item) { $p_row = $temp_row; |