=NOW() OR user_up_expire>=NOW()) "; $val_string .= " AND (ad_start_date='0000-00-00' or (DATE_FORMAT(ad_start_date,'%Y-%m-%d')>=DATE_FORMAT(NOW(),'%Y-%m-%d'))) "; $option_list=getCategoriesDD(getParamInt("catid",""),2); $tplPbrowse->assign("option_list", $option_list); $number_of_ads_per_page = $set_num_browse; $query = "select * from $pic_tbl,$ads_tbl,$usr_tbl where $pic_tbl.pic_ad_id = $ads_tbl.ad_id and ad_owner=user_id AND main=1 $val_string"; $lAddOnQuery=""; if (getParam("catid","")) { $ltmpChilds=getCategoryChildren(getParamInt("catid","")); if ($ltmpChilds) $lAddOnQuery.=" AND ad_cat_id IN (". $ltmpChilds . ",". getParamInt("catid",0) .")"; else $lAddOnQuery.=" AND ad_cat_id=". getParamInt("catid",0); } $query.=$lAddOnQuery; $result = q($query); $num_links = mysql_num_rows($result); $lNavigation=urlBar($num_links,$number_of_ads_per_page,getParamInt("page",1),getAllParams(array("page"))); $query = "select * from $pic_tbl,$ads_tbl,$usr_tbl where $pic_tbl.pic_ad_id = $ads_tbl.ad_id and ad_owner=user_id AND main=1 $val_string"; $query.=" $lAddOnQuery order by pic_ad_id desc " . $lNavigation["sql_limit"]; $result = q ($query); $this_screen = mysql_num_rows($result); $tplPbrowse->assign("this_screen",$this_screen); $break_counter=0; while ($row = mysql_fetch_array($result)) { $break_counter++; $ad_id = $row["pic_ad_id"]; $id = $row["pic_ad_id"]; $sitetitle = $row["ad_title"]; $filename = $row["filename"]; $filename=ereg_replace("tmb2","tmb1",$filename); if ($set_image_program==0) { $lSizeArray=setImageSize($filename,getManualSize("small"),0); $lImageList[$i]["w"]=$lSizeArray[0]; $lImageList[$i]["h"]=$lSizeArray[1]; } $lImageList[$i]["fancy_opentable"]=cornerTableLayout(150,100,1); $lImageList[$i]["filename"]=$filename; $lImageList[$i]["alt"]=htmlspecialchars($sitetitle,ENT_QUOTES); $lImageList[$i]["id"]=$id; $lImageList[$i]["fancy_closetable"]=cornerTableLayout(150,100,2); $lImageList[$i]["link"]=linkDetail($id); $lImageList[$i]["break"]=$break_counter; if ($break_counter==4) $break_counter=0; $i++; } $tplPbrowse->assign("set_gallery_catlist","$set_gallery_catlist"); $tplPbrowse->assign("set_image_program","$set_image_program"); $tplPbrowse->assign("image_list",$lImageList); $tplPbrowse->assign("url_bar",$lNavigation["url_bar"]); $tplPbrowse->display("picturebrowse.tpl"); function cornerTableLayout($aTableW,$aTableH,$aSection) { if ($aSection==1) { $retStr.=""; $retStr.= ""; $retStr.= ""; $retStr.= ""; $retStr.= ""; $retStr.= ""; $retStr.= ""; $retStr.= ""; $retStr.= "
"; return $retStr; } if ($aSection==2) { $retStr.= "
"; return $retStr; } } include_once("footer_inc.php"); ?>