Announcement

Collapse
No announcement yet.

Can a forum be shared by two or more categories??

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Can a forum be shared by two or more categories??

    Sorry if this has been asked before. I'm wondering if I can put a forum (posting) into several different non-posting categories. That forum has to be shared by those categories. For example if I have:

    Ford(category)
    --Feedback(forum)

    Honda(category)
    --Feedback(forum)

    I want to set it up so that the Feedback forums are essentially the same forum. So it won't matter which Feedback forum I go into, the same forum will show up. How can I do it?

    Your help will be greatly appreciated!!

  • #2
    You need to hack the code for this.

    Comment


    • #3
      Can you give me an idea on how to do this?

      Comment


      • #4
        I would also be interested in this
        HP DL-380 G6, 2x E5520, 28GB RAM, 4x300GB SAS, VMWare ESXi
        -
        Unreal Tournament : Assault forums - irc://irc.utassault.net:6667 -

        Comment


        • #5
          Has anyone implemented this in his/her vB?? Which template to hack and what is the code to be changed??

          Comment


          • #6
            I really want this but have been unable to even work out how to go about doing it i am afraid... I don't think it will be easy.
            Christopher Padfield
            Web Based Helpdesk
            DeskPRO v3.0.3 Released - Download Demo Now!

            Comment


            • #7
              I don't think this would be easy because of the way parent forums are updated, etc.... however I can see alot of use for something like this.

              Comment


              • #8
                why not do something like the thread MOVED link and have only the text link in each of 2 forums that redirects to the 1 forum ?
                :: Always Back Up Forum Database + Attachments BEFORE upgrading !
                :: Nginx SPDY SSL - World Flags Demo [video results]
                :: vBulletin hacked forums: Clean Up Guide for VPS/Dedicated hosting users [ vbulletin.com blog summary ]

                Comment


                • #9
                  In concept your would have to go to a multiple parent system where a list of parents is stored instead of a parentid.

                  The parentlist would also have to reflect this. Doing this would create a lot of extra processing to allow the forums to display correctly...

                  However you can fake this like this:

                  1. Create your "Feedback" forum. Setting everything as normal but set the display order to '0' (zero). After saving it, hover over the edit command and write down the forumid.

                  2. Open your templates.. Find your forumhome_forumbit_level1_nopost template. You are going to make it look like:
                  Code:
                  <tr id="cat">
                    <td bgcolor="{categorybackcolor}" colspan="6"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$forum[forumid]"><normalfont color="{categoryfontcolor}"><b>$forum[title]</b></normalfont></a>
                    <br><smallfont>$forum[description]</smallfont></td>
                  </tr>
                  <tr align="center">
                    <td bgcolor="{secondaltcolor}" valign="top"><img src="{imagesfolder}/$feedback[onoff].gif" border="0" alt=""></td>
                    <td bgcolor="{firstaltcolor}" align="left"><a href="forumdisplay.php?s=$session[sessionhash]&forumid=$feedback[forumid]"><normalfont><b>$feedback[title]</b></normalfont></a>
                    <br><smallfont>$feedback[description]</smallfont></td>
                    <td bgcolor="{secondaltcolor}"><normalfont>$feedback[replycount]</normalfont></td>
                    <td bgcolor="{firstaltcolor}"><normalfont>$feedback[threadcount]</normalfont></td>
                    <td bgcolor="{secondaltcolor}" align="left"><smallfont>$feedback[lastpostinfo]</smallfont></td>
                    <td bgcolor="{firstaltcolor}"><smallfont>$feedback[moderators]</smallfont></td>
                  </tr>
                  3. In index.php find:
                  PHP Code:
                  //Forum info
                  $forums=$DB_site->query('SELECT * FROM forum WHERE displayorder<>0 AND active=1 ORDER BY parentid,displayorder');
                  while (
                  $forum=$DB_site->fetch_array($forums)) {
                      
                  $iforumcache["$forum[parentid]"]["$forum[displayorder]"]["$forum[forumid]"] = $forum;
                  }
                  $DB_site->free_result($forums);
                  unset(
                  $forum); 
                  After that add:
                  PHP Code:
                  $feedback==getforuminfo(XX); 
                  Where XX equals the forumid number that you wrote down earlier.

                  This will show most of the information. More hacking is needed to show the proper lightbulbs and moderator information. You can find out what is needed by looking at the code in index.php.
                  Translations provided by Google.

                  Wayne Luke
                  The Rabid Badger - a vBulletin Cloud demonstration site.
                  vBulletin 5 API

                  Comment


                  • #10
                    thanks wayne, i am very tempted to try this out i can see a lot of uses for it at my site.
                    Christopher Padfield
                    Web Based Helpdesk
                    DeskPRO v3.0.3 Released - Download Demo Now!

                    Comment


                    • #11
                      I created a hacked version of index.php with the following changes:

                      At the very beginning, add the following code:
                      Code:
                      if (isset($go)) {
                      	if ($go==1) {
                      			$catname="UK and Ireland";
                      			$yourcat="133_146_144_143_135~133~146~144~143~135";
                      		} elseif ($go==2) {
                      			$catname="Europe";
                      			$yourcat="133_134_146_144_143_135~133~134~146~144~143~135";
                      		} elseif ($go==3) {
                      			$catname="USA";
                      			$yourcat="133_132_141_136_139_144_143_135~133~132~141~136~139~144~135";
                      		} elseif ($go==4) {
                      			$catname="The Americas";
                      			$yourcat="133_132_141_136_139_138_140_144_143_135~133~138~140~144~143~135";
                      		} elseif ($go==5) {
                      			$catname="Women";
                      			$yourcat="133_142_139_144_143_135~133~142~139~144~143~135";
                      		} elseif ($go==6) {
                      			$catname="MLS";
                      			$yourcat="132_144_143_135~132~144~143~135";
                      		} else {
                      			$catname="";
                      			$yourcat="132_133_134_135_136_137_138_139_140_141_142_143_144_145_146~132~133~134~135~136~137~138~139~140~141~142~143~144~145~146";
                      		}
                      }	else {
                      			$catname="";
                      $yourcat="132_133_134_135_136_137_138_139_140_141_142_143_144_145_146~132~133~134~135~136~137~138~139~140~141~142~143~144~145~146";
                      }
                      
                      $yourcat=str_replace("_", " OR parentid=", $yourcat);
                      $yourcat=str_replace("~", " OR parentlist=", $yourcat);
                      What you are doing here is setting up different top level categories and which categories appear in them. Each different "go=" is a different top level category. In the above example, go=1 is a top level category called UK & Ireland and contains 5 categories. The numbers seperated by _ are the caegories with that parentid and the ones seperated by ~ are the categories with that parentlist. You'll have to look in the dbase with phpMyAdmin to find out which is which.

                      You can see in the above example that the category with parentlist 135 appears in every subcategory.

                      Then, replace the line that says //Foruminfo (approximately line 130) to be the following:

                      Code:
                      //Forum info
                      $forums=$DB_site->query("SELECT * FROM forum WHERE displayorder<>0 AND active=1 HAVING parentid=$yourcat ORDER BY parentid,displayorder");
                      while ($forum=$DB_site->fetch_array($forums)) {
                          $iforumcache["$forum[parentid]"]["$forum[displayorder]"]["$forum[forumid]"] = $forum;
                      You can then call the various categories by adding ?go= and the number of the category you created. For example, on my site: http://www.bigsoccer.com/forum/boards.php?go=1 . Also, you can add the variable $catname to the template to display the category name. You can see my example working on the above URL.

                      It's a bit kludgy, but it works. Hope this helps.

                      Comment


                      • #12
                        Originally posted by JonnyQuest


                        The numbers seperated by _ are the caegories with that parentid and the ones seperated by ~ are the categories with that parentlist. You'll have to look in the dbase with phpMyAdmin to find out which is which.

                        You can see in the above example that the category with parentlist 135 appears in every subcategory.
                        JohnyQuest,

                        Thats fine work!

                        I am a bit confused about the part on "_"and "~". Can you explain more clearly?

                        I assume you're talking about the "forum" table?

                        When you say categories do you mean forumid's?

                        I'm not sure what you meant about "parentlist" and parentid" though - I see them in the table but I don't understand how to know which numbers to use for each.

                        Thanks!

                        -bw

                        Comment


                        • #13
                          to be honest, I'm not exactly sure how the parentid and parentlist work, I just hacked it until it worked.
                          If you use phpMyAdmin and look in the forums table, you'll see that each forum has both a parentid and a parentlist. If you want that forum to appear in the list, you have to put the parentid with a _ before it, and the parentlist with a ~ before it. This way, the code replaces the _ with 'parentid = ' and ~ with 'parentlist =' when creating the query.

                          Comment


                          • #14
                            hmmm...that's weird. JonnyQuest, I tried it your way. It works when I'm showing first-level categories, but it doesn't work when I'm trying to show second-level categories and their forums.

                            This is the problem: A second-level category has three numbers in its parentlist (for example: 4,1,-1). I tried to make just one second-level category to show by doing this in one of the if statements for the go variable in index.php:


                            $yourcat="4 OR parentlist='4,1,-1'";



                            obviously 4 is the parentid. I have no idea why 4,1,-1 within single quotes wouldn't work. I went to phpMyAdmin and it shows the second-level category's parentlist is 4,1,-1 and its forums' parentids are all 4s. I even tried 4,1 as parentlist but still won't work.

                            Am I missing something here? I'm pretty sure that parentid has to be 4. But I'm not so sure what parentlist should be (although logically it should be 4,1,-1 as shown in phpMyAdmin.) I've been trying to figure this out for the last 10 hours!!!!
                            Last edited by ForzaGrifo; Tue 17 Jul '01, 11:09pm.

                            Comment


                            • #15
                              Does anyone have any idea why using something like parentlist='4,1,-1' in the HAVING clause to query the 'forum' table wouldn't work?

                              What I want to do is retrieve all forums where their parentlist equals '4,1,-1' (I went to phpMyAdmin and it shows the one category that I want to show has parentlist of 4,1,-1.). I also want to retrieve all the forum within that category. The parentid for all those forums is 4 (again phpMyAdmin shows it's 4). Basically I'm doing this in my index.php:

                              I set variable $yourcat to "4 OR parentlist='4,1,-1'"


                              Then in index.php where it says forum info I added a HAVING clause:



                              //Forum info
                              $forums=$DB_site->query("SELECT * FROM forum WHERE displayorder<>0 AND active=1 HAVING parentid=$yourcat ORDER BY parentid,displayorder");
                              while ($forum=$DB_site->fetch_array($forums)) {
                              $iforumcache["$forum[parentid]"]["$forum[displayorder]" ["$forum[forumid]"] = $forum;
                              }





                              But I'm not retrieving any forums back on my screen.

                              Can somebody come to my rescue???
                              Last edited by ForzaGrifo; Wed 18 Jul '01, 1:54pm.

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X