thumbnails.php?album=lastalb&cat=0 has wrong pagination thumbnails.php?album=lastalb&cat=0 has wrong pagination
 

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]

Main Menu

thumbnails.php?album=lastalb&cat=0 has wrong pagination

Started by donnoman, December 01, 2005, 06:21:08 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

donnoman

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.

Tranz

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

donnoman

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.

Tranz

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)

Abbas Ali

In functions.inc.php

Replacing (in case 'lastalb')


                $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


                $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
Chief Geek at Ranium Systems

donnoman

Yeap, slicker than a snotty hot-dog.

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

Tranz

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.

Abbas Ali

#7
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
Chief Geek at Ranium Systems

donnoman

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.

Abbas Ali

Chief Geek at Ranium Systems

Joachim Müller

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.

Abbas Ali

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
Chief Geek at Ranium Systems

Joachim Müller


Abbas Ali

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

Marking the thread as fixed.


Abbas
Chief Geek at Ranium Systems