Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: thumbnails.php?album=lastalb&cat=0 has wrong pagination  (Read 9218 times)

0 Members and 1 Guest are viewing this topic.

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
thumbnails.php?album=lastalb&cat=0 has wrong pagination
« on: December 01, 2005, 06:21:08 am »

the last updated album page has pagination for ALL of the lastupdated pictures. so you might only have thumbnails of only two albums, but 187 pages of blank.
« Last Edit: December 02, 2005, 04:25:27 pm by Abbas Ali »
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #1 on: December 01, 2005, 06:27:20 am »

I'm not sure what you mean... could you please post a link? I get 20 tabs out of 35 pages.
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #2 on: December 01, 2005, 06:35:13 am »

go to this URL http://takethu.com/thumbnails.php?album=lastalb&cat=0&page=2

You'll notice that you only really have two pages of last updated albums, but your pagination goes up to 16 pages. (Which IS the correct pagination if you were looking at last updated pictures)

If someone has time to look at this great, I was just putting this in the bug boards as a reminder to me, so I don't forget it.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #3 on: December 01, 2005, 07:35:41 am »

OIC. Yeah. It's not just the pagination... the details pertain to the number of files rather than albums.

It's showing:
648 files on 33 page(s)

When it should be:
59 albums on 2 page(s)
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #4 on: December 01, 2005, 06:01:54 pm »

In functions.inc.php

Replacing (in case 'lastalb')

Code: [Select]
                $query = "SELECT COUNT(*) from {$CONFIG['TABLE_PICTURES']} WHERE approved = 'YES' $META_ALBUM_SET";
               
                $result = cpg_db_query($query);
                $nbEnr = mysql_fetch_array($result);
                $count = $nbEnr[0];

with

Code: [Select]
                $query = "SELECT count({$CONFIG['TABLE_ALBUMS']}.aid) FROM {$CONFIG['TABLE_PICTURES']},{$CONFIG['TABLE_ALBUMS']} WHERE {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND approved = 'YES' $META_ALBUM_SET GROUP  BY {$CONFIG['TABLE_PICTURES']}.aid";
               
                $result = cpg_db_query($query);
                $count = mysql_num_rows($result);

does the trick.

Please confirm so that i can commit it in devel branch. Also if approved should this go into stable too?


Abbas
Logged
Chief Geek at Ranium Systems

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #5 on: December 02, 2005, 03:44:54 am »

Yeap, slicker than a snotty hot-dog.

Works for me, I think it needs to be committed to stable and devel.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #6 on: December 02, 2005, 05:26:22 am »

Coolio. The numbering is correct. Just the text needs to be corrected, too.

It says:
55 files on 3 page(s)
instead of
55 albums on 3 page(s)

I looked around the code to figure it out but couldn't.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #7 on: December 02, 2005, 06:26:41 am »

To replace 55 files on 3 page(s) with 55 albums on 3 page(s) we will need to insert a lang string in english.php and all other lang files. Also this will require to modify theme_display_thumbnails function in themes.inc.php and all other theme files which have their own theme_display_thumbnails function.

Should this be done?

I am comitting the fix in devel (only query fix). Will wait before comitting in stable.


Abbas
« Last Edit: December 02, 2005, 06:38:50 am by Abbas Ali »
Logged
Chief Geek at Ranium Systems

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #8 on: December 02, 2005, 06:58:59 am »

files vs albums is so minor particularly on a page that isn't directly linked by a main menu button, I think the language fix can be skipped for stable, but go into devel.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #9 on: December 02, 2005, 07:01:13 am »

i agree with Donovan.
Logged
Chief Geek at Ranium Systems

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #10 on: December 02, 2005, 07:40:53 am »

another "me to" posting. Please do as suggested: commit the query fix to both branches, the language file modification only to the devel branch. Good work.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #11 on: December 02, 2005, 11:39:41 am »

My mistake. There is no need to modify the lang file since "x albums of x pages" is already there in lang file.

I have committed themes.inc.php and themes/sample/theme.php which were modified to replace the "files" string with "albums"  in devel. Now since there is no need to modify lang files should this be done in stable too?



Abbas
Logged
Chief Geek at Ranium Systems

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #12 on: December 02, 2005, 03:11:54 pm »

yes, please commit to stable as well.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
« Reply #13 on: December 02, 2005, 04:24:27 pm »

Done. Now stable and devel both are updated with this fix.

Marking the thread as fixed.


Abbas
Logged
Chief Geek at Ranium Systems
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 18 queries.