1
yyvonne
How to change order of display in extgallery?
  • 2008/4/10 2:07

  • yyvonne

  • Just popping in

  • Posts: 38

  • Since: 2008/4/4 2


How to change order of display in extgallery?

I want to change it to display newest uploaded photo first, instead of the oldest first.

2
bwoods01
Re: How to change order of display in extgallery?
  • 2008/4/10 5:25

  • bwoods01

  • Just popping in

  • Posts: 51

  • Since: 2004/12/18


Go to eXtGallery on the admin side. Click on the Photo tab. Go to the “Edit/Delete photo” section. Choose the album with the pictures you want to re-arrange, then click on “Submit”. In the weight field you can enter numbers “0” will be the first picture “1” the second picture and so on. Make sure that you select the photos on the left or no changes will be made. Click on “Apply Changes” at the bottom.

Buddy

3
irmtfan
Re: How to change order of display in extgallery?
  • 2008/4/10 11:35

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


thank you Buddy but it seems our newcomer friend "yyvonne" want to change order and you describe how to change sort.
sort and order are totally different.
sort is a custom way to show pictures while order is a 2-way method: Ascending or Descending

anyway i had this problem myself. so here is the solution.
just open the file: class/photoHandler.php
then around line 134 find this function:
function getAlbumPhotoPage($catId$start) {
        
$criteria = new CriteriaCompo();
        
$criteria->add(new Criteria('cat_id',$catId));
        
$criteria->add(new Criteria('photo_approved',1));
        
$criteria->setStart($start);
        
$criteria->setLimit($GLOBALS['xoopsModuleConfig']['nb_column']*$GLOBALS['xoopsModuleConfig']['nb_line']);
        
$criteria->setSort('photo_weight');
        
$criteria->setOrder('ASC');

        return 
$this->getObjects($criteria);
    }

edit this:
$criteria->setOrder('DESC');

4
yyvonne
Re: How to change order of display in extgallery?
  • 2008/4/10 11:37

  • yyvonne

  • Just popping in

  • Posts: 38

  • Since: 2008/4/4 2


Thank you so much, that's exactly what I need!

But I think you need to change the photo_weight to photo_id or photo_date to work.
function getAlbumPhotoPage($catId$start) {
        
$criteria = new CriteriaCompo();
        
$criteria->add(new Criteria('cat_id',$catId));
        
$criteria->add(new Criteria('photo_approved',1));
        
$criteria->setStart($start);
        
$criteria->setLimit($GLOBALS['xoopsModuleConfig']['nb_column']*$GLOBALS['xoopsModuleConfig']['nb_line']);
        
$criteria->setSort('photo_date');
        
$criteria->setOrder('DESC');

        return 
$this->getObjects($criteria);
    }

5
irmtfan
Re: How to change order of display in extgallery?
  • 2008/4/10 14:55

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Ah my bad...
you are right

Login

Who's Online

175 user(s) are online (100 user(s) are browsing Support Forums)


Members: 0


Guests: 175


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits