Go!
 
 
May 16, 2008, 05:27:26 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Last uploaded picture shown as first  (Read 5600 times)
Dumber
Newbie
*
Offline Offline

Posts: 26


View Profile
« on: March 14, 2007, 01:56:30 PM »

Is it possible the choose how the pictures are sorted in the galleries?
for example:

Last picture I upload shows as last picture in the gallery
Last picture I upload shows as first picture in the gallery
Sorting images on given names

thnx  Cheesy
Logged
Dumber
Newbie
*
Offline Offline

Posts: 26


View Profile
« Reply #1 on: March 15, 2007, 05:08:33 PM »

Is it not possible? Roll Eyes
Logged
Adam
Administrator
Hero Member
*****
Offline Offline

Posts: 4.253



View Profile WWW
« Reply #2 on: March 15, 2007, 08:37:36 PM »

not at this moment no
will have a look at this
Logged

- Joomla developer -

IMPORTANT: http://www.joomla-addons.org/option,com_smf/Itemid,7/topic,1332.0.html
Do not send support requests by PM. Post on the forum in stead.
Dumber
Newbie
*
Offline Offline

Posts: 26


View Profile
« Reply #3 on: March 15, 2007, 08:39:28 PM »

Thnx Adam Cheesy
Logged
Dumber
Newbie
*
Offline Offline

Posts: 26


View Profile
« Reply #4 on: March 26, 2007, 04:05:40 PM »

Did you already made some progress with it?  Roll Eyes Roll Eyes
Logged
ebohatch
Newbie
*
Offline Offline

Posts: 1


View Profile
« Reply #5 on: May 15, 2007, 09:17:22 PM »

I would like the pictures in order based on name.
I put in the following function (at showgallery in easygallery.html.php):

//  usage: objectSort($photos, 'name');
function objectSort(&$data, $key)
{
    for ($i = count($data) - 1; $i >= 0; $i--)
    {
      $swapped = false;
      for ($j = 0; $j < $i; $j++)
      {
           if ($data[$j]->$key > $data[$j + 1]->$key)
           {
                $tmp = $data[$j];
                $data[$j] = $data[$j + 1];       
                $data[$j + 1] = $tmp;
                $swapped = true;
           }
      }
      if (!$swapped) return;
    }
}


to reorder the photo display but this only works for page being displayed.
I finally went to manage photos in the admin and reordered them
 but everytime i need to add new photos they will need to be reordered again.

AHA!

after a little more searching I found I can change the DB query to oder by name
 instead of by ordering in /classes/category.php

now the images will always display in alphabetical order by name
« Last Edit: May 15, 2007, 10:37:41 PM by ebohatch » Logged
diavi
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #6 on: March 21, 2008, 04:44:11 AM »

I need to change mine SO bad!  I REALLY need to have the newest images shown first.  I'm actually a little suprised that this isn't the default way, IMHO.  Any help would be greatly appreciated!  Smiley
Logged
Adam
Administrator
Hero Member
*****
Offline Offline

Posts: 4.253



View Profile WWW
« Reply #7 on: March 21, 2008, 09:47:10 AM »

open /administrator/components/com_easygallery/classes/categories.php

find:
Code:
$query = 'SELECT * FROM #__easygallery
      WHERE cid = ' . $cid . '
      AND state = 1
      ORDER BY ordering';

in the last line:

ORDER BY ordering';

change ordering to name if you would like to sort by name:
ORDER BY name';

change ordering to id DESC, if you would like the newest first:
ORDER BY id DESC';
Logged

- Joomla developer -

IMPORTANT: http://www.joomla-addons.org/option,com_smf/Itemid,7/topic,1332.0.html
Do not send support requests by PM. Post on the forum in stead.
diavi
Newbie
*
Offline Offline

Posts: 2


View Profile
« Reply #8 on: March 21, 2008, 03:03:21 PM »

AWESOME!  That did the trick!  Thank you SO much.  This component really does rock.  Thanks again.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Joomla-addons.org © 2006 | www.bandhosting.nl | JCD-A Member | Newsletter | Sitemap |