MyBB Community Forums

Full Version: Trying to Implement JW Player Mycode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am only new to mybb, so I am just starting to feel my round. Please be gentle!

Any way, I am trying to implement a mycode for JWPlayer(v5.9), so far I have it working to this stage:

http://www.justwushu.info/Thread-Xiayang...Gongfu-Fan

The mycode I have is this:

Regular Expression: \[jw\](.*?)\[/jw\]

Replacement: <script type='text/javascript' src='http://www.justwushu.info/jwplayer/jwplayer.js'></script><div id='mediaspace'>This text will be replaced</div><script type='text/javascript'>jwplayer('mediaspace').setup({'flashplayer': 'http://www.justwushu.info/jwplayer/player.swf','file': '$1','controlbar': 'over','stretching': 'fill', 'width': '640','height': '380'});</script>

Now what I can't seem to work out, is how do I place a second variable in the 'regular expression' for a preview image?

I am grabbing the .flv file, and the preview image file from a phpmotion site I own. The JW Player replacement code, will look like this: 'image':'file url',

Can anyone please point me in the right direction for achieving this. Any guidance would appreciated.

By the way, if the above code can be improved, please feel free to correct me! Smile
If the input you will give will be like image:file then regular expression should be
\[jw\](.*?):(.*?)\[/jw\]

Now you can use $1 for image and $2 for file.
(2012-02-23, 09:06 AM)kavin Wrote: [ -> ]If the input you will give will be like image:file then regular expression should be
\[jw\](.*?):(.*?)\[/jw\]

Now you can use $1 for image and $2 for file.


Hi Kavin,

thank you very much for taking the time to reply. Sorry, I was slightly delayed in my reply, as I was out of town for a couple of days.

Tried that code, but I didn't seem to have any luck for with it.

I probably made a mistake somewhere!

Here's what it looks like now:

Regular Expression: \[jw\](.*?):(.*?)\[/jw\]

Replacement:

<script type='text/javascript' src='http://www.justwushu.info/jwplayer/jwplayer.js'></script><div id='mediaspace'>This text will be replaced</div><script type='text/javascript'>jwplayer('mediaspace').setup({'flashplayer': 'http://www.justwushu.info/jwplayer/player.swf','file': '$2','image':'$1','controlbar': 'over','stretching': 'fill', 'width': '640','height': '380'});</script>


mycode:
[jw]http://www.justwushu.tv/uploads/player_thumbs/1sbthkRXwRtKTdLvmERx.jpg:http://www.justwushu.tv/uploads/1sbthkRXwRtKTdLvmERx.flv[/jw]

If someone would be so kind, as to point out my error, I would appreciate it. Thank you in advance!
try changing : with something else - can be ::
Thanks ranjani,

I will give it a try!
Hi ranjani,

gave it a try, still not working. Thank you, I appreciated the response.
the URL's have : in it (httpSmile.

Try using - as separator between file link and image link. Smile
Thanks kavin, I will give it a try.
it is not work
(2012-02-23, 09:06 AM)kavin Wrote: [ -> ]If the input you will give will be like image:file then regular expression should be
\[jw\](.*?):(.*?)\[/jw\]

Now you can use $1 for image and $2 for file.

Thanks Kavin, i was searching this for many days, finally I found this solution. it worked for me in MyBB 1.6.13.

Now i can use multiple variables in a custom MyCode.

Thank you sooo much.