Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/10/2008, 12:41
[G]aRRiGa!
 
Fecha de Ingreso: octubre-2005
Mensajes: 59
Antigüedad: 18 años, 7 meses
Puntos: 0
No me funciona el block (php-nuke) de scroll últimos mensajes

Pues bueno amigos, he intentado poner el block de Últimos mensajes en mi web php-nuke www.elnastic.com y cada vez que lo activo me da error la página, solo me cargan los bloques de la izquierda.

Aquí teneis el de block-forums.php que viene de serie que sí que va bien:
<?php

if (eregi("block-Forums.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

****** $prefix, $db, $sitename;

$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"20\" onmouseover='this.stop()' onmouseout='this.start()'>";
$result = $db->sql_query("SELECT forum_id, topic_id, topic_title FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT 20");
while ($row = $db->sql_fetchrow($result)) {
$forum_id = intval($row['forum_id']);
$topic_id = intval($row['topic_id']);
$topic_title = $row['topic_title'];
$row2 = $db->sql_fetchrow($db->sql_query("SELECT auth_view, auth_read FROM ".$prefix."_bbforums WHERE forum_id='$forum_id'"));
$auth_view = intval($row2['auth_view']);
$auth_read = intval($row2['auth_read']);
if (($auth_view < 2) OR ($auth_read < 2)) {
$content .= "<img src=\"modules/Forums/templates/subSilver/images/icon_mini_message.gif\" border=\"0\" alt=\"\" title=\"\">&nbsp;<a href=\"modules.php?name=Forums&amp;file=viewtopic& amp;t=$topic_id\">$topic_title</a><br>";
}
}

?>


Y el que me da error es este (he quitado el copyright para colgarlo en el foro, xq son bastantes lineas):
<?php

if (eregi("block-Forums.php", $_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}

****** $prefix, $dbi, $sitename, $user, $cookie, $group_id;
$count = 1;
$content = "<A name= \"scrollingCode\"></A>";
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"20\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Ultimos 20 Mensajes en el Foro</b></center>";
$result1 = sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id and f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT 20", $dbi);
$content .= "<br>";
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_name, $forum_id) = sql_fetch_row($result1, $dbi)) {
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);

$result3 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result3, $dbi);

$topic_title=parseEmoticons($topic_title);
// Remove the comment below to add the counter
//$content .="<STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Message: $count<br></b>";

$content .= "<img src=\"modules/Forums/templates/subSilver/images/icon_mini_message.gif\" border=\"0\" alt=\"\"><a href=\"modules.php?name=Forums&amp;file=viewtopic& amp;p=$topic_last_post_id#$topic_last_post_id\"STY LE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#666666\"><i>Ultimo post de <A HREF=\"modules.php?name=Forums&file=profile&mode=v iewprofile&u=$user_id\"STYLE=\"text-decoration: none\"> $username </a> en <a href=\"modules.php?name=Forums&amp;file=viewforum& amp;f=$forum_id\">$forum_name</a> on $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "<br><center>[ <a href=\"modules.php?name=Forums\"STYLE=\"text-decoration: none\">$sitename ]</center>";
?>


No consigo encontrar el error, pero creo que estaba por aquí:
$result1 = sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id and f.auth_view=0 ORDER BY t.topic_last_post_id DESC LIMIT 20", $dbi);

A ver si me podéis ayudar, un saludo.