Example #1
0
 function catparents($current, $categoryList)
 {
     $this->breadcrumb[] = models\categories::format($current);
     if ($current['parentID']) {
         $this->catparents($categoryList["ID-" . $current['parentID']], $categoryList);
     }
 }
Example #2
0
 function data()
 {
     $domain = $this->f3->get("domain");
     $result = array();
     $ID = isset($_REQUEST['ID']) ? $_REQUEST['ID'] : "";
     $details = new models\categories();
     $details = $details->get($ID);
     $result['details'] = $details;
     $where = "";
     $records = models\categories::getInstance()->getAll($where, "category ASC");
     $result['records'] = models\categories::format($records, true);
     return $GLOBALS["output"]['data'] = $result;
 }
Example #3
0
 function page()
 {
     $user = $this->f3->get("user");
     $ID = $this->f3->get("PARAMS['ID']");
     $highlight = isset($_REQUEST['highlight']) ? $_REQUEST['highlight'] : false;
     $details = models\items::getInstance()->get($ID);
     $details = models\items::format($details, $highlight);
     $categories = models\categories::format(models\categories::getInstance()->getAll("dir_items.ID='{$details['ID']}'", "category ASC"), false, $highlight);
     $title = $details['name'];
     //	test_array($category);
     //	test_array(array("breadcrumbs"=>$this->breadcrumb,"categories"=>$c));
     $tmpl = new \template("template.twig");
     $tmpl->page = array("section" => "details", "sub_section" => "item-" . $details['ID'], "template" => "item_details", "meta" => array("title" => "Directory | {$this->f3->scrub($title)}"), "css" => "", "js" => "http://maps.google.com/maps/api/js");
     $tmpl->details = $details;
     $tmpl->categories = $categories;
     $tmpl->output();
 }
Example #4
0
 function page()
 {
     $user = $this->f3->get("user");
     $letter = $this->f3->get("PARAMS['letter']");
     //$category = models\categories::getInstance()->get($catID);
     $where = "name LIKE '{$letter}%'";
     $where_cat = "category LIKE '{$letter}%'";
     if ($letter == "other") {
         $where = 'ucase(mid(name, 1, 1)) not between "A" and "Z"';
         $where_cat = 'ucase(mid(category, 1, 1)) not between "A" and "Z"';
     }
     $items = array("suggested" => models\items::format(models\items::getInstance()->getAll("{$where} AND recommended='1'", "name ASC")), "other" => models\items::format(models\items::getInstance()->getAll("{$where} AND recommended='0'", "name ASC")));
     $categories = models\categories::format(models\categories::getInstance()->getAll("{$where_cat}", "category ASC"));
     //test_array($items);
     $tmpl = new \template("template.twig");
     $tmpl->page = array("section" => "alphabet", "sub_section" => "{$letter}", "template" => "list_alphabet", "meta" => array("title" => "Directory | starts with '{$letter}'"), "css" => "", "js" => "");
     $tmpl->items = $items;
     $tmpl->categories = $categories;
     $tmpl->letter = $letter;
     $tmpl->output();
 }
Example #5
0
 function page()
 {
     $user = $this->f3->get("user");
     $search = isset($_REQUEST['search-box']) ? $_REQUEST['search-box'] : "";
     $columns = $this->f3->get("DB")->exec("EXPLAIN dir_items;");
     $str = array();
     foreach ($columns as $item) {
         $str[] = "dir_items.{$item['Field']} LIKE '%{$search}%'";
     }
     $str = implode(" OR ", $str);
     //test_array(array($str,$columns));
     $where = "({$str}) ";
     $where_cat = "(dir_categories.category LIKE '%{$search}%' OR dir_categories.text  LIKE '%{$search}%') ";
     $items = array("suggested" => models\items::format(models\items::getInstance()->getAll("{$where} AND recommended='1'", "name ASC"), $search), "other" => models\items::format(models\items::getInstance()->getAll("{$where} AND recommended='0'", "name ASC"), $search));
     $categories = models\categories::format(models\categories::getInstance()->getAll("{$where_cat}", "category ASC"), false, $search);
     //test_array($search);
     $tmpl = new \template("template.twig");
     $tmpl->page = array("section" => "search", "sub_section" => "search", "template" => "search", "meta" => array("title" => "Directory | Search '{$search}'"), "css" => "", "js" => "");
     $tmpl->items = $items;
     $tmpl->categories = $categories;
     $tmpl->search = $search;
     $tmpl->output();
 }