Announcement

Collapse
No announcement yet.

Plug In

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

  • Plug In

    I created a plug in so a specific group of forums would have a special logo, but the other forums would default to the image in Style Vars. Here is what I created:

    Code:
    [COLOR=#000000][COLOR=#0000bb][/COLOR][FONT=Courier New][COLOR=#007700]if([/COLOR][COLOR=#0000bb]$vbulletin[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]GPC[/COLOR][COLOR=#007700][[/COLOR][COLOR=#0000bb]forumid[/COLOR][COLOR=#007700]] == [/COLOR][COLOR=#dd0000]'1'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700])
    {
       [/COLOR][COLOR=#0000bb]$BannerImg [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]'special.png'[/COLOR][/FONT][FONT=Courier New][COLOR=#007700];
    }
    else
    {
       [/COLOR][COLOR=#0000bb]$BannerImg [/COLOR][COLOR=#007700]= [/COLOR][COLOR=#dd0000]'default.png'[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];
    } [/FONT][/COLOR][/COLOR]
    I did the first forum id, however, when I go to add another forum to use the special image, it defaults. What is wrong?
    Have a great day! :cool:

  • #2
    Depends how you're adding the second. What did you try?

    Comment


    • #3
      First, I tried to just add it below the first plug in code. Didn't work. Then I added a NEW plug in, calling it something different, changed the forum id, and that didn't work. Still giving me the default logo in the forums. Except for the first plug i created. It's the only one working.
      Have a great day! :cool:

      Comment


      • #4
        PHP Code:
        if (($vbulletin->GPC[forumid] == '1') OR ($vbulletin->GPC[forumid] == '2'))
        {
           
        $BannerImg 'special.png';
        }
        else
        {
           
        $BannerImg 'default.png';

        Comment


        • #5
          Originally posted by Dilly View Post
          PHP Code:
          if (($vbulletin->GPC[forumid] == '1') OR ($vbulletin->GPC[forumid] == '2'))
          {
             
          $BannerImg 'special.png';
          }
          else
          {
             
          $BannerImg 'default.png';

          Dilly, do I make a new plug with the edited above code, or just keep it under the code in the first/original plug in?
          Have a great day! :cool:

          Comment


          • #6
            Replace the original. If you have a glance through and compare what I posted it should make more sense. I've just added another condition.

            Comment


            • #7
              If I'm changing 5 forums, do I change the "OR" to "AND"?
              Have a great day! :cool:

              Comment


              • #8
                Nope. Just keep tacking on more ORs.

                Ie.
                PHP Code:
                if (($vbulletin->GPC[forumid] == '1') OR ($vbulletin->GPC[forumid] == '2') OR ($vbulletin->GPC[forumid] == '3') OR ($vbulletin->GPC[forumid] == '4') OR ($vbulletin->GPC[forumid] == '5')) 

                Comment


                • #9
                  I included a screen shot. I'ts not working. Where am I off?
                  Attached Files
                  Have a great day! :cool:

                  Comment


                  • #10
                    What do you mean its not working? The image doesn't display?

                    A link to your site may help.

                    Comment


                    • #11
                      My user name is Becky. I had to IM you a password and link, because it's a completley private board. Go to the Main street board. It should have a differnt logo than the main board one.
                      Have a great day! :cool:

                      Comment


                      • #12
                        I was told to change the header to this: It's working in forum id 128 and 129. What would be the code to add 3 more, and where would it go?

                        <img src="<if condition="$foruminfo['forumid'] == 128">images/spotlight/communitycorner1.gif<else /><if condition="$foruminfo['forumid'] == 129">images/spotlight/communitycorner1.gif<else />
                        $stylevar[titleimage]</if></if>" border="0" alt="$vboptions[bbtitle]" /></a></td>

                        I tried to duplicated the code, but I'm getting addtional title images. When I duplicated the code to add more forums, I put this at the end.

                        $stylevar[titleimage]</if></if>" border="0" alt="$vboptions[bbtitle]" /></a></td>

                        Any ideas?
                        Have a great day! :cool:

                        Comment


                        • #13
                          I got it! Thank you everybody!
                          Have a great day! :cool:

                          Comment

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