Needs a BackButton (js history(-1))

Where are we heading with kPlaylist?

Needs a BackButton (js history(-1))

Postby Guest » Wed Jun 22, 2005 6:26 pm

Hi there,

I try to modify a little part of the script. What I need is that Back-Button-Output as I've seen it by testing, but cannot find it know in the sourcecode.

The first little thing I want to add to the script is in m3ugenerator->start() the ability to save a playlist as a file on the server. This will be used for my Jukebox-Winamp.

Can someone point me to the partwhere to find the (maybe) function call for the back-button?


Regards,
Waldemar

Code: Select all
PS: my new m3ugenerator->start():

   function start($saveAsJukeboxList='')
   {
      $num = lzero(getrand(1,999999),6);
      if (db_guinfo('plinline')) $method = 'inline'; else $method = 'attachment';
      if ($this->addcrlf) $this->data .= $this->crlf;
      if (trim($saveAsJukeboxList)!='')
      {
         $fp = @fopen($saveAsJukeboxList,'wb');
         if($fp===FALSE) return FALSE;
         $ret = @fwrite($fp,$this->data,strlen($this->data));
         @fclose($fp);
         return $ret===FALSE ? FALSE : TRUE;
      }
      header('Content-Disposition: '.$method.'; filename=kp'.$num.'.m3u', true);
      header('Content-Type: audio/x-mpegurl', true);
      header('Content-Length: '.strlen($this->data), true);
      header('Cache-Control: must-revalidate, post-check=0, pre-check=0', true);
      echo $this->data;
   }
Guest
 

Re: Needs a BackButton (js history(-1))

Postby aba » Wed Jun 22, 2005 9:08 pm

Anonymous wrote:Hi there,

I try to modify a little part of the script. What I need is that Back-Button-Output as I've seen it by testing, but cannot find it know in the sourcecode.


You mean this?

Code: Select all
<a href="javascript:history.go(-1);">back</a>
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Yes, that was what I'm searching for, but ...

Postby Guest » Fri Jun 24, 2005 5:33 pm

... also with complete header, styles and footer! :wink:

But after studying your Script, I've found it all, here one hacked section with the response of the BackButton:

Code: Select all
                  if (isset($_POST['jukeboxlist']))
                  {
                     if (isset($_POST['sel_playlist']) && is_numeric($_POST['sel_playlist']))
                     {
                        $kp = new kp_playlist($_POST['sel_playlist']);
                        $res = $kp->saveAsJukeboxList(trim($JukeboxFilename));
                        if($res==1)
                        {
                           $myBody = "\n<font class=\"notice\">Successful saved as JukeboxList!&nbsp;</font>";
                           $myBody .= "<a href=\"/studiowinamp/index.php?DO=60001\" onClick=\"history.go(-1);return true;\" target=\"MUSICMAN\" class=\"fatbuttom\">&nbsp;";
                           $myBody .= "Load&nbsp;List&nbsp;into&nbsp;Winamp&nbsp;and&nbsp;return&nbsp;to&nbsp;K-Playlist";
                           $myBody .= "&nbsp;</a>\n";
                        }
                        else
                        {
                           $myBody = "\n<font class=\"notice\">Error saving as JukeboxList!&nbsp;</font>";
                           $myBody .= '<a href="javascript:history.go(-1)" class="fatbuttom">&nbsp;'.get_lang(34);
                           $myBody .= "&nbsp;</a>\n";
                        }
                        kprintheader();
                        echo $myBody;
                        kprintend();
                     }
                  }


Now I've a tiny but nice solution that lets work together my serverside (PHP)-Winamp-Player and your very powerful K-Playlist :D

Everytime in Directorymode when "psongsall" is posted (or in PlaylistMode "jukeboxlist"), the script generates a EXTM3U-list with Pathnames instead of Stream-URL's, and support it to myWinampControl:

Image

Image

The script runs only in my intranet, so there is no need for security at that point. This way I can send music to my JukeBoxPlayer and also stream to PC's in other rooms.

The only thing what would be much better: You embedd a direct Jukebox-solution into your script, :wink:
(I've send some scripts to you, hopefuly you have received them?)


OK, enough for this time.
Many thanks for making that powerful program public and open source!


Best wishes,
Waldemar
Guest
 

Postby jmelhus » Fri Jun 24, 2005 7:37 pm

Winamp playing serverside? Wow, thats great! Is it difficult to set up?
jmelhus
 
Posts: 128
Joined: Sat Jan 01, 2005 1:10 pm

Postby Waldemar2 » Fri Jun 24, 2005 10:48 pm

Hi,

jmelhus wrote:Winamp playing serverside? Wow, thats great! Is it difficult to set up?


The PlayerControl-Script isn't much difficult, when it's used standalone.
But to embedd it into K-Playlist in a "professional" way, would be a lot of work, I think.
What I've done is only a quick (not very quick because it took me much hours, :wink: ) and dirty hack. No support for toggle on/off this mode, is available for every user, uuh; no language support, is hacked directly into the script, will be difficult to do an upgrade, etc. etc.

Better the developers of the K-Playlist-Script do it. They will know how to make it best, :)


Regards,
Waldemar
Waldemar2
 

Postby Guest » Fri Jun 24, 2005 11:36 pm

What do you think aba? This would really be great!!! :D
Guest
 


Return to Development