Advanced search  

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

Pages: [1]   Go Down

Author Topic: Album Views  (Read 11218 times)

0 Members and 1 Guest are viewing this topic.

sectioni

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Album Views
« on: March 13, 2006, 08:46:39 pm »

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
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Album Views
« Reply #1 on: March 13, 2006, 11:25:57 pm »

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

sectioni

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
Re: Album Views
« Reply #2 on: March 15, 2006, 02:53:06 am »

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.
Logged

lordprodigy

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 228
    • B514 ///
Re: Album Views
« Reply #3 on: March 17, 2006, 06:06:04 pm »

take a look at paver's search album plugin (http://forum.coppermine-gallery.net/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.
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: Album Views
« Reply #4 on: May 22, 2008, 09:22:57 am »

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
Code: [Select]
);

}

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

BEFORE, ADD
Code: [Select]
  'n_views' => ' - %s views',

OPEN
index.php

FIND (2 times)
Code: [Select]
    $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
Code: [Select]
    $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)
Code: [Select]
            $link_pic_count = !empty($alb_stat['link_pic_count']) ? $alb_stat['link_pic_count'] : 0;
AFTER, ADD
Code: [Select]
            $hit_count = !empty($alb_stat['hit_count']) ? $alb_stat['hit_count'] : 0;
FIND
Code: [Select]
            $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
Code: [Select]
            $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
Code: [Select]
            $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
Code: [Select]
            $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
Code: [Select]
            $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
Code: [Select]
            $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
Code: [Select]
            $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
Code: [Select]
            $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
« Last Edit: May 23, 2008, 10:35:10 am by Ludo »
Logged
Pages: [1]   Go Up
 

Page created in 0.025 seconds with 19 queries.