coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 themes (visuals) => Topic started by: CrusaderZA on April 05, 2012, 05:55:03 PM

Title: Editing Thumbnail view sort order
Post by: CrusaderZA on April 05, 2012, 05:55:03 PM
I'm trying to upgrade my Coppermine to the latest version. I've got a heavily modified theme from 1.4.18 which seems to work fine except for the sort order of the thumbnail view and I can't figure out how to correct that.

My previous theme.php contained this:
// HTML template for title row of the thumbnail view (album title + sort options)
$template_thumb_view_title_row = <<<EOT

                        <table width="100%" cellpadding="0" cellspacing="0">
                        <tr>
                                <td class="statlink"><h2 style="text-align:left;">{ALBUM_NAME}</h2></td>
                                <td><img src="images/spacer.gif" width="1" alt="" /></td>
                                <td class="sortorder_cell" width="250">
                                        <table cellpadding="0" cellspacing="0" align="center">
                                        <tr><td class="sortorder_options" >SORT BY: </td>
<td width="10"></td>


                                                <td class="sortorder_options">{DATE}: </td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=da" title="{SORT_DA}">&nbsp;+&nbsp;</a></span></td>
                                                <td class="sortorder_options">


<span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=dd" title="{SORT_DD}">&nbsp;-&nbsp;</a></span></td>
                                       <td width="10"></td>
                                                <td class="sortorder_options">{POSITION}: </td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=pa" title="{SORT_PA}">&nbsp;+&nbsp;</a></span></td>
                                                <td class="sortorder_options"><span class="statlink"><a href="thumbnails.php?album={AID}&amp;page={PAGE}&amp;sort=pd" title="{SORT_PD}">&nbsp;-&nbsp;</a></span></td>
                                        </tr>
                                        </table>
                                </td>
                        </tr>
                        </table>

EOT;


It shows the sort options, Sort by {Date} + - {Position} + - , but when you click on the + or - it gives an error stating Error The selected album/file does not exist!

Any ideas how I can fix this?


Title: Re: Editing Thumbnail view sort order
Post by: ΑndrĂ© on April 06, 2012, 11:19:32 AM
Please enable debug mode to see the extended error message. If I remember correctly we already had a thread dealing with the same issue. Please also post a link to your gallery if you need further help.
Title: Re: Editing Thumbnail view sort order
Post by: CrusaderZA on April 06, 2012, 07:05:55 PM
Thanks for the help.

I've got 3 separate Coppermine installs running. With my main gallery I've removed the sort option for the time being.

I've just updated the second gallery located at http://www.spacewallpapers.net/aircraft-wallpaper/index.php and it has the same problem (uses same theme).

With debug mode on the error given is:
The selected album/file does not exist!
File: /home/mysite/public_html/aircraft-wallpaper/include/functions.inc.php - Line: 2380

I think the method the sorting is handled has changed between the two installs and that it can no longer find the functions previously used.
Title: Re: Editing Thumbnail view sort order
Post by: Joe Carver on April 07, 2012, 12:27:29 AM
Ugh - pop under ads...

Quote from: CrusaderZA on April 05, 2012, 05:55:03 PM
... I've got a heavily modified theme...
Any ideas how I can fix this?

Finish upgrading the theme - at least start by removing:

<script type="text/javascript" src="scripts.js">
</script>


It throws more than a few errors in the Firefox error console.

Check it here:
The W3C Markup Validation Service  (http://validator.w3.org/)


Title: Re: Editing Thumbnail view sort order
Post by: CrusaderZA on April 07, 2012, 04:06:11 PM
Sorry about the pop-under ads. The hosting is quite expensive so need to make ends meet and that's the way that pay the most. Luckily they'll only show once every 24 hours.

I'm a bit out of my depth here since I don't really know what I'm doing and I can't remember much about the original template modification. I think it's one that came from version 1.3 if I'm not mistaken and I'm sure there will be lots of room for improvement so I'm definitely open to any help/suggestions.
Title: Re: Editing Thumbnail view sort order
Post by: ΑndrĂ© on April 07, 2012, 04:09:24 PM
Have a look at the sort order link targets. The tokens don't get replaced with the actual IDs, e.g.:
Quotehttp://www.spacewallpapers.net/aircraft-wallpaper/thumbnails.php?album={AID}&page={PAGE}&sort=da

So it's the same issue as described here: http://forum.coppermine-gallery.net/index.php/topic,74607.0.html
Title: Re: Editing Thumbnail view sort order
Post by: CrusaderZA on April 07, 2012, 08:42:47 PM
Thanks. That's my problem exactly and seems to have fixed the error on the version I'm running on XAMPP to test things.