Resource icon

vBulletin [MOD] Add a vBGallery BB Code Link

Kevin

Code Monkey
Staff member
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 =
      This tag will link a thumbnail to an image that is contained within vBa Gallery.
    • 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.
 
Back
Top