forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: donnoman on December 01, 2005, 06:21:08 am

Title: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: donnoman 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.
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Tranz 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.
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: donnoman 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.
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Tranz 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)
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Abbas Ali 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
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: donnoman 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.
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Tranz 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.
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Abbas Ali 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
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: donnoman 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.
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Abbas Ali on December 02, 2005, 07:01:13 am
i agree with Donovan.
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Joachim Müller 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.
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Abbas Ali 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
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Joachim Müller on December 02, 2005, 03:11:54 pm
yes, please commit to stable as well.
Title: Re: thumbnails.php?album=lastalb&cat=0 has wrong pagination
Post by: Abbas Ali 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