thumbnail page navigation - no image counter thumbnail page navigation - no image counter
 

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

thumbnail page navigation - no image counter

Started by ks, September 01, 2006, 12:54:19 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ks

Hi,

my previous cpg 132 install did show something like '1423 Dateien auf 36 Seite(n)' next to the page links in the thumbnail navigation bar. However, with 1.49 I think I once had seen this too, but now it disappeared and only the page links remain. I can see the same behavior with the official cpg demo. The 1.3x demo shows this info while 1.4x does not. Is there any way to get number of pics info back via a switch in the config?


1.3x: http://coppermine-gallery.net/demo/cpg13x/thumbnails.php?album=lastup&cat=0
1.4x: http://coppermine-gallery.net/demo/cpg14x/thumbnails.php?album=lastup&cat=0


thanks


klaus


Paver

Quick catch, Nibbler.  I cannot figure out what width="100%%" means (and obviously didn't know at the time I made the change).  With a single percent, the line never appears in the output, and you have the reported bug (which I apologize for not seeing).  With two percent signs, the line is output and it only has one percent sign.  It is single-quoted in the array, so it's not variable interpolation.  And I cannot think of any other reason it's necessary.  And I cannot figure out how to search for it on google or php.net.

Regardless, it works, so here's the fix.  Look for this variable in include/themes.inc.php and put in two percent signs as shown:
// Template used for tabbed display
$template_tab_display = array('left_text' => '<td width="100%%" align="left" valign="middle" class="tableh1_compact" style="white-space: nowrap"><b>{LEFT_TEXT}</b></td>' . "\n",
    'tab_header' => '',
    'tab_trailer' => '',
    'active_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="tableb_compact"><b>%d</b></td>',
    'inactive_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="{LINK}"><b>%d</b></a></td>' . "\n",
    'inactive_prev_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="{LINK}"><b>{PREV}</b></a></td>' . "\n",
    'inactive_next_tab' => '<td><img src="images/spacer.gif" width="1" height="1" alt="" /></td>' . "\n" . '<td align="center" valign="middle" class="navmenu"><a href="{LINK}"><b>{NEXT}</b></a></td>' . "\n",
);


You can alternatively add this variable into themes/yourtheme/theme.php and not touch the core script.

Nibbler

I'd imagine the string gets put through a sprintf() later in the code so the % needs to be escaped by another % in order to be taken literally.

Paver

You're right.  I saw the initial strtr() call, but didn't follow it all the way through, and I forgot about the sprintf format string specs (%d, %s, etc).  The files & pages counts are put in with a sprintf call (in the appropriate language string).

Changes (to revert my previous change) applied to devel & stable branches (and to include/themes.inc.php and the sample theme in each).

jur