|
From: Jon O. <jon...@us...> - 2006-08-13 18:52:36
|
Update of /cvsroot/mxbb/mx_linkdb/linkdb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28103/modules/mx_linkdb/linkdb/includes Modified Files: functions_linkdb.php Log Message: More module blocks - Mini block - Latest Item block Index: functions_linkdb.php =================================================================== RCS file: /cvsroot/mxbb/mx_linkdb/linkdb/includes/functions_linkdb.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** functions_linkdb.php 4 Aug 2006 20:11:18 -0000 1.18 --- functions_linkdb.php 13 Aug 2006 18:52:32 -0000 1.19 *************** *** 772,779 **** * @param unknown_type $sort_order * @param unknown_type $start - * @param unknown_type $show_file_message * @param unknown_type $cat_id */ ! function display_items( $sort_method, $sort_order, $start, $show_file_message, $cat_id = false ) { global $db, $linkdb_config, $template, $board_config; --- 772,782 ---- * @param unknown_type $sort_order * @param unknown_type $start * @param unknown_type $cat_id + * @param unknown_type $show_file_message + * @param unknown_type $sort_options_list + * @param unknown_type $sql_xtra + * @param unknown_type $target_page_id */ ! function display_items( $sort_method, $sort_order, $start, $cat_id = false, $show_file_message = true, $sort_options_list = false, $sql_xtra = '', $target_page_id = false ) { global $db, $linkdb_config, $template, $board_config; *************** *** 788,792 **** // Category SQL // ! $cat_where = empty( $cat_id ) ? "AND f1.link_catid IN (" . $this->gen_cat_ids( '0' ) . ")" : "AND f1.link_catid = $cat_id"; // --- 791,807 ---- // Category SQL // ! if (!$cat_id) ! { ! $cat_where = "AND f1.link_catid IN (" . $this->gen_cat_ids( '0' ) . ")"; ! } ! else if (is_array($cat_id)) ! { ! $cat_where = "AND f1.link_catid IN (" . $this->gen_cat_ids( $cat_id['parent'] ) . ")"; ! $cat_id = false; ! } ! else ! { ! $cat_where = "AND f1.link_catid = $cat_id"; ! } // *************** *** 802,805 **** --- 817,821 ---- AND f1.link_approved = 1 $cat_where + $sql_xtra GROUP BY f1.link_id ORDER BY $sort_method $sort_order"; *************** *** 813,816 **** --- 829,833 ---- WHERE f1.link_approved = 1 $cat_where + $sql_xtra GROUP BY f1.link_id ORDER BY $sort_method $sort_order"; *************** *** 836,840 **** FROM " . LINKS_TABLE . " AS f1 WHERE f1.link_approved='1' ! $cat_where"; if ( !( $result = $db->sql_query( $sql ) ) ) --- 853,858 ---- FROM " . LINKS_TABLE . " AS f1 WHERE f1.link_approved='1' ! $cat_where ! $sql_xtra"; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 953,956 **** --- 971,1000 ---- $template->assign_block_vars( "FILELIST.file_rows.split_links", array() ); } + + // + // 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( "FILELIST.file_rows.display_date", array()); + break; + case 'username': + $template->assign_block_vars( "FILELIST.file_rows.display_username", array()); + break; + case 'counter': + $template->assign_block_vars( "FILELIST.file_rows.display_counter", array()); + break; + case 'rate': + $template->assign_block_vars( "FILELIST.file_rows.display_rate", array()); + break; + } + } + } + } *************** *** 1069,1076 **** * @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 ) { --- 1113,1122 ---- * @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 ) { *************** *** 1086,1092 **** { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if ( is_numeric( $page_id ) ) { ! $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : ( $non_html_amp ? '&' : '&' ) . $args ); } else --- 1132,1138 ---- { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if ( is_numeric( $pageId ) ) { ! $mxurl .= '?page=' . $pageId . ( $args == '' ? '' : ( $non_html_amp ? '&' : '&' ) . $args ); } else |