• Viernes 29 de Marzo de 2024, 15:36

Autor Tema:  ¿Cómo lo puedo solucionar? Unknown modifier  (Leído 1660 veces)

Game User

  • Nuevo Miembro
  • *
  • Mensajes: 2
    • Ver Perfil
¿Cómo lo puedo solucionar? Unknown modifier
« en: Lunes 25 de Junio de 2012, 21:16 »
0
¿Me podrían ayudar?
En el sistema de noticias de mi web, va bien insertar noticias, pero a la hora de leerlas...
leer.php:
<?php

function bbcode($text){
   $a = array(
      "/\[i\](.*?)\[\/i\]/is",
      "/\[b\](.*?)\[\/b\]/is",
      "/\[u\](.*?)\[\/u\]/is",
     "/\[s\](.*?)\[\/s/\]/is",
     "/\[center\](.*?)\[\/center\]/is",
     "/\[align=left\](.*?)\[\/align\]/is",
     "/\[align=right\](.*?)\[\/align\]/is",
      "/\[img\](.*?)\[\/img\]/is",
     "/\[img=(.*?)\]/is",
      "/\[youtube\](.*?)\[\/youtube\]/is",
      "/\(.*?)\[\/url\]/is",
     "/\[url\](.*?)\[\/url\]/is",
     "/\[quote\](.*?)\[\/quote\]/is",
     "/\[code\](.*?)\[\/code\]/is"
   );
   $b = array(
      "<i>$1</i>",
      "<b>$1</b>",
      "<u>$1</u>",
     "<strike>$1</strike>",
     "<p align=\"center\">$1</p>",
     "<p align=\"left\">$1</p>",
     "<p align=\"right\">$1</p>",
      "<img src=\"$1\" />",
     "<img src=\"$1\" />",
     "<object width=\"425\" height=\"344\"><param name=\"movie\" value=\"$1\"></param><param name=\"allowFullScreen\" value=\"true\"></param><param name=\"allowscriptaccess\" value=\"always\"></param><embed src=\"$1\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"425\" height=\"344\"></embed></object>",

         "<a href=\"$1\" target=\"_blank\">$2</a>",
         "<a href=\"$1\" target=\"_blank\">$1</a>",
      "<div class=\"textoCita\">Cita:\n<div class=\"cita\">$1</div></div>",
      "<div class=\"textoCodigo\">C&oacute;digo:\n<div class=\"codigo\">$1</div></div>"
   );
   $text = str_replace("<br \>","\n",$text);
   $text = preg_replace($a, $b, $text);
   $text = str_replace("watch?v=","v/",$text);
   return $text;
}
?>

<html>
<head>
<title>Leer noticia</title>
<link href="include/css.css" type="text/css" rel="stylesheet" />
</head>
<body>
<?php
//incluimos archivo de conexion
require("include/conexion.php");
if (isset($_GET['ID'])) {
$ID = $_GET['ID'];
//cogemos datos de la base
$select = mysql_query("select * from not_bn where ID = $ID order by ID desc", $conectar)or die("Fallo el select: ".mysql_error());
//los mostramos
while($not = mysql_fetch_array($select)){
//Mostramos el titulo de la noticia
echo "<h1 style=\"text-transform:uppercase;margin-bottom:2px;margin-top:0px;\">".$not['titulo']."</h1>";
//mostramos el contenido de la noticia
echo bbcode(nl2br(htmlspecialchars($not['noticia'])))."";
echo "<p>";
// la fecha y otros datos
echo "Enviado el ".$not['fecha']." a las ".$not['hora']."";
}
}else{
echo "Error!";
}
?>

Me sale este error:
Warning: preg_replace() [function.preg-replace]: Unknown modifier '\' in /home/u122160329/public_html/leer.php on line 38

Agradeceria mucho su ayuda.