Changeset 29452 for extensions
- Timestamp:
- Sep 9, 2014, 9:30:58 PM (10 years ago)
- Location:
- extensions/rv_akismet
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rv_akismet/csi.php
r13799 r29452 1 1 <?php 2 define('IN_CSI', 1); 2 3 define('PHPWG_ROOT_PATH','../../'); 3 4 include_once( PHPWG_ROOT_PATH.'include/common.inc.php' ); 4 5 5 $_SESSION['csi']=1; 6 if (!isset($_SESSION['csi'])) 7 $_SESSION['csi'] = 1; 8 6 9 //set_status_header(204); 7 10 header('Content-Type: image/gif'); -
extensions/rv_akismet/main.inc.php
r29181 r29452 1 1 <?php /* 2 2 Plugin Name: RV Akismet 3 Version: 2. 6.d3 Version: 2.7.a 4 4 Description: Uses Akismet online service to check comments agains spam 5 5 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=192 … … 12 12 13 13 add_event_handler('user_comment_check', 'akismet_user_comment_check_wrapper', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 3); 14 add_event_handler('loc_begin_page_tail', 'akismet_page_tail' ); 14 if (!isset($_SESSION['csi'])) 15 add_event_handler('loc_begin_page_tail', 'akismet_page_tail' ); 15 16 16 17 … … 62 63 function akismet_page_tail() 63 64 { 64 global $template, $conf; 65 if (!isset($_SESSION['csi']) && strpos(@$_SERVER['HTTP_USER_AGENT'],'bot')===false) 66 { 67 $src = get_root_url().'plugins/'.AKIS_DIR.'/csi.php'; 68 $template->append( 'footer_elements', '<img src="'.$src.'" width=0 height=0>'); 69 } 65 global $template; 66 67 $ua = @$_SERVER['HTTP_USER_AGENT']; 68 foreach(array('bot','crawl','spider','slurp') as $needle) 69 if (stripos($ua, $needle)!==false) 70 return; 71 72 $src = get_root_url().'plugins/'.AKIS_DIR.'/csi.php'; 73 $template->append( 'footer_elements', '<img src="'.$src.'" width=0 height=0>'); 70 74 } 71 75
Note: See TracChangeset
for help on using the changeset viewer.