Skip to content
WJunction - Webmaster Forum

Auto Embed Scrip for Wordpress

Status
Not open for further replies.
Hello to all,
i'am using flashx as video for my site and when i upload files i get the link like this : http://flashx.tv/video/O3NB2MOH921A/mdyd-716 making my visitor to leave my website to go to stream.
So i have to edit 1-by-1 post to add the iflame of flashx on each post taking me a lot of time

i use a script to auto add link (functions.php )
Code:
function flashx_iframe($content){
  $content =  preg_replace('/http:\/\/flashx\.tv\/video\/([a-z0-9]+)\/[a-z0-9]+/i','<iframe  width="600" height="400"  src="http://play.flashx.tv/player/embed.php?hash=$1&width=580&height=380&autoplay=no"  frameborder="0" allowfullscreen></iframe>',$content);
  return $content;
}
add_filter('the_content','flashx_iframe', 1);

the video is still running normally, but it leaves out the names after post:
My link is :http://flashx.tv/video/O3NB2MOH921A/mdyd-716
After post :" video"-716
Please help me edit the script to remove the title "-716"
please contact for the script
thanks!
 

3 comments

Try this:

PHP:
function flashx_iframe($content){
  $content =  preg_replace('/http:\/\/flashx\.tv\/video\/(\w+)\/\w+(?:-\d+)?/i','<iframe  width="600" height="400"  src="http://play.flashx.tv/player/embed.php?hash=$1&width=580&height=380&autoplay=no"  frameborder="0" allowfullscreen></iframe>',$content);
  return $content;
}
add_filter('the_content','flashx_iframe', 1);
 
Status
Not open for further replies.

About the author

K
Active Member · Joined
167
Messages
7
Reactions
18
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom