Changeset 28184


Ignore:
Timestamp:
04/14/14 23:38:41 (6 years ago)
Author:
rvelices
Message:

simplified allow_increment_element_hit_count call and also pass the image id in the event ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r27867 r28184  
    418418 
    419419//---------- incrementation of the number of hits 
     420$inc_hit_count = !isset($_POST['content']); 
    420421// don't increment counter if in the Mozilla Firefox prefetch 
    421422if (isset($_SERVER['HTTP_X_MOZ']) and $_SERVER['HTTP_X_MOZ'] == 'prefetch') 
    422423{ 
    423   add_event_handler('allow_increment_element_hit_count', create_function('$b', 'return false;')); 
     424  $inc_hit_count = false; 
    424425} 
    425426else 
     
    428429  if (pwg_get_session_var('referer_image_id',0) == $page['image_id']) 
    429430  { 
    430     add_event_handler('allow_increment_element_hit_count', create_function('$b', 'return false;')); 
     431    $inc_hit_count = false; 
    431432  } 
    432433  pwg_set_session_var('referer_image_id', $page['image_id']); 
     
    434435 
    435436// don't increment if adding a comment 
    436 if (trigger_event('allow_increment_element_hit_count', !isset($_POST['content']) ) ) 
     437if (trigger_event('allow_increment_element_hit_count', $inc_hit_count, $page['image_id'] ) ) 
    437438{ 
    438439  $query = ' 
Note: See TracChangeset for help on using the changeset viewer.