on my website: http://gracebook.pl/ I added fancybox so that users can display larger versions of images (see magnifier icon near each image).
Under every photo there's also information how many times it was clicked. But this feature works only when user clicks on a photo and open it in new page.
I'm trying to figure out if there's a way to count clicks with fancybox so that image gain +1 view when user clicks on magnifier and launching fancybox.
Any clues?
I think I should somehow add a function like this:
function myCall() {
var request = $.ajax({
url: "PHP FILE URL",
type: "GET",
data: {n : '__hash__'},
dataType: "html"
});
And then query database with php:
mysql_connect("IP", "USER", "PASS") or die(mysql_error());
mysql_select_db("DB NAME") or die(mysql_error());
mysql_query("UPDATE `TABLE` SET `Views` = `Views` +1 WHERE `Hash` = 'SOMETHING'");
But I have no idea how to do this :)
I would be grateful for any clues.
I'm using Version: 1.3.4 (11/11/2010).