function getLinks($source = null) { if (!isset($source)) { require_once 'AMP/Content/Link/Link.php'; $source = new AMP_Content_Link(AMP_Registry::getDbcon()); } $source_set = $source->search($source->makeCriteria(array('linkType' => $this->id))); }
<?php $modid = AMP_MODULE_ID_LINKS; $intro_id = AMP_CONTENT_PUBLICPAGE_ID_LINKS_DISPLAY; if (isset($_GET["name"]) && $_GET['name']) { $name_link = $_GET["name"]; ampredirect("links.php#{$name_link}"); } require_once "AMP/BaseTemplate.php"; require_once "AMP/BaseModuleIntro.php"; require_once 'AMP/Content/Link/Link.php'; require_once 'AMP/Content/Link/Type/Type.php'; require_once 'AMP/Display/Template.php'; $link_source = new AMP_Content_Link(AMP_Registry::getDbcon()); $link_source->addCriteriaGlobal($link_source->makeCriteria(array('live' => true))); $link_type_source =& new Link_Type($dbcon); $requested_section = isset($_GET['linktype']) && $_GET['linktype'] ? $_GET['linktype'] : false; $content_map = AMPContent_Lookup::instance('sectionMap'); $link_types = $link_type_source->search($link_type_source->makeCriteria(array('live' => true))); $display_types = false; if ($requested_section) { if (!isset($content_map[$requested_section])) { AMP_make_404(); } else { $link_source->addCriteriaGlobal($link_source->makeCriteria(array('section' => $requested_section))); $renderer =& new AMP_Display_Template('AMP/Content/Display/heading.inc.thtml'); $section_names =& AMPContent_Lookup::instance("sections"); $renderer->set_property('heading', $section_names[$requested_section]); print $renderer->execute(); } }