Skip to content
WJunction - Webmaster Forum

Auto Embed Scrip for Wordpress

Status
Not open for further replies.

kdaica

Established Member
167
2011
7
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
Established Member · Joined
167
Messages
7
Reactions
206
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom