From 6d2ef17c1f61608469a15f3221104d3c10716d3a Mon Sep 17 00:00:00 2001 From: ozhozh Date: Sun, 25 Sep 2011 19:32:51 +0000 Subject: [PATCH] New filters and actions into yourls-infos.php. Fixes issue 948. git-svn-id: http://yourls.googlecode.com/svn/trunk@697 12232710-3e20-11de-b438-597f59cd7555 --- yourls-infos.php | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/yourls-infos.php b/yourls-infos.php index 135ccc8..ea8e54d 100644 --- a/yourls-infos.php +++ b/yourls-infos.php @@ -34,6 +34,8 @@ yourls_redirect( YOURLS_SITE, 302 ); } +yourls_do_action( 'pre_yourls_infos', $keyword ); + if( yourls_do_log_redirect() ) { // Duplicate keywords, if applicable @@ -154,7 +156,18 @@ $referrer_sort[$site] = array_sum( $urls ); } arsort($referrer_sort); - + + // Filter all this junk if applicable. Be warned, some are possibly huge datasets. + $referrers = yourls_apply_filter( 'pre_yourls_info_referrers', $referrers ); + $referrer_sort = yourls_apply_filter( 'pre_yourls_info_referrer_sort', $referrer_sort ); + $direct = yourls_apply_filter( 'pre_yourls_info_direct', $direct ); + $notdirect = yourls_apply_filter( 'pre_yourls_info_notdirect', $notdirect ); + $dates = yourls_apply_filter( 'pre_yourls_info_dates', $dates ); + $list_of_days = yourls_apply_filter( 'pre_yourls_info_list_of_days', $list_of_days ); + $list_of_months = yourls_apply_filter( 'pre_yourls_info_list_of_months', $list_of_months ); + $list_of_years = yourls_apply_filter( 'pre_yourls_info_list_of_years', $list_of_years ); + $last_24h = yourls_apply_filter( 'pre_yourls_info_last_24h', $last_24h ); + $countries = yourls_apply_filter( 'pre_yourls_info_countries', $countries ); /** echo "
";
@@ -167,8 +180,7 @@
 	echo "list_of_months: "; print_r( $list_of_months );
 	echo "list_of_years: "; print_r( $list_of_years );
 	echo "last_24h: "; print_r( $last_24h );
-	//echo "countries: "; print_r( $countries );
-
+	echo "countries: "; print_r( $countries );
 	die();
 	/**/
 
@@ -218,6 +230,8 @@
 	

Traffic statistics

+ + - + No traffic yet. Get some clicks first!

"; @@ -435,6 +449,8 @@

Traffic location

+ + @@ -459,6 +475,8 @@
+ + No country data.

"; } ?> @@ -468,6 +486,8 @@

Traffic Sources

+ + @@ -522,6 +542,8 @@
+ + No referrer data.

"; } ?> -- 2.45.0