<?

/********************************************************/
/* NSN HELP 1.1.0 for PHP-Nuke 7.5/7.6                  */
/* Author: Benoit (gargamel10@msn.com)                  */
/*                                                      */
/* http://www.nukescripts.net                           */
/*http://www.nukescripts.fr                             */
/* Copyright © 2005 by NukeScripts Network              */
/********************************************************/

function MainMenu(){
global $admin_file ,$radminsuper;
Max_OpenTable();
echo "<center><font class='title'><b>"._HELP_ADMIN."</b></font></center>";
Max_CloseTable();
br('1');
if($radminsuper == 1){
Max_OpenTable();
$addFonction = "| <a href=\"".$admin_file.".php?op=AddFonction\">"._ADD_FONCTION."</a> | ";
$addFonction .= "<a href=\"".$admin_file.".php?op=GestionFonction\">"._GESTION_FONCTION."</a> |";
$addFonction .= "<a href=\"".$admin_file.".php?op=ConfigHelp\">"._CONFIG_HELP."</a> |";
$addFonction .= "<a href=\"".$admin_file.".php\">"._BACK_ADMIN."</a> |";
$addFonction .= "<a href=\"".$admin_file.".php?op=ListAide\">"._BACK_HELP."</a> |";
echo "<center><font class=\"content\">$addFonction</center></font>";
Max_CloseTable();
br('1');
} else {
Max_OpenTable();
$addFonction .= "<a href=\"".$admin_file.".php\">"._BACK_ADMIN."</a> |";
$addFonction .= "<a href=\"".$admin_file.".php?op=ListAide\">"._BACK_HELP."</a> |";
echo "<center><font class=\"content\">$addFonction</center></font>";
Max_CloseTable();
br('1');
}
}

function BenDate($curDate, $mode) {
if(strcmp($mode, "english") == 0){
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $curDate, $date);
if($date[2]==1)$date[2]='January';
if($date[2]==2)$date[2]='February';
if($date[2]==3)$date[2]='March';
if($date[2]==4)$date[2]='April';
if($date[2]==5)$date[2]='May';
if($date[2]==6)$date[2]='June';
if($date[2]==7)$date[2]='July';
if($date[2]==8)$date[2]='August';
if($date[2]==9)$date[2]='Septembrer';
if($date[2]==10)$date[2]='Octobrer';
if($date[2]==11)$date[2]='Novembrer';
if($date[2]==12)$date[2]='Decembrer';
$lol = $date[2]. " " .$date[3]. " " .$date[1]. " at ". $date[4].":" .  $date[5] .":" . $date[6];
return $lol;
} 	
if(strcmp($mode, "french") == 0){
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $curDate, $date);
if($date[2]==1)$date[2]='Janvier';
if($date[2]==2)$date[2]='Fevrier';
if($date[2]==3)$date[2]='Mars';
if($date[2]==4)$date[2]='Avril';
if($date[2]==5)$date[2]='Mai';
if($date[2]==6)$date[2]='Juin';
if($date[2]==7)$date[2]='Juillet';
if($date[2]==8)$date[2]='Aout';
if($date[2]==9)$date[2]='Septembre';
if($date[2]==10)$date[2]='Octobre';
if($date[2]==11)$date[2]='Novembre';
if($date[2]==12)$date[2]='Décembre';

$lol = $date[3]. " " .$date[2]. " " .$date[1]. " à ". $date[4].":" .  $date[5] .":" . $date[6];
return $lol;
}else{
return(substr($curDate, 8, 2)."/".substr($curDate, 5, 2)."/".substr($curDate, 0, 4));
  }
}

function help_get_configs(){
    global $prefix, $db;
    $configresult = $db->sql_query("SELECT config_name, config_value FROM ".$prefix."_nsnhelp_config");
    while (list($config_name, $config_value) = $db->sql_fetchrow($configresult)) {
        $config[$config_name] = $config_value;

    }
    $db->sql_freeresult($configresult);
    return $config;
}

function help_save_config($config_name, $config_value){
    global $prefix, $db;
    $save_config = $db->sql_query("UPDATE ".$prefix."_nsnhelp_config SET config_value='$config_value' WHERE config_name='$config_name'");
    $db->sql_freeresult($save_config);
}
?>
