Foros del Web » Programando para Internet » PHP »

Problema al mostrar noticias del foro a la Web con Forumnews

Estas en el tema de Problema al mostrar noticias del foro a la Web con Forumnews en el foro de PHP en Foros del Web. Hola a todos, Despues de investigar en todos los temas, no he podido encontrar solución a mi duda, os la dejo a ver si alguien ...
  #1 (permalink)  
Antiguo 18/01/2010, 15:12
 
Fecha de Ingreso: enero-2010
Mensajes: 4
Antigüedad: 14 años, 3 meses
Puntos: 0
Hola a todos,

Despues de investigar en todos los temas, no he podido encontrar solución a mi duda, os la dejo a ver si alguien puede ayudarme por favor.

Gracias de antemano.

Mi problema:

Tengo un foro y una web alojados en el mismo host, cuando pongo una noticia en el foro aparece en la web gracias a forumnews, en el index tengo un incluide que muestra miweb/noticias/forumnews.php.

En la carpeta de fourmnews tengo editada la tabla a mi gusto pero cuando muestra un mensaje del foro no me aparecen las imágenes, las negritas…es decir, el bbcode no me lo pasa a HTML, simplemente me muestra el código en bbcode del foro, en el foro lógicamente si se muestra la negrita, imágenes, etc.

Aquí están las imágenes del foro y como queda en al web

En el foro escribo esto:



Y en al web me muestra esto:



En vez de salir web en engrita en la web, sale esto: [b:905f02f7d4]queráis[/b:905f02f7d4]


El archivo que tengo que editar creo que es el funcs.php que lo tengo en la carpeta forumnews junto al archivo forumnews.php y junto a otros archivos, que son estos:





En codigo de funcs.php es este:


Código PHP:
<?
/*

  funcs.php,v 1.1 2004/07/24 05:31:09 philb Exp

  funcs.php - Functions file
  -- seepies.net Forumnews --

  (Name is a work in progress ;))

  This file contains all the functions, conditions on
  changing any of this are below.

  This work is copyrighted to Phil Barbier (c) 2003 - 2004.
  Please do not copy this without permission to the author.
  Also, please do not edit/alter the core code and do not
  distribute this software without permission from the author.
  
  If you want to change anything, just drop me an e-mail with details
  and an explanation so that I can perhaps extend the software further.

  Don't be scared to ask, I'm only human ;) I just want to keep
  track of this :) Thanks.

  Phil Barbier - [email protected]  

*/

require_once("config.php");

if(!isset(
$dbsystem)) {

  
// can't carry on - can't assume this one

  
print "Database type not selected in your configuration, please correct this.";

  exit;

}

if (
$dbsystem != "mysql" && $dbsystem != "postgres" && $dbsystem != "access") {

  
// Can't process any other db type either atm.
  
print "Invalid database type selected, please correct this in your configuration.";
  exit;

}

if (
$dbsystem == "postgres") {

  require(
"db/pgsql.php");

} elseif (
$dbsystem == "mysql") {

  require(
"db/mysql.php");

} elseif (
$dbsystem == "access") {

  require(
"db/access.php");

}

if (
$dbconn == false) {

  
// Can't carry on here either.

  
print "Database connection error";
  exit;

}

// Set some sensible boundaries on the number of posts to get

if ($numposts 10) {

  
$numposts 10;

} elseif(
$numposts 0) {

  
$numposts 5;

}

// OK, we've got a database handler and things are going well...
// Time to introduce specific forum variables into the relationship

if ($forumtype == "phpbb") {

  require(
"phpbb.php");

} elseif (
$forumtype == "ib") {

  require(
"ib.php");

} else {

  
// Action stations, no supported forum entered!
  
  
print "<br><font color=\"#FF0000\">Error: no supported forum entered, please correct your <b>config.php</b> and try again.</font><br>";
  exit;

}


// OK, now to set some globals

// Firstly, the support forum URL that we want
// everyone to go to for any support issues (outlined in readme)

define("supporturl""http://www.seepies.net/forum/viewforum.php?f=4");

// version no

define("versioninfo""1.1");

// date formats

define("datefmt"$datestring);

/********************************************

Function to print out a formatted array

********************************************/

function debug_array($a) {

  if (
is_array($a)) {

    print 
"<br /><pre>";
    
print_r($a);
    print 
"</pre><br />";
    
  } else {
  
    print 
"<br />" $a " is not an array.<br />";
    
  }
  
}

/*******************************************

Function to check if a variable is empty,
set, null or an empty string

********************************************/

function check_empty($v) {

  if(empty(
$v) || $v == "" || !isset($v) || is_null($v)) {
  
    return 
true;
    
  } else {
  
    return 
false;
    
  }

}

/******************************************

Function to help debug a function that
uses SQL

********************************************/

function debug_sqlfnc($sql$dberr) {

  print 
"<br /><br /><pre>error: " $dberr "<br />";
  print 
"SQL is: " $sql;
  print 
"</pre><br /><br />";
  
}

// by now, we should be able to allow queries to the database, so... :)

function getlastposts($postno) {

  global 
$dbconn$forumid$firstlast$dbsystem;
  
  
$sql $GLOBALS['sql'];
  
  
// Below is handy for debugging

  // print "executing SQL: " . $sql;

  
$queryresult doquery($sql$dbconn);

  if (
$queryresult) {
  
    
$posts getresults($queryresult);
    
    return 
$posts;
  
  } else {

    return 
$queryresult;

  }
  
  
// closedb($dbconn);

}

function 
fmt_date($str$datestr) {

  return 
date($datestr$str);

}

function 
get_post_text($sp$ftext$pid) {

  if (
strlen($ftext)<=$sp) {
  
    
$spos strlen($ftext);
    
$ftext substr($ftext0$spos);
  
  } else {
  
    
$spos strpos($ftext" "$sp);
    
$ftext substr($ftext0$spos) . " <a href=\"" gettopicurl($pid) . "\">(cont...)</a>";
    
  }
  
  
// $ftext = addurls($ftext);  
  
$ftext nl2br($ftext);
  
  return 
$ftext;
  
}

function 
addurls($post) {

  
$strstart strpos($post"http://");

  
$strend $strstart strpos(substr($post$strstart), " ");
  
//$strend = $strstart + strpos(substr($post, $strstart), "]");

  
$url substr($post$strstart$strend $strstart);

  
$badpos strpos($url"]");

  if (
$badpos) {
  
    
$url substr($url0$badpos);
          
  }

  
$post str_replace($url"<a target=\"_blank\" href=\"$url\">$url</a>"$post);

  return 
$post;

}

/*
function addurls($post) {

  $post = preg_replace("#([\t\r\n ])([a-z0-9]+?){1}://([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1<a href="\2://\3" target="_blank">\2://\3</a>', $post);

  $post = preg_replace("#([\t\r\n ])(www|ftp)\.(([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)#i", '\1<a href="http://\2.\3" target="_blank">\2.\3</a>', $post);
  
  return $post;

}
*/

?>
alguien puede decirme que tengo que añadir para que en la web me sustituya el BBCODE por el HTMl, he probado varios codigos pero no me funciona.

Como veo que nadie contesta, hago otra pregunta:

en vez de hacer que en la web me muestre el bbcode en html, se puede hacer que en el foro se permita escribir en html en vez de bbcode?

Gracias, un saludo.

Última edición por GatorV; 19/01/2010 a las 11:06

Etiquetas: foros
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 10:59.