Previous Thread
Next Thread
Print Thread
Rate Thread
#277541 08/03/2004 11:05 AM
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
Has anyone tried doing these? We have some forums which would benefit from grouping of subject matter within a forum and I've been considering tackling this.

Sponsored Links
gailg #277542 08/03/2004 12:00 PM
Joined: Apr 2002
Posts: 610
Code Monkey
Code Monkey
Joined: Apr 2002
Posts: 610
I'd love to see it...

wilstephens #277543 08/03/2004 3:18 PM
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
let me know if ya do I will probable try and tackle this after I move in a month but if ya do let me know

234234 #277544 08/03/2004 4:04 PM
Joined: Apr 2002
Posts: 610
Code Monkey
Code Monkey
Joined: Apr 2002
Posts: 610
how about if shortbus pitches in some moolah to get this thing rolling? Hmmn hmmmn, hmmmn? Am I your pal?....How bout a Fresca!

wilstephens #277545 08/04/2004 2:14 PM
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
http://www.viperalley.com/ubbthreads.php

Well, I took some time to look into this and was unable to come up with a universal solution; however, I did add Sub-Forums to my site (intelligent ones that indicate new posts - and in the case of the Anything Goes area, an indicator of the number of new posts); however, my solution is specific to my site as the database layout is not subforum friendly.

There are two tables: the categories table and the boards table. Using this layout, there isn't an obvious way to make roomfor sub-forums without adding some kind of indentifier to the boards table. In doing so, you could potentially build upon the $forum array built in ubbthreads.php (when you encounter a subcat flag, add to the Description string for the last cateogry added to the array, for example).

I didn't want to spend a week on this, so did it my own way but hopefully someone has some time to invest in getting a better solution.

Sponsored Links
gailg #277546 08/04/2004 2:50 PM
Joined: Oct 2003
Posts: 2,305
Old Hand
Old Hand
Joined: Oct 2003
Posts: 2,305
Yeah thats what I had planned. Adding a column for parent and child and linking it that way. It would be a universal fix and allow for subforums.

gailg #277547 08/05/2004 12:37 PM
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
Could you post a code on how you did it?

domain123 #277548 08/05/2004 2:49 PM
Joined: Feb 2002
Posts: 950
Hacker
Hacker
Offline
Joined: Feb 2002
Posts: 950
Well, here's what I did, but I don't want to doc it fully as I don't want to support it - if you catch my drift. Just making them list is easy (and I'll describe), making them show new posts and post counts is a bit more involved...

1) First, you just create the forum - making sure it appears below the forum you plan to make it a sub of.

2) In ubbthreads.php, you place this line just above where the $forum variable gets assigned.

if ( $Keyword == "yoursubforumkeyword" ) continue;

This will prevent the subforum from being displayed on the Main Index.

3) In the description field for the Parent, you insert a link to the sub-forum:

Description text<br /><b>Sub-Forums:</b> <a href="/postlist.php...">Sub-Forum Name</a>

So, you actually create a hard link in the description to the sub forum.

That's it! You have a sub-forum now.

That's how I did the Main Index. I also added some code to explicitly add a "Sub-Forum:" and "Parent:" link when viewing those two forums to the postlist.php script. (blank is in other forums).

Also, on the ubbthreads.php script I modified the $forum[$x][$y]['Description'] variable for the parent to append a NEW tag if there are new messages (which we already know because its been checked for).

if ( $Keyword == "subforumname" ) {
$olddesc = $forum[$otx][$oty]['Description'];
$newdesc = str_replace( "</a>", "</a> <img border="0" height="12" width="16" src="/images/newposts.gif">", $olddesc);
$forum[$otx][$oty]['Description'] = $newdesc;
}

And, finally, the trickiest part, I added code to check for new messages in the postlist.php script *if* I was viewing the parent.

Thanks about it. Like I said, this was specific to my forum and your milage may vary.

gailg #277549 08/08/2004 6:53 AM
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
Ic... thank you.

gailg #277550 11/02/2004 6:21 AM
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
I finaly made a full featured subforums mod.

More information here.
https://www.ubbdev.com/forum/showflat.php/Number/122416/

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
hatter
hatter
USA
Posts: 69
Joined: January 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)