|
|
ibm
Registrad@


Registrado: Apr 22, 2003
Mensajes: 9

|
Problema con el scroll de los foros Help
Este es el codigo q me he bajado y he modificado parte para q me funcione, tengo dos problemas, uno que no me muestro wel usuario que ha puesto el post ni tampoco el dia y segundo que cuando te aparecen los post en el scrool el link se va contra el last_post_id y no contra el post_id y por lo tanto se me va a otro mensaje.Echadme una mano.
Gracias
if (eregi("block-Forums-scroll.php", $PHP_SELF)) {
Header("Location: index.html");
die();
}
include_once ('blocks/smileys.php');
global $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 10 post del foro</b></center>";
$result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM `phpbb_topics`".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT 10", $dbi);
$content .= "<br>";
while(list($topic_id, $topic_last_post_id, $topic_title) = 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 'phpbb_posts'".$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 uname, uid FROM 'phpbb_users'".$prefix."_users where uid='$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>Post: $count<br></b>";
$content .= "<img src=\"phpbb2/templates/subSilver/images/icon_mini_message.gif\" border=\"0\"alt=\"\"><a href=\"http://localhost/phpbb2/viewtopic.php?t=$topic_last_post_id#$topic_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#666666\"><i>Ultimo post de <A HREF=\"http://localhost/phpbb2/profile.php?mode=viewprofile&u='$user_id'\"STYLE=\"text-decoration: none\"> $username </a> on $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "<br><center>[ <a href=\"gate.html?name=Foro\"STYLE=\"text-decoration: none\">$sitename ]</center>";
$content .= "<center><img src=\"images/banners/fatalexception-logo-88x31.gif\" border=\"0\"></center>
</a>";
?>
|
Dom Jun 15, 2003 5:51 pm |
|
|
panzher
Administrador


Registrado: Jan 29, 2003
Mensajes: 1034

|
A ver si me aclaro:
CITA: $result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title FROM `phpbb_topics`".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT 10", $dbi);
Por lo que se ve, tus tablas no son del tipo "nuke_", sino que has instalado el foro en distintas tablas, ya que no estas usando el prefijo tipico "nuke"
Lo que veo raro, es que en una consulta de resultados, estas mezclando llamadas a tablas tipo "phpbb", con las tipicas nuke.
Mira aqui:
CITA: $result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM 'phpbb_posts'".$prefix."_bbposts where post_id=$topic_last_post_id", $dbi);
En esta linea, donde pones
CITA: FROM 'phpbb_posts'".$prefix."_bbposts
ahi me pierdo.
¿Quieres hacer una consulta de la tabla "phpbb_post"? o de la "nuke_bbpost"?.
Si usas 2 tablas distintas, dudo que te funcione.
Seguramente si esto lo dejas asi:
CITA: $result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time FROM 'phpbb_posts' where post_id=$topic_last_post_id", $dbi);
Tendra mas sentido.
CITA: $result3 = sql_query("SELECT uname, uid FROM 'phpbb_users'".$prefix."_users where uid='$poster_id'", $dbi);
En esta le veo el mismo fallo.
Lo demas mas o menos creo que esta bien.
A ver si te sirve de ayuda. Un saludooo 
|
Lun Jun 16, 2003 1:42 pm |
|
|
|
|
|
|
|
|
|