Add "Viewed" to view_photo page?

jblucher

Joined: 2004-12-25
Posts: 3
Posted: Sat, 2004-12-25 20:08

I am trying to add the number of times the picture has been viewed to the photo page under the custom fields. I've tried copying and pasting the code from other pages, and I've acheived partial success. However, it's always displaying the number 4. I'm guessing this is not the actual click count for this image. Has anyone done this before? Any tips?

 
jblucher

Joined: 2004-12-25
Posts: 3
Posted: Sun, 2004-12-26 17:45

I think I've figured it out. I wasn't passing the correct photo id, to get the click count. Anyways, this is what I added to the caption section of view_photo.

<!-- caption -->
<p align="center" class="modcaption"><?php echo editCaption($gallery->album, $index) ?>

<!-- Times Viewed -->

<br>
<?php
	if (!(strcmp($gallery->album->fields["display_clicks"] , "yes")) && !$gallery->session->offline && ($gallery->album->getItemClicks($index) > 0)) {					
			
		echo _("Viewed:") ." ". pluralize_n2(ngettext("1 time", "%d times", $gallery->album->getItemClicks($index)), $gallery->album->getItemClicks($index));					
		echo ".</div>\n";				
		}
?>

</p>

Next, I'd like to figure out a way to add Times Viewed to the mouse over tooltip on the image from view_album. If anyone knows how to set the tooltip, I'd appreciate the help.