Previous Thread
Next Thread
Print Thread
Rate Thread
#281883 11/10/2004 7:32 AM
Joined: Sep 2006
Posts: 75
Power User
Power User
Offline
Joined: Sep 2006
Posts: 75
I've just recently bought UBBthreads, and I'm still setting it up. I've used a threaded forum previously (WebBBS) and I'm trying to get UBBthreads to display as closely as possible to my previous forum. I've noticed two things on the PostList page, and if somebody knows (1) what I'm doing wrong, or; (2) of a mod to fix it, I'd greatly appreciate it. (By the way, I'm using Expanded View).

1. When posting to a main topic, replies to it are in reverse chronological order. So the last person to reply shows immediately underneath the main topic, while the first person to reply shows last. I'd like it to be the reverse of that.

2. It seems that all replies are indented, and that the thread does not determine which message is being replied to. Here's an example of what is happening:

Main Topic
---Reply 3 to Main Topic
------Reply 2 to Main Topic
---------Reply 1 to Main Topic

Below is how I want it to work:

Main Topic
---Reply 1 to Main Topic
------Reply 1 to Reply 1
---Reply 2 to Main Topic
---Reply 3 to Main Topic

and so on ...

Again, if anyone can help it would be greatly appreciated.

Thanks,

Sponsored Links
jay-zi #281884 11/10/2004 8:52 AM
Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
[]Rose said:
I've just recently bought UBBthreads, and I'm still setting it up. I've used a threaded forum previously (WebBBS) and I'm trying to get UBBthreads to display as closely as possible to my previous forum. I've noticed two things on the PostList page, and if somebody knows (1) what I'm doing wrong, or; (2) of a mod to fix it, I'd greatly appreciate it. (By the way, I'm using Expanded View).

1. When posting to a main topic, replies to it are in reverse chronological order. So the last person to reply shows immediately underneath the main topic, while the first person to reply shows last. I'd like it to be the reverse of that. [/]

Ok, it requires 2 small changes...one in postlist.php and the other in showthreaded.php. I'll show how it's done in v6.3 (6.5 should be somewhat similar but probably won't be the exact same query, although you should still be able to find the relevant section though by matching the comments).

[1-A] In postlist.php find this...

Code
   // --------------------------------------------------------------- <br />   // If we are not doing flat posts and the view is expanded then we <br />   // will list all the replies out in a threaded format <br />      $tree = array(); <br />      if ($view == "expanded") { <br />         $query = " <br />           SELECT t1.B_Number,t1.B_Parent,t1.B_Posted,t2.U_Username,t1.B_Subject,t1.B_Status,t1.B_Approved,t1.B_Icon,t1.B_Reged,t2.U_Color,t2.U_Status,t2.U_Number,t1.B_AnonName,t1.B_File <br />           FROM  {$config['tbprefix']}Posts AS t1, <br />			  		  {$config['tbprefix']}Users AS t2 <br />           WHERE t1.B_Main = $Number <br />           AND   t1.B_Number <> $Number <br />			  AND   t1.B_PosterId = t2.U_Number <br />           $Viewable <br />           ORDER BY t1.B_Number DESC <br />         "; <br />         $stj = $dbh -> do_query($query); <br />         $results = 0;  


Now toward the end just change the DESC to ASC as follows...

Code
    // --------------------------------------------------------------- <br />   // If we are not doing flat posts and the view is expanded then we <br />   // will list all the replies out in a threaded format <br />      $tree = array(); <br />      if ($view == "expanded") { <br />         $query = " <br />           SELECT t1.B_Number,t1.B_Parent,t1.B_Posted,t2.U_Username,t1.B_Subject,t1.B_Status,t1.B_Approved,t1.B_Icon,t1.B_Reged,t2.U_Color,t2.U_Status,t2.U_Number,t1.B_AnonName,t1.B_File <br />           FROM  {$config['tbprefix']}Posts AS t1, <br />			  		  {$config['tbprefix']}Users AS t2 <br />           WHERE t1.B_Main = $Number <br />           AND   t1.B_Number <> $Number <br />			  AND   t1.B_PosterId = t2.U_Number <br />           $Viewable <br />           ORDER BY t1.B_Number ASC <br />         "; <br />         $stj = $dbh -> do_query($query); <br />         $results = 0; 



[1-B] In showthreaded.php find this...

Code
    // -------------------------------------- <br />   // Grab all of the replies in this thread <br />      $query = " <br />        SELECT t1.B_Number,t1.B_Parent,t1.B_Posted,t2.U_Username,t1.B_Subject,t1.B_Status,t1.B_Approved,t1.B_Icon,t1.B_Reged,t2.U_Color,t2.U_Status,t2.U_Number,t1.B_AnonName,t1.B_File <br />        FROM  {$config['tbprefix']}Posts AS t1, <br />		  		  {$config['tbprefix']}Users AS t2 <br />        WHERE t1.B_Main=$current <br />		  AND   t1.B_Posterid = t2.U_Number <br />        $Viewable <br />        ORDER BY t1.B_Number DESC <br />      "; <br />      $sth = $dbh -> do_query($query); 


And again, change the DESC to ASC...

Code
   // -------------------------------------- <br />   // Grab all of the replies in this thread <br />      $query = " <br />        SELECT t1.B_Number,t1.B_Parent,t1.B_Posted,t2.U_Username,t1.B_Subject,t1.B_Status,t1.B_Approved,t1.B_Icon,t1.B_Reged,t2.U_Color,t2.U_Status,t2.U_Number,t1.B_AnonName,t1.B_File <br />        FROM  {$config['tbprefix']}Posts AS t1, <br />		  		  {$config['tbprefix']}Users AS t2 <br />        WHERE t1.B_Main=$current <br />		  AND   t1.B_Posterid = t2.U_Number <br />        $Viewable <br />        ORDER BY t1.B_Number ASC <br />      "; <br />      $sth = $dbh -> do_query($query);  




[]2. It seems that all replies are indented, and that the thread does not determine which message is being replied to. Here's an example of what is happening:

Main Topic
---Reply 3 to Main Topic
------Reply 2 to Main Topic
---------Reply 1 to Main Topic

Below is how I want it to work:

Main Topic
---Reply 1 to Main Topic
------Reply 1 to Reply 1
---Reply 2 to Main Topic
---Reply 3 to Main Topic

and so on ...

Again, if anyone can help it would be greatly appreciated.

Thanks, [/]

It *should* now appear as mentioned in the 2nd example you gave. At least it does for my version.

If 6.5 is not that way after the change then I have no idea what's up

smoknz28 #281885 11/10/2004 11:51 AM
Joined: Sep 2006
Posts: 75
Power User
Power User
Offline
Joined: Sep 2006
Posts: 75
Thanks so much, Twisty! Your reply helped me greatly! Much appreciated.

The order is now correct on both PostList.php and ShowThreaded.php.

As to the second problem (message indentation) - the spacing on ShowThreaded.php is absolutely correct and matches my second example. However, the indenting on the index (PostList.php) still matches the first example. For some reason second tier messages don't line up with each other, and the same with third tier messages, and so on.

It appears that PostList.php and ShowThreaded.php indent differently. If you or anyone else knows how to fix the indentation on PostList.php then that will solve all my threading problems.

Thanks,

jay-zi #281886 11/10/2004 6:39 PM
Joined: Sep 2006
Posts: 75
Power User
Power User
Offline
Joined: Sep 2006
Posts: 75
I reread my last post, and it sort of sounds as clear as mud. This is an example of what I want.

Original Topic - (John)
---Reply to John - (Cindy)
------Reply to Cindy - (George)
---Reply to John (Dave)
------Reply to Dave (Fred)
---------Reply to Dave
---Reply to John (Mary)


Currently the threads are working something like this:

Original Topic (John)
---Reply to John (Cindy)
------Reply to John (Dave)
---------Reply to John (Mary)

The third level replies (replies to replies) seem to appear with no apparent consistency. Sometimes they will appear correctly, most of the time they don't. It seems to depend on WHEN they were posted, not which thread they are replying to.

The crazy thing is, the threads appear the way I want them to on the ShowThreaded.php page, but not on the PostList.php page.

I'm really bamboozled by this - it would have to be THE most frustrating thing I've come up againist with the UBBThreads forum, and for me, the biggest show-stopper.

Thanks for any hints, tips, suggestions, ideas, or even a gun to shoot myself right now would be good.

jay-zi #281887 11/10/2004 7:09 PM
Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
Don't worry, I understand exactly what you meant.

Well I did some testing on this board, and just as I suspected, the Quick Reply feature has a bug, actually 2 of them...

1) It toasts the original thread structure after a reply is made using it, giving the effect you describe

This would explain why it only happens sometimes and not all the time, because everything works normally when only making regular replies.

2) After a reply is made with it in threaded mode, it reverts back to showing flat view (?). If that is intentional behaviour, then I have to admit it seems much better to keep the preferred view that a user/admin chooses. Seems more like a bug imo.

Anyway, my advice would be to rip it right out altogether, which would a lot easier than trying to fix these issues yourself. I don't use it at all on my boards and no one misses it

Sponsored Links
smoknz28 #281888 11/10/2004 7:35 PM
Joined: Sep 2006
Posts: 75
Power User
Power User
Offline
Joined: Sep 2006
Posts: 75
Thanks Twisty - but I have Quick Reply disabled. I have had all along because I don't like the space it takes up. Or did you mean do more than just disable it?

smoknz28 #281889 11/10/2004 7:59 PM
Joined: Sep 2006
Posts: 75
Power User
Power User
Offline
Joined: Sep 2006
Posts: 75
Twisty, I just had a look at your forum, and the threads behave the way they should. I see you're using 6.3 .. would that make a difference, or did you modify the code?

jay-zi #281890 11/10/2004 8:02 PM
Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
[]Rose said:
Thanks Twisty - but I have Quick Reply disabled. I have had all along because I don't like the space it takes up. Or did you mean do more than just disable it? [/]

Hmm, now that's weird. If it's not being used, and you're still having this problem, then I really have no idea what it could be. It's undoubtedly a bug of some kind, although everything seems to work correctly for me here when making a normal reply (?). It's only the Quick Reply which causes me problems.

Perhaps I'll do some more testing to see if I can replicate the bug without Quick Reply.

smoknz28 #281891 11/10/2004 8:59 PM
Joined: Sep 2003
Posts: 488
Code Monkey
Code Monkey
Joined: Sep 2003
Posts: 488
Alright I tested some more and you are correct, it messes up regardless of which method is used to reply. This is clearly a postlist indentation bug in 6.5 then.

Hmm, there is no rational explanation for why it should be behaving like that. I know it doesn't do that in 6.3 (not sure about 6.4).

If you want to PM me your FTP login I can try fixing it (after backing up the original of course), it's up to you.

smoknz28 #281892 11/10/2004 11:49 PM
Joined: Sep 2006
Posts: 75
Power User
Power User
Offline
Joined: Sep 2006
Posts: 75
Twisty, my sweet husband managed to fix the problem. It was a bug (in my opinion).

To "correct" the indentation so that child messages line up correctly, we replaced the following code in 6.5 postlist.php,

_______________________
// Setup the postrow array
if ($isnew) {
$color = "new$color";
}
$postrow[$z]['color'] = $color;
$postrow[$z]['indentsize'] = $indentsize;
$postrow[$z]['icon'] = "blank.gif";
$postrow[$z]['imagesize'] = $imagesize;
$postrow[$z]['Number'] = $PNumber;
$postrow[$z]['Subject'] = "<img src="{$config['images']}/$specialicon" border="0"> <img src="{$config['images']}/$icon" border="0"> $Subject";
$postrow[$z]['Username'] = $Username;
$postrow[$z]['UserStatus'] = $UserStatus;
$postrow[$z]['Views'] = " ";
$postrow[$z]['Replies'] = " ";
$postrow[$z]['time'] = $time;
$postrow[$z]['pageprint'] = "";
$postrow[$z]['UserNumber'] = $Uid;
$postrow[$z]['goto'] = "#$PNumber";
$postrow[$z]['Rating'] = "";
$postrow[$z]['lastposter'] = "";
$postrow[$z]['specialicon'] = "blank.gif";
$postrow[$z]['announce'] = "0";
if ($Sticky == '2') {
$postrow[$z]['announce'] = "$Board";
}
$postrow[$z]['newreplies'] = "";

// --------------------
// alternate the colors
//$color = $html -> switch_colors($color);
$indent++;
if (isset($tree[$PNumber]['children'])) {
$color = show_replies($Cat,$PNumber,$Board,$indent,$unread,$read,$color,$page,$view,$sb,$sort,$Viewable,$offset,$C,$mode,$o,$PNumber,$user['U_TimeFormat'],$Main,$Sticky,$topiclock);
}

}
__________________________

with the following code:
__________________________


// Setup the postrow array
if ($isnew) {
$color = "new$color";
}
$postrow[$z]['color'] = $color;
$postrow[$z]['indentsize'] = $indentsize;
$postrow[$z]['icon'] = "blank.gif";
$postrow[$z]['imagesize'] = $imagesize;
$postrow[$z]['Number'] = $PNumber;
$postrow[$z]['Subject'] = "<img src="{$config['images']}/$specialicon" border="0"> <img src="{$config['images']}/$icon" border="0"> $Subject";
$postrow[$z]['Username'] = $Username;
$postrow[$z]['UserStatus'] = $UserStatus;
$postrow[$z]['Views'] = " ";
$postrow[$z]['Replies'] = " ";
$postrow[$z]['time'] = $time;
$postrow[$z]['pageprint'] = "";
$postrow[$z]['UserNumber'] = $Uid;
$postrow[$z]['goto'] = "#$PNumber";
$postrow[$z]['Rating'] = "";
$postrow[$z]['lastposter'] = "";
$postrow[$z]['specialicon'] = "blank.gif";
$postrow[$z]['announce'] = "0";
if ($Sticky == '2') {
$postrow[$z]['announce'] = "$Board";
}
$postrow[$z]['newreplies'] = "";

// --------------------
// alternate the colors
//$color = $html -> switch_colors($color);
//$indent++;
if (isset($tree[$PNumber]['children'])) {
// Steve J Code: Moved the above $indent++ to below to make indenting behave correctly
$indent++;
$color = show_replies($Cat,$PNumber,$Board,$indent,$unread,$read,$color,$page,$view,$sb,$sort,$Viewable,$offset,$C,$mode,$o,$PNumber,$user['U_TimeFormat'],$Main,$Sticky,$topiclock);
$indent--;
}

}
_______________________________________

What was involved was moving $indent++; to the correct location, then adding #indent--; after the function returned the function values.

Once again, thanks for your generous help. Hopefully other people might be able to use this. I'm trying to talk my husband into posting the fix in the Mods forum.

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)