Import hits

Please, tell me there's a way to import all the old hits that were using this method
http://www.zenphoto.org/support/topic.php?id=332&replies=17
to the new hitcounter function. Otherwise I might cry.
I have almost 7000 images, changing hits manually would take ages. :'(

Comments

  • The hits are stored in the database. Don't know where your hits are being imported from, but if they are in a database you can craft up a query to fetch them from the source and store them in the zenphoto album/image record.
  • Awesome! This is the best support forum ever, thank you so much for the quick reply. :)

    Now, how would I do that? Is there a tutorial online somewhere?
    I have a database called 'photos'and a field (is that correct?) called 'hit' inside the table 'images'
  • I can tell you how to set the counter in zenphoto, but you will have to figure out how to retrieve it from wherever it is.

    Assuming all your image names are unique and your table prefix is 'zp_':
    UPDATE `zp_images` SET `hitcounter` = 'value' WHERE `filename` = 'image name';
    `value` is the new hitcount and `image name` is the filename of the image to get the counter.

    The forum is a bit nasty with the peck marks required by SQL. The green words in the query are all supposed to be enclosed in peck marks.
  • I don't know very much about mysql or php so I'm doing something wrong.
    Here's what I did: I took your code and made it like this http://www.freewebs.com/sf95/junk/sql.txt (first line says <?php, I don't why freewebs makes it <-- instead) I saved the page as a php file, loaded it into my browser and then nothing happened.
  • You may need to find some with the appropriate expertise to help you. It is not a simple task.
Sign In or Register to comment.