Styles - this should be easy, correct?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Una Persson
    Member
    • May 2001
    • 44

    Styles - this should be easy, correct?

    I read the documentation, and I searched on such things as "styles", "replacement", "template", etc. But I still really do not understand how styles work in the new vBulletin. Is there some step-by-step documentation online that explains them, and how to work with them? Here's my situation:

    1) When I add a new style, I have options by Replacement Set of "Create new replacement set", "default", or can select from several others, which I have previously (I thought) deleted. What does this mean?

    2) When I add a new style, I also have options by Template set of "Create new template set", "default", and several others I thought I had deleted. What do these mean?

    3) All I really want to do right now is have all Forums have the same header and footer, and change the Forum picture in each Forum to be unique. That's all. What is the best way to go about this?
  • Kier
    Former Lead Developer, vBulletin
    • Sep 2000
    • 8179

    #2
    I think the easiest way to achieve this would be to follow FireFly's instructions here:

    Comment

    • Una Persson
      Member
      • May 2001
      • 44

      #3
      Well, his suggestion is a good one, but it says that it does not work while one is viewing threads. I want the graphic in a Forum, and all threads underneath it, to be the same. This was trivial in 1.1.6 - surely there must be an easy way to do this in 2.0.3?

      Comment

      • Kier
        Former Lead Developer, vBulletin
        • Sep 2000
        • 8179

        #4
        Actually, I believe his system will work on the showthread page as well as on forum pages.

        Comment

        • Una Persson
          Member
          • May 2001
          • 44

          #5
          I regret to say that it seems not to work once you are down in a thread, as (I suspect) it does not know what the $forumid is. I will likely have to look at the template option again. Is there a tutorial that explains how I should use the template functions to do this then?

          Comment

          • Chen
            Senior Member
            • Jun 2001
            • 8388

            #6
            Nope, it doesn't work inside threads. The problem is that global.php (evals phpinclude) is called in before the forumid is pulled from the database.
            Last edited by Chen; Thu 23 Aug '01, 9:54pm.
            Chen Avinadav
            Better to remain silent and be thought a fool than to speak out and remove all doubt.

            גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

            Comment

            • Mike Sullivan
              Former vBulletin Developer
              • Apr 2000
              • 13327
              • 3.6.x

              #7
              *cough* Try $getforum[forumid] *cough*

              Comment

              • Una Persson
                Member
                • May 2001
                • 44

                #8
                Originally posted by Ed Sullivan
                *cough* Try $getforum[forumid] *cough*
                Forgive me for being inexperienced at this - I am assuming that this is a function that returns the id of the forum you are viewing the thread in? If so, it looks promising. Would I put it in the phpinclude code that Firefly wrote in the other thread?

                Comment

                • Una Persson
                  Member
                  • May 2001
                  • 44

                  #9
                  Never mind, I figured it out - it seems to be working perfectly now for all cases.

                  I'm not *actually* dumb, just over-cautious when changing new things.

                  Comment

                  • Chen
                    Senior Member
                    • Jun 2001
                    • 8388

                    #10
                    This is what I used.
                    PHP Code:
                    if($getforum[forumid]) {
                      
                    $forumid  $getforum[forumid];
                    }

                    if (!
                    $forumid) {
                      
                    $logo "{titleimage}";
                    } else {
                      
                    $logo "{imagesfolder}/logo_forum";
                      
                    $logo .= "$forumid";
                      
                    $logo .= ".gif";

                    Thanks for the tip Ed!
                    Someone should add this to the Tips and Hints forum... a lot of users seems to ask this question.
                    Chen Avinadav
                    Better to remain silent and be thought a fool than to speak out and remove all doubt.

                    גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                    Comment

                    • Una Persson
                      Member
                      • May 2001
                      • 44

                      #11
                      Firefly, I found a possible bug with the code here.

                      As-implemented, it seems to kill the "Move Thread" function (I posted about it in "Troubleshooting"). I got around it by using a temporary variable (at the suggestion of my babe ) in this way:

                      PHP Code:
                      if($getforum[forumid]) {
                        
                      $pinky  $getforum[forumid];
                      }

                      if (!
                      $forumid && !$pinky) {
                        
                      $logo "images/vBulletin_logo.gif";
                      } else {
                        
                      $logo "images/logo_forum";
                        
                      $logo .= "$pinky";
                        
                      $logo .= ".gif";

                      Comment

                      • Chen
                        Senior Member
                        • Jun 2001
                        • 8388

                        #12
                        Actually it should be
                        PHP Code:
                        if($getforum[forumid]) {
                          
                        $pinky  $getforum[forumid];
                        }
                        $pinky $forumid;
                        if (!
                        $pinky) {
                          
                        $logo "images/vBulletin_logo.gif";
                        } else {
                          
                        $logo "images/logo_forum";
                          
                        $logo .= "$pinky";
                          
                        $logo .= ".gif";

                        Tanks for telling me!
                        Chen Avinadav
                        Better to remain silent and be thought a fool than to speak out and remove all doubt.

                        גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                        Comment

                        • Mike Sullivan
                          Former vBulletin Developer
                          • Apr 2000
                          • 13327
                          • 3.6.x

                          #13
                          PHP Code:
                          if($getforum[forumid]) {
                            
                          $pinky  $getforum[forumid];
                          }
                          $pinky $forumid
                          You realize that if block serves no purpose whatsoever with that code, right?

                          Comment

                          • Chen
                            Senior Member
                            • Jun 2001
                            • 8388

                            #14
                            Yeah, but I'm used to put blocks everytwhere - blame it on my teacher!
                            And besides, I like things organized.
                            Chen Avinadav
                            Better to remain silent and be thought a fool than to speak out and remove all doubt.

                            גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                            Comment

                            • Una Persson
                              Member
                              • May 2001
                              • 44

                              #15
                              Wait a second, Mr Sullivan - is my code correct then? The way I read it, it checks to see if there is a valid return for the $getforum function, if so sets local variable "$pinky" to it, and then goes on to the next block. Then in the next block, it sees if we don't have $forumid or $pinky, and if we don't it uses the default image. Else, it uses $pinky to construct a filename.

                              My code appears to work perfectly, and the Move Thread function is uncorrupted. Am I still doing something improper here?

                              And why doesn't "$pinky" go out of scope as soon as the code leaves the first braces, since it is dynamically created there? I must admit, I did not believe the code would even work at first, but my little gal told me to try it anyways, and it did.

                              Comment

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