Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Tutorial) Mycode Youtube 720p [HD on] by default]
#1
Lightbulb 
Go to your ACP in:
http://www.yoursite.com/admin/index.php?module=config/mycode

Follow these steps in creating a new mycode

Title: Youtube HD

Short Description: YoutubeHD

Regular Expression:
Code:
\[video=hd\]([0-9a-zA-Z\-_ ]+)\[/video\]

Replacement:
Code:
<object width="854" height="450"><param name="movie" value="http://www.youtube.com/v/$1&hl=pt-br&fs=1&hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/$1&hl=pt-br&fs=1&hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="854" height="450"></embed></object>

PS: Replace pt-br with with your language code



Result:
   
Reply
#2
will this make it though for people who have a youtube video url can just copy it to the site and post reply and voila there is the youtube video and then you start to watch it?
Reply
#3
nope... bbcode for this will be

Code:
[video=hd]video-ID[/video]

(05-12-2009, 11:23 AM)Yumi Wrote:  I've seen a number of MyCodes where "(.*?)" expression is used. I thought it'd be about time that I suggest trying to avoid that expression where possible, as this may allow users to perform some minor HTML injection (HTML tags are automatically converted to their entities and Javascript is automatically stripped out, so luckily this isn't that big an issue).

Suggestions:
Number fields, use "([0-9]+)"
General CSS fields (may not apply to everything), use "([0-9a-zA-Z\-_ ]+)"

Hope that helps.

Updated...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)