sek_see Posted December 4, 2005 Posted December 4, 2005 I'm changing the normal sort order in my SQL to sort by date added. It works fine until I change pages (as in page 2 of 3), then the other pages reflect a different sort order. I'm not sure where the problem is. The change I made was to the index.php : if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'PRODUCT_LIST_NAME') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by p.products_date_added desc"; break; } } } else { $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1); $sort_order = substr($HTTP_GET_VARS['sort'], 1); $listing_sql .= ' order by '; switch ($column_list[$sort_col-1]) { case 'PRODUCT_LIST_MODEL': $listing_sql .= "p.products_model " . ($sort_order == 'd' ? 'desc' : '') . ", pd.products_name"; ... Would anybody know what other changes I have to make in order to have the sort apply to all split pages? Thank you.
♥yesudo Posted December 4, 2005 Posted December 4, 2005 Go to the product listing page on your site. Click the sort order link above the date added column until the list it is in the order you want. In the URL you will then see a variable called sort. Then change in the code above the following line from: $HTTP_GET_VARS['sort'] = $i+1 . 'a'; To: $HTTP_GET_VARS['sort'] = SORT VALUE FROM URL MENTIONED ABOVE; Example SORT VALUE - 4d. Your online success is Paramount.
sek_see Posted December 4, 2005 Author Posted December 4, 2005 THANK YOU, THANK YOU, THANK YOU. All the information provided gave me enough info to figure out what my problem was. Everything works good now. You guys are awesome. Thanks again. Go to the product listing page on your site. Click the sort order link above the date added column until the list it is in the order you want. In the URL you will then see a variable called sort. Then change in the code above the following line from: $HTTP_GET_VARS['sort'] = $i+1 . 'a'; To: $HTTP_GET_VARS['sort'] = SORT VALUE FROM URL MENTIONED ABOVE; Example SORT VALUE - 4d.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.