coppermine-gallery.com/forum

Support => cpg1.5.x Support => cpg1.5 miscellaneous => Topic started by: Secretcloud on June 20, 2011, 08:59:16 AM

Title: Is there any way to maintain "total views" even if I delete certain images?
Post by: Secretcloud on June 20, 2011, 08:59:16 AM
Hi, first off let me say that I love your program. I have had fun with it so far and enjoy it very much.

Now for my question, I did some searches on this forum but could not find anybody speaking about my specific inquiry in regards to photo views:

I am curious if there is a way to keep the "total lifetime views" for my gallery regardless whether photos have been removed or not?

Basically, I want to remove a section from my gallery but that will also reduce my total views from:

"303 files in 7 albums and 2 categories with 4 comments viewed 23419 times"

all the way down to:

"70 files in 6 albums and 2 categories with 4 comments viewed 2445 times"

Is there any possibility to make it so that it does not base this number on files that remain but instead a "total lifetime time views" of the gallery history instead? For example, I know that on youtube if I delete a video my total video views on my channel does not fluctuate and is unaffected by the deleted video.  So if I had a total of 100,000 views and removed a video with 25,000 views my total will still remain 100,000 instead of becoming 75,000 because of the deleted video.  Is there anyway to do that here with Coppermine so that I can remove a large folder that was viewed heavily and even with the removed folder I can still maintain my total views for the lifetime of the gallery?

Thanks for any help about this,

Secretcloud
Title: Re: Is there any way to maintain "total views" even if I delete certain images?
Post by: ΑndrĂ© on June 22, 2011, 12:39:32 PM
That's not possible by default. Maybe it works when you move images (instead of deleting them) in a hidden, password protected album (I haven't checked that). If that's no option you'd have to insert a new value in the database that counts up every time someone views an image (the function add_hit would be the right place). Then you'll have to modify/extend the following row, so it just reads your new value instead of calculating it from all available images:
Quote303 files in 7 albums and 2 categories with 4 comments viewed 23419 times