I’ve been working on this for a while, and have nearly finished.
Only one slight problem heh.
I’m trying to code it so as all the forums, and all the threads, and the thread selected can be displayed all on one page.
If that doesn’t make much sense, like this:
User accesses forums.php and views all forums in database.
Clicks a forum, and the link is forums.php?id=$forumid
This then refreshes the page but instead of showing forums it shows threads within that forum.
Then, a thread is chosen, and the link becomes forums.php?id=$forumid&thread=$threadid
However, it doesn’t refresh and display that thread, unfortunately.
I’m using IF/Else statements, not Case/Break.
Any suggestions? I know it can be done. I have highlighted the area in question with comment tags.
Be warned, it’s a lot of code ![]()
[PHP]
<?php oB_start(); require("config.php");?> Forums ..my css here <?phpif(!$_GET[id]) //there is no forum id so show all forums…
{ ?>
?>
<?php } ?>| Forum ID | Site Forums | Last Post | Topics | Posts |
| <? echo $rows['id']; ?> | <? echo $rows['name']; ?> <? echo $rows['description']; ?> |
|||
$threads = mysql_query(“select * from threads where forumid = $id”);
while($r=(mysql_fetch_array($threads))) {
?>
<? } ?>| Forum ID | Site Forums | Last Post | Topics | Posts |
| <? echo $r['threadid']; ?> | <? echo $r['title']; ?> <? echo $r['user']; ?> <? //this above creates a link to the thread..forum?id=$id&thread=$threadid ?> |
|||
| Create New Topic | ||||
$threads = mysql_query(“select * from threads where threadid = $thread”);
while($r=(mysql_fetch_array($threads))) {
?>
<? } ?>| Forum ID | Thread |
| <? echo $r['threadid']; ?> | <? echo $r['title']; ?> <? echo $r['post']; ?> |
| Add reply | |
Thanks.