Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Fixed]: Reset view counter button can't be turned off  (Read 24954 times)

0 Members and 1 Guest are viewing this topic.

jwbirks

  • Coppermine newbie
  • Offline Offline
  • Posts: 5
[Fixed]: Reset view counter button can't be turned off
« 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

« Last Edit: September 05, 2009, 01:16:34 am by Paver »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Reset view counter button can't be turned off
« Reply #1 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.
Logged

enquirer64

  • Coppermine novice
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 21
Re: Reset view counter button can't be turned off
« Reply #2 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.
Logged
Negative karma and proud of it...

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Reset view counter button can't be turned off
« Reply #3 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.
Logged

Hein Traag

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: nl
  • Offline Offline
  • Gender: Male
  • Posts: 2166
  • A, B, Cpg
    • Personal website - Spintires.nl
Re: Reset view counter button can't be turned off
« Reply #4 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

Cheers!
Hein
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Reset view counter button can't be turned off
« Reply #5 on: November 15, 2006, 08:10:41 am »

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

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Reset view counter button can't be turned off
« Reply #6 on: November 15, 2006, 06:06:12 pm »

committed to stable and devel.
Logged

superdave

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 25
Re: Reset view counter button can't be turned off
« Reply #7 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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Reset view counter button can't be turned off
« Reply #8 on: June 11, 2007, 09:46:02 am »

Will go into cpg1.4.11
Logged

bmn

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 6
    • diseño web tenerife
Re: Reset view counter button can't be turned off
« Reply #9 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    
« Last Edit: September 05, 2009, 01:18:39 am by Paver »
Logged

Paver

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 1609
  • Paul V.
Re: [Fixed]: Reset view counter button can't be turned off
« Reply #10 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.035 seconds with 19 queries.