aboutsummaryrefslogtreecommitdiffstats
path: root/mod/photos.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/photos.php')
-rw-r--r--mod/photos.php33
1 files changed, 20 insertions, 13 deletions
diff --git a/mod/photos.php b/mod/photos.php
index 43c74851a..63806896b 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -19,6 +19,9 @@ function photos_init(&$a) {
if(argc() > 1) {
$nick = argv(1);
+
+ profile_load($a,$nick);
+
$channelx = channelx_by_nick($nick);
if(! $channelx)
@@ -31,16 +34,7 @@ function photos_init(&$a) {
$observer_xchan = (($observer) ? $observer['xchan_hash'] : '');
- $a->data['perms'] = get_all_perms($channelx[0]['channel_id'],$observer_xchan);
-
-
-
- $a->set_widget('vcard',vcard_from_xchan($a->data['channel'],$observer));
head_set_icon($a->data['channel']['xchan_photo_s']);
- if($a->data['perms']['view_photos']) {
- $a->data['albums'] = photos_albums_list($a->data['channel'],$observer);
- $a->set_widget('photo_albums',photos_album_widget($a->data['channel'],$observer,$a->data['albums']));
- }
$a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "'; var profile_uid = " . (($a->data['channel']) ? $a->data['channel']['channel_id'] : 0) . "; </script>" ;
@@ -596,6 +590,8 @@ function photos_content(&$a) {
// Parse arguments
//
+ $can_comment = perm_is_allowed($a->profile['profile_uid'],get_observer_hash(),'post_comments');
+
if(argc() > 3) {
$datatype = argv(2);
$datum = argv(3);
@@ -699,8 +695,19 @@ function photos_content(&$a) {
$usage_message = sprintf( t('You have used %1$.2f Mbytes of photo storage.'), $r[0]['total'] / 1024000 );
}
+ if($_is_owner) {
+ $channel = $a->get_channel();
+
+ $channel_acl = array(
+ 'allow_cid' => $channel['channel_allow_cid'],
+ 'allow_gid' => $channel['channel_allow_gid'],
+ 'deny_cid' => $channel['channel_deny_cid'],
+ 'deny_gid' => $channel['channel_deny_gid']
+ );
+ }
+
$albumselect_e = $albumselect;
- $aclselect_e = (($_is_owner) ? populate_acl($a->get_channel(), false) : '');
+ $aclselect_e = (($_is_owner) ? populate_acl($channel_acl) : '');
$tpl = get_markup_template('photos_upload.tpl');
$o .= replace_macros($tpl,array(
@@ -1052,7 +1059,7 @@ function photos_content(&$a) {
$likebuttons = '';
- if($can_post || $a->data['perms']['post_comments']) {
+ if($can_post || $can_comment) {
$likebuttons = replace_macros($like_tpl,array(
'$id' => $link_item['id'],
'$likethis' => t("I like this \x28toggle\x29"),
@@ -1064,7 +1071,7 @@ function photos_content(&$a) {
$comments = '';
if(! count($r)) {
- if($can_post || $a->data['perms']['post_comments']) {
+ if($can_post || $can_comment) {
$comments .= replace_macros($cmnt_tpl,array(
'$return_path' => '',
'$mode' => 'photos',
@@ -1152,7 +1159,7 @@ function photos_content(&$a) {
}
- if($can_post || $a->data['perms']['post_comments']) {
+ if($can_post || $can_comment) {
$comments .= replace_macros($cmnt_tpl,array(
'$return_path' => '',
'$jsreload' => $return_url,