"._T('magusine:acces_a_la_page')."

"; fin_page(); exit; } traiter_post(); $params= charger_parametres(); traiter_get(); echo debut_page(); echo barre_onglets("arty", "base"); //affiche la barre des onglets du groupe "magusine", l'onglet courant est "base". echo debut_gauche(); echo debut_cadre_relief(_DIR_PLUGIN_ARTY.'/images/aide.png', true, "", _T('arty:info')); echo _T("arty:sideinfo_arty"); echo fin_cadre_relief(true); echo debut_droite(); gros_titre(_T("arty:titre_configuration_base")); // choix de l'edito echo debut_cadre_trait_couleur(_DIR_PLUGIN_ARTY."images/document-properties.png", true, "", _T('arty:edito')); $edito=array( "exec" => "arty", "#" => "acces_a", "ajouter" => "edito", "verif" => $_SESSION['id_check'] ); $message = afficher_selectionne("arty", "edito"); if (!$message) { echo _T("arty:pas_de_edito"); } echo "
"._T("arty:modifier_cette_option")."
"; echo "
"; afficher_selecteur($edito); echo "
"; echo ""; $resultat = spip_query("SELECT * FROM spip_arty_parametres WHERE parametre='cacher_edito'"); $resultat = spip_fetch_array($resultat); if($resultat) { $cacher = $resultat['valeur']; $lien = $resultat['valeur2']; } else { $cacher = "false"; $lien= "false"; } echo "
"; echo "
"; echo ""; echo "

"; echo "

"; echo "

"; echo "

"; echo ""; echo "
"; echo fin_cadre_trait_couleur(); // choix de la une echo debut_cadre_trait_couleur(_DIR_PLUGIN_ARTY."images/folder-new.png", true, "", _T('arty:rubrique_article_une')); $rubart_une=array( "exec" => "arty", "#" => "rubart_une", "ajouter" => "rubart_une", "verif" => $_SESSION['id_check'] ); $message = afficher_selectionne("arty", "rubart_une"); if (!$message) { echo "

"._T("arty:pas_de_une")."

"; } echo "
"._T("arty:modifier_cette_option")."
"; echo "
"; afficher_selecteur($rubart_une); echo "
"; echo ""; echo fin_cadre_trait_couleur(); // rubrique de news echo debut_cadre_trait_couleur(_DIR_PLUGIN_ARTY."images/edit-find.png", true, "", _T('arty:choix_rubrique_news')); // controle l'existence du parametre, sinon injecte par defaut echo "

"._T("arty:explication_choix_rubrique_news")."

"; $news=array( "exec" => "arty", "#" => "news", "ajouter" => "rubrique-news", "verif" => $_SESSION['id_check'] ); $message = afficher_selectionne("arty", "rubrique-news"); if (!$message) { echo "

"._T("arty:pas_de_rubrique_news")."

"; } echo "
"._T("arty:modifier_cette_option")."
"; echo "
"; afficher_selecteur($news, true, false); echo "
"; echo ""; echo fin_cadre_trait_couleur(); echo debut_cadre_trait_couleur(_DIR_PLUGIN_ARTY."images/camera-video.png", true, "", _T('arty:video_au_hasard')); $edito=array( "exec" => "arty", "#" => "access-d", "ajouter" => "video-hasard", "verif" => $_SESSION['id_check'] ); $message = afficher_selectionne("arty", "video-hasard"); if (!$message) { echo "

"._T("arty:pas_de_video_hasard")."

"; } echo "
"._T("arty:modifier_cette_option")."
"; echo "
"; afficher_selecteur($edito); echo "
"; echo ""; echo fin_cadre_trait_couleur(); echo debut_cadre_trait_couleur(_DIR_PLUGIN_ARTY."images/camera-photo.png", true, "", _T('arty:image_au_hasard')); $image=array( "exec" => "arty", "#" => "acces-e", "ajouter" => "image-hasard", "verif" => $_SESSION['id_check'] ); $message = afficher_selectionne("arty", "image-hasard"); if (!$message) { echo _T("arty:pas_de_image_hasard"); } echo "
"._T("arty:modifier_cette_option")."
"; echo "
"; afficher_selecteur($image); echo "
"; echo ""; echo fin_cadre_trait_couleur(); // reglage des parametres : afficher la date et les auteurs echo debut_cadre_trait_couleur(_DIR_PLUGIN_ARTY."images/edit-find.png", true, "", _T('arty:config_date_auteur')); $resultat= spip_query("SELECT * FROM spip_arty_parametres WHERE parametre='date_auteur'"); $resultat=spip_fetch_array($resultat); //print_r($resultat); if($resultat) { $date=$resultat['valeur']; $auteur=$resultat['valeur2']; $suite=$resultat['valeur3']; } else { $date="false"; $auteur="false"; $suite="false"; } echo _T("arty:intro_config_date_auteur"); echo "
\n"; echo ""; echo "

"._T("arty:intro_date")."

"; echo "
"; echo "
"; echo "

"._T("arty:intro_auteur")."

"; echo "
"; echo "
"; echo "

"._T("arty:intro_suite")."

"; echo "
"; echo "
"; echo "
"; echo "
"; echo fin_cadre_trait_couleur(); // forum dans la meme page ou dans la page forum echo debut_cadre_trait_couleur(_DIR_PLUGIN_ARTY."images/edit-find.png", true, "", _T('arty:config_forum')); //print_r($params); if(!$params['config_forum']) { $params['config_forum']="false"; } echo "

"._T("arty:intro_config_forum")."

"; echo "
\n"; echo ""; echo "

"._T("arty:explication_forum")."

"; echo "
"; echo "
"; echo "
"; echo "
"; echo fin_cadre_trait_couleur(); echo debut_cadre_trait_couleur(_DIR_PLUGIN_ARTY."images/edit-find.png", true, "", _T('arty:config_google_maps')); //print_r($params); if (!isset($params['google_api_key'])) { $params['google_api_key'] = ""; } if (!isset($params['gmaps_afficher_controles'])) { $params['gmaps_afficher_controles'] = "false"; } echo "

"._T("arty:intro_config_api_key")."

"; echo "
\n"; echo "
"; echo ""; echo "

"; echo "

"; echo "
"; echo "
"; echo fin_cadre_trait_couleur(); echo fin_gauche(); echo fin_page(); } function traiter_post() { //print_r($_POST); if($_POST['action']=='config_date_auteur') { $date=addslashes($_POST['date']); $auteur=addslashes($_POST['auteur']); $suite=addslashes($_POST['suite']); $resultat = spip_query("SELECT * FROM spip_arty_parametres WHERE parametre = 'date_auteur'"); if(!spip_num_rows($resultat)) { spip_query("INSERT INTO spip_arty_parametres (parametre,valeur,valeur2, valeur3) VALUES ('date_auteur','$date', '$auteur', '$suite')"); } else { spip_query("UPDATE spip_arty_parametres SET valeur= '$date',valeur2='$auteur', valeur3='$suite' WHERE parametre = 'date_auteur'"); } } if($_POST['action']=='config_forum') { $config_forum=addslashes($_POST['config_forum']); $resultat = spip_query("SELECT * FROM spip_arty_parametres WHERE parametre = 'config_forum'"); if(!spip_num_rows($resultat)) { spip_query("INSERT INTO spip_arty_parametres (parametre,valeur) VALUES ('config_forum','$config_forum')"); } else { spip_query("UPDATE spip_arty_parametres SET valeur= '$config_forum' WHERE parametre = 'config_forum'"); } } if (isset($_POST['cacher_edito'])) { $cacher = addslashes($_POST['cacher_edito']); $lien=addslashes($_POST['lire_autres_editos']); $resultat = spip_query("SELECT * FROM spip_arty_parametres WHERE parametre = 'cacher_edito'"); if(!spip_num_rows($resultat)) { spip_query("INSERT INTO spip_arty_parametres (parametre,valeur,valeur2) VALUES ('cacher_edito','$cacher','$lien')"); } else { spip_query("UPDATE spip_arty_parametres SET valeur='$cacher',valeur2='$lien' WHERE parametre = 'cacher_edito'"); } } if (isset($_POST['google_api_key'])) { $api_key = addslashes($_POST['google_api_key']); $resultat = spip_query("SELECT * FROM spip_arty_parametres WHERE parametre = 'google_api_key'"); if(!spip_num_rows($resultat)) { spip_query("INSERT INTO spip_arty_parametres (parametre,valeur) VALUES ('google_api_key','$api_key')"); } else { spip_query("UPDATE spip_arty_parametres SET valeur='$api_key' WHERE parametre = 'google_api_key'"); } $controles = addslashes($_POST['gmaps_afficher_controles']); $resultat = spip_query("SELECT * FROM spip_arty_parametres WHERE parametre = 'gmaps_afficher_controles'"); if(!spip_num_rows($resultat)) { spip_query("INSERT INTO spip_arty_parametres (parametre,valeur) VALUES ('gmaps_afficher_controles','$controles')"); } else { spip_query("UPDATE spip_arty_parametres SET valeur='$controles' WHERE parametre = 'gmaps_afficher_controles'"); } //enregistrement des formats kml et kmz $resultat = spip_query("SELECT * FROM spip_types_documents WHERE extension = 'kml'"); if(!spip_num_rows($resultat)) { spip_query("INSERT INTO spip_types_documents (titre, extension, mime_type, inclus, upload) VALUES ('Keyhole Markup Language','kml', 'application/vnd.google-earth.kml+xml', 'non', 'oui')"); } $resultat = spip_query("SELECT * FROM spip_types_documents WHERE extension = 'kmz'"); if(!spip_num_rows($resultat)) { spip_query("INSERT INTO spip_types_documents (titre, extension, mime_type, inclus, upload) VALUES ('Keyhole Markup Language (compressed)','kmz', 'application/vnd.google-earth.kmz', 'non', 'oui')"); } } } function charger_parametres() { $params=array(); $resultat= spip_query("SELECT * FROM spip_arty_parametres"); if (spip_num_rows($resultat)) { while ($row=spip_fetch_array($resultat)) { $params[$row['parametre']] = $row['valeur']; } } return $params; } function traiter_get() { //print_r($_GET); $param_accepte=array('edito','video-hasard','rubrique-news','image-hasard', 'rubart_une'); if(isset($_GET['ajouter']) && isset($_GET['verif'])){ $param=$_GET['ajouter']; if(in_array($param, $param_accepte) && $_GET['verif']==$_SESSION['id_check']) { if(isset($_GET['id_rubrique'])) { $id_rubrique=(int) $_GET['id_rubrique']; if(is_numeric($id_rubrique)){ $resultat = spip_query("SELECT * FROM spip_arty_paramassoc WHERE param = '$param' AND id_rubrique = $id_rubrique"); if(!spip_num_rows($resultat)) { spip_query("INSERT INTO spip_arty_paramassoc (param, id_rubrique) VALUES ('$param', $id_rubrique)"); } } } elseif(isset($_GET['id_article'])) { $id_article=(int) $_GET['id_article']; if(is_numeric($id_article)){ $resultat = spip_query("SELECT * FROM spip_arty_paramassoc WHERE param = '$param' AND id_article = $id_article"); if(!spip_num_rows($resultat)) { spip_query("INSERT INTO spip_arty_paramassoc (param, id_article) VALUES ('$param', $id_article)"); } } } } } if(isset($_GET['supprimer']) && isset($_GET['verif'])){ $id_assoc=(int) $_GET['supprimer']; if( is_numeric($id_assoc) && $_GET['verif']==$_SESSION['id_check']) { spip_query("DELETE FROM spip_arty_paramassoc WHERE id_assoc = $id_assoc"); } } } function afficher_selectionne($page, $param) { $resultat = spip_query("SELECT * FROM spip_arty_paramassoc WHERE param = '$param'"); if(spip_num_rows($resultat)) { echo "
"; return true; } else { return false; } } ?>