
23-02-2011, 17:00:54
|
| |
denemedim PHP- Kodu: <?php
ob_start();
function facelink($link) {
$link = str_replace ("\u00253A",":",$link);
$link = str_replace ("\u00252F","/",$link);
$link = str_replace ("\u002526","&",$link);
$link = str_replace ("\u00253F","?",$link);
$link = str_replace ("\u00253D","=",$link);
return $link;
}
function faceduzelt($urele)
{
$explode=explode("/",$urele);
$say=count($explode);
$son=$explode[$say-1];
$explode2=explode("_",$son);
$videoaydi=$explode2[0];
$al = file_get_contents("http://www.facebook.com/ajax/flash/expand_inline.php?target_div=u879823_18&__a=1&v=$videoaydi");
$al = stripslashes($al);
//echo $al;
$exp=explode("\"video_src\", \"",$al);
$exp=explode("\");",$exp[1]);
$l=facelink($exp[0]);
$l=str_replace('http://','',$l);
//$l=urlencode($l);
return $l;
}
function embed($kod,$width,$height) {
if(eregi("<",$kod)) {
$basla = array('/height="([0-9]+)"/','/width="([0-9]+)"/','/height=([0-9]+)/','/width=([0-9]+)/','/height:([0-9]+)/','/width:([0-9]+)/');
$bitir = array('height="'.$height.'"','width="'.$width.'"','height="'.$height.'"','width="'.$width.'"','height:'.$height,'width:'.$width);
$kod = preg_replace($basla,$bitir,$kod,-1);
return $kod;
}else{
$facele = $kod;
if ((strpos($facele,'facebook.com')) or (strpos($facele,'fbcdn.net'))) {
$facele = faceduzelt($facele);
}
$facele = str_replace('http://','',$facele);
$embed = '<div id="playerx" style="float:left;"><a href="http://www.macromedia.com/go/getflashplayer">Video izleyemiyorsanız lütfen Flash Player son versiyonu buradan yükleyiniz.</a></div>
<script type="text/javascript" src="/js/swfobject.js"></script>
<script type="text/javascript">
var s1 = new SWFObject("/images/player.swf","mediaplayer","'.$width.'","'.$height.'","7");
s1.addParam("allowfullscreen","true");
s1.addVariable("width","'.$width.'");
s1.addVariable("autostart","true");
s1.addVariable("height","'.$height.'");
s1.addVariable("type", "flv");
s1.addVariable("file",encodeURIComponent(\''.$facele.'\'));
s1.write("playerx");</script>';
return $embed;
}
}
?> |