[Evocms-plugins-commits] SF.net SVN: evocms-plugins: [322] am_search_cloud_plugin/trunk/ _am_search
Brought to you by:
blueyed
From: <ya...@us...> - 2007-04-27 09:29:09
|
Revision: 322 http://svn.sourceforge.net/evocms-plugins/?rev=322&view=rev Author: yabs Date: 2007-04-27 02:28:39 -0700 (Fri, 27 Apr 2007) Log Message: ----------- added copyright and license minor doc and code changes Modified Paths: -------------- am_search_cloud_plugin/trunk/_am_search_cloud.plugin.php Modified: am_search_cloud_plugin/trunk/_am_search_cloud.plugin.php =================================================================== --- am_search_cloud_plugin/trunk/_am_search_cloud.plugin.php 2007-04-27 09:27:28 UTC (rev 321) +++ am_search_cloud_plugin/trunk/_am_search_cloud.plugin.php 2007-04-27 09:28:39 UTC (rev 322) @@ -4,19 +4,22 @@ * * @package plugins * + * @copyright (c)2007 by AstonishMe - {@link http://astonishme.co.uk/}. + * * {@internal Below is a list of authors who have contributed to design/coding of this file: }} * @author Yabba - {@link http://www.astonishme.co.uk/} * @author Stk - {@link http://www.astonishme.co.uk/} * - */ -if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); - -/** - * AstonishMe Search Cloud Plugin + * @license GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php * + * The idea for this plugin was blatantly stolen from + * Whoo {@link http://www.village-idiot.org/archives/2007/04/15/wp-zeitgeist/ } + * * @package plugins */ +if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); + class am_search_cloud_plugin extends Plugin { var $name = 'AM Search Cloud'; @@ -41,90 +44,7 @@ function SkinBeginHtmlHead() { - echo '<style type="text/css"> -/* AstonishMe Search Cloud plugin styles */ -#search_cloud{ -margin:2em 4em; -padding:1em 2em; -list-style:none; -text-align:center; -} - -#search_cloud legend{ -font-size:130%; -margin:0 2em; -padding:0 1em; -border:1px solid; -} - -#search_cloud ul{ -margin:0; -padding:0; -list-style:none; -} - -#search_cloud li{ -display:inline; -margin:0; -padding:0; -list-style:none; -} - -#search_cloud a{ -padding:4px; -margin:2px; -text-decoration:none; -} - -#search_cloud a:hover{ -background:#eee; -color:#000; -} - -.search_cloud_0{ -font-size:100%; -} - -.search_cloud_1{ -font-size:110%; -} - -.search_cloud_2{ -font-size:120%; -} - -.search_cloud_3{ -font-size:130%; -} - -.search_cloud_4{ -font-size:140%; -} - -.search_cloud_5{ -font-size:150%; -} - -.search_cloud_6{ -font-size:160%; -} - -.search_cloud_7{ -font-size:170%; -} - -.search_cloud_8{ -font-size:180%; -} - -.search_cloud_9{ -font-size:190%; -} - -.search_cloud_10{ -font-size:200%; -} -</style>'."\n\r"; + echo '<link href="'.$this->get_plugin_url().'cloud.css" type="text/css" rel="stylesheet" />'."\n\r"; } function SkinTag( & $params ) @@ -147,7 +67,7 @@ $params[ 'after_each' ] = ( empty( $params['after_each' ] ) ? '</li>' : $params[ 'after_each' ] ); $params[ 'hover_title' ] = ( empty( $params['hover_title' ] ) ? 'Searched #count# times - Read it!' : $params[ 'hover_title' ] ); - $sql = 'select hit_uri, hit_referer, hit_blog_ID from T_hitlog where hit_referer_type = \'search\''.( $search_blog == 1 ? '' : ' and hit_blog_ID = '.$search_blog ).' order by rand()'; + $sql = 'select hit_uri, hit_referer, hit_blog_ID from T_hitlog where hit_referer_type = \'search\''.( $search_blog == 1 ? '' : ' and hit_blog_ID = '.$search_blog ); $all_hits = $DB->get_results( $sql ); $max = 0; foreach( $all_hits as $a_hit ) @@ -204,7 +124,7 @@ $tmp_Blog = & $BlogCache->get_by_ID( $search_stat->blog_ID ); $full_url = str_replace( array( '&', '&' ), array( '&', '&' ), preg_replace( array( '#tempskin=[^&]+?(&|$)#', '#\?$#', '#index\.php$#' ), '', $tmp_Blog->get('baseurlroot').$search_stat->url) ); $class = ( $mult ? intval( ( $search_stat->count - $min ) / $mult * 10 ) : 5 ); - $output .= $params[ 'before_each'].'<a href="'.$full_url.'" title=" '.$this->T_( str_replace ('#count#', "$search_stat->count", $params[ 'hover_title' ] ) ).' " class="search_cloud_'.$class.'">'.str_replace( ' ', ' ', $search_stat->term ).'</a>'.$params[ 'after_each' ]."\n"; + $output .= $params[ 'before_each'].'<a href="'.$full_url.'" title=" '.str_replace ('#count#', $search_stat->count, $this->T_( $params[ 'hover_title' ] ) ).' " class="search_cloud_'.$class.'">'.str_replace( ' ', ' ', $search_stat->term ).'</a>'.$params[ 'after_each' ]."\n"; } $output = ( empty( $output ) ? '' : $params[ 'before_all' ].$params[ 'title' ].$params[ 'block_start' ].$output.$params[ 'block_end' ].$params[ 'after_all' ] ); echo $output; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |