tb_categories . " WHERE parent = $parent"; $result = mysql_query($sql) or trigger_error(mysql_error() . "

$sql

"); if($result) { while ($data = mysql_fetch_array($result)) { if(empty($data['preview_image'])) { $data['preview_image'] = $cfg->csearch_categorie_thumb; } array_push($this->data_arr, $data); } } //Sortiere Kategorien arr_sort($this->data_arr, array("+name")); } function list_categories() { global $cfg, $template; preg_match("'.+'is", $template, $preg); $tablecol = $preg[0]; preg_match("'.+'is", $template, $preg); $tablerow = $preg[0]; $tabledata = array(); $tableoutput = array(); $this->get_data(); $col = 1; foreach ($this->data_arr as $key => $val) { $data = (object)$this->data_arr[$key]; $tmp = $tablecol; $tmp = str_replace("%categorie%", $data->id, $tmp); $tmp = str_replace("%preview_image%", $data->preview_image, $tmp); $tmp = str_replace("%categorie_name%", $data->name, $tmp); array_push($tabledata, $tmp); if(++$col >= $cfg->csearch_cols) { //Setze Cols zusammen $tabledata = join("", $tabledata); array_push($tableoutput, str_replace($tablecol, $tabledata, $tablerow)); $tabledata = array(); $col = 1; } } //Setze restliche Cols zusammen $tabledata = join("", $tabledata); array_push($tableoutput, str_replace($tablecol, $tabledata, $tablerow)); //Rows in TPL einfügen $tableoutput = join("", $tableoutput); $template = str_replace($tablerow, $tableoutput, $template); } } $categories = new categories; $categories->list_categories(); #################################### Template Ausgabe ############################## $categories = print_categories(read_categories($start_categorie), 0); $template = str_replace("%categories%", $categories, $template); $template = str_replace("%categorie_path%", categorie_path($start_categorie), $template); include("output.inc.php"); ?>