".$extarray[$i]."
"; break; } } if ($bBreak==false) {return -1;} return $FilterExtension; } /////////////////////////// // GET ACTUAL SCRIPT NAME ////////////////////////// function thisscript() { //extract($GLOBALS); // function to show the actual script name $MaxLevel=explode("/",$_SERVER["SCRIPT_NAME"]); $phpscript=$MaxLevel[count($MaxLevel)-1]; return $phpscript; } ///////////////////////////////////////////// // Prepare posted date To INSERT,UPDATE PHP ///////////////////////////////////////////// function verifposted($myinput) { extract($GLOBALS); $datatoreturn = "" ; if (isset($_POST[$myinput])) $datatoreturn=$_POST[$myinput]; if ( $magicq != 1 ) {$datatoreturn=addslashes($datatoreturn) ; } //$datatoreturn=str_replace('\\','\\\\',$datatoreturn); // Backslash first //$datatoreturn=str_replace("'","\'",$datatoreturn); // Single quote //$datatoreturn=str_replace('"','\"',$datatoreturn); // Double quote return $datatoreturn; } //////////////////////////////////////////////////// // Prepare posted date To INSERT,UPDATE PHP FRO DATE // ( TO CHANGE ) /////////////////////////////////////////////////// function verifposteddate($myinput) { extract($GLOBALS); $datatoreturn =""; if (isset($_POST[$myinput])) $datatoreturn=$_POST[$myinput]; $datatoreturn=str_replace('\\','\\\\',$datatoreturn); // Backslash first $datatoreturn=str_replace("'","\'",$datatoreturn); // Single quote $datatoreturn=str_replace('"','\"',$datatoreturn); // Double quote $MaxLevel=split("/",$datatoreturn); if ( count($MaxLevel)==3 ) { $datatoreturn=$MaxLevel[2]."-".$MaxLevel[1]."-".$MaxLevel[0]; } else { $datatoreturn = date("Y-m-d G:i:s"); } return $datatoreturn; } function verifposteddate3($myinput) { extract($GLOBALS); $datatoreturn =""; if (isset($_POST[$myinput])) $datatoreturn=$_POST[$myinput]; $datatoreturn=str_replace('\\','\\\\',$datatoreturn); // Backslash first $datatoreturn=str_replace("'","\'",$datatoreturn); // Single quote $datatoreturn=str_replace('"','\"',$datatoreturn); // Double quote $MaxLevel=split("/",$datatoreturn); if ( count($MaxLevel)==3 ) { $datatoreturn=$MaxLevel[2]."-".$MaxLevel[1]."-".$MaxLevel[0]; } else { $datatoreturn = date("Y-m-d"); } return $datatoreturn; } /////////////////////////////////////////////////////////// // Prepare posted date To INSERT,UPDATE PHP for Bool value ////////////////////////////////////////////////////////// function verifpostedbool($myinput) // ( TO CHANGE ) { if (isset($_POST[$myinput])) $datatoreturn=$_POST[$myinput]; if ( strtolower($datatoreturn) == 'true' ) $datatoreturn =-1; else $datatoreturn =0; return $datatoreturn; } ////////////////////////////////////////////////////////////////// // Function to make a dropdown values from a seperated comma list ////////////////////////////////////////////////////////////////// function Dropdown($prmvalue,$prmFieldName,$prmdefaulvalues,$prmdefaultexts,$prmWidth,$DefaultText,$prmOnChange,$prmDisable,$prmbgcolor) { extract($GLOBALS); $myarray=explode(";",$prmdefaulvalues); $myarraytext=explode(";",$prmdefaultexts); $selectstr=""; // disable make a new hidden input - ( disable inputs are not posted .!? ) if ($prmDisable) { print ""; } } ////////////////////////////////////////////////////////////////// // Function to make a dropdown values from db table ////////////////////////////////////////////////////////////////// function DbDropdown($prmInputName,$prmTable,$prmField,$PrmKey,$prmSecondKeyValue,$prmWidth,$DefaultText,$prmOnChange,$prmDisable,$prmconnid) { extract($GLOBALS); $instrSql="SELECT ".$prmField.",".$PrmKey." FROM ".$prmTable." order by ".$prmField." "; $selectstr=""; mysql_free_result($rstemp); // disable make a new hidden input - ( disable inputs are not posted .!? ) if ($prmDisable) {print "";} } ///////////////////////////////////////////// // BoolView true = oui false = non ///////////////////////////////////////////// function boolview($bool) { switch ($bool) { case true : return "Oui"; break; case false : return "Non"; break; } } ///////////////////////////////////////////// // view profil ///////////////////////////////////////////// function viewprofil($profil) { switch ($profil) { case "AD": $profil="Administrateur"; break; case "AU": $profil="Auteur"; break; case "VL": $profil="Validateur"; break; case "GU": $profil="Invit"; break; } return $profil; } ///////////////////////////////////////////// // ADMIN ERROR MESSAGE ///////////////////////////////////////////// function AdminMessage($strErrMessage,$prmmode) { extract($GLOBALS); ?>

Calendrier  "; while($row=mysql_fetch_object($rs)){ $sql='select count(menuId) as nb from m_menu where act=1 and parentId='.$row->menuId; $rssql=mysql_query($sql); $nb=mysql_result($rssql,0,"nb"); if($nbparent!=$i){ $menu1.= "
  • link==''){$menu1.= "#'";}else{$menu1.= $row->link."'";} if(thisscript()==$row->link){$menu1.=" class='active'";} } if($row->type=='DOC'){ //$menu1.= "doc.php?docid=".$row->menuId."'"; $menu1.=RewriteRule("document",$row->menu,array($row->menuId)); if($docid==$row->menuId){$menu1.=" class='active'";} } $menu1.= ">"; $menu1.= $row->menu; $menu1.= ""; if($nb!=0){ $sub=""; $sub.=recurMenuFront($row->menuId,$sub,$docid); $menu1.=$sub; } $menu1.= "
  • "; }mysql_free_result($rs); $menu1.= ""; return $menu1; }*/ function recurMenuFront($qryparent,$menu1,$docid) { $strsql="SELECT * from m_menu where act=1 and parentId=$qryparent ORDER BY ord ;"; $rs=mysql_query($strsql) or die ("Erreur : ". mysql_error()) ; $menu1.= ""; return $menu1; } function recurMenuFrontLeft($docid1,$qryparent,$menu1,$docid) { $strsql="SELECT * from m_menu where act=1 and parentId=$qryparent ORDER BY ord ;"; $rs=mysql_query($strsql) or die ("Erreur : ". mysql_error()) ; $menu1.= ""; return $menu1; } function recurMenuFront1($qryparent,$menu1,$docid) { $menu1=""; $i=1; $strsql="SELECT * from m_menu where act=1 and parentId=$qryparent ORDER BY ord limit 0,8 ;"; $rs=mysql_query($strsql) or die ("Erreur : ". mysql_error()) ; $nbparent=mysql_num_rows($rs); $menu1.= "\n"; return $menu1; } function recurMenuFrontF($qryparent,$docid,$rlang) { $menu1=""; $i=1; $strsql="SELECT * from m_menu where act=1 and parentId=$qryparent ORDER BY ord ;"; $rs=mysql_query($strsql) or die ("Erreur : ". mysql_error()) ; $nbparent=mysql_num_rows($rs); while($row=mysql_fetch_object($rs)){ $sql='select count(menuId) as nb from m_menu where act=1 and parentId='.$row->menuId; $rssql=mysql_query($sql); $nb=mysql_result($rssql,0,"nb"); $menu1.= "link==''){$menu1.= "#'";}else{$menu1.= $row->link."?lang=".$row->langcode."'";} $chaine=explode("?",$row->link); $link=$chaine[0]; //echo $_SERVER["REQUEST_URI"]."
    "; if($_SERVER["REQUEST_URI"]==$link){$menu1.=" class='active'";}else{$menu1.=" class='disable'";} } if($row->type=='DOC'){ $menu1.= "doc.php?docid=".$row->menuId."&lang=".$row->langcode."'"; // $menu1.=RewriteRule("document",$row->menu,array($row->menuId))."'"; //$menu1.=RewriteRule("document",$row->menu,array($row->menuId),$row->langcode)."'"; if($docid==$row->menuId){$menu1.="class='active'";}else{$menu1.="class='disable'";} } if($nbparent==$i){$menu1.= "style='border:0px;'";} $menu1.="title='".$row->metatitle."'>"; $menu1.= $row->menu; $menu1.= "
    "; $i++; }mysql_free_result($rs); return $menu1; } function dump($tab){ if(is_array($tab) || is_object($tab)){ print '
    ';
    		print_r($tab);
    		print '
    '; }else { print $tab; } } /*function adjastfstring($string){ $string = strtr($string,'','AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'); $string = preg_replace('/([^.a-z0-9]+)/i', '_', $string); return $string; }*/ ///////////////////////////////////////////// // request and save data into session ///////////////////////////////////////////// function REQSES($frmItem) { if ( isset($_REQUEST[$frmItem]) ) { $str=$_REQUEST[$frmItem]; $_SESSION[$frmItem] = $str; } elseif ( isset($_SESSION[$frmItem]) ) { $str=$_SESSION[$frmItem];} else { $str = ""; } return $str; } /** * Fonction qui fait l'ajout automatique dans la base de mailling * Chtioui Slah */ function addMailling($prmmail,$prmnom){ extract($GLOBALS); $sql="select email from mailing_list where email='".$prmmail."'"; $rs=mysql_query($sql); $nb=mysql_num_rows($rs); if($nb==0){ $sql="INSERT INTO `mailing_list` (`email`,`name`,`act`,`dcr`) VALUES ('".$prmmail."','$prmnom',1,now())"; $rs=mysql_query($sql); return true; } else{return false;} } function adjastfstring($string){ $string = strtr($string,'ܯ謹~ ','AAAAAACEEEEIIIIOOOOOUUUUYaaaaaceeeeiiiioooooouuuuyyy_'); $string = preg_replace('/([^.a-z0-9]+)/i', '_', $string); return $string; } function RewriteRule($prefix,$chaine,$tab,$lang){ extract($GLOBALS); $chaine=adjastfstring($chaine); $url=$prefix."-".$chaine; //dump($tab); foreach ($tab as $value){ $url.=",".$value.",".$lang; } return $url.".html"; } if (!function_exists("mime_content_type")) { function mime_content_type($fn) { static $mime_magic_data; #-- fallback $type = false; #-- read in first 3K of given file if (is_dir($fn)) { return("httpd/unix-directory"); } elseif (is_resource($fn) || ($fn = @fopen($fn, "rb"))) { $bin = fread($fn, $maxlen=3072); fclose($fn); } elseif (!file_exists($fn)) { return false; } else { return("application/octet-stream"); // give up } #-- use the appropriate external tool /* if (function_exists("exec") && !ini_get("safe_mode")) { $type = exec("file -iL " . escapeshellcmd($fn) . " 2>/dev/null"); if ($type = trim(strtok(substr(strrchr($type, ":"), 1), ";"))) { return $type; } } */ #-- use PECL::fileinfo when available if (function_exists("finfo_buffer")) { $fi = new finfo(FILEINFO_MIME_TYPE); $type = $fi->buffer($bin); return($type); } #-- read in magic data, when called for the very first time if (!isset($mime_content_type)) { if ((file_exists($fn = ini_get("mime_magic.magicfile"))) or (file_exists($fn = "/usr/share/misc/magic.mime")) or (file_exists($fn = "/etc/mime-magic")) ) { $mime_magic_data = array(); #-- read in file $f = fopen($fn, "r"); $fd = fread($f, 1<<20); fclose($f); $fd = str_replace(" ", "\t", $fd); #-- look at each entry foreach (explode("\n", $fd) as $line) { #-- skip empty lines if (!strlen($line) or ($line[0] == "#") or ($line[0] == "\n")) { continue; } #-- break into four fields at tabs $l = preg_split("/\t+/", $line); @list($pos, $typestr, $magic, $ct) = $l; #print_r($l); #-- ignore >continuing lines if ($pos[0] == ">") { continue; } #-- real mime type string? $ct = strtok($ct, " "); if (!strpos($ct, "/")) { continue; } #-- mask given? $mask = 0; if (strpos($typestr, "&")) { $typestr = strtok($typestr, "&"); $mask = strtok(" "); if ($mask[0] == "0") { $mask = ($mask[1] == "x") ? hexdec(substr($mask, 2)) : octdec($mask); } else { $mask = (int)$mask; } } #-- strip prefixes if ($magic[0] == "=") { $magic = substr($magic, 1); } #-- convert type if ($typestr == "string") { $magic = stripcslashes($magic); $len = strlen($magic); if ($mask) { continue; } } #-- numeric values else { $mask or $mask = 0xFFFFFFFF; if ((ord($magic[0]) < 48) or (ord($magic[0]) > 57)) { #echo "\nmagicnumspec=$line\n"; #var_dump($l); continue; #-- skip specials like >, x, <, ^, & } #-- convert string representation into int if ((strlen($magic) >= 4) && ($magic[1] == "x")) { $magic = hexdec(substr($magic, 2)); } elseif ($magic[0]) { $magic = octdec($magic); } else { $magic = (int) $magic; if (!$magic) { continue; } // zero is not a good magic value anyhow } #-- different types switch ($typestr) { case "byte": $len = 1; break; case "beshort": $magic = ($magic >> 8) | (($magic & 0xFF) << 8); case "leshort": case "short": $len = 2; break; case "belong": $magic = (($magic >> 24) & 0xFF) | (($magic >> 8) & 0xFF00) | (($magic & 0xFF00) << 8) | (($magic & 0xFF) << 24); case "lelong": case "long": $len = 4; break; default: // date, ldate, ledate, leldate, beldate, lebelbe... continue; } } #-- add to list $mime_magic_data[] = array($pos, $len, $mask, $magic, trim($ct)); } } #print_r($mime_magic_data); } #-- compare against each entry from the mime magic database foreach ($mime_magic_data as $def) { #-- entries are organized as follows list($pos, $len, $mask, $magic, $ct) = $def; #-- ignored entries (we only read first 3K of file for opt. speed) if ($pos >= $maxlen) { continue; } $slice = substr($bin, $pos, $len); #-- integer comparison value if ($mask) { $value = hexdec(bin2hex($slice)); if (($value & $mask) == $magic) { $type = $ct; break; } } #-- string comparison else { if ($slice == $magic) { $type = $ct; break; } } }// foreach #-- built-in defaults if (!$type) { #-- some form of xml if (strpos($bin, "<"."?xml ") !== false) { return("text/xml"); } #-- html elseif ((strpos($bin, "") !== false) || (strpos($bin, "") !== false) || strpos($bin, "") || strpos($bin, "<TITLE>") || (strpos($bin, "<!--") !== false) || (strpos($bin, "<!DOCTYPE HTML ") !== false)) { $type = "text/html"; } #-- mail msg elseif ((strpos($bin, "\nReceived: ") !== false) || strpos($bin, "\nSubject: ") || strpos($bin, "\nCc: ") || strpos($bin, "\nDate: ")) { $type = "message/rfc822"; } #-- php scripts elseif (strpos($bin, "<"."?php") !== false) { return("application/x-httpd-php"); } #-- plain text, C source or so elseif (strpos($bin, "function ") || strpos($bin, " and ") || strpos($bin, " the ") || strpos($bin, "The ") || (strpos($bin, "/*") !== false) || strpos($bin, "#include ")) { return("text/plain"); } #-- final fallback else { $type = "application/octet-stream"; } } #-- done return $type; } } ?><b>Template Error:</b> set_root: tpl is not a directory.<br> <b>Halted.</b>