redirects($_GET['label']); $is_mobile = $detect->is_mobile; //}else{ //include("./inc/mobile_device_detect.php"); //if(mobile_device_detect() && $_SERVER['HTTP_REFERER']!="http://m.centauria.com/"){ //header('Location: http://m.centauria.com/');exit; //} //} $contentTpl = ""; $aPageData = array(); //print $centauriaEmail2;exit; function deliver_data($sql, $field = "value"){ global $rs, $cn; $rs->open( $sql ); return unhtmlentities($rs->row[$field]); } function seo4Valid($string){ $string = trim(strip_tags(html_entity_decode($string))); $string = str_replace(" & ", " & ", $string); return $string; } //dump($_GET); $pageRegularText['ourSpecText'] = deliver_data("select * from pages where `label`='inc_our_specialties'"); $pageRegularText['incFooterText'] = deliver_data("select * from pages where `label`='inc_footer'"); $pageRegularText['signInText'] = ($_SESSION['is_authorized']==1) ? "My Account" : "Client Sign-In" ; $sql = "select * ". "from testimonials". " where `featured`=1"; $rs->open( $sql ); if(!$rs->eof){ while($rs->row){ $editedValue = strip_tags(unhtmlentities($rs->row['value'])); $pos1 = stripos($editedValue, $option_array[2]['value']); if($pos1) $editedValue = substr_replace($editedValue, "", $pos1); $aFeaturedTestimonials[] = array( "url" => unhtmlentities($rs->row['url']), "organization" => unhtmlentities($rs->row['organization']), "name" => unhtmlentities($rs->row['Name']), "value" => $editedValue, "featured_page" => $rs->row['featured_page'] ); $rs->movenext(); } } $aFeaturedTestimonials2 = array(); foreach($aFeaturedTestimonials as $val){ if($val['featured_page'] == $label){ $aFeaturedTestimonials2[] = $val; } } if(count($aFeaturedTestimonials2) > 0){ $aFeaturedTestimonials = $aFeaturedTestimonials2; } if($label == "index" || $label == ""){ //Pulling in data for homepage $contentTpl = "index.html"; $sql = "select * from pages where `label`='homepage' limit 0,1"; $rs->open( $sql ); $aPageRow = $rs->row; $title = seo4Valid($aPageRow["title"]); $keywords = seo4Valid($aPageRow["keywords"]); $description = seo4Valid($aPageRow["description"]); $contentTplText = unhtmlentities($aPageRow["value"]); $tpl->assign('contentTplText', $contentTplText); //Taking data about Featured Portfolio $tpl->assign('featuredPortfolioImgUrl', deliver_data("select nameS from portfolio as pf left join portfolio_images as pfi on pf.id=pfi.id_parent where pf.isFeatured=1 limit 0,1", "nameS")); //Pulling in slides data $sql = "select value from pages where `label`='homepage_slide_1' or `label`='homepage_slide_2' or `label`='homepage_slide_3' limit 0,3"; $rs->open( $sql ); if(!$rs->eof){ while($rs->row){ $aSlidesData[] = unhtmlentities($rs->row["value"]); $rs->movenext(); } } $tpl->assign('aSlidesData', $aSlidesData); }else{ //Pulling In data for Any other page $sql = "select * ". "from pages". " where `label`='".$label."'". " limit 0,1"; $rs->open( $sql ); $aPageRow = $rs->row; $contentTpl = "generic.html"; if($aPageRow){ $contentTplText = unhtmlentities($aPageRow["value"]); $breaker = $option_array[2]['value']; $splittedText = split($breaker, $contentTplText); $tpl->assign('contentTplText', $splittedText[0]); $tpl->assign('pageCount', count($splittedText)); $tpl->assign('isScroll', $aPageRow["scroll"]); $title = seo4Valid($aPageRow["title"]); $keywords = seo4Valid($aPageRow["keywords"]); $description = seo4Valid($aPageRow["description"]); } if($aListPages[$label]){ $contentTpl = $aListPages[$label]['template']; }elseif(!$aPageRow){ $contentTpl = "404.html"; } if($aListPages[$label]['script']){ if(!isset($_SESSION['client_id']) && $aListPages[$label]['protected']){ header("Location: login.html"); } //Have a specified script to this template include("./section/".$aListPages[$label]['script']); } } $mailText = rawurlencode("Your friend thought you might like this:\n\n".WEB_URL."\n\nPlease copy this link into your browser window if it does not work correctly when you click on it."); //Footer data $pageRegularText['seo'] = array( "title" => $title, "keyword" => $keywords, "description" => $description ); $tpl->assign('mailText', $mailText); $tpl->assign('pageRegularText', $pageRegularText); $tpl->assign('featuredTestimonial', $aFeaturedTestimonials[rand(0,count($aFeaturedTestimonials)-1)]); $tpl->assign('label', $label); $tpl->assign('pageHref', $label.".html"); $tpl->assign('contentTpl', $contentTpl); $tpl->assign('is_mobile', $is_mobile); //dump($contentTpl); $tpl->display($contentTpl); if (IS_WEBMASTER) { $time_end = microtime_float();$time = $time_end - $time_start; echo "$time seconds
\n"; //print "
DEBUG:";print_r($db->debug_quries);print "
"; print_r($_GET); } ?>