Current time: 03-22-2010, 08:15 AM Hello There, Guest! (LoginRegister)


Post Reply 
 
Thread Rating:
  • 2 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[MyCode] Get your custom video in posts just posting its URL (automatic embed)
06-04-2009, 07:59 PM (This post was last modified: 06-06-2009 12:37 PM by aglioeolio.)
Post: #1
Lightbulb [MyCode] Get your custom video in posts just posting its URL (automatic embed)
'Basics' of auto-embed credits to SAFAD
threads: http://community.mybboard.net/thread-49050.html http://community.mybboard.net/thread-48781.html

1st: Number of chars in Video-ID
Pick a video url and see its relation with embed code... there must be an "ID Code" between both that will be the mycode key value (video-ID). You will need the number of chars from that code.

* example:
Dailymotion:

video URL:
PHP Code:
http://www.dailymotion.com/relevance/search/pes+2010+e3/video/x9h0nm_pes-2010-e3-2k9_videogames 

video Embed:
Code:
<div><object width="480" height="291"><param name="movie" value="http://www.dailymotion.com/swf/x9h0nm_pes-2010-e3-2k9_videogames&related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/x9h0nm_pes-2010-e3-2k9_videogames&related=0" type="application/x-shockwave-flash" width="480" height="291" allowFullScreen="true" allowScriptAccess="always"></embed></object><br /><b><a href="http://www.dailymotion.com/video/x9h0nm_pes-2010-e3-2k9_videogames">PES 2010 E3 2K9</a></b><br /><i>Enviado por <a href="http://www.dailymotion.com/CSL_Console">CSL_Console</a>. - <a href="http://www.dailymotion.com/br/channel/videogames">Veja reviews de games, trailers e seus melhores momentos jogando</a></i></div>

Key value (Video-ID): x9h0nm - 6 chars


2nd: Build the "Regular Expression" mycode with video url

Just paste video url in mycode replacement following SAFAD replacements
(example from auto-youtube)

(\[youtube\]|(<a href=\")?(http://)?(www.)?youtube.com/watch\?v=)(.{11}?)((.*?)\" target=\"_blank\">)?((.*?)\[/youtube\]|(.*?)</a>)

  1. Red = Basic site URL
  2. Green = Number os chars from youtube´s video ID > Example: http://www.youtube.com/watch?v=W4K_k_7Eroo




* Still studying dailymotion example:
http://www.dailymotion.com/relevance/search/pes+2010+e3/video/x9h0nm_pes-2010-e3-2k9_videogames
  1. Green = basic video URL



Regular Expression:
(\[dailymotion\]|(<a href=\")?(http://)?(www.)?dailymotion.com/(.*?)/video/)(.{6}?)((.*?)\" target=\"_blank\">)?((.*?)\[/dailymotion\]|(.*?)</a>)

{6} = number os characters from Video-ID Lightbulb


3rd: Build the "Replacement" mycode with Embed code

Just copy & paste EMBED Code from video and replace Video-ID with ${5} tag:

from:
Video example:

Quote:<div><object width="480" height="291"><param name="movie" value="http://www.dailymotion.com/swf/x9h0nm_pes-2010-e3-2k9_videogames&related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/x9h0nm_pes-2010-e3-2k9_videogames&related=0" type="application/x-shockwave-flash" width="480" height="291" allowFullScreen="true" allowScriptAccess="always"></embed></object><br /><b><a href="http://www.dailymotion.com/video/x9h0nm_pes-2010-e3-2k9_videogames">PES 2010 E3 2K9</a></b><br /><i>Enviado por <a href="http://www.dailymotion.com/CSL_Console">CSL_Console</a>. - <a href="http://www.dailymotion.com/br/channel/videogames">Ver mais videos de jogos</a></i></div>

  1. Red = useless code
  2. Blue = Video-ID




Replacement:
Code:
<object width="480" height="291"><param name="movie" value="http://www.dailymotion.com/swf/${6}&related=0"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.dailymotion.com/swf/${6}&related=0" type="application/x-shockwave-flash" width="480" height="291" allowFullScreen="true" allowScriptAccess="always"></embed></object>


it´s done...pretty simple Smile

"MyCode preview" won´t work, test directly in post preview pasting some Video urls - surelly will work

[]s, Claudio

Petition: Distinction between "Premium" and "Free" Plugin & Themes Thread Releases
Visit this user's website Find all posts by this user
Quote this message in a reply
06-04-2009, 08:21 PM
Post: #2
RE: [MyCode] Get your custom video in posts just posting its URL (automatic embed)
Interesting.. thanks for posting.
Find all posts by this user
Quote this message in a reply
06-15-2009, 05:22 PM
Post: #3
RE: [MyCode] Get your custom video in posts just posting its URL (automatic embed)
Testing...

-Rafael
Im a Big MyBB Fan!!! Cool
My Forum
My Blog
PM Me if you want a Lockerz Invitation
Visit this user's website Find all posts by this user
Quote this message in a reply
06-16-2009, 10:13 AM
Post: #4
RE: [MyCode] Get your custom video in posts just posting its URL (automatic embed)
You Have Stolen My Codes !

http://www.safadsoft.com
1.4.4
Visit this user's website Find all posts by this user
Quote this message in a reply
01-12-2010, 06:45 PM
Post: #5
RE: [MyCode] Get your custom video in posts just posting its URL (automatic embed)
he is giving you the credits
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: