# HG changeset patch # User Dan # Date 1206324237 14400 # Node ID cde92f6ec29f3b15a2f6e31765c5cb86572cd373 # Parent e7447a6044ec0021cd68f68dbf9121e2f09f9f57 Should be completely iPhone/iPod Touch-friendly now :) diff -r e7447a6044ec -r cde92f6ec29f functions.php --- a/functions.php Sun Mar 23 20:58:51 2008 -0400 +++ b/functions.php Sun Mar 23 22:03:57 2008 -0400 @@ -132,3 +132,24 @@ return "$minutes:$seconds"; } +/** + * Loads the specified theme into Smarty + * @param string Theme ID + * @return object Smarty object + */ + +function load_theme($theme_id) +{ + global $httpd; + static $smarty = array(); + if ( !isset($smarty[$theme_id]) ) + { + $smarty[$theme_id] = new Smarty(); + $smarty[$theme_id]->template_dir = "./themes/$theme_id"; + $smarty[$theme_id]->compile_dir = "./themes/$theme_id/compiled"; + $smarty[$theme_id]->cache_dir = "./cache"; + $smarty[$theme_id]->config_dir = "./config"; + $httpd->add_handler("themes/$theme_id", 'dir', "./themes/$theme_id"); + } + return $smarty[$theme_id]; +} diff -r e7447a6044ec -r cde92f6ec29f playlist.php --- a/playlist.php Sun Mar 23 20:58:51 2008 -0400 +++ b/playlist.php Sun Mar 23 22:03:57 2008 -0400 @@ -11,10 +11,18 @@ function amarok_playlist($server) { - global $smarty, $theme, $playlist, $allowcontrol; + global $theme, $playlist, $allowcontrol; + + $iphone = ( strpos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || + strpos($_SERVER['HTTP_USER_AGENT'], 'iPod') || + strpos($_SERVER['HTTP_USER_AGENT'], 'BlackBerry') || + isset($_GET['m']) + ); + $theme_id = ( $iphone ) ? 'iphone' : $theme; + $smarty = load_theme($theme_id); $active = dcop_action('playlist', 'getActiveIndex'); - $smarty->assign('theme', $theme); + $smarty->assign('theme', $theme_id); $smarty->assign('playlist', $playlist); $smarty->assign('active', $active); $smarty->assign('scripts', array( diff -r e7447a6044ec -r cde92f6ec29f themes/funkymonkey/style.css --- a/themes/funkymonkey/style.css Sun Mar 23 20:58:51 2008 -0400 +++ b/themes/funkymonkey/style.css Sun Mar 23 22:03:57 2008 -0400 @@ -87,6 +87,7 @@ margin-right: 1px; background-color: #33395d; border: 1px solid #909090; + text-decoration: none; } a.volume_button_active { diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/ajax.gif Binary file themes/iphone/images/ajax.gif has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/amarok.gif Binary file themes/iphone/images/amarok.gif has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/next.png Binary file themes/iphone/images/next.png has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/pause.png Binary file themes/iphone/images/pause.png has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/play.png Binary file themes/iphone/images/play.png has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/playbar-shadow.gif Binary file themes/iphone/images/playbar-shadow.gif has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/playbar.gif Binary file themes/iphone/images/playbar.gif has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/prev.png Binary file themes/iphone/images/prev.png has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/src/playbar-shadow.xcf Binary file themes/iphone/images/src/playbar-shadow.xcf has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/src/playbar.xcf Binary file themes/iphone/images/src/playbar.xcf has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/stop.png Binary file themes/iphone/images/stop.png has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/images/volume.png Binary file themes/iphone/images/volume.png has changed diff -r e7447a6044ec -r cde92f6ec29f themes/iphone/playlist.tpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/themes/iphone/playlist.tpl Sun Mar 23 22:03:57 2008 -0400 @@ -0,0 +1,85 @@ +{** + * Template file for default Funky Monkey theme + * Web control interface script for Amarok + * Written by Dan Fuhry - 2008 + * + * This script is in the public domain. Use it for good, not evil. + *} + + + +
+Track | +
---|
+ + {$track.title|escape} + + | +