if (!isset($admin_area)) include_once("includes/common_public_inc.php"); else include_once("includes/common_admin_inc.php"); if (!$set_url) { if (file_exists("install.php")) { redirect("install.php"); exit(); } else { "
You must run the installer before you can use this software, but your install.php file is missing
"; } } $lMasterTemplate = new TplLoad(); $lInputValues=array_merge($_POST,$_GET); // Get all input params from URL/post ini_set('error_reporting', E_ALL & ~E_NOTICE); // Try to avoid Notice warnings on Live site $lSetMeasureTime=0; if ($lSetMeasureTime) timeStart(); $lPageInfo=getPage(); $lCurrentCatId=$lPageInfo["current_cat_id"]; $lCurrentAdId=$lPageInfo["current_ad_id"]; $lCurrentPage=$lPageInfo["current_page"]; if (safeIntNumber($_SESSION["valid_user"])){ $lCurrentUserId=round($_SESSION["valid_user"]); $lCurrentUserName=StrToDb($_SESSION["user_name"]); } if ($_SESSION["set_region"]>0) $lSetRegion=round($_SESSION["set_region"]); if ($_REQUEST["unset_region"]){ $lSetRegion=""; $_SESSION["set_region"]=0; } if ($lCurrentCatId>0) $lCurrentPage="category"; if($lCurrentAdId>0) $lCurrentPage="detail"; // Find the unique ID for the current page.. if (empty($lInputValues) && empty($lOverridePage)) $lPageInternalId=1; else { if (!empty($lOverridePage)) $lCurrentPage=$lOverridePage; $lSql="select page_id,page_name,page_key,page_value,page_template,page_caption,page_descr,page_keywords from $page_tbl"; if ($lCurrentPage!="") // We have a Page $lSql.=" where page_key='p' AND page_value='".strToDb($lCurrentPage)."' AND page_active=1"; //echo $lSql; $lSql.=" limit 1"; $lRes=q($lSql); $lRow=mysql_fetch_array($lRes); $lPageInternalId=$lRow["page_id"]; $lPageKey=$lRow["page_key"]; $lPageTemplate=$lRow["page_template"]; $lPageCaption=getStr($lRow["page_caption"]); $lPageDescription=$lRow["page_descr"]; $lPageKeywords=$lRow["page_keywords"]; $lPageValue=getParam($lRow["page_value"],""); //echo $lPageInternalId; if (!$lPageInternalId) { include "blocks/" . "404.php"; $lMasterTemplate->assign("error","$lContentHtml"); } } // We know what page we are on, find out what "blocks" to include... if ($lPageInternalId>0) { if ($lPageInternalId==1) $fp=1; $lSqlInc="select * from $page_inc_tbl where inc_belongto=$lPageInternalId"; $lResInc=q($lSqlInc); while ($lRowInc=mysql_fetch_array($lResInc)) { $lTag=$lRowInc["inc_tag"]; $lFile=$lRowInc["inc_file"] . ".php"; require "blocks/" . $lFile; $lMasterTemplate->assign("$lTag","$lContentHtml"); $lContentHtml=""; } } if (!empty($set_stat)) { // Log every visit if ($lCurrentPage=="") $lCurrentPageLog="frontpage"; else $lCurrentPageLog=$lCurrentPage; gatherStats($lCurrentPageLog); } $lWelcome=formatString(LA_WELCOME_1, array("$set_sitename")); $lCurrUrl=getInputVariablesString(); $lMasterTemplate->assign("isFrontpage",$fp); $lMasterTemplate->assign("set_sitename","$set_sitename"); $lMasterTemplate->assign("member",$lCurrentUserId); $lMasterTemplate->assign("index_welcome",formatString(WELCOME_MESSAGE, array("$set_sitename"))); $lMasterTemplate->assign("index_welcome_1",$lWelcome); $lMasterTemplate->assign("index_welcome_2",formatString(LA_WELCOME_2, array(getPageLink('login'),getPageLink('register')))); $lMasterTemplate->assign("index_welcome_91",formatString(LA_WELCOME_LOGGED_1, array($_SESSION['user_name']))); $lMasterTemplate->assign("index_welcome_92",formatString(LA_WELCOME_LOGGED_2, array(getPageLink('member')))); $lMasterTemplate->assign("current",$lCurrUrl); $lMasterTemplate->assign("current_page",$lCurrentPage); if ($lSetRegion>0){ $lRegionName=getRegionName($lSetRegion); $lRegionUrl=getPageLink("region"); $lMasterTemplate->assign("region_name",$lRegionName); $lMasterTemplate->assign("region_url",$lRegionUrl); $lMasterTemplate->assign("region_reset_url",getPageLink('frontpage',array('unset_region'=>'1'))); } $lUrl="http://$set_url/" ; if ($html_editor && $lCurrentUserId>0) $lMasterTemplate->assign("html_editor",$set_wysiwyg_editor); $lMasterTemplate->assign("url",$set_url); // Assign URL to the template $lMasterTemplate->assign('print', getParam("print","")); $lMasterTemplate->assign("refereer",$_SERVER['HTTP_REFERER']); $lMasterTemplate->assign('seo_url_register', getPageLink('register')); $lMasterTemplate->assign('seo_url_choose_cat', getPageLink('choose_cat')); $lMasterTemplate->assign('seo_url_log_in', getPageLink('login')); $lMasterTemplate->assign('seo_url_log_out', getPageLink('login', array('logout'=> 1))); $lMasterTemplate->assign('seo_url_latestwap', getPageLink('latestwap')); $lMasterTemplate->assign('seo_url_member', getPageLink('member')); $lMasterTemplate->assign('seo_url_browse', getPageLink('browse')); $lMasterTemplate->assign('seo_url_latest', getPageLink('latest')); $lMasterTemplate->assign('seo_url_frontpage', getPageLink('frontpage')); $lMasterTemplate->assign('seo_url_mostpop', getPageLink('mostpop')); $lMasterTemplate->assign('seo_url_bestrated', getPageLink('bestrated')); $lMasterTemplate->assign('seo_url_myfav', getPageLink('myfav')); $lMasterTemplate->assign('seo_url_search', getPageLink('search')); $lMasterTemplate->assign('seo_url_changelang', getPageLink('frontpage', array('setlang'=>''))); $lMasterTemplate->assign('seo_url_search_footer', getPageLink('search')); $lMasterTemplate->assign('seo_url_info_help', getPageLink('help')); $lMasterTemplate->assign('seo_url_info_aboutus', getPageLink('aboutus')); $lMasterTemplate->assign('seo_url_info_terms', getPageLink('terms')); $lMasterTemplate->assign('seo_url_info_advertise', getPageLink('advertise')); $lMasterTemplate->assign('seo_url_region', getPageLink('region')); $lMasterTemplate->assign('seo_active', $set_rewrite); $lMasterTemplate->assign('set_region', $set_region); if ($lCurrentPage=="detail") $lMasterTemplate->assign('googlemap', $set_googlemap_code); if ($lCurrentCatId) $lMasterTemplate->assign('seo_url_rss', getPageLink('rss',array("cat"=>$lCurrentCatId))); else $lMasterTemplate->assign('seo_url_rss', getPageLink('rss',array("type"=>$lCurrentPage))); include "blocks/ad_get.php"; $lMasterTemplate->assign('banner_section1', $lBanner); if ($set_dropdown_style==2) $string=getCategoriesDD($lCurrentCatId,0); else $string=getCategoriesDDSimple($lCurrentCatId,0); $lMasterTemplate->assign("dropdown_catlist",$string); // Assign URL to the template if (isset($lUseAjax)) // If Ajax enabled for this page include "includes/ajaxfunctions.php"; $lMasterTemplate->assign("linked_path",writeLinkedTitle($lCurrentCatId,$lCurrentAdId,$lPageCaption,$lCurrUrl)); if (!$lPageTemplate){ $lPageTemplate="masterpage"; // If non-spesific page $lPageCaption=LA_FRONTPAGE; } if (!$lPageDescription){ if ($fp) $lPageDescription=$lWelcome; elseif ($lCurrentCatId>0) { $lPageDescription="$lLastCatName ($lCurrentCatId)"; $lPageCaption.=" - $lLastCatName"; } elseif ($lCurrentAdId>0) $lPageDescription="$lCatName: $lDescriptionDetail"; else $lPageDescription=$lPageCaption; } $lMasterTemplate->assign('page_description', $lPageDescription); $lMasterTemplate->assign('page_keywords', $lPageKeywords); $lMasterTemplate->assign("page_caption",$lPageCaption); q("update $oth_tbl set oth_num_tot_hit=oth_num_tot_hit+1 where oth_id=1"); // Historic counter $lResOth=q("select * from $oth_tbl where oth_id=1"); $lRow=mysql_fetch_array($lResOth); $lMasterTemplate->assign("footer_statistics",formatString(LA_S_BAR, array($lRow["oth_num_cur_user"],$lRow["oth_num_cur_ad"],$lRow["oth_num_tot_ad_view"],$lRow["oth_num_tot_ad"]))); if (isset($admin_area)) $lPageTemplate="adm_plain"; $lMasterTemplate->display($lPageTemplate . ".tpl"); // Display if ($lSetMeasureTime) timeStop(); ?>