forum.coppermine-gallery.net

Dev Board => cpg1.4 Testing/Bugs => cpg1.4 Testing/Bugs: FIXED/CLOSED => Topic started by: jwbirks on July 19, 2006, 12:12:49 am

Title: [Fixed]: Reset view counter button can't be turned off
Post by: jwbirks on July 19, 2006, 12:12:49 am
I accidentally ran the "Reset view counters" in Admin Tools and lost the record of all of my 20,000+ views.  This happened while I was resizing pictures and deleting the larger ones.  I have a backup of the data base.  If I reinstate the old database, will the links to all my pics be wrong now that the they have been renamed?  Is there a way to recover the view counts?

Incidentally, having "Reset view counters" as the default in Admin Tools is a problem for people who want to keep their counts.  It is very easy to accidentally run it since it only turns off when you select another function.

Thanks for your help.  -John

Title: Re: Reset view counter button can't be turned off
Post by: Joachim Müller on July 19, 2006, 09:07:04 am
If the backup does not contain the situation from before your accidental reset, then you mustn't restore it. It's mandatory to do frequent backups, especially before and after applying crucial maintenance works or changing things that have a deep impact. There is of course no method to restore the hits count except restoring a working backup. Sounds a bit like "help, I've hit myself on the head. How do I stop my head from hurting?". Generic advice: don't hit yourself in the first place. In coppermine terms: admin tools are very powerful (that's why they are available for the admin only), be extra careful when using them.
Title: Re: Reset view counter button can't be turned off
Post by: enquirer64 on November 12, 2006, 09:52:40 am
More attitude...and lectures.

As JWBirks says Reset View Counters is a DEFAULT action. This is not helpful. Saying "admin tools are very powerful" is misleading as admin tools should be just that: Tools that you, the administrator, have invoked. The Default action should be Do Nothing.

Since there is no cancel button in Admin tools you must use the Back button otherwise you'll end up doing just what we have all done - resetting your View Counters! ...and then getting this:

"Sounds a bit like "help, I've hit myself on the head. How do I stop my head from hurting?" -- This is rude and unneccessary.
Title: Re: Reset view counter button can't be turned off
Post by: TranzNDance on November 14, 2006, 05:54:53 pm
I see where the issue is. Each of the radio buttons is "checked" by default. Since only one radio button in a group can be activated, the last one wins, and it happens to be the one that resets the view counter.

Is it ok to remove checked=\"checked\" from util.php:
Code: [Select]
                if ($name){
                    starttable('100%', "<input type=\"radio\" name=\"action\" value=\"$name\" id=\"$name\" checked=\"checked\" class=\"nobg\" /><label for=\"$name\" class=\"clickable_option\" >$title</label> (1)");
                }

I tried it and it no longer activates that radio button by default.
Title: Re: Reset view counter button can't be turned off
Post by: Hein Traag on November 14, 2006, 06:28:51 pm
Thanks TranzDance, needed that ;)

A other thread related to this is http://forum.coppermine-gallery.net/index.php?topic=38414.0 (http://forum.coppermine-gallery.net/index.php?topic=38414.0)

Cheers!
Hein
Title: Re: Reset view counter button can't be turned off
Post by: Joachim Müller on November 15, 2006, 08:10:41 am
@Thu: imo you discovered a bug. Please commit as suggested.
Title: Re: Reset view counter button can't be turned off
Post by: TranzNDance on November 15, 2006, 06:06:12 pm
committed to stable and devel.
Title: Re: Reset view counter button can't be turned off
Post by: superdave on June 11, 2007, 09:42:43 am
Is it ok to remove checked=\"checked\" from util.php:

I tried it and it no longer activates that radio button by default.

i just found this thread because i'm one of the idiots that accidentally deleted his own view counts!!  :(

as you said tranz, this should be done by default in cpg1.4 ... i downloaded this gallery recently and the checked=\"checked\" is still there ...

i've removed checked=\"checked\" and now it's great! cpg1.4 needs to be idiot proof, to prevent idiots like me from deleting their own records. since i didn't backup yet, i lost about 800 views. nothing major though.

thanks for the advice though!  :D
Title: Re: Reset view counter button can't be turned off
Post by: Joachim Müller on June 11, 2007, 09:46:02 am
Will go into cpg1.4.11
Title: Re: Reset view counter button can't be turned off
Post by: bmn on September 04, 2009, 03:43:30 pm
Hi there,

ok, it now happend  to me. Shame on me, but that radio button tricked me out. I changed then the util.php.

But the reason why I reply is, maybe there is a possibility to recover the hits-counter. In the database there is a table called "cpg132_hit_stats". For each PID which is equal to a picture in the gallery there is a line for each hit on a picture. Is there a way to count the hits for each PID in the "cpg132_hit_stats" and then write the result or sum for each PID in the row "hits" in the "cpg132_pictures" table?  I don´t know how to do that.

cu    
Title: Re: [Fixed]: Reset view counter button can't be turned off
Post by: Paver on September 05, 2009, 01:21:04 am
Is there a way to count the hits for each PID in the "cpg132_hit_stats" and then write the result or sum for each PID in the row "hits" in the "cpg132_pictures" table?

The Bugs board is not a place to ask for support.  Please repost your question on the Support board for 1.4.x, under the appropriate sub-board (miscellaneous).

As this is a fixed issue for both 1.4 and 1.5, I'm locking this thread to avoid more replies.