/** * Get tags for the blog/headlines handler in the * Dynamic Objects dialog. */ function blog_get_tags() { $out = array((object) array('key' => '', 'value' => __('- select -'))); $tags = blog\Post::tags(); foreach ($tags as $tag => $count) { $out[] = (object) array('key' => $tag, 'value' => $tag . ' (' . $count . ')'); } return $out; }
<?php /** * Renders a tag cloud, with more frequently used tags appearing larger. */ if (!$this->internal) { $page->layout = $appconf['Blog']['layout']; $page->title = i18n_get('Tags'); } $pg->limit = 10; $pg->tags = blog\Post::tags(); foreach ($pg->tags as $k => $v) { $pg->tags[$k] = $v / 10 < 2 ? $v / 10 + 0.9 : ($v / 10 >= 2 ? 3 : $v / 10); } echo $tpl->render('blog/tags', $pg); $page->add_script(sprintf('<link rel="alternate" type="application/rss+xml" href="http://%s/blog/rss" />', $_SERVER['HTTP_HOST']));