aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ItemObject.php2
-rwxr-xr-xinclude/diaspora.php2
-rw-r--r--include/dir_fns.php8
-rw-r--r--include/features.php1
-rwxr-xr-xinclude/items.php2
-rw-r--r--include/permissions.php2
-rw-r--r--include/zot.php21
-rw-r--r--mod/dirsearch.php6
-rwxr-xr-xmod/like.php18
-rw-r--r--mod/mail.php8
-rw-r--r--mod/photos.php3
-rw-r--r--mod/wall_upload.php1
-rw-r--r--version.inc2
-rwxr-xr-xview/tpl/conv_list.tpl9
-rwxr-xr-xview/tpl/msg-header.tpl28
-rwxr-xr-xview/tpl/photo_view.tpl3
-rwxr-xr-xview/tpl/prv_message.tpl14
17 files changed, 80 insertions, 50 deletions
diff --git a/include/ItemObject.php b/include/ItemObject.php
index 6f1c76fa1..f6f7c0fba 100644
--- a/include/ItemObject.php
+++ b/include/ItemObject.php
@@ -79,7 +79,7 @@ class Item extends BaseObject {
$indent = '';
$osparkle = '';
$total_children = $this->count_descendants();
- $unseen_comments = (($item->real_uid) ? 0 : $this->count_unseen_descendants());
+ $unseen_comments = (($item['real_uid']) ? 0 : $this->count_unseen_descendants());
$conv = $this->get_conversation();
$observer = $conv->get_observer();
diff --git a/include/diaspora.php b/include/diaspora.php
index 09521b82b..b4f20528d 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -1788,7 +1788,7 @@ function diaspora_like($importer,$xml,$msg) {
$contact = diaspora_get_contact_by_handle($importer['channel_id'],$msg['author']);
if(! $contact) {
- logger('diaspora_like: cannot find contact: ' . $msg['author']);
+ logger('diaspora_like: cannot find contact: ' . $msg['author'] . ' for channel ' . $importer['channel_name']);
return;
}
diff --git a/include/dir_fns.php b/include/dir_fns.php
index 8f27fb85d..0ba4f8712 100644
--- a/include/dir_fns.php
+++ b/include/dir_fns.php
@@ -38,7 +38,7 @@ function check_upstream_directory() {
*/
$directory = get_config('system','directory_server');
if ($directory) {
- $r = q("select * from site where site_url = '%s' and (site_flags & %d)>0 ",
+ $r = q("select * from site where site_url = '%s' and (site_flags & %d) > 0 ",
dbesc($directory),
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY|DIRECTORY_MODE_STANDALONE)
);
@@ -86,14 +86,14 @@ function sync_directories($dirmode) {
$realm = get_directory_realm();
if($realm == DIRECTORY_REALM) {
- $r = q("select * from site where (site_flags & %d)>0 and site_url != '%s' and ( site_realm = '%s' or site_realm = '') ",
+ $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and ( site_realm = '%s' or site_realm = '') ",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
dbesc($realm)
);
}
else {
- $r = q("select * from site where (site_flags & %d)>0 and site_url != '%s' and site_realm like '%s' ",
+ $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s' and site_realm like '%s' ",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root()),
dbesc(protect_sprintf('%' . $realm . '%'))
@@ -120,7 +120,7 @@ function sync_directories($dirmode) {
dbesc($r[0]['site_realm'])
);
- $r = q("select * from site where (site_flags & %d)>0 and site_url != '%s'",
+ $r = q("select * from site where (site_flags & %d) > 0 and site_url != '%s'",
intval(DIRECTORY_MODE_PRIMARY|DIRECTORY_MODE_SECONDARY),
dbesc(z_root())
);
diff --git a/include/features.php b/include/features.php
index 7530158ec..92d8598a5 100644
--- a/include/features.php
+++ b/include/features.php
@@ -48,6 +48,7 @@ function get_features() {
array('preview', t('Post Preview'), t('Allow previewing posts and comments before publishing them')),
array('channel_sources', t('Channel Sources'), t('Automatically import channel content from other channels or feeds')),
array('content_encrypt', t('Even More Encryption'), t('Allow optional encryption of content end-to-end with a shared secret key')),
+ array('adult_photo_flagging', t('Flag Adult Photos'), t('Provide photo edit option to hide adult photos from default album view')),
),
// Network Tools
diff --git a/include/items.php b/include/items.php
index 19de52e92..00edeabdd 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4285,7 +4285,7 @@ function zot_feed($uid,$observer_xchan,$arr) {
$mindate = NULL_DATE;
$mindate = dbesc($mindate);
- logger('zot_feed: ' . $uid);
+ logger('zot_feed: requested for uid ' . $uid . ' from observer ' . $observer_xchan, LOGGER_DEBUG);
if(! perm_is_allowed($uid,$observer_xchan,'view_stream')) {
logger('zot_feed: permission denied.');
diff --git a/include/permissions.php b/include/permissions.php
index 0ad28b3f1..b078de4d5 100644
--- a/include/permissions.php
+++ b/include/permissions.php
@@ -257,7 +257,7 @@ function perm_is_allowed($uid,$observer_xchan,$permission) {
$channel_perm = $global_perms[$permission][0];
- $r = q("select %s, channel_hash from channel where channel_id = %d limit 1",
+ $r = q("select %s, channel_pageflags, channel_hash from channel where channel_id = %d limit 1",
dbesc($channel_perm),
intval($uid)
);
diff --git a/include/zot.php b/include/zot.php
index 3ffc9b43f..3b8584509 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -1256,8 +1256,14 @@ function zot_import($arr, $sender_url) {
function public_recips($msg) {
+
+ require_once('include/identity.php');
+
$check_mentions = false;
+ $include_sys = false;
+
if($msg['message']['type'] === 'activity') {
+ $include_sys = true;
$col = 'channel_w_stream';
$field = PERMS_W_STREAM;
if(array_key_exists('flags',$msg['message']) && in_array('thread_parent', $msg['message']['flags'])) {
@@ -1307,6 +1313,14 @@ function public_recips($msg) {
$r = array_merge($r,$x);
+ //logger('message: ' . print_r($msg['message'],true));
+
+ if($include_sys && array_key_exists('public_scope',$msg['message']) && $msg['message']['public_scope'] === 'public') {
+ $sys = get_sys_channel();
+ if($sys)
+ $r[] = array('hash' => $sys['channel_hash']);
+ }
+
// look for any public mentions on this site
// They will get filtered by tgroup_check() so we don't need to check permissions now
@@ -1337,7 +1351,7 @@ function public_recips($msg) {
function allowed_public_recips($msg) {
- logger('allowed_public_recips: ' . print_r($msg,true));
+ logger('allowed_public_recips: ' . print_r($msg,true),LOGGER_DATA);
$recips = public_recips($msg);
@@ -1414,8 +1428,13 @@ function process_delivery($sender,$arr,$deliveries,$relay,$public = false,$reque
continue;
}
+
$channel = $r[0];
+ // allow public postings to the sys channel regardless of permissions
+ if(($channel['channel_pageflags'] & PAGE_SYSTEM) && (! $arr['item_private']))
+ $public = true;
+
$tag_delivery = tgroup_check($channel['channel_id'],$arr);
$perm = (($arr['mid'] == $arr['parent_mid']) ? 'send_stream' : 'post_comments');
diff --git a/mod/dirsearch.php b/mod/dirsearch.php
index 52d953707..56e2378a8 100644
--- a/mod/dirsearch.php
+++ b/mod/dirsearch.php
@@ -305,6 +305,12 @@ function dir_parse_query($s) {
$curr['value'] = substr($curr['value'],1);
continue;
}
+ elseif($curr['value'][0] == '"' && $curr['value'][strlen($curr['value'])-1] == '"') {
+ $curr['value'] = substr($curr['value'],1,strlen($curr['value'])-2);
+ $ret[] = $curr;
+ $curr = array();
+ continue;
+ }
else {
$ret[] = $curr;
$curr = array();
diff --git a/mod/like.php b/mod/like.php
index b56611197..04a2b43cd 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -263,26 +263,18 @@ function like_content(&$a) {
else
killme();
-
- $r = q("SELECT * FROM item WHERE verb = '%s' AND item_restrict = 0
+ $r = q("SELECT id FROM item WHERE verb = '%s' AND item_restrict = 0
AND author_xchan = '%s' AND ( parent = %d OR thr_parent = '%s') LIMIT 1",
dbesc($activity),
dbesc($observer['xchan_hash']),
intval($item_id),
dbesc($item['mid'])
);
- if($r) {
- $like_item = $r[0];
-
- // Already liked/disliked it, delete it
- $r = q("UPDATE item SET item_restrict = ( item_restrict & ~%d ), changed = '%s' WHERE id = %d",
- intval(ITEM_DELETED),
- dbesc(datetime_convert()),
- intval($like_item['id'])
- );
-
- proc_run('php',"include/notifier.php","like",$like_item['id']);
+ if($r) {
+ // already liked it. Drop that item.
+ require_once('include/items.php');
+ drop_item($r[0]['id'],false,DROPITEM_PHASE1);
return;
}
diff --git a/mod/mail.php b/mod/mail.php
index dacb181c5..6c778b956 100644
--- a/mod/mail.php
+++ b/mod/mail.php
@@ -113,6 +113,7 @@ function mail_content(&$a) {
}
$channel = $a->get_channel();
+
head_set_icon($channel['xchan_photo_s']);
$cipher = get_pconfig(local_user(),'system','default_cipher');
@@ -163,13 +164,16 @@ function mail_content(&$a) {
$tpl = get_markup_template('msg-header.tpl');
- $a->page['htmlhead'] .= replace_macros($tpl, array(
+ $header = replace_macros($tpl, array(
'$baseurl' => $a->get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$nickname' => $channel['channel_address'],
'$linkurl' => t('Please enter a link URL:'),
'$expireswhen' => t('Expires YYYY-MM-DD HH:MM')
));
+
+ $a->page['htmlhead'] .= $header;
+
$preselect = (isset($a->argv[2])?array($a->argv[2]):false);
$prename = $preurl = $preid = '';
@@ -276,7 +280,7 @@ function mail_content(&$a) {
$tpl = get_markup_template('msg-header.tpl');
$a->page['htmlhead'] .= replace_macros($tpl, array(
- '$nickname' => $channel['channel_addr'],
+ '$nickname' => $channel['channel_address'],
'$baseurl' => $a->get_baseurl(true),
'$editselect' => (($plaintext) ? 'none' : '/(profile-jot-text|prvmail-text)/'),
'$linkurl' => t('Please enter a link URL:'),
diff --git a/mod/photos.php b/mod/photos.php
index ab848c709..7a9229cc4 100644
--- a/mod/photos.php
+++ b/mod/photos.php
@@ -952,6 +952,7 @@ function photos_content(&$a) {
'lockstate' => $lockstate[0],
'help_tags' => t('Example: @bob, @Barbara_Jensen, @jim@example.com'),
'item_id' => ((count($linked_items)) ? $link_item['id'] : 0),
+ 'adult_enabled' => feature_enabled($owner_uid,'adult_photo_flagging'),
'adult' => array('adult',t('Flag as adult in album view'), (($ph[0]['photo_flags'] & PHOTO_ADULT) ? 1 : 0),''),
'submit' => t('Submit'),
'delete' => t('Delete Photo')
@@ -1175,7 +1176,7 @@ function photos_content(&$a) {
$r = q("SELECT p.resource_id, p.id, p.filename, p.type, p.album, p.scale, p.created FROM photo p INNER JOIN
(SELECT resource_id, max(scale) scale FROM photo
WHERE uid=%d AND album != '%s' AND album != '%s'
- AND (photo_flags = %d or photo_flags = %d ) $sql_extra group by resource_id) ph
+ AND (photo_flags = %d or ( photo_flags & %d ) > 0 ) $sql_extra group by resource_id) ph
ON (p.resource_id = ph.resource_id and p.scale = ph.scale) ORDER by p.created DESC LIMIT %d OFFSET %d",
intval($a->data['channel']['channel_id']),
dbesc('Contact Photos'),
diff --git a/mod/wall_upload.php b/mod/wall_upload.php
index 97840a180..7ed1859a8 100644
--- a/mod/wall_upload.php
+++ b/mod/wall_upload.php
@@ -8,6 +8,7 @@ require_once('include/photos.php');
function wall_upload_post(&$a) {
+
$using_api = ((x($_FILES,'media')) ? true : false);
if($using_api) {
diff --git a/version.inc b/version.inc
index 2679ebdf3..97d0c5a13 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-11-18.863
+2014-11-19.864
diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl
index b9a966e93..aec1a78ab 100755
--- a/view/tpl/conv_list.tpl
+++ b/view/tpl/conv_list.tpl
@@ -104,7 +104,12 @@
</ul>
</div>
<div id="like-rotator-{{$item.id}}" class="like-rotator"></div>
- <div class="wall-item-tools-left{{if $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}} btn-group{{/if}}">
+
+
+ <div class="wall-item-list-comments btn-group"><button class="btn btn-default btn-sm" onclick="window.location.href='{{$item.llink}}'; return false;">{{$item.comment_count_txt}}{{if $item.unseen_comments}}
+<span class="unseen-wall-indicator-{{$item.id}}">, {{$item.list_unseen_txt}}{{/if}}</span></button></div>{{if $item.unseen_comments}}<div class="unseen-wall-indicator-{{$item.id}} btn-group"><button class="btn btn-default btn-sm" title="{{$item.markseen}}" onclick="markItemRead({{$item.id}}); return false;"><i class="icon-check"></i></div>{{/if}}
+
{{if $item.like_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-like-{{$item.id}}">{{$item.like_count}} {{$item.like_button_label}}</button>
@@ -164,8 +169,6 @@
{{/if}}
</div>
<div class="clear"></div>
- <div class="wall-item-list-comments"><a href="{{$item.llink}}">{{$item.comment_count_txt}}{{if $item.unseen_comments}}
-<span class="unseen-wall-indicator-{{$item.id}}">, {{$item.list_unseen_txt}}{{/if}}</span></a>{{if $item.unseen_comments}}<span class="unseen-wall-indicator-{{$item.id}}">&nbsp;&nbsp;&nbsp;<button class="btn btn-default" title="{{$item.markseen}}" onclick="markItemRead({{$item.id}}); return false;"><i class="icon-check"></i></span>{{/if}}</div>
</div>
<div class="wall-item-wrapper-end"></div>
<div class="wall-item-outside-wrapper-end {{$item.indent}}" ></div>
diff --git a/view/tpl/msg-header.tpl b/view/tpl/msg-header.tpl
index 503e4c8cc..85fa51b0a 100755
--- a/view/tpl/msg-header.tpl
+++ b/view/tpl/msg-header.tpl
@@ -52,10 +52,10 @@ else
'prvmail-upload-wrapper',
{ action: 'wall_upload/{{$nickname}}',
name: 'userfile',
- onSubmit: function(file,ext) { $('#profile-rotator').spin('tiny'); },
+ onSubmit: function(file,ext) { $('#prvmail-rotator').spin('tiny'); },
onComplete: function(file,response) {
- addeditortext(response);
- $('#profile-rotator').spin(false);
+ addmailtext(response);
+ $('#prvmail-rotator').spin(false);
}
}
);
@@ -64,23 +64,23 @@ else
'prvmail-attach-wrapper',
{ action: 'wall_attach/{{$nickname}}',
name: 'userfile',
- onSubmit: function(file,ext) { $('#profile-rotator').spin('tiny'); },
+ onSubmit: function(file,ext) { $('#prvmail-rotator').spin('tiny'); },
onComplete: function(file,response) {
- addeditortext(response);
- $('#profile-rotator').spin(false);
+ addmailtext(response);
+ $('#prvmail-rotator').spin(false);
}
}
);
});
- function jotGetLink() {
+ function prvmailJotGetLink() {
reply = prompt("{{$linkurl}}");
if(reply && reply.length) {
- $('#profile-rotator').spin('tiny');
+ $('#prvmail-rotator').spin('tiny');
$.get('parse_url?url=' + reply, function(data) {
- addeditortext(response);
- $('#profile-rotator').spin(false);
+ addmailtext(data);
+ $('#prvmail-rotator').spin(false);
});
}
}
@@ -103,15 +103,15 @@ else
event.target.textContent = reply;
event.preventDefault();
if(reply && reply.length) {
- $('#profile-rotator').spin('tiny');
+ $('#prvmail-rotator').spin('tiny');
$.get('parse_url?url=' + reply, function(data) {
- addeditortext(response);
- $('#profile-rotator').spin(false);
+ addmailtext(data);
+ $('#prvmail-rotator').spin(false);
});
}
}
- function addeditortext(data) {
+ function addmailtext(data) {
if(plaintext == 'none') {
var currentText = $("#prvmail-text").val();
$("#prvmail-text").val(currentText + data);
diff --git a/view/tpl/photo_view.tpl b/view/tpl/photo_view.tpl
index a741a5ce7..45a7cd7e5 100755
--- a/view/tpl/photo_view.tpl
+++ b/view/tpl/photo_view.tpl
@@ -59,9 +59,12 @@
<label class="radio-inline" id="photo-edit-rotate-cw-label" for="photo-edit-rotate-cw"><input id="photo-edit-rotate-cw" type="radio" name="rotate" value="1" />{{$edit.rotatecw}}</label>
<label class="radio-inline" id="photo-edit-rotate-ccw-label" for="photo-edit-rotate-ccw"><input id="photo-edit-rotate-ccw" type="radio" name="rotate" value="2" />{{$edit.rotateccw}}</label>
</div>
+ {{if $edit.adult_enabled}}
<div class="form-group">
{{include file="field_checkbox.tpl" field=$edit.adult}}
</div>
+ {{/if}}
+
{{$edit.aclselect}}
<div class="form-group pull-left">
diff --git a/view/tpl/prv_message.tpl b/view/tpl/prv_message.tpl
index 709943541..c6f393aa4 100755
--- a/view/tpl/prv_message.tpl
+++ b/view/tpl/prv_message.tpl
@@ -34,21 +34,21 @@
<i id="prvmail-attach" class="icon-paper-clip jot-icons" title="{{$attach}}"></i>
</button>
- <button id="prvmail-link-wrapper" class="btn btn-default btn-sm" >
- <i id="prvmail-link" class="icon-link jot-icons" title="{{$insert}}" onclick="jotGetLink(); return false;"></i>
+ <button id="prvmail-link-wrapper" class="btn btn-default btn-sm" onclick="prvmailJotGetLink(); return false;" >
+ <i id="prvmail-link" class="icon-link jot-icons" title="{{$insert}}" ></i>
</button>
{{if $feature_expire}}
- <button id="prvmail-expire-wrapper" class="btn btn-default btn-sm" >
- <i id="prvmail-expires" class="icon-eraser jot-icons" title="{{$expires}}" onclick="prvmailGetExpiry();return false;"></i>
+ <button id="prvmail-expire-wrapper" class="btn btn-default btn-sm" onclick="prvmailGetExpiry();return false;" >
+ <i id="prvmail-expires" class="icon-eraser jot-icons" title="{{$expires}}" ></i>
</button>
{{/if}}
{{if $feature_encrypt}}
- <button id="prvmail-encrypt-wrapper" class="btn btn-default btn-sm" >
- <i id="prvmail-encrypt" class="icon-key jot-icons" title="{{$encrypt}}" onclick="red_encrypt('{{$cipher}}','#prvmail-text',$('#prvmail-text').val());return false;"></i>
+ <button id="prvmail-encrypt-wrapper" class="btn btn-default btn-sm" onclick="red_encrypt('{{$cipher}}','#prvmail-text',$('#prvmail-text').val());return false;">
+ <i id="prvmail-encrypt" class="icon-key jot-icons" title="{{$encrypt}}" ></i>
</button>
{{/if}}
<div id="prvmail-rotator-wrapper" >
- <img id="prvmail-rotator" src="images/rotator.gif" alt="{{$wait}}" title="{{$wait}}" style="display: none;" />
+ <div id="prvmail-rotator"></div>
</div>
</div>
<div id="prvmail-end"></div>