function show_item($notice) {
$profile = Profile::staticGet($notice->profile_id);
$nurl = common_local_url('shownotice', array('notice' => $notice->id));
- $user = User::staticGet($profile->id);
- if ($user) {
- $creator_url = $user->uri;
- } else {
- $creator_url = $profile->profile_url;
- }
+ $creator_uri = common_profile_uri($profile);
common_element_start('item', array('rdf:about' => $notice->uri));
$title = $profile->nickname . ': ' . $notice->content;
common_element('title', NULL, $title);
common_element('sioc:has_creator', array('rdf:resource' => $creator_url));
common_element('cc:licence', array('rdf:resource' => common_config('license', 'url')));
common_element_end('item');
- $this->creators[$creator_url] = $profile;
+ $this->creators[$creator_uri] = $profile;
}
function show_creators() {
return common_default_avatar($size);
}
}
-
\ No newline at end of file
+
+function common_profile_uri($profile) {
+ if (!$profile) {
+ return NULL;
+ }
+ $user = User::staticGet($profile->id);
+ if ($user) {
+ return $user->uri;
+ }
+
+ $remote = Remote_profile::staticGet($profile->id);
+ if ($remote) {
+ return $remote->uri;
+ }
+ # XXX: this is a very bad profile!
+ return NULL;
+}
\ No newline at end of file