|
From: OryNider <ory...@us...> - 2007-07-11 14:25:34
|
Update of /cvsroot/mxbb/mx_smartor/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv28995/includes Modified Files: album_cat.php Log Message: This will readd the droped Jaime Lettering. Index: album_cat.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/includes/album_cat.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** album_cat.php 7 Jun 2007 20:13:27 -0000 1.10 --- album_cat.php 11 Jul 2007 14:25:27 -0000 1.11 *************** *** 115,139 **** $where = ''; ! if ( !empty($HTTP_GET_VARS['initial']) || !empty($HTTP_POST_VARS['initial']) ) { ! $initial = ( !empty($HTTP_POST_VARS['initial']) ) ? $HTTP_POST_VARS['initial'] : $HTTP_GET_VARS['initial']; if ($initial == 'other') ! { ! $other = 1; ! foreach ($letters as $let) ! { ! $where .= " AND p.pic_title NOT LIKE '" . $let . "%' "; ! } ! } elseif ($initial == 'all') { $all = 1; } else // if $initial is set and it is not all and is not other -> it is a letter { $initial_letter = $initial{0}; ! $initial = ($initial != "") ? "'" . $initial{0} . "%'" : "'A%'"; ! $where = " AND p.pic_title LIKE ". $initial; } } --- 115,141 ---- $where = ''; ! if ( !empty($_GET['initial']) || !empty($_POST['initial']) ) { ! $initial = ( !empty($_POST['initial']) ) ? $_POST['initial'] : $_GET['initial']; if ($initial == 'other') ! { ! $other = 1; ! foreach ($letters as $let) ! { ! $jaime_lettering .= " AND p.pic_title NOT LIKE '" . $let . "%' "; ! } ! } elseif ($initial == 'all') { $all = 1; + $jaime_lettering = ''; } else // if $initial is set and it is not all and is not other -> it is a letter { $initial_letter = $initial{0}; ! $initial = ( $initial != "" ) ? "'" . $initial_letter . "%'" : "'A%'"; ! $jaime_lettering = " AND p.pic_title LIKE " . $initial; ! } } *************** *** 141,149 **** { $all = 1; } // End of of Jaime's Initials Mod // ------------------------------------ ! // Get this cat info (watch out Jaime's Initials Mod includes $where in the query) // ------------------------------------ --- 143,152 ---- { $all = 1; + $jaime_lettering = ''; } // End of of Jaime's Initials Mod // ------------------------------------ ! // Get this cat info (watch out Jaime's Initials Mod includes $jaime_lettering in the query) // ------------------------------------ *************** *** 154,158 **** FROM ". ALBUM_CAT_TABLE ." AS c LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id WHERE c.cat_id <> 0 ! $where GROUP BY c.cat_id ORDER BY cat_order"; --- 157,161 ---- FROM ". ALBUM_CAT_TABLE ." AS c LEFT JOIN ". ALBUM_TABLE ." AS p ON c.cat_id = p.pic_cat_id WHERE c.cat_id <> 0 ! $jaime_lettering GROUP BY c.cat_id ORDER BY cat_order"; *************** *** 313,325 **** --- 316,340 ---- $sort_method = 'p.pic_time'; break; + case 'p.pic_time': + $sort_method = 'p.pic_time'; + break; case 'pic_title': $sort_method = 'p.pic_title'; break; + case 'p.pic_title': + $sort_method = 'p.pic_title'; + break; case 'username': $sort_method = 'u.username'; break; + case 'u.username': + $sort_method = 'u.username'; + break; case 'pic_view_count': $sort_method = 'p.pic_view_count'; break; + case 'p.pic_view_count': + $sort_method = 'p.pic_view_count'; + break; case 'rating': $sort_method = 'rating'; *************** *** 342,354 **** --- 357,381 ---- $sort_method = 'p.pic_time'; break; + case 'p.pic_time': + $sort_method = 'p.pic_time'; + break; case 'pic_title': $sort_method = 'p.pic_title'; break; + case 'p.pic_title': + $sort_method = 'p.pic_title'; + break; case 'username': $sort_method = 'u.username'; break; + case 'u.username': + $sort_method = 'u.username'; + break; case 'pic_view_count': $sort_method = 'p.pic_view_count'; break; + case 'p.pic_view_count': + $sort_method = 'p.pic_view_count'; + break; case 'rating': $sort_method = 'rating'; *************** *** 406,409 **** --- 433,437 ---- $pics_per_page = $album_config['rows_per_page'] * $album_config['cols_per_page']; + /* if ($total_pics > 0) { *************** *** 418,423 **** } } ! ! // watch out Jaime's Initials Mod includes $where in the query $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, p.pic_lock, p.pic_approval, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment --- 446,451 ---- } } ! echo 'jaime_lettering:' . $jaime_lettering; ! // watch out Jaime's Initials Mod includes $jaime_lettering in the query $sql = "SELECT p.pic_id, p.pic_title, p.pic_desc, p.pic_user_id, p.pic_user_ip, p.pic_username, p.pic_time, p.pic_cat_id, p.pic_view_count, p.pic_lock, p.pic_approval, u.user_id, u.username, r.rate_pic_id, AVG(r.rate_point) AS rating, COUNT(DISTINCT c.comment_id) AS comments, MAX(c.comment_id) as new_comment *************** *** 426,431 **** LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id ! WHERE p.pic_cat_id = '$cat_id' $pic_approval_sql ! $where GROUP BY p.pic_id ORDER BY $sort_method $sort_order --- 454,460 ---- LEFT JOIN ". ALBUM_RATE_TABLE ." AS r ON p.pic_id = r.rate_pic_id LEFT JOIN ". ALBUM_COMMENT_TABLE ." AS c ON p.pic_id = c.comment_pic_id ! WHERE p.pic_cat_id = '$cat_id' ! $pic_approval_sql ! $jaime_lettering GROUP BY p.pic_id ORDER BY $sort_method $sort_order *************** *** 534,540 **** $template->assign_block_vars('index_pics_block.no_pics', array()); } ! // ! // END thumbnails table ! // --- 563,568 ---- $template->assign_block_vars('index_pics_block.no_pics', array()); } ! */ ! *************** *** 650,657 **** // $page_title = $lang['Album']; ! if ( !$is_block ) ! { include($mx_root_path . 'includes/page_header.'.$phpEx); ! } $base_url = this_smartor_mxurl("smartor_mode=album_cat&cat_id=$cat_id&sort_method=$sort_method&sort_order=$sort_order&initial="); --- 678,686 ---- // $page_title = $lang['Album']; ! ! if ( !$is_block ) ! { include($mx_root_path . 'includes/page_header.'.$phpEx); ! } $base_url = this_smartor_mxurl("smartor_mode=album_cat&cat_id=$cat_id&sort_method=$sort_method&sort_order=$sort_order&initial="); *************** *** 699,752 **** if ($total_pics > 0) ! { ! album_build_picture_table($album_user_id, $cat_id, $thiscat, $auth_data, $start, $sort_method, $sort_order, $total_pics); ! // Last Comments ! if ($album_config['show_last_comments'] == 1) ! { ! album_build_last_comments_info($allowed_cat); ! } ! // Recent Public Pics ! if ($album_config['show_recent_in_subcats'] == 1) ! { ! album_build_recent_pics($allowed_cat); ! } ! // Most Viewed Pics ! if ($album_config['disp_mostv'] == 1) ! { ! album_build_most_viewed_pics($allowed_cat); ! } } ! else { ! // ------------------------------------ ! // Build Recent Public Pics ! // ------------------------------------ ! $has_sub_cats = album_has_sub_cats($cat_id); ! if ($has_sub_cats && $album_config['show_recent_instead_of_nopics'] == 1) ! { ! album_build_recent_pics($allowed_cat); ! } ! else ! { ! $template->assign_block_vars('index_pics_block', array()); ! $template->assign_block_vars('index_pics_block.no_pics', array()); ! $template->assign_block_vars('index_pics_block.enable_gallery_title', array()); ! } } ! // END thumbnails table ! ! album_read_tree($album_user_id); ! $album_nav_cat_desc = album_make_nav_tree($cat_id, this_smartor_mxurl("smartor_mode=album_cat"), 'nav' , $album_user_id); ! if ($album_nav_cat_desc != '') { ! $album_nav_cat_desc = ALBUM_NAV_ARROW . $album_nav_cat_desc; } ! // Maybe we should also add a new check to see if user really can upload or not ! // this is not even in the original code by smartor --- 728,783 ---- if ($total_pics > 0) ! { ! album_build_picture_table($album_user_id, $cat_id, $thiscat, $auth_data, $start, $sort_method, $sort_order, $total_pics); ! // Last Comments ! if ($album_config['show_last_comments'] == 1) ! { ! album_build_last_comments_info($allowed_cat); ! } ! // Recent Public Pics ! if ($album_config['show_recent_in_subcats'] == 1) ! { ! album_build_recent_pics($allowed_cat); ! } ! // Most Viewed Pics ! if ($album_config['disp_mostv'] == 1) ! { ! album_build_most_viewed_pics($allowed_cat); } ! } ! else ! { ! // ------------------------------------ ! // Build Recent Public Pics ! // ------------------------------------ ! $has_sub_cats = album_has_sub_cats($cat_id); ! if ($has_sub_cats && $album_config['show_recent_instead_of_nopics'] == 1) { ! album_build_recent_pics($allowed_cat); } ! else { ! $template->assign_block_vars('index_pics_block', array()); ! $template->assign_block_vars('index_pics_block.no_pics', array()); ! $template->assign_block_vars('index_pics_block.enable_gallery_title', array()); } + } + // + // END thumbnails table + // ! album_read_tree($album_user_id); ! $album_nav_cat_desc = album_make_nav_tree($cat_id, this_smartor_mxurl("smartor_mode=album_cat"), 'nav' , $album_user_id); ! if ($album_nav_cat_desc != '') ! { ! $album_nav_cat_desc = ALBUM_NAV_ARROW . $album_nav_cat_desc; ! } ! ! // Maybe we should also add a new check to see if user really can upload or not ! // this is not even in the original code by smartor *************** *** 843,850 **** ); if ( $album_sp_config['jaime_lettering'] == 1) { $template->assign_block_vars('lettering', array( - // For Jaime's initials mod 'L_SELECT_INITIAL' => ( !empty( $lang['Select_initial'] ) ? $lang['Select_initial'] : 'Select:' ), 'INITIALS' => $initial_links --- 874,881 ---- ); + // For Jaime's initials mod if ( $album_sp_config['jaime_lettering'] == 1) { $template->assign_block_vars('lettering', array( 'L_SELECT_INITIAL' => ( !empty( $lang['Select_initial'] ) ? $lang['Select_initial'] : 'Select:' ), 'INITIALS' => $initial_links |