Global start variable not available in postbit template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mferguson
    Member
    • Feb 2003
    • 80

    Global start variable not available in postbit template

    Some background....
    As I try to make my various sites run on the same versions of vBulletin I often set up variables in a Global Start plugin. With this variables I can turn on/off features across the site depending on whether it is needed.

    The issue I'm seeing...
    I added a new variable into the Global Start plug-in I've been using and use a conditional in the postbit template to control whether a link is presented to the user or not. If enabled the link would be visible with each person's post. Unfortunately it does not appear that the template "sees" or has access to these variables. Is this a bug or something that was intended? It appears that various other templates in vbulleting do have access to these.

    Thanks for any assistance you can provide!

    Mark
    Drive Thru Online vBulletin Plugins | PureSportsCar.com | GearHeadApps.com - iPhone and iPad App Reviews for the Motoring Enthusiast
  • Zachery
    Former vBulletin Support
    • Jul 2002
    • 59097

    #2
    Whats the code you are using, and how are you trying to make sue of it in the postbit template.

    Comment

    • mferguson
      Member
      • Feb 2003
      • 80

      #3
      The site-wide variables are set in the plug-in manager as DTO Global Variables and is using the global_start hook. The plug-in is set to active.

      Code:
      $dto_gallery_photopost = TRUE; // Flag denoting that gallery in use is Photopost
      
      $dto_gallery_vbgallery = FALSE; // Flag denoting if gallery in use is vba Gallery
      In the postbit template I added the following immediately after the Yahoo icon positioning in the post header.

      Code:
      <if condition="$dto_gallery_photopost">
      <a href="/gallery/showgallery.php?cat=500&ppuser=$post[userid]">Gallery</a>
      <else />
        <if condition="$dto_gallery_vbgallery">
        <a href="/gallery/browseimages.php?c=500&userid=$post[userid]">Gallery</a>
        </if>
      </if>
      Drive Thru Online vBulletin Plugins | PureSportsCar.com | GearHeadApps.com - iPhone and iPad App Reviews for the Motoring Enthusiast

      Comment

      • Zachery
        Former vBulletin Support
        • Jul 2002
        • 59097

        #4
        $GLOBAL['dto_gallery_photopost']

        Try that same for the vbgallery one

        Comment

        • mferguson
          Member
          • Feb 2003
          • 80

          #5
          This didn't appear to work either. The code in the template now looks like the following:

          Code:
          <if condition="$GLOBAL['dto_gallery_photopost']">
          <a href="/gallery/showgallery.php?cat=500&ppuser=$post[userid]">Gallery</a>
          <else />
            <if condition="$GLOBAL['dto_gallery_vbgallery']">
            <a href="/gallery/browseimages.php?c=500&userid=$post[userid]">Gallery</a>
            </if>
          </if>
          Drive Thru Online vBulletin Plugins | PureSportsCar.com | GearHeadApps.com - iPhone and iPad App Reviews for the Motoring Enthusiast

          Comment

          • Freddie Bingham
            Former vBulletin Developer
            • May 2000
            • 14057
            • 1.1.x

            #6
            Try $GLOBALS

            Comment

            • mferguson
              Member
              • Feb 2003
              • 80

              #7
              That did the trick. Just to close here is the final code that worked:

              Code:
              <if condition="$GLOBALS['dto_gallery_photopost']">
              <a href="/gallery/showgallery.php?cat=500&ppuser=$post[userid]">Gallery</a>
              <else />
                Blah
                <if condition="$GLOBALS['dto_gallery_vbgallery']">
                <a href="/gallery/browseimages.php?c=500&userid=$post[userid]">Gallery</a>
                </if>
              </if>
              Many thanks for the assistance!

              Mark
              Drive Thru Online vBulletin Plugins | PureSportsCar.com | GearHeadApps.com - iPhone and iPad App Reviews for the Motoring Enthusiast

              Comment

              • Zachery
                Former vBulletin Support
                • Jul 2002
                • 59097

                #8
                Originally posted by Freddie Bingham
                Try $GLOBALS
                I always get confused when it comes to $GLOBAL and $GLOBALS

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                😀
                😂
                🥰
                😘
                🤢
                😎
                😞
                😡
                👍
                👎