aRMY83The old code that Eton Bones had .. allowed any member the ability to post the example of code below ....
<object width="448" height="374"><param name="movie" value="http://www.worldstarhiphop.com/videos/e/16711680/wshhT44kBSqhcZ1NerFX"><param name="allowFullScreen" value="true"></param><embed src="http://www.worldstarhiphop.com/videos/e/16711680/wshhT44kBSqhcZ1NerFX" type="application/x-shockwave-flash" allowFullscreen="true" width="448" height="374"></embed></object>
and he had a choice in the v4 version ... to use a drop down window and choose 'embed video' .. it was somewhat of a general way to wrap codes like this ... with ease. Most would show without a hitch. The page way .. doesn't allow anyone but me to post/reply, in the way that I'd like the members to be able to do. :/
I've been trying to contact Eton, but he hasn't been around in a few weeks .. which, is why I'm wondering if someone outside of him .. could take a stab at this ... be it, a plug-in or H&F'r type code .. and btw, you've been so gracious and helpful through this all, I must say.
HERE'S WHAT HIS CODE LOOKED LIKE WHEN IT WORKED WITH V4.5
GLOBAL HEADERS<script type="text/javascript">
<!--
/* Any Video in Post - Eton Bones*/
/* last updated: 7/4/2008 (rev 9) */
var caller=[];
var vidType={
_Globals:{
defaultType:'Embed',
params:{allowfullscreen:false, allowscriptaccess:'always', pluginspage:'http://www.macromedia.com/go/getflashplayer', type:'application/x-shockwave-flash', classid:'clsid:D27CDB6E-AE6D-11cf-96B8-444553540000', quality:'autohigh', codebase:'http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab', wmode:'transparent'},
maxVidsPerPost:20,
maxVidsPerPage:20,
defaultWidth:'720px',
defaultHeight:'400px',
canPost:'-Guest',
//canView:'-Guest',
autoLink:'YouTube'
},
Embed:{
prefix:'%video%',
checkid:function(vid){ if(/<(object|embed)\b/im.test(deEntify(vid)) /*&& /\.swf\b/i.test(vid)*/)return true; else return false;},
postprocess: function(ret){
var w=vidType['Embed'].maxwidth; var h=vidType['Embed'].maxheight
ret=deEntify(caller[caller.length-1].arguments[2])
if(!/width=\d+/i.test(caller[caller.length-1].arguments[0].split(/\]/)[0]))w=0
if(!/height=\d+/i.test(caller[caller.length-1].arguments[0].split(/\]/)[0]))h=0
ret=ret.replace(/(width|height)=['"]?(\d+)/gi,function(m,p1,p2){
if(/width/i.test(p1)&&w>0){
m=m.replace(/width=('|")\d+/i,'width=$1'+w)
}else if(/height/i.test(p1)&&h>0){
m=m.replace(/height=('|")\d+/i,'height=$1'+h)
}
return m;
})
//disable all SWF browser navigation and browser interaction APIs to avoid possible popups
if(/\ballownetworking\b/i.test(ret))
ret=ret.replace(/(value|allownetworking)=('|")all['"]/gim, "$1=$2internal$2");
else
ret=ret.replace(/<embed\s/gi,'<embed allownetworking="internal" ').replace( /<param\s/i,'<param name="allownetworking" value="internal"/><param ');
return String('<div name="swfPlayer">'+ret)
},
preprocess:function(vType,vURI){
caller[caller.length-1].arguments[2]= pb_unwrap(vURI)
},
description:'Embed Code'
},
AnySWF:{
prefix:'%video%',
description:'Generic SWF Player',
maxwidth:'425px',
maxheight:'350px',
params:{flashvars:_getFlashVars},
checkid:function(vid){return /\.swf(\?|\s*$)/i.test(vid)}
},
AnyFLV:{
prefix:'http://www.jeroenwijering.com/embed/mediaplayer.swf?file=%video%',
description:'Generic FLV Player',
maxwidth:'360px',
maxheight:'360px',
custom:{skinall:'&displayheight=%height%&displaywidth=%width%',skin1:'&lightcolor=0x000000&backcolor=0x334455&frontcolor=0x666666&screencolor=0xFFFFFF'},
params:{flashvars:_getFlashVars},
preprocess:function(vType,vURI){this['flashvars']=((this['flashvars'])?this['flashvars']:'');this.flashvars=this.flashvars.replace(/%height%/gi,parseInt(this.maxheight)).replace(/%width%/gi,parseInt(this.maxheight));if(vURI.match(/\.(flv|mp4|m4v|m4a|3gp|mov|f4v|f4p|f4a|f4b)(\?|\s*$)/i))this.flashvars+='&type='+RegExp.$1;},
checkid:function(vid){return /\.(flv|mp4|m4v|m4a|3gp|mov|f4v|f4p|f4a|f4b|xml|asx)(\?|\s*$)/i.test(vid)}
},
WMP:{
prefix:'%video%',
description:'Windows Media Player',
example:'http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=18',
params:{CLASSID:'clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6', invokeurls:0, autostart:0,playcount:1, name:'mediaplayer1',CODEBASE:'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701',pluginspage:'http://www.microsoft.com/Windows/MediaPlayer/',type:'application/x-mplayer2'}
},
Quicktime:{
prefix:'%video%',
example:'http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=17',
params:{CLASSID:'clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B', autoplay:0 , name:'quicktimeplayer1', CODEBASE:'http://www.apple.com/qtactivex/qtplugin.cab',pluginspage:'http://www.apple.com/quicktime/download',type:'video/quicktime'}
},
Real:{
description:'Real Player',
prefix:'%video%',
example:'http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=15',
preprocess:function(vType,vURI){if(!vURI.match(/\?embed$/i))caller[caller.length-1].arguments[2]+='?embed'},
postprocess:function(ret){
//real player requires separate controls for vid and control panel
ret+='<br><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" '+ret.match(/width=[^\s]+/)[0]+' '+ ' height="36" >'
ret+='<param name="controls" value="ControlPanel">';
ret+='<param name="console" value="vidplayer">';
ret+=ret.match(/\<embed[\w\W]+?<\/embed>/im)[0].replace(/controls="ImageWindow"/,'controls="ControlPanel"').replace(/height=".+?"/,'height="36"')
ret + '></object>'
return ret
},
params:{CLASSID:'clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA', autogotourl :0 , autostart :0, controls:'ImageWindow', console:'vidplayer', pluginspage:'http://www.real.com/', /*type:'audio/x-pn-realaudio-plugin'*/type:'application/vnd.rn-realplayer'}
},
VLC:{
prefix:'%video%',
description:'VideoLAN (VLC)',
params:{CLASSID:'clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8',CODEBASE:'http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab',pluginspage:'http://www.videolan.org',type:'application/x-vlc-plugin'}
}
}
function aV(video){
video=(video)?video:vidType._Globals.defaultType
add("[video=", "[/video]", video);
}
function _getFlashVars(){
var vType=caller[caller.length-1].arguments[1];
var a=prefix.split(/\?/);
prefix=a[0]; if(a.length==1)a.push('')
if(vidType[vType]['flashvars']){ a[1]+=((a[1].length)?'&':'')+vidType[vType]['flashvars']; }
return a[1]
}
function deEntify(sStr){
return sStr.replace(/&am{1}p;/gi,"&").replace(/&l{1}t;/gi,"<").replace(/&g{1}t;/gi,">")
}
function pb_unwrap(sStr){return sStr.replace(/([^\s\n\r]{111,})(\s|%20)/gm,'$1')}
function trim(sStr){
return sStr.replace(/(^\s+|\s+$)/g,'')
}
function isAllowed(users,user){
if(!vidType._Globals[users])return true
var u=vidType._Globals[users]
u=u.split(/,/).sort().reverse().join('|')
var v=u.indexOf('-')
if(v>-1){
if(RegExp('^('+u.substr(v).replace('-','')+')$').test(user))return false;
u=u.substr(0,v).replace(/|$/,'')
}
if(u.length){
if(RegExp('^('+u+')$',"i").test(user))return true;
return false;
}else{ return true;}
}
function disableVideo(vid,link,title){
title=(title)?title:''
var ret='<a href="javascript:void(0)" onClick="enableVideo(this)" title="'+title+'">'
ret+=link+'</a><xm'+'p style="display:none;">'+ vid +'</xm'+'p>'
return ret
}
function enableVideo(thiss){
var v=document.createElement('div');
v.innerHTML=deEntify(thiss.nextSibling.innerHTML);
thiss.parentNode.replaceChild(v.firstChild,thiss.nextSibling);
thiss.style.display="none"
}
function makeEmbed(m,vType,vURI){
var params=''; var attribs=null;
if(mTD.getElementsByTagName('a').length<((window['pb_VersionNo'])?2:1) && !isAllowed('canPost','Guest')) return '<DIV>Guests are not allowed to post videos</DIV>'
if(mTD.getElementsByTagName('a').length>((window['pb_VersionNo'])?2:1) && mTD.getElementsByTagName('a')[((window['pb_VersionNo'])?2:1)].href.match(/user=(\w+)/) && !isAllowed('canPost',RegExp.$1))
return '<DIV>'+mTD.getElementsByTagName('a')[((window['pb_VersionNo'])?2:1)].innerHTML + ' is not allowed to post videos</DIV>'
if(vidType._Globals['boards'] && !vidType._Globals['boards'].match(/\bmain\b/i))vidType._Globals['boards']+=",main";
if(!isAllowed('boards',((document.getElementsByName('board').length)?document.getElementsByName('board')[0].value:'main'))) return m;
if(!vType)vType=vidType._Globals.defaultType;
if(!/^Embed\b/.test(vType) && vURI.match(/href=['"]?([^\s'">]+)/i))vURI=RegExp.$1;
//if(/\<\s*(embed|object)/i.test(m))return m
if(/,/.test(vType)){attribs=trim(deEntify(vType.substr(vType.indexOf(',')+1)));vType=trim(vType.split(/,/)[0]);}
if(!vidType[vType]) return m;
if('checkid' in vidType[vType]) if(!vidType[vType].checkid(vURI)) return m;
caller.push(arguments.callee) //opera+safari don't support arguments.callee.caller
if(!vidType[vType]['maxwidth'])vidType[vType].maxwidth=vidType._Globals.defaultWidth;
if(!vidType[vType]['maxheight'])vidType[vType].maxheight=vidType._Globals.defaultHeight;
prefix=vidType[vType].prefix
if(attribs){
vidType[vType].maxwidth=(/width=([^,]+)/i.test(attribs) && parseInt(RegExp.$1)<=parseInt(vidType[vType].maxwidth))?RegExp.$1:vidType[vType].maxwidth;
vidType[vType].maxheight=(/height=([^,]+)/i.test(attribs) && parseInt(RegExp.$1)<=parseInt(vidType[vType].maxheight))?RegExp.$1:vidType[vType].maxheight;
if(attribs.match(/flashvars=([^,]+)/i)){if(/\?/.test(prefix))prefix+='&'; else prefix+='?'; prefix+=trim(attribs.match(/flashvars=([^,]+)/i)[1])}
}
if("custom" in vidType[vType]){
if(!('flashvars' in vidType[vType]))vidType[vType].flashvars='';
if('skin'+pb_skinid in vidType[vType].custom)vidType[vType].flashvars+=((vidType[vType].flashvars.length && vidType[vType].custom['skin'+pb_skinid].substr(0,1)!='&')?'&' + vidType[vType].custom['skin'+pb_skinid]:vidType[vType].custom['skin'+pb_skinid])
if('skinall' in vidType[vType].custom)vidType[vType].flashvars+=((vidType[vType].flashvars.length && vidType[vType].custom['skinall'].substr(0,1)!='&')?'&'+ vidType[vType].custom['skinall']:vidType[vType].custom['skinall'])
}
if("preprocess" in vidType[vType])vidType[vType].preprocess(vType,vURI)
prefix=prefix.replace(/%video%/g,vURI)
var ret='<div name="swfPlayer"><OBJECT width="'+ vidType[vType].maxwidth + '" height="'+ vidType[vType].maxheight + '" data="'+prefix.replace(/%video%/,vURI).split('?')[0]+'" standby="Loading player components..." >'
ret+= '<PARAM name="movie" value="'+prefix + '" />';
ret+= '<PARAM name="url" value="'+prefix + '" />';
ret+= '<PARAM name="src" value="'+prefix + '" />';
if("params" in vidType[vType]){
for(var v in vidType[vType].params){
var ret1=("function"==typeof vidType[vType].params[v])?vidType[vType].params[v]():vidType[vType].params[v]
if(!/^pluginspage$/.test(v)){
if(!/^(classid|codebase)$/i.test(v))
ret+= '<PARAM name="'+v + '" value="'+ ret1 + '" />';
else
ret=ret.replace(/<OBJECT\s/i,'<OBJECT '+v+'="'+ret1+'" ')
}
if(!/^(classid|codebase)$/i.test(v)){
params+= v + '="'+ ret1 + '" ';
}
}
}
for(var u in vidType._Globals.params){
if(!ret.match(new RegExp('name="'+ u +'"','i')) && !ret.match(new RegExp( u +'="','i')) && !params.match(new RegExp( u +'="','i'))){
var ret2=("function"==typeof vidType._Globals.params)?vidType._Globals.params():vidType._Globals.params
if(!/^pluginspage$/.test(u)){
if(!/^(classid|codebase)$/i.test(u))
ret+= '<PARAM name="'+ u + '" value="'+ ret2 + '" />';
else
ret=ret.replace(/<object\s/i,'<OBJECT '+u+'="'+ret2+'" ')
}
if(!/^(classid|codebase)$/i.test(u))
params+= u + '="'+ ret2 + '" ';
}
}
ret= '<div name="swfPlayer">' //7/4/08 abandon twice cooked embedding for <embed> alone
ret+= '<embed src=\042'+ prefix.replace(/%video%/,vURI)
ret+= '\042 width="'+ vidType[vType].maxwidth + '" height="'+ vidType[vType].maxheight + '" '+ params
ret+= ' id="_'+perPage+'"></embed>' //</object>'
if('postprocess' in vidType[vType])ret=vidType[vType].postprocess(ret)
ret+='</div>'
perPost++;
if(!isLink && (vidType._Globals.maxVidsPerPost<perPost || vidType._Globals.maxVidsPerPage<perPage || (attribs && attribs.match(/disabled?=(true|[1-9])/i))))
ret=disableVideo(ret,'<div style="text-align:center;line-height:30px;width:'+vidType[vType].maxwidth+';height:'+vidType[vType].maxheight+';" class="bordercolor" ><br><br>This video has been disabled to save bandwidth.<br> Click to enable</div>')
else
perPage++; caller.pop();
return ret
}
/* AVIP Addon:ESPN (global header below AVIP header code) - Eton Bones*/
if(window['vidType']){
vidType['ESPN']={};
vidType['ESPN'].prefix='http://sports.espn.go.com/broadband/player.swf?mediaId=%video%';
vidType['ESPN'].example='http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=19';
vidType['ESPN'].preprocess=function(vType,vURI){if(vURI.match(/\b{video|media}?Id=([^&]+)/i))caller[caller.length-1].arguments[2]=RegExp.$1};
vidType['ESPN'].params={allownetworking:'internal'}
}
/* AVIP Addon:Vimeo (global header below AVIP header code) - Eton Bones*/
if(window['vidType']){
vidType['Vimeo']={};
vidType['Vimeo'].prefix='http://www.vimeo.com/moogaloop.swf?clip_id=%video%&server=www.vimeo.com&show_title=1&show_byline=1&show _portrait=0';
}
/* AVIP Addon:Game Trailers (global header below AVIP header code) - Eton Bones*/
if(window['vidType']){
vidType['GT']={};
vidType['GT'].prefix='http://www.gametrailers.com/remote_wrap.php?mid=%video%';
vidType['GT'].description='Game Trailers';
vidType['GT'].example='http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=31';
vidType['GT'].preprocess=function(vType,vURI){if(vURI.match(/([^/]+)\.html?/))caller[caller.length-1].arguments[2]=RegExp.$1};
}
/* AVIP Addon:DailyMotion (global header below AVIP header code) - Eton Bones*/
if(window['vidType']){
vidType['DailyMotion']={};
vidType['DailyMotion'].prefix='http://www.dailymotion.com/swf/%video%';
vidType['DailyMotion'].params={flashvars:_getFlashVars};
vidType['DailyMotion'].example='http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=23';
vidType['DailyMotion'].preprocess=function(vType,vURI){if(vURI.match(/video\/([^_]+)/))caller[caller.length-1].arguments[2]=RegExp.$1};
vidType['DailyMotion'].custom={skin1:'colors=background:DDDDDD;glow:FFFFFF;foreground:333333;special:FFC300'};
}
/* AVIP Addon:Break (global header below AVIP header code) - Eton Bones*/
if(window['vidType']){
vidType['Break']={};
vidType['Break'].prefix='http://embed.break.com/%video%';
vidType['Break'].params={flashvars:_getFlashVars};
vidType['Break'].example='http://etonbones.proboards100.com/index.cgi?board=examples&action=display&thread=20';
vidType['Break'].description='Break.com';
}
//-->
</script>
GLOBAL FOOTERS
<script type="text/javascript">
<!--
}
/*Any Video in Post (footer portion)- Eton Bones */
/* last updated: 6/29/2008 (rev8)*/
var _color=document.getElementsByName('color')
if(document.postForm && _color.length && isAllowed('canPost',pb_username) && isAllowed('boards',((document.getElementsByName('board').length)?document.getElementsByName('board')[0].value:'main'))){
_color=_color[0];
var select=document.createElement('select');
select.options[0]=new Option('videos','')
for(var v in vidType){
if(v.substr(0,1)!="_")
select.options[select.options.length]=new Option(('description' in vidType[v])?vidType[v].description:v,v)
}
select.options[0].selected=true;
select.onchange=function(){
if("example" in vidType[this.options[this.selectedIndex].value]){
document.getElementById('videoExample').innerHTML='For an example of how to insert a'+((/[aeiou]/i.test(this.options[this.selectedIndex].text.substr(0,1)))?'n ':' ')+ this.options[this.selectedIndex].text + ' video into a post please see <a href="' + vidType[this.options[this.selectedIndex].value].example + '" target="_blank">this</a> link.'
}else{
document.getElementById('videoExample').innerHTML='';
}
aV(this.options[this.selectedIndex].value);this.selectedIndex=0;
}
_color.parentNode.appendChild(document.createTextNode(' '));
_color.parentNode.appendChild(select)
var ex = document.postForm.message.parentNode.appendChild(document.createElement('div'));
ex.id="videoExample";
}
if((location.href.match(/action=(display|goto|(?:user)?recent|search2|pmview)/i)||(location.href.split(/\//).pop()=="index.cgi" && (document.body.innerHTML.match(/b>\d+\sresults found<\/b/i)||document.title.match(/-\sPreview/)))) && isAllowed('canView',pb_username)){
var mTD=document.getElementsByTagName('td'),imgDisabled=false, perPost=perPage=0,prefix='',isLink=false;
for(var i=0;i<mTD.length;i++){
if(mTD.className=="menubg" && mTD.innerHTML.match(/\balt=['"]?\[Home\]/i))imgDisabled=false;
if(mTD.width=="20%" && mTD.className.match(/windowbg2?/) && !imgDisabled){
var post=mTD.nextSibling; perPost=0;
post.innerHTML=post.innerHTML.replace(/\[video=?([^\]]+?)?\]([^[]+?)\[\/video\]/gI'makeEmbed);
if(vidType._Globals['autoLink'] && vidType._Globals['autoLink'].length){
var v=vidType._Globals['autoLink'].split(/,/)
isLink=true;
for(var u=0;u<v.length;u++){ try{ret=vidType[v].autolink(post)}catch(e){}
}
isLink=false;
}
}
}
}
}
//-->
</script>