I am using the same forum this site uses for testing purposes on a portal I am making. I am trying to display the threads from the news post,posted on my main page. I have done that, but when I post the news threads it also post all the comments in the news threads as well. After looking at the mysql tables I can't seem to see how the forum destinquishes between the two. Any help on how to not post the comments would be appreciated.
my code:
$scan = mysql_query("SELECT * FROM `smf_messages` WHERE `ID_BOARD`= '2' ORDER BY `posterTime` DESC") or die(mysql_error());
while($row= mysql_fetch_array($scan)){
$user = $row['posterName'];
$time = $row['posterTime'];
$q = date("m/j/y h:i:s A", $time);
$s = mysql_query("SELECT * FROM `smf_members` WHERE `memberName` = '$user'") or die(mysql_error());
$r = mysql_fetch_array($s) or die(mysql_error());
$avy = $r['avatar'];
echo "<table cellpadding=0 cellspacing=0 width=400><tr><td width=100></td><td><b>". $row['subject'];
echo "</b><br /><img src=".$avy." align=left><i>". $row['body'] ."</i><br />";
echo "<font size=-2>".$q. "<br />".$user."</td></tr></table><br />";
}
the mysql table:
(http://www.securegamers.com/Forged/damnit.jpg)
I would say the Topic ID. Only accept the first title for each number.
Quote from: Savior on February 07, 2006, 09:49 AM
I would say the Topic ID. Only accept the first title for each number.
If ID_MSG == ID_TOPIC, it's the thread. If ID_MSG != ID_TOPIC, ID_MSG is a reply to ID_TOPIC.
No, Id_message is the post number, id_topic is the thread number. So you could have message=100000 and thread=300 and it could still be a new thread. However, I decided to use phpbb, seems like a better forum anyway.
if(!substr($SUBJECT), 0, 3) == "Re:")
{
//nothing
}
else
{
//topic
}
Quote from: Joe on February 10, 2006, 04:43 PM
if(!substr($SUBJECT), 0, 3) == "Re:")
{
//nothing
}
else
{
//topic
}
What happens if someone changes the title to 'That's a stupid suggestion, Joe.'?
Why would they do that? It'd break of course, but nobody ever changes it, so eh?
Quote from: Joe on February 11, 2006, 05:02 PM
Why would they do that? I'd break of course, but nobody ever changes it, so eh?
I'd like to see you even attempt to break
anything. And that is a gross generalization. LOT's of people change the reply title.