|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
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.
|
|
|
|
Joined: Apr 2002
Posts: 610
Code Monkey
|
Code Monkey
Joined: Apr 2002
Posts: 610 |
|
|
|
|
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 
|
|
|
|
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!
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
Joined: Feb 2002
Posts: 950 |
http://www.viperalley.com/ubbthreads.phpWell, 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.
|
|
|
|
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.
|
|
|
|
Joined: May 2001
Posts: 550
Code Monkey
|
Code Monkey
Joined: May 2001
Posts: 550 |
Could you post a code on how you did it?
|
|
|
|
Joined: Feb 2002
Posts: 950
Hacker
|
Hacker
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.
|
|
|
|
Joined: May 2001
Posts: 550
Code Monkey
|
Code Monkey
Joined: May 2001
Posts: 550 |
|
|
|
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.
|
|
Posts: 808
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,823
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|