parse_all();if(!isset($all_url_vars['action'])) $all_url_vars['action']="form";if(!isset($all_url_vars['nrofrows'])) $all_url_vars['nrofrows'] = 1;else $all_url_vars['nrofrows'] = (int) $all_url_vars['nrofrows'];if(!isset($all_url_vars['from'])) $all_url_vars['from']=0;else $all_url_vars['from']=(int)$all_url_vars['from'];if(!isset($all_url_vars['idgallery'])) $all_url_vars['idgallery'] = firstGallery();else $all_url_vars['idgallery']=(int) $all_url_vars['idgallery']; $ft = new FastTemplate(INDEX_PATH); $ft->define(array("main"=>"programtemplates/template_gallery.html","content"=>"gallery/programtemplates/category.html")); $ft->assign("GALLERY_INDEX_URL",GALLERY_INDEX_URL); $ft->assign("TITLE_TAG",LANG_TITLETAG_GALLERY); $SQL = "SELECT idcategory,name,image FROM `".GALLERY_DB_PREFIX."category` WHERE idcategory <> 1 AND parent_category = 1 ORDER BY name ASC"; $retid = mysql_query($SQL) ; if (!$retid) { ( mysql_error()); } $i=0; if ($row = mysql_fetch_array($retid)) do{ $id_category[$i] = $row["idcategory"]; $categoryname[$i] = $row["name"]; $cat_image[$i] = $row["image"]; $i++; }while ($row = mysql_fetch_array($retid)); $nrcateg = $i; if ($nrcateg == 1) { if (NONSEO == 1) { header ("Location: ".GALLERY_INDEX_URL."category.php?name=".$categoryname[0]."&id=".$id_category[0]); exit; } else { header ("Location: ".GALLERY_INDEX_URL."category.php/".$categoryname[0]."/".$id_category[0]."/"); exit; } } if($nrcateg>0) { $ft->assign("CATEGORIES",1); if ($nrcateg % GALLERY_NR_CATEGORYCOLUMNS == 0) $nrofrows = $nrcateg/GALLERY_NR_CATEGORYCOLUMNS; else $nrofrows = (int) ($nrcateg/GALLERY_NR_CATEGORYCOLUMNS)+1; $ft->define_dynamic("category_row","content"); $m = 0; for($i=0;$i<$nrofrows;$i++) { $ft2 = new FastTemplate(GALLERY_TEMPLATE_PATH); $ft2->define(array("main"=>"category_column.html")); $ft2->define_dynamic("category_column","main"); for($j=0;$j$m) { $ft2->assign("CATEG_COLUMN",1); $ft2->assign("NAME_CATEGORY",$categoryname[$m]); if (NONSEO == 1) $ft2->assign("LINK",GALLERY_INDEX_URL."category.php?name=".$categoryname[$m]."&id=".$id_category[$m]); else $ft2->assign("LINK",GALLERY_INDEX_URL."category.php/".$categoryname[$m]."/".$id_category[$m]."/"); if(empty($cat_image[$m])) $ft2->assign("IMAGE_CATEGORY",GALLERY_IMG_CONTENT_URL."spacer.gif"); else $ft2->assign("IMAGE_CATEGORY",GALLERY_CATEGORY_IMAGE_URL."thumbs/".$cat_image[$m]); } else { $ft2->assign("CATEG_COLUMN",0); } $ft2->parse("CATEGORY_COLUMN",".category_column"); $m++; } $ft2->parse("mainContent","main"); $buffer = $ft2->fetch("mainContent"); $ft->assign("category_column.html",$buffer); $ft->parse("CATEGORY_ROW",".category_row"); } } else { $ft->assign("CATEGORIES",0); } $ft->assign("LANG", $NEWLANG); include_once(GALLERY_INCLUDE_PATH."description.inc.php"); $ft->multiple_assign_define("LANG_GALLERY"); $ft->multiple_assign_define("CONF_"); $ft->multiple_assign_define("LANG_"); $ft->parse("BODY", array("content","main")); $ft->FastPrint(); $ft->clear_all();?>