want a Flashx Auto Embed Script for Wordpress

Status
Not open for further replies.

Rajcoolindian

Banned
Banned
5
2013
1
0
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/3OYSB12792HD/51840e17bd4bemp4 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 want a script to auto add the hash file example:

http://flashx.tv/video/3OYSB12792HD/51840e17bd4bemp4 to

<iframe width="600" height="400" src="http://play.flashx.tv/player/embed.php?hash=3OYSB12792HD&width=580&height=380&autoplay=no" frameborder="0" allowfullscreen></iframe>

please contact for the price if possible for the script
thanks
 
4 comments
add to functions.php:
PHP:
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');
 
thanks, great script
only one issue, am using "Auto-hyperlink URLs" as plug-inand it double post the iflame

deactivating the plug-in its work perfectly , there is a way to enable the plug-in without double post the iflame

many thanks and you didn't asked the cost?
 
It's because the plugin changes
Code:
http://flashx.tv/video/3OYSB12792HD/51840e17bd4bemp4
to something like
Code:
<a href="http://flashx.tv/video/3OYSB12792HD/51840e17bd4bemp4">http://flashx.tv/video/3OYSB12792HD/51840e17bd4bemp4</a>
and as you see, the URL shows up twice, both of them are replaced by my filter.

I think it will work if you modify the code a bit:
PHP:
function flashx_iframe($content) {
  $content = preg_replace('/<a.+href="http:\/\/flashx\.tv\/video\/([a-z0-9]+)\/[a-z0-9]+"[^>]+>[^<]+</a>/iU','<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');
I won't ask money for this, it was for free now :) I hope it works.
PM me next time you have a WP/PHP-related job.


EDIT: the add_filter() function also accepts a priority argument, using that it's possible to make it run BEFORE the auto-hyperlink filter. So you can try this too:
PHP:
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);
(notice the 1 at the end)
 
Last edited:
Hey Guys,

here is an updated code for PHP

function flashx_iframe($content, $width, $height){
$content = preg_replace('/http:\/\/www.flashx\.tv\/([a-z0-9]+)+.html/i','<iframe src="http://www.flashx.tv/embed-$1-'.$width.'x'.$height.'.html" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" width="'.$width.'" height="'.$height.'"></iframe>',$content);
return $content;
}

flashx_iframe("http://www.flashx.tv/8k6aqw6yr1q4.html", 640, 360);

flashx_iframe("THE URL", "WIDTH", "HEIGHT");

Regards

flashX.tv
 
Status
Not open for further replies.
Back
Top