mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 19:41:55 +02:00
fix url to song, and throw some non-working tag cloud crap in
This commit is contained in:
parent
0a506696ac
commit
02f8bb52fd
9 changed files with 56 additions and 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');
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 = '';
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
25
templates/browse_content.inc.php
Normal file
25
templates/browse_content.inc.php
Normal file
|
@ -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(); ?>
|
|
@ -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(); ?>
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue