forum.coppermine-gallery.net

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Aknot on June 30, 2012, 02:33:03 pm

Title: Reset Album viewed
Post by: Aknot on June 30, 2012, 02:33:03 pm
I have a site that I display sports cards on. http://www.facciolli.com/cards/index.php?cat=10001

I would like to know if there is a way reset the Album Viewed information:

For example Dolphins For Trade:
148 files, last one added on May 31, 2012
Album viewed 23 times

I would like to reset that 23 times (or whatever number it may be if you look) to 0.

Thanks in advance for any support.

Title: Re: Reset Album viewed
Post by: Αndré on July 02, 2012, 10:30:46 am
Do you want to reset just the albums view counters, or also the file view counters?
Title: Re: Re: Reset Album viewed
Post by: Aknot on July 03, 2012, 04:31:33 pm
Do you want to reset just the albums view counters, or also the file view counters?

Both if not album is more important to me.

Thanks.
Title: Re: Reset Album viewed
Post by: Αndré on July 03, 2012, 04:41:48 pm
Open util.php, find
Code: [Select]
cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET hits = 0 $albstr");and below, add
Code: [Select]
cpg_db_query("UPDATE {$CONFIG['TABLE_ALBUMS']} SET alb_hits = 0 $albstr");
Now, please use the admin tools to reset the view counters.


For your information: that code change has already been committed to our SVN repository in revision 8438 and will be part of the next Coppermine release, cpg1.5.22.
Title: Re: Reset Album viewed
Post by: Aknot on July 03, 2012, 06:12:10 pm
I went into the file you said. I could not even find the word "hit". I copied and pasted it into notepad and searched again and could not find that string or the word hit.

I am using 1.5.20.
Title: Re: Reset Album viewed
Post by: Αndré on July 03, 2012, 06:36:50 pm
Sounds like you visited that file with your browser at your gallery? If so, that's not what I want you to do. Please open the file with your favorite text editor (you'll probably have to download it via FTP/SSH/etc. in advance). Then, do as suggested. It's definitely there, see here (http://coppermine.svn.sourceforge.net/viewvc/coppermine/trunk/cpg1.5.x/util.php?r1=8438&r2=8437&pathrev=8438).
Title: Re: Reset Album viewed
Post by: Aknot on July 03, 2012, 09:04:43 pm
Got it and thank you for your help.
Title: Re: Reset Album viewed
Post by: Αndré on July 03, 2012, 09:26:24 pm
Please
tag your answer as "solved" by clicking on the "Topic Solved" button on the bar at the left hand side at the bottom of your thread.