getDocument(); $toheader = ""; $header = array(); $tofoot = ""; $foot = array(); $select_global_vars = $database->query("SELECT * FROM ".BDD_PREFIXE."global_params WHERE name = 'website'"); if(mysql_num_rows($select_global_vars)!=0) { $params_global_vars = mysql_fetch_array($select_global_vars); $params = @unserialize($params_global_vars["params"]); if(is_array($params)) { $template->header["title"][0] = @html_entity_decode(stripslashes($params["intitule"])); $params["description"] = str_replace(array("\n","\r"),"",stripslashes($params["description"])); $template->header["other"]["canonical"] = ''; $template->header["other"]["rss"] = ''; $template->header["other"]["sitemap"] = ''; $template->header["meta"]["description"] = array( "name" => "description" , "content" => @htmlentities(stripslashes($params["description"])) ); $template->header["meta"]["keywords"] = array( "name" => "keywords" , "content" => @htmlentities(stripslashes($params["keywords"])) ); $template->header["og"]["og:latitude"] = array( "name" => "og:latitude" , "content" => @htmlentities($params["og_latitude"]) ); $template->header["og"]["og:longitude"] = array( "name" => "og:longitude" , "content" => @htmlentities($params["og_longitude"]) ); $template->header["og"]["og:street-address"] = array( "name" => "og:street-address" , "content" => @htmlentities($params["og_street-address"]) ); $template->header["og"]["og:locality"] = array( "name" => "og:locality" , "content" => @htmlentities($params["og_locality"]) ); $template->header["og"]["og:region"] = array( "name" => "og:region" , "content" => @htmlentities($params["og_region"]) ); $template->header["og"]["og:postal-code"] = array( "name" => "og:postal-code" , "content" => @htmlentities($params["og_postal-code"]) ); $template->header["og"]["og:country-name"] = array( "name" => "og:country-name" , "content" => @htmlentities($params["og_country-name"]) ); $template->header["og"]["og:email"] = array( "name" => "og:email" , "content" => @htmlentities($params["og_email"]) ); $template->header["og"]["og:phone_number"] = array( "name" => "og:phone_number" , "content" => @htmlentities($params["og_phone_number"]) ); $template->header["og"]["og:fax_number"] = array( "name" => "og:fax_number" , "content" => @htmlentities($params["og_fax_number"]) ); $template->header["og"]["og:type"] = array( "name" => "og:type" , "content" => "website" ); $template->header["og"]["og:site_name"] = array( "name" => "og:site_name" , "content" => @htmlentities(stripslashes($params["sitename"])) ); $template->header["og"]["og:url"] = array( "name" => "og:url" , "content" => 'http://'.$_SERVER['HTTP_HOST'].'/'.$_SERVER['QUERY_STRING'] ); $template->header["og"]["og:locale"] = array( "name" => "og:locale" , "content" => @htmlentities($params["og_locale"]) ); $template->header["og"]["og:title"] = array( "name" => "og:title" , "content" => @htmlentities($params["intitule"]) ); $template->header["og"]["og:description"] = array( "name" => "og:description" , "content" => @htmlentities(stripslashes($params["description"])) ); $template->header["og"]["og:image"] = array( "name" => "og:image" , "content" => @htmlentities($params["og_image"]) ); $template->header["og"]["og:image:width"] = array( "name" => "og:image:width" , "content" => @htmlentities($params["og_image_width"]) ); $template->header["og"]["og:image:height"] = array( "name" => "og:image:height" , "content" => @htmlentities($params["og_image_height"]) ); $template->header["og"]["og:image:type"] = array( "name" => "og:image:type" , "content" => @htmlentities($params["og_image_type"]) ); if($params["fb_admins"]!="") $template->header["og"]["fb:admins"] = array( "name" => "fb:admins" , "content" => @htmlentities($params["fb_admins"]) ); if($params["fb_app_id"]!="") $template->header["og"]["fb:app_id"] = array( "name" => "fb:app_id" , "content" => @htmlentities($params["fb_app_id"]) ); if($params["fb_page_id"]!="") $template->header["og"]["fb:page_id"] = array( "name" => "fb:page_id" , "content" => @htmlentities($params["fb_page_id"]) ); } // INCLUDE MODULES HEADERS $select = $database->query("SELECT * FROM ".BDD_PREFIXE."plugins WHERE actif = 1 AND ( version = 'Module' OR version = 'Application' ) ORDER BY ordre"); while($plugins = mysql_fetch_array($select)) { if(class_exists($plugins["name"])) { eval('$mod = new '.$plugins["name"].'();'); eval('$add_header = (array)$mod->header();'); eval('$add_foot = (array)$mod->foot();'); $header = array_merge_recursive($header, $add_header); $foot = array_merge_recursive($add_foot, $foot); } } foreach ($header as $type=>$valeur) { if(is_array($valeur)) { foreach ($valeur as $value) { if($value!="") { switch($type) { case "title" : $toheader .= ''.$value.''."\n\t"; break; case "meta" : $toheader .= ''."\n\t"; break; case "og" : $toheader .= ''."\n\t"; break; case "other" : $toheader .= $value."\n\t"; break; case "js" : $toheader .= ''."\n\t"; break; case "css" : $toheader .= ''."\n\t"; break; } } } } } foreach ($foot as $type=>$valeur) { if(is_array($valeur)) { foreach ($valeur as $value) { if($value!="") { switch($type) { case "other" : $tofoot .= $value."\n\t"; break; case "js" : $tofoot .= ''."\n\t"; break; case "css" : $tofoot .= ''."\n\t"; break; } } } } } } $nav = ""; // NAVIGATION function list_slide_group($parent=0, $first=0, $level=0) { global $database, $nav; $select_groups = $database->query("SELECT * FROM ".BDD_PREFIXE."slides_group WHERE parent='$parent' AND show_menu = '1' ORDER BY ordre ASC, name ASC"); if($first==0) $id='id="nav"'; else $id=""; if(mysql_num_rows($select_groups)!=0 && $level==0) $nav .= ''; } list_slide_group(); $tpl = $template->loadTemplate("index"); $tpl = str_replace("{TIME}",time(),$tpl); $tpl = str_replace("{HEADERS}",$toheader,$tpl); $tpl = str_replace("{FOOTS}",$tofoot,$tpl); $tpl = str_replace("{NAV}",$nav,$tpl); $template->htmls = $tpl; $template->scanneAllInserts(); $template->scanneAllBlocks(); $template->output(); ?>