Remove %d albums on %d page(s) Remove %d albums on %d page(s)
 

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

Remove %d albums on %d page(s)

Started by meek, December 30, 2006, 12:22:04 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

meek

Hi.

I've been searching hi and low to find a way to remove the ""xx albums on xx page(s)"" which is listed under each catogory. I've looked through this forum but can't find any similar issue. I can't seem to find the code (album_on_page?) anywhere in the core or template files. Does anyone have an idea?

Thanks in advance.

Meek.

gotwings

Hi Meek!

I found one way to do this after lurking for a while.... Go to a language file
(for example: lang/english.php) and then null out  the value of the
album_on_page hash key. Here's a diff:


<   'album_on_page' => '',
---
>   'album_on_page' => '%d albums on %d page(s)',


But this probably is not the right/themeable way to make this change. I looked
at the theme_display_album_list() function and found something promising:


    $theme_alb_list_tab_tmpl['left_text'] = strtr($theme_alb_list_tab_tmpl['left_text'], array('{LEFT_TEXT}' => $lang_album_list['al
bum_on_page']));
    $theme_alb_list_tab_tmpl['inactive_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_tab'], array('{LINK}' => 'index.php?cat=' .
$cat . '&amp;page=%d'));
    $theme_alb_list_tab_tmpl['inactive_next_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_next_tab'], array('{LINK}' => 'index.ph
p?cat=' . $cat . '&amp;page=%d'));
    $theme_alb_list_tab_tmpl['inactive_prev_tab'] = strtr($theme_alb_list_tab_tmpl['inactive_prev_tab'], array('{LINK}' => 'index.ph
p?cat=' . $cat . '&amp;page=%d'));


This looks like the place that changes _should_ be made.... But I've hesitated, because
it looks like this code might handle the case when a category has a large number of albums,
which require paging/navigation?

Does anyone know the right way to remove the per-category stats?

Cheers!

PS:

This eyeball-based gallery uses the simple language-file trick:

http://galleries.chgpa.org

zac

I think this is a fine way to do it... same solution as here

http://forum.coppermine-gallery.net/index.php?topic=7228.0

while you are at it you might want to change

'pic_on_page' => '%d files on %d page(s)', -->  'pic_on_page' => ' ',

The only problem with this method that I see is that it leaves an empty <td> where the stats were.  I found old solutions where they deleted {STATISTICS} from the theme but that doesnt seem to work with latest cpg.

meek

Hi guys.

Thanks for your answers. I went with the fastest and easiest method - I changed the value of "album_on_page" in my language file with the value "&nbsp;". It seems to work perfectly.

Kind regards,

Meek.

Gizmo

It's best if you stick to editing the theme.php file in your theme. This way when you upgrade, you won't have to remember all the other hacks that you did on any core files. To answer the question in the first post, you can edit the $template_tab_display variable like below. If you don't have $template_tab_display in your theme.php, copy it from the sample theme.php and paste it into yours.

// 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",
);


and remove the {LEFT_TEXT} tag. Edit the html code to give the divider line to suit your taste.

// 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"></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",
);
Did you read the manual first???? Taking 2 minutes to backup your files can save you hours of wondering what you screwed up.
Billy Bullock - BullsEyePhotos Blog of Indecision