View Full Version : Photo View Counter
photocroatia
19th of June 2004 (Sat), 00:58
Hi Pekka or anybody else
Is teher anyway of updating the photo view counter (how many tiems a photos has been viewed)?
I am reorganizing my photos , but I don't want to loose the total counter value, as I have over 600000.
Is there anyway of updating the counter, i know the value is greyed out (non updateable)
Thank you.
Pekka
19th of June 2004 (Sat), 16:55
The counters are stored per photo, i.e each photo id has a counter attached. If you reorganize photos using EE's tools counter value is preserved.
If you want to enable counter value updating in photo editor, change in EDITOR_photo.php
/*
$oldcounter = $HTTP_POST_VARS['counter'];
$update_counter = mysql_query(
"
UPDATE
ee_counter
SET
ee_counter.ee_counter_value = '$oldcounter'
WHERE
ee_counter.ee_counter_id = '$counter_id_to_sql'
"
);
ee_error ($update_counter,"update_counter",$currentpage);
*/
to
$oldcounter = $HTTP_POST_VARS['counter'];
$update_counter = mysql_query(
"
UPDATE
ee_counter
SET
ee_counter.ee_counter_value = '$oldcounter'
WHERE
ee_counter.ee_counter_id = '$counter_id_to_sql'
"
);
ee_error ($update_counter,"update_counter",$currentpage);
and code
<br><br>COUNTER:</b><br><input type="text" name="counter" value="<?php print $counter; ?>" size="20" STYLE="color: #999999; background: #dddddd;" maxlength="100" locked <?php
to
<br><br>COUNTER:</b><br><input type="text" name="counter" value="<?php print $counter; ?>" size="20" STYLE="color: #999999; background: #dddddd;" maxlength="100" <?php
and right after that delete line
<input type="hidden" name="counter" value="<?php print $counter; ?>">
photocroatia
19th of June 2004 (Sat), 18:14
Pekka,
Thank you very much.!! Ill give it a shot today
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.