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: Remove album count.  (Read 8229 times)

0 Members and 1 Guest are viewing this topic.

Max88

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Remove album count.
« on: September 29, 2015, 03:59:18 pm »

Apparently this trick does not work anymore: http://forum.coppermine-gallery.net/index.php?topic=70498.0
Does anyone have a solution?
Logged

Max88

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Remove album count.
« Reply #1 on: September 29, 2015, 04:00:08 pm »

I mean I want to remove "Album viewed xx times" without messing up the count of the image files on the index page.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Remove album count.
« Reply #2 on: September 29, 2015, 09:19:28 pm »

Open themes/your_theme_name/theme.php

1) PASTE function $template_album_list at the end of theme.php before ?> (first check if the function is already in your theme.php)

Code: [Select]
/******************************************************************************
** Section <<<$template_album_list>>> - START
******************************************************************************/
// HTML template for the album list
$template_album_list = <<<EOT

<!-- BEGIN stat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END stat_row -->
<!-- BEGIN header -->
        <tr class="tableb tableb_alternate">
<!-- END header -->
<!-- BEGIN album_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" align="left" valign="top" class="tableh2">
                        <span class="alblink"><a href="{ALB_LINK_TGT}">{ALBUM_TITLE}</a></span>
                </td>
        </tr>
        <tr>
                <td colspan="3">
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td align="center" valign="middle" class="thumbnails">
                        <img src="images/spacer.gif" width="{THUMB_CELL_WIDTH}" height="1" style="margin-top: 0px; margin-bottom: 0px; border: none;" alt="" /><br />
                        <a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
                </td>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" />
                </td>
                <td width="100%" valign="top" align="left" class="tableb tableb_alternate">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br />{ALB_HITS}</p>
                </td>
        </tr>
        </table>
        </td>
<!-- END album_cell -->
<!-- BEGIN empty_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td height="1" valign="top" class="tableh2">
                        &nbsp;
                </td>
        </tr>
        <tr>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td width="100%" valign="top" class="tableb tableb_alternate">
                    <div class="thumbnails" style="background-color:transparent"><img src="images/spacer.gif" width="1" height="1" border="0" class="image" style="border:0;margin-top:1px;margin-bottom:0" alt="" /></div>
                </td>
        </tr>
        </table>
        </td>
<!-- END empty_cell -->
<!-- BEGIN row_separator -->
        </tr>
        <tr class="tableb tableb_alternate">
<!-- END row_separator -->
<!-- BEGIN footer -->
        </tr>
<!-- END footer -->
<!-- BEGIN tabs -->
        <tr>
                <td colspan="{COLUMNS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END tabs -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;
/******************************************************************************
** Section <<<$template_album_list>>> - END
******************************************************************************/

Now delete from the code above {ALB_HITS} If you want to delete even x files, last one added on date x then delete everything

Code: [Select]
<p class="album_stat">{ALB_INFOS}<br />{ALB_HITS}</p>

2) If you have in Config - Album list view - Show first level album thumbnails in categories ON then paste function $template_album_list_cat (first check if the function is already in your theme.php)

Code: [Select]
/******************************************************************************
** Section <<<$template_album_list_cat>>> - START
******************************************************************************/
// HTML template for the album list
$template_album_list_cat = <<<EOT

<!-- BEGIN c_stat_row -->
        <tr>
                <td colspan="{COLUMNS}" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END c_stat_row -->
<!-- BEGIN c_header -->
        <tr class="tableb tableb_alternate">
<!-- END c_header -->
<!-- BEGIN c_album_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0">
        <tr>
                <td colspan="3" height="1" valign="top" class="tableh2">
                        <span class="alblink"><a href="{ALB_LINK_TGT}">{ALBUM_TITLE}</a></span>
                </td>
        </tr>
        <tr>
                <td colspan="3">
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td align="center" valign="middle" class="thumbnails">
                        <img src="images/spacer.gif" width="{THUMB_CELL_WIDTH}" height="1" style="margin-top: 0px; margin-bottom: 0px; border: none;" alt="" /><br />
                        <a href="{ALB_LINK_TGT}" class="albums">{ALB_LINK_PIC}<br /></a>
                </td>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" />
                </td>
                <td width="100%" valign="top" class="tableb tableb_alternate">
                        {ADMIN_MENU}
                        <p>{ALB_DESC}</p>
                        <p class="album_stat">{ALB_INFOS}<br />{ALB_HITS}</p>
                </td>
        </tr>
        </table>
        </td>
<!-- END c_album_cell -->
<!-- BEGIN c_empty_cell -->
        <td width="{COL_WIDTH}%" valign="top">
        <table width="100%" cellspacing="0" cellpadding="0" >
        <tr>
                <td height="1" valign="top" class="tableh2">
                        &nbsp;
                </td>
        </tr>
        <tr>
                <td>
                        <img src="images/spacer.gif" width="1" height="1" border="0" alt="" /><br />
                </td>
        </tr>
        <tr>
                <td width="100%" valign="top" class="tableb tableb_alternate" >
                      <div class="thumbnails" style="background-color:transparent"><img src="images/spacer.gif" width="1" height="1" border="0" class="image" style="border:0;margin-top:1px;margin-bottom:0" alt="" /></div>
                </td>
        </tr>
        </table>
        </td>
<!-- END c_empty_cell -->
<!-- BEGIN c_row_separator -->
        </tr>
        <tr class="tableb tableb_alternate">
<!-- END c_row_separator -->
<!-- BEGIN c_footer -->
        </tr>
<!-- END c_footer -->
<!-- BEGIN c_tabs -->
        <tr>
                <td colspan="{COLUMNS}" style="padding: 0px;">
                        <table width="100%" cellspacing="0" cellpadding="0">
                                <tr>
                                       {TABS}
                                </tr>
                        </table>
                </td>
        </tr>
<!-- END c_tabs -->
<!-- BEGIN c_spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END c_spacer -->

EOT;
/******************************************************************************
** Section <<<$template_album_list_cat>>> - END
******************************************************************************/

Now delete from the code above {ALB_HITS} If you want to delete even x files, last one added on date x then delete everything

Code: [Select]
<p class="album_stat">{ALB_INFOS}<br />{ALB_HITS}</p>

If you want to delete just , last one added on date x and keep x files then Open lang/english.php

REPLACE

Code: [Select]
$lang_list_albums['last_added'] = ', last one added on %s';

WITH

Code: [Select]
$lang_list_albums['last_added'] = ' ';

IMPORTANT 
If your gallery is in another language like french then edit french.php

If you have in Config - Language & Charset settings - Autodetect language ON then you have to edit all the languages files.



You can also do it via lang/english.php but like Phill said it means the edit would need to be redone every time cpg is updated.

Open lang/english.php

FIND

Code: [Select]
$lang_list_albums['alb_hits'] = 'Album viewed %s times';

REPLACE WITH

Code: [Select]
$lang_list_albums['alb_hits'] = ' ';

« Last Edit: December 14, 2015, 06:10:46 pm by allvip »
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Remove album count.
« Reply #3 on: September 29, 2015, 10:19:34 pm »

Better to do it via the theme.php file than the language files. While your suggestion will work it means the edit would need to be redone every time cpg is updated.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Re: Remove album count.
« Reply #4 on: September 30, 2015, 03:57:19 am »

Better to do it via the theme.php file than the language files. While your suggestion will work it means the edit would need to be redone every time cpg is updated.

I forgot. You're right. Thanks a lot. I updated my reply.
Logged

Max88

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Remove album count.
« Reply #5 on: September 30, 2015, 11:42:00 am »

Thanks for your reply, but I can't get it to work. Here is my theme.php file. Is it another version pherhaps?
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Remove album count.
« Reply #6 on: September 30, 2015, 01:02:43 pm »

You did not posted themes/your_current_theme_name/theme.php.
You posted themes/sample/theme.php
The sample theme is not be used but to copy function from it to your theme.php whenever you want to edit a function.

What theme are you using? Please post a link to your gallery.
Logged

Max88

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Remove album count.
« Reply #7 on: September 30, 2015, 04:46:27 pm »

That is the theme.php file I have in /public_html/domainname.com/themes/cpg3

The gallery is not open yet.
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Remove album count.
« Reply #8 on: September 30, 2015, 06:26:26 pm »

How did the cp3 theme did a big mistake. He copyed all the functions from sample theme. This is not the way to do a theme. Anyway I removed {ALB_INFOS} from your theme and attached it to this post.
I also updated my first reply.

If you want you can give me the entire cp3 folder in a zip archive and I will correct it for you.
Logged

Max88

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Remove album count.
« Reply #9 on: September 30, 2015, 09:20:25 pm »

Here is the file. I uploaded the theme.php but it still shows "Album viewed 0 times" etc...

allvip: removed at request.
« Last Edit: September 30, 2015, 10:20:52 pm by allvip »
Logged

allvip

  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Posts: 1362
Re: Remove album count.
« Reply #10 on: September 30, 2015, 09:36:05 pm »

DONE.
You supose to upload just folder mnd-cpg05 in the folder themes not all the cpg05 folder and sorry was {ALB_HITS} not {ALB_INFOS}. Updated my first reply.
« Last Edit: September 30, 2015, 10:19:20 pm by allvip »
Logged

Max88

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Remove album count.
« Reply #11 on: September 30, 2015, 10:06:20 pm »

Thank you for helping. I uploaded your zip file now but still.
« Last Edit: September 30, 2015, 10:18:46 pm by allvip »
Logged

Max88

  • Coppermine newbie
  • Offline Offline
  • Posts: 7
Re: Remove album count.
« Reply #12 on: September 30, 2015, 10:07:19 pm »

Never mind. Worked :D Thanks so much!
Logged
Pages: [1]   Go Up
 

Page created in 0.031 seconds with 20 queries.