[Fixed]: Reset view counter button can't be turned off [Fixed]: Reset view counter button can't be turned off
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Fixed]: Reset view counter button can't be turned off

Started by jwbirks, July 19, 2006, 12:12:49 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jwbirks

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


Joachim Müller

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.

enquirer64

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.
Negative karma and proud of it...

Tranz

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

Hein Traag


Joachim Müller

@Thu: imo you discovered a bug. Please commit as suggested.

Tranz


superdave

Quote from: TranzNDance on November 14, 2006, 05:54:53 PM
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

Joachim Müller


bmn

#9
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    

Paver

Quote from: bmn on September 04, 2009, 03:43:30 PM
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.