playlist.php
author Dan
Fri, 25 Apr 2008 14:48:23 -0400
changeset 19 75dd71fe35b2
parent 10 d3059e20b0fa
child 21 74edc873234f
permissions -rw-r--r--
Added the "powered by" link and rebranded as 0.1 alpha 1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
     1
<?php
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
     2
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
     3
/**
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
     4
 * Playlist displayer
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
     5
 *
6
5f35ebc4f9bb First release version. Renamed to Greyhound and readme/license files added.
Dan
parents: 5
diff changeset
     6
 * Greyhound - real web management for Amarok
5
9b96265b5918 Relicensed to GPLv2. Previous revisions should not be downloaded as they do not contain copies of appropriate licenses, which will be added in a later commit. Completed interface for mobile devices.
Dan
parents: 4
diff changeset
     7
 * Copyright (C) 2008 Dan Fuhry
0
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
     8
 *
5
9b96265b5918 Relicensed to GPLv2. Previous revisions should not be downloaded as they do not contain copies of appropriate licenses, which will be added in a later commit. Completed interface for mobile devices.
Dan
parents: 4
diff changeset
     9
 * This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License
9b96265b5918 Relicensed to GPLv2. Previous revisions should not be downloaded as they do not contain copies of appropriate licenses, which will be added in a later commit. Completed interface for mobile devices.
Dan
parents: 4
diff changeset
    10
 * as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
9b96265b5918 Relicensed to GPLv2. Previous revisions should not be downloaded as they do not contain copies of appropriate licenses, which will be added in a later commit. Completed interface for mobile devices.
Dan
parents: 4
diff changeset
    11
 *
9b96265b5918 Relicensed to GPLv2. Previous revisions should not be downloaded as they do not contain copies of appropriate licenses, which will be added in a later commit. Completed interface for mobile devices.
Dan
parents: 4
diff changeset
    12
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
9b96265b5918 Relicensed to GPLv2. Previous revisions should not be downloaded as they do not contain copies of appropriate licenses, which will be added in a later commit. Completed interface for mobile devices.
Dan
parents: 4
diff changeset
    13
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
0
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    14
 */
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    15
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    16
function amarok_playlist($server)
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    17
{
4
cde92f6ec29f Should be completely iPhone/iPod Touch-friendly now :)
Dan
parents: 3
diff changeset
    18
  global $theme, $playlist, $allowcontrol;
cde92f6ec29f Should be completely iPhone/iPod Touch-friendly now :)
Dan
parents: 3
diff changeset
    19
  
10
d3059e20b0fa SECURITY: Fix ability to crash server in ajax.php; added playback position slider and ability to seek through current song
Dan
parents: 6
diff changeset
    20
  $iphone = ( ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') ||
4
cde92f6ec29f Should be completely iPhone/iPod Touch-friendly now :)
Dan
parents: 3
diff changeset
    21
       strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') ||
cde92f6ec29f Should be completely iPhone/iPod Touch-friendly now :)
Dan
parents: 3
diff changeset
    22
       strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') ||
10
d3059e20b0fa SECURITY: Fix ability to crash server in ajax.php; added playback position slider and ability to seek through current song
Dan
parents: 6
diff changeset
    23
       isset($_GET['m']) )
d3059e20b0fa SECURITY: Fix ability to crash server in ajax.php; added playback position slider and ability to seek through current song
Dan
parents: 6
diff changeset
    24
       && !isset($_GET['f'])
4
cde92f6ec29f Should be completely iPhone/iPod Touch-friendly now :)
Dan
parents: 3
diff changeset
    25
       );
cde92f6ec29f Should be completely iPhone/iPod Touch-friendly now :)
Dan
parents: 3
diff changeset
    26
  $theme_id = ( $iphone ) ? 'iphone' : $theme;
cde92f6ec29f Should be completely iPhone/iPod Touch-friendly now :)
Dan
parents: 3
diff changeset
    27
  $smarty = load_theme($theme_id);
0
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    28
  
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    29
  $active = dcop_action('playlist', 'getActiveIndex');
4
cde92f6ec29f Should be completely iPhone/iPod Touch-friendly now :)
Dan
parents: 3
diff changeset
    30
  $smarty->assign('theme', $theme_id);
0
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    31
  $smarty->assign('playlist', $playlist);
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    32
  $smarty->assign('active', $active);
1
cddc2ba706d6 Preliminary groundwork for AJAX interface
Dan
parents: 0
diff changeset
    33
  $smarty->assign('scripts', array(
cddc2ba706d6 Preliminary groundwork for AJAX interface
Dan
parents: 0
diff changeset
    34
      'ajax.js',
2
860ba7141641 Should be nearly finished now - includes volume control, length measurement, and seems pretty stable
Dan
parents: 1
diff changeset
    35
      'domutils.js',
10
d3059e20b0fa SECURITY: Fix ability to crash server in ajax.php; added playback position slider and ability to seek through current song
Dan
parents: 6
diff changeset
    36
      'volume.js',
d3059e20b0fa SECURITY: Fix ability to crash server in ajax.php; added playback position slider and ability to seek through current song
Dan
parents: 6
diff changeset
    37
      'dom-drag.js',
d3059e20b0fa SECURITY: Fix ability to crash server in ajax.php; added playback position slider and ability to seek through current song
Dan
parents: 6
diff changeset
    38
      'position.js'
1
cddc2ba706d6 Preliminary groundwork for AJAX interface
Dan
parents: 0
diff changeset
    39
    ));
3
e7447a6044ec $allowcontrol = false working and turned on now; switched default port back to 7447 instead of random; added favicon and apple-touch-icon
Dan
parents: 2
diff changeset
    40
  $smarty->assign('allow_control', $allowcontrol);
0
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    41
  $smarty->display('playlist.tpl');
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    42
}
c63de9eb7045 First commit. Basic things are working and implemented (webserver, templating, DCOP interface)
Dan
parents:
diff changeset
    43