aboutsummaryrefslogtreecommitdiffstats
path: root/picture.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2014-04-14 21:38:41 +0000
committerrvelices <rv-github@modusoptimus.com>2014-04-14 21:38:41 +0000
commitcac08d6f486f35322cfe873caaab7f730ac838b1 (patch)
treee5ca2950b681cc03304ca87a7c15a72d94380de1 /picture.php
parent612509bef38393917793c697fee79ba31df55fb6 (diff)
simplified allow_increment_element_hit_count call and also pass the image id in the event ...
git-svn-id: http://piwigo.org/svn/trunk@28184 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r--picture.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/picture.php b/picture.php
index 10c39a789..13599bc43 100644
--- a/picture.php
+++ b/picture.php
@@ -417,23 +417,24 @@ UPDATE '.CATEGORIES_TABLE.'
//---------- incrementation of the number of hits
+$inc_hit_count = !isset($_POST['content']);
// don't increment counter if in the Mozilla Firefox prefetch
if (isset($_SERVER['HTTP_X_MOZ']) and $_SERVER['HTTP_X_MOZ'] == 'prefetch')
{
- add_event_handler('allow_increment_element_hit_count', create_function('$b', 'return false;'));
+ $inc_hit_count = false;
}
else
{
// don't increment counter if comming from the same picture (actions)
if (pwg_get_session_var('referer_image_id',0) == $page['image_id'])
{
- add_event_handler('allow_increment_element_hit_count', create_function('$b', 'return false;'));
+ $inc_hit_count = false;
}
pwg_set_session_var('referer_image_id', $page['image_id']);
}
// don't increment if adding a comment
-if (trigger_event('allow_increment_element_hit_count', !isset($_POST['content']) ) )
+if (trigger_event('allow_increment_element_hit_count', $inc_hit_count, $page['image_id'] ) )
{
$query = '
UPDATE