Advanced search  

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]

Pages: [1]   Go Down

Author Topic: thumbnail page navigation - no image counter  (Read 7955 times)

0 Members and 1 Guest are viewing this topic.

ks

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 44
thumbnail page navigation - no image counter
« 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
1.4x: http://coppermine-gallery.net/demo/cpg14x/thumbnails.php?album=lastup&cat=0


thanks


klaus
« Last Edit: September 01, 2006, 11:30:48 pm by Paver »
Logged

Nibbler

  • Guest
Re: thumbnail page navigation - no image counter
« Reply #1 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
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: thumbnail page navigation - no image counter
« Reply #2 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.
Logged

Nibbler

  • Guest
Re: thumbnail page navigation - no image counter
« Reply #3 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.
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: thumbnail page navigation - no image counter
« Reply #4 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).
Logged

jur

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: thumbnail page navigation - no image counter
« Reply #5 on: October 04, 2006, 11:51:53 am »

A very big thanks  ;D
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 19 queries.