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: [Solved]: Maybe possibility to recover deleted hits-counter!?  (Read 2136 times)

0 Members and 1 Guest are viewing this topic.

bmn

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 6
    • diseņo web tenerife
[Solved]: Maybe possibility to recover deleted hits-counter!?
« on: September 04, 2009, 06:24:39 pm »

Hi there,

Maybe is it better to post  here, then in the Dev corner.

Ok, it now happend  to me. I deleted the hits-counter records.  Shame on me, but that radio button tricked me out. I then changed the util.php.  . . .

The reason why I post is, that there is maybe a possibility to recover the hits-counter. In the database there is a table called "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 "hit_stats" and then write the result or sum for each PID in the row "hits" in the "pictures" table?  I donīt know how to do that.

Is there a way?


« Last Edit: September 22, 2009, 04:04:45 pm by Joachim Müller »
Logged

Nibbler

  • Guest
Re: Maybe possibility to recover deleted hits-counter!?
« Reply #1 on: September 04, 2009, 06:30:12 pm »

Run an SQL query like this in phpMyAdmin

Code: [Select]
UPDATE cpg_pictures AS p SET hits = (SELECT COUNT(*) FROM cpg_hit_stats AS s WHERE s.pid = p.pid)

change the table names as required.
Logged

bmn

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 6
    • diseņo web tenerife
Re: Maybe possibility to recover deleted hits-counter!?
« Reply #2 on: September 05, 2009, 09:33:39 am »

Run an SQL query like this in phpMyAdmin

Code: [Select]
UPDATE cpg_pictures AS p SET hits = (SELECT COUNT(*) FROM cpg_hit_stats AS s WHERE s.pid = p.pid)

change the table names as required.

Thanks! I will try that.

At all with the same problem: donīt forget to backup your database first  ;)
Logged

bmn

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 6
    • diseņo web tenerife
Re: Maybe possibility to recover deleted hits-counter!?
« Reply #3 on: September 22, 2009, 02:12:04 pm »

Hi!

Thanks to Nibbler! It worked!!

Greets
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 20 queries.