1. Welcome to CinVin!
    CinVin is a friendly general discussion community. From TV shows to graphics to technology to games and everything in between, this is the place to talk about it!

    You are currently viewing our community forums as a guest account user.
    Sign up or
    Having a CinVin account gives you privileges, such as creating & participating in discussions.

vBulletin [MOD] Add a vBGallery BB Code Link

Discussion in 'Forum Management' started by Kevin, Jun 13, 2007.

  1. Kevin Code Monkey
    Spaced

    Overview:
    This modification will allow you to create a new BB code that shows the thumbnail of a file in your Gallery that is linked to the Gallery page.

    Changes:
    Two (2) changes are needed. The first is to modify one (1) Gallery template and the second is to create one (1) new BB code.

    Instructions:

    Step #1 -- The template change
    • Modify your ADV_GALLERY_SHOWIMAGE template.
    • Look for...
      PHP:
       <if condition="$vba_options['gallery_imagebbcode']">
          <
      tr>
              <
      td class="alt1"><span class="smallfont"><b>$vbphrase[bb_image_code]:</b></span></td>
              <
      td class="alt1" colspan="3"><input class="bginput" type="text" value="[img]$image[/img]size="45" /></td>
          </
      tr>
      </if>
    • Replace it with...
      PHP:
       <if condition="$vba_options['gallery_imagebbcode']">
          <
      tr>
              <
      td class="alt1"><span class="smallfont"><b>$vbphrase[bb_image_code]:</b></span></td>
              <
      td class="alt1" colspan="3"><input class="bginput" type="text" value="[img]$image[/img]size="45" /></td>
          </
      tr>
          <
      tr>
              <
      td class="alt1"><span class="smallfont"><b>Thumbs $vbphrase[bb_image_code]:</b></span></td>
              <
      td class="alt1" colspan="3"><input class="bginput" type="text" value="[gallery=$image[imageid]]$image[thumbname][folderstring]/$image[thumbname][/gallery]" size="45" /></td>
          </
      tr>
      </if>
    • Save your template
    Step #2 -- The new BB code
    • After changing the template above go into your gallery and display any file. We'll copy & paste the new tag shown as the Example tag when creating our new BB code.
    • Go into your ACP and add a new BB code.
    • Use the following values....
      • Title = Gallery Link
      • Tag = gallery
      • Replace =
        PHP:
        <a href="http://www.coolscifi.com/gallery/showimage.php?i={option}" target="_self"><img src="{param}" /></a>
      • Example = {copy & paste the tag from the Gallery}
      • Description =
      • Use {option} = Yes
    • Replace "http://www.coolscifi.com/gallery" with the path to your own site.
    • Save your new BB code.
    Notes / Comments:
    • What's cool about this approach is that you could really put anything you want in there for the thumbnail. For example, if you know the image ID you could use the real image ID but then put in a completely different image to be used as the link.
    • This *should* work with all version of Gallery and all versions of vBulletin.
    • Your mileage may vary.

Share This Page

Pin It