1 (edited by Ju 2005-05-05 17:46)

Topic: [BBCODE] - include swf

(sorry for my english)

Edit include/parser.php, after (line ~440) :

    $text = str_replace('<p></p>', '', '<p>'.$text.'</p>');

add :

    // BBCODE - Gestion des swf
    $codeswf = "\n\t\t\t\t\t<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0\" width=\"\$2\" height=\"\$3\">\n\t\t\t\t\t  <param name=\"movie\" value=\"\$1\" />\n\t\t\t\t\t  <param name=\"quality\" value=\"high\" />\n\t\t\t\t\t  <param name=\"loop\" value=\"false\" />\n\t\t\t\t\t  <embed src=\"\$1\" quality=\"high\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"\$2\" height=\"\$3\" loop=\"false\"></embed>\n\t\t\t\t\t</object>\n\t\t\t\t\t";
    $text = preg_replace("/\[swf url=([^ ]+) width=([0-9]*) height=([0-9]*)\]/", $codeswf, $text);

Save and upload (overwrite).

The bbcode syntaxe is :

[swf url=http://www.ndd.nld/flash.swf width=550 height=413]

smile

2

Re: [BBCODE] - include swf

For no duplicate :

Edit post.php, after (~ line 345) :

        list($q_poster, $q_message) = $db->fetch_row($result);

Add :

        $q_message = preg_replace("/\[swf url=([^ ]+) width=([0-9]*) height=([0-9]*)\]/", "[url]$1[/url]", $q_message);

Save and upload.

Re: [BBCODE] - include swf

wow nice this is good for content

4 (edited by Ataxy 2005-05-05 23:40)

Re: [BBCODE] - include swf

wow cool mod
merci ju!

Re: [BBCODE] - include swf

I don't how to do this but when you delete a post with a flash video posted you think you could make it where it does not show the video again so you won't have to wait for it to load.

Re: [BBCODE] - include swf

Has anyone devised a way to include QuickTime movies?

7

Re: [BBCODE] - include swf

I have an idea about Videos ... but usign DHTML ... (but great effect)

if someone is able to see with me how to "transform" it in BBcode ...

Re: [BBCODE] - include swf

well if you just post the template for the html output for a video then i can convert that to bbcode easily

9 (edited by Rod 2005-05-08 21:26)

Re: [BBCODE] - include swf

OK .... smile

look at this ...

/***********************************************
* 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")

I have modified this Dynamicdrive Code to implement all possible medias, with the size or height I want : perfect only JS to modify ... (for width and height, 'cause appareance = CSS)

#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;
      }

Ok ... after place where you want in your code (on the bottom page for example)

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

Now if I want to show an url with a QUICKTIME MOVIE, I would like to have


[qt=urlofmyvideo.mov]Name of my Video[/qt]

[real=urlofmyRV.rm]Name of my Real[/real]

The final code in source would be ...

For QT : 
<a href="urlofmyvideo.mov"  onclick="return enlarge('urlofmyvideo.mov', event, 'quicktime', 'center', '320', '188')">name of my video</a>

For Real : 
<a href="urlofmyvideo.rm"  onclick="return enlarge('urlofmyvideo.rm', event, 'realvideo', 'center', '320', '240')">name of my video</a>

What happens if a browser isn't able to read this dhtml ?

Browsers which can read simple JS will open in NORMAL popup window the url

for very old browsers, it links directly to the media ...



Connorhd, if you do this, you are my God smile

10

Re: [BBCODE] - include swf

Connorhd, afraid ? smile

Re: [BBCODE] - include swf

no, just super busy, gimme this weekend and i'll get it done, if i don't get it done then post again i'll have probably just forgotten

12 (edited by Apupv 2005-05-13 17:49)

Re: [BBCODE] - include swf

I've got a problem with the bbcode :
I can't put a Swf in a signature.
Anyway, it works great in the post.

Does anyone know how to fix it ?


J'ai un probleme avec ce bbcode : je n'arrive pas à mettre un swf dans une signature.
Pourtant ça marche très bien dans les messages.

Quelqu'un a une idée pour régler ça ?

13

Re: [BBCODE] - include swf

Still nobody ?

Well, i'll have to wait tongue

Re: [BBCODE] - include swf

rod, i am your god big_smile http://punres.org/doku.php?id=tutorials … deo_bbcode

15

Re: [BBCODE] - include swf

Why don't you embed videos in SWF as seen here?:
http://crohn-colitis.hu/forum/viewtopic.php?id=72

Re: [BBCODE] - include swf

whats the point?

17

Re: [BBCODE] - include swf

No smile


When I put your code inside parser.php, the viewtopic.php is BROKEN (no more header, no more style ...)

Re: [BBCODE] - include swf

could you paste your parser.php here?

edit: i know why the stupid wiki stripped the slashes

edit2: should be

                     '<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>',

19

Re: [BBCODE] - include swf

Ok ... smile another problem ....

my actual bbcode is

$pattern = array('#\[b\](.*?)\[/b\]#s',
                     '#\[i\](.*?)\[/i\]#s',
                     '#\[u\](.*?)\[/u\]#s',
                     '#\[url\](.*?)\[/url\]#e',
                     '#\[url=(.*?)\](.*?)\[/url\]#e',
                     '#\[email\](.*?)\[/email\]#',
                     '#\[email=(.*?)\](.*?)\[/email\]#',
                     '#[qt=(.*?)](.*?)[/qt]#',
                     '#[real=(.*?)](.*?)[/real]#',
                     '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');


    $replace = array('<strong>$1</strong>',
                     '<em>$1</em>',
                     '<span class="bbu">$1</span>',
                     'handle_url_tag(\'$1\')',
                     'handle_url_tag(\'$1\', \'$2\')',
                     '<a href="mailto:$1">$1</a>',
                     '<a href="mailto:$1">$2</a>',
                                    '<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>',
                     '<span style="color: $1">$2</span>');

But when I read the forum, ALL MY QUOTES become ...


[<ickn gv', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')"><u con k ickn gu con k v', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')"> hfs c nous km kiickn gs c nous km kiv', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')">i c so hf" oncn g', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')"> on y vn m hfickn gv', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')"><ickn gv', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')"> hfs cooickn gs coov', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')"> hfickn gv', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')">]
T's un pà d di ça !
J hfn é y'" oncn gn é y'', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')"> hf jis di" oncn g jis di', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')"> hf ci" oncn g ci', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')">ob !

D hfickn gv', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')"> f s hfouv v fi is d'hui " oncn gouv v fi is d'hui ', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')"> n<éi" oncn géi', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')"> mais vu !)
Donc jos comm m hf m'in" oncn g m'in', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')"> pnd mcs jus<u 20 ickn gu 20 v', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')">a>...
En <ickn gv', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')">s si c confi, is< " oncn g ', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')"> j'ns cul.
Jin<nickn gnv', 'c<" onclick="return enlarge('', '320', '188')"><', event, 'realvideo', 'center', '320', '240')"> < jns d'is j sbson" oncn g jns d'is j sbson', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')">s <nd jis confi" oncn gnd jis confi', nt, 'quicktimnt', '320', '188'<" onclick="return enlarge('"><', event, 'realvideo', 'center', '320', '240')">a>ion.

20

Re: [BBCODE] - include swf

CONNORHDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD


smile smile smile

Re: [BBCODE] - include swf

if you look at the first bit of the bbcode its missing slashes too make it so it has slashes where the email one has

22

Re: [BBCODE] - include swf

don't understand ...

without the video bbcode, it works

with it, it crashes


I don't understand your sentence.

Re: [BBCODE] - include swf

instead of

$pattern = array('#\[b\](.*?)\[/b\]#s',
                     '#\[i\](.*?)\[/i\]#s',
                     '#\[u\](.*?)\[/u\]#s',
                     '#\[url\](.*?)\[/url\]#e',
                     '#\[url=(.*?)\](.*?)\[/url\]#e',
                     '#\[email\](.*?)\[/email\]#',
                     '#\[email=(.*?)\](.*?)\[/email\]#',
                     '#[qt=(.*?)](.*?)[/qt]#',
                     '#[real=(.*?)](.*?)[/real]#',
                     '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');

use

$pattern = array('#\[b\](.*?)\[/b\]#s',
                     '#\[i\](.*?)\[/i\]#s',
                     '#\[u\](.*?)\[/u\]#s',
                     '#\[url\](.*?)\[/url\]#e',
                     '#\[url=(.*?)\](.*?)\[/url\]#e',
                     '#\[email\](.*?)\[/email\]#',
                     '#\[email=(.*?)\](.*?)\[/email\]#',
                     '#\[qt=(.*?)\](.*?)\[/qt\]#',
                     '#\[real=(.*?)\](.*?)\[/real\]#',
                     '#\[color=([a-zA-Z]*|\#?[0-9a-fA-F]{6})](.*?)\[/color\]#s');

24 (edited by Rod 2005-05-19 18:50)

Re: [BBCODE] - include swf

It works !!!! smile


Look at http://www.sortons.net/forum/viewtopic.php?id=3843

and search the sentence Le trailer APPLE.COM est visible ICI (nouveau BBCode Sortons.Net qui permet de linker direct les videos en restant sur le site)


Click on the word "ICI" smile

25

Re: [BBCODE] - include swf

Update of JS Code : you can now put WMV files

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="189" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab"><PARAM NAME="src" VALUE="'+which+'"><PARAM NAME="controller" VALUE="true"><PARAM NAME="target" VALUE="myself"><PARAM NAME="pluginspage" VALUE="http://www.apple.com/quicktime/download/"><EMBED WIDTH="320" HEIGHT="189" CONTROLLER="true" TARGET="myself" SRC="'+which+'" BORDER="0" PLUGINSPAGE="http://www.apple.com/quicktime/download/indext.html"></EMBED></OBJECT>'
    crossobj.style.display="block"
        }

    if (nat=="wmv") {
    crossobj.innerHTML='<div align="right" id="dragbar"><span id="closetext" onClick="closepreview()">Fermer cette fenêtre</span> </div><object name=wmv id=wmv classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width="320" height="309"><PARAM NAME="URL" VALUE="'+which+'"><PARAM NAME="ShowControls" VALUE="TRUE"><PARAM NAME="TransparentAtStart" VALUE="TRUE"><PARAM NAME="AutoSize" VALUE="TRUE"><PARAM NAME="fullScreen" VALUE="FALSE"><embed src="'+which+'" type="video/x-ms-asf-plugin" width="320" height="285" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" autostart="1" showcontrols="1" AutoSize="1" ShowStatusBar="1" vspace="0" hspace="0" border="0" name="wmv" fullScreen="0"></embed></object>'
    crossobj.style.display="block"
        }

With the help of Connorhd, this mod allows you to put Quicktime, Real and WMV files directly on your forum, with an elegant DHTML solution. 100% well degradable (users who have no dhtml browser open the videos on a new window, people who desactive / don't have javascript have a direct link video.)