|
From: Jon O. <jon...@us...> - 2006-08-13 18:53:13
|
Update of /cvsroot/mxbb/mx_pafiledb/pafiledb/includes In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv28185/modules/mx_pafiledb/pafiledb/includes Modified Files: functions.php functions_pafiledb.php Log Message: More module blocks - Mini block - Latest Item block Index: functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions.php,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** functions.php 4 Aug 2006 16:32:19 -0000 1.29 --- functions.php 13 Aug 2006 18:53:09 -0000 1.30 *************** *** 321,325 **** function page_footer() { ! global $pafiledb_cache, $lang, $pafiledb_template, $board_config, $_GET, $pafiledb, $userdata, $phpbb_root_path; global $phpEx, $template, $do_gzip_compress, $debug, $db, $starttime; global $mx_root_path, $module_root_path, $is_block, $phpEx, $page_id; --- 321,325 ---- function page_footer() { ! global $pafiledb_cache, $lang, $pafiledb_template, $board_config, $pafiledb, $userdata, $phpbb_root_path; global $phpEx, $template, $do_gzip_compress, $debug, $db, $starttime; global $mx_root_path, $module_root_path, $is_block, $phpEx, $page_id; Index: functions_pafiledb.php =================================================================== RCS file: /cvsroot/mxbb/mx_pafiledb/pafiledb/includes/functions_pafiledb.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** functions_pafiledb.php 4 Aug 2006 20:11:50 -0000 1.39 --- functions_pafiledb.php 13 Aug 2006 18:53:09 -0000 1.40 *************** *** 1044,1051 **** * @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, $pafiledb_config, $pafiledb_template, $board_config; --- 1044,1054 ---- * @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, $pafiledb_config, $pafiledb_template, $board_config; *************** *** 1055,1062 **** $filelist = false; // // Category SQL // ! $cat_where = empty( $cat_id ) ? "AND f1.file_catid IN (" . $this->gen_cat_ids( '0' ) . ")" : "AND f1.file_catid = $cat_id"; // --- 1058,1080 ---- $filelist = false; + $file_rowset = array(); + $total_file = 0; + // // Category SQL // ! if (!$cat_id) ! { ! $cat_where = "AND f1.file_catid IN (" . $this->gen_cat_ids( '0' ) . ")"; ! } ! else if (is_array($cat_id)) ! { ! $cat_where = "AND f1.file_catid IN (" . $this->gen_cat_ids( $cat_id['parent'] ) . ")"; ! $cat_id = false; ! } ! else ! { ! $cat_where = "AND f1.file_catid = $cat_id"; ! } // *************** *** 1075,1078 **** --- 1093,1097 ---- AND f1.file_catid = cat.cat_id $cat_where + $sql_xtra GROUP BY f1.file_id ORDER BY $sort_method $sort_order"; *************** *** 1089,1092 **** --- 1108,1112 ---- AND f1.file_approved = 1 $cat_where + $sql_xtra GROUP BY f1.file_id ORDER BY $sort_method $sort_order"; *************** *** 1126,1129 **** --- 1146,1150 ---- AND f1.file_catid = cat.cat_id $cat_where + $sql_xtra GROUP BY f1.file_id ORDER BY $sort_method $sort_order"; *************** *** 1139,1142 **** --- 1160,1164 ---- AND f1.file_approved = 1 $cat_where + $sql_xtra GROUP BY f1.file_id ORDER BY $sort_method $sort_order"; *************** *** 1162,1166 **** FROM " . PA_FILES_TABLE . " AS f1 WHERE f1.file_approved='1' ! $cat_where"; if ( !( $result = $db->sql_query( $sql ) ) ) --- 1184,1189 ---- FROM " . PA_FILES_TABLE . " AS f1 WHERE f1.file_approved='1' ! $cat_where ! $sql_xtra"; if ( !( $result = $db->sql_query( $sql ) ) ) *************** *** 1259,1263 **** 'U_CAT' => $cat_url, 'SHOW_RATINGS' => ( $pa_use_ratings ? true : false ), ! 'U_FILE' => append_sid( $this->this_mxurl( 'action=file&file_id=' . $file_rowset[$i]['file_id'] ) ), 'COLOR' => ( ( $i % 2 ) ? "row2" : "row1" ), 'POSTER' => $file_poster, --- 1282,1287 ---- 'U_CAT' => $cat_url, 'SHOW_RATINGS' => ( $pa_use_ratings ? true : false ), ! 'U_FILE' => append_sid( $this->this_mxurl( 'action=file&file_id=' . $file_rowset[$i]['file_id'], false, false, $target_page_id ) ), ! 'U_FILE_JUMP' => append_sid( $this->this_mxurl( 'action=download&file_id=' . $file_rowset[$i]['file_id'], false, false, $target_page_id ) ), 'COLOR' => ( ( $i % 2 ) ? "row2" : "row1" ), 'POSTER' => $file_poster, *************** *** 1270,1273 **** --- 1294,1322 ---- )); + // + // 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': + $pafiledb_template->assign_block_vars( "file_rows.display_date", array()); + break; + case 'username': + $pafiledb_template->assign_block_vars( "file_rows.display_username", array()); + break; + case 'counter': + $pafiledb_template->assign_block_vars( "file_rows.display_counter", array()); + break; + case 'rate': + $pafiledb_template->assign_block_vars( "file_rows.display_rate", array()); + break; + } + } + } + $filelist = true; $pa_use_ratings = $this->ratings[$file_rowset[$i]['file_catid']]['activated']; *************** *** 1332,1335 **** --- 1381,1386 ---- ); } + + return $total_file; } *************** *** 1343,1346 **** --- 1394,1398 ---- * @param unknown_type $cat_id */ + /* function display_items_quickdl( $sort_method, $sort_order, $start, $show_file_message, $cat_id = false ) { *************** *** 1580,1583 **** --- 1632,1636 ---- } } + */ /** *************** *** 1613,1651 **** * @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 ( $force_standalone_mode || !$is_block ) { $mxurl = $module_root_path . 'dload.' . $phpEx . ( $args == '' ? '' : '?' . $args ); } - else - { - $mxurl = $mx_root_path . 'index.' . $phpEx; - - if ( is_numeric( $page_id ) ) - { - $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : ( $non_html_amp ? '&' : '&' ) . $args ); - } - else - { - $mxurl .= ( $args == '' ? '' : '?' . $args ); - } - } - return $mxurl; - } - - /** - * Enter description here... - * - * @param unknown_type $args - * @param unknown_type $force_standalone_mode - * @param unknown_type $page_id - * @return unknown - */ - function this_mxurl_list( $args = '', $force_standalone_mode = false, $page_id = 1 ) - { - global $mx_root_path, $module_root_path, $phpEx, $is_block; if ( $force_standalone_mode || !$is_block ) --- 1666,1680 ---- * @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 ) { $mxurl = $module_root_path . 'dload.' . $phpEx . ( $args == '' ? '' : '?' . $args ); + return $mxurl; } if ( $force_standalone_mode || !$is_block ) *************** *** 1656,1662 **** { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if ( is_numeric( $page_id ) ) { ! $mxurl .= '?page=' . $page_id . ( $args == '' ? '' : '&' . $args ); } else --- 1685,1691 ---- { $mxurl = $mx_root_path . 'index.' . $phpEx; ! if ( is_numeric( $pageId ) ) { ! $mxurl .= '?page=' . $pageId . ( $args == '' ? '' : ( $non_html_amp ? '&' : '&' ) . $args ); } else |