Jump to content

Topic View Issue!


ConnorSBB

Recommended Posts

Hi,

I am working on my own forum script.

PlusBB

http://plusbb.wehostyour.info/forums

 

What I wanted to do is make it so the posts were flat rather than threaded.

Well the tutorials I used ended up bringing me to something I do not want.

I ended up with a Threaded Page view after combining all the tutorials.

 

Here is the forumid .php script(mbindex.php)

 

<?php
    if (!isset($_GET['MBID'])) exit;
    mysql_connect("localhost", "phpuser", "alm65z");
    mysql_select_db("phpdb");
    
    function showpost(&$parent) {
        extract($parent, EXTR_PREFIX_ALL, "msg");
        $msg_DateSubmitted = date("jS of F Y", $msg_DateSubmitted);
        echo "<li><A HREF=\"read.php?Msg=$msg_ID\">$msg_Title</a> posted by <a href=\"mailto:$msg_Email\">$msg_Poster</a> on $msg_DateSubmitted";
        $result = mysql_query("SELECT ID, Title, Poster, Email, DateSubmitted FROM mbmsgs WHERE MBID = {$_GET['MBID']} AND Parent = $msg_ID ORDER BY DateSubmitted DESC;");
    
        if (mysql_num_rows($result)) {
            echo "<ul>";
            while ($row = mysql_fetch_assoc($result)) {
                showpost($row);
            }
            echo "</ul>";
        }
    }
    
    $result = mysql_query("SELECT ID, Title, Poster, Email, DateSubmitted FROM mbmsgs WHERE MBID = {$_GET['MBID']} AND Parent = 0 ORDER BY DateSubmitted DESC;");
    if (!$result) exit;
    if (!mysql_num_rows($result)) {
        echo "This messageboard has no posts.";
    } else {
        echo "<ul>";
        while ($row = mysql_fetch_assoc($result)) {
            showpost($row);
        }
        echo "</ul>";
    }
?>

<br /><br /><a href="post.php?MBID=<?php echo $_GET['MBID']; ?>">Post new message</a>

 

 

And here is the topic view code(read.php)

<?php
    if (!isset($_GET['Msg'])) exit;
    mysql_connect("localhost", "phpuser", "alm65z");
    mysql_select_db("phpdb");
    
    $result = mysql_query("SELECT MBID, Poster, Email, Title, Message, DateSubmitted FROM mbmsgs WHERE ID = {$_GET['Msg']};");
    if (!$result) exit;
    if (!mysql_num_rows($result)) exit;
    extract(mysql_fetch_array($result), EXTR_PREFIX_ALL, 'msg');
    
    $msg_DateSubmitted = date("jS of F Y", $msg_DateSubmitted);
    echo "Posted by <a href=\"mailto:$msg_Email\"> $msg_Poster</a> on $msg_DateSubmitted<br />";
    echo "$msg_Message<br /><br />";
    echo "<a href=\"post.php?Parent={$_GET['Msg']}&MBID=$msg_MBID\"> Reply to this post</a>";
?>

 

Can someone please help me fix this issue?

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/193723-topic-view-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.