PDA

View Full Version : Modifying the album_picturebit template to create a lightbox effect


Scathefire
06-15-2008, 11:18 PM
I'm wanting to get the highslide javascript image viewer (http://vikjavev.no/highslide/) to work in my vbulletin albums. It currently works for post attachments in threads, but I can't seem to to get this to work. I'm sure its juse because I am failing to structure it properly.

This is the suggested structure given by the highslide documentation:

<a id="thumb1" href="images/full-image.jpg" class="highslide" onclick="return hs.expand(this)">
<img src="images/thumbnail.jpg" alt="Highslide JS"
title="Click to enlarge" height="120" width="107" /></a>

Here is the default code for album_picturebit:

<table style="width:{$picturebit_width}px; height:{$picturebit_height}px; margin:5px; float:$stylevar[left]" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="smallfont" align="center" valign="middle">
<if condition="$picture['thumburl']">
<a href="album.php?$session[sessionurl]albumid=$albuminfo[albumid]&amp;pictureid=$picture[pictureid]"><img class="alt2" src="$picture[thumburl]" alt="$picture[caption_preview]" border="0" style="
padding:$stylevar[cellpadding]px;
<if condition="!$usercss">border:solid $stylevar[cellspacing]px $stylevar[tborder_bgcolor]</if>
" $picture[dimensions] /></a>
<else />
<a href="album.php?$session[sessionurl]albumid=$albuminfo[albumid]&amp;pictureid=$picture[pictureid]"><if condition="$picture['caption_preview']">$picture[caption_preview]<else />$vbphrase[picture]</if></a>
</if>
<if condition="$show['moderation']"><br /><span class="shade">$vbphrase[picture_moderated]</span></if>
</td>
</tr>
</table>

Since it is already working in post attachments, I looked at the currently modified template, postbit_attachmentthumbnail and see it is structured like this:

<a href="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;d=$attachment[dateline]" rel="Lightbox" id="attachment$attachment[attachmentid]"<if condition="$show['newwindow']"> target="_blank"</if>><img class="thumbnail" src="attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&amp;stc=1&amp;thumb=1&amp;d=$attachment[thumbnail_dateline]" border="0" alt="<phrase 1="$attachment[filename]" 2="$attachment[counter]" 3="$attachment[filesize]" 4="$attachment[attachmentid]">$vbphrase[image_larger_version_x_y_z]</phrase>" /></a>
&nbsp;<if condition="$show['br']"><br /><br /></if>

What confuses me is there is nothing like "onclick" or anything like that, but on the generated page it spits out:

<!-- BEGIN TEMPLATE: postbit_attachmentthumbnail -->
<a id="att_1253" rel="http:_slash__slash_www.websiteurl.com_slash_forums _slash_attachment.php?attachmentid=1253&amp;d=12131218 12" class="highslide" onclick="return hs.expand(this, { slideshowGroup: '57562' })" href="attachment.php?attachmentid=1253&amp;d=1213121812" rel="Lightbox" id="attachment1253"><img class="thumbnail" src="attachment.php?attachmentid=1253&amp;stc=1&amp;thumb=1&amp;d=1 213121812" border="0" alt="Click image for larger version

Name: screenshot12.jpg
Views: 33
Size: 238.2 KB
ID: 1253" /></a>
&nbsp;
<!-- END TEMPLATE: postbit_attachmentthumbnail -->

Can anyone help me with this? I like highslides ability to open up multiple images at a time, and it seems smoother than the default vbulletin lightbox feature. In general, this is superior than the out of the box option offered.

The post thumbnail highslide feature is done by this now dead mod:

https://vborg.vbsupport.ru/showthread.php?t=139167

Attached is the xml file if anyone wishes to look at it and maybe offer me a suggestion. I would be grateful with any assistance someone can offer with getting this to work.

Scathefire
06-20-2008, 05:58 PM
Sorry for bumping this.

Any suggestions? Or even a new direction I should go in?

Guest210212002
06-20-2008, 06:31 PM
You could probably use Thickbox highslide for this somewhat easily, you'd just need to tinker with the template code to parse/add in the path variables on the fly. An example of thickbox is here, on a site I threw up for a luthier friend of mine:

http://www.sherman-customs.com/

Same as any other HS and a breeze to set up.

Dr. Bantham
06-28-2008, 02:29 PM
I am also very interested in getting this integrated. Any luck? This would made a great mod!