예제 #1
0
 /**
  * Clean Tag Caches
  *
  * @return string HTML
  */
 function clean_cache()
 {
     set_time_limit(0);
     global $vars;
     // remove all files
     $pkwk_tag = new PluginSonotsTag();
     $files = $pkwk_tag->get_items_filenames();
     $files = array_merge($files, $pkwk_tag->get_tags_filenames());
     $files[] = $pkwk_tag->get_tagcloud_filename();
     foreach ($files as $file) {
         unlink($file);
     }
     // execute all pages
     $exec_pages = sonots::exec_existpages('', '/&tag\\([^;]*\\);/');
     if (empty($exec_pages)) {
         $html = '';
     } else {
         $links = array_map('make_pagelink', $exec_pages);
         $html = '<p>Following pages were executed to assure:</p>' . '<p>' . implode("<br />\n", $links) . '</p>';
     }
     $html .= $pkwk_tag->display_tagcloud();
     return $html;
 }