Member
Member
Barbara   2008-01-11, 23:51
#1

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

Member
Member
sbillard   2008-01-12, 01:20
#2

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.

Member
Member
Barbara   2008-01-13, 00:04
#3

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'

Member
Member
sbillard   2008-01-13, 01:11
#4

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.

Member
Member
Barbara   2008-01-13, 18:13
#5

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

Member
Member
sbillard   2008-01-14, 03:53
#6

You may need to find some with the appropriate expertise to help you. It is not a simple task.

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.