From 6b24d5a55f4933016edfed44722d8bf6c877b552 Mon Sep 17 00:00:00 2001 From: ozhozh Date: Wed, 27 Apr 2011 15:22:52 +0000 Subject: [PATCH] Add filter on stat query git-svn-id: http://yourls.googlecode.com/svn/trunk@616 12232710-3e20-11de-b438-597f59cd7555 --- yourls-infos.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yourls-infos.php b/yourls-infos.php index 5323195..032c561 100644 --- a/yourls-infos.php +++ b/yourls-infos.php @@ -43,14 +43,16 @@ $table = YOURLS_DB_TABLE_LOG; if( $aggregate ) { - $keywords = join( "', '", $keyword_list ); // Fetch information for all keywords pointing to $longurl - $hits = $ydb->get_results( "SELECT `shorturl`, `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `shorturl` IN ( '$keywords' );" ); + $keywords = join( "', '", $keyword_list ); + $query = "SELECT `shorturl`, `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `shorturl` IN ( '$keywords' );"; } else { // Fetch information for current keyword only - $hits = $ydb->get_results( "SELECT `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `shorturl` = '$keyword';" ); + $query = "SELECT `click_time`, `referrer`, `user_agent`, `country_code` FROM `$table` WHERE `shorturl` = '$keyword'"; } + $hits = $ydb->get_results( yourls_apply_filter( 'stat_query_all', $query ) ); + $referrers = array(); $direct = $notdirect = 0; $countries = array(); -- 2.45.0