News:

CPG Release 1.6.28
added submissions from {406man}
cleaned up a few PHP (8.4) deprecations
fixed PHP deprecation in calendar
removed security vulnerability
(please upgrade when possible)

Main Menu

Album Views

Started by sectioni, March 13, 2006, 08:46:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sectioni

Found a few posts on this, but none with a resolution.  I have image view counts and category view counts, but I don't see anything for an album view count.  Is there such a thing?  Ideally, I'd like it to show in the ALB_INFOS block, such as "202 views, 100 files, last one added on xx/xx/xx".

Thanks

cpg 1.4.4

Stramm

album views don't get counted. You only could count all image views in that album

sectioni

Thanks very much.  I'll give a shot at my first mod.  If it works out ok, I'll share what I have if anyone is interested.

lordprodigy

take a look at paver's search album plugin (http://coppermine-gallery.com/forum/index.php?topic=26483.0). it does something similar but not where you want it. take a look at my site to see how it works. I think the simplest thing to do is to kindly ask Paver if he wants to add this feature in his next revision of the plugin.

Ludo

#4
Here is a mod to display album views in albums stats on Album list

Demo: http://vanrokken.altervista.org/index.php?cat=3

Files to edit:
lang/your_lang.php
index.php


OPEN
lang/your_lang.php

FIND
);

}

// ------------------------------------------------------------------------- //
// File keywordmgr.php //cpg1.4


BEFORE, ADD
  'n_views' => ' - %s views',


OPEN
index.php

FIND (2 times)
    $sql = "SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, a.keyword" .

REPLACE WITH
    $sql = "SELECT a.aid, count( p.pid )  AS pic_count, max( p.pid )  AS last_pid, max( p.ctime )  AS last_upload, SUM(p.hits) AS hit_count, a.keyword" .

FIND (4 times)
            $link_pic_count = !empty($alb_stat['link_pic_count']) ? $alb_stat['link_pic_count'] : 0;

AFTER, ADD
            $hit_count = !empty($alb_stat['hit_count']) ? $alb_stat['hit_count'] : 0;

FIND
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0 ) ? sprintf(", {$lang_list_albums['n_link_pictures']},  {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "");

REPLACE WITH
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0 ) ? sprintf(", {$lang_list_albums['n_link_pictures']},  {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "") . (($hit_count > 0) ? sprintf($lang_list_albums['n_views'], $hit_count) : "");

FIND
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0 ) ? sprintf(", {$lang_list_albums['n_link_pictures']},   {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "");

REPLACE WITH
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0 ) ? sprintf(", {$lang_list_albums['n_link_pictures']},  {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "") . (($hit_count > 0) ? sprintf($lang_list_albums['n_views'], $hit_count) : "");

FIND
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0)  ? sprintf(", {$lang_list_albums['n_link_pictures']}, {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "");

REPLACE WITH
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0 ) ? sprintf(", {$lang_list_albums['n_link_pictures']},  {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "") . (($hit_count > 0) ? sprintf($lang_list_albums['n_views'], $hit_count) : "");

FIND
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0 )? sprintf(", {$lang_list_albums['n_link_pictures']}, {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "");

REPLACE WITH
            $alb_list[$alb_idx]['album_info'] = sprintf($lang_list_albums['n_pictures'], $count) . ($count ? sprintf($lang_list_albums['last_added'], $last_upload_date) : "") . (($CONFIG['link_pic_count'] && $link_pic_count > 0 ) ? sprintf(", {$lang_list_albums['n_link_pictures']},  {$lang_list_albums['total_pictures']}", $link_pic_count, $count + $link_pic_count) : "") . (($hit_count > 0) ? sprintf($lang_list_albums['n_views'], $hit_count) : "");

SAVE AND CLOSE ALL FILES