[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Librefm-commits] [1650] Don't try to use PEAR class that won't be loade
From: |
Clint Adams |
Subject: |
[Librefm-commits] [1650] Don't try to use PEAR class that won't be loaded. |
Date: |
Sat, 16 May 2009 01:19:15 +0000 |
Revision: 1650
http://svn.sv.gnu.org/viewvc/?view=rev&root=librefm&revision=1650
Author: clint
Date: 2009-05-16 01:19:13 +0000 (Sat, 16 May 2009)
Log Message:
-----------
Don't try to use PEAR class that won't be loaded.
Modified Paths:
--------------
trunk/nixtape/album.php
trunk/nixtape/api/ArtistXML.php
trunk/nixtape/api/UserXML.php
trunk/nixtape/artist.php
trunk/nixtape/data/Artist.php
trunk/nixtape/data/Group.php
trunk/nixtape/data/Server.php
trunk/nixtape/data/TagCloud.php
trunk/nixtape/data/User.php
trunk/nixtape/edit_group.php
trunk/nixtape/explore.php
trunk/nixtape/group.php
trunk/nixtape/listen.php
trunk/nixtape/track.php
trunk/nixtape/user-edit.php
trunk/nixtape/user-groups.php
trunk/nixtape/user-journal.php
trunk/nixtape/user-profile.php
trunk/nixtape/user-recent-tracks.php
trunk/nixtape/user-stats.php
Modified: trunk/nixtape/album.php
===================================================================
--- trunk/nixtape/album.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/album.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -32,7 +32,7 @@
$smarty->assign('artist', $artist);
$smarty->assign('album', $album);
$aAlbumTracks = $album->getTracks();
-if (!PEAR::isError($aAlbumTracks )) {
+if ($aAlbumTracks) {
$smarty->assign('tracks', $aAlbumTracks);
}
Modified: trunk/nixtape/api/ArtistXML.php
===================================================================
--- trunk/nixtape/api/ArtistXML.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/api/ArtistXML.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -42,7 +42,7 @@
$artist = new Artist($artistName, $mbid);
- if (PEAR::isError($artist)) {
+ if (!$artist) {
return(XML::error('failed', '7', 'Invalid resource
specified'));
}
@@ -66,7 +66,7 @@
$artist = new Artist($artistName);
- if (PEAR::isError($artist)) {
+ if (!$artist) {
return(XML::error('failed', '7', 'Invalid resource
specified'));
}
Modified: trunk/nixtape/api/UserXML.php
===================================================================
--- trunk/nixtape/api/UserXML.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/api/UserXML.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -27,7 +27,7 @@
public static function getInfo($username) {
$user = new User($username);
- if (PEAR::isError($user)) {
+ if (!$user) {
return(XML::error('failed', '7', 'Invalid resource
specified'));
}
Modified: trunk/nixtape/artist.php
===================================================================
--- trunk/nixtape/artist.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/artist.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -33,12 +33,12 @@
$smarty->assign('bio_summary', $artist->bio_summary);
$aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
-if (!PEAR::isError ($aTagCloud)) {
+if ($aTagCloud) {
$smarty->assign('tagcloud', $aTagCloud);
}
$aArtistAlbums = $artist->getAlbums();
-if (!PEAR::isError($aArtistAlbums)) {
+if ($aArtistAlbums) {
$smarty->assign('albums', $aArtistAlbums);
}
Modified: trunk/nixtape/data/Artist.php
===================================================================
--- trunk/nixtape/data/Artist.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/data/Artist.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -53,7 +53,7 @@
. 'mbid = ' . $adodb->qstr($mbid) . ' OR '
. 'name = ' . $adodb->qstr($name));
if(!$row) {
- return(new PEAR_Error('No such artist: ' . $name));
+ throw new Exception('No such artist' . $name);
} else {
$this->name = $row['name'];
$this->mbid = $row['mbid'];
Modified: trunk/nixtape/data/Group.php
===================================================================
--- trunk/nixtape/data/Group.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/data/Group.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -194,10 +194,10 @@
, (int)($grp)
, (int)($owner->uniqueid)
, time());
- $res = $adodb->Execute($q);
- if (PEAR::isError($res))
- {
- return $res;
+ try {
+ $res = $adodb->Execute($q);
+ } catch (exception $e) {
+ return null;
}
// Return the newly created group. Callers should check the
return value.
Modified: trunk/nixtape/data/Server.php
===================================================================
--- trunk/nixtape/data/Server.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/data/Server.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -41,7 +41,7 @@
* Retrieves a list of recent scrobbles
*
* @param int $number The number of scrobbles to return
- * @return An array of scrobbles or a PEAR_Error in case of failure
+ * @return An array of scrobbles or null in case of failure
*/
static function getRecentScrobbles($number=10, $username=false) {
global $adodb;
@@ -106,7 +106,7 @@
}
}
catch (exception $e) {
- return $false;
+ return null;
}
foreach($res as &$i) {
@@ -150,7 +150,7 @@
* Retrieves a list of popular artists
*
* @param int $number The number of artists to return
- * @return An array of artists or a PEAR_Error in case of failure
+ * @return An array of artists or null in case of failure
*/
static function getTopArtists($number=20) {
global $adodb;
@@ -160,7 +160,7 @@
$data = $adodb->CacheGetAll(720, 'SELECT COUNT(artist) as c,
artist FROM Scrobbles GROUP BY artist ORDER BY c DESC LIMIT 20');
}
catch (exception $e) {
- return false;
+ return null;
}
foreach($data as &$i) {
@@ -176,7 +176,7 @@
* Retrieves a list of the currently playing tracks
*
* @param int $number The maximum number of tracks to return
- * @return An array of now playing data or a PEAR_Error in case of
failure
+ * @return An array of now playing data or null in case of failure
*/
static function getNowPlaying($number, $username=false) {
global $adodb;
@@ -233,7 +233,7 @@
}
}
catch (exception $e) {
- return false;
+ return null;
}
foreach($data as &$i) {
Modified: trunk/nixtape/data/TagCloud.php
===================================================================
--- trunk/nixtape/data/TagCloud.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/data/TagCloud.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -53,7 +53,7 @@
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$res = $adodb->CacheGetAll(7200,$query);
if (!$res) {
- return(new PEAR_Error('ERROR ' . $query));
+ throw new Exception('ERROR ' . $query);
} else {
foreach($res as $count => &$i) {
$i['size'] = $sizes[(int)
($count/(count($res)/7))];
Modified: trunk/nixtape/data/User.php
===================================================================
--- trunk/nixtape/data/User.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/data/User.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -55,7 +55,7 @@
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$row = $adodb->CacheGetRow(7200,$query);
if (!$row) {
- return(new PEAR_Error('ERROR ' . $query));
+ throw new Exception('ERROR ' . $query);
}
}
@@ -141,11 +141,10 @@
, time()
, $adodb->qstr($this->name));
- $res = $adodb->Execute($q);
-
- if(PEAR::isError($res)) {
+ try {
+ $res = $adodb->Execute($q);
+ } catch (exception $e) {
header('Content-Type: text/plain');
- //($res);
exit;
}
@@ -232,7 +231,7 @@
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$data = $adodb->CacheGetAll(7200,$query);
if (!$data) {
- return(new PEAR_Error('ERROR ' . $query));
+ throw new Exception('ERROR ' . $query);
}
$maxcount = 0;
Modified: trunk/nixtape/edit_group.php
===================================================================
--- trunk/nixtape/edit_group.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/edit_group.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -37,29 +37,26 @@
{
if ($_REQUEST['new'])
{
- $result = Group::create(strtolower($_REQUEST['new']), $this_user);
-
- if ($result instanceof Group)
- {
- header('Location: ' . $base_url .
'/edit_group.php?group=' . $_REQUEST['new']);
- exit();
- }
- elseif (PEAR::isError($result))
- {
+ try {
+ $result = Group::create(strtolower($_REQUEST['new']),
$this_user);
+ } catch (exception $e) {
$smarty->assign('error', 'Error!');
- $smarty->assign('details', $result->getMessage());
+ $smarty->assign('details', $e->getMessage());
$smarty->display('error.tpl');
die();
}
+ if ($result instanceof Group) {
+ header('Location: ' . $base_url .
'/edit_group.php?group=' . $_REQUEST['new']);
+ exit();
+ }
}
else
{
$smarty->assign('newform', true);
- $aTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
- if (!PEAR::isError ($aTagCloud))
- {
+ try {
+ $aTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
$smarty->assign('tagcloud', $aTagCloud);
- }
+ } catch (exception $e) {}
$smarty->display('edit_group.tpl');
exit();
}
@@ -163,11 +160,10 @@
# And display the page.
$smarty->assign('errors', $errors);
$smarty->assign('newform', false);
- $aUserTagCloud = $group->tagCloudData();
- if (!PEAR::isError ($aTagCloud))
- {
+ try {
+ $aUserTagCloud = $group->tagCloudData();
$smarty->assign('tagcloud', $aTagCloud);
- }
+ } catch (exception $e) {}
$smarty->display('edit_group.tpl');
}
Modified: trunk/nixtape/explore.php
===================================================================
--- trunk/nixtape/explore.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/explore.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -27,10 +27,10 @@
require_once('data/TagCloud.php');
// This should be contextual based on the mode= parameter?
+try {
$aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
-if (!PEAR::isError ($aTagCloud)) {
$smarty->assign('tagcloud', $aTagCloud);
-}
+} catch (exception $e) {}
$aTopArtists = Server::getTopArtists(20);
if (!PEAR::isError ($aTopArtists)) {
Modified: trunk/nixtape/group.php
===================================================================
--- trunk/nixtape/group.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/group.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -29,18 +29,17 @@
{
$smarty->assign('groups', Group::groupList());
$smarty->assign('extra_head_links', array(
- array(
- 'rel' => 'meta',
- 'type' => 'application/rdf+xml' ,
- 'title' => 'FOAF',
- 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$_SERVER['REQUEST_URI']))
- )
- ));
- $aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(),
'artist');
- if (!PEAR::isError ($aTagCloud))
- {
+ array(
+ 'rel' => 'meta',
+ 'type' => 'application/rdf+xml' ,
+ 'title' => 'FOAF',
+ 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$_SERVER['REQUEST_URI']))
+ )
+ ));
+ try {
+ $aTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
$smarty->assign('tagcloud', $aTagCloud);
- }
+ } catch (exception $e) {}
$smarty->display('group-list.tpl');
exit;
}
@@ -68,10 +67,10 @@
$smarty->assign('homepage', $group->homepage);
$smarty->assign('avatar', $group->getAvatar());
- $aUserTagCloud = $group->tagCloudData();
- if (!PEAR::isError ($aUserTagCloud)) {
+ try {
+ $aUserTagCloud = $group->tagCloudData();
$smarty->assign('group_tagcloud',$aUserTagCloud);
- }
+ } catch (exception $e) {}
$smarty->assign('userlist', $group->getUsers());
@@ -83,13 +82,13 @@
$smarty->assign('link', $group->getURL());
$smarty->assign('extra_head_links', array(
- array(
- 'rel' => 'meta',
- 'type' => 'application/rdf+xml' ,
- 'title' => 'FOAF',
- 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$_SERVER['REQUEST_URI']))
- )
- ));
+ array(
+ 'rel' => 'meta',
+ 'type' => 'application/rdf+xml' ,
+ 'title' => 'FOAF',
+ 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$_SERVER['REQUEST_URI']))
+ )
+ ));
$smarty->assign('profile', true);
$smarty->display('group.tpl');
Modified: trunk/nixtape/listen.php
===================================================================
--- trunk/nixtape/listen.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/listen.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -23,10 +23,10 @@
require_once('templating.php');
require_once('data/TagCloud.php');
+try {
$aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
-if (!PEAR::isError ($aTagCloud)) {
$smarty->assign('tagcloud', $aTagCloud);
-}
+} catch (exception $e) {}
if(isset($_GET['tag'])) {
$station = 'librefm://globaltags/' . $_GET['tag'];
Modified: trunk/nixtape/track.php
===================================================================
--- trunk/nixtape/track.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/track.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -35,10 +35,10 @@
$smarty->assign('artist', $artist);
// no idea how this would be track-relevant
+try {
$aTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable(), 'artist');
-if (!PEAR::isError ($aTagCloud)) {
$smarty->assign('tagcloud', $aTagCloud);
-}
+} catch (exception $e) {}
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$res = $adodb->GetAll('SELECT * FROM Track WHERE lower(artist_name) = ' .
$adodb->qstr(mb_strtolower($track->artist_name, 'UTF-8')) . ' AND lower(name) =
' . $adodb->qstr(mb_strtolower($track->name, 'UTF-8')));
Modified: trunk/nixtape/user-edit.php
===================================================================
--- trunk/nixtape/user-edit.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/user-edit.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -170,11 +170,10 @@
}
# And display the page.
- $aTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40,
$this_user->name);
- if (!PEAR::isError ($aTagCloud))
- {
+ try {
+ $aTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40,
$this_user->name);
$smarty->assign('tagcloud', $aTagCloud);
- }
+ } catch (exception $e) {}
$smarty->assign('errors', $errors);
$smarty->display('user-edit.tpl');
}
Modified: trunk/nixtape/user-groups.php
===================================================================
--- trunk/nixtape/user-groups.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/user-groups.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -39,10 +39,10 @@
if(isset($user->name)) {
$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
- $aUserTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40,
$user->name);
- if (!PEAR::isError ($aUserTagCloud)) {
+ try {
+ $aUserTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40,
$user->name);
$smarty->assign('user_tagcloud',$aUserTagCloud);
- }
+ } catch (exception $e) {}
$smarty->assign('isme', ($_SESSION['user']->name == $user->name));
$smarty->assign('me', $user);
$smarty->assign('profile', true);
@@ -50,13 +50,13 @@
$smarty->assign('groups', Group::groupList($user));
$smarty->assign('extra_head_links', array(
- array(
- 'rel' => 'meta',
- 'type' => 'application/rdf+xml' ,
- 'title' => 'FOAF',
- 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$user->getURL('groups')))
- )
- ));
+ array(
+ 'rel' => 'meta',
+ 'type' => 'application/rdf+xml' ,
+ 'title' => 'FOAF',
+ 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$user->getURL('groups')))
+ )
+ ));
$smarty->display('user-groups.tpl');
} else {
Modified: trunk/nixtape/user-journal.php
===================================================================
--- trunk/nixtape/user-journal.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/user-journal.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -66,28 +66,28 @@
}
}
-$aUserTagCloud = TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'),
'artist', 40, $user->name);
-if (!PEAR::isError ($aUserTagCloud)) {
+try {
+ $aUserTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40,
$user->name);
$smarty->assign('user_tagcloud',$aUserTagCloud);
-}
+} catch (exception $e) {}
$smarty->assign('isme', ($this_user->name == $user->name));
$smarty->assign('me', $user);
$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
$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' => $user->journal_rss
- ),
- array(
- 'rel' => 'meta',
- 'type' => 'application/rdf+xml' ,
- 'title' => 'FOAF',
- 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$user->getURL()))
- )
- ));
+ array(
+ 'rel'=>'alternate',
+ 'type' => 'application/rss+xml' ,
+ 'title' => 'RSS 1.0 Feed (Journal)',
+ 'href' => $user->journal_rss
+ ),
+ array(
+ 'rel' => 'meta',
+ 'type' => 'application/rdf+xml' ,
+ 'title' => 'FOAF',
+ 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$user->getURL()))
+ )
+ ));
$smarty->display('user-journal.tpl');
Modified: trunk/nixtape/user-profile.php
===================================================================
--- trunk/nixtape/user-profile.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/user-profile.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -37,43 +37,43 @@
if(isset($user->name)) {
$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
- $aUserScrobbles = $user->getScrobbles(10);
- if (!PEAR::isError ($aUserScrobbles)) {
+ try {
+ $aUserScrobbles = $user->getScrobbles(10);
$smarty->assign('scrobbles', $aUserScrobbles);
- }
+ } catch (exception $e) {}
+ try {
$aUserNowPlaying = $user->getNowPlaying(10);
- if (!PEAR::isError ($aUserNowPlaying)) {
$smarty->assign('nowplaying', $aUserNowPlaying);
- }
+ } catch (exception $e) {}
+ try {
$aUserTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40,
$user->name);
- if (!PEAR::isError ($aUserTagCloud)) {
$smarty->assign('user_tagcloud',$aUserTagCloud);
- }
+ } catch (exception $e) {}
$smarty->assign('isme', ($this_user->name == $user->name));
$smarty->assign('me', $user);
$smarty->assign('sidebar', true);
$smarty->assign('sidebartemplate', 'profile-sidebar.tpl');
$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='.urlencode(str_replace($base_url, '',
$user->getURL('recent-tracks')))
- ),
- array(
- 'rel'=>'alternate',
- 'type' => 'application/rss+xml' ,
- 'title' => 'RSS 1.0 Feed (Journal)',
- 'href' => $user->journal_rss
- ),
- array(
- 'rel' => 'meta',
- 'type' => 'application/rdf+xml' ,
- 'title' => 'FOAF',
- 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$user->getURL()))
- )
- ));
+ array(
+ 'rel'=>'alternate',
+ 'type' => 'application/rss+xml' ,
+ 'title' => 'RSS 1.0 Feed (Recent
plays)',
+ 'href' =>
$base_url.'/rdf.php?fmt=rss&page='.urlencode(str_replace($base_url, '',
$user->getURL('recent-tracks')))
+ ),
+ array(
+ 'rel'=>'alternate',
+ 'type' => 'application/rss+xml' ,
+ 'title' => 'RSS 1.0 Feed (Journal)',
+ 'href' => $user->journal_rss
+ ),
+ array(
+ 'rel' => 'meta',
+ 'type' => 'application/rdf+xml' ,
+ 'title' => 'FOAF',
+ 'href' =>
$base_url.'/rdf.php?fmt=xml&page='.urlencode(str_replace($base_url, '',
$user->getURL()))
+ )
+ ));
$smarty->display('user-profile.tpl');
} else {
Modified: trunk/nixtape/user-recent-tracks.php
===================================================================
--- trunk/nixtape/user-recent-tracks.php 2009-05-16 00:55:42 UTC (rev
1649)
+++ trunk/nixtape/user-recent-tracks.php 2009-05-16 01:19:13 UTC (rev
1650)
@@ -42,14 +42,14 @@
if(isset($user->name)) {
$smarty->assign('geo', Server::getLocationDetails($user->location_uri));
+ try {
$aUserScrobbles = $user->getScrobbles( $scrobbleCount );
- if (!PEAR::isError ($aUserScrobbles)) {
$smarty->assign('scrobbles', $aUserScrobbles);
- }
+ } catch (exception $e) {}
+ try {
$aUserTagCloud =
TagCloud::GenerateTagCloud(TagCloud::scrobblesTable('user'), 'artist', 40,
$user->name);
- if (!PEAR::isError ($aUserTagCloud)) {
$smarty->assign('user_tagcloud',$aUserTagCloud);
- }
+ } catch (exception $e) {}
$smarty->assign('isme', ($this_user->name == $user->name));
$smarty->assign('me', $user);
$smarty->assign('profile', true);
Modified: trunk/nixtape/user-stats.php
===================================================================
--- trunk/nixtape/user-stats.php 2009-05-16 00:55:42 UTC (rev 1649)
+++ trunk/nixtape/user-stats.php 2009-05-16 01:19:13 UTC (rev 1650)
@@ -42,15 +42,15 @@
# }
$smarty->assign('stat_barwidth', 320);
+try {
$aUserPlayStat = Statistic::GeneratePlayStats('Scrobbles', 'artist',
40, $user->name, 300);
- if (!PEAR::isError ($aUserPlayStat)) {
$smarty->assign('user_playstats',$aUserPlayStat);
- }
+ } catch (exception $e) {}
+try {
$aUserDayStat = Statistic::generatePlayByDays('Scrobbles', 40,
$user->name, 300);
- if (!PEAR::isError ($aUserDayStat)) {
$smarty->assign('user_daystats',$aUserDayStat);
- }
+ } catch (exception $e) {}
$smarty->assign('toptracks', $user->getTopTracks(40));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Librefm-commits] [1650] Don't try to use PEAR class that won't be loaded.,
Clint Adams <=