forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: ks on September 01, 2006, 12:54:19 pm

Title: thumbnail page navigation - no image counter
Post by: ks on September 01, 2006, 12:54:19 pm
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 (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 (http://coppermine-gallery.net/demo/cpg14x/thumbnails.php?album=lastup&cat=0)


thanks


klaus
Title: Re: thumbnail page navigation - no image counter
Post by: Nibbler on September 01, 2006, 01:12:48 pm
Issue tracked to revision 3154, moving to bugs board.

http://svn.sourceforge.net/viewvc/coppermine?view=rev&revision=3154
Title: Re: thumbnail page navigation - no image counter
Post by: Paver on September 01, 2006, 09:52:02 pm
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:
Code: [Select]
// 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.
Title: Re: thumbnail page navigation - no image counter
Post by: Nibbler on September 01, 2006, 10:28:19 pm
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.
Title: Re: thumbnail page navigation - no image counter
Post by: Paver on September 01, 2006, 11:30:36 pm
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).
Title: Re: thumbnail page navigation - no image counter
Post by: jur on October 04, 2006, 11:51:53 am
A very big thanks  ;D