From d48575fcf6e28af0dbd153fd6718784ac43dfdfa Mon Sep 17 00:00:00 2001 From: Niols Date: Sat, 6 Jun 2015 18:52:57 +0200 Subject: [PATCH 1/3] Ignore emacs files, log dir and channel/.htaccess --- .gitignore | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 39e94cc5..d89f9757 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ config/ampache.cfg.php config/ampache-doped.cfg.php rest/.htaccess play/.htaccess +channel/.htaccess *.phpproj *.sln *.v11.suo @@ -9,4 +10,7 @@ play/.htaccess logs /nbproject/private/ .pc -/tmp \ No newline at end of file +/tmp +log/ +*~ +*# \ No newline at end of file From 35477d0a5ef273bda71107be15f681619243f2bc Mon Sep 17 00:00:00 2001 From: Niols Date: Sat, 6 Jun 2015 18:53:38 +0200 Subject: [PATCH 2/3] Add UI::find_template method and its allow_php_themes argument --- config/ampache.cfg.php.dist | 7 +++++++ lib/class/ui.class.php | 31 +++++++++++++++++++++++++------ 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/config/ampache.cfg.php.dist b/config/ampache.cfg.php.dist index c27949aa..c0c75ccd 100644 --- a/config/ampache.cfg.php.dist +++ b/config/ampache.cfg.php.dist @@ -972,3 +972,10 @@ encode_ss_duration = "-t %DURATION%" ; so that the ordering is sane. ; DEFAULT: auto ;mb_detect_order = "ASCII,UTF-8,EUC-JP,ISO-2022-JP,SJIS,JIS" + + + +; This setting allows themes to overwrite PHP template files. This can be really +; dangerous. Do this only if you trust every theme in your themes/ directory. +; DEFAULT: false +;allow_php_themes = "false" diff --git a/lib/class/ui.class.php b/lib/class/ui.class.php index 563db1a3..b769e120 100644 --- a/lib/class/ui.class.php +++ b/lib/class/ui.class.php @@ -34,6 +34,25 @@ class UI return false; } + /** + * find_template + * + * Return the path to the template file wanted. The file can be overwriten + * by the theme if it's not a php file, or if it is and if option + * allow_php_themes is set to true. + */ + public static function find_template($template) + { + $path = AmpConfig::get('theme_path') . '/templates/' . $template; + $realpath = AmpConfig::get('prefix') . $path; + $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); + if(($extension != 'php' || AmpConfig::get('allow_php_themes')) + && file_exists($realpath) && is_file($realpath)) + return $path; + else + return '/templates/' . $template; + } + /** * access_denied * @@ -44,7 +63,7 @@ class UI // Clear any buffered crap ob_end_clean(); header("HTTP/1.1 403 $error"); - require_once AmpConfig::get('prefix') . '/templates/show_denied.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_denied.inc.php'); exit; } @@ -57,7 +76,7 @@ class UI public static function ajax_include($template) { ob_start(); - require AmpConfig::get('prefix') . '/templates/' . $template; + require AmpConfig::get('prefix') . UI::find_template('') . $template; $output = ob_get_contents(); ob_end_clean(); @@ -274,7 +293,7 @@ END; */ public static function show_header() { - require_once AmpConfig::get('prefix') . '/templates/header.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('header.inc.php'); } /** @@ -296,7 +315,7 @@ END; } } - require_once AmpConfig::get('prefix') . '/templates/footer.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('footer.inc.php'); if (isset($_REQUEST['profiling'])) { Dba::show_profile(); } @@ -309,7 +328,7 @@ END; */ public static function show_box_top($title = '', $class = '') { - require AmpConfig::get('prefix') . '/templates/show_box_top.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_box_top.inc.php'); } /** @@ -319,7 +338,7 @@ END; */ public static function show_box_bottom() { - require AmpConfig::get('prefix') . '/templates/show_box_bottom.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_box_bottom.inc.php'); } public static function show_custom_style() From a1f6a073cbeb2b2b4c9c2de792255b6d02a5dab6 Mon Sep 17 00:00:00 2001 From: Niols Date: Sat, 6 Jun 2015 18:54:05 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Use=20UI::find=5Ftemplate=20everytime=20the?= =?UTF-8?q?re's=20a=20'/templates/=E2=80=A6'=20Note:=20This=20concerns=20e?= =?UTF-8?q?verything=20but=20the=20install=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/access.php | 10 +- admin/catalog.php | 12 +- admin/duplicates.php | 6 +- admin/export.php | 2 +- admin/license.php | 2 +- admin/mail.php | 2 +- admin/modules.php | 6 +- admin/shout.php | 2 +- admin/system.php | 2 +- admin/users.php | 12 +- albums.php | 10 +- artists.php | 12 +- arts.php | 6 +- bin/channel_run.inc | 1 - browse.php | 4 +- channel.php | 4 +- cookie_disclaimer.php | 2 +- democratic.php | 8 +- image.php | 2 +- index.php | 4 +- install.php | 8 +- labels.php | 6 +- lib/class/album.class.php | 6 - lib/class/api.class.php | 122 +----------------- lib/class/artist.class.php | 3 - lib/class/browse.class.php | 58 ++++----- lib/class/catalog.class.php | 4 +- lib/class/channel.class.php | 2 +- lib/class/graph.class.php | 2 +- lib/class/rating.class.php | 4 +- lib/class/search.class.php | 14 -- lib/class/shoutbox.class.php | 12 +- lib/class/stream_playlist.class.php | 4 +- lib/class/userflag.class.php | 2 +- lib/class/xml_data.class.php | 81 ------------ lib/install.lib.php | 4 - lib/javascript/dynamicpage.js | 34 +++-- lib/rating.lib.php | 2 +- lib/ui.lib.php | 6 +- localplay.php | 8 +- login.php | 2 +- lostpassword.php | 4 +- modules/Beets/Catalog.php | 2 +- modules/catalog/local.catalog.php | 6 +- modules/plugins/ShoutHome.plugin.php | 2 +- playlist.php | 10 +- preferences.php | 2 +- pvmsg.php | 6 +- radio.php | 4 +- random.php | 2 +- register.php | 10 +- search.php | 10 +- server/browse.ajax.php | 2 +- server/edit.server.php | 6 +- server/index.ajax.php | 22 ++-- server/localplay.ajax.php | 8 +- server/player.ajax.php | 2 +- server/playlist.ajax.php | 2 +- server/sse.server.php | 2 +- server/stream.ajax.php | 2 +- share.php | 6 +- shout.php | 2 +- smartplaylist.php | 6 +- song.php | 4 +- sql/ampache.sql | 85 +----------- stats.php | 20 +-- templates/browse_filters.inc.php | 2 +- templates/footer.inc.php | 2 +- templates/header.inc.php | 18 +-- templates/rightbar.inc.php | 2 +- templates/show_add_shout.inc.php | 2 +- templates/show_albums.inc.php | 6 +- templates/show_artists.inc.php | 6 +- templates/show_broadcasts.inc.php | 6 +- templates/show_catalogs.inc.php | 6 +- templates/show_channels.inc.php | 6 +- templates/show_concerts.inc.php | 4 +- templates/show_democratic_playlist.inc.php | 4 +- templates/show_denied.inc.php | 8 +- templates/show_edit_video_row.inc.php | 2 +- templates/show_highest.inc.php | 2 +- templates/show_html5_player.inc.php | 4 +- templates/show_html5_player_headers.inc.php | 8 +- templates/show_index.inc.php | 2 +- templates/show_install_config.inc.php | 3 - templates/show_labels.inc.php | 6 +- templates/show_live_streams.inc.php | 6 +- templates/show_localplay_playlist.inc.php | 4 +- templates/show_login_form.inc.php | 16 ++- templates/show_lostpassword_form.inc.php | 14 +- templates/show_manage_license.inc.php | 2 +- templates/show_manage_shoutbox.inc.php | 2 +- templates/show_missing_albums.inc.php | 2 +- templates/show_newest.inc.php | 2 +- templates/show_now_playing.inc.php | 4 +- templates/show_objects.inc.php | 2 +- templates/show_playlist.inc.php | 2 +- templates/show_playlist_songs.inc.php | 6 +- templates/show_playlists.inc.php | 6 +- templates/show_preferences.inc.php | 2 +- templates/show_pvmsgs.inc.php | 6 +- templates/show_random.inc.php | 2 +- templates/show_recent.inc.php | 2 +- templates/show_recommended_artists.inc.php | 2 +- .../show_registration_confirmation.inc.php | 10 +- templates/show_search.inc.php | 4 +- templates/show_search_form.inc.php | 2 +- templates/show_searches.inc.php | 6 +- templates/show_share.inc.php | 2 +- templates/show_shared_objects.inc.php | 2 +- templates/show_shares.inc.php | 2 +- templates/show_song_previews.inc.php | 2 +- templates/show_songs.inc.php | 6 +- templates/show_stats_popular.inc.php | 6 +- templates/show_tvshow_seasons.inc.php | 6 +- templates/show_tvshows.inc.php | 6 +- templates/show_uploads.inc.php | 2 +- templates/show_user.inc.php | 2 +- templates/show_user_activate.inc.php | 10 +- templates/show_user_registration.inc.php | 8 +- templates/show_userflag.inc.php | 2 +- templates/show_users.inc.php | 6 +- templates/show_video.inc.php | 2 +- templates/show_video_row.inc.php | 2 +- templates/show_videos.inc.php | 10 +- templates/show_wanted.inc.php | 2 +- templates/show_wanted_albums.inc.php | 2 +- templates/show_web_player.inc.php | 2 +- templates/sidebar.inc.php | 4 +- templates/stylesheets.inc.php | 12 +- tvshow_seasons.php | 2 +- tvshows.php | 6 +- upload.php | 2 +- video.php | 2 +- web_player.php | 2 +- web_player_embedded.php | 2 +- 136 files changed, 365 insertions(+), 672 deletions(-) diff --git a/admin/access.php b/admin/access.php index 5c48f783..97e7ca39 100644 --- a/admin/access.php +++ b/admin/access.php @@ -72,7 +72,7 @@ switch ($_REQUEST['action']) { show_confirmation(T_('Added'), T_('Your new Access Control List(s) have been created'),$url); } else { $action = 'show_add_' . $_POST['type']; - require_once AmpConfig::get('prefix') . '/templates/show_add_access.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_access.inc.php'); } break; case 'update_record': @@ -86,7 +86,7 @@ switch ($_REQUEST['action']) { show_confirmation(T_('Updated'), T_('Access List Entry updated'), AmpConfig::get('web_path').'/admin/access.php'); } else { $access->format(); - require_once AmpConfig::get('prefix') . '/templates/show_edit_access.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_edit_access.inc.php'); } break; case 'show_add_current': @@ -94,17 +94,17 @@ switch ($_REQUEST['action']) { case 'show_add_local': case 'show_add_advanced': $action = $_REQUEST['action']; - require_once AmpConfig::get('prefix') . '/templates/show_add_access.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_access.inc.php'); break; case 'show_edit_record': $access = new Access($_REQUEST['access_id']); $access->format(); - require_once AmpConfig::get('prefix') . '/templates/show_edit_access.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_edit_access.inc.php'); break; default: $list = array(); $list = Access::get_access_lists(); - require_once AmpConfig::get('prefix') .'/templates/show_access_list.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_access_list.inc.php'); break; } // end switch on action UI::show_footer(); diff --git a/admin/catalog.php b/admin/catalog.php index 61372dd1..a5943a12 100644 --- a/admin/catalog.php +++ b/admin/catalog.php @@ -176,7 +176,7 @@ switch ($_REQUEST['action']) { $catalog_id = Catalog::create($_POST); if (!$catalog_id) { - require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_add_catalog.inc.php'); break; } @@ -185,7 +185,7 @@ switch ($_REQUEST['action']) { show_confirmation(T_('Catalog Creation started...'), '', AmpConfig::get('web_path') . '/admin/catalog.php', 0, 'confirmation', false); } else { - require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_add_catalog.inc.php'); } break; case 'clear_stats': @@ -197,7 +197,7 @@ switch ($_REQUEST['action']) { show_confirmation($title, $body, $url); break; case 'show_add_catalog': - require AmpConfig::get('prefix') . '/templates/show_add_catalog.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_add_catalog.inc.php'); break; case 'clear_now_playing': if (AmpConfig::get('demo_mode')) { UI::access_denied(); break; } @@ -210,7 +210,7 @@ switch ($_REQUEST['action']) { $songs = Song::get_disabled(); if (count($songs)) { - require AmpConfig::get('prefix') . '/templates/show_disabled_songs.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_disabled_songs.inc.php'); } else { echo "
" . T_('No Disabled songs found') . "
"; } @@ -226,7 +226,7 @@ switch ($_REQUEST['action']) { case 'show_customize_catalog': $catalog = Catalog::create_from_id($_REQUEST['catalog_id']); $catalog->format(); - require_once AmpConfig::get('prefix') . '/templates/show_edit_catalog.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_edit_catalog.inc.php'); break; case 'gather_media_art': $sse_url = AmpConfig::get('web_path') . "/server/sse.server.php?worker=catalog&action=gather_media_art&catalogs=" . $sse_catalogs; @@ -235,7 +235,7 @@ switch ($_REQUEST['action']) { break; case 'show_catalogs': default: - require_once AmpConfig::get('prefix') . '/templates/show_manage_catalogs.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_manage_catalogs.inc.php'); break; } // end switch diff --git a/admin/duplicates.php b/admin/duplicates.php index 69c812b4..6cc350b0 100644 --- a/admin/duplicates.php +++ b/admin/duplicates.php @@ -34,11 +34,11 @@ switch ($_REQUEST['action']) { case 'find_duplicates': $search_type = $_REQUEST['search_type']; $duplicates = Song::find_duplicates($search_type); - require_once AmpConfig::get('prefix') . '/templates/show_duplicate.inc.php'; - require_once AmpConfig::get('prefix') . '/templates/show_duplicates.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_duplicate.inc.php'); + require_once AmpConfig::get('prefix') . UI::find_template('show_duplicates.inc.php'); break; default: - require_once AmpConfig::get('prefix') . '/templates/show_duplicate.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_duplicate.inc.php'); break; } // end switch on action diff --git a/admin/export.php b/admin/export.php index bd9e5d1f..952282a8 100644 --- a/admin/export.php +++ b/admin/export.php @@ -65,7 +65,7 @@ switch ($_REQUEST['action']) { // We don't want the footer so we're done here exit; default: - require_once AmpConfig::get('prefix') . '/templates/show_export.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_export.inc.php'); break; } // end switch on action diff --git a/admin/license.php b/admin/license.php index aa22a2fc..3cae0490 100644 --- a/admin/license.php +++ b/admin/license.php @@ -46,7 +46,7 @@ switch ($_REQUEST['action']) { case 'show_edit': $license = new License($_REQUEST['license_id']); case 'show_create': - require_once AmpConfig::get('prefix') . '/templates/show_edit_license.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_edit_license.inc.php'); break; case 'delete': License::delete($_REQUEST['license_id']); diff --git a/admin/mail.php b/admin/mail.php index 15f5e768..d3ac75bd 100644 --- a/admin/mail.php +++ b/admin/mail.php @@ -71,7 +71,7 @@ switch ($_REQUEST['action']) { break; default: - require_once AmpConfig::get('prefix') . '/templates/show_mail_users.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_mail_users.inc.php'); break; } // end switch diff --git a/admin/modules.php b/admin/modules.php index 7407410a..b9f72176 100644 --- a/admin/modules.php +++ b/admin/modules.php @@ -184,19 +184,19 @@ switch ($_REQUEST['action']) { case 'show_plugins': $plugins = Plugin::get_plugins(); UI::show_box_top(T_('Plugins'), 'box box_localplay_plugins'); - require_once AmpConfig::get('prefix') . '/templates/show_plugins.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_plugins.inc.php'); UI::show_box_bottom(); break; case 'show_localplay': $controllers = Localplay::get_controllers(); UI::show_box_top(T_('Localplay Controllers'), 'box box_localplay_controllers'); - require_once AmpConfig::get('prefix') . '/templates/show_localplay_controllers.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_localplay_controllers.inc.php'); UI::show_box_bottom(); break; case 'show_catalog_types': $catalogs = Catalog::get_catalog_types(); UI::show_box_top(T_('Catalog Types'), 'box box_catalog_types'); - require_once AmpConfig::get('prefix') . '/templates/show_catalog_types.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_catalog_types.inc.php'); UI::show_box_bottom(); break; default: diff --git a/admin/shout.php b/admin/shout.php index 50c02213..a5001de9 100644 --- a/admin/shout.php +++ b/admin/shout.php @@ -44,7 +44,7 @@ switch ($_REQUEST['action']) { $object->format(); $client = new User($shout->user); $client->format(); - require_once AmpConfig::get('prefix') . '/templates/show_edit_shout.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_edit_shout.inc.php'); break; case 'delete': Shoutbox::delete($_REQUEST['shout_id']); diff --git a/admin/system.php b/admin/system.php index ea009d9f..45a7f267 100644 --- a/admin/system.php +++ b/admin/system.php @@ -55,7 +55,7 @@ switch ($_REQUEST['action']) { if ($_REQUEST['autoupdate'] == 'force') { $version = AutoUpdate::get_latest_version(true); } - require_once AmpConfig::get('prefix') . '/templates/show_debug.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_debug.inc.php'); break; case 'clear_cache': switch ($_REQUEST['type']) { diff --git a/admin/users.php b/admin/users.php index 5bd3e244..44f9912b 100644 --- a/admin/users.php +++ b/admin/users.php @@ -76,7 +76,7 @@ switch ($_REQUEST['action']) { /* If we've got an error then show edit form! */ if (Error::occurred()) { - require_once AmpConfig::get('prefix') . '/templates/show_edit_user.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_edit_user.inc.php'); break; } @@ -149,7 +149,7 @@ switch ($_REQUEST['action']) { /* If we've got an error then show add form! */ if (Error::occurred()) { - require_once AmpConfig::get('prefix') . '/templates/show_add_user.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_user.inc.php'); break; } @@ -185,7 +185,7 @@ switch ($_REQUEST['action']) { case 'show_edit': if (AmpConfig::get('demo_mode')) { break; } $client = new User($_REQUEST['user_id']); - require_once AmpConfig::get('prefix') . '/templates/show_edit_user.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_edit_user.inc.php'); break; case 'confirm_delete': if (AmpConfig::get('demo_mode')) { break; } @@ -257,16 +257,16 @@ switch ($_REQUEST['action']) { } else { $history = $working_user->get_ip_history(); } - require AmpConfig::get('prefix') . '/templates/show_ip_history.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_ip_history.inc.php'); break; case 'show_add_user': if (AmpConfig::get('demo_mode')) { break; } - require_once AmpConfig::get('prefix') . '/templates/show_add_user.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_user.inc.php'); break; case 'show_preferences': $client = new User($_REQUEST['user_id']); $preferences = Preference::get_all($client->id); - require_once AmpConfig::get('prefix') . '/templates/show_user_preferences.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_user_preferences.inc.php'); break; default: $browse = new Browse(); diff --git a/albums.php b/albums.php index 5b189c38..f3809042 100644 --- a/albums.php +++ b/albums.php @@ -22,7 +22,7 @@ require_once 'lib/init.php'; -require_once AmpConfig::get('prefix') . '/templates/header.inc.php'; +require_once AmpConfig::get('prefix') . UI::find_template('header.inc.php'); /* Switch on Action */ switch ($_REQUEST['action']) { @@ -64,7 +64,7 @@ switch ($_REQUEST['action']) { $type = 'album'; $object_id = intval($_REQUEST['album_id']); $target_url = AmpConfig::get('web_path') . '/albums.php?action=show&album=' . $object_id; - require_once AmpConfig::get('prefix') . '/templates/show_update_items.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_update_items.inc.php'); break; case 'set_track_numbers': debug_event('albums', 'Set track numbers called.', '5'); @@ -108,7 +108,7 @@ switch ($_REQUEST['action']) { } $walbum->load_all(); $walbum->format(); - require AmpConfig::get('prefix') . '/templates/show_missing_album.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_missing_album.inc.php'); break; // Browse by Album case 'show': @@ -117,9 +117,9 @@ switch ($_REQUEST['action']) { $album->format(); if (!count($album->album_suite)) { - require AmpConfig::get('prefix') . '/templates/show_album.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_album.inc.php'); } else { - require AmpConfig::get('prefix') . '/templates/show_album_group_disks.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_album_group_disks.inc.php'); } break; diff --git a/artists.php b/artists.php index 7fb38ff8..f13a122f 100644 --- a/artists.php +++ b/artists.php @@ -65,30 +65,30 @@ switch ($_REQUEST['action']) { $object_ids = $artist->get_albums($_REQUEST['catalog']); } $object_type = 'album'; - require_once AmpConfig::get('prefix') . '/templates/show_artist.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_artist.inc.php'); break; case 'show_all_songs': $artist = new Artist($_REQUEST['artist']); $artist->format(); $object_type = 'song'; $object_ids = $artist->get_songs(); - require_once AmpConfig::get('prefix') . '/templates/show_artist.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_artist.inc.php'); break; case 'update_from_tags': $type = 'artist'; $object_id = intval($_REQUEST['artist']); $target_url = AmpConfig::get('web_path') . "/artists.php?action=show&artist=" . $object_id; - require_once AmpConfig::get('prefix') . '/templates/show_update_items.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_update_items.inc.php'); break; case 'match': case 'Match': $match = scrub_in($_REQUEST['match']); if ($match == "Browse" || $match == "Show_all") { $chr = ""; } else { $chr = $match; } /* Enclose this in the purty box! */ - require AmpConfig::get('prefix') . '/templates/show_box_top.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_box_top.inc.php'); show_alphabet_list('artists','artists.php',$match); show_alphabet_form($chr, T_('Show Artists starting with'),"artists.php?action=match"); - require AmpConfig::get('prefix') . '/templates/show_box_bottom.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_box_bottom.inc.php'); if ($match === "Browse") { show_artists(); @@ -108,7 +108,7 @@ switch ($_REQUEST['action']) { $mbid = $_REQUEST['mbid']; $wartist = Wanted::get_missing_artist($mbid); - require AmpConfig::get('prefix') . '/templates/show_missing_artist.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_missing_artist.inc.php'); break; } // end switch diff --git a/arts.php b/arts.php index 65aaffe9..0037c44c 100644 --- a/arts.php +++ b/arts.php @@ -22,7 +22,7 @@ require_once 'lib/init.php'; -require_once AmpConfig::get('prefix') . '/templates/header.inc.php'; +require_once AmpConfig::get('prefix') . UI::find_template('header.inc.php'); $object_type = $_GET['object_type']; $object_id = $_GET['object_id']; @@ -128,14 +128,14 @@ switch ($_REQUEST['action']) { } // end foreach // Store the results for further use $_SESSION['form']['images'] = $images; - require_once AmpConfig::get('prefix') . '/templates/show_arts.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_arts.inc.php'); } // Else nothing else { show_confirmation(T_('Art Not Located'), T_('Art could not be located at this time. This may be due to write access error, or the file is not received correctly.'), $burl); } - require_once AmpConfig::get('prefix') . '/templates/show_get_art.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_get_art.inc.php'); break; case 'select_art': diff --git a/bin/channel_run.inc b/bin/channel_run.inc index dca4f149..0dcdef7a 100644 --- a/bin/channel_run.inc +++ b/bin/channel_run.inc @@ -280,7 +280,6 @@ while(true) } } else { $channel->update_listeners(0); - debug_event('channel', 'No more data, stream ended.', 5); die('No more data, stream ended.'); } } diff --git a/browse.php b/browse.php index 8cfd61fc..6e7407af 100644 --- a/browse.php +++ b/browse.php @@ -93,10 +93,10 @@ switch ($_REQUEST['action']) { $browse2 = new Browse(); $browse2->set_type($browse_type); $browse2->store(); - require_once AmpConfig::get('prefix') . '/templates/show_tagcloud.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_tagcloud.inc.php'); UI::show_box_bottom(); $type = $browse2->get_type(); - require_once AmpConfig::get('prefix') . '/templates/browse_content.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('browse_content.inc.php'); break; case 'artist': $browse->set_filter('catalog',$_SESSION['catalog']); diff --git a/channel.php b/channel.php index ddaa1258..95dbfbaf 100644 --- a/channel.php +++ b/channel.php @@ -37,7 +37,7 @@ switch ($_REQUEST['action']) { $object = new $type($_REQUEST['id']); if ($object->id) { $object->format(); - require_once AmpConfig::get('prefix') . '/templates/show_add_channel.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_channel.inc.php'); } } UI::show_footer(); @@ -56,7 +56,7 @@ switch ($_REQUEST['action']) { $created = Channel::create($_REQUEST['name'], $_REQUEST['description'], $_REQUEST['url'], $_REQUEST['type'], $_REQUEST['id'], $_REQUEST['interface'], $_REQUEST['port'], $_REQUEST['admin_password'], $_REQUEST['private'] ?: 0, $_REQUEST['max_listeners'], $_REQUEST['random'] ?: 0, $_REQUEST['loop'] ?: 0, $_REQUEST['stream_type'], $_REQUEST['bitrate']); if (!$created) { - require_once AmpConfig::get('prefix') . '/templates/show_add_channel.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_channel.inc.php'); } else { $title = T_('Channel Created'); show_confirmation($title, $body, AmpConfig::get('web_path') . '/browse.php?action=channel'); diff --git a/cookie_disclaimer.php b/cookie_disclaimer.php index d46ec1fb..7ba1cea8 100644 --- a/cookie_disclaimer.php +++ b/cookie_disclaimer.php @@ -24,6 +24,6 @@ require_once 'lib/init.php'; UI::show_header(); -require_once AmpConfig::get('prefix') . '/templates/cookie_disclaimer.inc.php'; +require_once AmpConfig::get('prefix') . UI::find_template('cookie_disclaimer.inc.php'); UI::show_footer(); diff --git a/democratic.php b/democratic.php index 498f7806..58cefc45 100644 --- a/democratic.php +++ b/democratic.php @@ -43,7 +43,7 @@ switch ($_REQUEST['action']) { } // Show the create page - require_once AmpConfig::get('prefix') . '/templates/show_create_democratic.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_create_democratic.inc.php'); break; case 'delete': if (!Access::check('interface','75')) { @@ -96,20 +96,20 @@ switch ($_REQUEST['action']) { // Get all of the non-user playlists $playlists = Democratic::get_playlists(); - require_once AmpConfig::get('prefix') . '/templates/show_manage_democratic.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_manage_democratic.inc.php'); break; case 'show_playlist': default: $democratic = Democratic::get_current_playlist(); if (!$democratic->id) { - require_once AmpConfig::get('prefix') . '/templates/show_democratic.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_democratic.inc.php'); break; } $democratic->set_parent(); $democratic->format(); - require_once AmpConfig::get('prefix') . '/templates/show_democratic.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_democratic.inc.php'); $objects = $democratic->get_items(); Song::build_cache($democratic->object_ids); Democratic::build_vote_cache($democratic->vote_ids); diff --git a/image.php b/image.php index dfeb43ca..b23f8db2 100644 --- a/image.php +++ b/image.php @@ -65,7 +65,7 @@ if (isset($_GET['type'])) { switch ($_GET['type']) { case 'popup': $typeManaged = true; - require_once AmpConfig::get('prefix') . '/templates/show_big_art.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_big_art.inc.php'); break; case 'session': // If we need to pull the data out of the session diff --git a/index.php b/index.php index 96107155..92723bf7 100644 --- a/index.php +++ b/index.php @@ -39,9 +39,9 @@ $_SESSION['catalog'] = 0; if (AmpConfig::get('refresh_limit') > 5 && AmpConfig::get('home_now_playing')) { $refresh_limit = AmpConfig::get('refresh_limit'); $ajax_url = '?page=index&action=reloadnp'; - require_once AmpConfig::get('prefix') . '/templates/javascript_refresh.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('javascript_refresh.inc.php'); } -require_once AmpConfig::get('prefix') . '/templates/show_index.inc.php'; +require_once AmpConfig::get('prefix') . UI::find_template('show_index.inc.php'); UI::show_footer(); diff --git a/install.php b/install.php index 686c1b7f..a71bc7cc 100644 --- a/install.php +++ b/install.php @@ -29,7 +29,7 @@ set_error_handler('ampache_error_handler'); // Redirect if installation is already complete. if (!install_check_status($configfile)) { $redirect_url = 'login.php'; - require_once AmpConfig::get('prefix') . '/templates/error_page.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('error_page.inc.php'); exit; } @@ -171,13 +171,13 @@ switch ($_REQUEST['action']) { /* Make sure we've got a valid config file */ if (!check_config_values($results) || !$created_config) { Error::add('general', T_('Error: Config files not found or unreadable')); - require_once AmpConfig::get('prefix') . '/templates/show_install_config.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_install_config.inc.php'); break; } // Don't try to add administrator user on existing database if (install_check_status($configfile)) { - require_once AmpConfig::get('prefix') . '/templates/show_install_account.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_install_account.inc.php'); } else { header ("Location: " . $web_path . '/login.php'); } @@ -189,7 +189,7 @@ switch ($_REQUEST['action']) { $password2 = scrub_in($_REQUEST['local_pass2']); if (!install_create_account($username, $password, $password2)) { - require_once AmpConfig::get('prefix') . '/templates/show_install_account.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_install_account.inc.php'); break; } diff --git a/labels.php b/labels.php index 4ba238d8..f2070430 100644 --- a/labels.php +++ b/labels.php @@ -76,7 +76,7 @@ switch ($_REQUEST['action']) { $label_id = Label::create($_POST); if (!$label_id) { - require_once AmpConfig::get('prefix') . '/templates/show_add_label.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_label.inc.php'); } else { $body = T_('Label Added'); $title = ''; @@ -95,13 +95,13 @@ switch ($_REQUEST['action']) { $label->format(); $object_ids = $label->get_artists(); $object_type = 'artist'; - require_once AmpConfig::get('prefix') . '/templates/show_label.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_label.inc.php'); UI::show_footer(); exit; } case 'show_add_label': if (Access::check('interface','50') || AmpConfig::get('upload_allow_edit')) { - require_once AmpConfig::get('prefix') . '/templates/show_add_label.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_label.inc.php'); } else { echo T_('Label cannot be found.'); } diff --git a/lib/class/album.class.php b/lib/class/album.class.php index be71bee5..1a55a136 100644 --- a/lib/class/album.class.php +++ b/lib/class/album.class.php @@ -717,12 +717,6 @@ class Album extends database_object implements library_item $search['rule_0_input'] = $name; $search['rule_0_operator'] = 4; $search['rule_0'] = "title"; - $search['rule_1_input'] = $this->name; - $search['rule_1_operator'] = 4; - $search['rule_1'] = "album"; - $search['rule_2_input'] = $this->album_artist_name; - $search['rule_2_operator'] = 4; - $search['rule_2'] = "artist"; $songs = Search::run($search); $childrens = array(); diff --git a/lib/class/api.class.php b/lib/class/api.class.php index e7cd5b61..8d323a36 100644 --- a/lib/class/api.class.php +++ b/lib/class/api.class.php @@ -37,7 +37,7 @@ class Api /** * @var string $version */ - public static $version = '380001'; + public static $version = '370001'; /** * @var Browse $browse @@ -863,9 +863,7 @@ class Api $type = $input['type']; $offset = $input['offset']; $limit = $input['limit']; - $username = $input['username']; - $albums = null; if ($type == "newest") { $albums = Stats::get_newest("album", $limit, $offset); } else if ($type == "highest") { @@ -873,16 +871,7 @@ class Api } else if ($type == "frequent") { $albums = Stats::get_top("album", $limit, '', $offset); } else if ($type == "recent") { - if (!empty($username)) { - $user = User::get_from_username($username); - if ($user !== null) { - $albums = $user->get_recently_played($limit, 'album'); - } else { - debug_event('api', 'User `' . $username . '` cannot be found.', 1); - } - } else { - $albums = Stats::get_recent("album", $limit, $offset); - } + $albums = Stats::get_recent("album", $limit, $offset); } else if ($type == "flagged") { $albums = Userflag::get_latest('album'); } else { @@ -892,109 +881,8 @@ class Api $albums = Album::get_random($limit); } - if ($albums !== null) { - ob_end_clean(); - echo XML_Data::albums($albums); - } - } // stats - - /** - * user - * This get an user public information - * @param array $input - */ - public static function user($input) - { - $username = $input['username']; - if (!empty($username)) { - $user = User::get_from_username($username); - if ($user !== null) { - ob_end_clean(); - echo XML_Data::user($user); - } else { - debug_event('api', 'User `' . $username . '` cannot be found.', 1); - } - } else { - debug_event('api', 'Username required on user function call.', 1); - } - } // user - - /** - * followers - * This get an user followers - * @param array $input - */ - public static function followers($input) - { - if (AmpConfig::get('sociable')) { - $username = $input['username']; - if (!empty($username)) { - $user = User::get_from_username($username); - if ($user !== null) { - $users = $user->get_followers(); - ob_end_clean(); - echo XML_Data::users($user); - } else { - debug_event('api', 'User `' . $username . '` cannot be found.', 1); - } - } else { - debug_event('api', 'Username required on followers function call.', 1); - } - } else { - debug_event('api', 'Sociable feature is not enabled.', 3); - } - } // followers - - /** - * following - * This get the user list followed by an user - * @param array $input - */ - public static function following($input) - { - if (AmpConfig::get('sociable')) { - $username = $input['username']; - if (!empty($username)) { - $user = User::get_from_username($username); - if ($user !== null) { - $users = $user->get_following(); - ob_end_clean(); - echo XML_Data::users($user); - } else { - debug_event('api', 'User `' . $username . '` cannot be found.', 1); - } - } else { - debug_event('api', 'Username required on following function call.', 1); - } - } else { - debug_event('api', 'Sociable feature is not enabled.', 3); - } - } // following - - /** - * last_shouts - * This get the latest posted shouts - * @param array $input - */ - public static function last_shouts($input) - { - $limit = intval($input['limit']); - if ($limit < 1) { - $limit = AmpConfig::get('popular_threshold'); - } - if (AmpConfig::get('sociable')) { - $username = $input['username']; - if (!empty($username)) { - $shouts = Shoutbox::get_top($limit, $username); - } else { - $shouts = Shoutbox::get_top($limit); - } - - ob_end_clean(); - echo XML_Data::shouts($shouts); - } else { - debug_event('api', 'Sociable feature is not enabled.', 3); - } - } // last_shouts + ob_end_clean(); + echo XML_Data::albums($albums); + } } // API class diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php index 11587a86..10bbe4ee 100644 --- a/lib/class/artist.class.php +++ b/lib/class/artist.class.php @@ -537,9 +537,6 @@ class Artist extends database_object implements library_item $search['rule_0_input'] = $name; $search['rule_0_operator'] = 4; $search['rule_0'] = "title"; - $search['rule_1_input'] = $this->name; - $search['rule_1_operator'] = 4; - $search['rule_1'] = "artist"; $albums = Search::run($search); $childrens = array(); diff --git a/lib/class/browse.class.php b/lib/class/browse.class.php index 459873cd..3086adc0 100644 --- a/lib/class/browse.class.php +++ b/lib/class/browse.class.php @@ -204,7 +204,7 @@ class Browse extends Query case 'song': $box_title = T_('Songs') . $match; Song::build_cache($object_ids, $limit_threshold); - $box_req = AmpConfig::get('prefix') . '/templates/show_songs.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_songs.inc.php'); break; case 'album': Album::build_cache($object_ids); @@ -217,122 +217,122 @@ class Browse extends Query } else { $allow_group_disks = false; } - $box_req = AmpConfig::get('prefix') . '/templates/show_albums.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_albums.inc.php'); break; case 'user': $box_title = T_('Users') . $match; - $box_req = AmpConfig::get('prefix') . '/templates/show_users.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_users.inc.php'); break; case 'artist': $box_title = T_('Artists') . $match; Artist::build_cache($object_ids, true, $limit_threshold); - $box_req = AmpConfig::get('prefix') . '/templates/show_artists.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_artists.inc.php'); break; case 'live_stream': - require_once AmpConfig::get('prefix') . '/templates/show_live_stream.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_live_stream.inc.php'); $box_title = T_('Radio Stations') . $match; - $box_req = AmpConfig::get('prefix') . '/templates/show_live_streams.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_live_streams.inc.php'); break; case 'playlist': Playlist::build_cache($object_ids); $box_title = T_('Playlists') . $match; - $box_req = AmpConfig::get('prefix') . '/templates/show_playlists.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_playlists.inc.php'); break; case 'playlist_song': $box_title = T_('Playlist Songs') . $match; - $box_req = AmpConfig::get('prefix') . '/templates/show_playlist_songs.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_playlist_songs.inc.php'); break; case 'playlist_localplay': $box_title = T_('Current Playlist'); - $box_req = AmpConfig::get('prefix') . '/templates/show_localplay_playlist.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_localplay_playlist.inc.php'); UI::show_box_bottom(); break; case 'smartplaylist': $box_title = T_('Smart Playlists') . $match; - $box_req = AmpConfig::get('prefix') . '/templates/show_searches.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_searches.inc.php'); break; case 'catalog': $box_title = T_('Catalogs'); - $box_req = AmpConfig::get('prefix') . '/templates/show_catalogs.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_catalogs.inc.php'); break; case 'shoutbox': $box_title = T_('Shoutbox Records'); - $box_req = AmpConfig::get('prefix') . '/templates/show_manage_shoutbox.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_manage_shoutbox.inc.php'); break; case 'tag': Tag::build_cache($object_ids); $box_title = T_('Tag Cloud'); - $box_req = AmpConfig::get('prefix') . '/templates/show_tagcloud.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_tagcloud.inc.php'); break; case 'video': Video::build_cache($object_ids); $video_type = 'video'; $box_title = T_('Videos'); - $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_videos.inc.php'); break; case 'democratic': $box_title = T_('Democratic Playlist'); - $box_req = AmpConfig::get('prefix') . '/templates/show_democratic_playlist.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_democratic_playlist.inc.php'); break; case 'wanted': $box_title = T_('Wanted Albums'); - $box_req = AmpConfig::get('prefix') . '/templates/show_wanted_albums.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_wanted_albums.inc.php'); break; case 'share': $box_title = T_('Shared Objects'); - $box_req = AmpConfig::get('prefix') . '/templates/show_shared_objects.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_shared_objects.inc.php'); break; case 'song_preview': $box_title = T_('Songs'); - $box_req = AmpConfig::get('prefix') . '/templates/show_song_previews.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_song_previews.inc.php'); break; case 'channel': $box_title = T_('Channels'); - $box_req = AmpConfig::get('prefix') . '/templates/show_channels.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_channels.inc.php'); break; case 'broadcast': $box_title = T_('Broadcasts'); - $box_req = AmpConfig::get('prefix') . '/templates/show_broadcasts.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_broadcasts.inc.php'); break; case 'license': $box_title = T_('Media Licenses'); - $box_req = AmpConfig::get('prefix') . '/templates/show_manage_license.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_manage_license.inc.php'); break; case 'tvshow': $box_title = T_('TV Shows'); - $box_req = AmpConfig::get('prefix') . '/templates/show_tvshows.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_tvshows.inc.php'); break; case 'tvshow_season': $box_title = T_('Seasons'); - $box_req = AmpConfig::get('prefix') . '/templates/show_tvshow_seasons.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_tvshow_seasons.inc.php'); break; case 'tvshow_episode': $box_title = T_('Episodes'); $video_type = $type; - $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_videos.inc.php'); break; case 'movie': $box_title = T_('Movies'); $video_type = $type; - $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_videos.inc.php'); break; case 'clip': $box_title = T_('Clips'); $video_type = $type; - $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_videos.inc.php'); break; case 'personal_video': $box_title = T_('Personal Videos'); $video_type = $type; - $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_videos.inc.php'); break; case 'label': $box_title = T_('Labels'); - $box_req = AmpConfig::get('prefix') . '/templates/show_labels.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_labels.inc.php'); break; case 'pvmsg': $box_title = T_('Private Messages'); - $box_req = AmpConfig::get('prefix') . '/templates/show_pvmsgs.inc.php'; + $box_req = AmpConfig::get('prefix') . UI::find_template('show_pvmsgs.inc.php'); break; default: // Rien a faire diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index 0090bf8e..a912fa58 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -1589,7 +1589,7 @@ abstract class Catalog extends database_object debug_event('clean', 'Starting on ' . $this->name, 5); if (!defined('SSE_OUTPUT')) { - require AmpConfig::get('prefix') . '/templates/show_clean_catalog.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_clean_catalog.inc.php'); ob_flush(); flush(); } @@ -1619,7 +1619,7 @@ abstract class Catalog extends database_object public function verify_catalog() { if (!defined('SSE_OUTPUT')) { - require AmpConfig::get('prefix') . '/templates/show_verify_catalog.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_verify_catalog.inc.php'); ob_flush(); flush(); } diff --git a/lib/class/channel.class.php b/lib/class/channel.class.php index c092f662..f79ea4d3 100644 --- a/lib/class/channel.class.php +++ b/lib/class/channel.class.php @@ -472,7 +472,7 @@ class Channel extends database_object implements media, library_item fclose($this->transcoder['stderr']); } fclose($this->transcoder['handle']); - Stream::kill_process($this->transcoder); + Stream::kill_process($this->$transcoder); $this->media = null; $this->transcoder = null; diff --git a/lib/class/graph.class.php b/lib/class/graph.class.php index 911b72bc..636aeb4d 100644 --- a/lib/class/graph.class.php +++ b/lib/class/graph.class.php @@ -499,7 +499,7 @@ class Graph $blink = $u->f_link; } - require_once AmpConfig::get('prefix') . '/templates/show_graphs.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_graphs.inc.php'); } } } diff --git a/lib/class/rating.class.php b/lib/class/rating.class.php index 787c5148..5ffce873 100644 --- a/lib/class/rating.class.php +++ b/lib/class/rating.class.php @@ -277,9 +277,9 @@ class Rating extends database_object $rating = new Rating($object_id, $type); if ($static) { - require AmpConfig::get('prefix') . '/templates/show_static_object_rating.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_static_object_rating.inc.php'); } else { - require AmpConfig::get('prefix') . '/templates/show_object_rating.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_object_rating.inc.php'); } } // show diff --git a/lib/class/search.class.php b/lib/class/search.class.php index 0942075b..23e2476d 100644 --- a/lib/class/search.class.php +++ b/lib/class/search.class.php @@ -415,13 +415,6 @@ class Search extends playlist_object 'widget' => array('input', 'text') ); - $this->types[] = array( - 'name' => 'artist', - 'label' => T_('Artist'), - 'type' => 'text', - 'widget' => array('input', 'text') - ); - $this->types[] = array( 'name' => 'year', 'label' => T_('Year'), @@ -989,10 +982,6 @@ class Search extends playlist_object $where[] = "`image`.`width` $sql_match_operator '$input'"; $join['image'] = true; break; - case 'artist': - $where[] = "`artist`.`name` $sql_match_operator '$input'"; - $join['artist'] = true; - break; default: // Nae laird! break; @@ -1015,9 +1004,6 @@ class Search extends playlist_object ") AS realtag_$key " . "ON `album`.`id`=`realtag_$key`.`object_id`"; } - if ($join['artist']) { - $table['artist'] = "LEFT JOIN `artist` ON `artist`.`id`=`album`.`album_artist`"; - } if ($join['song']) { $table['song'] = "LEFT JOIN `song` ON `song`.`album`=`album`.`id`"; diff --git a/lib/class/shoutbox.class.php b/lib/class/shoutbox.class.php index d80b80cf..d259657f 100644 --- a/lib/class/shoutbox.class.php +++ b/lib/class/shoutbox.class.php @@ -96,7 +96,7 @@ class Shoutbox * This returns the top user_shouts, shoutbox objects are always shown regardless and count against the total * number of objects shown */ - public static function get_top($limit, $username = null) + public static function get_top($limit) { $shouts = self::get_sticky(); @@ -108,14 +108,8 @@ class Shoutbox // Only get as many as we need $limit = intval($limit) - count($shouts); - $params = array(); - $sql = "SELECT `user_shout`.`id` AS `id` FROM `user_shout` LEFT JOIN `user` ON `user`.`id` = `user_shout`.`user` WHERE `user_shout`.`sticky`='0' "; - if ($username !== null) { - $sql .= "AND `user`.`username` = ? "; - $params[] = $username; - } - $sql .= "ORDER BY `user_shout`.`date` DESC LIMIT " . $limit; - $db_results = Dba::read($sql, $params); + $sql = "SELECT * FROM `user_shout` WHERE `sticky`='0' ORDER BY `date` DESC LIMIT $limit"; + $db_results = Dba::read($sql); while ($row = Dba::fetch_assoc($db_results)) { $shouts[] = $row['id']; diff --git a/lib/class/stream_playlist.class.php b/lib/class/stream_playlist.class.php index ae84e049..3050bca7 100644 --- a/lib/class/stream_playlist.class.php +++ b/lib/class/stream_playlist.class.php @@ -457,9 +457,9 @@ class Stream_Playlist public function create_web_player() { if (AmpConfig::get("ajax_load")) { - require AmpConfig::get('prefix') . '/templates/create_web_player_embedded.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('create_web_player_embedded.inc.php'); } else { - require AmpConfig::get('prefix') . '/templates/create_web_player.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('create_web_player.inc.php'); } } // create_web_player diff --git a/lib/class/userflag.class.php b/lib/class/userflag.class.php index bb1535f1..36bc2813 100644 --- a/lib/class/userflag.class.php +++ b/lib/class/userflag.class.php @@ -247,7 +247,7 @@ class Userflag extends database_object if (!AmpConfig::get('userflags')) { return false; } $userflag = new Userflag($object_id, $type); - require AmpConfig::get('prefix') . '/templates/show_object_userflag.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_object_userflag.inc.php'); } // show diff --git a/lib/class/xml_data.class.php b/lib/class/xml_data.class.php index 0d7869ed..eef8ee31 100644 --- a/lib/class/xml_data.class.php +++ b/lib/class/xml_data.class.php @@ -572,87 +572,6 @@ class XML_Data return $final; } // democratic - /** - * user - * - * This handles creating an xml document for an user - * - * @param User $user User - * @return string return xml - */ - public static function user(User $user) - { - $user->format(); - - $string = "id . "\">\n" . - "\tusername . "]]>\n" . - "\t" . $user->create_date . "\n" . - "\t" . $user->last_seen . "\n" . - "\twebsite . "]]>\n" . - "\tstate . "]]>\n" . - "\tcity . "]]>\n"; - if ($user->fullname_public) { - $string .= "\tfullname . "]]>\n"; - } - $string .= "\n"; - - $final = self::_header() . $string . self::_footer(); - - return $final; - } // user - - /** - * users - * - * This handles creating an xml document for an user list - * - * @param int[] $users User identifier list - * @return string return xml - */ - public static function users($users) - { - $string = "\n"; - foreach ($users as $user_id) { - $user = new User($user_id); - $string .= "\tusername . "]]>\n"; - } - $string .= "\n"; - - $final = self::_header() . $string . self::_footer(); - - return $final; - } // users - - /** - * shouts - * - * This handles creating an xml document for a shout list - * - * @param int[] $shouts Shout identifier list - * @return string return xml - */ - public static function shouts($shouts) - { - $string = "\n"; - foreach ($shouts as $shout_id) { - $shout = new Shoutbox($shout_id); - $shout->format(); - $user = new User($shout->user); - $string .= "\t\n" . - "\t\t" . $shout->date . "\n" . - "\t\ttext . "]]>\n"; - if ($user->id) { - $string .= "\t\tusername ."]]>"; - } - $string .= "\tn"; - } - $string .= "\n"; - - $final = self::_header() . $string . self::_footer(); - - return $final; - } // shouts - /** * rss_feed * diff --git a/lib/install.lib.php b/lib/install.lib.php index 98abfc98..fc79d266 100644 --- a/lib/install.lib.php +++ b/lib/install.lib.php @@ -485,7 +485,6 @@ function install_config_backends(Array $backends) 'plex_backend' => '0', 'daap_backend' => '0', 'upnp_backend' => '0', - 'webdav_backend' => '0', 'stream_beautiful_url' => '0' ); @@ -504,9 +503,6 @@ function install_config_backends(Array $backends) case 'daap': $dbconfig['daap_backend'] = '1'; break; - case 'webdav': - $dbconfig['webdav_backend'] = '1'; - break; } } diff --git a/lib/javascript/dynamicpage.js b/lib/javascript/dynamicpage.js index 6f502d30..2fcc21d5 100644 --- a/lib/javascript/dynamicpage.js +++ b/lib/javascript/dynamicpage.js @@ -92,25 +92,23 @@ $(function() { var postData = $(this).serializeArray(); var formURL = $(this).attr("action"); - if (formURL.indexOf('javascript:') !== 0) { - $.ajax( - { - url : formURL, - type: "POST", - data : postData, - success:function(data, status, jqXHR) - { - loadContentData(data, status, jqXHR); - window.location.hash = ""; - }, - error: function(jqXHR, status, errorThrown) - { - alert(errorThrown); - } - }); + $.ajax( + { + url : formURL, + type: "POST", + data : postData, + success:function(data, status, jqXHR) + { + loadContentData(data, status, jqXHR); + window.location.hash = ""; + }, + error: function(jqXHR, status, errorThrown) + { + alert(errorThrown); + } + }); - e.preventDefault(); - } + e.preventDefault(); } }); diff --git a/lib/rating.lib.php b/lib/rating.lib.php index 5bc7f45d..3d308fab 100644 --- a/lib/rating.lib.php +++ b/lib/rating.lib.php @@ -28,7 +28,7 @@ function show_rating($object_id,$type) { $rating = new Rating($object_id,$type); - require AmpConfig::get('prefix') . '/templates/show_object_rating.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_object_rating.inc.php'); } // show_rating diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 48843a46..0ee9ac46 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -43,7 +43,7 @@ function show_confirmation($title,$text,$next_url,$cancel=0,$form_name='confirma $path = AmpConfig::get('web_path') . "/$next_url"; } - require AmpConfig::get('prefix') . '/templates/show_confirmation.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_confirmation.inc.php'); } // show_confirmation function sse_worker($url) @@ -183,7 +183,7 @@ function get_location() */ function show_preference_box($preferences) { - require AmpConfig::get('prefix') . '/templates/show_preference_box.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_preference_box.inc.php'); } // show_preference_box @@ -733,7 +733,7 @@ function show_now_playing() $web_path = AmpConfig::get('web_path'); $results = Stream::get_now_playing(); - require_once AmpConfig::get('prefix') . '/templates/show_now_playing.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_now_playing.inc.php'); } // show_now_playing diff --git a/localplay.php b/localplay.php index caf39920..82c7a4f3 100644 --- a/localplay.php +++ b/localplay.php @@ -38,7 +38,7 @@ switch ($_REQUEST['action']) { // Get the current localplay fields $localplay = new Localplay(AmpConfig::get('localplay_controller')); $fields = $localplay->get_instance_fields(); - require_once AmpConfig::get('prefix') . '/templates/show_localplay_add_instance.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_localplay_add_instance.inc.php'); break; case 'add_instance': // This requires 50 or better! @@ -62,7 +62,7 @@ switch ($_REQUEST['action']) { $localplay = new Localplay(AmpConfig::get('localplay_controller')); $instance = $localplay->get_instance($_REQUEST['instance']); $fields = $localplay->get_instance_fields(); - require_once AmpConfig::get('prefix') . '/templates/show_localplay_edit_instance.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_localplay_edit_instance.inc.php'); break; case 'show_instances': // First build the localplay object and then get the instances @@ -70,7 +70,7 @@ switch ($_REQUEST['action']) { $localplay = new Localplay(AmpConfig::get('localplay_controller')); $instances = $localplay->get_instances(); $fields = $localplay->get_instance_fields(); - require_once AmpConfig::get('prefix') . '/templates/show_localplay_instances.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_localplay_instances.inc.php'); break; case 'show_playlist': default: @@ -81,7 +81,7 @@ switch ($_REQUEST['action']) { // Pull the current playlist and require the template $objects = $localplay->get(); - require_once AmpConfig::get('prefix') . '/templates/show_localplay_status.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_localplay_status.inc.php'); break; } // end switch action diff --git a/login.php b/login.php index 495ac0ea..49ad7021 100644 --- a/login.php +++ b/login.php @@ -39,4 +39,4 @@ if (AmpConfig::get('use_auth') && !isset($_GET['force_display'])) { } require_once 'lib/login.php'; -require AmpConfig::get('prefix') . '/templates/show_login_form.inc.php'; +require AmpConfig::get('prefix') . UI::find_template('show_login_form.inc.php'); diff --git a/lostpassword.php b/lostpassword.php index c57a2b0d..7f522d7b 100644 --- a/lostpassword.php +++ b/lostpassword.php @@ -41,10 +41,10 @@ switch ($action) { Error::add('general', T_('Password has not been sent')); } - require AmpConfig::get('prefix') . '/templates/show_login_form.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_login_form.inc.php'); break; default: - require AmpConfig::get('prefix') . '/templates/show_lostpassword_form.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_lostpassword_form.inc.php'); } function send_newpassword($email,$current_ip) diff --git a/modules/Beets/Catalog.php b/modules/Beets/Catalog.php index c628cd79..f4eb9d4a 100644 --- a/modules/Beets/Catalog.php +++ b/modules/Beets/Catalog.php @@ -115,7 +115,7 @@ abstract class Catalog extends \Catalog public function add_to_catalog($options = null) { if (!defined('SSE_OUTPUT')) { - require AmpConfig::get('prefix') . '/templates/show_adds_catalog.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_adds_catalog.inc.php'); flush(); } set_time_limit(0); diff --git a/modules/catalog/local.catalog.php b/modules/catalog/local.catalog.php index 6bd577eb..681eff2b 100644 --- a/modules/catalog/local.catalog.php +++ b/modules/catalog/local.catalog.php @@ -432,7 +432,7 @@ class Catalog_local extends Catalog $this->added_videos_to_gather = array(); if (!defined('SSE_OUTPUT')) { - require AmpConfig::get('prefix') . '/templates/show_adds_catalog.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_adds_catalog.inc.php'); flush(); } @@ -465,7 +465,7 @@ class Catalog_local extends Catalog if ($options['gather_art']) { $catalog_id = $this->id; if (!defined('SSE_OUTPUT')) { - require AmpConfig::get('prefix') . '/templates/show_gather_art.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_gather_art.inc.php'); flush(); } $this->gather_art($this->added_songs_to_gather, $this->added_videos_to_gather); @@ -505,7 +505,7 @@ class Catalog_local extends Catalog $this->count = 0; if (!defined('SSE_OUTPUT')) { - require_once AmpConfig::get('prefix') . '/templates/show_verify_catalog.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_verify_catalog.inc.php'); flush(); } diff --git a/modules/plugins/ShoutHome.plugin.php b/modules/plugins/ShoutHome.plugin.php index f31c3ca0..3fb3ed5c 100644 --- a/modules/plugins/ShoutHome.plugin.php +++ b/modules/plugins/ShoutHome.plugin.php @@ -83,7 +83,7 @@ class AmpacheShoutHome { echo "
\n"; $shouts = Shoutbox::get_top($this->maxitems); if (count($shouts)) { - require_once AmpConfig::get('prefix') . '/templates/show_shoutbox.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_shoutbox.inc.php'); } echo "
\n"; } diff --git a/playlist.php b/playlist.php index 7bbaba3c..366424da 100644 --- a/playlist.php +++ b/playlist.php @@ -61,10 +61,10 @@ switch ($_REQUEST['action']) { $playlist = new Playlist($_REQUEST['playlist_id']); $playlist->format(); $object_ids = $playlist->get_items(); - require_once AmpConfig::get('prefix') . '/templates/show_playlist.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_playlist.inc.php'); break; case 'show_import_playlist': - require_once AmpConfig::get('prefix') . '/templates/show_import_playlist.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_import_playlist.inc.php'); break; case 'import_playlist': /* first we rename the file to it's original name before importing. @@ -164,7 +164,7 @@ switch ($_REQUEST['action']) { $playlist->delete_track($track_id); } $object_ids = $playlist->get_items(); - require_once AmpConfig::get('prefix') . '/templates/show_playlist.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_playlist.inc.php'); break; case 'sort_tracks': $playlist = new Playlist($_REQUEST['playlist_id']); @@ -176,10 +176,10 @@ switch ($_REQUEST['action']) { /* Sort the tracks */ $playlist->sort_tracks(); $object_ids = $playlist->get_items(); - require_once AmpConfig::get('prefix') . '/templates/show_playlist.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_playlist.inc.php'); break; default: - require_once AmpConfig::get('prefix') . '/templates/show_playlist.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_playlist.inc.php'); break; } // switch on the action diff --git a/preferences.php b/preferences.php index 35d268da..83471d7e 100644 --- a/preferences.php +++ b/preferences.php @@ -168,7 +168,7 @@ switch ($_REQUEST['action']) { } // Show the default preferences page - require AmpConfig::get('prefix') . '/templates/show_preferences.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_preferences.inc.php'); break; } // end switch on action diff --git a/pvmsg.php b/pvmsg.php index 8cc8fc2a..0d45b6dd 100644 --- a/pvmsg.php +++ b/pvmsg.php @@ -42,7 +42,7 @@ switch ($action) { $_REQUEST['message'] = "\n\n\n---\n> " . str_replace("\n", "\n> ", $pvmsg->message); } } - require_once AmpConfig::get('prefix') . '/templates/show_add_pvmsg.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_pvmsg.inc.php'); break; case 'add_message': if (AmpConfig::get('demo_mode')) { break; } @@ -60,7 +60,7 @@ switch ($action) { $pvmsg_id = PrivateMsg::create($_POST); if (!$pvmsg_id) { - require_once AmpConfig::get('prefix') . '/templates/show_add_pvmsg.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_pvmsg.inc.php'); } else { $body = T_('Message Sent'); $title = ''; @@ -124,7 +124,7 @@ switch ($action) { if (!$pvmsg->is_read) { $pvmsg->set_is_read(true); } - require_once AmpConfig::get('prefix') . '/templates/show_pvmsg.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_pvmsg.inc.php'); } else { debug_event('UI::access_denied', 'Unknown or unauthorized private message #' . $msg_id . '.', '3'); UI::access_denied(); diff --git a/radio.php b/radio.php index 59e03af9..8fbc01a0 100644 --- a/radio.php +++ b/radio.php @@ -37,7 +37,7 @@ switch ($_REQUEST['action']) { exit; } - require_once AmpConfig::get('prefix') . '/templates/show_add_live_stream.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_live_stream.inc.php'); break; case 'create': @@ -55,7 +55,7 @@ switch ($_REQUEST['action']) { $results = Live_Stream::create($_POST); if (!$results) { - require_once AmpConfig::get('prefix') . '/templates/show_add_live_stream.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_live_stream.inc.php'); } else { $body = T_('Radio Station Added'); $title = ''; diff --git a/random.php b/random.php index 403b6d0b..5495d780 100644 --- a/random.php +++ b/random.php @@ -36,7 +36,7 @@ switch ($_REQUEST['action']) { } case 'advanced': default: - require_once AmpConfig::get('prefix') . '/templates/show_random.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_random.inc.php'); break; } // end switch diff --git a/register.php b/register.php index 5cf52171..b9ea4170 100644 --- a/register.php +++ b/register.php @@ -44,7 +44,7 @@ switch ($_REQUEST['action']) { case 'validate': $username = scrub_in($_GET['username']); $validation = scrub_in($_GET['auth']); - require_once AmpConfig::get('prefix') . '/templates/show_user_activate.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_user_activate.inc.php'); break; case 'add_user': /** @@ -123,7 +123,7 @@ switch ($_REQUEST['action']) { // If we've hit an error anywhere up there break! if (Error::occurred()) { - require_once AmpConfig::get('prefix') . '/templates/show_user_registration.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_user_registration.inc.php'); break; } @@ -148,7 +148,7 @@ switch ($_REQUEST['action']) { if (!$new_user) { Error::add('duplicate_user', T_("Error: Insert Failed")); - require_once AmpConfig::get('prefix') . '/templates/show_user_registration.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_user_registration.inc.php'); break; } @@ -161,10 +161,10 @@ switch ($_REQUEST['action']) { Registration::send_confirmation($username, $fullname, $email, $website, $pass1, $validation); } - require_once AmpConfig::get('prefix') . '/templates/show_registration_confirmation.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_registration_confirmation.inc.php'); break; case 'show_add_user': default: - require_once AmpConfig::get('prefix') . '/templates/show_user_registration.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_user_registration.inc.php'); break; } // end switch on action diff --git a/search.php b/search.php index 1f491076..711e2dfd 100644 --- a/search.php +++ b/search.php @@ -31,15 +31,15 @@ switch ($_REQUEST['action']) { case 'search': if ($_REQUEST['rule_1'] != 'missing_artist') { $browse = new Browse(); - require_once AmpConfig::get('prefix') . '/templates/show_search_form.inc.php'; - require_once AmpConfig::get('prefix') . '/templates/show_search_options.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_search_form.inc.php'); + require_once AmpConfig::get('prefix') . UI::find_template('show_search_options.inc.php'); $results = Search::run($_REQUEST); $browse->set_type($_REQUEST['type']); $browse->show_objects($results); $browse->store(); } else { $wartists = Wanted::search_missing_artists($_REQUEST['rule_1_input']); - require_once AmpConfig::get('prefix') . '/templates/show_missing_artists.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_missing_artists.inc.php'); echo '' . T_('View on MusicBrainz') . '
'; } break; @@ -56,10 +56,10 @@ switch ($_REQUEST['action']) { case 'descriptor': // This is a little special we don't want header/footers so trash what we've got in the OB ob_clean(); - require_once AmpConfig::get('prefix') . '/templates/show_search_descriptor.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_search_descriptor.inc.php'); exit; default: - require_once AmpConfig::get('prefix') . '/templates/show_search_form.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_search_form.inc.php'); break; } diff --git a/server/browse.ajax.php b/server/browse.ajax.php index 8d4f8a70..833873d9 100644 --- a/server/browse.ajax.php +++ b/server/browse.ajax.php @@ -142,7 +142,7 @@ switch ($_REQUEST['action']) { break; case 'get_filters': ob_start(); - require_once AmpConfig::get('prefix') . '/templates/browse_filters.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('browse_filters.inc.php'); $results['browse_filters'] = ob_get_clean(); break; case 'options': diff --git a/server/edit.server.php b/server/edit.server.php index 19a637fd..aab064ed 100644 --- a/server/edit.server.php +++ b/server/edit.server.php @@ -68,16 +68,16 @@ if (!Access::check('interface', $level) || AmpConfig::get('demo_mode')) { switch ($_REQUEST['action']) { case 'show_edit_object': ob_start(); - require AmpConfig::get('prefix') . '/templates/show_edit_' . $type . '.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_edit_' . $type . '.inc.php'); $results = ob_get_contents(); break; case 'refresh_updated': - require AmpConfig::get('prefix') . '/templates/show_' . $type . '.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_' . $type . '.inc.php'); $results = ob_get_contents(); break; case 'show_edit_playlist': ob_start(); - require AmpConfig::get('prefix') . '/templates/show_playlists_dialog.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_playlists_dialog.inc.php'); $results = ob_get_contents(); ob_end_clean(); break; diff --git a/server/index.ajax.php b/server/index.ajax.php index c76c21e2..e21d88ee 100644 --- a/server/index.ajax.php +++ b/server/index.ajax.php @@ -31,7 +31,7 @@ switch ($_REQUEST['action']) { $albums = Album::get_random(6); if (count($albums) AND is_array($albums)) { ob_start(); - require_once AmpConfig::get('prefix') . '/templates/show_random_albums.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_random_albums.inc.php'); $results['random_selection'] = ob_get_clean(); } else { $results['random_selection'] = ''; @@ -48,7 +48,7 @@ switch ($_REQUEST['action']) { $videos = Video::get_random(6); if (count($videos) AND is_array($videos)) { ob_start(); - require_once AmpConfig::get('prefix') . '/templates/show_random_videos.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_random_videos.inc.php'); $results['random_video_selection'] = ob_get_clean(); } else { $results['random_video_selection'] = ''; @@ -64,7 +64,7 @@ switch ($_REQUEST['action']) { $biography = Recommendation::get_artist_info(null, rawurldecode($_REQUEST['fullname'])); } ob_start(); - require_once AmpConfig::get('prefix') . '/templates/show_artist_info.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_artist_info.inc.php'); $results['artist_biography'] = ob_get_clean(); } break; @@ -84,7 +84,7 @@ switch ($_REQUEST['action']) { } } ob_start(); - require_once AmpConfig::get('prefix') . '/templates/show_recommended_artists.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_recommended_artists.inc.php'); $results['similar_artist'] = ob_get_clean(); } break; @@ -94,7 +94,7 @@ switch ($_REQUEST['action']) { $artists = Recommendation::get_artists_like($_REQUEST['media_artist'], 3, false); $songs = Recommendation::get_songs_like($media_id, 3); ob_start(); - require_once AmpConfig::get('prefix') . '/templates/show_now_playing_similar.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_now_playing_similar.inc.php'); $results['similar_items_' . $media_id] = ob_get_clean(); } break; @@ -123,7 +123,7 @@ switch ($_REQUEST['action']) { } } ob_start(); - require_once AmpConfig::get('prefix') . '/templates/show_concerts.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_concerts.inc.php'); $results['concerts'] = ob_get_clean(); } break; @@ -142,7 +142,7 @@ switch ($_REQUEST['action']) { $browse->save_objects($object_ids); $browse->store(); ob_start(); - require_once AmpConfig::get('prefix') . '/templates/show_labels.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_labels.inc.php'); $results['labels'] = ob_get_clean(); } break; @@ -161,7 +161,7 @@ switch ($_REQUEST['action']) { } ob_start(); - require_once AmpConfig::get('prefix') . '/templates/show_missing_albums.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_missing_albums.inc.php'); $results['missing_albums'] = ob_get_clean(); } break; @@ -221,7 +221,7 @@ switch ($_REQUEST['action']) { ob_start(); $data = Song::get_recently_played(); Song::build_cache(array_keys($data)); - require_once AmpConfig::get('prefix') . '/templates/show_recently_played.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_recently_played.inc.php'); $results['recently_played'] = ob_get_clean(); break; case 'sidebar': @@ -243,7 +243,7 @@ switch ($_REQUEST['action']) { Ajax::set_include_override(true); ob_start(); $_SESSION['state']['sidebar_tab'] = $button; - require_once AmpConfig::get('prefix') . '/templates/sidebar.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('sidebar.inc.php'); $results['sidebar-content'] = ob_get_contents(); ob_end_clean(); break; @@ -316,7 +316,7 @@ switch ($_REQUEST['action']) { $browse->store(); UI::show_box_top(T_('Songs'), 'info-box'); - require_once AmpConfig::get('prefix') . '/templates/show_songs.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_songs.inc.php'); UI::show_box_bottom(); } diff --git a/server/localplay.ajax.php b/server/localplay.ajax.php index 963f90f7..62e8c366 100644 --- a/server/localplay.ajax.php +++ b/server/localplay.ajax.php @@ -42,7 +42,7 @@ switch ($_REQUEST['action']) { // We should also refesh the sidebar ob_start(); - require_once AmpConfig::get('prefix') . '/templates/sidebar.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('sidebar.inc.php'); $results['sidebar-content'] = ob_get_contents(); ob_end_clean(); break; @@ -75,7 +75,7 @@ switch ($_REQUEST['action']) { // We actually want to refresh something here ob_start(); $objects = $localplay->get(); - require_once AmpConfig::get('prefix') . '/templates/show_localplay_status.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_localplay_status.inc.php'); $results['localplay_status'] = ob_get_contents(); ob_end_clean(); break; @@ -168,7 +168,7 @@ switch ($_REQUEST['action']) { ob_start(); $objects = $localplay->get(); - require_once AmpConfig::get('prefix') . '/templates/show_localplay_status.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_localplay_status.inc.php'); $results['localplay_status'] = ob_get_contents(); ob_end_clean(); @@ -187,7 +187,7 @@ switch ($_REQUEST['action']) { ob_start(); $objects = $localplay->get(); - require_once AmpConfig::get('prefix') . '/templates/show_localplay_status.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_localplay_status.inc.php'); $results['localplay_status'] = ob_get_contents(); ob_end_clean(); diff --git a/server/player.ajax.php b/server/player.ajax.php index d3b3df49..214e176c 100644 --- a/server/player.ajax.php +++ b/server/player.ajax.php @@ -30,7 +30,7 @@ $results = array(); switch ($_REQUEST['action']) { case 'show_broadcasts': ob_start(); - require AmpConfig::get('prefix') . '/templates/show_broadcasts_dialog.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_broadcasts_dialog.inc.php'); $results = ob_get_contents(); ob_end_clean(); echo $results; diff --git a/server/playlist.ajax.php b/server/playlist.ajax.php index bda1e0ae..778f96f9 100644 --- a/server/playlist.ajax.php +++ b/server/playlist.ajax.php @@ -129,7 +129,7 @@ switch ($_REQUEST['action']) { /*$playlist->format(); $object_ids = $playlist->get_items(); ob_start(); - require_once AmpConfig::get('prefix') . '/templates/show_playlist.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_playlist.inc.php'); $results['content'] = ob_get_contents(); ob_end_clean();*/ debug_event('playlist', 'Items added successfully!', '5'); diff --git a/server/sse.server.php b/server/sse.server.php index 544058ee..684a97f7 100644 --- a/server/sse.server.php +++ b/server/sse.server.php @@ -148,7 +148,7 @@ switch ($worker) { foreach ($catalogs as $catalog_id) { $catalog = Catalog::create_from_id($catalog_id); if ($catalog !== null) { - require AmpConfig::get('prefix') . '/templates/show_gather_art.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_gather_art.inc.php'); flush(); $catalog->gather_art(); } diff --git a/server/stream.ajax.php b/server/stream.ajax.php index 0d57f885..13c09885 100644 --- a/server/stream.ajax.php +++ b/server/stream.ajax.php @@ -107,7 +107,7 @@ switch ($_REQUEST['action']) { if ( ($_REQUEST['playlist_method'] == 'clear' || AmpConfig::get('playlist_method') == 'clear')) { define('NO_SONGS','1'); ob_start(); - require_once AmpConfig::get('prefix') . '/templates/rightbar.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('rightbar.inc.php'); $results['rightbar'] = ob_get_clean(); } diff --git a/share.php b/share.php index 11c44cef..f1fd431a 100644 --- a/share.php +++ b/share.php @@ -49,7 +49,7 @@ switch ($action) { $object = new $type($oid); if ($object->id) { $object->format(); - require_once AmpConfig::get('prefix') . '/templates/show_add_share.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_share.inc.php'); } } UI::show_footer(); @@ -69,7 +69,7 @@ switch ($action) { $id = Share::create_share($_REQUEST['type'], $_REQUEST['id'], $_REQUEST['allow_stream'], $_REQUEST['allow_download'], $_REQUEST['expire'], $_REQUEST['secret'], $_REQUEST['max_counter']); if (!$id) { - require_once AmpConfig::get('prefix') . '/templates/show_add_share.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_share.inc.php'); } else { $share = new Share($id); $body = T_('Share created.') . '
' . @@ -191,7 +191,7 @@ if ($action == 'download') { require AmpConfig::get('prefix') . '/batch.php'; } } elseif ($action == 'stream') { - require AmpConfig::get('prefix') . '/templates/show_share.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_share.inc.php'); } else { debug_event('UI::access_denied', 'Access Denied: unknown action.', '3'); UI::access_denied(); diff --git a/shout.php b/shout.php index 2afec8f1..b9c9ef92 100644 --- a/shout.php +++ b/shout.php @@ -71,7 +71,7 @@ switch ($_REQUEST['action']) { } // Now go ahead and display the page where we let them add a comment etc - require_once AmpConfig::get('prefix') . '/templates/show_add_shout.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_add_shout.inc.php'); break; default: header("Location:" . AmpConfig::get('web_path')); diff --git a/smartplaylist.php b/smartplaylist.php index 583161eb..1ee86fb7 100644 --- a/smartplaylist.php +++ b/smartplaylist.php @@ -80,7 +80,7 @@ switch ($_REQUEST['action']) { $playlist = new Search($_REQUEST['playlist_id'], 'song'); $playlist->format(); $object_ids = $playlist->get_items(); - require_once AmpConfig::get('prefix') . '/templates/show_search.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_search.inc.php'); break; case 'update_playlist': $playlist = new Search($_REQUEST['playlist_id'], 'song'); @@ -93,11 +93,11 @@ switch ($_REQUEST['action']) { break; } $object_ids = $playlist->get_items(); - require_once AmpConfig::get('prefix') . '/templates/show_search.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_search.inc.php'); break; default: $object_ids = $playlist->get_items(); - require_once AmpConfig::get('prefix') . '/templates/show_search.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_search.inc.php'); break; } // switch on the action diff --git a/song.php b/song.php index c97f7fa5..abcb1999 100644 --- a/song.php +++ b/song.php @@ -59,14 +59,14 @@ switch ($_REQUEST['action']) { $song->format(); $song->fill_ext_info(); $lyrics = $song->get_lyrics(); - require_once AmpConfig::get('prefix') . '/templates/show_lyrics.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_lyrics.inc.php'); break; case 'show_song': default: $song = new Song($_REQUEST['song_id']); $song->format(); $song->fill_ext_info(); - require_once AmpConfig::get('prefix') . '/templates/show_song.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_song.inc.php'); break; } // end data collection diff --git a/sql/ampache.sql b/sql/ampache.sql index 188f1257..aeb30494 100644 --- a/sql/ampache.sql +++ b/sql/ampache.sql @@ -650,12 +650,7 @@ INSERT INTO `preference` (`id`, `name`, `value`, `description`, `level`, `type`, (132, 'browser_notify_timeout', '10', 'WebPlayer browser notifications timeout (seconds)', 25, 'integer', 'interface'), (133, 'geolocation', '0', 'Allow geolocation', 25, 'integer', 'options'), (134, 'webplayer_aurora', '1', 'Authorize JavaScript decoder (Aurora.js) in Web Player(s)', 25, 'boolean', 'streaming'), -(135, 'upload_allow_remove', '1', 'Upload: allow users to remove uploaded songs', 75, 'boolean', 'system'), -(136, 'custom_login_logo', '', 'Custom login page logo url', 75, 'string', 'interface'), -(137, 'custom_favicon', '', 'Custom favicon url', 75, 'string', 'interface'), -(138, 'custom_text_footer', '', 'Custom text footer', 75, 'string', 'interface'), -(139, 'webdav_backend', '0', 'Use WebDAV backend', 100, 'boolean', 'system'), -(140, 'notify_email', '0', 'Receive notifications by email (shouts, private messages, ...)', 25, 'boolean', 'options'); +(135, 'upload_allow_remove', '1', 'Upload: allow users to remove uploaded songs', 75, 'boolean', 'system'); -- -------------------------------------------------------- @@ -1074,7 +1069,7 @@ CREATE TABLE IF NOT EXISTS `update_info` ( -- INSERT INTO `update_info` (`key`, `value`) VALUES -('db_version', '370035'), +('db_version', '370030'), ('Plugin_Last.FM', '000004'); -- -------------------------------------------------------- @@ -1099,7 +1094,6 @@ CREATE TABLE IF NOT EXISTS `user` ( `validation` varchar(128) CHARACTER SET utf8 DEFAULT NULL, `state` varchar(64) CHARACTER SET utf8 DEFAULT NULL, `city` varchar(64) CHARACTER SET utf8 DEFAULT NULL, - `fullname_public` tinyint(1) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=3 ; @@ -1247,11 +1241,6 @@ INSERT INTO `user_preference` (`user`, `preference`, `value`) VALUES (-1, 133, '0'), (-1, 134, '1'), (-1, 135, '1'), -(-1, 136, ''), -(-1, 137, ''), -(-1, 138, ''), -(-1, 139, '0'), -(-1, 140, '0'), (-1, 96, ''), (-1, 97, ''), (-1, 98, ''); @@ -1355,76 +1344,6 @@ CREATE TABLE IF NOT EXISTS `wanted` ( UNIQUE KEY `unique_wanted` (`user`,`artist`,`mbid`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; --- -------------------------------------------------------- - --- --- Table structure for table `label` --- - -DROP TABLE IF EXISTS `label`; -CREATE TABLE IF NOT EXISTS `label` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `name` varchar(80) NOT NULL, - `category` varchar(40) NULL, - `summary` TEXT CHARACTER SET utf8 NULL, - `address` varchar(256) NULL, - `email` varchar(128) NULL, - `website` varchar(256) NULL, - `user` int(11) unsigned NULL, - `creation_date` int(11) unsigned NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 - --- -------------------------------------------------------- - --- --- Table structure for table `label_asso` --- - -DROP TABLE IF EXISTS `label_asso`; -CREATE TABLE IF NOT EXISTS `label_asso` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `label` int(11) unsigned NOT NULL, - `artist` int(11) unsigned NOT NULL, - `creation_date` int(11) unsigned NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `user_pvmsg` --- - -DROP TABLE IF EXISTS `user_pvmsg`; -CREATE TABLE IF NOT EXISTS `user_pvmsg` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `subject` varchar(80) NOT NULL, - `message` TEXT CHARACTER SET utf8 NULL, - `from_user` int(11) unsigned NOT NULL, - `to_user` int(11) unsigned NOT NULL, - `is_read` tinyint(1) unsigned NOT NULL DEFAULT '0', - `creation_date` int(11) unsigned NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `user_follower` --- - -DROP TABLE IF EXISTS `user_follower`; -CREATE TABLE IF NOT EXISTS `user_follower` ( - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, - `user` int(11) unsigned NOT NULL, - `follow_user` int(11) unsigned NOT NULL, - `follow_date` int(11) unsigned NULL, - `creation_date` int(11) unsigned NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; - - /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; diff --git a/stats.php b/stats.php index 491eb38f..59d9700b 100644 --- a/stats.php +++ b/stats.php @@ -33,33 +33,33 @@ switch ($_REQUEST['action']) { // Show a Users "Profile" page case 'show_user': $client = new User($_REQUEST['user_id']); - require_once AmpConfig::get('prefix') . '/templates/show_user.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_user.inc.php'); break; // Show stats case 'newest': - require_once AmpConfig::get('prefix') . '/templates/show_newest.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_newest.inc.php'); break; case 'popular': - require_once AmpConfig::get('prefix') . '/templates/show_popular.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_popular.inc.php'); break; case 'highest': - require_once AmpConfig::get('prefix') . '/templates/show_highest.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_highest.inc.php'); break; case 'userflag': - require_once AmpConfig::get('prefix') . '/templates/show_userflag.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_userflag.inc.php'); break; case 'recent': $user_id = $_REQUEST['user_id']; - require_once AmpConfig::get('prefix') . '/templates/show_recent.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_recent.inc.php'); break; case 'wanted': - require_once AmpConfig::get('prefix') . '/templates/show_wanted.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_wanted.inc.php'); break; case 'share': - require_once AmpConfig::get('prefix') . '/templates/show_shares.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_shares.inc.php'); break; case 'upload': - require_once AmpConfig::get('prefix') . '/templates/show_uploads.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_uploads.inc.php'); break; case 'graph': Graph::display_from_request(); @@ -67,7 +67,7 @@ switch ($_REQUEST['action']) { case 'show': default: if (Access::check('interface','50')) { - require_once AmpConfig::get('prefix') . '/templates/show_stats.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_stats.inc.php'); } break; } // end switch on action diff --git a/templates/browse_filters.inc.php b/templates/browse_filters.inc.php index d590f8fa..8b088ee0 100644 --- a/templates/browse_filters.inc.php +++ b/templates/browse_filters.inc.php @@ -30,7 +30,7 @@ if (!Core::is_session_started()) {

-
+
diff --git a/templates/footer.inc.php b/templates/footer.inc.php index 93f2b814..44bd002b 100644 --- a/templates/footer.inc.php +++ b/templates/footer.inc.php @@ -58,7 +58,7 @@
diff --git a/templates/header.inc.php b/templates/header.inc.php index 0eb37c4c..87e878de 100644 --- a/templates/header.inc.php +++ b/templates/header.inc.php @@ -45,10 +45,10 @@ $_SESSION['login'] = false; <?php echo AmpConfig::get('site_title'); ?> - <?php echo $location['title']; ?> - - + + - + @@ -95,7 +95,7 @@ $_SESSION['login'] = false; ?>
- +
diff --git a/templates/rightbar.inc.php b/templates/rightbar.inc.php index ee697de9..0d0ce7df 100644 --- a/templates/rightbar.inc.php +++ b/templates/rightbar.inc.php @@ -75,7 +75,7 @@
    diff --git a/templates/show_add_shout.inc.php b/templates/show_add_shout.inc.php index d078d520..f286043a 100644 --- a/templates/show_add_shout.inc.php +++ b/templates/show_add_shout.inc.php @@ -65,7 +65,7 @@ UI::show_box_top($boxtitle, 'box box_add_shout'); id); if (count($shouts)) { - require_once AmpConfig::get('prefix') . '/templates/show_shoutbox.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_shoutbox.inc.php'); } ?> diff --git a/templates/show_albums.inc.php b/templates/show_albums.inc.php index 70602886..c7d2bf23 100644 --- a/templates/show_albums.inc.php +++ b/templates/show_albums.inc.php @@ -23,7 +23,7 @@ $web_path = AmpConfig::get('web_path'); $thcount = 8; ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -74,7 +74,7 @@ $thcount = 8; } ?> - + @@ -112,4 +112,4 @@ $thcount = 8;
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_artists.inc.php b/templates/show_artists.inc.php index 5825396a..0e2f0ac6 100644 --- a/templates/show_artists.inc.php +++ b/templates/show_artists.inc.php @@ -25,7 +25,7 @@ session_start(); $web_path = AmpConfig::get('web_path'); $thcount = 8; ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -76,7 +76,7 @@ $thcount = 8; } ?> - + @@ -114,4 +114,4 @@ $thcount = 8;
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_broadcasts.inc.php b/templates/show_broadcasts.inc.php index 4f9ff39a..eee65148 100644 --- a/templates/show_broadcasts.inc.php +++ b/templates/show_broadcasts.inc.php @@ -21,7 +21,7 @@ */ ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php') ?> @@ -40,7 +40,7 @@ $libitem->format(); ?> - + @@ -51,4 +51,4 @@
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php') ?> diff --git a/templates/show_catalogs.inc.php b/templates/show_catalogs.inc.php index 0b220d0c..14fd67da 100644 --- a/templates/show_catalogs.inc.php +++ b/templates/show_catalogs.inc.php @@ -20,7 +20,7 @@ * */ ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -39,7 +39,7 @@ $libitem->format(); ?> - + @@ -62,4 +62,4 @@
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_channels.inc.php b/templates/show_channels.inc.php index 3cad5bc7..8a7993d9 100644 --- a/templates/show_channels.inc.php +++ b/templates/show_channels.inc.php @@ -21,7 +21,7 @@ */ ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php') ?> @@ -49,7 +49,7 @@ $libitem->format(); ?> - + @@ -60,4 +60,4 @@
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php') ?> diff --git a/templates/show_concerts.inc.php b/templates/show_concerts.inc.php index f10c000d..83099863 100644 --- a/templates/show_concerts.inc.php +++ b/templates/show_concerts.inc.php @@ -34,7 +34,7 @@ foreach ($coming_concerts as $libitem) { ?> - + @@ -59,7 +59,7 @@ foreach ($concerts as $libitem) { ?> - + diff --git a/templates/show_democratic_playlist.inc.php b/templates/show_democratic_playlist.inc.php index 8f12dfb2..728e8154 100644 --- a/templates/show_democratic_playlist.inc.php +++ b/templates/show_democratic_playlist.inc.php @@ -22,7 +22,7 @@ $web_path = AmpConfig::get('web_path'); ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -116,4 +116,4 @@ foreach ($object_ids as $item) {
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_denied.inc.php b/templates/show_denied.inc.php index b4748473..159dccc2 100644 --- a/templates/show_denied.inc.php +++ b/templates/show_denied.inc.php @@ -24,6 +24,8 @@ $logo_url = AmpConfig::get('custom_login_logo'); if (empty($logo_url)) { $logo_url = AmpConfig::get('web_path') . "/themes/reborn/images/ampache.png"; } + +$web_path = AmpConfig::get('web_path'); ?> @@ -32,9 +34,9 @@ if (empty($logo_url)) { Ampache -- Debug Page - - - + + + diff --git a/templates/show_install_config.inc.php b/templates/show_install_config.inc.php index 84c4fa32..0f489aff 100644 --- a/templates/show_install_config.inc.php +++ b/templates/show_install_config.inc.php @@ -172,9 +172,6 @@ require $prefix . '/templates/install_header.inc.php';
    -
    - -


diff --git a/templates/show_labels.inc.php b/templates/show_labels.inc.php index 69d2c5d2..a1962086 100644 --- a/templates/show_labels.inc.php +++ b/templates/show_labels.inc.php @@ -29,7 +29,7 @@ $thcount = 6; -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -50,7 +50,7 @@ $thcount = 6; $libitem->format(); ?> - + @@ -73,4 +73,4 @@ $thcount = 6;
-get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_live_streams.inc.php b/templates/show_live_streams.inc.php index ccf797ac..dc5b40b7 100644 --- a/templates/show_live_streams.inc.php +++ b/templates/show_live_streams.inc.php @@ -22,7 +22,7 @@ $web_path = AmpConfig::get('web_path'); ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -40,7 +40,7 @@ $web_path = AmpConfig::get('web_path'); $libitem->format(); ?> - + @@ -60,4 +60,4 @@ $web_path = AmpConfig::get('web_path');
-get_show_header()) require AmpConfig::Get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_localplay_playlist.inc.php b/templates/show_localplay_playlist.inc.php index 6c9122ed..538a0b25 100644 --- a/templates/show_localplay_playlist.inc.php +++ b/templates/show_localplay_playlist.inc.php @@ -24,7 +24,7 @@ $localplay = new Localplay(AmpConfig::get('localplay_controller')); $localplay->connect(); $status = $localplay->status(); ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -64,4 +64,4 @@ $status = $localplay->status();
-get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_login_form.inc.php b/templates/show_login_form.inc.php index 8b757135..35cf3363 100644 --- a/templates/show_login_form.inc.php +++ b/templates/show_login_form.inc.php @@ -30,6 +30,8 @@ if (AmpConfig::get('session_length') >= AmpConfig::get('remember_length')) { $htmllang = str_replace("_","-",AmpConfig::get('lang')); is_rtl(AmpConfig::get('lang')) ? $dir = 'rtl' : $dir = 'ltr'; +$web_path = AmpConfig::get('web_path'); + $_SESSION['login'] = true; define('TABLE_RENDERED', 1); @@ -40,9 +42,9 @@ define('TABLE_RENDERED', 1); - - - + + + <?php echo scrub_out(AmpConfig::get('site_title')); ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php') ?> diff --git a/templates/show_preferences.inc.php b/templates/show_preferences.inc.php index 29ce46e7..aa3045af 100644 --- a/templates/show_preferences.inc.php +++ b/templates/show_preferences.inc.php @@ -44,7 +44,7 @@ } // end if not account if ($_REQUEST['tab'] == 'account') { $client = $GLOBALS['user']; - require AmpConfig::get('prefix') . '/templates/show_account.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_account.inc.php'); } ?> diff --git a/templates/show_pvmsgs.inc.php b/templates/show_pvmsgs.inc.php index b29a03a2..9c6542ef 100644 --- a/templates/show_pvmsgs.inc.php +++ b/templates/show_pvmsgs.inc.php @@ -40,7 +40,7 @@ $thcount = 5;
  • -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -60,7 +60,7 @@ $thcount = 5; $libitem->format(); ?> "> - + @@ -82,4 +82,4 @@ $thcount = 5;
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_random.inc.php b/templates/show_random.inc.php index b88e371b..380ee98d 100644 --- a/templates/show_random.inc.php +++ b/templates/show_random.inc.php @@ -96,7 +96,7 @@ - +
    diff --git a/templates/show_recent.inc.php b/templates/show_recent.inc.php index ebb46663..a24242d7 100644 --- a/templates/show_recent.inc.php +++ b/templates/show_recent.inc.php @@ -21,5 +21,5 @@ */ ?> - + diff --git a/templates/show_recommended_artists.inc.php b/templates/show_recommended_artists.inc.php index cc0a86c8..d43d5e31 100644 --- a/templates/show_recommended_artists.inc.php +++ b/templates/show_recommended_artists.inc.php @@ -55,7 +55,7 @@ $thcount = 8; $libitem->format(); ?> - + <?php echo AmpConfig::get('site_title'); ?> - <?php echo T_('Registration'); ?> - - - + + +
    @@ -55,7 +55,7 @@ $_SESSION['login'] = true; } ?>

    - +

    diff --git a/templates/show_search.inc.php b/templates/show_search.inc.php index 811f1ff3..010d2995 100644 --- a/templates/show_search.inc.php +++ b/templates/show_search.inc.php @@ -22,7 +22,7 @@ ?> id . '">' . $title . '' , 'box box_smartplaylist'); @@ -51,7 +51,7 @@ UI::show_box_top('
    ' . $title .
    - +
    diff --git a/templates/show_search_form.inc.php b/templates/show_search_form.inc.php index 8e0d7aff..92dacc9e 100644 --- a/templates/show_search_form.inc.php +++ b/templates/show_search_form.inc.php @@ -47,7 +47,7 @@ UI::show_box_top(T_('Search Ampache') . "...", 'box box_advanced_search'); - +
       diff --git a/templates/show_searches.inc.php b/templates/show_searches.inc.php index 3e60bc6e..26d26bab 100644 --- a/templates/show_searches.inc.php +++ b/templates/show_searches.inc.php @@ -30,7 +30,7 @@
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php') ?> @@ -51,7 +51,7 @@ $libitem->format(); ?> - + @@ -74,4 +74,4 @@
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php' ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php') ?> diff --git a/templates/show_share.inc.php b/templates/show_share.inc.php index 33e969ad..81a6cd3b 100644 --- a/templates/show_share.inc.php +++ b/templates/show_share.inc.php @@ -25,7 +25,7 @@ $embed = $_REQUEST['embed']; $is_share = true; $playlist = $share->create_fake_playlist(); -require AmpConfig::get('prefix') . '/templates/show_web_player.inc.php'; +require AmpConfig::get('prefix') . UI::find_template('show_web_player.inc.php'); if (empty($embed)) { echo "" .T_('Shared by') . ' ' . $share->f_user . "
    "; diff --git a/templates/show_shared_objects.inc.php b/templates/show_shared_objects.inc.php index cc5c5dcf..8e2cc5d1 100644 --- a/templates/show_shared_objects.inc.php +++ b/templates/show_shared_objects.inc.php @@ -44,7 +44,7 @@ $libitem->format(); ?> - + diff --git a/templates/show_shares.inc.php b/templates/show_shares.inc.php index 0c4a6b1c..ccaf7551 100644 --- a/templates/show_shares.inc.php +++ b/templates/show_shares.inc.php @@ -29,5 +29,5 @@ - + diff --git a/templates/show_song_previews.inc.php b/templates/show_song_previews.inc.php index e8bc2b2b..04802c17 100644 --- a/templates/show_song_previews.inc.php +++ b/templates/show_song_previews.inc.php @@ -41,7 +41,7 @@ foreach ($object_ids as $libitem) { ?> - + diff --git a/templates/show_songs.inc.php b/templates/show_songs.inc.php index 41df9179..4ec1295c 100644 --- a/templates/show_songs.inc.php +++ b/templates/show_songs.inc.php @@ -23,7 +23,7 @@ $web_path = AmpConfig::get('web_path'); $thcount = 8; ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -64,7 +64,7 @@ $thcount = 8; $libitem->format(); ?> - + @@ -103,4 +103,4 @@ $thcount = 8;
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_stats_popular.inc.php b/templates/show_stats_popular.inc.php index 4b700b65..10c73cdb 100644 --- a/templates/show_stats_popular.inc.php +++ b/templates/show_stats_popular.inc.php @@ -25,20 +25,20 @@ $objects = Stats::get_top('album'); $headers = array('f_link' => T_('Most Popular Albums')); UI::show_box_top('','info-box box_popular_albums'); -require AmpConfig::get('prefix') . '/templates/show_objects.inc.php'; +require AmpConfig::get('prefix') . UI::find_template('show_objects.inc.php'); UI::show_box_bottom(); $objects = Stats::get_top('artist'); $headers = array('f_link' => T_('Most Popular Artists')); UI::show_box_top('','info-box box_popular_artists'); -require AmpConfig::get('prefix') . '/templates/show_objects.inc.php'; +require AmpConfig::get('prefix') . UI::find_template('show_objects.inc.php'); UI::show_box_bottom(); if (AmpConfig::get('allow_video')) { $objects = Stats::get_top('video'); $headers = array('f_link' => T_('Most Popular Videos')); UI::show_box_top('','info-box box_popular_videos'); - require AmpConfig::get('prefix') . '/templates/show_objects.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_objects.inc.php'); UI::show_box_bottom(); } diff --git a/templates/show_tvshow_seasons.inc.php b/templates/show_tvshow_seasons.inc.php index 4e3419e1..e9969bfb 100644 --- a/templates/show_tvshow_seasons.inc.php +++ b/templates/show_tvshow_seasons.inc.php @@ -23,7 +23,7 @@ $web_path = AmpConfig::get('web_path'); $thcount = 6; ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -55,7 +55,7 @@ $thcount = 6; $libitem->format(); ?> - + @@ -86,4 +86,4 @@ $thcount = 6;
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_tvshows.inc.php b/templates/show_tvshows.inc.php index c72481da..3f6a118f 100644 --- a/templates/show_tvshows.inc.php +++ b/templates/show_tvshows.inc.php @@ -25,7 +25,7 @@ session_start(); $web_path = AmpConfig::get('web_path'); $thcount = 8; ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -60,7 +60,7 @@ $thcount = 8; $libitem->format(); ?> - + @@ -92,4 +92,4 @@ $thcount = 8;
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_uploads.inc.php b/templates/show_uploads.inc.php index 0b39e7af..22460635 100644 --- a/templates/show_uploads.inc.php +++ b/templates/show_uploads.inc.php @@ -21,5 +21,5 @@ */ ?> - + diff --git a/templates/show_user.inc.php b/templates/show_user.inc.php index a5394c05..f8c017b0 100644 --- a/templates/show_user.inc.php +++ b/templates/show_user.inc.php @@ -137,7 +137,7 @@ if ($client->f_avatar) { $data = Song::get_recently_played($client->id); Song::build_cache(array_keys($data)); $user_id = $client->id; - require AmpConfig::get('prefix') . '/templates/show_recently_played.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_recently_played.inc.php'); ?> diff --git a/templates/show_user_activate.inc.php b/templates/show_user_activate.inc.php index 498ef98b..590fb474 100644 --- a/templates/show_user_activate.inc.php +++ b/templates/show_user_activate.inc.php @@ -29,15 +29,15 @@ $web_path = AmpConfig::get('web_path'); <?php echo AmpConfig::get('site_title'); ?> - <?php echo T_('Registration'); ?> - - - + + +
    @@ -52,7 +52,7 @@ $web_path = AmpConfig::get('web_path');

    ', ''); ?> + printf(T_('This User ID is activated and can be used %sLogin%s'), '', ''); ?>

    diff --git a/templates/show_user_registration.inc.php b/templates/show_user_registration.inc.php index d28cf772..a421cef9 100644 --- a/templates/show_user_registration.inc.php +++ b/templates/show_user_registration.inc.php @@ -35,9 +35,9 @@ $_SESSION['login'] = true; <?php echo AmpConfig::get('site_title'); ?> - <?php echo T_('Registration'); ?> - - - + + + @@ -47,7 +47,7 @@ $_SESSION['login'] = true;
    - + diff --git a/templates/show_users.inc.php b/templates/show_users.inc.php index 65381b3a..a08575a1 100644 --- a/templates/show_users.inc.php +++ b/templates/show_users.inc.php @@ -23,7 +23,7 @@ $web_path = AmpConfig::get('web_path'); ?> -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -65,7 +65,7 @@ foreach ($object_ids as $user_id) { $create_date = $libitem->create_date ? date("m\/d\/Y - H:i",$libitem->create_date) : T_('Unknown'); ?> - + @@ -89,4 +89,4 @@ foreach ($object_ids as $user_id) {
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_video.inc.php b/templates/show_video.inc.php index a608d6ce..e5a6a559 100644 --- a/templates/show_video.inc.php +++ b/templates/show_video.inc.php @@ -110,7 +110,7 @@ foreach ($subtitles as $subtitle) { $videoprops[gettext_noop('Title')] = scrub_out($video->f_title); $videoprops[gettext_noop('Length')] = scrub_out($video->f_time); if (!strtolower(get_class($video)) != 'video') { - require AmpConfig::get('prefix') . '/templates/show_partial_' . strtolower(get_class($video)) . '.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_partial_' . strtolower(get_class($video)) . '.inc.php'); } $videoprops[gettext_noop('Release Date')] = scrub_out($video->f_release_date); $videoprops[gettext_noop('Codec')] = scrub_out($video->f_codec); diff --git a/templates/show_video_row.inc.php b/templates/show_video_row.inc.php index ad10a5fd..0e27e8e6 100644 --- a/templates/show_video_row.inc.php +++ b/templates/show_video_row.inc.php @@ -57,7 +57,7 @@ if (Art::is_enabled()) { f_link; ?> f_release_date; ?> diff --git a/templates/show_videos.inc.php b/templates/show_videos.inc.php index b9357b43..af9a4361 100644 --- a/templates/show_videos.inc.php +++ b/templates/show_videos.inc.php @@ -21,7 +21,7 @@ */ $web_path = AmpConfig::get('web_path'); -if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; +if ($browse->get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> @@ -33,7 +33,7 @@ if ($browse->get_show_header()) require AmpConfig::get('prefix') . '/templates/l @@ -67,7 +67,7 @@ if (isset($video_type) && $video_type != 'video') { $libitem->format(); ?> - + @@ -85,7 +85,7 @@ if (isset($video_type) && $video_type != 'video') { @@ -109,4 +109,4 @@ if (isset($video_type) && $video_type != 'video') {
    id . '&type=video&sort=title', T_('Title'),'sort_video_title'); ?> id . '&type=video&sort=release_date', T_('Release Date'),'sort_video_release_date'); ?>
    id . '&type=video&sort=title', T_('Title'),'sort_video_title'); ?> id . '&type=video&sort=release_date', T_('Release Date'),'sort_video_release_date'); ?>
    -get_show_header()) require AmpConfig::get('prefix') . '/templates/list_header.inc.php'; ?> +get_show_header()) require AmpConfig::get('prefix') . UI::find_template('list_header.inc.php'); ?> diff --git a/templates/show_wanted.inc.php b/templates/show_wanted.inc.php index f767c099..b2d1749d 100644 --- a/templates/show_wanted.inc.php +++ b/templates/show_wanted.inc.php @@ -21,5 +21,5 @@ */ ?> - + diff --git a/templates/show_wanted_albums.inc.php b/templates/show_wanted_albums.inc.php index 5b1ba2b0..b69e223e 100644 --- a/templates/show_wanted_albums.inc.php +++ b/templates/show_wanted_albums.inc.php @@ -37,7 +37,7 @@ $libitem->format(); ?> - + diff --git a/templates/show_web_player.inc.php b/templates/show_web_player.inc.php index cb9ef1e7..cf75df8f 100644 --- a/templates/show_web_player.inc.php +++ b/templates/show_web_player.inc.php @@ -52,5 +52,5 @@ if (isset($playlist)) { $isVideo = WebPlayer::is_playlist_video($playlist); } } -require_once AmpConfig::get('prefix') . '/templates/show_html5_player.inc.php'; +require_once AmpConfig::get('prefix') . UI::find_template('show_html5_player.inc.php'); ?> diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php index 26d2df99..f3c445b1 100644 --- a/templates/sidebar.inc.php +++ b/templates/sidebar.inc.php @@ -53,7 +53,7 @@ if (User::is_registered()) { if ($item['id']==$_SESSION['state']['sidebar_tab']) { ?> diff --git a/templates/stylesheets.inc.php b/templates/stylesheets.inc.php index 1c657171..7e0a422f 100644 --- a/templates/stylesheets.inc.php +++ b/templates/stylesheets.inc.php @@ -23,9 +23,9 @@ $web_path = AmpConfig::get('web_path'); $theme_path = AmpConfig::get('theme_path') . '/templates'; ?> - - - + + + @@ -35,12 +35,12 @@ if (file_exists(AmpConfig::get('prefix') . $theme_path . '/icons.sprite.css')) { ?> - - + + diff --git a/tvshow_seasons.php b/tvshow_seasons.php index af5281e3..147d166a 100644 --- a/tvshow_seasons.php +++ b/tvshow_seasons.php @@ -61,7 +61,7 @@ switch ($_REQUEST['action']) { $season->format(); $object_ids = $season->get_episodes(); $object_type = 'tvshow_episode'; - require_once AmpConfig::get('prefix') . '/templates/show_tvshow_season.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_tvshow_season.inc.php'); break; } // end switch diff --git a/tvshows.php b/tvshows.php index e5798669..0f8a2f5b 100644 --- a/tvshows.php +++ b/tvshows.php @@ -61,17 +61,17 @@ switch ($_REQUEST['action']) { $tvshow->format(); $object_ids = $tvshow->get_seasons(); $object_type = 'tvshow_season'; - require_once AmpConfig::get('prefix') . '/templates/show_tvshow.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_tvshow.inc.php'); break; case 'match': case 'Match': $match = scrub_in($_REQUEST['match']); if ($match == "Browse") { $chr = ""; } else { $chr = $match; } /* Enclose this in the purty box! */ - require AmpConfig::get('prefix') . '/templates/show_box_top.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_box_top.inc.php'); show_alphabet_list('tvshows','tvshows.php',$match); show_alphabet_form($chr, T_('Show TV Shows starting with'),"tvshows.php?action=match"); - require AmpConfig::get('prefix') . '/templates/show_box_bottom.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_box_bottom.inc.php'); if ($match === "Browse") { show_tvshows(); diff --git a/upload.php b/upload.php index 7d2016b9..4f34a9f7 100644 --- a/upload.php +++ b/upload.php @@ -51,7 +51,7 @@ switch ($_REQUEST['actionp']) { default: UI::show_header(); - require AmpConfig::get('prefix') . '/templates/show_add_upload.inc.php'; + require AmpConfig::get('prefix') . UI::find_template('show_add_upload.inc.php'); break; } // switch on the action diff --git a/video.php b/video.php index 371a132c..c6369646 100644 --- a/video.php +++ b/video.php @@ -57,7 +57,7 @@ switch ($_REQUEST['action']) { default: $video = Video::create_from_id($_REQUEST['video_id']); $video->format(); - require_once AmpConfig::get('prefix') . '/templates/show_video.inc.php'; + require_once AmpConfig::get('prefix') . UI::find_template('show_video.inc.php'); break; } diff --git a/web_player.php b/web_player.php index 06e5f061..b4760fda 100644 --- a/web_player.php +++ b/web_player.php @@ -22,4 +22,4 @@ require_once 'lib/init.php'; -require_once AmpConfig::get('prefix') . '/templates/show_web_player.inc.php'; +require_once AmpConfig::get('prefix') . UI::find_template('show_web_player.inc.php'); diff --git a/web_player_embedded.php b/web_player_embedded.php index 82845c1c..01c737a1 100644 --- a/web_player_embedded.php +++ b/web_player_embedded.php @@ -23,4 +23,4 @@ require_once 'lib/init.php'; $iframed = true; -require_once AmpConfig::get('prefix') . '/templates/show_web_player.inc.php'; +require_once AmpConfig::get('prefix') . UI::find_template('show_web_player.inc.php');