PHP Code:
<?php
$mysql_host = "localhost";
$mysql_user = "alfredoc";
$mysql_senha = "password";
$mysql_db = "Forum";
$mostrar = 10; //Links to show
$letras = 32; //Max letters of topic title
$sufixo = "..."; //Title sufix
$link_forum = "http://forum.systemgunz.com"; //Your forum link
$tbl_prefixo = "ibf_"; //Your forum table prefix
$mysql_conexao = @mysql_connect($mysql_host, $mysql_user, $mysql_senha) or die("Erro ao conectar-se ao fórum");
$mysql_selecao = @mysql_select_db($mysql_db,$mysql_conexao) or die("Erro ao Selecionar Banco de Dados");
$query = mysql_query("SELECT last_poster_name, last_poster_id, title, tid, forum_id, last_post FROM " . $tbl_prefixo . "topics WHERE forum_id = 4 OR forum_id = 20 OR forum_id = 19 AND forum_id != 7 ORDER BY last_post DESC LIMIT 0, " . $mostrar);
while($tpf = mysql_fetch_array($query))
{
if ($letras != 0)
{
if(strlen($tpf[title]) > $letras)
{
$titulo = substr($tpf[title], 0, $letras) . $sufixo;
}
else
{
$titulo = $tpf[title];
}
}
else
{
$titulo = $tpf[title];
}
echo "<a href=\"$link_forum/index.php?showtopic=$tpf[tid]&view=getnewpost\" target=\"_blank\" title=\"$titulo\">$titulo</a><br />\n";
}
?>