Remove album count. Remove album count.
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Remove album count.

Started by Max88, September 29, 2015, 03:59:18 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Max88

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

Max88

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

allvip

#2
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)


/******************************************************************************
** 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


<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)


/******************************************************************************
** 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


<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


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


WITH


$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


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


REPLACE WITH


$lang_list_albums['alb_hits'] = ' ';



phill104

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.
It is a mistake to think you can solve any major problems just with potatoes.

allvip

Quote from: Phill Luckhurst 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.

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

Max88

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

allvip

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.

Max88

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

The gallery is not open yet.

allvip

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.

Max88

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

allvip: removed at request.

allvip

#10
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.

Max88

#11
Thank you for helping. I uploaded your zip file now but still.

Max88

Never mind. Worked :D Thanks so much!