We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 6f003fea authored by Mike Sheldon's avatar Mike Sheldon

Add page to users profile for displaying the recommended radio station

parent 728fea46
......@@ -7,6 +7,7 @@ RewriteRule ^user/([^/]+)/groups/?$ user-groups.php?
RewriteRule ^user/([^/]+)/recent-tracks/?$ user-recent-tracks.php?user=$1 [B,NC,QSA]
RewriteRule ^user/([^/]+)/stats/?$ user-stats.php?user=$1 [B,NC]
RewriteRule ^user/([^/]+)/station/?$ user-station.php?user=$1 [B,NC]
RewriteRule ^user/([^/]+)/recommended/?$ user-recommended.php?user=$1 [B,NC]
RewriteRule ^artist/([^/]+)/track/([^/]+)/?$ track.php?artist=$1&track=$2 [B,NC]
RewriteRule ^artist/([^/]+)/album/([^/]+)/track/([^/]+)/?$ track.php?artist=$1&album=$2&track=$3 [B,NC]
RewriteRule ^artist/([^/]+)/album/add/?$ album-add.php?artist=$1 [B,NC]
......
......@@ -28,9 +28,10 @@ function user_menu($user, $active_page) {
);
if($user->hasLoved()) {
$submenu[] = array('name' => 'Radio Station', 'url' => $user->getURL('station'));
$submenu[] = array('name' => 'Recommended', 'url' => $user->getURL('recommended'));
}
if($user->name == $this_user->name) {
$submenu[] = array('name' => 'Edit Profile', 'url' => $user->getURL('edit'));
$submenu[] = array('name' => 'Edit', 'url' => $user->getURL('edit'));
}
foreach ($submenu as &$item) {
......
<?php
/* GNU FM -- a free network service for sharing your music listening habits
Copyright (C) 2009 Free Software Foundation, Inc
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
require_once('database.php');
require_once('user-menu.php');
require_once('templating.php');
require_once('data/User.php');
require_once('data/TagCloud.php');
require_once('data/Server.php');
if(!isset($_GET['user']) && $logged_in == false) {
$smarty->assign('pageheading', 'Error!');
$smarty->assign('details', 'User not set! You shouldn\'t be here!');
$smarty->display('error.tpl');
die();
}
try {
$user = new User(urldecode($_GET['user']));
} catch (exception $e) {
$error = 'User not found';
}
if(isset($user->name)) {
$smarty->assign('me', $user);
$smarty->assign('pagetitle', $user->name . '\'s Recommended Artists');
$station = 'librefm://user/' . $user->name . '/recommended';
if(isset($this_user)) {
$radio_session = $this_user->getRadioSession($station);
} else {
$radio_session = Server::getRadioSession($station);
}
$smarty->assign('radio_session', $radio_session);
$submenu = user_menu($user, 'Recommended');
$smarty->assign('submenu', $submenu);
$smarty->assign('headerfile', 'maxiprofile.tpl');
$smarty->display('user-recommended.tpl');
} else {
$smarty->assign('pageheading', $error);
$smarty->assign('details', 'Shall I call in a missing persons report?');
$smarty->display('error.tpl');
}
?>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment