Merge remote-tracking branch 'mike/master' into dev
This commit is contained in:
commit
a618f70f56
@ -407,6 +407,7 @@ class ThreadItem {
|
||||
'showdislike' => $showdislike,
|
||||
'comment' => $this->get_comment_box($indent),
|
||||
'previewing' => ($conv->is_preview() ? true : false ),
|
||||
'preview_lbl' => t('This is an unsaved preview'),
|
||||
'wait' => t('Please wait'),
|
||||
'submid' => str_replace(['+','='], ['',''], base64_encode(substr($item['mid'],0,32))),
|
||||
'thread_level' => $thread_level
|
||||
|
@ -30,7 +30,7 @@ class Ap_probe extends \Zotlabs\Web\Controller {
|
||||
$redirects = 0;
|
||||
$x = z_fetch_url($addr,true,$redirects, [ 'headers' => [ $headers ]]);
|
||||
if($x['success'])
|
||||
$o .= '<pre>' . str_replace('\\','',jindent($x['body'])) . '</pre>';
|
||||
$o .= '<pre>' . str_replace(['\\n','\\'],["\n",''],jindent($x['body'])) . '</pre>';
|
||||
}
|
||||
return $o;
|
||||
}
|
||||
|
@ -358,9 +358,13 @@ class Channel extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
if($is_owner && $update_unseen) {
|
||||
$r = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 and item_wall = 1 AND uid = %d $update_unseen",
|
||||
intval(local_channel())
|
||||
);
|
||||
$x = [ 'channel_id' => local_channel(), 'update' => 'unset' ];
|
||||
call_hooks('update_unseen',$x);
|
||||
if($x['update'] === 'unset' || intval($x['update'])) {
|
||||
$r = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 and item_wall = 1 AND uid = %d $update_unseen",
|
||||
intval(local_channel())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -545,10 +545,15 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
}
|
||||
|
||||
if(($update_unseen) && (! $firehose))
|
||||
$r = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d $update_unseen ",
|
||||
intval(local_channel())
|
||||
);
|
||||
if(($update_unseen) && (! $firehose)) {
|
||||
$x = [ 'channel_id' => local_channel(), 'update' => 'unset' ];
|
||||
call_hooks('update_unseen',$x);
|
||||
if($x['update'] === 'unset' || intval($x['update'])) {
|
||||
$r = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d $update_unseen ",
|
||||
intval(local_channel())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$mode = (($nouveau) ? 'network-new' : 'network');
|
||||
|
||||
|
@ -15,12 +15,16 @@ class Notify extends \Zotlabs\Web\Controller {
|
||||
intval(local_channel())
|
||||
);
|
||||
if($r) {
|
||||
q("update notify set seen = 1 where (( parent != '' and parent = '%s' and otype = '%s' ) or link = '%s' ) and uid = %d",
|
||||
dbesc($r[0]['parent']),
|
||||
dbesc($r[0]['otype']),
|
||||
dbesc($r[0]['link']),
|
||||
intval(local_channel())
|
||||
);
|
||||
$x = [ 'channel_id' => local_channel(), 'update' => 'unset' ];
|
||||
call_hooks('update_unseen',$x);
|
||||
if($x['update'] === 'unset' || intval($x['update'])) {
|
||||
q("update notify set seen = 1 where (( parent != '' and parent = '%s' and otype = '%s' ) or link = '%s' ) and uid = %d",
|
||||
dbesc($r[0]['parent']),
|
||||
dbesc($r[0]['otype']),
|
||||
dbesc($r[0]['link']),
|
||||
intval(local_channel())
|
||||
);
|
||||
}
|
||||
goaway($r[0]['link']);
|
||||
}
|
||||
goaway(z_root());
|
||||
|
9
doc/hook/update_unseen.bb
Normal file
9
doc/hook/update_unseen.bb
Normal file
@ -0,0 +1,9 @@
|
||||
[h3]update_unseen[/h3]
|
||||
|
||||
Called prior to automatically marking items 'seen'; allowing a plugin the choice to not perform this action.
|
||||
|
||||
hook data
|
||||
|
||||
[ 'channel_id' => local_channel(), 'update' => 'unset' ];
|
||||
|
||||
If 'update' is set to 0 or false on return, the update operation is not performed.
|
@ -572,6 +572,9 @@ Hooks allow plugins/addons to "hook into" the code at many points and alter the
|
||||
[zrl=[baseurl]/help/hook/tagged]tagged[/zrl]
|
||||
Called when a delivery is processed which results in you being tagged
|
||||
|
||||
[zrl=[baseurl]/help/hook/update_unseen]update_unseen[/zrl]
|
||||
Called prior to automatically marking items seen which were loaded in the browser
|
||||
|
||||
[zrl=[baseurl]/help/hook/validate_channelname]validate_channelname[/zrl]
|
||||
Used to validate the names used by a channel
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
require_once('include/oembed.php');
|
||||
require_once('include/event.php');
|
||||
require_once('include/zot.php');
|
||||
|
||||
require_once('include/html2plain.php');
|
||||
|
||||
function get_bb_tag_pos($s, $name, $occurance = 1) {
|
||||
|
||||
|
@ -467,6 +467,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
|
||||
|
||||
$preview = (($page_mode === 'preview') ? true : false);
|
||||
$previewing = (($preview) ? ' preview ' : '');
|
||||
$preview_lbl = t('This is an unsaved preview');
|
||||
|
||||
if ($mode === 'network') {
|
||||
|
||||
@ -684,6 +685,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
|
||||
'mode' => $mode,
|
||||
'approve' => t('Approve'),
|
||||
'delete' => t('Delete'),
|
||||
'preview_lbl' => $preview_lbl,
|
||||
'id' => (($preview) ? 'P0' : $item['item_id']),
|
||||
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url),
|
||||
'profile_url' => $profile_link,
|
||||
|
@ -157,11 +157,11 @@ function bb_to_markdown($Text, $options = []) {
|
||||
* Transform #tags, strip off the [url] and replace spaces with underscore
|
||||
*/
|
||||
|
||||
$Text = preg_replace_callback('/#\[([zu])rl\=(\w+.*?)\](\w+.*?)\[\/[(zu)]rl\]/i',
|
||||
$Text = preg_replace_callback('/#\[([zu])rl\=(.*?)\](.*?)\[\/[(zu)]rl\]/i',
|
||||
create_function('$match', 'return \'#\'. str_replace(\' \', \'_\', $match[3]);'), $Text);
|
||||
|
||||
|
||||
$Text = preg_replace('/#\^\[([zu])rl\=(\w+.*?)\](\w+.*?)\[\/([zu])rl\]/i', '[$1rl=$2]$3[/$4rl]', $Text);
|
||||
$Text = preg_replace('/#\^\[([zu])rl\=(.*?)\](.*?)\[\/([zu])rl\]/i', '[$1rl=$2]$3[/$4rl]', $Text);
|
||||
|
||||
// Converting images with size parameters to simple images. Markdown doesn't know it.
|
||||
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $Text);
|
||||
@ -197,9 +197,6 @@ function bb_to_markdown($Text, $options = []) {
|
||||
// Remove empty zrl links
|
||||
$Text = preg_replace("/\[zrl\=\].*?\[\/zrl\]/is", "", $Text);
|
||||
|
||||
// escape all unconverted tags
|
||||
$Text = escape_tags($Text);
|
||||
|
||||
$Text = trim($Text);
|
||||
|
||||
call_hooks('bb_to_markdown', $Text);
|
||||
|
@ -149,6 +149,7 @@ function insertCommentURL(comment, id) {
|
||||
|
||||
textarea = document.getElementById("comment-edit-text-" +id);
|
||||
textarea.value = textarea.value + data;
|
||||
preview_comment(id);
|
||||
$('body').css('cursor', 'auto');
|
||||
});
|
||||
}
|
||||
|
@ -251,8 +251,7 @@ footer {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.preview {
|
||||
background: url('../img/gray_and_white_diagonal_stripes_background_seamless.gif');
|
||||
.preview-indicator {
|
||||
}
|
||||
|
||||
#theme-preview {
|
||||
|
@ -39,6 +39,7 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="wall-item-author">
|
||||
{{if $item.previewing}}<span class="preview-indicator"><i class="fa fa-eye" title="{{$item.preview_lbl}}"></i></span> {{/if}}
|
||||
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}} {{$item.via}} <a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
|
||||
</div>
|
||||
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
|
||||
|
@ -126,6 +126,7 @@ function enableOnUser(){
|
||||
$('#jot-media').val($('#jot-media').val() + data.result.message);
|
||||
},
|
||||
stop: function(e,data) {
|
||||
preview_post();
|
||||
$('#profile-rotator').spin(false);
|
||||
},
|
||||
});
|
||||
@ -175,6 +176,7 @@ function enableOnUser(){
|
||||
$('#profile-rotator').spin('tiny');
|
||||
$.get('{{$baseurl}}/linkinfo?f=&binurl=' + reply, function(data) {
|
||||
addeditortext(data);
|
||||
preview_post();
|
||||
$('#profile-rotator').spin(false);
|
||||
});
|
||||
}
|
||||
@ -421,6 +423,7 @@ function enableOnUser(){
|
||||
function(ddata) {
|
||||
if (ddata['status']) {
|
||||
addeditortext(ddata['photolink']);
|
||||
preview_post();
|
||||
} else {
|
||||
window.console.log("{{$modalerrorlink}}" + ':' + ddata['errormsg']);
|
||||
}
|
||||
|
@ -32,6 +32,7 @@
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="wall-item-author">
|
||||
{{if $item.previewing}}<span class="preview-indicator"><i class="fa fa-eye" title="{{$item.preview_lbl}}"></i></span> {{/if}}
|
||||
<a href="{{$item.profile_url}}" title="{{$item.linktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.sparkle}}" id="wall-item-name-{{$item.id}}" >{{$item.name}}</span></a>{{if $item.owner_url}} {{$item.via}} <a href="{{$item.owner_url}}" title="{{$item.olinktitle}}" class="wall-item-name-link"><span class="wall-item-name{{$item.osparkle}}" id="wall-item-ownername-{{$item.id}}">{{$item.owner_name}}</span></a>{{/if}}
|
||||
</div>
|
||||
<div class="wall-item-ago" id="wall-item-ago-{{$item.id}}">
|
||||
|
Reference in New Issue
Block a user