Esempio n. 1
0
 public function render($matches)
 {
     $count = isset($matches[0]) ? $matches[0] : 20;
     // sanity check
     if (!(int) $count) {
         $count = 20;
     }
     // query the database and layout that stuff
     if (!($text = Members::list_categories_by_count_for_anchor(NULL, 0, $count, 'cloud'))) {
         $text = '<p>' . i18n::s('No item has been found.') . '</p>';
     }
     // we have an array to format
     if (is_array($text)) {
         $text = Skin::build_list($text, '2-columns');
     }
     // job done
     return $text;
 }
Esempio n. 2
0
File: cloud.php Progetto: rair/yacs
// common definitions and initial processing
include_once '../shared/global.php';
include_once 'categories.php';
// load the skin
load_skin('categories');
// the title of the page
$context['page_title'] = i18n::s('The cloud of tags');
// commands for associates
if (Surfer::is_associate()) {
    $context['page_menu'] += array('categories/edit.php' => i18n::s('Add a category'), 'categories/check.php' => i18n::s('Maintenance'));
}
// the list of active categories
$cache_id = 'categories/cloud.php#content';
if (!($text = Cache::get($cache_id))) {
    // query the database and layout that stuff
    if (!($text =& Members::list_categories_by_count_for_anchor(NULL, 0, 200, 'cloud'))) {
        $text = '<p>' . i18n::s('No item has been found.') . '</p>';
    }
    // we have an array to format
    if (is_array($text)) {
        $text =& Skin::build_list($text, '2-columns');
    }
    // make a box
    if ($text) {
        $text =& Skin::build_box('', $text, 'header1', 'categories');
    }
    // cache this to speed subsequent queries
    Cache::put($cache_id, $text, 'categories');
}
$context['text'] .= $text;
// display extra information