Add quicktime and real video bbcode

From PunBB Resource Wiki

Jump to: navigation, search

Contents

header.php

Find line 121

	}
 
	return true
}

After, add

/***********************************************
* Image Thumbnail viewer- © Dynamic Drive (www.dynamicdrive.com)
* Last updated Sept 26th, 03'. This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
* 04.08.04 - Modifications apportées par Rod - Sortons.Net 
*    possibilité de choisir son média (image, texte, iframe, realvideo, Quicktime)
*    ne fonctionne qu'avec IE & Mozilla !
* Revision 18.08.04 Ajout Possibilité Quicktime
***********************************************/
tabS=new Array(); // Permet d'avoir des JS à l'interieur des popmedias
 
var ie=document.all
var ns6=document.getElementById&&!document.all
 
function ietruebody(){
    return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
    }
 
    function enlarge (which, e, nat, position, imgwidth, imgheight) {
        if (ie||ns6){
            crossobj=document.getElementById? document.getElementById("showdiv") : document.all.showimage
        if (position=="center"){
            pgyoffset=ns6? parseInt(pageYOffset) : parseInt(ietruebody().scrollTop)
            horzpos=ns6? pageXOffset+window.innerWidth/2-imgwidth/2 : ietruebody().scrollLeft+ietruebody().clientWidth/2-imgwidth/2
            vertpos=ns6? pgyoffset+window.innerHeight/2-imgheight/2 : pgyoffset+ietruebody().clientHeight/2-imgheight/2
        if (window.opera && window.innerHeight) //compensate for Opera toolbar
            vertpos=pgyoffset+window.innerHeight/2-imgheight/2
            vertpos=Math.max(pgyoffset, vertpos)
        }
 
        else {
            var horzpos=ns6? pageXOffset+e.clientX : ietruebody().scrollLeft+event.clientX
            var vertpos=ns6? pageYOffset+e.clientY : ietruebody().scrollTop+event.clientY
        }
 
 
    crossobj.style.left=horzpos+"px"
    crossobj.style.top=vertpos+"px"
 
 
    // Modifs par Rod 04.08.04 : en tapant simplement le type de media que l'on souhaite dans l'url, le script prend en charge le innerHTML correspondant
    // On peut donc creer tout son systeme multimedia sur ce SIMPLE js ... la fete pour la mise a jour (il suffit de tout changer ICI)
 
    if (nat=="img") {
    crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Fermer cette fenêtre</span> </div><img src="'+which+'">'
    crossobj.style.display="block"
        }
 
    if (nat=="text") {
    crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Fermer cette fenêtre</span> </div><div style="width: 320px; height: 210px; padding: 10px; margin: 10px; overflow: auto; text-align:left">'+which+'</div>'
    crossobj.style.display="block"
        }
 
    if (nat=="iframe") {
    crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">fermer cette fenêtre</span> </div><iframe src="'+which+'" width="600" height="400" frameborder="0" allowTransparency="true" scroll="auto" ></iframe>'
    crossobj.style.display="block"
        }
 
    if (nat=="realvideo") {
    crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Fermer cette fenêtre</span> </div><embed src='+which+' width=320 height=240 type=audio/x-pn-realaudio-plugin console=Clip1 autostart=true controls=ImageWindow><br><embed src='+which+' width=320 height=20 type=audio/x-pn-realaudio-plugin console=Clip1 autostart=true controls=ControlPanel></embed>'
    crossobj.style.display="block"
        }
 
    if (nat=="quicktime") {
    crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Fermer cette fenêtre</span> </div><OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="320" HEIGHT="188" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"><PARAM NAME="controller" VALUE="false"><PARAM NAME="type" VALUE="video/quicktime"><PARAM NAME="autoplay" VALUE="false"><PARAM NAME="target" VALUE="myself"><PARAM NAME="src" VALUE="http://www.themoviebox.net/trailers/CLICK-IMAGE.gif"><PARAM NAME="pluginspage" VALUE="http://www.apple.com/quicktime/download/indext.html"><EMBED WIDTH="320" HEIGHT="188" CONTROLLER="false" TARGET="myself" SRC="http://www.themoviebox.net/trailers/CLICK-IMAGE.gif" href="'+which+'" type="video/quicktime" BGCOLOR="#000000" BORDER="0" PLUGINSPAGE="http://www.apple.com/quicktime/download/indext.html" autoplay="false"></EMBED></OBJECT>'
    crossobj.style.display="block"
        }
 
    return false
    }
 
 
    else  //if NOT IE 4+ or NS 6+, simply display image in full browser window
    return true
    }
 
    function closepreview() {
        crossobj.style.display="none"
    }
 
    function drag_drop(e){
        if (ie&&dragapproved){
            crossobj.style.left=tempx+event.clientX-offsetx+"px"
            crossobj.style.top=tempy+event.clientY-offsety+"px"
        }
        else if (ns6&&dragapproved){
            crossobj.style.left=tempx+e.clientX-offsetx+"px"
            crossobj.style.top=tempy+e.clientY-offsety+"px"
        }
        return false
    }
 
    function initializedrag(e){
        if (ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar"){
            offsetx=ie? event.clientX : e.clientX
            offsety=ie? event.clientY : e.clientY
 
            tempx=parseInt(crossobj.style.left)
            tempy=parseInt(crossobj.style.top)
 
        dragapproved=true
        document.onmousemove=drag_drop
        }
    }
 
document.onmousedown=initializedrag
document.onmouseup=new Function("dragapproved=false")

style/imports/base.css

Add to the end of the file:

#showdiv {
           position : absolute;
           display : none;
           z-index : 3000;
           color : #b4c4d8;
           font-size : 11px;
    }
 
#dragbar {
           padding : 1px;
           min-width : 100px;
           cursor : pointer;
           color : #fff;
      }
 
#dragbar a {
    background : #000;
}
 
#dragbar #closetext {
           margin-right : 2px;
           font-weight : bold;
           font-size : 16px;
      }

include/templates/main.tpl

Find

<pun_footer>

After, add

<div id="showdiv"></div>

include/parser.php

Find

					 '#\[email=(.*?)\](.*?)\[/email\]#',

After, add

					 '#\[qt=(.*?)\](.*?)\[/qt\]#',
					 '#\[real=(.*?)\](.*?)\[/real\]#',

Find

  					 '<a href="mailto:$1">$2</a>',

After, add

					 '<a href="$1" onclick="return enlarge(\'$1\', event, \'quicktime\', \'center\', \'320\', \'188\')">$2</a>',
					 '<a href="$1" onclick="return enlarge(\'$1\', event, \'realvideo\', \'center\', \'320\', \'240\')">$2</a>',
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox