#CACHE{0} #HTTP_HEADER{'Content-Type: text/javascript'} /* Ne fonctionne pas, car la page se charge une première fois, puis une deuxième fois avant d'obtenir la bonne variable d'environnement if (document.location.href.indexOf("&var_mode=recalcul")==-1){ window.location += "&var_mode=recalcul"; } */ //alert('page=[(#ENV{nompage})]\ntype=[(#ENV{nomtype})]\nid=[(#ENV{nomid})]'); // Fonction permettant de créer un cookie sans durée, avec suppression à la fermeture du navigateur function setCookie(c_name,value) { document.cookie = c_name+"="+ escape(value); } // On récupère le cookie function GetCookie (name) { var arg=name+"="; var alen=arg.length; var clen=document.cookie.length; var i=0; while (i .color {color: red; font-size : 15px;}"); // Css "Version iPhone" if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))) // Si l'utilisateur est sur un iPhone ou un iPod. { document.write("Version Mobile "); } /***************************************************************** TEST IPHONE *********************************************************************/ if((navigator.userAgent.match(/iPhone/i))||(navigator.userAgent.match(/iPod/i))) // Si l'utilisateur est sur un iPhone ou un iPod. { if (GetCookie("cookie")!= "opt" && GetCookie("cookie")!= "n_opt") // == Si le cookie n'existe pas. { optimisation = confirm("Souhaitez-vous naviguer sur le site optimise pour iPhone ?"); if (optimisation) // Si oui { setCookie ("cookie", "opt"); // Création du cookie, nom : "cookie" avec valeur : "opt" (pour "optimiser") } else // Si non { setCookie ("cookie", "n_opt"); // Création du cookie, nom : "cookie" avec valeur : "n_opt", (pour "non_optimiser") } } } else { setCookie ("cookie", "n_opt"); } /****************************************************************************************************************************************************/ /**************************************************************** Redirection *****************************************************************************/ if (GetCookie ("cookie") == "opt") // Si l'utilisateur souhaite passer sur la version optimisée { setCookie ("spip_admin","%40admin"); // Correction bug : utilisateur non connecté accédant directement à la version iSPIP de Thélia //[(#ENV{nompage}|match{ispip}|non) var url; url=document.location.href; // vaut par ex : http://localhost/spipthelia/spip.php?page=rubrique_thelia&id_rubrique_thelia=2 if (url.indexOf("page")!=-1) { if ("#ENV{nomid}"=="") { window.location = "[(#URL_PAGE{ispip-#ENV{nompage}}|html_entity_decode)]"; } else { window.location = "[(#URL_PAGE{ispip-#ENV{nompage},id_[(#ENV{nompage})]=[(#ENV{nomid})]}|html_entity_decode)]"; } } else { if ("#ENV{nomid}"=="") { window.location = "[(#URL_PAGE{ispip-#ENV{nomtype}}|html_entity_decode)]"; } else { window.location = "[(#URL_PAGE{ispip-#ENV{nomtype},id_[(#ENV{nomtype})]=[(#ENV{nomid})]}|html_entity_decode)]"; } } //window.location = "[(#SELF|parametre_url{page,ispip-#ENV{nompage}}|html_entity_decode)]"; // Cas de la page d'accueil SPIP, de la page Plan, de la page connexion et de la page index (exceptions) /*if (url.indexOf("page")!=-1) { window.location = "[(#SELF|parametre_url{page,ispip-#ENV{nompage}}|html_entity_decode)]"; } else { [(#ENV{nompage}|=={rubrique}|oui) window.location = "[(#URL_PAGE{ispip-rubrique,id_rubrique=#ID_RUBRIQUE}|html_entity_decode)]"; ] [(#ENV{nompage}|=={rubrique}|non) [(#ENV{nompage}|=={article}|oui) window.location = "[(#URL_PAGE{ispip-article,id_article=#ID_ARTICLE}|html_entity_decode)]"; ] [(#ENV{nompage}|=={article}|non) [(#ENV{nompage}|=={auteur}|oui) window.location = "[(#URL_PAGE{ispip-auteur,id_auteur=#ID_AUTEUR}|html_entity_decode)]"; ] [(#ENV{nompage}|=={auteur}|non) [(#ENV{nompage}|=={breve}|oui) window.location = "[(#URL_PAGE{ispip-breve,id_breve=#ID_BREVE}|html_entity_decode)]"; ] [(#ENV{nompage}|=={breve}|non) [(#ENV{nompage}|=={mot}|oui) window.location = "[(#URL_PAGE{ispip-mot,id_mot=#ID_MOT}|html_entity_decode)]"; ] [(#ENV{nompage}|=={mot}|non) [(#ENV{nompage}|=={site}|oui) window.location = "[(#URL_PAGE{ispip-site,id_site=#ID_SYNDIC}|html_entity_decode)]"; ] [(#ENV{nompage}|=={site}|non) window.location = "[(#URL_PAGE{ispip})]"; // evenements / agenda etc. ] ] ] ] ] ] }*/ //] } /**********************************************************************************************************************************************************/