<?PHP
/************************************************************************/
/* NPDS V : Net Portal Dynamic System .                                 */
/* ===========================                                          */
/*                                                                      */
/* This version name NPDS Copyright (c) 2001-2005 by Philippe Brunier   */
/*                                                                      */
/* Manage Plugins Admin of your web site                                */
/*                                                                      */
/* 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.       */
/************************************************************************/
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();
}
if (!eregi("admin.php", $PHP_SELF)) { Access_Error(); }
global $pdst; $pdst="0";

global $language;
$hlpfile = "manuels/$language/plugins.html";
include ("header.php");
GraphicAdmin($hlpfile);

if ($op!="Extend-Admin-SubModule") {
   if (file_exists("admin/extend-modules.txt")) {
      $fp=fopen("admin/extend-modules.txt","r");
      if (filesize("admin/extend-modules.txt")>0)
         $Xcontent=fread($fp,filesize("admin/extend-modules.txt"));
      fclose($fp);
      OpenTable();
      echo "<table width=\"100%\" cellspacing=\"2\" cellpadding=\"2\" border=\"0\"><tr>\n";
      $segment=4;
      $tmp = explode("[/module]",$Xcontent);
      array_pop($tmp);
      foreach ($tmp as $ibid) {
         $Tnom=explode("[/nom]",$ibid);
         if ($ibid) {
            $Q = mysql_query("SELECT * FROM authors WHERE aid='$aid' LIMIT 1");
            $Q = mysql_fetch_assoc($Q);
            $Tlevel=explode("[/niveau]",$ibid);
            if (strpos($ibid,"[/niveau]")==0) {
               if ($Q[radminsuper]==1) {$affich=true;}
            } else {
               if ($Q[radminsuper]!=1) {
                  if (substr($Tlevel[0], strpos($Tlevel[0],"[niveau]")+8)=="no-right") {
                     $affich=true;
                  } else if ($Q[substr($Tlevel[0], strpos($Tlevel[0],"[niveau]")+8)]==1) {
                     $affich=true;
                  } else {
                     $affich=false;
                  }
               } else {
                  $affich=true;
               }
            }
            if ($affich) {
               echo "<td align=\"center\" width=\"".floor(100/$segment)."%\">";
               $TModPath=explode("[/ModPath]",$ibid);
               $TModStart=explode("[/ModStart]",$ibid);
               $chemin=substr($TModPath[0], strpos($TModPath[0],"[ModPath]")+9);
               if ($chemin!="")
                  echo "<a href=\"admin.php?op=Extend-Admin-SubModule&amp;ModPath=".$chemin."&amp;ModStart=".substr($TModStart[0], strpos($TModStart[0],"[ModStart]")+10);
               else
                  echo "<a href=\"admin.php?op=Extend-Admin-SubModule&amp;ModPath=&amp;ModStart=".urlencode(substr($TModStart[0], strpos($TModStart[0],"[ModStart]")+10));

               echo "\" class=\"NOIR\"><img src=\"";
               if (file_exists("modules/$chemin/$chemin.gif")) {
                   echo "modules/$chemin/$chemin.gif";
               } else {
                   echo $adminimg."optimysql.".$admf_ext;
               }
               echo "\" border=\"0\" alt=\"$chemin\" /><br />";

               echo "<b>".substr($Tnom[0], strpos($Tnom[0],"[nom]")+5)."</b></a><br /><br />";
               echo $chemin."&nbsp;::&nbsp;";
               echo substr($TModStart[0], strpos($TModStart[0],"[ModStart]")+10)."</td>";
               $count++;
               if ($count==$segment) {
                  echo "</tr><tr>";
                  $count = 0;
               }
            }
         }
      }
      echo "</tr></table>";
      CloseTable();
   }
} else {
   if ($ModPath!="")
      include("modules/$ModPath/$ModStart.php");
   else
      redirect_url(urldecode($ModStart));
}
include ("footer.php");
?>
