1
ohwada
Add [flash] tag to BB code
  • 2005/6/28 15:58

  • ohwada

  • Just popping in

  • Posts: 28

  • Since: 2003/11/15


Extension of BB code
hack of module.textsanitizer.php

Get from here

1. Added image size parameter to [ img ] tag.

You can use three specification.
(1) [ img ]url,width,height[ /img 
(
2) [ img ]url,width[ /img 
(
3) [ img ]url[ /img ]


2. Added [ flash ] tag.
You can use FLASH in text.

You can use three specification.
(1) [ flash ]url,width,height[ /flash 
(
2) [ flash ]url,width[ /flash 
(
3) [ flash ]url[ /flash ]

2
bluenova
Re: Add [flash] tag to BB code

Nice

3
Mithrandir
Re: Add [flash] tag to BB code

Could I get you to re-do them so that the extra specifications go inside the [ ] ?

e.g. [ img width=25 heigh=120]url[/img]

Then it would be like the other tags that have additional parameters.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

4
phppp
Re: Add [flash] tag to BB code
  • 2005/6/28 17:47

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


Quote:

Mithrandir wrote:
Could I get you to re-do them so that the extra specifications go inside the [ ] ?

e.g. [ img width=25 heigh=120]url[/img]



This has been available in my xoopsextendedcode hack, with which flash/media/realplayer are also available

5
Mithrandir
Re: Add [flash] tag to BB code

On that note, I am a little wary about letting just anybody add flash to e.g. a forum post. Am I being paranoid or could it lead to a security problem? (my knowledge about flash and what you can do with it is rather limited, sorry)
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

6
phppp
Re: Add [flash] tag to BB code
  • 2005/6/28 18:22

  • phppp

  • XOOPS Contributor

  • Posts: 2857

  • Since: 2004/1/25


yes, flash player should be restricted to common users.

the [img ] part in that hack, including auto-resizing, I think it does not introduce new vulnerability than XOOPS' original [img ] parser, but could slow down a little.

7
Mithrandir
Re: Add [flash] tag to BB code

Yeah, I have no problems with the image tag - it's just the flash tag, I'm worrying about.
"When you can flatten entire cities at a whim, a tendency towards quiet reflection and seeing-things-from-the-other-fellow's-point-of-view is seldom necessary."

Cusix Software

8
si13n7ki11er
Re: Add [flash] tag to BB code

is there any possible way to convert this into BBCode?

<embed src="http://card.mygamercard.net/si13n7ki11er.swf" classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" type="application/x-shockwave-flash" width="198" height="135">
</embed>

I have tried things like:

[embed]http://card.mygamercard.net/si13n7ki11er.swf[/embed]

[flash]http://card.mygamercard.net/si13n7ki11er.swf[/flash]

[flash]http://card.mygamercard.net/si13n7ki11er.swf,198,135[/flash]

9
sakyant
Re: Add [flash] tag to BB code
  • 2008/10/3 7:42

  • sakyant

  • Just popping in

  • Posts: 13

  • Since: 2006/8/13


I dont have time in the moment to find the snippet (also im not a programmer but i could find it if i had time.)
But i have an "smf" forum on one of my sites, and it has a module i downloded to be able to insert a youtube and co video in the forum posts.
This is so excellently made, that all the enduser needs to do is insert the url in the post !! i mean.. no bb tags no embed code necessary! just copy and paste the url from the page where your clip was found and presto!
you cant get get any better than that, here is a link to some post

http://www.dharmathai.com/forum/index.php?topic=132.0


so you can look (i hope im allowed to do this, sorry in case i shouldnt post links to my site im not doing it for any other reason to help you all think of a way to get your result.. if you like the result on that link, then i would recommend downloading one of the smf forums and looking at the code.
actually , better even - here is the name of the module for you to downlaod and look at code instead.
Auto Embed Video Clips 2.1.4

whle im at it id like to compare the bb forum with the smf too..
on posting if you wish to insert a smiley in the middle of the post you have to insert smile forst (will appear always at bottom of post! regardless of where you selcted on the textfield burrrrrrrr~!! boring! and then cut and paste where you want.. urtl inserts are the same BS.. the thing just is useless.
But heres the worst thing.. to install a module you have to uplaod per ftp prgram! *separate program) On SMF forums they have an upload interface on the admin CP where oyu just upload the zip folder of the module and press install so you dont need a separate
ftp program to install../ plus you dont have to uplooad as unzipped which is so very slow.
here is the snippet i found of code from the videoclip module, along with a hack for it.



-----------------------

<?php/********************************************************************************* Subs-AutoEmbedVideoClips.php v2.1.4                                    ** By Karl Benson                                                    **********************************************************************************This program is distributed in the hope that it is and will be useful, butWITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITYor FITNESS FOR A PARTICULAR PURPOSE.********************************************************************************/if (!defined('SMF'))    die('Hacking attempt...');function AutoEmbedVideoClips($message){    // Access globals    global $context, $modSettings;    // Max auto embedded video clips *per page* to avoid flash overload. It only applies to this mod, and not other video mods.    // Use -1 for no-limit (not recommended)    static $autoembedmax = 12;        $video_sites = array(        // Put the most popular first for speed        array(            'name' => 'YouTube',            'enabled' => 1,            'pattern' => 'http://(?:video.google.(?:com|com.au|co.uk|de|es|fr|it|nl|pl|ca|cn)/(?:[^"]*?))?(?:(?:www|au|br|ca|es|fr|de|hk|ie|it|jp|mx|nl|nz|pl|ru|tw|uk).)?youtube.com(?:[^"]*?)?(?:&|/|?|;|%3F|%2F)(?:video_id=|v(?:/|=|%3D|%2F))([0-9a-z-_]{11})',            // Includes parsing of youtube videos on google            'movie' => 'http://www.youtube.com/v/$1&rel=1',            'width' => '425',            'height' => '350',        ),        array(            'name' => 'YouTube Playlist',            'enabled' => 1,            'pattern' => 'http://(?:(?:www|au|br|ca|es|fr|de|hk|ie|it|jp|mx|nl|nz|pl|ru|tw|uk).)?youtube.com(?:[^"]*?)?(?:&|/|?|;)(?:id=|p=|p/)([0-9a-f]{16})',            'movie' => 'http://www.youtube.com/p/$1&rel=1',            'width' => '425',            'height' => '355',        ),        array(            'name' => 'Google Video',            'enabled' => 1,            'pattern' => 'http://video.google.(com|com.au|co.uk|de|es|fr|it|nl|pl|ca|cn)/(?:videoplay|url|googleplayer.swf)?(?:[^"]*?)?docid=([0-9a-z-_]{1,20})',            'movie' => 'http://video.google.$1/googleplayer.swf?docId=$2',            'width' => '400',            'height' => '326',        ),        array(            'name' => 'Dailymotion',            'enabled' => 1,            'pattern' => 'http://(?:www.)?dailymotion.(?:com|alice.it)/(?:(?:[^"]*?)?video|swf)/([a-z0-9]{1,8})',            'movie' => 'http://www.dailymotion.com/swf/$1',            'width' => '420',            'height' => '335',        ),        array(            'name' => 'Megavideo',            'enabled' => 1,            'pattern' => 'http://(?:www.)?megavideo.com/?(?:[^"]*?)?v=([0-9a-z]{8})',            'movie' => 'http://www.megavideo.com/v/$1.0.0',            'width' => '432',            'height' => '351',        ),        array(            'name' => 'MetaCafe',            'enabled' => 1,            'pattern' => 'http://(?:www.)?metacafe.com/(?:watch|fplayer)/([0-9]{1,10})/',            'movie' => 'http://www.metacafe.com/fplayer/$1/metacafe.swf',            'width' => '400',            'height' => '345',        ),        array(            'name' => '123video.nl',            'enabled' => 1,            'pattern' => 'http://(?:www.)?123video.nl/playvideos.asp?(?:[^"]*?)?MovieID=([0-9]{1,8})',            'movie' => 'http://www.123video.nl/123video_share.swf?mediaSrc=$1',            'width' => '420',            'height' => '339',        ),        array(            'name' => 'Aniboom',            'enabled' => 1,            'pattern' => 'http://(?:www.)?aniboom.com/Player.aspx?(?:[^"]*?)?v=([0-9]{1,8})',            'movie' => 'http://api.aniboom.com/embedded.swf?videoar=$1',            'width' => '448',            'height' => '372',        ),        array(            'name' => 'AOL Uncut',            'enabled' => 1,            'pattern' => 'http://uncutvideo.aol.com/videos/([0-9a-f]{32})',            'movie' => 'http://uncutvideo.aol.com/v6.220/en-US/uc_videoplayer.swf?aID=1$1&site=http://uncutvideo.aol.com/',            'width' => '415',            'height' => '347',        ),        array(            'name' => 'AtomFilms',            'enabled' => 1,            'pattern' => 'http://(?:www.)?atomfilms.com/film/([0-9a-z_-]{1,40}).jsp',            'movie' => 'http://www.atomfilms.com:80/a/autoplayer/shareEmbed.swf?keyword=$1',            'width' => '426',            'height' => '350',        ),        array(            'name' => 'AtomFilms Uploads',            'enabled' => 1,            'pattern' => 'http://uploads.atomfilms.com/Clip.aspx?(?:[^"]*?)?key=([0-9a-f]{1,16})',            'movie' => 'http://uploads.atomfilms.com/player.swf?key=$1',            'width' => '430',            'height' => '354',        ),        array(            'name' => 'Biku',            'enabled' => 1,            'pattern' => 'http://(?:www.)?biku.com/opus/(?:player.swf?(?:[^"]*?)?VideoID=)?([0-9]{1,8})',            'movie' => 'http://www.biku.com/opus/player.swf?VideoID=$1&embed=true&autoStart=false',            'width' => '480',            'height' => '395',        ),        array(            'name' => 'BrightCove',            'enabled' => 1,            'pattern' => 'http://(?:www.)?brightcove.(tv|com)/title.jsp?(?:[^"]*?)?title=([0-9]{1,12})',            'movie' => 'http://www.brightcove.$1/playerswf?allowFullScreen=true&initVideoId=$2&servicesURL=http://www.brightcove.tv'                            .'&viewerSecureGatewayURL=https://www.brightcove.tv&cdnURL=http://admin.brightcove.com&autoStart=false',            'width' => '486',            'height' => '412',        ),        array(            'name' => 'CellFish',            'enabled' => 1,            'pattern' => 'http://cellfish.cellfish.com/(?:video|multimedia)/([0-9]{1,8})',            'movie' => 'http://cellfish.com/static/swf/player.swf?Id=$1',            'width' => '420',            'height' => '315',        ),        array(            'name' => 'ClipFish.de',            'enabled' => 1,            'pattern' => 'http://(?:www.)?clipfish.de/(?:player.php|videoplayer.swf)?(?:[^"]*?)?videoid=([a-z0-9]{1,20})',            'movie' => 'http://www.clipfish.de/videoplayer.swf?as=0&videoid=$1&r=1&c=0067B3',            'width' => '464',            'height' => '380',        ),        array(            'name' => 'CollegeHumor',            'enabled' => 1,            'pattern' => 'http://(?:www.)?collegehumor.com/video:([0-9]{1,12})',            'movie' => 'http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=$1',            'width' => '480',            'height' => '360',        ),        array(            'name' => 'Dave.tv',            'enabled' => 1,            'pattern' => 'http://(?:www.)?dave.tv/MediaPlayer.aspx?(?:[^"]*?)?contentItemId=([0-9]{1,10})',            'movie' => 'http://dave.tv/dbox/dbox_small.swf?configURI=http://dave.tv/dbox/config.ashx&volume=50&channelContentId=$1',            'width' => '300',            'height' => '260',        ),        array(            'name' => 'dv.ouou',            'enabled' => 1,            'pattern' => 'http://dv.ouou.com/(?:play/v_|v/)([a-f0-9]{14})',            'movie' => 'http://dv.ouou.com/v/$1',            'width' => '480',            'height' => '385',        ),        array(            'name' => 'ESPN',            'enabled' => 1,            'pattern' => 'http://sports.espn.go.com/broadband/video/videopage?(?:[^"]*?)?videoId=([0-9]{1,10})',            'movie' => 'http://sports.espn.go.com/broadband/player.swf?mediaId=$1',            'width' => '440',            'height' => '361',        ),        array(            'name' => 'Gametrailers',            'enabled' => 1,            'pattern' => 'http://(?:www.)?gametrailers.com/(?:player/|remote_wrap.php?mid=)([0-9]{1,10})',            'movie' => 'http://www.gametrailers.com/remote_wrap.php?mid=$1',            'width' => '480',            'height' => '392',        ),        array(            'name' => 'Gametrailers User Movies',            'enabled' => 1,            'pattern' => 'http://(?:www.)?gametrailers.com/(?:player/usermovies/|remote_wrap.php?umid=)([0-9]{1,10})',            'movie' => 'http://www.gametrailers.com/remote_wrap.php?umid=$1',            'width' => '480',            'height' => '392',        ),        array(            'name' => 'GameVideos',            'enabled' => 1,            'pattern' => 'http://(?:www.)?gamevideos.com/(?:video/id/|video/embed?(?:[^"]*?)?video=)([0-9]{1,8})',            'movie' => 'http://gamevideos.com:80/swf/gamevideos11.swf?embedded=1&autoplay=0&src=http://gamevideos.com:80/video/videoListXML%3Fid%3D$1%26adPlay%3Dfalse',            'width' => '420',            'height' => '405',        ),        array(            'name' => 'Glumbert',            'enabled' => 1,            'pattern' => 'http://(?:www.)?glumbert.com/media/([a-z0-9_-]{1,30})',            'movie' => 'http://www.glumbert.com/embed/$1',            'width' => '425',            'height' => '335',        ),        array(            'name' => 'Godtube',            'enabled' => 1,            'pattern' => 'http://(?:www.)?godtube.com/view_video.php?(?:[^"]*?)?viewkey=([0-9a-f]{20})',            'movie' => 'http://godtube.com/flvplayer.swf?viewkey=$1',            'width' => '330',            'height' => '270',        ),        array(            'name' => 'Gofish Videos',            'enabled' => 1,            'pattern' => 'http://(?:www.)?gofish.com/player(?:.gfp?|/fwplayer.swf?(?:[^"]*?))gfid=([0-9-]{10})',            'movie' => 'http://www.gofish.com/player/fwplayer.swf?loc=blog&gf=true&ns=false&fs=false&gfid=$1&c=grey&autoPlay=false&getAd=false&wm=false&ct=true&tb=false&svr=www.gofish.com',            'width' => '448',            'height' => '336',        ),        array(            'name' => 'Gofish Channels', // Channels are different than videos :(            'enabled' => 1,            'pattern' => 'http://(?:www.)?gofish.com/(?:channel.gfp|player/gfplayer.swf)(?:?gfid|(?:[^"]*?)cgfid)=([0-9-]{7})(?:[^"]*?)(?:videogfid|vgfid)=([0-9-]{7})',            'movie' => 'http://www.gofish.com/player/GFPlayer.swf?cm=false&tb=true&ap=false&co=false&ct=true&gf=true&loc=external&lp=true&sb=true&cgfid=$1&pgfid=&vgfid=$2&ad=false&svr=www.gofish.com',            'width' => '492',            'height' => '336',        ),        array(            'name' => 'Guba',            'enabled' => 1,            'pattern' => 'http://(?:www.)?guba.com/watch/([0-9]{1,12})',            'movie' => 'http://www.guba.com/f/root.swf?video_url=http://free.guba.com/uploaditem/$1/flash.flv&isEmbeddedPlayer=true',            'width' => '525',            'height' => '360',        ),        array(            'name' => 'Hulu.com (US Only)',            'enabled' => 1,            'pattern' => 'http://(?:www.)?hulu.com/(?:watch/embed/|playerembed.swf?(?:[^"]*?)?pid=)?([a-z0-9-_]{1,32})',            'movie' => 'http://www.hulu.com/embed/$1',            'width' => '567',            'height' => '350',        ),        array(            'name' => 'IFilm',            'enabled' => 1,            'pattern' => 'http://(?:www.)?ifilm.com/video/([0-9]{1,8})',            'movie' => 'http://www.ifilm.com/efp?flvbaseclip=$1',            'width' => '448',            'height' => '365',        ),        array(            'name' => 'Imageshack.us',            'enabled' => 1,            'pattern' => 'http://img([0-9]{1,5}).imageshack.us/(?:my.php?image=|img(?:[0-9]{1,5})/(?:[0-9]{1,8})/|flvplayer.swf?f=T)([a-z0-9-_]{1,20}).flv',            'movie' => 'http://img$1.imageshack.us/flvplayer.swf?f=T$2&autostart=false',            'width' => '424',            'height' => '338',        ),        array(            'name' => 'Koreus',            'enabled' => 1,            'pattern' => 'http://(?:www.)?koreus.com/video/([0-9a-z-]{1,50}).html',            'movie' => 'http://www.koreus.com/video/$1',            'width' => '400',            'height' => '300',        ),        array(            'name' => 'Libero.it',            'enabled' => 1,            'pattern' => 'http://video.libero.it/app/play(?:/index.html)??(?:[^"]*?)?id=([a-f0-9]{32})',            'movie' => 'http://video.libero.it/static/swf/eltvplayer.swf?id=$1.flv&ap=0',            'width' => '400',            'height' => '333',        ),        array(            'name' => 'LiveLeak',            'enabled' => 1,            'pattern' => 'http://(?:www.)?liveleak.com/(?:player.swf?autostart=false&token=|view?(?:[^"]*?)?i=)([0-9a-z]{3})_([a-z0-9]{10})',            'movie' => 'http://www.liveleak.com/player.swf?autostart=false&token=$1_$2',            'width' => '450',            'height' => '370',        ),        array(            'name' => 'LiveVideo',            'enabled' => 1,            'pattern' => 'http://(?:www.)?livevideo.com/(?:flvplayer/embed/|video/(?:view/)?(?:(?:[^"]*?)?/)?)([0-9a-f]{32})',            'movie' => 'http://www.livevideo.com/flvplayer/embed/$1',            'width' => '445',            'height' => '369',        ),        array(            'name' => 'MSN Live/Soapbox Video',            'enabled' => 1,            'pattern' => 'http://(?:soapbox|video).msn.com/video.aspx?(?:(?:[^"]*?)?vid=|from=msnvideo&showPlaylist=true&playlist=videoByUuids:uuids:)((?:[0-9a-z]{8})(?:(?:-(?:[0-9a-z]{4})){3})-(?:[0-9a-z]{12}))',            'movie' => 'http://images.video.msn.com/flash/soapbox1_1.swf?c=v&v=$1',            'width' => '432',            'height' => '364',        ),        array(            'name' => 'Mofile',            'enabled' => 1,            'pattern' => 'http://(?:www.|tv.)?mofile.com/([0-9a-z]{8})',            'movie' => 'http://tv.mofile.com/cn/xplayer.swf?v=$1',            'width' => '480',            'height' => '395',        ),        array(            'name' => 'M Thai',            'enabled' => 1,            'pattern' => 'http://video.mthai.com/player.php?(?:[^"]*?)?id=([0-9a-z]{14,20})',            'movie' => 'http://video.mthai.com/Flash_player/player.swf?idMovie=$1',            'width' => '370',            'height' => '330',        ),        array(            'name' => 'Mtvu',            'enabled' => 1,            'pattern' => 'http://(?:www.)?mtvu.com/video/?id=([0-9]{1,9})(?:[^"]*?)vid=([0-9]{1,9})',            'movie' => 'http://www.mtvu.com/player/embed/?CONFIG_URL=http://www.mtvu.com/player/embed/configuration.jhtml%3Fid%3D$1%26vid%3D$2$1',            'width' => '480',            'height' => '395',        ),        array(            'name' => 'MySpaceTv',            'enabled' => 1,            'pattern' => 'http://(?:vids.myspace|myspacetv).com/index.cfm?(?:[^"]*?)?VideoID=([0-9]{1,10})',            'movie' => 'http://lads.myspace.com/videos/myspacetv_vplayer0005.swf?m=$1&type=video',            'width' => '480',            'height' => '386',        ),        array(            'name' => 'MyVideo.de',            'enabled' => 1,            'pattern' => 'http://(?:www.)?myvideo.de/(?:watch|movie)/([0-9]{1,8})',            'movie' => 'http://www.myvideo.de/movie/$1',            'width' => '470',            'height' => '406',        ),        array(            'name' => 'OnSmash',            'enabled' => 1,            'pattern' => 'http://(?:www.|videos.)?onsmash.com/(?:v|e)/([0-9a-z]{16})',            'movie' => 'http://videos.onsmash.com/e/$1',            'width' => '448',            'height' => '374',        ),        array(            'name' => 'Photobucket',            'enabled' => 1,            'pattern' => 'http://(?:(?:i(?:[0-9]{1,5}).|www.)?photobucket.com/player.swf?file=http://vid|s)([0-9]{1,5}).photobucket.com/albums/((?:(?:[%0-9a-z_-]{1,50})/){1,10})(?:?(?:[^"]*?)current=)?([%0-9a-z_-]{1,50}).flv',            'movie' => 'http://i$1.photobucket.com/player.swf?file=http://vid$1.photobucket.com/albums/$2$3.flv',            'width' => '448',            'height' => '361',        ),        array(            'name' => 'Revver',            'enabled' => 1,            'pattern' => 'http://(?:one.|www.)?revver.com/(?:watch|video)/([0-9]{1,8})(?:/)?',            'movie' => 'http://flash.revver.com/player/1.0/player.swf?mediaId=$1',            'width' => '480',            'height' => '392',        ),        array(            'name' => 'Sevenload',            'enabled' => 1,            'pattern' => 'http://((?:en|tr|de|www).)?sevenload.com/(?:videos|videolar)/([0-9a-z]{1,8})',            'movie' => 'http://$1sevenload.com/pl/$2/425x350/swf',            'width' => '425',            'height' => '350',        ),        array(            'name' => 'Streetfire.net',            'enabled' => 1,            'pattern' => 'http://(?:www.|videos.)?streetfire.net/video/((?:[0-9a-z]{8})(?:(?:-(?:[0-9a-z]{4})){3})-(?:[0-9a-z]{12})).htm',            'movie' => 'http://videos.streetfire.net/vidiac.swf?video=$1',            'width' => '428',            'height' => '352',        ),        array(            'name' => 'Stupidvideos.com',            'enabled' => 1,            'pattern' => 'http://(?:www.)?stupidvideos.com/video/(?:[^"]*?)#([0-9]{1,10})',            'movie' => 'http://img.purevideo.com/images/player/player.swf?sa=1&sk=5&si=2&i=$1',            'width' => '451',            'height' => '433',        ),        array(            'name' => 'Tudou',            'enabled' => 1,            'pattern' => 'http://(?:www.)?tudou.com/(?:programs/view/|v/)([a-z0-9-]{1,12})',            'movie' => 'http://www.tudou.com/v/$1',            'width' => '400',            'height' => '300',        ),        array(            'name' => 'Veoh',            'enabled' => 1,            'pattern' => 'http://(?:www.)?veoh.com/(?:videos/|videodetails2.swf?permalinkId=)([0-9a-z]{14,16})',            'movie' => 'http://www.veoh.com/videodetails2.swf?permalinkId=$1&id=anonymous&player=videodetailsembedded&videoAutoPlay=0',            'width' => '540',            'height' => '438',        ),        array(            'name' => 'videotube.de',            'enabled' => 1,            'pattern' => 'http://(?:www.)?videotube.de/watch/([0-9]{1,8})',            'movie' => 'http://www.videotube.de/flash/player.swf?baseURL=http%3A%2F%2Fwww.videotube.de%2Fwatch%2F$1',            'width' => '480',            'height' => '400',        ),        array(            'name' => 'Vidiac',            'enabled' => 1,            'pattern' => 'http://(?:www.)?vidiac.com/video/((?:[0-9a-z]{8})(?:(?:-(?:[0-9a-z]{4})){3})-(?:[0-9a-z]{12})).htm',            'movie' => 'http://www.vidiac.com/vidiac.swf?video=$1',            'width' => '428',            'height' => '352',        ),        array(            'name' => 'VidMax',            'enabled' => 1,            'pattern' => 'http://(?:www.)?vidmax.com/index.php/videos/view/([0-9]{1,10})',            'movie' => 'http://vidmax.com/img/vidmax_player.swf?xml=http://vidmax.com/index.php/videos/playlist/&id=$1&autoPlay=true&bg=http://vidmax.com/img/back.jpg',            'width' => '450',            'height' => '447',        ),        array(            'name' => 'Vimeo',            'enabled' => 1,            'pattern' => 'http://(?:www.)?vimeo.com/([0-9]{1,12})',            'movie' => 'http://vimeo.com/moogaloop.swf?clip_id=$1&server=vimeo.com&fullscreen=1&show_title=1'                            .'&show_byline=1&show_portrait=0&color=01AAEA',            'width' => '400',            'height' => '225',        ),        array(            'name' => 'VSocial',            'enabled' => 1,            'pattern' => 'http://(?:www.)?vsocial.com/video/?d=([0-9]{1,8})',            'movie' => 'http://static.vsocial.com/flash/ups.swf?d=$1&a=0',            'width' => '410',            'height' => '400',        ),        array(            'name' => 'WeGame',            'enabled' => 1,            'pattern' => 'http://(?:www.)?wegame.com/watch/([0-9a-z_-]*?)/',            'movie' => 'http://wegame.com/static/flash/player2.swf?tag=$1',            'width' => '480',            'height' => '387',        ),        array(            'name' => 'Yahoo (Except HK)',            'enabled' => 1,            'pattern' => 'http://(?:(?:www|uk|fr|it|es|br|au|mx|de|ca).)?video.yahoo.com/video/play?(?:[^"]*?)?vid=([0-9]{1,10})',            'movie' => 'http://us.i1.yimg.com/cosmos.bcst.yahoo.com/player/media/swf/FLVVideoSolo.swf?id=$1',            'width' => '425',            'height' => '350',        ),        array(            'name' => 'Yahoo HK Only',            'enabled' => 1,            'pattern' => 'http://hk.video.yahoo.com/video/video.html?id=([0-9]{1,10})',            'movie' => 'http://w.video.hk.yahoo.net/video/dplayer.html?vid=$1',            'width' => '420',            'height' => '370',        ),        array(            'name' => 'Youku',            'enabled' => 1,            'pattern' => 'http://(?:v.youku.com/v_show/id_(?:[0-9a-z]{4})|player.youku.com/player.php/sid/)([0-9a-z]{6,14})',            'movie' => 'http://player.youku.com/player.php/sid/$1=/v.swf',            'width' => '450',            'height' => '372',        ),        array(            'name' => 'You.Video.Sina.com.cn',            'enabled' => 1,            'pattern' => 'http://you.video.sina.com.cn/pg/topicdetail/topicPlay.php?(?:[^"]*?)?uid=([0-9]{5,12})(?:[^"]*?)#([0-9]{5,10})',            'movie' => 'http://vhead.blog.sina.com.cn/player/outer_player.swf?auto=0&vid=$2&uid=$1',            'width' => '475',            'height' => '447',        ),    );    // Protect any noembed bbcoded links or <noembed> objects    if(preg_match_all('~(?:([noembed])(?:.*?)[/noembed]|<noembed>(?:.*?)</noembed>)~im', $message, $noembed, PREG_SET_ORDER))    {        foreach ($noembed as $a)        {            // Copy it so we can modify a copy            $a[2] = $a[0];            // Make any non-active links active            if(!empty($a[1]) && strtolower($a[1]) == '[noembed]' && !empty($modSettings['autoLinkUrls']))                // Strip the noembed tags                $a[2] = StripAndFixNoEmbed($a[2]);            // Protect links so they don't get caught by our preg, any so much so they are likely to be unique.            $a[2] = str_replace('<a href=', '#<AEVC href=#', $a[2]);            $message = str_replace($a[0], $a[2], $message);        }        // Tidy up        unset($a, $noembed);    }    // Default params    $default_params = array(        'wmode' => 'transparent',        'quality' => 'high',        'allowFullScreen' => 'true',        'allowScriptAccess' => 'never',        'pluginspage' => 'http://www.macromedia.com/go/getflashplayer',    );        // Build the params for the object (same for all)    $object_params = $embed_params = '';    foreach($default_params as $a => $b)    {        // <Embed>        $embed_params .= ' '.$a.'="'.$b.'"';        // <Object>?        if($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])            $object_params .= '<param name="'.$a.'" value="'.$b.'" />';            }    // Tidy up    unset($a, $b, $default_params);            // Now do the magic, convert those links in messages to automatically embed the videos    foreach($video_sites as $arr)    {        // If the site is disabled, then continue with the next site.        if(!$arr['enabled'])            continue;            // Create empty object        $object = '';                // Build the <object> (Non-Mac IE Only)        if($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])            $object = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" '.                        'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" '.                        'type="application/x-shockwave-flash" width="'.$arr['width'].'px" height="'.$arr['height'].'px">'.                        '<param name="movie" value="'.$arr['movie'].'" />'. $object_params;        // Build the <embed>        $object .= '                    <embed type="application/x-shockwave-flash" '.                        'src="'.$arr['movie'].'" width="'.$arr['width'].'px" height="'.$arr['height'].'px"'. $embed_params .' />'.                    '<noembed>#<AEVC href=#"'.$arr['movie'].'" target="_blank">'.$arr['movie'].'</a></noembed>';        // Note the link inside the <noembed starts #<AEVC href=#  to protect it from being affected, this will be reversed later                // If using <object> remember to close it        if($context['browser']['is_ie'] && !$context['browser']['is_mac_ie'])            $object .= '</object>';                    // Build the pattern/(re)set the count        $pattern = '~<a href="'.$arr['pattern'].'(?:[^"]*?)"(?:.*?)</a>~i'.($context['utf8'] ? 'u' : '') ;        $count = 0;        // Pre php 5.1.0, No count parameter, so do it the slower, inefficient way        if (@version_compare(PHP_VERSION, '5.1.0') == -1)        {            // Grab all the matches to count the no. of replacements that will be made            if(preg_match_all($pattern, $message, $out, PREG_PATTERN_ORDER))            {                $count = count($out[0]);                unset($out);                $message = preg_replace($pattern, $object, $message, $autoembedmax);            }        }        else            // Fantastic! From 5.1.0 we can use the count parameter            $message = preg_replace($pattern, $object, $message, $autoembedmax, $count);        // Reduce remaining replacements allowed        if($autoembedmax != -1)            $autoembedmax = $autoembedmax - $count;        // Tidy up        unset($object, $pattern, $count);                // If we've reached our max replacements OR there are no links remaining, exit;        if($autoembedmax == 0 || stripos($message, '<a href="') === false)            break;    }    // Tidy up    unset($video_sites, $object_params, $embed_params, $pattern, $arr, $count);        // Reverse protection of noembed stuff in one go    $message = str_replace('#<AEVC href=#', '<a href=', $message);    // Strip [noembed] bbcode codes    if(stripos($message, '[noembed]') !== false)        $message = StripAndFixNoEmbed($message);        // Return our message.return $message;}// Strips [noembed] tags out of posts once they've been usefulfunction StripAndFixNoEmbed($input){    global $context;        // Pre PHP5, there is no str_ireplace    if (@version_compare(PHP_VERSION, '5.0') == -1)        $input = preg_replace(array('~[noembed]~i', '~[/noembed]~i'), '', $input);    else        $input = str_ireplace(array('[noembed]', '[/noembed]'), '', $input);            // Parse any URLs.... have to get rid of the @ problems some things cause... stupid email addresses.    if (!isset($disabled['url']) && (stripos($input, '://') !== false || stripos($input, 'www.') !== false))    {        // Modified from smf code        // Switch out quotes really quick because they can cause problems        $input = strtr($input, array(''' => ''', '&nbsp;' => $context['utf8'] ? "xC2xA0" : "xA0", '"' => '>">', '"' => '<"<', '<' => '<lt<'));        $input = preg_replace(array('~(?<=[s>.(;'"]|^)((?:http|https|ftp|ftps)://[w-_%@:|]+(?:.[w-_%]+)*(?::d+)?(?:/[w-_~%.@,?&;=#+:'\\]*|[({][w-_~%.@,?&;=#(){}+:'\\]*)*[/w-_~%@?;=#}\\])~i', '~(?<=[s>('<]|^)(www(?:.[w-_]+)+(?::d+)?(?:/[w-_~%.@,?&;=#+:'\\]*|[({][w-_~%.@,?&;=#(){}+:'\\]*)*[/w-_~%@?;=#}\\])~i'), array('<a href="$1">$1</a>', '<a href="http://$1">$1</a>'), $input);        $input = strtr($input, array(''' => ''', $context['utf8'] ? "xC2xA0" : "xA0" => '&nbsp;', '>">' => '"', '<"<' => '"', '<lt<' => '<'));    }        // Return it    return $input;}?>



and here is a mod

[hr]AUTO EMBED VIDEO CLIPS v2.1.4
By Karl Benson
[hr]Link to Mod | Support Topic | Demo | Donate[hr]


Compatibility
For SMF 1.1.x and SMF 2.0 Beta x

Introduction
Automatically embeds video clips from links for 50+ sites including YouTube/DailyMotion/MetaCafe/GoogleVideo without the need for html or bbcode.

Just copy the url from your address bar into a post and let the mod will do the rest.
Its the ultimate user friendly way of posting clips and safe from a security standpoint.

Features
o Supports 50+ Video clip sites
- 123video.nl, Aniboom, AOL Uncut, AtomFilms, AtomFilms Uploads, Biku, BrightCove, CellFish, ClipFish.de, CollegeHumor, DailyMotion.com, DailyMotion.Alice.It, Dave.tv, dv.ouou, ESPN, Gametrailers, GameVideos, Glumbert, Godtube, GoFish, Google Video, Guba, Hulu (US Visitors Only), IFilm, Imageshack.us, Koreus, Libero.it, LiveLeak, LiveVideo, Megavideo, MetaCafe, MSN Live/Soapbox Video, Mofile, MThai, MySpaceTv, MyVideo.de, OnSmash, Photobucket, Revver, Sevenload, Sina.com.cn, Stage6, Streetfire.net, Stupidvideos.com, Tudou, Veoh, videotube.de, Vidiac, VidMax, Vimeo, VSocial, WeGame, Yahoo, Yahoo HK, Youku, YouTube (including Playlists)
o Safe from security standpoint
- They can't just embed ANY object hosted ANYWHERE, it only works for trusted supported sites
- Properly validates/sanitizes/parses the video id before including it in the url
- Disables script access (allowScriptAccess="never")
o No configuration necessary
o Works for all themes/languages, no manual edits necessary
o Use [noembed][/noembed] bbcode to prevent links being converted to embedded clips
o Hard-coded limit to number to converted links per page (to prevent flash overload/browser crash)
- Only applies to links converted by this mod (not other video clip mods)
o Disabled for Printer Friendly pages & Signatures
o Since all the videos are hosted by external sites, it won't consume your bandwidth

Since the mod only converts active links, it is recommended to have the setting "Automatically link posted URLs" enabled.
(via Admin > Posts & Topics > Bulletin Board Code)
Other than that there are no admin settings with this mod. Uninstall the mod to disable it.

Other video mods (such as my YouTube BBCode mod) will take precedence for bbcoded links.

Note: Some users have reported that the players won't go fullscreen. This maybe caused by bugs in some versions of Adobe Flash Player when wmode="transparent" is in use. Check [here] whether you have the latest version of Adobe Flash Player.

Installation
Any previous versions of this mod MUST be uninstalled BEFORE installing this version.

Install the mod via the SMF Package Manager, and your done. It installs on ALL themes automatically as it only affects Source files.
There are NO theme edits required and there are NO language strings to translate.

Useful Links
SMF Package Parser
Manual Installation Of Mods
How Do I Modify Files?

Donate
Has this modification helped you? Support the developer by Donating

(Optional) Convert Old Video BBCode
(Mysql users only) If you have had video bbcode mods previously installed eg [nobbc][youtube][/nobbc], then you might want to use my convert_old_video_bbcodes.php script to convert bbcoded video links to normal links (and therefore make those links work with this mod).

Use this at your OWN risk.
This cannot be undone, so backup your database and files prior to running it.
Upload it via ftp to your directory where SMF runs from. Put your forum in maintenance mode, and then point to it in your browser.
For security reasons, remove the file once completed.
o Only applies to topics/posts.
o Works for valid links or ids
o Works for both types of bbcode (with or without sizes)
o Converts the following bbcodes
[nobbc][youtube], [yt], [ytplaylist], [stage6], [metacafe], [googlevid], [gv], [google_video], [gvideo], [dailymotion], [livevideo], [liveleak], [myvideo], [clipfish], [veoh][/nobbc]
Other uses of the bbcode will remain untouched.
o You can use the script at any time (with or without the AutoEmbedVideoClips mod installed)

Customizing
The mod has been designed to be fully functional 'out of the box' and not require any configuration or manual edits.
However some 'hardcoded' capability/hooks have been included for those who understand php/smf and maybe wish to customize the mod.

Enable/Disable Specific Sites
Eg to enable/disable Stage6

Open Sources/Subs-AutoEmbedVideoClips.php
FIND
array(
            
'name' => 'YouTube',
            
'enabled' => 1,

Change the number 1 to enable, 0 to disable (note, all sites are enabled by default)
Similarly change it for any of the other sites supported to disable them.

Increase/Decrease The Limit On The Number Embedded Objects Per Page
Too much flash can be bad for your health (eg it will crash your browser). Thats why the limit was put in place.
IE, Firefox, Opera etc start kicking and screaming if you get over 10 objects.
Open Sources/Subs.php
FIND
[CODE] static $autoembedmax = 12 ;[/CODE]
Change 12 to another number. Use -1 for no limit (Not Recommended).

Disabling Embedding In Specific Areas
By default embedding is disabled in signatures.
Some people requested a way to disable it for other sections such as Shoutbox.
You must find in the relevant SOURCE file where that string or data is put through the function "parse_bbc"
And on the line BEFORE it, put
$context['disableautoembedvideo'] = ;


Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

Note: I do NOT have the time nor the desire to provide support for making or helping to make this mod support videos hosted on your OWN site.
You may be able to find someone to help by posting a request in the Help Wanted board on the SimpleMachines.org
But be careful with regex patterns.

Note: Whilst I do take requests to support other popular video clip sites in future versions, it is NOT possible to add support for the following sites because the video id/filename in the url is not the same as in the actual filename in the embed code.
Break.com, ebaumsworld, garagetv.be, 56.com, Blip.Tv, slideshare.net, videojug, vidlife, Filefront, IGN, Gamespot, Dipvid, youSportz, tinypic.com
I won't include sites which require users 'fishing' in the embed code for the correct file url.

No adult/porn ones please (although most will NOT work anyway).

Changelog
I am still recommending anyone who is using less than v2.1 to uninstall that version and then install the latest version.
2.1.4 - 1st March 2008
- Removed Stage6 (since its CLOSED)
- Fixed codebase to specify latest adobe flash version 9.0.115.0
- By request, moved default params into array
- Simplified the building of the object
- Fixed Gametrailer to support uservideos
For the full changelog for previous versions please see changelog.txt


so there you are! its open source so either adapt it or if XOOPS want it then contact the guy for hm to make another one for bbforums!
I just think that you cant get any better for the end user... actually if i get a bit better at php and MySQL then maybe ill make an installer
to make smf insertable in XOOPS - as it is anyway much better than phpbb
(pretty hard to use properly, Bull(s) and Boring! - PHPBB)

10
sakyant
Re: Add [flash] tag to BB code
  • 2008/10/3 8:01

  • sakyant

  • Just popping in

  • Posts: 13

  • Since: 2006/8/13


ps look how wide my text goes in the post above!!!
another crap thing about the way that php programmers cant make block templates for candy!
a simple piece of css can solve that. Like just define the width of the textfield how many colums or the P tag or if not work with individual elements, then just make a div id or class with fixed width
and put all template code within it
I also am astounded at the bad english on software products that are being internationally recognized.
I mean the damn wf downloads module . when you go to the first page of it once installed you see the "B"
tag for bold script in bb code and one of the words is misspelled!!

ok now a test to see if i can make this forum post very hard to read in a browser that is lass than 5 yards wide ajsjdsjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
i mean whats the guy writing a bb code for in aphp/html template???

well i see now that this post template has a fixed width of something over 2 or 3000 pixels . Why is that?
why not limit it to 500 pixels? that would leave room for the navbar ro appear in the screen too
I see that XOOPS is all concentrated on the php and functions etc but the module templates are really
obviously made by people who think code and dont know anything about visual aesthetics
Im a jack of all trades myself, master of none.. but i run some sitse with 1000 visitors a day and forums
and i do all the graphics, moderation php hacks and css as well as the installations .. everything basically..
as i cant afford to pay anyone
example of one of my amateur designed forums of bb3 is on
http://www.sak-yant.com/sakyant-forum/
graphics are in Khmer sanskrit. took me one day to install and redesign

I am a XOOPS love because of its many modules and multifacetted capabilities for what kind of site you can make.. you can make communities, online shops, portals, galleries are all good..
but it seems to have become ill lately.
Many problems and i have lost a forum with over 2000 members amd 3 years of posts because i "Updated" (downdated more like it.. it destroyed my database!)
The same happend with my downlaod section the update button made it delete all the folders with uploaded videos etc and i lost everything just because i went to admin cp and it said "wf downloads i out of date please update click here" god did i curse that day! please press this button so we can destroy 3 years of your work!
anyway to stick to the point.. hope the code above helps you to make a solution.

as a last note; Of course open source is free for us individual endusers.. and therefore merits no complaints from that
individual enduser (or?).. but then we must also consider that corporate concerns must buy that same open source product
if the companies buying usage rights of an open source product see that the people who first made that product famous and popular
are finding a lot of mistakes and bugs, then the product becomes a lot less marketable.. the open source scene is not really a free ride.
It is a clever way to promote oneself and attain mass popularity.. which makes the product then a profitable resource that can be marketed to big ccompanies
and commercial operations for lots of money.
So to the people who manage to gain their living by XOOPS sales to companies should realize that the individual enduser is the publicity agent of the product.

modules that are not perfect should be named beta or alpha im not sure which is which either.. whicheve one mean "not perfect"

but there are kids out there making a module and thinking its readyand post it! it should be indicated that such modules
are recommended for a test enviroment.
not for a working site that cannot risk losing a module that is being used by amny users .
One thing i do know is i dont update anythjing anymore.. leave what works as working better than risk destroying it
all just because some wiseass thinks he has developed a piece of code.. that actually is only half ready..
sorry about the irregular line breaks but the textwindow here has no end to its width so i just kleep pressing the enter button to make sure that i dont write 5 mile wide paragraphs.
its like a 14 year old kid installed this forum oi would fix it its embarrassing this is the site of xoops! and the XOOPS forum on XOOPS isnt even working efficiently..
what great publicity!


Login

Username:
Password:

Lost Password? Register now!

Who's Online

65 user(s) are online (35 user(s) are browsing Support Forums)


Members: 0


Guests: 65


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits