What's New
Off Topix: Embrace the Unexpected in Every Discussion

Off Topix is a well established general discussion forum that originally opened to the public way back in 2009! We provide a laid back atmosphere and our members are down to earth. We have a ton of content and fresh stuff is constantly being added. We cover all sorts of topics, so there's bound to be something inside to pique your interest. We welcome anyone and everyone to register & become a member of our awesome community.

Topic View Issue!

Connor

the big kahuna
Member
Joined
Sep 25, 2009
Posts
137
OT Bucks
383
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)



Code:
<?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 [*][url=read.php?Msg=$msg_ID]$msg_Title[/url] posted by [email=$msg_Email]$msg_Poster[/email] 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 [/list];

        }

    }

    

    $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 [/list];

    }

?>





[url=post.php?MBID=<?php echo $_GET['MBID']; ?>]Post new message[/url]





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

Code:
<?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 [email=$msg_Email] $msg_Poster[/email] on $msg_DateSubmitted
;

    echo $msg_Message

;

    echo [url=post.php?Parent={$_GET['Msg']}&MBID=$msg_MBID] Reply to this post[/url];

?>



Can someone please help me fix this issue?



Thanks
 
Can you explain what you mean by flat rather than threaded? Otherwise, the only format I'm thinking of as to when you explain it is a chatboard I joined up with three years ago. There was a bunch of subjects to choose from and then after so many days they poofed. Is that kind of what you want?
 
hmmm?

Flat is like PHPBB, threaded is when it shows a thread, then lists the subject of each of the replies but not the full reply.
 
Back
Top Bottom