Editing Thumbnail view sort order Editing Thumbnail view sort order
 

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

Editing Thumbnail view sort order

Started by CrusaderZA, April 05, 2012, 05:55:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CrusaderZA

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?



Αndré

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.

CrusaderZA

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.

Joe Carver

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



CrusaderZA

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.

Αndré

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

CrusaderZA

Thanks. That's my problem exactly and seems to have fixed the error on the version I'm running on XAMPP to test things.