943,172 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 542
  • PHP RSS
Sep 1st, 2010
0

ZippyShare embedded player generator

Expand Post »
I have a blog,where I post a lot of songs,and I'd love if somebody could help me implement some sort of script in my blog.

Is it possible,that whenever I want to post a zippyshare link,the script automatically converts it into a embedded media player?

This is some source code I got from another site,I don't know if it is helpful or not.

As far as I can tell,it's the generation procedure of the embedded player.

I'd really appreciate any kind of help.

PHP Syntax (Toggle Plain Text)
  1. class ZippyShare {
  2.  
  3. public function getURL($url) {
  4.  
  5. $url = str_replace("/file.html", "", explode("/v/", $url));
  6. $url = $url['0']."/downloadMusic%3Fkey%3D".$url['1']."ay";
  7. return $url;
  8. }
  9.  
  10. public function musicPlayer($url) {
  11.  
  12. $url = $this->getURL($url);
  13.  
  14. $player = '<embed
  15. width="440"
  16. height="20"
  17. type="application/x-shockwave-flash"
  18. src="http://api.zippyshare.com/api/mediaplayer/mediaplayer.swf"
  19. style=""
  20. id="mpl"
  21. name="mpl"
  22. quality="high" allowfullscreen="false"
  23. flashvars="height=20&amp;width=440&amp;file='.$url.'&amp;volume=100&amp;autostart=false&amp;frontcolor=0xffffff&amp;backcolor=0x000000&amp;lightcolor=0xffffff&amp;type=flv">
  24. ';
  25.  
  26. return $player;
  27. }
  28.  
  29. }
  30.  
  31. $music = new ZippyShare;
  32. echo $music->musicPlayer('http://www48.zippyshare.com/v/70282946/file.html');
  33. ?>

or

PHP Syntax (Toggle Plain Text)
  1. <?
  2.  
  3. $i= 1;
  4. while($i <= 1){
  5.  
  6. //name
  7. $name = explode('Name: </strong>', $geturl);
  8. $name = explode('</font><br />', $name[1]);
  9. $name = $name[0];
  10. $replaceobj = array(".mp3");
  11. $name = str_replace( $replaceobj, "", $name );
  12. // Link
  13. $link = explode('src="../../mediaplayer/mediaplayer.swf?file=', $geturl);
  14. $link = explode('"', $link[1]);
  15. $link = $link[0];
  16.  
  17. if($link != ""){
  18. ?>
  19. <textarea rows="1" cols="100">
  20. <?=$name?>
  21. </textarea>
  22. <textarea rows="10" cols="100">
  23. <strong><?=$name?></strong><br />
  24. Listen:<br />
  25. <embed allowScriptAccess="never" src="http://www.zippyshare.com/mediaplayer/mediaplayer.swf?file=<?=$link?>" menu="false" quality="high" width="300" height="20" name="mp3player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" border="0" style="margin-bottom: 6px;"/></embed><br />
  26. <a href="<?=$url?>" target="_blank"><img src="<?=$downimgpath;?>" alt="<?=$name?>"></a>
  27. <a href="<?=$url?>"><?=$name?></a>
  28. </textarea>
  29. <br>
  30. <hr>
  31. <strong><?=$name?></strong><br />
  32. Listen:<br />
  33. <embed allowScriptAccess="never" src="http://www.zippyshare.com/mediaplayer/mediaplayer.swf?file=<?=$link?>" menu="false" quality="high" width="300" height="20" name="mp3player" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="transparent" border="0" style="margin-bottom: 6px;"/></embed><br />
  34. <a href="<?=$url?>" target="_blank"><img src="<?=$downimgpath;?>" alt="<?=$name?>"></a>
  35. <a href="<?=$url?>"><?=$name?></a>
  36.  
  37.  
  38.  
  39. <?
  40. $ts++;
  41. }
  42. else
  43. {
  44. ?>
  45. <textarea rows="10" cols="100">
  46. <strong><?=$name?></strong>
  47. Download:
  48. <a href="<?=$url?>"><?=$name?></a>
  49. </textarea>
  50. <br>
  51. <hr>
  52. <strong><?=$url?></strong>
  53. Download:
  54. <a href="<?=$url?>"><?=$name?></a>
  55. <?
  56.  
  57. }
  58. $i++;
  59. }
  60.  
  61.  
  62. ?>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mCmAl is offline Offline
1 posts
since Sep 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: login codes
Next Thread in PHP Forum Timeline: How to post the $_post from a previous page?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC