Post by Boy_Wonder on Feb 22, 2011 6:34:03 GMT -8
NB - you need to have this code installed to utilise this code Facebox
----
What this code does: This code works simply by assigning a 'rel' of facebox to any links that are added into the facebox ubbc tags.
Preview: dwfantasy.proboards.com/index.cgi?action=display&board=guidebook&thread=15&page=1 (Any of the images/links listed within that post utilise the 'facebox' system)
Code:
NB - if you are brave enough and experienced enough there is a chance that you could adapt this for other Lightbox systems dependent on if they use the 'rel' tag as referencing or not - if you want this customized to that then please contact me
----
What this code does: This code works simply by assigning a 'rel' of facebox to any links that are added into the facebox ubbc tags.
Preview: dwfantasy.proboards.com/index.cgi?action=display&board=guidebook&thread=15&page=1 (Any of the images/links listed within that post utilise the 'facebox' system)
Code:
<script type="text/javascript">
<!--
// Facebox posting
// concept by Natasha
// coded by Natasha adapted from the Tangent Tag by Wormopolis
// do not repost - keep header intact
//Edit here if you want to change the ubbc button
var buttonImage="http://i1102./g442/LoTRMR/faceboxbutton.png";
//DO NOT EDIT BELOW HERE
for (tds=document.getElementsByTagName('td'), t=0; t<tds.length; t++) {
if (tds[t].width=='80%' && tds[t].vAlign=='top' && tds[t].className.match(/windowbg/)) {
var postCell = tds[t].getElementsByTagName('table')[0].rows[1].cells[0];
if (postCell.innerHTML.match(/\[facebox=(.*?)\](.*?)\[\/facebox\]/i)) {
postCell.innerHTML=postCell.innerHTML.replace(/(alt|title)="\[image\] "/ig,'').replace(/\[facebox=((.|\n)*?)\](.*?)\[\/facebox\]/gi,function (res, hid, ign, txt) {return '<a href="'+hid+'" rel="facebox">'+txt+'</a>'; });
}
}
}
if (document.postForm) {
var tray=document.postForm.color.parentNode;
var tmpadd='<a href="javascript: add(\'[facebox=urlhere]\',\'[\/facebox]\');"><img src="'+buttonImage+'" border="0" alt="[facebox]" title="[facebox]"></a>';
tray.innerHTML+=tmpadd;
}
// -->
</script>
NB - if you are brave enough and experienced enough there is a chance that you could adapt this for other Lightbox systems dependent on if they use the 'rel' tag as referencing or not - if you want this customized to that then please contact me