diff options
Diffstat (limited to 'mod/photos.php')
-rw-r--r-- | mod/photos.php | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/mod/photos.php b/mod/photos.php index 23733e121..6798cb002 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -763,7 +763,7 @@ function photos_content(&$a) { /* Check again - this time without specifying permissions */ - $ph = q("SELECT `id` FROM `photo` WHERE `uid` = %d AND `resource_id` = '%s' + $ph = q("SELECT id FROM photo WHERE uid = %d AND resource_id = '%s' and ( photo_flags = %d or photo_flags = %d ) LIMIT 1", intval($owner_uid), @@ -778,6 +778,8 @@ function photos_content(&$a) { return; } + + $prevlink = ''; $nextlink = ''; @@ -873,6 +875,9 @@ function photos_content(&$a) { if($linked_items) { + xchan_query($linked_items); + $linked_items = fetch_post_tags($linked_items,true); + $link_item = $linked_items[0]; $r = q("select * from item where parent_mid = '%s' @@ -888,6 +893,21 @@ function photos_content(&$a) { $r = conv_sort($r,'commented'); } + + + $tags = array(); + if($link_item['term']) { + $cnt = 0; + foreach($link_item['term'] as $t) + $tags[$cnt] = array(0 => format_term_for_display($t)); + if($can_post && ($ph[0]['uid'] == $owner_uid)) { + $tags[$cnt][1] = 'tagrm?f=&item=' . $link_item['id']; + $tags[$cnt][2] = t('Remove'); + } + $cnt ++; + } + + if((local_user()) && (local_user() == $link_item['uid'])) { q("UPDATE `item` SET item_flags = (item_flags ^ %d) WHERE parent = %d and uid = %d and (item_flags & %d)", intval(ITEM_UNSEEN), @@ -898,6 +918,8 @@ function photos_content(&$a) { } } +// logger('mod_photo: link_item' . print_r($link_item,true)); + // FIXME - remove this when we move to conversation module $r = $r[0]['children']; @@ -921,7 +943,6 @@ function photos_content(&$a) { 'capt_label' => t('Caption'), 'caption' => $caption_e, 'tag_label' => t('Add a Tag'), - 'tags' => $link_item['tag'], 'permissions' => t('Permissions'), 'aclselect' => $aclselect_e, 'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com, #California, #camping'), @@ -1063,10 +1084,10 @@ function photos_content(&$a) { } $album_e = array($album_link,$ph[0]['album']); - $tags_e = $tags; $like_e = $like; $dislike_e = $dislike; + $photo_tpl = get_markup_template('photo_view.tpl'); $o .= replace_macros($photo_tpl, array( '$id' => $ph[0]['id'], @@ -1077,7 +1098,8 @@ function photos_content(&$a) { '$prevlink' => $prevlink, '$nextlink' => $nextlink, '$desc' => $ph[0]['description'], - '$tags' => $tags_e, + '$tag_hdr' => t('In This Photo:'), + '$tags' => $tags, '$edit' => $edit, '$likebuttons' => $likebuttons, '$like' => $like_e, |