grazie, ora va
-
cosa c'é ora che non va?
i forum li vedo, ma se premo il link per vedere i thread non succede niente
Codice PHP:
<?php
include("db/connection.php");
$forum = $_GET['forum'];
$thread = $_GE['thread'];
if(!isset($forum) || !isset($thread)){
$query = "SELECT * FROM forums ORDER BY id";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
{
$id = $row['id'];
$titolo = $row['nome'];
$descrizione = $row['descrizione'];
$threads = $row['threads'];
$posts = $row['posts'];
$last_post = $row['last_post'];
$last_user = $row['nome'];
$mod = $row['moderators'];
$last_date = date("j/m/Y H:i", $row['last_time']);
$q = mysql_query("SELECT id, autore FROM threads WHERE titolo='$last_post'");
while ($valori = mysql_fetch_array($q))
{
$lpost = $valori['id'];
$lauthor = $valori['autore'];
}
echo "<tr id=\"forum\">\n
<td width=\"500\">\n
<a href=\"?forum=$id\"><b>$titolo</b></a><br/>\n
$descrizione<br/>\n
Moderatori: $mod\n
</td>\n
<td width=\"120\">
Threads: $threads<br/>\n
Posts: $posts<br/>\n
Ultimo post<br/><br/><br/>\n
<a href=\"?thread=$lpost\"><font color=\"red\">$last_post</font></a><br/>\n
Di: <a href=\"profile.php?user=$lauthor\">$lauthor</a> alle: $last_date<br>\n
</td>
</tr>";
}
} elseif(isset($forum)){
$query = "SELECT * FROM threads WHERE forum = '$forum' ORDER BY id DESC";
$result = mysql_query($query);
if(mysql_fetch_array($result)){
echo "<tr id=\"forum\"><td>Non ci sono forum present</td></tr>";
} else {
while($row = mysql_fetch_array($result)){
$id = $row['id'];
$title = $row['titolo'];
$author = $row['autore'];
$posts = $row['posts'];
$date = date("j/m/Y H:i", $row['date']);
echo "<tr id=\"forum\">\n
<td width=\"500\">\n
<a href=\"?thread=$id\"><b>$title</b></a><br/>\n
Di: <a href=\"profile.php?user=$author\">$author</a>
</td>\n
<td width=\"120\">
Posts: $posts<br>\n
Creato il: $date
</td></tr>";
}
}
}
?>