$lSearchEngineArray=array("Google", "Fast", "Slurp", "Ink", "Atomz", "Scooter", "Crawler", "MSNbot", "Poodle", "Genius");
$lIsSearchE=0;
foreach($lSearchEngineArray as $key => $val)
if(strstr($_SERVER['HTTP_USER_AGENT'], $val))
$lIsSearchE++;
if($lIsSearchE==0)
session_start();
require("admin/inc.php");
$catname = "";
$catid = getParamInt("catid","");
if ($catid) {
$sql="select cat_name,cat_tpl";
if (!empty($_SESSION["la"]) AND $set_multilang_cat)
{
$lang_cat = "lang_" . $_SESSION["la"];
$sql.=",$lang_cat";
}
$sql.=" from $cat_tbl where cat_id = $catid";
$row=mysql_fetch_array(q($sql));
$catname = $row["cat_name"];
if (!empty($row["$lang_cat"]))
$catname=$row["$lang_cat"];
if (!empty($row["cat_tpl"]))
$cat_tpl=$row["cat_tpl"];
$pagename= $sitename . " - " . $catname;
}
else
$fp = 1;
require("header_inc.php");
$tplIndex=new TplLoad;
$tplIndex->assign("catname",$catname);
$val_string = "";
// Security check
if (file_exists("install.php"))
{
print "
SECURITY WARNING
You have not followed our instructions to delete install.php
immediately after install. Leaving this file here is a major security problem and opens your site up
to wild hacking.";
}
// If we are on the frontpage, write out welcome message along with flags
$tplIndex->assign("index_catid",$catid);
$tplIndex->assign("banner",$lBanner);
$tplIndex->assign("isFrontpage","$fp");
if ($fp && !$set_latest_fp)
$tplIndex->assign("HideLastListFp","1");
$tplIndex->assign("index_nameofsite",$name_of_site);
$tplIndex->assign("index_welcome",formatString(WELCOME_MESSAGE, array("$name_of_site")));
$tplIndex->assign("index_welcome_1",formatString(LA_WELCOME_1, array("$name_of_site")));
$tplIndex->assign("index_welcome_2",formatString(LA_WELCOME_2, array("$name_of_site")));
$tplIndex->assign("index_welcome_91",formatString(LA_WELCOME_LOGGED_1, array($_SESSION['user_name'])));
$tplIndex->assign("index_welcome_92",formatString(LA_WELCOME_LOGGED_2, array($_SESSION['user_name'])));
$tplIndex->assign("member",$_SESSION["valid_user"]);
if ($set_special)
{
$limit=$set_premium_limit;
$sql_str = "select ad_title, ad_id from $ads_tbl where ad_is_premium=1 ";
if ($catid AND $set_special_categories)
$sql_str.=" AND ad_cat_id=$catid";
if ($set_special_only_frontpage AND $catid)
$sql_str.=" AND 2<1";
$sql_str.=" $val_string order by ad_id desc limit $limit";
$res_sp = q($sql_str);
$sp_i=0;
while ($row_sp=mysql_fetch_array($res_sp))
{
$s_title = $row_sp["ad_title"];
$s_id = $row_sp["ad_id"];
$lSpecialAds[$sp_i]["s_title"]=dotString($s_title,$set_special_string_length);
$lSpecialAds[$sp_i]["s_id"]=$s_id;
$sp_i++;
}
$tplIndex->assign("special_list",$lSpecialAds);
if ($sp_i==0)
$tplIndex->assign("size","100");
else
$tplIndex->assign("size","70");
}
else
{
$tplIndex->assign("size","100");
}
$tplIndex->display("index.tpl");
include_once("footer_inc.php");
?>