Good evening I have this code in PHP that serves to list the latest topics in a forum (IPBOARD):
<?php
// CONFIGURAÇÕES DE CONEXÃO
$connect = mysql_connect("localhost","root","senha") or die (mysql_error());
$select = mysql_select_db("forum") or die(mysql_error());
// URL DO FÓRUM
$url = "http://endereço do forum/";
// LIMITE DE LINKS QUE IRÃO APARECER
$limit = 5;
// ID DO FóRUM QUE DESEJA LISTAR OS TÓPICOS
$forumid = 2;
// SELECIONANDO TÓPICOS E ORDENANDO PELA DATA
$sql = "SELECT * FROM `topics` WHERE `forum_id` = '$forumid' ORDER BY `start_date` DESC LIMIT $limit";
// EXECUTANDO A QUERY
$query = mysql_query($sql) or die (mysql_error());
// EFETUANDO LOOP PARA LISTAR OS TÓPICOS
while($row = mysql_fetch_array($query)){
// DATA DE POSTAGEM
$data = date( 'd/m', $row['start_date']);
// ID DO TÍTULO EXIBIDO NO LINK
$tid = $row['tid'];
// TÍTULO DO TÓPICO
$title = $row['title'];
// TÍTULO EXIBIDO NO LINK
$titleid = $row['title_seo'];
// CONSTRUINDO TABELA PARA ORDENAR A EXIBIçÃO
echo "<table border='0'>";
echo "<td><span style='margin-left: 10px; font:bold 12px arial, verdana, tahoma; letter-sp acing:-1.1px; color:#AD00FF;'>".substr( $data , 0 , 5 )."</span></td>";
// EXIBINDO TÍTULO DO TÓPICO COM LINK
echo "<td><a href='".$url."index.php?/topic/".$tid."-".$titleseo."' target='_self' class=' link-news'>".$title."</a></td>";
//FECHANDO TABELA
echo "</table>";
}
?>
I made this other code based on the above, it pulls the information from the database, but I am not knowing how to make it list the topics as in the code above. I think I have to convert it to PHP to list.
<link rel="stylesheet" type="text/css" href="./content.css">
<div class="boxBody">
<div id="homeNews">
<span class="ntype t-new"></span>
<img src="icon.fw.png" alt=""> <span class="title"> <?php echo "<td><a href='".$url."index.php?/topic/".$tid."-".$titleseo."' target='_self' class='link-news'>".$title."</a></td>"; ?></span>
<span class="date"><?php echo "<td><span>".substr( $data , 0 , 5 )."</span></td>"; ?></span>
</div>
<a href="http://" class="iconLink" style="opacity: 0.8;">Ver noticias anteriores</a>
</div>
Please help me! I know that those who understand that PHP is easy.