DOMnews 1.0. Author: Pixline Version: 0.3.1 Author URI: http://pixline.net/ ANT Plugin (C) 2007 Paolo Tresso / Pixline - http://pixline.net/ DOMnews 1.0 (C) Chris Heilmann - http://onlinetools.org/tools/domnews/) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ $parts = pathinfo(__FILE__); define("CACHE_PATH",str_replace("plugins/accessible-news-ticker","cache-feed",$parts['dirname'])); function widget_ant_install(){ if(!is_dir(CACHE_PATH) && !is_writeable(CACHE_PATH)){ mkdir(CACHE_PATH, 0777); } $ant_defaults = array("title"=>"Latest News", "howmany"=>5, "content"=>"posts", "category"=>"", "feedurl"=> ""); add_option('widget_ant_options',$ant_defauls); } register_activation_hook(__FILE__, 'widget_ant_install'); #include_once(get_bloginfo('url')."/wp-content/plugins/accessible-news-ticker/includes/simplepie.inc"); include_once("includes/simplepie.inc"); function ant_trim_sentence($string, $num){ //taglia frase e aggiunge ... $done = 0; $letters = 0; $sentence = ''; $words = explode(" ", trim($string)); $totalwords = count($words); for($i = 0; $i < $totalwords; $i++) { $word_array = preg_split('//', $words[$i], -1, PREG_SPLIT_NO_EMPTY); $letters = $letters + count($word_array); if (($letters > $num) && ($done == 0)) { $sentence = trim($sentence) . "..."; $done = 1; } if ($done == 0) { $sentence .= $words[$i] . " "; } } return ($sentence); } function widget_ant_init() { if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') ) return; function widget_ant_headscript(){ echo " "; $options = get_option('widget_ant_options'); # $minheight = empty($options['height']) ? '2em' : $options['height']; // deprecated/obsolete $speed = empty($options['speed']) ? 'slow' : $options['speed']; ?> " . $title ."". $after_title; switch($kind): case 'posts': # if(isset($cat) && $cat != 0) $menocat = "&exclude=".$cat; else $menocat = ""; // if global post list, but inside cat, exclude double posts $news = get_posts("numberposts=".$howmany."&category=".$antcat.$menocat); echo "
Accessible News Ticker widget.
©GPL 2008 Pixline | Support Forum | Donate!