[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1044] Beginning to apply some naming conventions to t
From: |
Toby Inkster |
Subject: |
[Librefm-commits] [1044] Beginning to apply some naming conventions to the files involved |
Date: |
Thu, 30 Apr 2009 08:27:07 +0000 |
Revision: 1044
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1044
Author: tobyink
Date: 2009-04-30 08:27:07 +0000 (Thu, 30 Apr 2009)
Log Message:
-----------
Beginning to apply some naming conventions to the files involved
in user profiles/info, because this area is bound to expand soon.
Modified Paths:
--------------
trunk/nixtape/.htaccess
trunk/nixtape/data/Server.php
trunk/nixtape/data/User.php
trunk/nixtape/themes/librefm/templates/miniprofile.tpl
Added Paths:
-----------
trunk/nixtape/themes/librefm/templates/user-edit.tpl
trunk/nixtape/themes/librefm/templates/user-journal.tpl
trunk/nixtape/themes/librefm/templates/user-profile.tpl
trunk/nixtape/user-edit.php
trunk/nixtape/user-journal.php
trunk/nixtape/user-profile.php
Removed Paths:
-------------
trunk/nixtape/edit_profile.php
trunk/nixtape/journal.php
trunk/nixtape/profile.php
trunk/nixtape/themes/librefm/templates/edit_profile.tpl
trunk/nixtape/themes/librefm/templates/journal.tpl
trunk/nixtape/themes/librefm/templates/profile.tpl
Modified: trunk/nixtape/.htaccess
===================================================================
--- trunk/nixtape/.htaccess 2009-04-30 04:26:18 UTC (rev 1043)
+++ trunk/nixtape/.htaccess 2009-04-30 08:27:07 UTC (rev 1044)
@@ -1,7 +1,9 @@
Options +FollowSymLinks
RewriteEngine on
-RewriteRule ^user/([^/]+)/?$
profile.php?user=$1 [B,NC]
+RewriteRule ^user/([^/]+)/?$
user-profile.php?user=$1 [B,NC]
+RewriteRule ^user/([^/]+)/journal?$
user-journal.php?user=$1 [B,NC]
+RewriteRule ^user/([^/]+)/groups?$
user-groups.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/([^/]+)/?$
album.php?artist=$1&album=$2 [B,NC]
Modified: trunk/nixtape/data/Server.php
===================================================================
--- trunk/nixtape/data/Server.php 2009-04-30 04:26:18 UTC (rev 1043)
+++ trunk/nixtape/data/Server.php 2009-04-30 08:27:07 UTC (rev 1044)
@@ -266,50 +266,62 @@
* @param string $username The username we want a URL for
* @return A string containing URL to the user's profile
*/
- static function getUserURL($username) {
+ static function getUserURL ($username, $component)
+ {
global $friendly_urls, $base_url;
- if($friendly_urls) {
- return $base_url . "/user/" .
urlencode(stripslashes($username));
- } else {
- return $base_url . "/profile.php?user=" .
urlencode(stripslashes($username));
+ if ($component == 'edit')
+ {
+ return $base_url . "/user-edit.php";
}
+ elseif($friendly_urls)
+ {
+ if ($component == 'profile')
+ $component = '';
+ else
+ $component = "/{$component}";
+ return $base_url . "/user/" . urlencode($username) .
$component;
+ }
+ else
+ {
+ return $base_url . "/user-{$component}.php?user=" .
urlencode($username);
+ }
}
static function getGroupURL($groupname) {
global $friendly_urls, $base_url;
if($friendly_urls) {
- return $base_url . "/group/" .
urlencode(stripslashes($groupname));
+ return $base_url . "/group/" . urlencode($groupname);
} else {
- return $base_url . "/group.php?group=" .
urlencode(stripslashes($groupname));
+ return $base_url . "/group.php?group=" .
urlencode($groupname);
}
}
static function getArtistURL($artist) {
global $friendly_urls, $base_url;
if($friendly_urls) {
- return $base_url . "/artist/" .
urlencode(stripslashes($artist));
+ return $base_url . "/artist/" . urlencode($artist);
} else {
- return $base_url . "/artist.php?artist=" .
urlencode(stripslashes($artist));
+ return $base_url . "/artist.php?artist=" .
urlencode($artist);
}
}
static function getAlbumURL($artist, $album) {
global $friendly_urls, $base_url;
if($friendly_urls) {
- return $base_url . "/artist/" .
urlencode(stripslashes($artist)) . "/album/" . urlencode(stripslashes($album));
+ return $base_url . "/artist/" . urlencode($artist) .
"/album/" . urlencode($album);
} else {
- return $base_url . "/album.php?artist=" .
urlencode(stripslashes($artist)) . "&album=" . urlencode(stripslashes($album));
+ return $base_url . "/album.php?artist=" .
urlencode($artist) . "&album=" . urlencode($album);
}
}
static function getTrackURL($artist, $album, $track) {
global $friendly_urls, $base_url;
if ($friendly_urls && $album) {
- return $base_url . "/artist/" .
urlencode(stripslashes($artist)) . "/album/" . urlencode(stripslashes($album))
. "/track/" . urlencode(stripslashes($track));
+ return $base_url . "/artist/" . urlencode($artist) .
"/album/" . urlencode($album) . "/track/" . urlencode($track);
} elseif ($friendly_urls) {
- return $base_url . "/artist/" .
urlencode(stripslashes($artist)) . "/track/" . urlencode(stripslashes($track));
+ return $base_url . "/artist/" . urlencode($artist) .
"/track/" . urlencode($track);
} else {
- return $base_url . "/track.php?artist=" .
urlencode(stripslashes($artist)) . "&album=" .
urlencode(stripslashes($album)) . "&track=" . urlencode(stripslashes($track));
+ return $base_url . "/track.php?artist=" .
urlencode($artist) . "&album=" . urlencode($album) . "&track=" .
urlencode($track);
}
}
Modified: trunk/nixtape/data/User.php
===================================================================
--- trunk/nixtape/data/User.php 2009-04-30 04:26:18 UTC (rev 1043)
+++ trunk/nixtape/data/User.php 2009-04-30 08:27:07 UTC (rev 1044)
@@ -149,8 +149,8 @@
return "http://www.gravatar.com/avatar/" . md5($this->email) .
"?s=" . $size . "&d=monsterid";
}
- function getURL() {
- return Server::getUserURL($this->name);
+ function getURL($component='profile') {
+ return Server::getUserURL($this->name, $component);
}
/**
Deleted: trunk/nixtape/edit_profile.php
===================================================================
--- trunk/nixtape/edit_profile.php 2009-04-30 04:26:18 UTC (rev 1043)
+++ trunk/nixtape/edit_profile.php 2009-04-30 08:27:07 UTC (rev 1044)
@@ -1,165 +0,0 @@
-<?php
-
-/* Libre.fm -- a free network service for sharing your music listening habits
-
- Copyright (C) 2009 Libre.fm Project
-
- 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('templating.php');
-require_once('data/User.php');
-require_once('data/TagCloud.php');
-
-if($logged_in == false)
-{
- $smarty->assign('error', 'Error!');
- $smarty->assign('details', 'Not logged in! You shouldn\'t be here!');
- $smarty->display('error.tpl');
- die();
-}
-
-# Doesn't seem to work - $user = $_SESSION['user'];
-$user = new User($_SESSION['user']->name);
-
-$errors = array();
-
-if ($_POST['submit'])
-{
- if (!empty($_POST['id']))
- {
- # Need better URI validation, but this will do for now. I think
- # PEAR has a suitable module to help out here.
- if ( !preg_match('/^[a-z0-9\+\.\-]+\:/i', $_POST['id']) )
- $errors[] = "WebID must be a URI.";
- if ( preg_match('/\s/', $_POST['id']) )
- $errors[] = "WebID must be a URI. Valid URIs cannot
contain whitespace.";
- }
-
- if (!empty($_POST['homepage']))
- {
- # Need better URI validation, but this will do for now. I think
- # PEAR has a suitable module to help out here.
- if ( !preg_match('/^[a-z0-9\+\.\-]+\:/i', $_POST['homepage']) )
- $errors[] = "Homepage must be a URI.";
- if ( preg_match('/\s/', $_POST['homepage']) )
- $errors[] = "Homepage must be a URI. Valid URIs cannot
contain whitespace.";
- }
-
- if (!empty($_POST['avatar_uri']))
- {
- # Need better URI validation, but this will do for now. I think
- # PEAR has a suitable module to help out here.
- if ( !preg_match('/^[a-z0-9\+\.\-]+\:/i', $_POST['avatar_uri'])
)
- $errors[] = "Avatar must be a URI.";
- if ( preg_match('/\s/', $_POST['avatar_uri']) )
- $errors[] = "Avatar must be a URI. Valid URIs cannot
contain whitespace.";
- }
-
- if (!empty($_POST['password_1']))
- {
- if ($_POST['password_1'] != $_POST['password_2'])
- $errors[] = "Passwords do not match.";
- }
-
- if (!empty($_POST['location_uri']))
- {
- # Currently only allow geonames URIs, but there's no reason we
can't accept
- # others at some point in the future. (e.g. dbpedia)
- if ( !preg_match('/^http:\/\/sws.geonames.org\/[0-9]+\/$/',
$_POST['location_uri']) )
- $errors[] = "This should be a geonames.org semantic web
service URI.";
- }
-
- if (!isset($errors[0]))
- {
- # Currently we don't allow them to change e-mail as we probably
should
- # have some kind of confirmation login to do so.
- $user->id = $_POST['id'];
- $user->fullname = $_POST['fullname'];
- $user->homepage = $_POST['homepage'];
- $user->bio = $_POST['bio'];
- $user->location = $_POST['location'];
- $user->location_uri = $_POST['location_uri'];
- $user->avatar_uri = $_POST['avatar_uri'];
-
- if (!empty( $_POST['password_1'] ))
- $user->password = md5($_POST['password_1']);
-
- $user->save();
-
- header("Location: " . $base_url . "/user/" . $user->name);
- exit;
- }
-
- if (isset($errors[0]))
- {
- header("Content-Type: text/plain");
- print_r($errors);
- exit;
- }
-}
-
-if(isset($user->name))
-{
- # Stuff which cannot be changed.
- $smarty->assign("acctid", $user->acctid);
- $smarty->assign('avatar', $user->getAvatar());
- $smarty->assign('user', $user->name);
-
- # Stuff which cannot be changed *here*
- $smarty->assign('userlevel', $user->userlevel);
-
- # Stuff which cannot be changed *yet*
- $smarty->assign('email', $user->email);
-
- if ($_POST['submit'])
- {
- $smarty->assign("id", $_POST['id']);
- $smarty->assign('fullname', $_POST['fullname']);
- $smarty->assign('bio', $_POST['bio']);
- $smarty->assign('homepage', $_POST['homepage']);
- $smarty->assign('location', $_POST['location']);
- $smarty->assign('location_uri', $_POST['location_uri']);
- $smarty->assign('avatar_uri', $_POST['avatar_uri']);
- }
- else
- {
- $smarty->assign("id", ($user->webid_uri));
- $smarty->assign('fullname', ($user->fullname));
- $smarty->assign('bio', ($user->bio));
- $smarty->assign('homepage', ($user->homepage));
- $smarty->assign('location', ($user->location));
- $smarty->assign('location_uri', ($user->location_uri));
- $smarty->assign('avatar_uri', ($user->avatar_uri));
- }
-
- # And display the page.
- $aTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist');
- if (!PEAR::isError ($aTagCloud))
- {
- $smarty->assign('tagcloud', $aTagCloud);
- }
- $smarty->assign('errors', $errors);
- $smarty->display('edit_profile.tpl');
-}
-
-else
-{
- $smarty->assign('error', 'User not found');
- $smarty->assign('details', 'Shall I call in a missing persons report?
This shouldn\'t happen.');
- $smarty->display('error.tpl');
-}
-
Deleted: trunk/nixtape/journal.php
===================================================================
--- trunk/nixtape/journal.php 2009-04-30 04:26:18 UTC (rev 1043)
+++ trunk/nixtape/journal.php 2009-04-30 08:27:07 UTC (rev 1044)
@@ -1,101 +0,0 @@
-<?php
-
-/* Libre.fm -- a free network service for sharing your music listening habits
-
- Copyright (C) 2009 Libre.fm Project
-
- 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('templating.php');
-require_once('data/User.php');
-require_once('data/TagCloud.php');
-require_once('data/Server.php');
-require_once('utils/arc/ARC2.php');
-require_once('utils/human-time.php');
-
-if(!isset($_GET['user']) && $logged_in == false) {
- $smarty->assign('error', 'Error!');
- $smarty->assign('details', 'User not set! You shouldn\'t be here!');
- $smarty->display('error.tpl');
- die();
-}
-
-$user = new User($_GET['user']);
-
-# We need to get this from account profile really. This is just hard-coded for
experimenting.
-if ($user->name == 'tobyink')
- $rssFeed = 'http://identi.ca/tobyink/rss';
-
-if ($rssFeed)
-{
- # We have to implement HTTP caching here!
- $parser = ARC2::getRDFParser();
- $parser->parse($rssFeed);
-
- $index = $parser->getSimpleIndex();
- krsort($index); // Newest last.
- $items = array();
- foreach ($index as $subject => $data)
- {
- if (in_array('http://purl.org/rss/1.0/item',
$data['http://www.w3.org/1999/02/22-rdf-syntax-ns#type']))
- {
- $ts = strtotime($data[
'http://purl.org/dc/elements/1.1/date' ][0]);
- $items[] = array(
- 'subject_uri' => $subject,
- 'title' => $data[
'http://purl.org/rss/1.0/title' ][0],
- 'link' => $data[ 'http://purl.org/rss/1.0/link'
][0],
- 'date_iso' => $data[
'http://purl.org/dc/elements/1.1/date' ][0],
- 'date_unix' => $ts,
- 'date_human' => human_timestamp($ts)
- );
- }
- }
-
- $smarty->assign("id", $user->id);
- $smarty->assign("acctid", $user->acctid);
- $smarty->assign('user', $user->name);
- $smarty->assign('email', $user->email);
- $smarty->assign('fullname', $user->fullname);
- $smarty->assign('bio', $user->bio);
- $smarty->assign('homepage', $user->homepage);
- $smarty->assign('location', $user->location);
- $smarty->assign('location_uri', $user->location_uri);
- $smarty->assign('geo', Server::getLocationDetails($user->location_uri));
- $smarty->assign('userlevel', $user->userlevel);
- $smarty->assign('avatar', $user->getAvatar());
- $aUserTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40,
$user->name);
- if (!PEAR::isError ($aUserTagCloud)) {
- $smarty->assign('user_tagcloud',$aUserTagCloud);
- }
- $smarty->assign('isme', ($_SESSION['user']->name == $user->name));
- $smarty->assign('profile', true);
- $smarty->assign('items', $items);
- $smarty->assign('extra_head_links', array(
- array(
- 'rel'=>'alternate',
- 'type' => 'application/rss+xml' ,
- 'title' => 'RSS 1.0 Feed (Journal)',
- 'href' =>
$base_url.'/rdf.php?fmt=rss&page='.htmlentities($_SERVER['REQUEST_URI'])
- )
- ));
- $smarty->display('journal.tpl');
-
-} else {
- $smarty->assign('error', 'No RSS Feed for this User');
- $smarty->assign('details', 'Shall I call in a missing feeds report?');
- $smarty->display('error.tpl');
-}
Deleted: trunk/nixtape/profile.php
===================================================================
--- trunk/nixtape/profile.php 2009-04-30 04:26:18 UTC (rev 1043)
+++ trunk/nixtape/profile.php 2009-04-30 08:27:07 UTC (rev 1044)
@@ -1,89 +0,0 @@
-<?php
-
-/* Libre.fm -- a free network service for sharing your music listening habits
-
- Copyright (C) 2009 Libre.fm Project
-
- 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('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('error', 'Error!');
- $smarty->assign('details', 'User not set! You shouldn\'t be here!');
- $smarty->display('error.tpl');
- die();
-}
-
-$user = new User($_GET['user']);
-
-if(isset($user->name)) {
- $smarty->assign("id", $user->id);
- $smarty->assign("acctid", $user->acctid);
- $smarty->assign('user', $user->name);
- $smarty->assign('email', $user->email);
- $smarty->assign('fullname', $user->fullname);
- $smarty->assign('bio', $user->bio);
- $smarty->assign('homepage', $user->homepage);
- $smarty->assign('location', $user->location);
- $smarty->assign('location_uri', $user->location_uri);
- $smarty->assign('geo', Server::getLocationDetails($user->location_uri));
- $aUserScrobbles = $user->getScrobbles(20);
- if (!PEAR::isError ($aUserScrobbles)) {
- $smarty->assign('scrobbles', $aUserScrobbles);
- }
- $smarty->assign('userlevel', $user->userlevel);
- $smarty->assign('avatar', $user->getAvatar());
- $aUserNowPlaying = $user->getNowPlaying(10);
- if (!PEAR::isError ($aUserNowPlaying)) {
- $smarty->assign('nowplaying', $aUserNowPlaying);
- }
- $aUserTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40,
$user->name);
- if (!PEAR::isError ($aUserTagCloud)) {
- $smarty->assign('user_tagcloud',$aUserTagCloud);
- }
- $smarty->assign('isme', ($_SESSION['user']->name == $user->name));
- $smarty->assign('profile', true);
-
- $smarty->assign('extra_head_links', array(
- array(
- 'rel'=>'alternate',
- 'type' => 'application/rss+xml' ,
- 'title' => 'RSS 1.0 Feed (Recent plays)',
- 'href' =>
$base_url.'/rdf.php?fmt=rss&page='.htmlentities($_SERVER['REQUEST_URI'])
- ),
- array(
- 'rel' => 'meta',
- 'type' => 'application/rdf+xml' ,
- 'title' => 'FOAF',
- 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.htmlentities($_SERVER['REQUEST_URI'])
- )
- ));
-
- $smarty->assign('toptracks', $user->getTopTracks());
-
- $smarty->display('profile.tpl');
-} else {
- $smarty->assign('error', 'User not found');
- $smarty->assign('details', 'Shall I call in a missing persons report?');
- $smarty->display('error.tpl');
-}
-
-?>
Deleted: trunk/nixtape/themes/librefm/templates/edit_profile.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/edit_profile.tpl 2009-04-30
04:26:18 UTC (rev 1043)
+++ trunk/nixtape/themes/librefm/templates/edit_profile.tpl 2009-04-30
08:27:07 UTC (rev 1044)
@@ -1,91 +0,0 @@
-{include file='header.tpl'}
-
-<h2 property="dc:title">Edit your profile</h2>
-
-<p><strong>The form below is still <em>very</em> experimental. Using this may
wreck your account!</strong></p>
-
-<form action="{$base_url}/edit_profile.php" method="post" class="notcrazy">
- <table>
- <tr>
- <th align="right" valign="top"><label
for="fullname">Full name:</label></th>
- <td><input name="fullname" id="fullname"
value="{$fullname|escape:'html':'UTF-8'}" /></td>
- <td> </td>
- </tr>
- <tr>
- <th align="right" valign="top"><label
for="location">Location:</label></th>
- <td><input name="location" id="location"
value="{$location|escape:'html':'UTF-8'}" /></td>
- <td> </td>
- </tr>
- <tr>
- <th align="right" valign="top"><label
for="location_uri">Geoname:</label></th>
- <td id="chooser">
- <input type="hidden" name="location_uri"
id="location_uri" value="{$location_uri|escape:'html':'UTF-8'}" />
- <input type="button" value="Find ..."
onclick="LocationCheck();" />
- <span id="location_uri_label"></span>
- </td>
- <td><a href="#dfn_location_uri" rel="glossary">What's
this?</a></td>
- </tr>
- <tr>
- <th align="right" valign="top"><label
for="homepage">Homepage URL:</label></th>
- <td><input name="homepage" id="homepage"
value="{$homepage|escape:'html':'UTF-8'}" /></td>
- <td> </td>
- </tr>
- <tr>
- <th align="right" valign="top"><label
for="avatar_uri">Avatar URL:</label></th>
- <td><input name="avatar_uri" id="avatar_uri"
value="{$avatar_uri|escape:'html':'UTF-8'}" /></td>
- <td><a href="#dfn_avatar_uri" rel="glossary">What's
this?</a></td>
- </tr>
- <tr>
- <th align="right" valign="top"><label for="bio">Mini
Biography:</label></th>
- <td><textarea name="bio" id="bio" rows="6" cols="30"
style="width:100%;min-width:20em">{$bio|escape:'html':'UTF-8'}</textarea></td>
- <td> </td>
- </tr>
- <tr>
- <th align="right" valign="top"><label for="id">WebID
(FOAF):</label></th>
- <td>
- <input name="id" id="id"
value="{$id|escape:'html':'UTF-8'}" />
- <input type="button" onclick="webidLookup();"
value="find!" />
- </td>
- <td><a href="#dfn_id" rel="glossary">What's
this?</a></td>
- </tr>
- <tr>
- <th align="right" valign="top"><label
for="password_1">Password:</label></th>
- <td><input name="password_1" id="password_1"
type="password" value="" /></td>
- <td rowspan="2">Leave this blank if you don't want to
change your password.</td>
- </tr>
- <tr>
- <th align="right" valign="top"><label
for="password_2">Confirm Password:</label></th>
- <td><input name="password_2" id="password_2"
type="password" value="" /></td>
- </tr>
- <tr>
- <td colspan="3" align="center">
- <input type="submit" value="Change" />
- <input name="submit" value="1" type="hidden" />
- </td>
- </tr>
- </table>
-</form>
-
-<script type="text/javascript"
src="{$base_url}/js/jquery-1.3.2.min.js"></script>
-<script type="text/javascript" src="{$base_url}/js/edit_profile.js"></script>
-
-<h3>Help</h3>
-<dl>
- <dt id="dfn_location_uri">Location check</dt>
- <dd>This feature looks up your location on <a
href="http://www.geonames.org"
- >geonames</a>. You don't need to do it, but it will help us find your
- latitude and longitude, which will help us add some great location-based
- features in the future.</dd>
-
- <dt id="dfn_avatar_uri">Avatar URL</dt>
- <dd>The web address for a picture to represent you on libre.fm. It
should
- not be more than 80x80 pixels. (64x64 is best.) If you leave this
empty, libre.fm will
- use <a href="http://gravatar.com">Gravatar</a> to find an image for
you.</dd>
-
- <dt id="dfn_id">WebID (FOAF)</dt>
- <dd>A URI that represents you in RDF. See <a
href="http://esw.w3.org/topic/WebID"
- >WebID</a> for details. If you don't know what this is, it's best to
leave it
- blank.</dd>
-</dl>
-
-{include file='footer.tpl'}
Deleted: trunk/nixtape/themes/librefm/templates/journal.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/journal.tpl 2009-04-30 04:26:18 UTC
(rev 1043)
+++ trunk/nixtape/themes/librefm/templates/journal.tpl 2009-04-30 08:27:07 UTC
(rev 1044)
@@ -1,44 +0,0 @@
-{include file='header.tpl'}
-
-<h2 property="dc:title">{$user|escape:'html':'UTF-8'}'{if $user|substr:-1 !=
's'}s{/if} journal</h2>
-
-{include file='maxiprofile.tpl'}
-
-<ul about="{$id}" rel="foaf:made" rev="foaf:maker" class="hfeed">
-{foreach from=$items item=i}
- <li {if $i.subject_uri}about="{$i.subject_uri|escape:'html':'UTF-8'}"
{/if}typeof="sioc:Item rss:item" class="hentry">
- <b class="entry-title"
property="dc:title">{$i.title|escape:'html':'UTF-8'}</b><br />
- <a property="rss:item" rel="bookmark sioc:link"
href="{$i.link|escape:'html':'UTF-8'}">{$i.link|escape:'html':'UTF-8'}</a>
- <abbr class="published" property="dc:date"
content="{$i.date_iso}" title="{$i.date_iso}">{$i.date_human}</abbr>
- </li>
-{/foreach}
-</ul>
-
-<!-- Column break -->
-</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
-
-<h3>{$user}'{if $user|substr:-1 != 's'}s{/if} top artists</h3>
-<ul class="tagcloud" about="{$id}">
- {section name=i loop=$user_tagcloud}
- <li style="font-size:{$user_tagcloud[i].size}"><a
- href="{$user_tagcloud[i].pageurl|escape:'html':'UTF-8'}" rel="{if
$user_tagcloud[i].size|substr:-5 ==
- 'large'}foaf:interest
{/if}tag">{$user_tagcloud[i].artist|escape:"html":"UTF-8"}</a></li>
- {/section}
-</ul>
-
- <div id="adbard">
-
- <!--Ad Bard advertisement snippet, begin -->
-
- <script type='text/javascript'>
- var ab_h = '4bcaab930d3bdfded68fd7be730d7db4';
- var ab_s = '55fd9cde6d855a75f9ca43d854272f6b';
- </script>
-
- <script type='text/javascript'
src='http://cdn1.adbard.net/js/ab1.js'></script>
-
- <!--Ad Bard, end -->
-
- </div>
-
-{include file='footer.tpl'}
Modified: trunk/nixtape/themes/librefm/templates/miniprofile.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/miniprofile.tpl 2009-04-30
04:26:18 UTC (rev 1043)
+++ trunk/nixtape/themes/librefm/templates/miniprofile.tpl 2009-04-30
08:27:07 UTC (rev 1044)
@@ -9,7 +9,7 @@
<span class="fn"
property="foaf:name">{$me->fullname|escape:'html':'UTF-8'}</span>
<span rel="foaf:holdsAccount" rev="sioc:account_of">
<span
about="{$me->acctid|escape:'html':'UTF-8'}" typeof="sioc:User">
- (<a class="nickname"
property="foaf:accountName" href="{$base_url}/user/{$me->name}"
rel="foaf:accountProfilePage"
rev="foaf:topic">{$me->name|escape:'html':'UTF-8'}</a>)
+ (<a class="nickname"
property="foaf:accountName" href="{$me->getURL()}"
rel="foaf:accountProfilePage"
rev="foaf:topic">{$me->name|escape:'html':'UTF-8'}</a>)
<span rel="foaf:accountServiceHomepage"
resource="{$base_url}"></span>
</span>
</span>
@@ -27,6 +27,6 @@
<dd class="note"
property="bio:olb">{$me->bio|escape:'html':'UTF-8'}</dd>
</dl>
- <hr style="border: 1px solid transparent; clear: both;" rel="foaf:page"
rev="foaf:primaryTopic" resource="{$base_url}/user/{$me->name}" />
+ <hr style="border: 1px solid transparent; clear: both;" rel="foaf:page"
rev="foaf:primaryTopic" resource="{$me->getURL()}" />
</div>
Deleted: trunk/nixtape/themes/librefm/templates/profile.tpl
===================================================================
--- trunk/nixtape/themes/librefm/templates/profile.tpl 2009-04-30 04:26:18 UTC
(rev 1043)
+++ trunk/nixtape/themes/librefm/templates/profile.tpl 2009-04-30 08:27:07 UTC
(rev 1044)
@@ -1,95 +0,0 @@
-{include file='header.tpl'}
-
-<h2 property="dc:title">{$user|escape:'html':'UTF-8'}'s profile</h2>
-
-{include file='maxiprofile.tpl'}
-
-{if $nowplaying|@count > 0}
-<h3>Now Playing:</h3>
-<!-- We should try to make this list work like the gobbles list. -->
-<dl class='now-playing'>
- {section name=i loop=$nowplaying}
-{if $scrobbles[i].license > 0}
- <dt class='track-name
libre'>{$nowplaying[i].track|escape:'html':'UTF-8'}</dt>
-{else}
- <dt class='track-name'>{$nowplaying[i].track|escape:'html':'UTF-8'}</dt>
-{/if}
- <dd>by <span class='artist-name'><a
href='{$nowplaying[i].artisturl|escape:'html':'UTF-8'}'>{$nowplaying[i].artist|escape:'html':'UTF-8'}</a></span></dd>
- <dd>with <span class='gobbler'>{$nowplaying[i].clientstr}</span></dd>
- {/section}
-</dl>
-{/if}
-
-<div about="[_:seq1]" typeof="rdf:Seq" rev="rss:items">
- <h3 typeof="rss:channel" property="rss:title" rel="rss:link"
resource="#latest_plays" id="latest_plays"
content="{$user|escape:'html':'UTF-8'}'s Latest Plays">Latest
{$scrobbles|@count} Plays:</h3>
-</div>
-
-<ul class="gobbles" about="{$id|escape:'html':'UTF-8'}" rev="gob:user">
-{section name=i loop=$scrobbles}
-
- <li class="play {if $scrobbles[i].license > 0}libre{/if}"
about="{$scrobbles[i].id|escape:'html':'UTF-8'}" typeof="rss:item
gob:ScrobbleEvent" rel="gob:track_played">
- <div about="{$scrobbles[i].id_track|escape:'html':'UTF-8'}"
typeof="mo:Track" class="haudio">
- <div rev="mo:track">
- <div
about="{$scrobbles[i].id_album|escape:'html':'UTF-8'}" typeof="mo:Record"{if
$scrobbles[i].album} property="dc:title"
content="{$scrobbles[i].album|escape:'html':'UTF-8'}"{/if}>
- {if $scrobbles[i].albumurl}<a
rel="foaf:page" href="{$scrobbles[i].albumurl|escape:'html':'UTF-8'}">{/if}
- <span{if
$scrobbles[i].album_image} rel="foaf:depiction"{/if}{if $scrobbles[i].albumurl}
about="{$scrobbles[i].id_album|escape:'html':'UTF-8'}"{/if}>
- <img height="50"
width="50"
- src="{if
!$scrobbles[i].album_image}/i/qm50.png{else}{$scrobbles[i].album_image|escape:'html':'UTF-8'}{/if}"
-
class="albumart{if !$scrobbles[i].album_image} photo{/if}"
- {if
$scrobbles[i].album}title="{$scrobbles[i].album|escape:'html':'UTF-8'}"
alt="Album: {$scrobbles[i].album|escape:'html':'UTF-8'}"{else}alt="Unknown
album"{/if} />
- </span>
- {if $scrobbles[i].albumurl}</a>{/if}
- </div>
- </div>
- <div rel="foaf:maker" class="contributor vcard">
- <a
about="{$scrobbles[i].id_artist|escape:'html':'UTF-8'}" typeof="mo:MusicArtist"
property="foaf:name" rel="foaf:page"
- class="fn url"
href="{$scrobbles[i].artisturl|escape:'html':'UTF-8'}"
-
>{$scrobbles[i].artist|escape:'html':'UTF-8'}</a>
- </div>
- <div><a class="fn" property="dc:title" rel="foaf:page"
href="{$scrobbles[i].trackurl|escape:'html':'UTF-8'}">{$scrobbles[i].track|escape:'html':'UTF-8'}</a></div>
- <small about="{$scrobbles[i].id|escape:'html':'UTF-8'}"
property="dc:date" content="{$scrobbles[i].timeiso}"
datatype="xsd:dateTime">{$scrobbles[i].timehuman}</small>
- <span about="{$scrobbles[i].id|escape:'html':'UTF-8'}"
property="rss:link" content="{$scrobbles[i].trackurl|escape:'html':'UTF-8'}">
- <span property="rss:description" content="{if
$scrobbles[i].album}{$scrobbles[i].album}{else}Unknown album{/if}">
- <span property="rss:title"
content="{$scrobbles[i].artist|escape:'html':'UTF-8'}:
{$scrobbles[i].track|escape:'html':'UTF-8'}"
rev="rdf:_{$smarty.section.i.index_next}" resource="[_:seq1]"></span>
- </span>
- </span>
- </div>
- </li>
-{/section}
-</ul>
-
-<h3>{$user}'s Top Tracks</h3>
-<ul>
-{section name=i loop=$toptracks}
-<li style="width:{$toptracks[i].width}" class="toptrack"><a
href="{$toptracks[i].artisturl}">{$toptracks[i].artist}</a> - <a
href="{$toptracks[i].trackurl}">{$toptracks[i].track}<a></li>
-{/section}
-</ul>
-
-<!-- Column break -->
-</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
-
-<h3>{$user}'s top artists</h3>
-<ul class="tagcloud" about="{$id}">
- {section name=i loop=$user_tagcloud}
- <li style="font-size:{$user_tagcloud[i].size}"><a
- href="{$user_tagcloud[i].pageurl|escape:'html':'UTF-8'}" rel="{if
$user_tagcloud[i].size|substr:-5 ==
- 'large'}foaf:interest
{/if}tag">{$user_tagcloud[i].artist|escape:"html":"UTF-8"}</a></li>
- {/section}
-</ul>
-
- <div id="adbard">
-
- <!--Ad Bard advertisement snippet, begin -->
-
- <script type='text/javascript'>
- var ab_h = '4bcaab930d3bdfded68fd7be730d7db4';
- var ab_s = '55fd9cde6d855a75f9ca43d854272f6b';
- </script>
-
- <script type='text/javascript'
src='http://cdn1.adbard.net/js/ab1.js'></script>
-
- <!--Ad Bard, end -->
-
- </div>
-
-{include file='footer.tpl'}
Copied: trunk/nixtape/themes/librefm/templates/user-edit.tpl (from rev 1043,
trunk/nixtape/themes/librefm/templates/edit_profile.tpl)
===================================================================
--- trunk/nixtape/themes/librefm/templates/user-edit.tpl
(rev 0)
+++ trunk/nixtape/themes/librefm/templates/user-edit.tpl 2009-04-30
08:27:07 UTC (rev 1044)
@@ -0,0 +1,91 @@
+{include file='header.tpl'}
+
+<h2 property="dc:title">Edit your profile</h2>
+
+<p><strong>The form below is still <em>very</em> experimental. Using this may
wreck your account!</strong></p>
+
+<form action="{$base_url}/edit_profile.php" method="post" class="notcrazy">
+ <table>
+ <tr>
+ <th align="right" valign="top"><label
for="fullname">Full name:</label></th>
+ <td><input name="fullname" id="fullname"
value="{$fullname|escape:'html':'UTF-8'}" /></td>
+ <td> </td>
+ </tr>
+ <tr>
+ <th align="right" valign="top"><label
for="location">Location:</label></th>
+ <td><input name="location" id="location"
value="{$location|escape:'html':'UTF-8'}" /></td>
+ <td> </td>
+ </tr>
+ <tr>
+ <th align="right" valign="top"><label
for="location_uri">Geoname:</label></th>
+ <td id="chooser">
+ <input type="hidden" name="location_uri"
id="location_uri" value="{$location_uri|escape:'html':'UTF-8'}" />
+ <input type="button" value="Find ..."
onclick="LocationCheck();" />
+ <span id="location_uri_label"></span>
+ </td>
+ <td><a href="#dfn_location_uri" rel="glossary">What's
this?</a></td>
+ </tr>
+ <tr>
+ <th align="right" valign="top"><label
for="homepage">Homepage URL:</label></th>
+ <td><input name="homepage" id="homepage"
value="{$homepage|escape:'html':'UTF-8'}" /></td>
+ <td> </td>
+ </tr>
+ <tr>
+ <th align="right" valign="top"><label
for="avatar_uri">Avatar URL:</label></th>
+ <td><input name="avatar_uri" id="avatar_uri"
value="{$avatar_uri|escape:'html':'UTF-8'}" /></td>
+ <td><a href="#dfn_avatar_uri" rel="glossary">What's
this?</a></td>
+ </tr>
+ <tr>
+ <th align="right" valign="top"><label for="bio">Mini
Biography:</label></th>
+ <td><textarea name="bio" id="bio" rows="6" cols="30"
style="width:100%;min-width:20em">{$bio|escape:'html':'UTF-8'}</textarea></td>
+ <td> </td>
+ </tr>
+ <tr>
+ <th align="right" valign="top"><label for="id">WebID
(FOAF):</label></th>
+ <td>
+ <input name="id" id="id"
value="{$id|escape:'html':'UTF-8'}" />
+ <input type="button" onclick="webidLookup();"
value="find!" />
+ </td>
+ <td><a href="#dfn_id" rel="glossary">What's
this?</a></td>
+ </tr>
+ <tr>
+ <th align="right" valign="top"><label
for="password_1">Password:</label></th>
+ <td><input name="password_1" id="password_1"
type="password" value="" /></td>
+ <td rowspan="2">Leave this blank if you don't want to
change your password.</td>
+ </tr>
+ <tr>
+ <th align="right" valign="top"><label
for="password_2">Confirm Password:</label></th>
+ <td><input name="password_2" id="password_2"
type="password" value="" /></td>
+ </tr>
+ <tr>
+ <td colspan="3" align="center">
+ <input type="submit" value="Change" />
+ <input name="submit" value="1" type="hidden" />
+ </td>
+ </tr>
+ </table>
+</form>
+
+<script type="text/javascript"
src="{$base_url}/js/jquery-1.3.2.min.js"></script>
+<script type="text/javascript" src="{$base_url}/js/edit_profile.js"></script>
+
+<h3>Help</h3>
+<dl>
+ <dt id="dfn_location_uri">Location check</dt>
+ <dd>This feature looks up your location on <a
href="http://www.geonames.org"
+ >geonames</a>. You don't need to do it, but it will help us find your
+ latitude and longitude, which will help us add some great location-based
+ features in the future.</dd>
+
+ <dt id="dfn_avatar_uri">Avatar URL</dt>
+ <dd>The web address for a picture to represent you on libre.fm. It
should
+ not be more than 80x80 pixels. (64x64 is best.) If you leave this
empty, libre.fm will
+ use <a href="http://gravatar.com">Gravatar</a> to find an image for
you.</dd>
+
+ <dt id="dfn_id">WebID (FOAF)</dt>
+ <dd>A URI that represents you in RDF. See <a
href="http://esw.w3.org/topic/WebID"
+ >WebID</a> for details. If you don't know what this is, it's best to
leave it
+ blank.</dd>
+</dl>
+
+{include file='footer.tpl'}
Copied: trunk/nixtape/themes/librefm/templates/user-journal.tpl (from rev 1043,
trunk/nixtape/themes/librefm/templates/journal.tpl)
===================================================================
--- trunk/nixtape/themes/librefm/templates/user-journal.tpl
(rev 0)
+++ trunk/nixtape/themes/librefm/templates/user-journal.tpl 2009-04-30
08:27:07 UTC (rev 1044)
@@ -0,0 +1,44 @@
+{include file='header.tpl'}
+
+<h2 property="dc:title">{$user|escape:'html':'UTF-8'}'{if $user|substr:-1 !=
's'}s{/if} journal</h2>
+
+{include file='maxiprofile.tpl'}
+
+<ul about="{$id}" rel="foaf:made" rev="foaf:maker" class="hfeed">
+{foreach from=$items item=i}
+ <li {if $i.subject_uri}about="{$i.subject_uri|escape:'html':'UTF-8'}"
{/if}typeof="sioc:Item rss:item" class="hentry">
+ <b class="entry-title"
property="dc:title">{$i.title|escape:'html':'UTF-8'}</b><br />
+ <a property="rss:item" rel="bookmark sioc:link"
href="{$i.link|escape:'html':'UTF-8'}">{$i.link|escape:'html':'UTF-8'}</a>
+ <abbr class="published" property="dc:date"
content="{$i.date_iso}" title="{$i.date_iso}">{$i.date_human}</abbr>
+ </li>
+{/foreach}
+</ul>
+
+<!-- Column break -->
+</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
+
+<h3>{$user}'{if $user|substr:-1 != 's'}s{/if} top artists</h3>
+<ul class="tagcloud" about="{$id}">
+ {section name=i loop=$user_tagcloud}
+ <li style="font-size:{$user_tagcloud[i].size}"><a
+ href="{$user_tagcloud[i].pageurl|escape:'html':'UTF-8'}" rel="{if
$user_tagcloud[i].size|substr:-5 ==
+ 'large'}foaf:interest
{/if}tag">{$user_tagcloud[i].artist|escape:"html":"UTF-8"}</a></li>
+ {/section}
+</ul>
+
+ <div id="adbard">
+
+ <!--Ad Bard advertisement snippet, begin -->
+
+ <script type='text/javascript'>
+ var ab_h = '4bcaab930d3bdfded68fd7be730d7db4';
+ var ab_s = '55fd9cde6d855a75f9ca43d854272f6b';
+ </script>
+
+ <script type='text/javascript'
src='http://cdn1.adbard.net/js/ab1.js'></script>
+
+ <!--Ad Bard, end -->
+
+ </div>
+
+{include file='footer.tpl'}
Copied: trunk/nixtape/themes/librefm/templates/user-profile.tpl (from rev 1043,
trunk/nixtape/themes/librefm/templates/profile.tpl)
===================================================================
--- trunk/nixtape/themes/librefm/templates/user-profile.tpl
(rev 0)
+++ trunk/nixtape/themes/librefm/templates/user-profile.tpl 2009-04-30
08:27:07 UTC (rev 1044)
@@ -0,0 +1,91 @@
+{include file='header.tpl'}
+
+<h2 property="dc:title">{$user|escape:'html':'UTF-8'}'s profile</h2>
+
+{include file='maxiprofile.tpl'}
+
+{if $nowplaying|@count > 0}
+<h3>Now Playing:</h3>
+<!-- We should try to make this list work like the gobbles list. -->
+<dl class='now-playing'>
+ {section name=i loop=$nowplaying}
+ <dt class='track-name {if $scrobbles[i].license >
0}libre{/if}'>{$nowplaying[i].track|escape:'html':'UTF-8'}</dt>
+ <dd>by <span class='artist-name'><a
href='{$nowplaying[i].artisturl|escape:'html':'UTF-8'}'>{$nowplaying[i].artist|escape:'html':'UTF-8'}</a></span></dd>
+ <dd>with <span class='gobbler'>{$nowplaying[i].clientstr}</span></dd>
+ {/section}
+</dl>
+{/if}
+
+<div about="[_:seq1]" typeof="rdf:Seq" rev="rss:items">
+ <h3 typeof="rss:channel" property="rss:title" rel="rss:link"
resource="#latest_plays" id="latest_plays"
content="{$user|escape:'html':'UTF-8'}'s Latest Plays">Latest
{$scrobbles|@count} Plays:</h3>
+</div>
+
+<ul class="gobbles" about="{$id|escape:'html':'UTF-8'}" rev="gob:user">
+{section name=i loop=$scrobbles}
+
+ <li class="play {if $scrobbles[i].license > 0}libre{/if}"
about="{$scrobbles[i].id|escape:'html':'UTF-8'}" typeof="rss:item
gob:ScrobbleEvent" rel="gob:track_played">
+ <div about="{$scrobbles[i].id_track|escape:'html':'UTF-8'}"
typeof="mo:Track" class="haudio">
+ <div rev="mo:track">
+ <div
about="{$scrobbles[i].id_album|escape:'html':'UTF-8'}" typeof="mo:Record"{if
$scrobbles[i].album} property="dc:title"
content="{$scrobbles[i].album|escape:'html':'UTF-8'}"{/if}>
+ {if $scrobbles[i].albumurl}<a
rel="foaf:page" href="{$scrobbles[i].albumurl|escape:'html':'UTF-8'}">{/if}
+ <span{if
$scrobbles[i].album_image} rel="foaf:depiction"{/if}{if $scrobbles[i].albumurl}
about="{$scrobbles[i].id_album|escape:'html':'UTF-8'}"{/if}>
+ <img height="50"
width="50"
+ src="{if
!$scrobbles[i].album_image}/i/qm50.png{else}{$scrobbles[i].album_image|escape:'html':'UTF-8'}{/if}"
+
class="albumart{if !$scrobbles[i].album_image} photo{/if}"
+ {if
$scrobbles[i].album}title="{$scrobbles[i].album|escape:'html':'UTF-8'}"
alt="Album: {$scrobbles[i].album|escape:'html':'UTF-8'}"{else}alt="Unknown
album"{/if} />
+ </span>
+ {if $scrobbles[i].albumurl}</a>{/if}
+ </div>
+ </div>
+ <div rel="foaf:maker" class="contributor vcard">
+ <a
about="{$scrobbles[i].id_artist|escape:'html':'UTF-8'}" typeof="mo:MusicArtist"
property="foaf:name" rel="foaf:page"
+ class="fn url"
href="{$scrobbles[i].artisturl|escape:'html':'UTF-8'}"
+
>{$scrobbles[i].artist|escape:'html':'UTF-8'}</a>
+ </div>
+ <div><a class="fn" property="dc:title" rel="foaf:page"
href="{$scrobbles[i].trackurl|escape:'html':'UTF-8'}">{$scrobbles[i].track|escape:'html':'UTF-8'}</a></div>
+ <small about="{$scrobbles[i].id|escape:'html':'UTF-8'}"
property="dc:date" content="{$scrobbles[i].timeiso}"
datatype="xsd:dateTime">{$scrobbles[i].timehuman}</small>
+ <span about="{$scrobbles[i].id|escape:'html':'UTF-8'}"
property="rss:link" content="{$scrobbles[i].trackurl|escape:'html':'UTF-8'}">
+ <span property="rss:description" content="{if
$scrobbles[i].album}{$scrobbles[i].album}{else}Unknown album{/if}">
+ <span property="rss:title"
content="{$scrobbles[i].artist|escape:'html':'UTF-8'}:
{$scrobbles[i].track|escape:'html':'UTF-8'}"
rev="rdf:_{$smarty.section.i.index_next}" resource="[_:seq1]"></span>
+ </span>
+ </span>
+ </div>
+ </li>
+{/section}
+</ul>
+
+<h3>{$user}'s Top Tracks</h3>
+<ul>
+{section name=i loop=$toptracks}
+<li style="width:{$toptracks[i].width}" class="toptrack"><a
href="{$toptracks[i].artisturl}">{$toptracks[i].artist}</a> - <a
href="{$toptracks[i].trackurl}">{$toptracks[i].track}<a></li>
+{/section}
+</ul>
+
+<!-- Column break -->
+</div></div><div class="yui-u" id="sidebar"><div style="padding: 10px;">
+
+<h3>{$user}'s top artists</h3>
+<ul class="tagcloud" about="{$id}">
+ {section name=i loop=$user_tagcloud}
+ <li style="font-size:{$user_tagcloud[i].size}"><a
+ href="{$user_tagcloud[i].pageurl|escape:'html':'UTF-8'}" rel="{if
$user_tagcloud[i].size|substr:-5 ==
+ 'large'}foaf:interest
{/if}tag">{$user_tagcloud[i].artist|escape:"html":"UTF-8"}</a></li>
+ {/section}
+</ul>
+
+ <div id="adbard">
+
+ <!--Ad Bard advertisement snippet, begin -->
+
+ <script type='text/javascript'>
+ var ab_h = '4bcaab930d3bdfded68fd7be730d7db4';
+ var ab_s = '55fd9cde6d855a75f9ca43d854272f6b';
+ </script>
+
+ <script type='text/javascript'
src='http://cdn1.adbard.net/js/ab1.js'></script>
+
+ <!--Ad Bard, end -->
+
+ </div>
+
+{include file='footer.tpl'}
Copied: trunk/nixtape/user-edit.php (from rev 1043,
trunk/nixtape/edit_profile.php)
===================================================================
--- trunk/nixtape/user-edit.php (rev 0)
+++ trunk/nixtape/user-edit.php 2009-04-30 08:27:07 UTC (rev 1044)
@@ -0,0 +1,165 @@
+<?php
+
+/* Libre.fm -- a free network service for sharing your music listening habits
+
+ Copyright (C) 2009 Libre.fm Project
+
+ 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('templating.php');
+require_once('data/User.php');
+require_once('data/TagCloud.php');
+
+if($logged_in == false)
+{
+ $smarty->assign('error', 'Error!');
+ $smarty->assign('details', 'Not logged in! You shouldn\'t be here!');
+ $smarty->display('error.tpl');
+ die();
+}
+
+# Doesn't seem to work - $user = $_SESSION['user'];
+$user = new User($_SESSION['user']->name);
+
+$errors = array();
+
+if ($_POST['submit'])
+{
+ if (!empty($_POST['id']))
+ {
+ # Need better URI validation, but this will do for now. I think
+ # PEAR has a suitable module to help out here.
+ if ( !preg_match('/^[a-z0-9\+\.\-]+\:/i', $_POST['id']) )
+ $errors[] = "WebID must be a URI.";
+ if ( preg_match('/\s/', $_POST['id']) )
+ $errors[] = "WebID must be a URI. Valid URIs cannot
contain whitespace.";
+ }
+
+ if (!empty($_POST['homepage']))
+ {
+ # Need better URI validation, but this will do for now. I think
+ # PEAR has a suitable module to help out here.
+ if ( !preg_match('/^[a-z0-9\+\.\-]+\:/i', $_POST['homepage']) )
+ $errors[] = "Homepage must be a URI.";
+ if ( preg_match('/\s/', $_POST['homepage']) )
+ $errors[] = "Homepage must be a URI. Valid URIs cannot
contain whitespace.";
+ }
+
+ if (!empty($_POST['avatar_uri']))
+ {
+ # Need better URI validation, but this will do for now. I think
+ # PEAR has a suitable module to help out here.
+ if ( !preg_match('/^[a-z0-9\+\.\-]+\:/i', $_POST['avatar_uri'])
)
+ $errors[] = "Avatar must be a URI.";
+ if ( preg_match('/\s/', $_POST['avatar_uri']) )
+ $errors[] = "Avatar must be a URI. Valid URIs cannot
contain whitespace.";
+ }
+
+ if (!empty($_POST['password_1']))
+ {
+ if ($_POST['password_1'] != $_POST['password_2'])
+ $errors[] = "Passwords do not match.";
+ }
+
+ if (!empty($_POST['location_uri']))
+ {
+ # Currently only allow geonames URIs, but there's no reason we
can't accept
+ # others at some point in the future. (e.g. dbpedia)
+ if ( !preg_match('/^http:\/\/sws.geonames.org\/[0-9]+\/$/',
$_POST['location_uri']) )
+ $errors[] = "This should be a geonames.org semantic web
service URI.";
+ }
+
+ if (!isset($errors[0]))
+ {
+ # Currently we don't allow them to change e-mail as we probably
should
+ # have some kind of confirmation login to do so.
+ $user->id = $_POST['id'];
+ $user->fullname = $_POST['fullname'];
+ $user->homepage = $_POST['homepage'];
+ $user->bio = $_POST['bio'];
+ $user->location = $_POST['location'];
+ $user->location_uri = $_POST['location_uri'];
+ $user->avatar_uri = $_POST['avatar_uri'];
+
+ if (!empty( $_POST['password_1'] ))
+ $user->password = md5($_POST['password_1']);
+
+ $user->save();
+
+ header("Location: " . $base_url . "/user/" . $user->name);
+ exit;
+ }
+
+ if (isset($errors[0]))
+ {
+ header("Content-Type: text/plain");
+ print_r($errors);
+ exit;
+ }
+}
+
+if(isset($user->name))
+{
+ # Stuff which cannot be changed.
+ $smarty->assign("acctid", $user->acctid);
+ $smarty->assign('avatar', $user->getAvatar());
+ $smarty->assign('user', $user->name);
+
+ # Stuff which cannot be changed *here*
+ $smarty->assign('userlevel', $user->userlevel);
+
+ # Stuff which cannot be changed *yet*
+ $smarty->assign('email', $user->email);
+
+ if ($_POST['submit'])
+ {
+ $smarty->assign("id", $_POST['id']);
+ $smarty->assign('fullname', $_POST['fullname']);
+ $smarty->assign('bio', $_POST['bio']);
+ $smarty->assign('homepage', $_POST['homepage']);
+ $smarty->assign('location', $_POST['location']);
+ $smarty->assign('location_uri', $_POST['location_uri']);
+ $smarty->assign('avatar_uri', $_POST['avatar_uri']);
+ }
+ else
+ {
+ $smarty->assign("id", ($user->webid_uri));
+ $smarty->assign('fullname', ($user->fullname));
+ $smarty->assign('bio', ($user->bio));
+ $smarty->assign('homepage', ($user->homepage));
+ $smarty->assign('location', ($user->location));
+ $smarty->assign('location_uri', ($user->location_uri));
+ $smarty->assign('avatar_uri', ($user->avatar_uri));
+ }
+
+ # And display the page.
+ $aTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist');
+ if (!PEAR::isError ($aTagCloud))
+ {
+ $smarty->assign('tagcloud', $aTagCloud);
+ }
+ $smarty->assign('errors', $errors);
+ $smarty->display('user-edit.tpl');
+}
+
+else
+{
+ $smarty->assign('error', 'User not found');
+ $smarty->assign('details', 'Shall I call in a missing persons report?
This shouldn\'t happen.');
+ $smarty->display('error.tpl');
+}
+
Copied: trunk/nixtape/user-journal.php (from rev 1043,
trunk/nixtape/journal.php)
===================================================================
--- trunk/nixtape/user-journal.php (rev 0)
+++ trunk/nixtape/user-journal.php 2009-04-30 08:27:07 UTC (rev 1044)
@@ -0,0 +1,101 @@
+<?php
+
+/* Libre.fm -- a free network service for sharing your music listening habits
+
+ Copyright (C) 2009 Libre.fm Project
+
+ 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('templating.php');
+require_once('data/User.php');
+require_once('data/TagCloud.php');
+require_once('data/Server.php');
+require_once('utils/arc/ARC2.php');
+require_once('utils/human-time.php');
+
+if(!isset($_GET['user']) && $logged_in == false) {
+ $smarty->assign('error', 'Error!');
+ $smarty->assign('details', 'User not set! You shouldn\'t be here!');
+ $smarty->display('error.tpl');
+ die();
+}
+
+$user = new User($_GET['user']);
+
+# We need to get this from account profile really. This is just hard-coded for
experimenting.
+if ($user->name == 'tobyink')
+ $rssFeed = 'http://identi.ca/tobyink/rss';
+
+if ($rssFeed)
+{
+ # We have to implement HTTP caching here!
+ $parser = ARC2::getRDFParser();
+ $parser->parse($rssFeed);
+
+ $index = $parser->getSimpleIndex();
+ krsort($index); // Newest last.
+ $items = array();
+ foreach ($index as $subject => $data)
+ {
+ if (in_array('http://purl.org/rss/1.0/item',
$data['http://www.w3.org/1999/02/22-rdf-syntax-ns#type']))
+ {
+ $ts = strtotime($data[
'http://purl.org/dc/elements/1.1/date' ][0]);
+ $items[] = array(
+ 'subject_uri' => $subject,
+ 'title' => $data[
'http://purl.org/rss/1.0/title' ][0],
+ 'link' => $data[ 'http://purl.org/rss/1.0/link'
][0],
+ 'date_iso' => $data[
'http://purl.org/dc/elements/1.1/date' ][0],
+ 'date_unix' => $ts,
+ 'date_human' => human_timestamp($ts)
+ );
+ }
+ }
+
+ $smarty->assign("id", $user->id);
+ $smarty->assign("acctid", $user->acctid);
+ $smarty->assign('user', $user->name);
+ $smarty->assign('email', $user->email);
+ $smarty->assign('fullname', $user->fullname);
+ $smarty->assign('bio', $user->bio);
+ $smarty->assign('homepage', $user->homepage);
+ $smarty->assign('location', $user->location);
+ $smarty->assign('location_uri', $user->location_uri);
+ $smarty->assign('geo', Server::getLocationDetails($user->location_uri));
+ $smarty->assign('userlevel', $user->userlevel);
+ $smarty->assign('avatar', $user->getAvatar());
+ $aUserTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40,
$user->name);
+ if (!PEAR::isError ($aUserTagCloud)) {
+ $smarty->assign('user_tagcloud',$aUserTagCloud);
+ }
+ $smarty->assign('isme', ($_SESSION['user']->name == $user->name));
+ $smarty->assign('profile', true);
+ $smarty->assign('items', $items);
+ $smarty->assign('extra_head_links', array(
+ array(
+ 'rel'=>'alternate',
+ 'type' => 'application/rss+xml' ,
+ 'title' => 'RSS 1.0 Feed (Journal)',
+ 'href' =>
$base_url.'/rdf.php?fmt=rss&page='.htmlentities($_SERVER['REQUEST_URI'])
+ )
+ ));
+ $smarty->display('user-journal.tpl');
+
+} else {
+ $smarty->assign('error', 'No RSS Feed for this User');
+ $smarty->assign('details', 'Shall I call in a missing feeds report?');
+ $smarty->display('error.tpl');
+}
Copied: trunk/nixtape/user-profile.php (from rev 1043,
trunk/nixtape/profile.php)
===================================================================
--- trunk/nixtape/user-profile.php (rev 0)
+++ trunk/nixtape/user-profile.php 2009-04-30 08:27:07 UTC (rev 1044)
@@ -0,0 +1,89 @@
+<?php
+
+/* Libre.fm -- a free network service for sharing your music listening habits
+
+ Copyright (C) 2009 Libre.fm Project
+
+ 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('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('error', 'Error!');
+ $smarty->assign('details', 'User not set! You shouldn\'t be here!');
+ $smarty->display('error.tpl');
+ die();
+}
+
+$user = new User($_GET['user']);
+
+if(isset($user->name)) {
+ $smarty->assign("id", $user->id);
+ $smarty->assign("acctid", $user->acctid);
+ $smarty->assign('user', $user->name);
+ $smarty->assign('email', $user->email);
+ $smarty->assign('fullname', $user->fullname);
+ $smarty->assign('bio', $user->bio);
+ $smarty->assign('homepage', $user->homepage);
+ $smarty->assign('location', $user->location);
+ $smarty->assign('location_uri', $user->location_uri);
+ $smarty->assign('geo', Server::getLocationDetails($user->location_uri));
+ $aUserScrobbles = $user->getScrobbles(20);
+ if (!PEAR::isError ($aUserScrobbles)) {
+ $smarty->assign('scrobbles', $aUserScrobbles);
+ }
+ $smarty->assign('userlevel', $user->userlevel);
+ $smarty->assign('avatar', $user->getAvatar());
+ $aUserNowPlaying = $user->getNowPlaying(10);
+ if (!PEAR::isError ($aUserNowPlaying)) {
+ $smarty->assign('nowplaying', $aUserNowPlaying);
+ }
+ $aUserTagCloud = TagCloud::GenerateTagCloud('Scrobbles', 'artist', 40,
$user->name);
+ if (!PEAR::isError ($aUserTagCloud)) {
+ $smarty->assign('user_tagcloud',$aUserTagCloud);
+ }
+ $smarty->assign('isme', ($_SESSION['user']->name == $user->name));
+ $smarty->assign('profile', true);
+
+ $smarty->assign('extra_head_links', array(
+ array(
+ 'rel'=>'alternate',
+ 'type' => 'application/rss+xml' ,
+ 'title' => 'RSS 1.0 Feed (Recent plays)',
+ 'href' =>
$base_url.'/rdf.php?fmt=rss&page='.htmlentities($_SERVER['REQUEST_URI'])
+ ),
+ array(
+ 'rel' => 'meta',
+ 'type' => 'application/rdf+xml' ,
+ 'title' => 'FOAF',
+ 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.htmlentities($_SERVER['REQUEST_URI'])
+ )
+ ));
+
+ $smarty->assign('toptracks', $user->getTopTracks());
+
+ $smarty->display('user-profile.tpl');
+} else {
+ $smarty->assign('error', 'User not found');
+ $smarty->assign('details', 'Shall I call in a missing persons report?');
+ $smarty->display('error.tpl');
+}
+
+?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1044] Beginning to apply some naming conventions to the files involved,
Toby Inkster <=