function amp_badge_tag_cloud($options = array()) { $qty_set = isset($options['qty_set']) && $options['qty_set'] ? $options['qty_set'] : false; if (!$qty_set && !isset($options['section'])) { $qty_set = AMP_lookup('tag_totals_articles_by_section_live', AMP_current_section_id()); } if (!$qty_set && !$options['section']) { $qty_set = AMP_lookup('tag_totals_articles_live'); } if (!$qty_set && $options['section']) { $qty_set = AMP_lookup('tag_totals_articles_by_section_live', $options['section']); } if (!$qty_set) { return false; } $display_url = isset($options['display_url']) && $options['display_url'] ? $options['display_url'] : false; $source_item = new AMP_Content_Tag(AMP_Registry::getDbcon()); $source = $source_item->find(array('displayable' => 1)); if (!$source) { return false; } $display = new AMP_Display_Cloud($source, $qty_set); if ($display_url) { $display->set_url_method($display_url); } $renderer = AMP_get_renderer(); return $renderer->div($display->execute(), array('class' => 'tagcloud_badge')); }
function __construct($options = array()) { $this->display_sections = isset($options['display_sections']) && $options['display_sections'] ? $options['display_sections'] : false; $this->display_articles = isset($options['display_articles']) && $options['display_articles'] ? $options['display_articles'] : false; $this->current_id = AMP_current_section_id(); $page = AMPContent_Page::instance(); if ($current_article = $page->getArticle()) { $this->current_article_id = $current_article->id; } $this->map =& AMPContent_Map::instance(); }
<?php //$dbcon = AMP_Registry::getDbcon(); //$type = AMP_current_section_id(); $type = AMP_current_section_id(); $get_parent = $dbcon->Execute("Select parent from articletype where id = {$type} limit 1"); $parent = $get_parent->Fields('parent'); if (isset($type)) { $feed = $dbcon->Execute("Select type as typename, id from articletype where parent = {$type} and id != 1 and usenav = 1 order by textorder asc"); $has_child = 0; $html = ''; $html .= '<table cellspacing="0" cellpadding="0"><tr> <td class="sidelist"> <ul>'; while (!$feed->EOF) { $id = $feed->Fields('id'); $title = $feed->Fields('typename'); $has_child = 1; $html .= '<li> <a class="sidelist_title" href="article.php?list=type&type=' . $id . '">' . $title . '</a> <div class="sidelist_spacer"></div> </li>'; $feed->MoveNext(); } if (!$has_child && !($parent == 1)) { $feed = $dbcon->Execute("Select type as typename, id from articletype where parent = {$parent} and articletype.id != 1 and usenav=1 order by textorder asc"); $html = ''; $html .= '<table cellspacing="0" cellpadding="0"><tr> <td class="sidelist"> <ul>'; while (!$feed->EOF) {
function &_current_section() { $page = AMPContent_Page::instance(); $current_section = $page->getSection(); if ($current_section) { return $current_section; } if (!$current_section && ($current_section_id = AMP_current_section_id())) { require_once 'AMP/Content/Section.inc.php'; $section = new Section(AMP_Registry::getDbcon(), $current_section_id); return $section; } $false = false; return $false; }
function Tiered_Sectional_Nav() { $this->current_id = AMP_current_section_id(); $this->map =& AMPContent_Map::instance(); }