Jump to content

need help with a modification


ddfusion

Recommended Posts

Hey All...  New here.

 

Any ways here is my problem.  I am trying to modify a small script for an audio player, the script was originally written for a different player than what i want to use.

 

basically i need it to write the files it pulls from user directories in a different format and put them into the swfobjet variables.  This is a plugin for an elgg social network site.

 

Here is the code that i have:

<?php

   //the page owner
   $owner = $vars['entity']->owner_guid;
   //The maximum mp3 files on playlist	
   $number = 10000;
   $playlist = "";
   $titles = "";
   

   //get the user's files
   $files = get_user_objects($vars['entity']->owner_guid, "file", $number, 0);

   //if there are some files, go get them
   if ($files) 
   {
   
   
   //display in list mode
      foreach($files as $f)
      {
          $mime = $f->mimetype;
          if ($mime == "audio/mpeg")
          {
            if ($playlist)
            {
              $playlist = $playlist . '|';
		  
              $titles = $titles . '|';
            }
		      $playlist = $playlist . $vars['url'] . 'action/file/download?file_guid=' . $f->guid;

            $titles = $titles . $f->title;
          }
      }
    } 
    else 
    {
    echo elgg_echo("No Files");
    }

?>

<!-- flash player -->
<script src="<?php echo $vars['url']; ?>mod/mytunes/swfobject/swfobject.js" type="text/javascript"></script>
<center>
<div id="mytunes">
</div>
</center>

<script type="text/javascript">
// <![CDATA[

var so = new SWFObject("<?php echo $vars['url']; ?>mod/mytunes/audioplayer/ep_player.swf", "ep_player", "269", "226", "9", "#FFFFFF");
so.addParam("WMODE", "transparent");
so.addVariable("skin", "<?php echo $vars['url']; ?>mod/mytunes/audioplayer/skins/nobius_platinum/skin.xml");
so.addVariable("playlistxml", "<?php echo $playlist; ?><?php echo $creator; ?><?php echo $titles; ?>");
so.addVariable("autoplay", "true");
so.addVariable("shuffle", "false");
so.addVariable("buffertime", "1");
so.write("mytunes");

// ]]>
</script>

 

the files should be a list in a format like this:

<track><location>url to file</location><creator>artist</creator><title>song title</title></track>

currently there is no option for creator so that will be a blank input.

then it should be able to be put in the swfobject line:

so.addVariable("playlistxml", "<?php echo $playlist; ?><?php echo $creator; ?><?php echo $titles; ?>");

 

however it needs to be written.

Link to comment
https://forums.phpfreaks.com/topic/156004-need-help-with-a-modification/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.