Tags connexions between random articles
Clic Titles to drag, double clic to open - Read more / Download
Canvas Test by molokoloco 2010 with http://raphaeljs.com
/", " \n",$string); // Retour à la ligne avec espace $string = preg_replace("/<\/(pre|ul|li|p|table|tr)>/", "\n", $string); $string = preg_replace("/<(.*?)>/","",$string); $dastringta = preg_replace("/\n\n+/", "\n\n", $string); return $string; } */ get_header(); $cacheBase = dirname(__FILE__).'/cache/'; //if (!is_dir($cacheBase)) mkdir($cache, 0777); $cache = $cacheBase.'canvas-'.date("Ymd").'.json'; ### @unlink($cache); if (!is_file($cache)) { // Must cache if you don't want WP to .... @ignore_user_abort(true); $articles = array(); $max = 15; $count = 1; query_posts('cat=16,92&posts_per_page=50&orderby=rand'); if (have_posts()) : while (have_posts()) : the_post(); $posttags = get_the_tags(); $taggs = array(); foreach((array)$posttags as $tag) { $taggs[] = addslashes($tag->name); } if (count($taggs) > 2) { $title = the_title('', '', false); if (strpos($title, '') === FALSE) { // for the moment, i cannot un_html_entities() that, some titles in the blog came from strange rss feed... $title = str_replace('’', '\'', $title); $title = stripTags(un_html_entities(utf8_decode($title))); if (strlen($title) > 40) $title = substr($title, 0, 40).' (...)'; $articles[] = "{href:'".get_permalink()."', title:'".utf8_encode(addslashes($title))."', tags:'".implode(',', $taggs)."'}"; if ($count >= $max) break; else $count++; } } endwhile; $articles = implode(',', $articles); endif; wp_reset_query(); $cachefile = @fopen($cache, 'wb'); @fwrite($cachefile, $articles); @fclose($cachefile); @ignore_user_abort(false); } else $articles = @file_get_contents($cache); //db($articles); ?>
Clic Titles to drag, double clic to open - Read more / Download
Canvas Test by molokoloco 2010 with http://raphaeljs.com