aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-25 23:32:44 -0800
committerfriendica <info@friendica.com>2013-01-25 23:32:44 -0800
commit70aa8421b37a6ad7318172ef515bbb56e2d33917 (patch)
treea3f6301666c5ab22be7fdb2c204993d734b58405 /mod
parent93af1932181a900c7b59d99799b28bd24e2c32d8 (diff)
downloadvolse-hubzilla-70aa8421b37a6ad7318172ef515bbb56e2d33917.tar.gz
volse-hubzilla-70aa8421b37a6ad7318172ef515bbb56e2d33917.tar.bz2
volse-hubzilla-70aa8421b37a6ad7318172ef515bbb56e2d33917.zip
further baby steps on the photos API
Diffstat (limited to 'mod')
-rw-r--r--mod/photos.php19
1 files changed, 8 insertions, 11 deletions
diff --git a/mod/photos.php b/mod/photos.php
index 8c967b91a..00985ab9b 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -5,6 +5,7 @@ require_once('include/items.php');
require_once('include/acl_selectors.php');
require_once('include/bbcode.php');
require_once('include/security.php');
+require_once('include/Contact.php');
function photos_init(&$a) {
@@ -17,7 +18,7 @@ function photos_init(&$a) {
if(argc() > 1) {
$nick = argv(1);
- $r = q("SELECT * FROM channel WHERE channel_address = '%s' LIMIT 1",
+ $r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_address = '%s' LIMIT 1",
dbesc($nick)
);
@@ -27,21 +28,17 @@ function photos_init(&$a) {
$a->data['channel'] = $r[0];
$observer = $a->get_observer();
- $a->data['perms'] = get_all_perms($r[0]['channel_id'],(($observer) ? $observer['xchan_hash'] : ''));
+ $a->data['observer'] = $observer;
- $o .= '<div class="vcard">';
- $o .= '<div class="fn">' . $a->data['channel']['channel_name'] . '</div>';
- $o .= '<div id="profile-photo-wrapper"><img class="photo" style="width: 175px; height: 175px;" src="' . $a->get_baseurl() . '/photo/profile/l/' . $a->data['channel']['channel_id'] . '" alt="' . $a->data['channel']['channel_name'] . '" /></div>';
- $o .= '</div>';
+ $observer_xchan = (($observer) ? $observer['xchan_hash'] : '');
+ $a->data['perms'] = get_all_perms($r[0]['channel_id'],$observer_xchan);
- $sql_extra = permissions_sql($a->data['channel']['channel_id']);
+ $o .= vcard_from_xchan($a->data['channel'],$observer_xchan);
- $albums = q("SELECT distinct(`album`) AS `album` FROM `photo` WHERE `uid` = %d $sql_extra order by created desc",
- intval($a->data['channel']['channel_id'])
- );
+ $albums = photos_albums_list($a->data['channel'],$observer);
- if(count($albums)) {
+ if($albums) {
$a->data['albums'] = $albums;
// FIXME
$albums_visible = ((intval($a->data['user']['hidewall']) && (! local_user()) && (! remote_user())) ? false : true);