Author Topic: sort new image page by date added  (Read 7096 times)

0 Members and 1 Guest are viewing this topic.

Offline Ljay

  • Newbie
  • *
  • Posts: 26
    • View Profile
sort new image page by date added
« on: January 17, 2008, 05:25:55 PM »
The pictures in my gallery are sorted by image name. On the index page, when a person follows the link to the new images page, the new images are also sorted by name.
I would like to have them sorted by date added, but still keep my other categories sorted by image name. Is there a way to do this?

Offline Ljay

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: sort new image page by date added
« Reply #1 on: February 09, 2008, 04:28:48 PM »
anyone please? I'm sure it must be easy, just something to add on the search.php page to tell the site how to order results maybe? I'm not good with coding so can't work it out myself

Offline Ljay

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: sort new image page by date added
« Reply #2 on: February 17, 2009, 02:55:17 AM »
Can anyone please help me with this? I want to keep all my categories in order of image name, but want the search results page for new images to show the files by date added in descending order (so that the newest images will be at the top of the page)

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: sort new image page by date added
« Reply #3 on: February 17, 2009, 05:44:19 AM »
try this (not tested):
in search.php find:
Code: (PHP/MySQL) [Select]
          ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."Replace with:
Code: (PHP/MySQL) [Select]
          ORDER BY ".((!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) ? "image_date DESC" : $config['image_order']." ".$config['image_sort']).", image_id ".$config['image_sort']."
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Ljay

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: sort new image page by date added
« Reply #4 on: February 17, 2009, 11:59:30 PM »
thank you so much it works perfectly :mrgreen:

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: sort new image page by date added
« Reply #5 on: October 22, 2010, 10:43:46 PM »
Hi,

1.7.8 works :) thx


Greetz X23

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--

jerickJames137

  • Guest
Re: sort new image page by date added
« Reply #6 on: October 23, 2010, 04:41:20 AM »
This message has been deleted by Rembrandt as spam!
« Last Edit: October 23, 2010, 05:08:16 AM by Rembrandt »