"._T("arty:pas_de_une")."
"; } echo ""; 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 ""; echo ""._T("arty:pas_de_video_hasard")."
"; } echo ""; echo ""._T("arty:intro_config_forum")."
"; 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 ""; 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 "