Hola amigos lamento que mi primer post sea para pedir ayuda pero es que la verdad en ningun lugar he encontrado la solucion espero me puedan ayudar Lo que pasa es que en mi web http://manganix.animeplanet.tyreus.com acabo de poner un foro phpbb3 y en el foro tengo un foro dedicado a las descargas de anime y manga, entonces lo que quisiera es que en la pag principal o index me muestre los post o temas que se han creado solamente en el foro de mangas o en el foro de anime no se si me explico.
por ejemplo en esta web ya lo tengo http://manganix.xtreemhost.com (pero ahi tengo el phpbb2 y ahora que me estoy mudando de host, tengo el phpbb3 pero no me sirve el mismo codigo que tenia antes.
este es el codigo que tengo pero para phpbb2 el que tengo en el antiguo host
(por cierto si alguien lo quiere para mostrar los post de solamente un foro y no de todo ahi se los dejo XD solo cambien esto forum_id='24' por el id del foro a mostrar.)Código PHP:
<?php
//cantidad de topicos que van a salir
$cantidad = "10";
//url de tu foro actual
$foroUrl = "foro";
//conexion a tu base de datos
$conexion = mysql_connect("localhost","darkfox","xxxxxxxx");
mysql_select_db("darkfox_phpb1",$conexion);
//query
$sql = "SELECT topic_id, forum_id, topic_title, topic_time FROM phpbb_topics where forum_id='24' ORDER BY topic_time DESC LIMIT $cantidad";
$query = mysql_query($sql);
$topic_number = 1;
while($result = mysql_fetch_array($query))
{
//para que los topicos no salgan con mas de 50 caracteres
$titulo = substr(stripslashes($result[topic_title]),0,25);
//pueden modificar este echo no es necesario tener el font ni nada de eso si usas CSS
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td bgcolor='2D2D2D'><strong>·
$topic_number:</strong> <a title='$result[topic_title]'
href='$foroUrl/viewtopic.php?t=$result[topic_id]&sid=$result[forum_id]'
target=_blank>$titulo</a></td>
</tr>
</table><br>";
$topic_number++;
}
mysql_close($conexion);
?>
Pero ese no me muestra nada y pienso que es por que ahora tengo el phpbb3.
Viendo por ahi encontre que este muestra los post del phpbb3.
pero me tira este error.Código PHP:
<?
$directorio = "foro";
$mostrar = "10";
$caracteres = "25";
include("$directorio/config.php");
echo "";
$conexion = mysql_connect($dbhost,$dbuser,$dbpasswd);
mysql_select_db($dbname,$conexion);
$consulta = "select * from ".$table_prefix."posts order by post_time desc";
$resultado = mysql_query($consulta);
$i = 0;
while ($rows = mysql_fetch_array($resultado)) {
if ($i <= $mostrar) {
$consulta1 = "select * from ".$table_prefix."forums where forum_id='25'";
$resultado1 = mysql_query($consulta1);
$datosf = mysql_fetch_array($resultado1);
#
$consulta3 = "select * from ".$table_prefix."topics where topic_id='$rows[topic_id]'";
$resultado3 = mysql_query($consulta3);
$datost = mysql_fetch_array($resultado3);
if (strlen($datost[topic_title]) > $caracteres) {
$datost[topic_title] = substr($datost[topic_title],0,20)."...";
}
echo "
<b>$datosf[forum_name]</b><br><a href=\"$directorio/viewtopic.php?t=$rows[topic_id]\" style=\"padding-left:15px\">$datost[topic_title]</a></td>
<b>$replys</b>";
$i++;
}
}
echo "";
mysql_free_result($resultado);
mysql_close($conexion);
?>
la verdad no se mucho de php pero pues picando aqui moviendo haya, he podido modifcar un poco los script de php pero este de plano no quiere XD, no se si sean tan amables y me puedan ayudar a encontrar el problema de por que me tira este error, o decirme que es lo que falla para modifcarloNotice: Use of undefined constant topic_title - assumed 'topic_title' in /home/darkfox/public_html/manganix/index.php on line 1189
Notice: Undefined variable: replys in /home/darkfox/public_html/manganix/index.php on line 1195
Manga en DD
Mai Favorite [06/06]
Notice: Use of undefined constant topic_title - assumed 'topic_title' in /home/darkfox/public_html/manganix/index.php on line 1189
Notice: Undefined variable: replys in /home/darkfox/public_html/manganix/index.php on line 1195
Manga en DD
Love Selection [11/11]
Notice: Use of undefined constant topic_title - assumed 'topic_title' in /home/darkfox/public_html/manganix/index.php on line 1189
Notice: Use of undefined constant topic_title - assumed 'topic_title' in /home/darkfox/public_html/manganix/index.php on line 1190
Notice: Use of undefined constant topic_title - assumed 'topic_title' in /home/darkfox/public_html/manganix/index.php on line 1190
Notice: Undefined variable: replys in /home/darkfox/public_html/manganix/index.php on line 1195
Manga en DD
Because I'm The Godd...
Notice: Use of undefined constant topic_title - assumed 'topic_title' in /home/darkfox/public_html/manganix/index.php on line 1189
Notice: Use of undefined constant topic_title - assumed 'topic_title' in /home/darkfox/public_html/manganix/index.php on line 1190
Notice: Use of undefined constant topic_title - assumed 'topic_title' in /home/darkfox/public_html/manganix/index.php on line 1190
Notice: Undefined variable: replys in /home/darkfox/public_html/manganix/index.php on line 1195
Manga en DD
Go! Tenba Cheerleade...
Notice: Use of undefined constant topic_title - assumed 'topic_title' in /home/darkfox/public_html/manganix/index.php on line 1189
saludos y gracias de antemano.
Marcadores