aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/conversation.php3
-rw-r--r--include/photo/photo_gd.php2
-rw-r--r--include/text.php2
-rw-r--r--include/zot.php22
-rw-r--r--view/theme/redbasic/css/style.css1
-rwxr-xr-xview/tpl/conv_item.tpl19
-rwxr-xr-xview/tpl/conv_list.tpl14
-rw-r--r--view/tpl/item_attach.tpl2
8 files changed, 44 insertions, 21 deletions
diff --git a/include/conversation.php b/include/conversation.php
index c2d9641ba..b2d58a025 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -681,7 +681,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
$body = prepare_body($item,true);
- $is_photo = ((($item['resource_type'] == 'photo') && (feature_enabled($profile_owner,'large_photos'))) ? true : false);
$has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false);
$tmp_item = array(
@@ -698,6 +697,7 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
'thumb' => $profile_avatar,
'title' => $item['title'],
'body' => $body['html'],
+ 'photo' => $body['photo'],
'tags' => $body['tags'],
'categories' => $body['categories'],
'mentions' => $body['mentions'],
@@ -738,7 +738,6 @@ function conversation(&$a, $items, $mode, $update, $page_mode = 'traditional', $
'previewing' => $previewing,
'wait' => t('Please wait'),
'thread_level' => 1,
- 'is_photo' => $is_photo,
'has_tags' => $has_tags,
);
diff --git a/include/photo/photo_gd.php b/include/photo/photo_gd.php
index fa1f700e9..2ac7287e4 100644
--- a/include/photo/photo_gd.php
+++ b/include/photo/photo_gd.php
@@ -137,4 +137,4 @@ class photo_gd extends photo_driver {
return $string;
}
-} \ No newline at end of file
+}
diff --git a/include/text.php b/include/text.php
index 5df7bb4a1..c2573da0c 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1233,7 +1233,7 @@ function theme_attachments(&$item) {
if($label == ' ')
$label = t('Unknown Attachment');
- $title = t('Attachment') . ' - ' . (($r['length']) ? userReadableSize($r['length']) : t('Size Unknown'));
+ $title = t('Size') . ' ' . (($r['length']) ? userReadableSize($r['length']) : t('unknown'));
require_once('include/identity.php');
if(is_foreigner($item['author_xchan']))
diff --git a/include/zot.php b/include/zot.php
index 793eb6b39..73c7460d3 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -814,6 +814,28 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED, $ud_arr = null) {
if ($local) {
$ph = z_fetch_url($arr['photo'], true);
if ($ph['success']) {
+
+ // unless proven otherwise
+ $is_default_profile = 1;
+
+ $profile = q("select is_default from profile where aid = %d and uid = %d limit 1",
+ intval($local[0]['channel_account_id']),
+ intval($local[0]['channel_id'])
+ );
+ if($profile) {
+ if(! intval($profile[0]['is_default']))
+ $is_default_profile = 0;
+ }
+
+ if($is_default_profile) {
+ q("UPDATE photo SET photo_usage = %d WHERE photo_usage = %d AND aid = %d AND uid = %d",
+ intval(PHOTO_NORMAL),
+ intval(PHOTO_PROFILE),
+ intval($local[0]['channel_account_id']),
+ intval($local[0]['channel_id'])
+ );
+ }
+
import_channel_photo($ph['body'], $arr['photo_mimetype'], $local[0]['channel_account_id'],$local[0]['channel_id']);
// reset the names in case they got messed up when we had a bug in this function
$photos = array(
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index 9403b078e..e83610f51 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -757,6 +757,7 @@ a.rateme, div.rateme {
.wall-item-conv {
padding: 7px 10px;
+ background-color: $comment_item_colour;
}
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index 760d64db0..4782f827b 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -69,11 +69,6 @@
<span class="tag">{{$item.folders}}</span>
</div>
{{/if}}
- {{if $item.attachments}}
- <div class="body-tags" id="item-attachments">
- <span class='tag'>{{$item.attachments}}</span>
- </div>
- {{/if}}
<div class="clear"></div>
</div>
{{/if}}
@@ -157,9 +152,15 @@
</div>
<div id="like-rotator-{{$item.id}}" class="like-rotator"></div>
- {{if $item.responses }}
- <div class="wall-item-tools-left{{if $item.responses.count > 1}} btn-group{{/if}}">
- {{foreach $item.responses as $verb=>$response}}
+ {{if $item.responses || $item.attachments}}
+ <div class="wall-item-tools-left{{if ($item.responses.count > 1) || ($item.responses.count && $item.attachments)}} btn-group{{/if}}">
+ {{if $item.attachments}}
+ <div class="btn-group">
+ <button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="attachment-menu-{{$item.id}}"><i class="icon-paperclip"></i></button>
+ <ul class="dropdown-menu" role="menu" aria-labelledby="attachment-menu-{{$item.id}}">{{$item.attachments}}</ul>
+ </div>
+ {{/if}}
+ {{foreach $item.responses as $verb=>$response}}
{{if $response.count}}
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="wall-item-{{$verb}}-{{$item.id}}">{{$response.count}} {{$response.button}}</button>
@@ -188,7 +189,7 @@
{{/if}}
</div>
{{/if}}
- {{/foreach}}
+ {{/foreach}}
</div>
{{/if}}
<div class="clear"></div>
diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl
index a3fb642ce..53f65bc78 100755
--- a/view/tpl/conv_list.tpl
+++ b/view/tpl/conv_list.tpl
@@ -66,11 +66,6 @@
<span class="tag">{{$item.folders}}</span>
</div>
{{/if}}
- {{if $item.attachments}}
- <div class="body-tags" id="item-attachments">
- <span class='tag'>{{$item.attachments}}</span>
- </div>
- {{/if}}
<div class="clear"></div>
</div>
{{/if}}
@@ -151,7 +146,13 @@
</ul>
</div>
<div id="like-rotator-{{$item.id}}" class="like-rotator"></div>
- <div class="wall-item-tools-left{{if $item.unseen_comments || $item.like_count || $item.dislike_count}} btn-group{{/if}}">
+ <div class="wall-item-tools-left{{if $item.unseen_comments || $item.like_count || $item.dislike_count || $item.attachments}} btn-group{{/if}}">
+ {{if $item.attachments}}
+ <div class="btn-group">
+ <button type="button" class="btn btn-default btn-sm wall-item-like dropdown-toggle" data-toggle="dropdown" id="attachment-menu-{{$item.id}}"><i class="icon-paperclip"></i></button>
+ <ul class="dropdown-menu" role="menu" aria-labelledby="attachment-menu-{{$item.id}}">{{$item.attachments}}</ul>
+ </div>
+ {{/if}}
<div class="wall-item-list-comments btn-group">
<button class="btn btn-default btn-sm" onclick="window.location.href='{{$item.viewthread}}'; return false;">
{{$item.comment_count_txt}}{{if $item.unseen_comments}}<span class="unseen-wall-indicator-{{$item.id}}">, {{$item.list_unseen_txt}}</span>{{/if}}
@@ -164,7 +165,6 @@
</button>
</div>
{{/if}}
-
{{if $item.responses }}
{{foreach $item.responses as $verb=>$response}}
{{if $response.count}}
diff --git a/view/tpl/item_attach.tpl b/view/tpl/item_attach.tpl
index 7638f39e7..67accc1ec 100644
--- a/view/tpl/item_attach.tpl
+++ b/view/tpl/item_attach.tpl
@@ -1,5 +1,5 @@
{{if $attaches}}
{{foreach $attaches as $a}}
-<a href="{{$a.url}}" title="{{$a.title}}" class="btn btn-xs btn-default"><i class="{{$a.icon}} attach-icons"></i>&nbsp;{{$a.label}}</a>
+<li><a href="{{$a.url}}" title="{{$a.title}}"><i class="{{$a.icon}} attach-icons"></i>&nbsp;{{$a.label}}</a></li>
{{/foreach}}
{{/if}}