|
From: Jon O. <jon...@us...> - 2006-08-13 18:51:43
|
Update of /cvsroot/mxbb/mx_kb/kb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv27663/modules/mx_kb/kb/includes Modified Files: functions_auth.php functions_kb.php Log Message: More module blocks - Mini block - Latest Item block Index: functions_auth.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_auth.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** functions_auth.php 1 Aug 2006 21:00:37 -0000 1.4 --- functions_auth.php 13 Aug 2006 18:51:37 -0000 1.5 *************** *** 347,351 **** global $kb_type_select_data, $kb_config; ! if ( !MXBB_MODULE || MXBB_27x ) { return true; --- 347,351 ---- global $kb_type_select_data, $kb_config; ! if ( !MXBB_MODULE || MXBB_27x || !isset($kb_type_select_data) ) { return true; Index: functions_kb.php =================================================================== RCS file: /cvsroot/mxbb/mx_kb/kb/includes/functions_kb.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** functions_kb.php 4 Aug 2006 20:10:43 -0000 1.17 --- functions_kb.php 13 Aug 2006 18:51:37 -0000 1.18 *************** *** 137,141 **** $db->sql_freeresult( $result ); ! $this->auth( AUTH_ALL, AUTH_LIST_ALL, $userdata, $cat_rowset ); for( $i = 0; $i < count( $cat_rowset ); $i++ ) --- 137,141 ---- $db->sql_freeresult( $result ); ! $this->auth( KB_AUTH_ALL, AUTH_LIST_ALL, $userdata, $cat_rowset ); for( $i = 0; $i < count( $cat_rowset ); $i++ ) *************** *** 821,825 **** /** ! * Enter description here... * * @param unknown_type $start --- 821,825 ---- /** ! * display items. * * @param unknown_type $start *************** *** 828,832 **** * @param unknown_type $approve */ ! function display_items( $start, $cat_id = false ) { global $db, $kb_config, $template, $board_config; --- 828,832 ---- * @param unknown_type $approve */ ! function display_items( $start, $cat_id = false, $sort_options_list = false, $sql_xtra = '', $target_page_id = false ) { global $db, $kb_config, $template, $board_config; *************** *** 836,843 **** $filelist = false; ! if ( empty( $cat_id ) ) { $cat_where = "AND t.article_category_id IN (" . $this->gen_cat_ids( '0' ) . ")"; } else { --- 836,854 ---- $filelist = false; ! $file_rowset = array(); ! $total_file = 0; ! ! // ! // Category SQL ! // ! if (!$cat_id) { $cat_where = "AND t.article_category_id IN (" . $this->gen_cat_ids( '0' ) . ")"; } + else if (is_array($cat_id)) + { + $cat_where = "AND t.article_category_id IN (" . $this->gen_cat_ids( $cat_id['parent'] ) . ")"; + $cat_id = false; + } else { *************** *** 856,859 **** --- 867,871 ---- AND t.article_category_id = cat.category_id $cat_where + $sql_xtra GROUP BY t.article_id ORDER BY " . $this->sort_method_extra . $this->sort_method . " " . $this->sort_order; *************** *** 869,872 **** --- 881,885 ---- WHERE t.approved = '1' $cat_where + $sql_xtra GROUP BY t.article_id ORDER BY " . $this->sort_method_extra . $this->sort_method . " " . $this->sort_order; *************** *** 876,880 **** if ( !( $result = $mx_kb_functions->sql_query_limit( $sql, $kb_config['pagination'], $start ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get file info for this category', '', __LINE__, __FILE__, $sql ); } --- 889,893 ---- if ( !( $result = $mx_kb_functions->sql_query_limit( $sql, $kb_config['pagination'], $start ) ) ) { ! mx_message_die( GENERAL_ERROR, 'Couldn\'t get article info for this category', '', __LINE__, __FILE__, $sql ); } *************** *** 895,899 **** FROM " . KB_ARTICLES_TABLE . " AS t WHERE t.approved='1' ! $cat_where"; if ( !( $result = $db->sql_query( $sql ) ) ) --- 908,913 ---- FROM " . KB_ARTICLES_TABLE . " AS t WHERE t.approved='1' ! $cat_where ! $sql_xtra"; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 1013,1016 **** --- 1027,1055 ---- } + // + // Options (only used for the toplist block) + // + if ($sort_options_list) + { + foreach ($sort_options_list as $sort_option => $options_value) + { + switch ($sort_option) + { + case 'date': + $template->assign_block_vars( "ARTICLELIST.articlerow.display_date", array()); + break; + case 'username': + $template->assign_block_vars( "ARTICLELIST.articlerow.display_username", array()); + break; + case 'counter': + $template->assign_block_vars( "ARTICLELIST.articlerow.display_counter", array()); + break; + case 'rate': + $template->assign_block_vars( "ARTICLELIST.articlerow.display_rate", array()); + break; + } + } + } + } *************** *** 1121,1128 **** * @return unknown */ ! function this_mxurl( $args = '', $force_standalone_mode = false, $non_html_amp = false ) { global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; if ( !MXBB_MODULE ) { --- 1160,1169 ---- * @return unknown */ ! function this_mxurl( $args = '', $force_standalone_mode = false, $non_html_amp = false, $pageId = '' ) { global $mx_root_path, $module_root_path, $page_id, $phpEx, $is_block; + $pageId = empty($pageId) ? $page_id : $pageId; + if ( !MXBB_MODULE ) { *************** *** 1138,1144 **** { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if ( is_numeric( $page_id ) ) { ! $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : ( $non_html_amp ? '&' : '&' ) . $args ); } else --- 1179,1185 ---- { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if ( is_numeric( $pageId ) ) { ! $mxurl .= '?page=' . $pageId . ( $args == '' ? '' : ( $non_html_amp ? '&' : '&' ) . $args ); } else |