// // This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License. // // To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/1.0/ // // or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. // // Francais (brouillon): http://creativecommons.org/projects/international/fr/translated-license // ////////////////////////////////////////////////////////////////////////////////////////////////////// // Gestion des Erreurs // v0.1.0 $cfg = $GLOBALS[cfg]; if(!function_exists('str_split')) { function str_split($str, $length = 1) { if (!is_string($str)|| !is_numeric($length) || $length == 0) return FALSE; $strArr = array(); for ($i = 0; $i < strlen($str); $i += $length) { if (strlen(substr($str, $i)) < $length) $strArr[] = substr($str, $i); else $strArr[] = substr($str, $i, $length); } return $strArr; } } if($statut == "FORBIDDEN" || $statut == "NOT_ALLOWED") header("HTTP/1.0 403 Forbidden"); elseif($statut == "NO_JOURNAL" || $statut == "NOT_FOUND") header("HTTP/1.0 404 Not Found"); else header("HTTP/1.0 200 OK"); echo ' Erreur - '.$cfg[titre].'

Erreur

'; if($statut == "NO_JOURNAL") { echo "

Il n'y a pas de journal à cette adresse.

"; $ids = str_split($id); $ids = implode("%",$ids); $req = "SELECT id,titre FROM journaux WHERE (statut='public' OR statut='collectif') AND id LIKE '%".$ids."%' ORDER BY id"; $res = mysql_query($req); if(mysql_num_rows($res) > 0) echo "

Peut-être cherchez-vous un de ces journaux?

"; } elseif($statut == "FORBIDDEN") { echo "

L'accès à ce journal est interdit.

"; } elseif($statut == "NOT_FOUND") { echo "

Il n'y a pas de page à cette adresse.

"; } elseif($statut == "NOT_ALLOWED") { echo "

Vous n'êtes pas autorisé à lire ce journal.

"; } elseif($statut == "NO_MESSAGE") { echo '

Il n\'y a aucun message dans ce forum.

'; } echo '
'.str2html($cfg[titre]).'
'; //echo "
";
//print_r($GLOBALS);

?>