function showthread($id, $start) { $query = doquery("SELECT * FROM {{table}} WHERE id='{$id}' OR parent='{$id}' ORDER BY id LIMIT {$start},15", "forum"); $query2 = doquery("SELECT title FROM {{table}} WHERE id='{$id}' LIMIT 1", "forum"); $row2 = mysql_fetch_array($query2); $page = "<table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><td colspan=\"2\" style=\"background-color:#dddddd;\"><b><a href=\"forum.php\">Forum</a> :: " . $row2["title"] . "</b></td></tr>\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "<tr><td width=\"25%\" style=\"background-color:#ffffff; vertical-align:top;\"><span class=\"small\"><b>" . $row["author"] . "</b><br /><br />" . prettyforumdate($row["postdate"]) . "</td><td style=\"background-color:#ffffff; vertical-align:top;\">" . nl2br($row["content"]) . "</td></tr>\n"; $count = 2; } else { $page .= "<tr><td width=\"25%\" style=\"background-color:#eeeeee; vertical-align:top;\"><span class=\"small\"><b>" . $row["author"] . "</b><br /><br />" . prettyforumdate($row["postdate"]) . "</td><td style=\"background-color:#eeeeee; vertical-align:top;\">" . nl2br($row["content"]) . "</td></tr>\n"; $count = 1; } } $page .= "</table></td></tr></table><br />"; $page .= "<table width=\"100%\"><tr><td><b>Reply To This Thread:</b><br /><form action=\"forum.php?do=reply\" method=\"post\"><input type=\"hidden\" name=\"parent\" value=\"{$id}\" /><input type=\"hidden\" name=\"title\" value=\"Re: " . $row2["title"] . "\" /><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br /><input type=\"submit\" name=\"submit\" value=\"Submit\" /> <input type=\"reset\" name=\"reset\" value=\"Reset\" /></form></td></tr></table>"; display($page, "Forum"); }
function showthread($id, $start) { global $userrow; $query = doquery("SELECT * FROM {{table}} WHERE id='{$id}' OR parent='{$id}' ORDER BY id LIMIT {$start},15", "forum"); $query2 = doquery("SELECT title FROM {{table}} WHERE id='{$id}' LIMIT 1", "forum"); $row2 = mysql_fetch_array($query2); $page = "<center><table width=\"100%\"><tr><td width=\"100%\" align=\"center\"><center><img src=\"images/title_forum.gif\" /></center></td></tr></table></center><table width=\"100%\"><tr><td style=\"padding:1px; background-color:black;\"><table width=\"100%\" style=\"margins:0px;\" cellspacing=\"1\" cellpadding=\"3\"><tr><td colspan=\"3\" style=\"background-color:#452202;\"><font color=\"white\"><center>Tópico e Respostas</center></font></td></tr><tr><td colspan=\"2\" style=\"background-color:#E4D094;\"><b><a href=\"forum.php\">Início</a> <img src=\"images/seta.gif\"> " . $row2["title"] . "</b></td></tr>\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { //cor das msgs $userquery2 = doquery("SELECT * FROM {{table}} WHERE charname='" . $row['author'] . "' LIMIT 1", "users"); $userpara = mysql_fetch_array($userquery2); if ($userpara["authlevel"] == 1) { $link = " id=\"adm\" "; $cor = "<font color=\"green\">"; $cor2 = "</font>"; } elseif ($userpara["acesso"] == 2) { $link = " id=\"tutor\" "; $cor = "<font color=\"orange\">"; $cor2 = "</font>"; } elseif ($userpara["acesso"] == 3) { $link = " id=\"gm\" "; $cor = "<font color=\"blue\">"; $cor2 = "</font>"; } else { $link = ""; $cor = ""; $cor2 = ""; } if ($userrow['authlevel'] == 1 || $userrow['acesso'] == 3) { $linkdeletar = " <a href=\"javascript: yesorno('vermelho', 'Deletar Resposta?', 'forum.php?do=deletar:" . $row['id'] . "', 'javascript: fecharexplic()');\" title=\"Deletar Resposta\" id=\"vermelho\">x</a>"; } $page .= "<tr><td width=\"25%\" style=\"background-color:#FFF1C7; vertical-align:top;\"><span class=\"small\"><b>{$cor}<a {$link} href=\"javascript: opcaochar('" . $row["author"] . "');\">" . $row["author"] . "</a>{$cor2}{$linkdeletar}</b><br />" . prettyforumdate($row["postdate"]) . "</td><td style=\"background-color:#FFF1C7; vertical-align:top;\">" . nl2br($row["content"]) . "</td></tr>\n"; $count = 2; } else { //cor das msgs $userquery2 = doquery("SELECT * FROM {{table}} WHERE charname='" . $row['author'] . "' LIMIT 1", "users"); $userpara = mysql_fetch_array($userquery2); if ($userpara["authlevel"] == 1) { $link = " id=\"adm\" "; $cor = "<font color=\"darkgreen\">"; $cor2 = "</font>"; } elseif ($userpara["acesso"] == 2) { $link = " id=\"tutor\" "; $cor = "<font color=\"darkorange\">"; $cor2 = "</font>"; } elseif ($userpara["acesso"] == 3) { $link = " id=\"gm\" "; $cor = "<font color=\"darkblue\">"; $cor2 = "</font>"; } else { $link = ""; $cor = ""; $cor2 = ""; } if ($userrow['authlevel'] == 1 || $userrow['acesso'] == 3) { $linkdeletar = " <a href=\"javascript: yesorno('vermelho', 'Deletar Resposta?', 'forum.php?do=deletar:" . $row['id'] . "', 'javascript: fecharexplic()');\" title=\"Deletar Resposta\" id=\"vermelho\">x</a>"; } $page .= "<tr><td width=\"25%\" style=\"background-color:#FFF1C7; vertical-align:top;\"><span class=\"small\"><b>{$cor}<a {$link} href=\"javascript: opcaochar('" . $row["author"] . "');\">" . $row["author"] . "</a>{$cor2}{$linkdeletar}</b><br />" . prettyforumdate($row["postdate"]) . "</td><td style=\"background-color:#FFF1C7; vertical-align:top;\">" . nl2br($row["content"]) . "</td></tr>\n"; $count = 1; } } $page .= "</table></td></tr></table><br />"; $page .= "<table width=\"100%\"><tr><td><b>Responder esse Tópico:</b><br /><form action=\"forum.php?do=reply\" method=\"post\"><input type=\"hidden\" name=\"parent\" value=\"{$id}\" /><input type=\"hidden\" name=\"title\" value=\"Re: " . $row2["title"] . "\" /><textarea name=\"content\" rows=\"7\" cols=\"40\"></textarea><br /><input type=\"submit\" name=\"submit\" value=\"Enviar\" /> <input type=\"reset\" name=\"reset\" value=\"Apagar\" /></form></td></tr></table>"; display($page, "Forum"); }