diff options
-rw-r--r-- | browse.php | 6 | ||||
-rwxr-xr-x | docs/CHANGELOG | 1 | ||||
-rw-r--r-- | lib/class/song.class.php | 2 | ||||
-rw-r--r-- | lib/class/xmldata.class.php | 3 | ||||
-rw-r--r-- | server/tag.ajax.php | 11 | ||||
-rw-r--r-- | server/xml.server.php | 4 | ||||
-rw-r--r-- | templates/browse_content.inc.php | 25 | ||||
-rw-r--r-- | templates/show_tagcloud.inc.php | 2 | ||||
-rw-r--r-- | templates/sidebar_home.inc.php | 11 |
9 files changed, 56 insertions, 9 deletions
@@ -64,7 +64,11 @@ switch($_REQUEST['action']) { Browse::save_objects(Tag::get_tags(Config::get('offset_limit'),array())); $keys = array_keys(Browse::get_saved()); Tag::build_cache($keys); - Browse::show_objects(); + $object_ids = Browse::get_saved(); + show_box_top(_('Tag Cloud'),$class); + require_once Config::get('prefix') . '/templates/show_tagcloud.inc.php'; + show_box_bottom(); + require_once Config::get('prefix') . '/templates/browse_content.inc.php'; break; case 'artist': Browse::set_sort('name','ASC'); diff --git a/docs/CHANGELOG b/docs/CHANGELOG index 78d48e5c..643f0213 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,7 @@ -------------------------------------------------------------------------- v.3.6-Alpha1 + - Fix the url to song function - Add full path to the files needed by the installation just to make it a little clearer - Fixed potential endless loop with malformed genre tags in mp3s diff --git a/lib/class/song.class.php b/lib/class/song.class.php index d0311112..9f5259ef 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -887,7 +887,7 @@ class Song extends database_object implements media { // We only care about the question mark stuff $query = parse_url($url,PHP_URL_QUERY); - $elements = explode("&",unhtmlentities($query)); + $elements = explode("&",$query); foreach ($elements as $items) { list($key,$value) = explode("=",$items); diff --git a/lib/class/xmldata.class.php b/lib/class/xmldata.class.php index 5fa58e71..b1b97264 100644 --- a/lib/class/xmldata.class.php +++ b/lib/class/xmldata.class.php @@ -339,6 +339,9 @@ class xmlData { // Foreach the ids! foreach ($songs as $song_id) { $song = new Song($song_id); + + // If the song id is invalid/null + if (!$song->id) { continue; } $song->format(); $tag_string = ''; diff --git a/server/tag.ajax.php b/server/tag.ajax.php index 51d86c80..af7ebfe3 100644 --- a/server/tag.ajax.php +++ b/server/tag.ajax.php @@ -35,6 +35,17 @@ switch ($_REQUEST['action']) { $tag = new Tag($_REQUEST['tag_id']); $tag->remove_map($_REQUEST['type'],$_REQUEST['object_id']); break; + case 'browse_type': + Browse::set_type('tag'); + Browse::set_filter('object_type',$_REQUEST['type']) + break; + case 'add_filter': + + // Set browse method + Browse::set_type('tag'); + + // Retrive current objects of type based on combined filters + break; default: $results['rfc3514'] = '0x1'; break; diff --git a/server/xml.server.php b/server/xml.server.php index bbe3cab2..9806eaae 100644 --- a/server/xml.server.php +++ b/server/xml.server.php @@ -251,9 +251,11 @@ switch ($_REQUEST['action']) { echo xmlData::songs(array($uid)); break; case 'url_to_song': - $url = scrub_in($_REQUEST['url']); + // Don't scrub in we need to give her raw and juicy to the function + $url = $_REQUEST['url']; $song_id = Song::parse_song_url($url); + ob_end_clean(); echo xmlData::songs(array($song_id)); break; diff --git a/templates/browse_content.inc.php b/templates/browse_content.inc.php new file mode 100644 index 00000000..e7dd3a31 --- /dev/null +++ b/templates/browse_content.inc.php @@ -0,0 +1,25 @@ +<?php +/* + + Copyright (c) Ampache.org + All rights reserved. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +// Because sometimes you just need a container +?> +<?php Ajax::start_container('browse_content'); ?> + +<?php Ajax::end_container(); ?> diff --git a/templates/show_tagcloud.inc.php b/templates/show_tagcloud.inc.php index 56831589..0f6d6e24 100644 --- a/templates/show_tagcloud.inc.php +++ b/templates/show_tagcloud.inc.php @@ -27,6 +27,6 @@ $web_path = Config::get('web_path'); $tag->format(); ?> <span id="click_<?php echo intval($tag->id); ?>" class="<?php echo $tag->f_class; ?>"><?php echo $tag->name; ?></span> -<?php echo Ajax::observe('click_' . intval($tag->id),'click',Ajax::action('?page=browse&action=toggle_tag&tag_id=' . intval($tag->id),'')); ?> +<?php echo Ajax::observe('click_' . intval($tag->id),'click',Ajax::action('?page=tag&action=add_filter&tag_id=' . intval($tag->id),'')); ?> <?php } ?> <?php Ajax::end_container(); ?> diff --git a/templates/sidebar_home.inc.php b/templates/sidebar_home.inc.php index a3b7891d..7bcd65af 100644 --- a/templates/sidebar_home.inc.php +++ b/templates/sidebar_home.inc.php @@ -32,7 +32,7 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path'); <li id="sb_browse_bb_SongTitle"><a href="<?php echo $web_path; ?>/browse.php?action=song"><?php echo _('Song Titles'); ?></a></li> <li id="sb_browse_bb_Album"><a href="<?php echo $web_path; ?>/browse.php?action=album"><?php echo _('Albums'); ?></a></li> <li id="sb_browse_bb_Artist"><a href="<?php echo $web_path; ?>/browse.php?action=artist"><?php echo _('Artists'); ?></a></li> - <!-- <li id="sb_browse_bb_Tags"><a href="<?php echo $web_path; ?>/browse.php?action=tag"><?php echo _('Tag Cloud'); ?></a></li> --> + <li id="sb_browse_bb_Tags"><a href="<?php echo $web_path; ?>/browse.php?action=tag"><?php echo _('Tag Cloud'); ?></a></li> <li id="sb_browse_bb_Playlist"><a href="<?php echo $web_path; ?>/browse.php?action=playlist"><?php echo _('Playlists'); ?></a></li> <li id="sb_browse_bb_RadioStation"><a href="<?php echo $web_path; ?>/browse.php?action=live_stream"><?php echo _('Radio Stations'); ?></a></li> <li id="sb_browse_bb_Video"><a href="<?php echo $web_path; ?>/browse.php?action=video"><?php echo _('Videos'); ?></a></li> @@ -70,15 +70,16 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path'); <?php echo Ajax::observe('show_allplCB','click',Ajax::action('?page=browse&action=browse&type=' . Browse::get_type() . '&key=playlist_type&value=1','')); ?> <?php } // if playlist_type ?> <?php if (in_array('object_type',$allowed_filters)) { ?> - <input id="typeSongRadio" type="radio" name="object_type" value="1" /> + <?php $string = 'otype_' . Browse::get_filter('object_type'); ${$string} = 'selected="selected"'; ?> + <input id="typeSongRadio" type="radio" name="object_type" value="1" <?php echo $otype_song; ?>/> <label id="typeSongLabel" for="typeSongRadio"><?php echo _('Song Title'); ?></label><br /> - <?php echo Ajax::observe('typeSongRadio','click',Ajax::action('?page=tag&action=browse&type=song','')); ?> + <?php echo Ajax::observe('typeSongRadio','click',Ajax::action('?page=tag&action=browse_type&type=song','')); ?> <input id="typeAlbumRadio" type="radio" name="object_type" value="1" /> <label id="typeAlbumLabel" for="typeAlbumRadio"><?php echo _('Albums'); ?></label><br /> - <?php echo Ajax::observe('typeAlbumRadio','click',Ajax::action('?page=tag&action=browse&type=album','')); ?> + <?php echo Ajax::observe('typeAlbumRadio','click',Ajax::action('?page=tag&action=browse_type&type=album','')); ?> <input id="typeArtistRadio" type="radio" name="object_type" value="1" /> <label id="typeArtistLabel" for="typeArtistRadio"><?php echo _('Artist'); ?></label><br /> - <?php echo Ajax::observe('typeArtistRadio','click',Ajax::action('?page=tag&action=browse&type=artist','')); ?> + <?php echo Ajax::observe('typeArtistRadio','click',Ajax::action('?page=tag&action=browse_type&type=artist','')); ?> <?php } ?> </div> </li> |