<?PHP
/****************************************************************************************/
/* NPDS V - MetaTags 1.0 .                                                              */
/* based on PHPNuke's metatags admin module (http://www.phpnuke.org)                    */
/* M. PASCAL aKa EBH (plan.net@free.fr)                                                 */
/*                                                                                      */
/* This program is free software. You can redistribute it and/or modify it under the    */
/* terms of the GNU General Public License as published by the Free Software Foundation */
/* either version 2 of the license.                                                     */
/*                                                                                      */
/* ver 1.0  : Rajout du charset                                                         */
/* ver 0.1b : suppression 'include(config.php)'                                         */
/*                                                                                      */
/* ver 0.1a : ajout/modification d'options,                                             */
/*            page de manuel manuels/metatags.html                                       */
/*                                                                                      */
/* ver 0.1 : adaptation de metatags, HTML/CSS (en attente de CLASS admin)               */
/*                                                                                      */
/****************************************************************************************/
function Access_Error () {
  if (file_exists("meta/meta.php"))
     include ("meta/meta.php");
  echo "<title>NPDS</title></head><body bgcolor=\"white\"><br /><p align=\"center\"><span style=\"font-size: 14px; font-family: Arial; font-weight: bold; color: red;\">";
  echo "Access Denied / Acc&egrave;s Refus&eacute;";
  if (cur_charset=="utf-8") echo" / &#x901A;&#x5165;&#x88AB;&#x5426;&#x8BA4;";
  echo "</span>";
  echo "<br /><br /><span style=\"font-size: 12px; font-family: Arial; font-weight: bold; color: black;\">NPDS - Portal System";
  echo "</span></p></body></html>";
  die();
}

function MetaTagAdmin($saved = false) {
   global $hlpfile;
   $tags = GetMetaTags("meta/meta.php");
   include("header.php");
   GraphicAdmin($hlpfile);
   OpenTable();
   echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr><td class=\"HEADER\">\n";
   echo adm_translate("Administration des MétaTags");
   echo "</td></tr></table>\n";
   echo "<br />\n";
   if ($saved){
      echo "<p align=\"center\" class class=\"ROUGE\">".adm_translate("Vos MétaTags ont été modifiés avec succès !")."</p><br />\n";
   }
   echo "<form action=\"admin.php\" method=\"post\">\n";

   echo "<b>".adm_translate("Auteur(s)")." :</b><br />\n";
   echo "<input class=\"TEXTBOX\" type=\"text\" name=\"newtag[author]\" value=\"".$tags[author]."\" size=\"80\" maxlength=\"100\"><br />\n";
   echo adm_translate("(Ex. : nom du webmaster)")."<br /><br />\n";

   echo "<b>".adm_translate("Propriétaire")." :</b><br />\n";
   echo "<input class=\"TEXTBOX\" type=\"text\" name=\"newtag[owner]\" value=\"".$tags[owner]."\" size=\"80\" maxlength=\"100\"><br />\n";
   echo adm_translate("(Ex. : nom de votre compagnie/service)")."<br /><br />\n";

   echo "<b>".adm_translate("Adresse e-mail principale")." :</b><br />\n";
   echo "<input class=\"TEXTBOX\" type=\"text\" name=\"newtag[reply-to]\" value=\"".$tags['reply-to']."\" size=\"80\" maxlength=\"100\"><br />\n";
   echo adm_translate("(Ex. : l'adresse e-mail du webmaster)")."<br /><br />\n";

   echo "<b>".adm_translate("Langue principale")." :</b><br />\n";
   echo "<input class=\"TEXTBOX\" type=\"text\" name=\"newtag[language]\" value=\"".$tags['language']."\" size=\"6\" maxlength=\"5\"><br />\n";
   echo adm_translate("(Ex. : fr(Français), en(Anglais), en-us(Américain), de(Allemand), it(Italien), pt(Portugais), etc)")."<br /><br />\n";

   echo "<b>".adm_translate("Description")." :</b><br />\n";
   echo "<input class=\"TEXTBOX\" type=\"text\" name=\"newtag[description]\" value=\"".$tags[description]."\" size=\"80\" maxlength=\"200\"><br />\n";
   echo adm_translate("(Brève description des centres d'intérêt du site. 200 caractères maxi.)")."<br /><br />\n";

   echo "<b>".adm_translate("Mot(s) clé(s)")." :</b><br />\n";
   echo "<input class=\"TEXTBOX_STANDARD\" type=\"text\" name=\"newtag[keywords]\" value=\"".$tags[keywords]."\" size=\"100\" maxlength=\"1000\"><br />\n";
   echo adm_translate("(Définissez un ou plusieurs mot(s) clé(s). 1000 caractères maxi.<br />Remarques : une lettre accentuée équivaut le plus souvent à 8 caractères. La majorité des moteurs de recherche font la distinction minuscule/majuscule. Séparez vos mots par une virgule)")."<br /><br />\n";

   echo "<b>".adm_translate("Audience")." :</b><br />\n";
   echo "<select class=\"TEXTBOX_STANDARD\" name=\"newtag[rating]\">\n";
   echo "<option value=\"general\"".(!strcasecmp($tags[rating], 'general') ? " selected" : "").">".adm_translate("Tout public")."</option>\n";
   echo "<option value=\"mature\"".(!strcasecmp($tags[rating], 'mature') ? " selected" : "").">".adm_translate("Adulte")."</option>\n";
   echo "<option value=\"restricted\"".(!strcasecmp($tags[rating], 'restricted') ? " selected" : "").">".adm_translate("Accès restreint")."</option>\n";
   echo "<option value=\"14 years\"".(!strcasecmp($tags[rating], '14 years') ? " selected" : "").">".adm_translate("14 ans")."</option>\n";
   echo "</select><br />\n";
   echo adm_translate("(Définissez le public intéressé par votre site)")."<br /><br />\n";

   echo "<b>".adm_translate("Distribution")." :</b><br />\n";
   echo "<select class=\"TEXTBOX_STANDARD\" name=\"newtag[distribution]\">\n";
   echo "<option value=\"global\"".(!strcasecmp($tags[distribution], 'global') ? " selected" : "").">".adm_translate("Large")."</option>\n";
   echo "<option value=\"local\"".(!strcasecmp($tags[distribution], 'local') ? " selected" : "").">".adm_translate("Restreinte")."</option>\n";
   echo "</select><br /><br />\n";

   echo "<b>".adm_translate("Copyright")." :</b><br />\n";
   echo "<input class=\"TEXTBOX\" type=\"text\" name=\"newtag[copyright]\" value=\"".$tags[copyright]."\" size=\"80\" maxlength=\"100\"><br />\n";
   echo adm_translate("(Informations légales)")."<br /><br />\n";

   echo "<b>".adm_translate("Robots/Spiders")." :</b><br />\n";
   echo "<select class=\"TEXTBOX_STANDARD\" name=\"newtag[robots]\">\n";
   echo "<option value=\"all\"".(!strcasecmp($tags[robots], 'all') ? " selected" : "").">".adm_translate("Tout contenu (page/liens/etc)")."</option>\n";
   echo "<option value=\"none\"".(!strcasecmp($tags[robots], 'none') ? " selected" : "").">".adm_translate("Aucune indexation")."</option>\n";
   echo "<option value=\"index,follow\"".(!strcasecmp($tags[robots], 'index,follow') ? " selected" : "").">".adm_translate("Page courante et liens locaux")."</option>\n";
   echo "<option value=\"index,nofollow\"".(!strcasecmp($tags[robots], 'index,nofollow') ? " selected" : "").">".adm_translate("Page courante sans liens locaux")."</option>\n";
   echo "<option value=\"noindex,follow\"".(!strcasecmp($tags[robots], 'noindex,follow') ? " selected" : "").">".adm_translate("Liens locaux sauf page courante")."</option>\n";
   echo "<option value=\"noindex,nofollow\"".(!strcasecmp($tags[robots], 'noindex,nofollow') ? " selected" : "").">".adm_translate("Ni page courante, ni liens locaux")."</option>\n";
   echo "</select><br />\n";
   echo adm_translate("(Définissez la méthode d'analyse que doivent adopter les robots des moteurs de recherche)")."<br /><br />\n";

   echo "<b>".adm_translate("Fréquence de visite des Robots/Spiders")." :</b><br />\n";
   echo "<input class=\"TEXTBOX_STANDARD\" type=\"text\" name=\"newtag[revisit-after]\" value=\"".$tags['revisit-after']."\" size=\"20\" maxlength=\"30\"><br />\n";
   echo adm_translate("(Ex. : 16 days. Remarque : ne définissez pas de fréquence inférieure à 14 jours !)")."<br /><br />\n";

   if (function_exists("utf8_encode")) {
      echo "<b>".adm_translate("Encodage")." :</b><br />\n";
      echo "<select class=\"TEXTBOX_STANDARD\" name=\"newtag[content-type]\">\n";
      echo "<option value=\"text/html; charset=iso-8859-1\"".(!strcasecmp($tags['content-type'], 'text/html; charset=iso-8859-1') ? " selected" : "").">charset=ISO-8859-1</option>\n";
      echo "<option value=\"text/html; charset=utf-8\"".(!strcasecmp($tags['content-type'], 'text/html; charset=utf-8') ? " selected" : "").">charset=UTF-8</option>\n";
      echo "</select>";
   } else {
      echo "<b>".adm_translate("Encodage")." :</b> ";
      echo "<span class=\"ROUGE\">utf8_encode() ".adm_translate("non disponible")."</span>";
   }
   echo "<br /><br />\n";
   echo "<b>DOCTYPE :</b><br />\n";
   echo "<select class=\"TEXTBOX_STANDARD\" name=\"newtag[doctype]\">\n";
   echo "<option value=\"HTML 4.01 Transitional\"".(!strcasecmp(doctype, 'HTML 4.01 Transitional') ? " selected" : "").">HTML 4.01 ".adm_translate("Transitional")."</option>\n";
   echo "<option value=\"HTML 4.01 Strict\"".(!strcasecmp(doctype, 'HTML 4.01 Strict') ? " selected" : "").">HTML 4.01 ".adm_translate("Strict")."</option>\n";
   echo "<option value=\"XHTML 1.0 Transitional\"".(!strcasecmp(doctype, 'XHTML 1.0 Transitional') ? " selected" : "").">XHTML 1.0 ".adm_translate("Transitional")."</option>\n";
   echo "<option value=\"XHTML 1.0 Strict\"".(!strcasecmp(doctype, 'XHTML 1.0 Strict') ? " selected" : "").">XHTML 1.0 ".adm_translate("Strict")."</option>\n";
   echo "</select>";
   echo "<br /><br />\n";

   echo "<input type=\"hidden\" name=\"op\" value=\"MetaTagSave\">\n";
   echo "<input class=\"BOUTON_STANDARD\" type=\"submit\" value=\"".adm_translate("Enregistrer")."\">\n";
   echo "</form>\n";
   CloseTable();
   include("footer.php");
}

if (!eregi("admin.php", $PHP_SELF)) { Access_Error(); }
include ("admin/settings_save.php");
global $pdst; $pdst = "0";

global $language;
$hlpfile = "manuels/$language/metatags.html";
$result = mysql_query("SELECT radminsuper FROM authors WHERE aid='$aid'");
list($radminsuper) = mysql_fetch_row($result);
if ($radminsuper != 1) {
   Access_Error();
} else {
   switch ($op) {
      case "MetaTagSave":
         $meta_saved = MetaTagSave("meta/meta.php", $newtag);
         header("location: admin.php?op=MetaTagAdmin");
         break;

       case "MetaTagAdmin":
         MetaTagAdmin($meta_saved);
         break;
    }
}
?>
