summaryrefslogtreecommitdiff
path: root/lib/gallery.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-09-11 10:47:42 -0400
committerEvan Prodromou <evan@prodromou.name>2008-09-11 10:47:42 -0400
commita482123feaf4ce90d24326067b4e75445b3dfeaa (patch)
treef0c0f971554c7005aaecd6c7df1703da83d59452 /lib/gallery.php
parent9805deccb3505a930189fe0d95cad2363eb150e1 (diff)
reverse order of queries for galleries
darcs-hash:20080911144742-84dde-235a1af2d958500b1f1c503f21785284ca4b5c8a.gz
Diffstat (limited to 'lib/gallery.php')
-rw-r--r--lib/gallery.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/gallery.php b/lib/gallery.php
index a79cde7b8..a478db25d 100644
--- a/lib/gallery.php
+++ b/lib/gallery.php
@@ -31,17 +31,22 @@ class GalleryAction extends Action {
function handle($args) {
parent::handle($args);
- $nickname = $this->arg('nickname');
- $profile = Profile::staticGet('nickname', $nickname);
- if (!$profile) {
+ $nickname = common_canonical_nickname($this->arg('nickname'));
+
+ $user = User::staticGet('nickname', $nickname);
+
+ if (!$user) {
$this->no_such_user();
return;
}
- $user = User::staticGet($profile->id);
- if (!$user) {
- $this->no_such_user();
+
+ $profile = $user->getProfile();
+
+ if (!$profile) {
+ $this->server_error(_('User without matching profile in system.'));
return;
}
+
$page = $this->arg('page');
if (!$page) {
$page = 1;
@@ -99,7 +104,7 @@ class GalleryAction extends Action {
common_log(LOG_WARNING, 'No matching profile for ' . $other_id);
continue;
}
-
+
common_element_start('li');
common_element_start('a', array('title' => ($other->fullname) ?