getCurrentSection($a,$b,$c,$d);//echo "@#C a $a b $b c $c d $d"; // Create $sluglanguage to augment language content slugs $sluglanguage = $AZ->Preferences->SlugLanguageSuffix(); $SNSLanguageCode = (array_key_exists($AZ->Preferences->UserLanguage,$AZ->LanguageReference))?$AZ->LanguageReference[$AZ->Preferences->UserLanguage][2]:$AZ->Preferences->UserLanguage; $LanguageCodes = array("az"=>$AZ->Preferences->UserLanguage, "html"=>(array_key_exists($AZ->Preferences->UserLanguage,$AZ->LanguageReference["html"]))?$AZ->LanguageReference["html"][$AZ->Preferences->UserLanguage]:$AZ->Preferences->UserLanguage, "gplus"=>(array_key_exists($AZ->Preferences->UserLanguage,$AZ->LanguageReference["gplus"]))?$AZ->LanguageReference["gplus"][$AZ->Preferences->UserLanguage]:$AZ->Preferences->UserLanguage, "facebook"=>(array_key_exists($AZ->Preferences->UserLanguage,$AZ->LanguageReference["facebook"]))?$AZ->LanguageReference["facebook"][$AZ->Preferences->UserLanguage]:$AZ->Preferences->UserLanguage, "twitter"=>(array_key_exists($AZ->Preferences->UserLanguage,$AZ->LanguageReference["twitter"]))?$AZ->LanguageReference["twitter"][$AZ->Preferences->UserLanguage]:$AZ->Preferences->UserLanguage); // Create Temporay (non-persistent) content cache $cache = array(); // If wordpress has provided content for us but it is different from expected if(!empty($post)&&$post->post_name!=$section->Slug){ $cache["wp_post"] = $post; $post = null; }//echo "

POST@11

"; print_r($post); echo "
"; if(empty($post)) $post = $AZ->lookupPost($section->Slug,true);//echo "

POST-@12

"; print_r($post); echo "
"; if(empty($post)) $post = $AZ->lookupPost("home",true);//echo "

POST-@13

"; print_r($post); echo "
"; // LANGUAGE CONTENT SUPPORT // Cache the main language (typically English) if enabled in settings if($setting["CacheMainLanguagePost"]){ $cache["mainLanguage_post"] = $post; } // Localize the post content for WPML if($setting["UseLanguages"]&&$setting["UseLanguagesWPML"]){ $post = $AZ->localizePost($post); } //Base Section and Post; lookup and cache the post if enabled in settings $cache["base_section"] = $section->SectionAtLevel(1); if($setting["CacheBasePost"]){ $cache["base_post"] = $AZ->lookupPost($cache["base_section"]->Slug); } //Convenience Functions function content($id=0,$filter=true){ global $post; $_post = ($id>0)?$post = get_post($ID):$post; if(!$filter) return $_post->post_content; return apply_filters('the_content',$_post->post_content); } function postContent(&$item){ //wp_reset_query(); return apply_filters('the_content',$item->post_content); } function excerpt($id=0,$filter=false){ global $post; $_post = ($id>0)?$post = get_post($ID):$post; if(!$filter) return $_post->post_excerpt; return apply_filters('the_content',$_post->post_excerpt); } function postExcerpt(&$item){ return apply_filters('the_content',$item->post_excerpt); } function title($id=0){ global $post; $_post = ($id>0)?$_post = get_post($ID):$post; return $_post->post_title; } function postTitle(&$item){ return $item->post_title; } function publishDate($format = null,$id = 0){ global $post,$AZ; $_post = ($id>0)?$post = get_post($ID):$post; if(empty($format))$format = $AZ->__("dataformat"); if(empty($format))$format = 'YmdGi'; return mysql2date($format, $_post->post_date); } function postPublishDate(&$item,$format = null){ //if(empty($format))$format = $AZ->__("dataformat"); if(empty($format))$format = 'YmdGi'; return mysql2date($format, $item->post_date); } include_once("Class.Article.php"); /* *********************************** * **** Mobile Response **** * *********************************** */ // Test if Mobile is requested by Browser/Device Agent $MobileAgent = (stripos($_SERVER["HTTP_USER_AGENT"],"mobile")!==false); if($_REQUEST["ForceMobileAgent"]==1)$MobileAgent = true; //If Explicit ForceDesktopAgent then set as preference in cookie if($_REQUEST["ForceDesktopAgent"]==1){ $ForceDesktopAgent = true; setcookie("ForceDesktopAgent",1,10368000); }else{ // if not explicit, refer to cookie $ForceDesktopAgent =($_COOKIE["ForceDesktopAgent"]==1); } //Check to see if terms acceptance was submitted if($AZ->__c($_POST["acceptTermsConfirmed"])==acceptTermsConfirmed){ $_SESSION["terms-accepted"] = 1; setcookie("terms-accepted",1,time()+(86400*60),"/"); } ?>