예제 #1
0
 function &instance($section_id)
 {
     static $lookup = false;
     if (!$lookup) {
         $lookup = new AMPContentLookup_LinksBySection($section_id);
     } else {
         $lookup->_addCriteriaSection($section_id);
         $lookup->init();
     }
     return $lookup->dataset;
 }
예제 #2
0
파일: Link.php 프로젝트: radicalsuz/amp
 function makeCriteriaSection($value)
 {
     if (!is_numeric($value)) {
         return false;
     }
     $related_links =& AMPContentLookup_LinksBySection::instance($value);
     $simple_crit = 'type=' . $value;
     if (!$related_links) {
         return $simple_crit;
     }
     return '( ' . $simple_crit . ' OR id in( ' . join(',', array_keys($related_links)) . '))';
 }