Results 1 to 15 of 21
Page 1 of 2
FirstFirst 1 2 ... LastLast

Thread: [Mini-RELEASE v2] Print linked list of forums in any template

  1. #1
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647

    *Updated* - v0.0.2 released

    LAST UPDATED 3.23.01 @ 2:42 PM Eastern

    This is another request from JJR512. (Hey, he has good ideas. What can I say? ) It prints a list of forums, each linked to the thread list page for that forum, for use in any template. It excludes a) forums that aren't displayed (display order = 0) and b) forums that aren't allowed to have posts (i.e. categories).

    There's no image as I couldn't find a good place to put it on my board (a slightly weird layout) so you can take a look at JJR's once he's implemented it if you like.

    Hack version number: 0.0.2

    Changes since last version (0.0.1): Now also excludes non-active forums (active=0); orders list by parent forum, then by display order.

    For version: 2.0.0 beta 3 (possibly beta 1 and beta 2 also, but it is untested with these versions).

    Files needed: functionsadd.txt (see attached zip file), functions.php.

    Files to edit: functions.php.

    Templates to edit: Depends (see instructions).

    Instructions
    1] Open the file functionsadd.txt from the zip file in a text editor.

    2] Open functions.php (in the /admin directory) in a TEXT-ONLY editor (such as Notepad, Wordpad, Simpletext, EditPlus, TextPad, etc. DO NOT USE an HTML editor or WYSIWYG editor (such as HotDog, FrontPage, DreamWeaver, etc.) because it will in all likelyhood screw up the file. If you do use an editor such as these, I will *not* be able to support you.). Right after the "<?php", add the contents of functionsadd.txt.

    3] Upload functions.php to your web server, making sure to put it in the admin directory.

    3] Edit whichever template you want the forum links in by adding $forumlinks1 where you want the links to appear. It will show a list, separated by &nbsp;&nbsp; (two spaces). You can change this by editing the $forumlinks1 .="&-nbsp;&-nbsp;" line. Change &-nbsp;&-nbsp; to whatever you want to separate each forum name.

    4] Save the template.

    Instructions are also included in the zip file (forumlinks.txt).

    FEEDBACK WANTED! Likes/dislikes/modification requests all accepted.

    EDIT: Added "-" to the &-nbsp; to keep them from turning into spaces. (Why if HTML is disabled do they turn into spaces????)
    Last edited by tubedogg; Mon 26th Mar '01 at 3:11am.
     

  2. #2
    Senior Member JJR512 is on a distinguished road JJR512's Avatar
    Join Date
    Dec 2000
    Location
    Glen Burnie, MD, USA
    Age
    34
    Posts
    507
    Two problems.

    1. It seemed that all forums, including inactive ones, were displayed.

    2. They were ordered, aparently, by forum number, rather than by display order.
    -Justin "JJR512" Rebbert
    JJR512.com: Chat about anything!
     

  3. #3
    Senior Member JJR512 is on a distinguished road JJR512's Avatar
    Join Date
    Dec 2000
    Location
    Glen Burnie, MD, USA
    Age
    34
    Posts
    507
    Just wanted to add, if you look at my place now, you will not see it...the feature is disabled as long as it shows the closed forums.
    -Justin "JJR512" Rebbert
    JJR512.com: Chat about anything!
     

  4. #4
    Senior Member Nicholas Brown is on a distinguished road
    Join Date
    Oct 2000
    Location
    Hull, England
    Posts
    1,084
    got a demo of this before I try it out?
     

  5. #5
    Senior Member snyx has disabled reputation snyx's Avatar
    Join Date
    Aug 2000
    Location
    Vancouver, BC, Canada (whistler.2010)
    Posts
    1,073
    Yes demo?
     

  6. #6
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    Originally posted by JJR512
    1. It seemed that all forums, including inactive ones, were displayed.
    By inactive ones do you mean categories? I specfically weeded those out (candisplaythreads = 0). If you mean other inactive forums, you're gonna have to explain.

    2. They were ordered, aparently, by forum number, rather than by display order.
    Hmm. There's a way around this, but it's gonna take some more work. I should have something before the end of the day.
     

  7. #7
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    I updated it to v0.0.2, which fixes the problems that JJR mentioned. As for a demo, you're just gonna have to wait. I can't really implement it on my forum, so...Plus there's not much to see. It basically just creates a list of forums, useful if you don't want to use forumjump.
     

  8. #8
    Senior Member JJR512 is on a distinguished road JJR512's Avatar
    Join Date
    Dec 2000
    Location
    Glen Burnie, MD, USA
    Age
    34
    Posts
    507
    OK, now all the forums are being displayed that I want to be displayed, and the ones that shouldn't be displayed are not displayed. That, in other words, is correct. Only thing is an archive is being displayed, too, which I would prefer not to, but I guess is acceptable. Although is there a way to exclude an archive? I guess that is a forum that is closed or locked.

    Now the problem is the display order.

    Here is how I have my category and forum display orders set:
    Code:
    General: 1
         Mindless Blabbering: 1
         Current Events: 2
         Useless Trivia: 3
         Sports: 4
         Entertainment: 5
         Automobiles: 6
    Computer Stuff: 2
         Hardware: 7
         Software: 8
         Gaming: 9
         SETI: 10
    Site Related: 3
         Feedback: 11
         Moderator's Hideout: 12
    Now for some reason, the Computer Stuff category's forums are displaying first, in order, then the Site Related category's forums are displaying, and finally the General category's forums are displaying (again, in order). So it seems that within each category, the forums are displayed in proper order, it's just that the categories are not displayed in order themselves.
    -Justin "JJR512" Rebbert
    JJR512.com: Chat about anything!
     

  9. #9
    Senior Member JJR512 is on a distinguished road JJR512's Avatar
    Join Date
    Dec 2000
    Location
    Glen Burnie, MD, USA
    Age
    34
    Posts
    507
    OK, I don't know much about PHP or MySql, but have learned enough by applying hacks to think I can experiment a little, hopefully without making the planet explode or anything. ANYway, I know that the order in which the forums are listed are controlled by this part...
    Code:
    ORDER BY parentid,displayorder
    ...which is part of the code that gets added to functions.php.

    So I tried reversing them to see what would happen, so it looks like this...
    Code:
    ORDER BY displayorder,parentid
    ...and now it works find. The forums are displayed in the correct order.

    Now if anyone would like to see a demo, look here:
    http://www.jjr512.com/forums/index.php?s=
    And look just under the dark blue navigation bar. You'll see a hyperlinked list of all my active forums. To me (and my users), this is better than the forumjump feature. It's easier to use; just click a link. One step, all there is to it. The forumjump feature requires you open the drop-down box, select the forum, etc.; hardly requires a Ph.D., but still it's a few more steps.

    Also, I've added it at the bottom of the page, in this case just above the dark blue navigation band. If you look at my message board, you'll see I've also added the navbar below the tables as well (the navbar is the part that shows the BBS name, the forum name, and if in a thread, the thread name, all as links, so you can go back up a level). I find the navbar (and the forumlinks from this hack) to actually be more useful at the bottom. Think about it. When you read through a thread, and read the last message, where do you end up? At the bottom. So why not put the links there, instead of making you have to scroll back up to the top.

    Edited to add: I put the $forumlinks1 in the header and footer templates, so they appear on every page.
    -Justin "JJR512" Rebbert
    JJR512.com: Chat about anything!
     

  10. #10
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    Hi JJR

    I've been thinking about this one and looking over the forum table again to see what I can do about it. You're right - the way you have yours set up, it works. However, on a board such as mine, I have the displayorder duplicated for each category. e.g.
    Code:
    General: 1
    ---Announcements: 1
    The Real World: 2
    ---New Season: 1
    ---Old Season: 2
    ---Casting: 3
    Road Rules: 3
    ---New Season: 1
    ---Old Season: 2
    ---Casting: 3
    The Void: 4
    ---Reality Online: 1
    ---Off-topic rambling: 2
    ---Bug Reports: 3
    ---Testing testing: 4
    (I left some off, but you get the idea.) So in that case, it wouldn't work. I'm trying to figure out a way around this - I think I'm gonna have to do some investigation of the parentlist field. I'll let y'all know when I come up with something.
     

  11. #11
    Senior Member JJR512 is on a distinguished road JJR512's Avatar
    Join Date
    Dec 2000
    Location
    Glen Burnie, MD, USA
    Age
    34
    Posts
    507
    I guess what I don't understand, then, is why were the categories shown in the wrong order in my case? "Mindless Blabbering" has a lower number than "Hardware", and the category that "MB" is in has a lower number than the category that "Hardware" is in. So regardless of if it was ordered by category first, then by forum, or just by forum, "MB" should have been first. But all the forums in the "Computer Stuff" category were displayed first, it the correct order within that category.
    -Justin "JJR512" Rebbert
    JJR512.com: Chat about anything!
     

  12. #12
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647

    Ahh I figured it out

    Because parent id (which is equal to the forum id of the parent in question) is different from display order. On your site, General's id = 19, so for the MB forum, the parent id is 19. However, in Computer Stuff (id = 17), Hardware & Overclocking has a parent id of 17. See where I'm going?

    I'm gonna have to figure out a way to use the parent list. But I have *no* idea how it works, at least not yet. I'm getting there.
     

  13. #13
    Senior Member JJR512 is on a distinguished road JJR512's Avatar
    Join Date
    Dec 2000
    Location
    Glen Burnie, MD, USA
    Age
    34
    Posts
    507
    Umm...I don't see where you're going, because you lost me with "General's id = 19". General has an ID of 1, and Computer Stuff has an ID of 2. Where did 19 and 17 come from?
    -Justin "JJR512" Rebbert
    JJR512.com: Chat about anything!
     

  14. #14
    Senior Member tubedogg has disabled reputation tubedogg's Avatar
    Join Date
    Feb 2001
    Location
    Medina, OH
    Age
    28
    Posts
    13,647
    General has a displayorder of 1, and computer stuff has a displayorder of 2, both of which are *not* the forum id (or parent id).

    OK. Ignoring displayorder for a minute:
    Code:
    General > forumid = 19. (any sub-forums will have a parentid of 19)
        MB > forumid = 1, parentid = 19.
    Computer Stuff > forumid = 17. (any sub-forums will have a parentid of 17)
        Hardware & Overclocking > forumid = 3, parentid = 17.
    If I order by parentid, Hardware & Overclocking (parentid=17) comes up first, then MB (parentid=19) because 17 < 19.

    See now?
     

  15. #15
    New Member alhatali is on a distinguished road
    Join Date
    May 2001
    Posts
    14
    I installed this hack successfully. However, I noticed that the list of forums displayed include private forums, not like the ForumJump list. It is true that when one clicks on a forum that's not allowed to see, they will get the Login In window.

    Is there a way of displaying only the forums that one is allowed to see?
     

Page 1 of 2
FirstFirst 1 2 ... LastLast

Similar Threads

  1. [MINI-RELEASE] FREE SpellCheck!
    By snyx in forum vBulletin Templates, Graphics & Styles
    Replies: 53
    Last Post: Wed 24th Aug '05, 7:13pm
  2. [Mini-RELEASE 2.x] New Threads Today
    By badmeetsevil- in forum Releases: Version 2.x
    Replies: 9
    Last Post: Mon 29th Oct '01, 11:06am
  3. [Mini-RELEASE v2] User has started X threads
    By tubedogg in forum Releases: Version 2.x
    Replies: 75
    Last Post: Sun 28th Oct '01, 10:57am
  4. [mini release V2] hypercell
    By adrianmak in forum vBulletin Templates, Graphics & Styles
    Replies: 15
    Last Post: Wed 15th Aug '01, 6:21pm
  5. [Mini-RELEASE v2] Different headers with one style
    By Essam in forum Releases: Version 2.x
    Replies: 0
    Last Post: Wed 13th Jun '01, 11:11pm

Bookmarks

Posting Permissions

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts