From 96d2531821c13a5962b09a5b130d93c8d8b8a987 Mon Sep 17 00:00:00 2001 From: donncha Date: Mon, 29 Aug 2005 12:10:12 +0000 Subject: Removed Smarty stuff git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@249 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- .../wp-content/smarty-plugins/function.referer.php | 128 --------------------- 1 file changed, 128 deletions(-) delete mode 100644 wp-inst/wp-content/smarty-plugins/function.referer.php (limited to 'wp-inst/wp-content/smarty-plugins/function.referer.php') diff --git a/wp-inst/wp-content/smarty-plugins/function.referer.php b/wp-inst/wp-content/smarty-plugins/function.referer.php deleted file mode 100644 index cda8e59..0000000 --- a/wp-inst/wp-content/smarty-plugins/function.referer.php +++ /dev/null @@ -1,128 +0,0 @@ -= NOW() - INTERVAL 24 HOUR ORDER BY visitTime DESC"; - //} - $result = $wpdb->get_results($sql); - if( $result ) - { - foreach( $result as $details ) - { - if( $details->referingURL == 'DIRECT' ) - { - $details->baseDomain = $details->referingURL; - } - else - { - $t = preg_replace("/http:\/\//i", "", $details->referingURL ); - $t = preg_replace("/^www\./i", "", $t ); - $t = preg_replace("/\/.*/i", "", $t ); - $details->baseDomain = $t; - } - if( $details->baseDomain != 'DIRECT' ) - { - if( substr( $details->baseDomain, 0, 6 ) == 'google' ) - { - $refererlinks[ 'google' ][ 'visitTimes' ] += $details->visitTimes; - $refererlinks[ 'google' ][ 'referingURL' ] = "http://www.google.com/"; - $refererlinks[ 'google' ][ 'baseDomain' ] = "google.com"; - } - elseif( strpos( $details->baseDomain, "ebsearch.com" ) ) - { - $refererlinks[ 'websearch' ][ 'visitTimes' ] += $details->visitTimes; - $refererlinks[ 'websearch' ][ 'referingURL' ] = "http://www.websearch.com/"; - $refererlinks[ 'websearch' ][ 'baseDomain' ] = "websearch.com"; - } - elseif( strpos( $details->baseDomain, "ahoo.com" ) ) - { - $refererlinks[ 'yahoo' ][ 'visitTimes' ] += $details->visitTimes; - $refererlinks[ 'yahoo' ][ 'referingURL' ] = "http://www.yahoo.com/"; - $refererlinks[ 'yahoo' ][ 'baseDomain' ] = "yahoo.com"; - } - elseif( strpos( $details->baseDomain, "sxml.infospace.com" ) ) - { - $refererlinks[ 'yahoo' ][ 'visitTimes' ] += $details->visitTimes; - $refererlinks[ 'yahoo' ][ 'referingURL' ] = "http://msxml.infospace.com/"; - $refererlinks[ 'yahoo' ][ 'baseDomain' ] = "infospace.com"; - } - elseif( strpos( $details->baseDomain, $siteDomain ) === false ) - { - $refererlinks[ $details->referingURL ][ "referingURL" ] = $details->referingURL; - $refererlinks[ $details->referingURL ][ "visitTimes" ] += $details->visitTimes; - $refererlinks[ $details->referingURL ][ "baseDomain" ] = $details->baseDomain; - } - } - } - if(is_array( $refererlinks ) == false ) - $refererlinks = array(); - reset( $refererlinks ); - while( list( $key, $val ) = each( $refererlinks ) ) - { - if( $val[ 'visitTimes' ] < 3 ) - unset( $refererlinks[ $key ] ); - } - } - else - { - $refererlinks = ''; - } - return $refererlinks; -} - -function smarty_function_referer($params, &$smarty) -{ - global $post, $wpdb, $wpblog; - - - $ref = getenv('HTTP_REFERER'); - $currentURL = $_SERVER['REQUEST_URI']; - $fullCurrentURL = "http://" . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; - - $tomorrow = date( "d", mktime (0,0,0,date("m") ,date("d")+1,date("Y")) ); - if( $site == 'root' ) - { - $sql = "delete from referer_visitLog WHERE dayofmonth = '$tomorrow'"; // delete referers from a (month - 1 day) ago. - $result = $wpdb->query( $query ); - } - - $siteurl = get_settings( "siteurl" ); - $siteDomain = str_replace( "http://", "", $siteurl ); - if( strpos( $siteDomain, "/" ) ) - $siteDomain = substr( $siteDomain, 0, strpos( $siteDomain, "/" ) ); - - // find referers for current page - - if( @include_once( "Cache/Function.php" ) ) - { - $cache = new Cache_Function( 'file', array('cache_dir' => ABSPATH . "/wp-content/smarty-cache", 'filename_prefix' => 'referers_cache_' ), 600 ); - $refererlinks = $cache->call( "getreferers", $wpblog, $siteDomain ); - } - else - { - $refererlinks = getreferers( $wpblog, $siteDomain ); - } - - - if( is_array( $refererlinks ) ) - reset( $refererlinks ); - - $smarty->assign( "refererlinks", $refererlinks ); -} - -?> -- cgit