diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-12 02:52:50 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2008-05-12 02:52:50 +0000 |
commit | 693e26e2ad074f8cc9d37098a0568cd93ae30f52 (patch) | |
tree | 8588523335a337d0971df768da0456e325bb6b66 /templates | |
parent | 003619c52c0370f03b9edb466addaaebac13ce41 (diff) | |
download | ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.tar.gz ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.tar.bz2 ampache-693e26e2ad074f8cc9d37098a0568cd93ae30f52.zip |
commit of the patches from codeoverload to implement tagging, will not work without manual modification of database, yes.. this commit breaks things cope
Diffstat (limited to 'templates')
-rw-r--r-- | templates/show_album.inc.php | 23 | ||||
-rw-r--r-- | templates/show_artist.inc.php | 17 | ||||
-rw-r--r-- | templates/show_artist_box.inc.php | 14 | ||||
-rw-r--r-- | templates/show_song.inc.php | 12 | ||||
-rw-r--r-- | templates/show_song_row.inc.php | 6 | ||||
-rw-r--r-- | templates/show_songs.inc.php | 9 |
6 files changed, 69 insertions, 12 deletions
diff --git a/templates/show_album.inc.php b/templates/show_album.inc.php index 96539167..bc7287a5 100644 --- a/templates/show_album.inc.php +++ b/templates/show_album.inc.php @@ -46,8 +46,24 @@ $title = scrub_out($album->name) . ' (' . $album->year . ')' . $disk .'&nb <?php Rating::show($album->id,'album'); ?> </div> <div id="information_actions"> + + <h3><?php echo _('Actions'); ?>:</h3> <ul> + <li>Tags: + <?php + $tags = TagCloud::get_tags('album', array($album->id)); + foreach($tags as $i) + echo ($i['name']) . ' '; + ?> + </li> + <li> + <form type=POST action=coin> +<?php +echo Ajax::text('?page=tag&action=add&type=album&id=' . $album->id . "&val='+document.getElementById('tagname').value+'", _("Add tag"), 'tag_album'); +?> +<input type="text" size="10" maxlength="10" id="tagname"></input></form> +</li> <li><?php echo Ajax::text('?action=basket&type=album&id=' . $album->id,_('Add Album'),'play_full_' . $album->id); ?></li> <li><?php echo Ajax::text('?action=basket&type=album_random&id=' . $album->id,_('Add Random from Album'),'play_random_' . $album->id); ?></li> <?php if ($GLOBALS['user']->has_access('75')) { ?> @@ -70,9 +86,8 @@ $title = scrub_out($album->name) . ' (' . $album->year . ')' . $disk .'&nb </div> <?php - $object_ids = $album->get_songs(); Browse::set_type('song'); - Browse::set_static_content(1); - Browse::save_objects($object_ids); - Browse::show_objects($object_ids); + Browse::set_filter('album', $album->id); + Browse::get_objects(); + Browse::show_objects(); ?> diff --git a/templates/show_artist.inc.php b/templates/show_artist.inc.php index 2bbb9cf5..cbb38ce0 100644 --- a/templates/show_artist.inc.php +++ b/templates/show_artist.inc.php @@ -22,12 +22,19 @@ $web_path = Config::get('web_path'); require Config::get('prefix') . '/templates/show_artist_box.inc.php'; - +//require Config::get('prefix') . '/templates/show_artist_tagcloud.inc.php'; ?> -<?php +<?php Browse::reset_filters(); Browse::set_type('album'); - Browse::set_static_content(1); - Browse::save_objects($albums); - Browse::show_objects($albums); + //Browse::set_filter('artist', $artist->id); + Browse::set_filter_from_request($_REQUEST); + $objs = Browse::get_objects(); + if (sizeof($objs)) { + $tagcloudHead = _('Tags for albums of') . ' ' . $artist->f_name; + $taglist = TagCloud::get_tags('album', $objs); + $tagcloudList = TagCloud::filter_with_prefs($taglist); + require Config::get('prefix') . '/templates/show_tagcloud.inc.php'; + } + Browse::show_objects(); ?> diff --git a/templates/show_artist_box.inc.php b/templates/show_artist_box.inc.php index 07307d8e..7968eb11 100644 --- a/templates/show_artist_box.inc.php +++ b/templates/show_artist_box.inc.php @@ -29,8 +29,22 @@ if (Config::get('ratings')) { show_rating($artist->id, 'artist'); echo "</div>"; } // end if ratings ?> + <strong><?php echo _('Actions'); ?>:</strong> <div id="information_actions"> +Tags: + <?php + $tags = TagCloud::get_tags('artist', array($artist->id)); + foreach($tags as $i) + echo ($i['name']) . ' '; + ?> + <br/> +<form type=POST action=coin> +<?php +echo Ajax::text('?page=tag&action=add&type=artist&id=' . $artist->id . "&val='+document.getElementById('tagname').value+'", _("Add tag"), 'tag_artist'); +?> +<input type="text" size="10" maxlength="10" id="tagname"></input></form> + <a href="<?php echo $web_path; ?>/artists.php?action=show_all_songs&artist=<?php echo $artist->id; ?>"><?php echo _("Show All Songs By") . " " . $artist->f_name; ?></a><br /> <?php echo Ajax::text('?action=basket&type=artist&id=' . $artist->id,_('Add All Songs By') . ' ' . $artist->f_name,'play_full_artist'); ?><br /> <?php echo Ajax::text('?action=basket&type=artist_random&id=' . $artist->id,_('Add Random Songs By') . ' ' . $artist->f_name,'play_random_artist'); ?><br /> diff --git a/templates/show_song.inc.php b/templates/show_song.inc.php index 260a37b4..d1c5dbe3 100644 --- a/templates/show_song.inc.php +++ b/templates/show_song.inc.php @@ -53,7 +53,17 @@ $rowparity = flip_class(); echo "<dt class=\"".$rowparity."\">" . _($key) . "</dt><dd class=\"".$rowparity."\">" . $value . "</dd>"; } - }?> + } + echo '<dt> Tags </dt><dd>'; + $tags = TagCloud::get_tags('song', array($song->id)); + foreach($tags as $i) + echo $i['name'] . ' '; + ?><form type=POST action=coin> + <?php + echo Ajax::text('?page=tag&action=add&type=song&id=' . $song->id . "&val='+document.getElementById('tagname').value+'", _("Add tag"), 'tag_artist'); + ?> + <input type="text" size="10" maxlength="10" id="tagname"></input></form> + </dd> </dl> <?php show_box_bottom(); ?> diff --git a/templates/show_song_row.inc.php b/templates/show_song_row.inc.php index 1dc3d1ed..29a37988 100644 --- a/templates/show_song_row.inc.php +++ b/templates/show_song_row.inc.php @@ -31,6 +31,12 @@ <?php if (Config::get('ratings')) { ?> <td class="cel_rating" id="rating_<?php echo $song->id; ?>_song"><?php Rating::show($song->id,'song'); ?></td> <?php } ?> +<td class="cel_tags"><?php +global $tag_cache; +$tags = $tag_cache[intval($song->id)]; //TagCloud::get_tags('song', array($song->id)); +foreach($tags as $i) + echo $i['name'] . ' '; +?></td> <td class="cel_action"> <?php if (Config::get('shoutbox')) { ?> <a href="<?php echo Config::get('web_path'); ?>/shout.php?action=show_add_shout&type=song&id=<?php echo $song->id; ?>"> diff --git a/templates/show_songs.inc.php b/templates/show_songs.inc.php index 2e3c3579..54ead654 100644 --- a/templates/show_songs.inc.php +++ b/templates/show_songs.inc.php @@ -44,12 +44,16 @@ $ajax_url = Config::get('ajax_url'); <th class="cel_genre"><?php echo _('Genre'); ?></th> <th class="cel_track"><?php echo Ajax::text('?page=browse&action=set_sort&sort=track',_('Track'),'sort_song_track'); ?></th> <th class="cel_time"><?php echo Ajax::text('?page=browse&action=set_sort&sort=time',_('Time'),'sort_song_time'); ?></th> -<?php if (Config::get('ratings')) { ?> +<?php if (Config::get('ratings')) { + Rating::build_cache('song', $object_ids); + ?> <th class="cel_rating"><?php echo _('Rating'); ?></th> <?php } ?> + <th class="cel_tags"><?php echo _('Tags'); ?></th> <th class="cel_action"><?php echo _('Action'); ?></th> </tr> -<?php +<?php + Song::build_cache($object_ids); foreach ($object_ids as $song_id) { $song = new Song($song_id); $song->format(); @@ -74,6 +78,7 @@ $ajax_url = Config::get('ajax_url'); <?php if (Config::get('ratings')) { ?> <th class="cel_rating"><?php echo _('Rating'); ?></th> <?php } ?> + <th class="cel_tags"><?php echo _('Tags'); ?></th> <th class="cel_action"><?php echo _('Action'); ?></th> </tr> </table> |