",$texte); $texte = ereg_replace("
*<","<",$texte); $titre = ucfirst($titre); $datelim = date("Y/m/d", mktime(date("H")+$hour_offset,date("i"),0,date("m"),date("d")-$jours,date("Y"))); $time = substr ("$date", -5); $rest = substr ("$date", 0, 10); list ($year, $month, $day) = split ("/", $rest); list ($hour, $min) = split (":", $time); //-----| format de date |--------------------------- $date1 = date("d/m/Y", mktime($hour + $hour_offset, $min, 0, $month, $day, $year)); //-----| début affichage des news |----------------- echo " "; $col_img = "\n"; echo $col_img; echo $col_spc; echo $col_txt; //-----| texte |------------------------------------ echo "\n"; echo "\n"; echo "
\n"; //-----| image |-------- if (!($image == '')) { if (!($imgurl == '')) $col_img .= "\n"; else $col_img .= "\n"; } $col_img .=""; //-----| separador |---------------------------- $col_spc = "\n"; //-----| fecha y titulo |---------------------------- $col_txt = ""; switch($auteur) { case "0": $col_txt .= "Campus de Mieres"; break; case "1": $col_txt .= "E.U. de Ingenierías Técnicas"; break; case "2": $col_txt .= "E.P.S. Guillermo Schutz"; break; case "3": $col_txt .= "Indurot"; break; case "4": $col_txt .= "Escuela Politécnica de Mieres"; break; } $col_txt .= " :: ".$date1."
".$titre."

\n"; //-----| texte |------------------------------------ $col_txt .= "".RepLink($texte)." ".$suite; $col_txt .= "

"; } echo "
\"inicio\" Ver todas las noticias

"; if($act == 1) { $double_query = "SELECT * from $table_comments WHERE titre='$titrec' AND comment='$comment'"; $double_resultat = Query($double_query); $test_double = mysql_num_rows($double_resultat); if($test_double > 0) { $ok = false; echo ""; echo "
"; echo "Este comentario ya ha sido enviado anteriormente
"; echo "Volver"; echo "

"; } elseif ($name == "" || $comment == "" || $titrec == "" || $mail == "") { $ok = false; echo ""; echo "
"; echo "Todos los campos son obligatorios!
"; echo "
Volver"; echo "

"; } elseif (!EmailOK($mail)) { $ok = false; echo ""; echo "
"; echo "Dirección de correo electrónico no válida!
"; echo "
Volver"; echo "

"; } else { if(!$ok) { $titrec = addslashes($titrec); $queryc1 = "INSERT INTO $table_comments VALUES ('','$id','$name','$mail','$titrec','$comment','$datepost','')"; $resultc1 = Query($queryc1); if($resultc1) { echo ""; echo "
"; echo "Gracias por tu aportación,
tu comentario será publicado una vez sea revisado."; echo "

"; } } } } else { echo ""; echo "
"; echo ""; echo "
"; $queryc = "select * from $table_comments WHERE id='$id' AND activc='1' order by datec"; $resultc = Query($queryc); while($val = mysql_fetch_array($resultc)) { $titrec = $val["titre"]; $idc = $val["idc"]; $datec = $val["datec"]; $activc = $val["activc"]; $comment = $val["comment"]; $mail = $val["mail"]; $name = $val["name"]; $comment = ereg_replace("\n","
",$comment); $comment = ereg_replace("
*<","<",$comment); $titrec = ucfirst($titrec); $timec = substr ("$datec", -5); $restc = substr ("$datec", 0, 10); list ($yearc, $monthc, $dayc) = split ("/", $restc); list ($hourc, $minc) = split (":", $timec); //-----| format de date |--------------------------- $datec1 = date("d/m/Y", mktime($hourc + $hour_offset, $minc, 0, $monthc, $dayc, $yearc)); //-----| date et titre |---------------------------- echo"

:: ".$datec1."
".stripslashes($titrec)." \n"; if (!($name == '') && !($mail == '')) echo "
enviado por: $name\n"; if (!($name == '') && ($mail == '')) echo "
enviado por: $name\n"; echo"
".stripslashes($comment)."

"; } } echo"
"; break; case "search": // rechercher des news if (isset($go)) { if ($find == "") { echo ""; echo "
"; echo "No ha especificado ninguna palabra para realizar la búsqueda
"; echo "
Volver"; echo "

"; } else { $operateur = "OR"; // OR AND if ($debut == "") $debut = 0; $limit = $npp; // on remplace les ' + , : par des espaces $mots = str_replace('+', ' ', trim($find)); $mots = str_replace('\'', ' ', $mots); $mots = str_replace(',', ' ', $mots); $mots = str_replace(':', ' ', $mots); // on passe les mots recherchés en minuscules $find1 = strtolower($find); // on remplace les ' + , : par des espaces $mots1 = str_replace('+', ' ', trim($find1)); $mots1 = str_replace('\'', ' ', $mots1); $mots1 = str_replace(',', ' ', $mots1); $mots1 = str_replace(':', ' ', $mots1); $mots = $mots; $mots .= " ".$mots1; // on place les differents mots dans un tableau $tab = explode(' ' , $mots); // on compte le nbr d'élément du tableau. $nb = count($tab); //on prépare la requête SQL. $sql = "select * from $table_news where 1 AND activ='1' and (texte like '%$tab[0]%' or titre like '%$tab[0]%')"; // // on boucle pour integrer tous les mots dans la requête for($i = 1; $i < $nb; $i++) { $sql .= " $operateur (texte like '%$tab[$i]%' or titre like '%$tab[$i]%')"; // $operateur } $sql2=$sql; $sql .= " LIMIT $debut,$limit"; // on execute la requête SQL. $result = Query($sql); $result2 = Query($sql2); if ($result) { if (mysql_num_rows($result) == 0) { // Si il n'y a pas de résultats echo ""; echo "
"; echo "No se han encontrado apuntes relativos a sus criterios de búsqueda
"; echo "
Volver"; echo "

"; } else { echo ""; echo "
Resultado(s) de la búsqueda:"; echo "

"; while($val = mysql_fetch_array($result)) { $titre = $val["titre"]; $id = $val["id"]; $date = $val["date"]; $texte = $val["texte"]; $auteur = $val["auteur"]; $autmail = $val["autmail"]; $image = $val["image"]; $image = ereg_replace(" ","%20",$image); $imgurl = $val["imgurl"]; $target = $val["target"]; $texte = ucfirst($texte); $texte = ereg_replace("\n","
",$texte); $texte = ereg_replace("
*<","<",$texte); $titre = ucfirst($titre); $datelim = date("Y/m/d", mktime(date("H"),date("i"),0,date("m"),date("d")-$jours,date("Y"))); $time = substr ("$date", -5); $rest = substr ("$date", 0, 10); list ($year, $month, $day) = split ("/", $rest); list ($hour, $min) = split (":", $time); //-----| format de date |--------------------------- $date1 = date("d/m/Y", mktime($hour + $hour_offset, $min, 0, $month, $day, $year)); echo " \n"; echo "\n"; echo ""; echo "
"; //-----| imagen |-------- if (!($image == '')) { if (!($imgurl == '')) echo (""); else echo (""); } echo ""; //-----| date et titre |---------------------------- for($i = 1; $i < $nb; $i++) { $titre = eregi_replace($tab[$i] , "".strtoupper($tab[$i])."", $titre); } switch($auteur) { case "0": $col_txt = "Campus de Mieres"; break; case "1": $col_txt = "E.U. de Ingenierías Técnicas"; break; case "2": $col_txt = "E.P.S. Guillermo Schutz"; break; case "3": $col_txt = "Indurot"; break; case "4": $col_txt = "Escuela Politécnica de Mieres"; break; } echo "\n"; echo "". $col_txt ." :: ".$date1."
".$titre."

\n"; //-----| texte |------------------------------------ if (strlen($texte) > $max_chars) { $suite = " ... continuar leyendo ++>>"; $texte1 = substr( $texte, 0, $max_chars ); $i = $max_chars; while( $texte[$i]!= " " && $i < strlen($texte)) $texte1 .= $texte[$i++]; $texte = $texte1; } else { unset($suite); } for($i = 1; $i < $nb; $i++) { $texte = eregi_replace($tab[$i] , "".strtoupper($tab[$i])."" , $texte); } echo "".RepLink($texte)." ".$suite; echo "


\"inicio\" Ver todas las noticias

"; } //----- début navigation ----- $nrows = mysql_num_rows($result2); $nombre = ceil($nrows/$limit); if($nombre > 1) { echo "
"; } if ($debut > 0) { echo "<< "; } if ($nombre > 1) { for($i = 1; $i <= $nombre; $i++) { if ($i == ceil($debut/$limit) +1 ) { echo " ".$i." "; } else { echo " ".$i." "; } echo "::\n"; } } if ( ($debut + $limit) < $nrows) { echo " >>"; } if($nombre > 1) { echo " total: $nrows noticias
"; } //----- fin navigation ----- mysql_free_result($result); } } } } break; default: if ($debut == "") $debut = 0; $limit = $npp; $query2 = "select * from $table_news". " WHERE activ='1' order by date desc"; $result2 = Query($query2); $query = $query2 . " Limit $debut,$limit"; $result = Query($query); while($val = mysql_fetch_array($result)) { $titre = $val["titre"]; $id = $val["id"]; $date = $val["date"]; $texte = $val["texte"]; $auteur = $val["auteur"]; $autmail = $val["autmail"]; $image = $val["image"]; $image = ereg_replace(" ","%20",$image); $imgurl = $val["imgurl"]; $target = $val["target"]; $activ = $val["activ"]; $texte = ucfirst($texte); $texte = ereg_replace("\n","
",$texte); $texte = ereg_replace("
*<","<",$texte); $titre = ucfirst($titre); $datelim = date("Y/m/d", mktime(date("H"),date("i"),0,date("m"),date("d")-$jours,date("Y"))); $time = substr ("$date", -5); $rest = substr ("$date", 0, 10); list ($year, $month, $day) = split ("/", $rest); list ($hour, $min) = split (":", $time); //-----| format de date |--------------------------- $date1 = date("d/m/Y", mktime($hour + $hour_offset, $min, 0, $month, $day, $year)); echo " "; $col_img = "\n"; echo $col_img; echo $col_spc; echo $col_txt; echo "\n"; echo "\n"; echo"
\n"; //-----| image |-------- if (!($image == '')) { if (!($imgurl == '')) $col_img .= "\n"; else $col_img .= "\n"; } $col_img .=""; //-----| separador |---------------------------- $col_spc = "\n"; //-----| fecha y titulo |---------------------------- $col_txt = ""; switch($auteur) { case "0": $col_txt .= "Campus de Mieres"; break; case "1": $col_txt .= "E.U. de Ingenierías Técnicas"; break; case "2": $col_txt .= "E.P.S. Guillermo Schutz"; break; case "3": $col_txt .= "Indurot"; break; case "4": $col_txt .= "Escuela Politécnica de Mieres"; break; } $col_txt .= " :: ".$date1."
".$titre."

\n"; //-----| texte |------------------------------------ if (strlen($texte) > $max_chars) { $suite = "... continuar leyendo ++>>"; $texte1 = substr( $texte, 0, $max_chars ); $i = $max_chars; while( $texte[$i]!= " " && $i < strlen($texte)) $texte1 .= $texte[$i++]; $texte = $texte1; } else { unset($suite); } $col_txt .= "".RepLink($texte)." ".$suite; $col_txt .= "

 
"; } //----- début navigation ----- $nrows = mysql_num_rows($result2); $nombre = ceil($nrows/$limit); if ($nombre > 1) { echo "
Pág. "; } if ($debut > 0) { echo "<< "; } if ($nombre > 1) { for($i = 1; $i <= $nombre; $i++) { if ($i == ceil($debut/$limit) +1 ) { echo " ".$i." "; } else { echo " ".$i." "; } echo "::\n"; } } if (($debut + $limit) < $nrows) { echo " >>"; } if ($nombre > 1) { echo " total: $nrows noticias

"; } //----- fin navigation ----- mysql_free_result($result); } //----- début du formulaire de recherche ----- echo "
Buscar en los archivos de noticias
 
"; //----- fin du formulaire de recherche ----- require ("footer.htm"); ?>