|
From: Jon O. <jon...@us...> - 2006-06-17 20:12:36
|
Update of /cvsroot/mxbb/mx_newssuite/admin In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv22199/modules/mx_newssuite/admin Modified Files: mx_module_defs.php Log Message: Syncronizing...and code cleanup Index: mx_module_defs.php =================================================================== RCS file: /cvsroot/mxbb/mx_newssuite/admin/mx_module_defs.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mx_module_defs.php 5 Apr 2006 22:35:24 -0000 1.9 --- mx_module_defs.php 17 Jun 2006 20:12:33 -0000 1.10 *************** *** 8,12 **** * */ ! /********************************************************************************\ | Class: mx_module_defs --- 8,17 ---- * */ ! ! if ( !defined( 'IN_PORTAL' ) ) ! { ! die( "Hacking attempt" ); ! } ! /********************************************************************************\ | Class: mx_module_defs *************** *** 32,43 **** { global $lang; ! if (empty($type_row)) { $type_row = array(); } ! $type_row['news_type_select'] = !empty($lang['ParType_news_type_select']) ? $lang['ParType_news_type_select'] : "NewsSuite phpBB/KB Source"; ! return $type_row; } --- 37,48 ---- { global $lang; ! if (empty($type_row)) { $type_row = array(); } ! $type_row['news_type_select'] = !empty($lang['ParType_news_type_select']) ? $lang['ParType_news_type_select'] : "NewsSuite phpBB/KB Source"; ! return $type_row; } *************** *** 50,57 **** global $HTTP_POST_VARS, $db, $board_config, $mx_blockcp, $mx_root_path, $phpEx; global $html_entities_match, $html_entities_replace; ! $parameter_value = $HTTP_POST_VARS[$parameter_data['parameter_name']]; $parameter_opt = ''; ! switch ( $parameter_data['parameter_type'] ) { --- 55,62 ---- global $HTTP_POST_VARS, $db, $board_config, $mx_blockcp, $mx_root_path, $phpEx; global $html_entities_match, $html_entities_replace; ! $parameter_value = $HTTP_POST_VARS[$parameter_data['parameter_name']]; $parameter_opt = ''; ! switch ( $parameter_data['parameter_type'] ) { *************** *** 60,64 **** $module_root_path = $mx_root_path . $mx_blockcp->module_root_path; include( $module_root_path . "includes/newssuite_defs.$phpEx" ); ! $news_types_list[$item_types_all] = $HTTP_POST_VARS[$item_types_all]; for( $z = 0; $z < ( count( $item_types_array ) ); $z++ ) --- 65,69 ---- $module_root_path = $mx_root_path . $mx_blockcp->module_root_path; include( $module_root_path . "includes/newssuite_defs.$phpEx" ); ! $news_types_list[$item_types_all] = $HTTP_POST_VARS[$item_types_all]; for( $z = 0; $z < ( count( $item_types_array ) ); $z++ ) *************** *** 66,77 **** $news_types_list[$item_types_array[$z]] = $HTTP_POST_VARS[$item_types_array[$z]]; } ! $parameter_value = addslashes( serialize( $news_types_list ) ); break; } ! return array('parameter_value' => $parameter_value, 'parameter_opt' => $parameter_opt); } ! // =================================================== // display parameter field and data in the add/edit page --- 71,82 ---- $news_types_list[$item_types_array[$z]] = $HTTP_POST_VARS[$item_types_array[$z]]; } ! $parameter_value = addslashes( serialize( $news_types_list ) ); break; } ! return array('parameter_value' => $parameter_value, 'parameter_opt' => $parameter_opt); } ! // =================================================== // display parameter field and data in the add/edit page *************** *** 88,92 **** } } ! function display_edit_News_type_select( $block_id, $parameter_id, $parameter_data ) { --- 93,97 ---- } } ! function display_edit_News_type_select( $block_id, $parameter_id, $parameter_data ) { *************** *** 95,102 **** $newssuite_config['news_source_switch'] = 'phpbb'; ! $module_root_path = $mx_root_path . $mx_blockcp->module_root_path; ! include( $module_root_path . 'includes/newssuite_constants.' . $phpEx ); ! include( $module_root_path . 'includes/newssuite_functions.' . $phpEx ); include( $module_root_path . "includes/newssuite_defs.$phpEx" ); --- 100,107 ---- $newssuite_config['news_source_switch'] = 'phpbb'; ! $module_root_path = $mx_root_path . $mx_blockcp->module_root_path; ! include( $module_root_path . 'includes/newssuite_constants.' . $phpEx ); ! include( $module_root_path . 'includes/newssuite_functions.' . $phpEx ); include( $module_root_path . "includes/newssuite_defs.$phpEx" ); *************** *** 104,134 **** 'parameter' => 'admin/mx_module_parameters.tpl') ); ! // Get number of forums in db ! $sql = "SELECT * FROM " . $news_cat_table . " ORDER BY $cat_extract_order"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql ); } ! $forums = $db->sql_fetchrowset( $result ); // Get array of categories from the database ! $categories = get_main_cats( $newssuite_config ); ! $news_type_select_data = ( !empty( $parameter_data['parameter_value'] ) ) ? unserialize($parameter_data['parameter_value']) : array(); ! // // Check that some categories exist ! // if ( $total_categories = count( $categories ) ) ! { ! // // Check that some forums exist (these were queried earlier) ! // if ( $total_forums = count( $forums ) ) { --- 109,139 ---- 'parameter' => 'admin/mx_module_parameters.tpl') ); ! // Get number of forums in db ! $sql = "SELECT * FROM " . $news_cat_table . " ORDER BY $cat_extract_order"; ! if ( !( $result = $db->sql_query( $sql ) ) ) { mx_message_die( GENERAL_ERROR, "Couldn't obtain forums information.", "", __LINE__, __FILE__, $sql ); } ! $forums = $db->sql_fetchrowset( $result ); // Get array of categories from the database ! $categories = get_main_cats( $newssuite_config ); ! $news_type_select_data = ( !empty( $parameter_data['parameter_value'] ) ) ? unserialize($parameter_data['parameter_value']) : array(); ! // // Check that some categories exist ! // if ( $total_categories = count( $categories ) ) ! { ! // // Check that some forums exist (these were queried earlier) ! // if ( $total_forums = count( $forums ) ) { *************** *** 136,160 **** { case 'phpbb': ! $template->assign_block_vars( 'switch_forums_phpbb', array( 'COLSPAN' => count( $item_types_array ) + 2 ) ); break; case 'kb': ! $template->assign_block_vars( 'switch_forums_kb', array( 'COLSPAN' => count( $item_types_array ) + 2 ) ); for( $z = 0; $z < ( count( $item_types_array ) ); $z++ ) { ! $template->assign_block_vars( 'switch_forums_kb.types_name', array( 'TYPES_NAME' => $item_types_name_array[$z] ) ); } break; } ! for( $i = 0; $i < $total_categories; $i++ ) { $template->assign_block_vars( 'catrow', array( 'CAT_ID' => $categories[$i]['cat_id'], 'COLSPAN' => count( $item_types_array ) + 1, ! 'CAT_NAME' => $categories[$i]['cat_title'] ) ); ! for( $j = 0; $j < $total_forums; $j++ ) { --- 141,165 ---- { case 'phpbb': ! $template->assign_block_vars( 'switch_forums_phpbb', array( 'COLSPAN' => count( $item_types_array ) + 2 ) ); break; case 'kb': ! $template->assign_block_vars( 'switch_forums_kb', array( 'COLSPAN' => count( $item_types_array ) + 2 ) ); for( $z = 0; $z < ( count( $item_types_array ) ); $z++ ) { ! $template->assign_block_vars( 'switch_forums_kb.types_name', array( 'TYPES_NAME' => $item_types_name_array[$z] ) ); } break; } ! for( $i = 0; $i < $total_categories; $i++ ) { $template->assign_block_vars( 'catrow', array( 'CAT_ID' => $categories[$i]['cat_id'], 'COLSPAN' => count( $item_types_array ) + 1, ! 'CAT_NAME' => $categories[$i]['cat_title'] ) ); ! for( $j = 0; $j < $total_forums; $j++ ) { *************** *** 167,175 **** 'FORUM_NAME' => $forums[$j][$catt_name], 'FORUM_DESC' => $forums[$j][$catt_desc], ! 'CHECKED' => ( $news_type_select_data['forum_news'][$forums[$j]['forum_id']] ? 'CHECKED' : '' ), 'ANNOUNCE_CHECKED' => ( $news_type_select_data['forum_news_announce'][$forums[$j]['forum_id']] ? 'CHECKED' : '' ), 'STICKY_CHECKED' => ( $news_type_select_data['forum_news_sticky'][$forums[$j]['forum_id']] ? 'CHECKED' : '' ), ! 'NORMAL_CHECKED' => ( $news_type_select_data['forum_news_post'][$forums[$j]['forum_id']] ? 'CHECKED' : '' ) ) ); break; --- 172,180 ---- 'FORUM_NAME' => $forums[$j][$catt_name], 'FORUM_DESC' => $forums[$j][$catt_desc], ! 'CHECKED' => ( $news_type_select_data['forum_news'][$forums[$j]['forum_id']] ? 'CHECKED' : '' ), 'ANNOUNCE_CHECKED' => ( $news_type_select_data['forum_news_announce'][$forums[$j]['forum_id']] ? 'CHECKED' : '' ), 'STICKY_CHECKED' => ( $news_type_select_data['forum_news_sticky'][$forums[$j]['forum_id']] ? 'CHECKED' : '' ), ! 'NORMAL_CHECKED' => ( $news_type_select_data['forum_news_post'][$forums[$j]['forum_id']] ? 'CHECKED' : '' ) ) ); break; *************** *** 178,183 **** 'FORUM_NAME' => $forums[$j][$catt_name], 'FORUM_DESC' => $forums[$j][$catt_desc], ! ! 'CHECKED' => ( $news_type_select_data['forum_news'][$forums[$j][$cool_array_category_id]] ? 'CHECKED' : '' ), ) ); for( $z = 0; $z < ( count( $item_types_array ) ); $z++ ) --- 183,188 ---- 'FORUM_NAME' => $forums[$j][$catt_name], 'FORUM_DESC' => $forums[$j][$catt_desc], ! ! 'CHECKED' => ( $news_type_select_data['forum_news'][$forums[$j][$cool_array_category_id]] ? 'CHECKED' : '' ), ) ); for( $z = 0; $z < ( count( $item_types_array ) ); $z++ ) *************** *** 185,189 **** $template->assign_block_vars( 'catrow.forumrow_kb.types', array( 'CHECKED' => ( $news_type_select_data[$item_types_array[$z]][$forums[$j][$cool_array_category_id]] ? 'CHECKED' : '' ), 'TYPE' => $item_types_array[$z], ! 'VALUE' => $item_types_id_array[$z] ) ); } --- 190,194 ---- $template->assign_block_vars( 'catrow.forumrow_kb.types', array( 'CHECKED' => ( $news_type_select_data[$item_types_array[$z]][$forums[$j][$cool_array_category_id]] ? 'CHECKED' : '' ), 'TYPE' => $item_types_array[$z], ! 'VALUE' => $item_types_id_array[$z] ) ); } *************** *** 195,199 **** } } ! $template->assign_vars(array( 'NAME' => $lang[$parameter_data['parameter_name']], --- 200,204 ---- } } ! $template->assign_vars(array( 'NAME' => $lang[$parameter_data['parameter_name']], *************** *** 202,206 **** 'PARAMETER_TYPE' => ( !empty($lang["ParType_".$parameter_data['parameter_type']]) ) ? $lang["ParType_".$parameter_data['parameter_type']] : '', 'PARAMETER_TYPE_EXPLAIN' => ( !empty($lang["ParType_".$parameter_data['parameter_type'] . "_info"]) ) ? '<br />' . $lang["ParType_".$parameter_data['parameter_type'] . "_info"] : '', ! 'MX_IMAGES_ROOT' => $images['mx_graphics']['block_icons'], 'SCRIPT_PATH' => $module_root_path, --- 207,211 ---- 'PARAMETER_TYPE' => ( !empty($lang["ParType_".$parameter_data['parameter_type']]) ) ? $lang["ParType_".$parameter_data['parameter_type']] : '', 'PARAMETER_TYPE_EXPLAIN' => ( !empty($lang["ParType_".$parameter_data['parameter_type'] . "_info"]) ) ? '<br />' . $lang["ParType_".$parameter_data['parameter_type'] . "_info"] : '', ! 'MX_IMAGES_ROOT' => $images['mx_graphics']['block_icons'], 'SCRIPT_PATH' => $module_root_path, *************** *** 208,219 **** 'I_STICKY' => $images['newssuite_folder_sticky'], 'I_NORMAL' => $images['newssuite_folder'], ! 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_STICKY' => $lang['Post_Sticky'], ! 'L_NORMAL' => $lang['Posted'], )); ! $template->pparse('parameter'); ! } } --- 213,224 ---- 'I_STICKY' => $images['newssuite_folder_sticky'], 'I_NORMAL' => $images['newssuite_folder'], ! 'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 'L_STICKY' => $lang['Post_Sticky'], ! 'L_NORMAL' => $lang['Posted'], )); ! $template->pparse('parameter'); ! } } |