summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-content/smarty-plugins/function.popularposts.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-08-29 12:10:12 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-08-29 12:10:12 +0000
commit96d2531821c13a5962b09a5b130d93c8d8b8a987 (patch)
treee257a4b90d1aadbfaec3763eefa1bf58dcab2af6 /wp-inst/wp-content/smarty-plugins/function.popularposts.php
parent04d51d5f3493a358f75449ac08425310978e5b24 (diff)
downloadwordpress-mu-96d2531821c13a5962b09a5b130d93c8d8b8a987.tar.gz
wordpress-mu-96d2531821c13a5962b09a5b130d93c8d8b8a987.tar.xz
wordpress-mu-96d2531821c13a5962b09a5b130d93c8d8b8a987.zip
Removed Smarty stuff
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@249 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-content/smarty-plugins/function.popularposts.php')
-rw-r--r--wp-inst/wp-content/smarty-plugins/function.popularposts.php80
1 files changed, 0 insertions, 80 deletions
diff --git a/wp-inst/wp-content/smarty-plugins/function.popularposts.php b/wp-inst/wp-content/smarty-plugins/function.popularposts.php
deleted file mode 100644
index 4a66e32..0000000
--- a/wp-inst/wp-content/smarty-plugins/function.popularposts.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-/* $Id: function.popularposts.php,v 1.2 2005/01/09 11:54:18 donncha Exp $ */
-
-/*
- * Smarty plugin
- * -------------------------------------------------------------
- * File: function.popularposts.php
- * Type: function
- * Name: popularposts
- * Purpose: outputs an image from the images/ directory.
- * -------------------------------------------------------------
- */
-
-function getlinks( $wpblog )
-{
- global $wpdb, $site;
- $s = strlen( $site );
- $sql = "SELECT visitURL, sum( visitTimes ) as c
- FROM `referer_visitLog`
- WHERE blogID = '".$wpblog."'
- AND visitURL LIKE '%/'
- GROUP BY visitURL
- ORDER BY c DESC LIMIT 0 , 30";
- $results = $wpdb->get_results($sql);
- if( $results )
- {
- reset( $results );
- while( list( $key, $t ) = each( $results ) )
- {
- if( substr( $t->visitURL, -9 ) == 'index.php' )
- $t->visitURL = substr( $t->visitURL, 0, -9 );
- $hits[ $t->visitURL ] += $t->c;
- }
- arsort( $hits );
- $hits = array_flip( $hits );
- reset( $hits );
- while( list( $key, $val ) = each( $hits ) )
- {
- if( substr( $val, -1 ) == '/' )
- {
- $post_name = substr( $val, 0, -1 );
- $post_name = substr( $post_name, strrpos( $post_name, '/' ) + 1 );
- $sql = "SELECT post_title
- FROM ".$wpdb->posts."
- WHERE post_name = '".$post_name."'";
- $results = $wpdb->get_results($sql);
- if( $results )
- {
- $links[ $key ] = array( "url" => $val, "title" => stripslashes( $results[0]->post_title ) );
- }
- }
- }
- }
- else
- {
- $links = false;
- }
-
- return $links;
-}
-
-function smarty_function_popularposts($params, &$smarty)
-{
- global $wpblog;
- extract( $params );
-
- if( @include_once( "Cache/Function.php" ) )
- {
- $cache = new Cache_Function( 'file', array('cache_dir' => ABSPATH . "/wp-content/smarty-cache", 'filename_prefix' => 'popularposts_cache_' ), 3600 );
- $links = $cache->call( "getlinks", $wpblog );
- }
- else
- {
- $links = getlinks( $wpblog, $site );
- }
-
- $smarty->assign( "pposts", $links );
-}
-?>