some more work on mod hq
This commit is contained in:
parent
14f1292743
commit
87eaa6d8e5
@ -54,6 +54,10 @@ class ThreadStream {
|
|||||||
$this->profile_owner = local_channel();
|
$this->profile_owner = local_channel();
|
||||||
$this->writable = true;
|
$this->writable = true;
|
||||||
break;
|
break;
|
||||||
|
case 'hq':
|
||||||
|
$this->profile_owner = local_channel();
|
||||||
|
$this->writable = true;
|
||||||
|
break;
|
||||||
case 'channel':
|
case 'channel':
|
||||||
$this->profile_owner = \App::$profile['profile_uid'];
|
$this->profile_owner = \App::$profile['profile_uid'];
|
||||||
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
|
$this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments');
|
||||||
|
@ -61,6 +61,7 @@ class Hq extends \Zotlabs\Web\Controller {
|
|||||||
$item_hash = 'b64.' . base64url_encode($r[0]['mid']);
|
$item_hash = 'b64.' . base64url_encode($r[0]['mid']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(strpos($item_hash,'b64.') === 0)
|
if(strpos($item_hash,'b64.') === 0)
|
||||||
$decoded = @base64url_decode(substr($item_hash,4));
|
$decoded = @base64url_decode(substr($item_hash,4));
|
||||||
if($decoded)
|
if($decoded)
|
||||||
@ -91,7 +92,7 @@ class Hq extends \Zotlabs\Web\Controller {
|
|||||||
'bang' => '',
|
'bang' => '',
|
||||||
'visitor' => true,
|
'visitor' => true,
|
||||||
'profile_uid' => local_channel(),
|
'profile_uid' => local_channel(),
|
||||||
'return_path' => 'channel/' . $channel['channel_address'],
|
'return_path' => 'hq',
|
||||||
'expanded' => true,
|
'expanded' => true,
|
||||||
'editor_autocomplete' => true,
|
'editor_autocomplete' => true,
|
||||||
'bbco_autocomplete' => 'bbcode',
|
'bbco_autocomplete' => 'bbcode',
|
||||||
@ -133,6 +134,8 @@ class Hq extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
if(! $update && ! $load) {
|
if(! $update && ! $load) {
|
||||||
|
|
||||||
|
nav_set_selected('HQ');
|
||||||
|
|
||||||
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
|
$static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1);
|
||||||
|
|
||||||
// if the target item is not a post (eg a like) we want to address its thread parent
|
// if the target item is not a post (eg a like) we want to address its thread parent
|
||||||
@ -143,14 +146,14 @@ class Hq extends \Zotlabs\Web\Controller {
|
|||||||
if($decoded)
|
if($decoded)
|
||||||
$mid = 'b64.' . base64url_encode($mid);
|
$mid = 'b64.' . base64url_encode($mid);
|
||||||
|
|
||||||
$o .= '<div id="live-display"></div>' . "\r\n";
|
$o .= '<div id="live-hq"></div>' . "\r\n";
|
||||||
$o .= "<script> var profile_uid = " . local_channel()
|
$o .= "<script> var profile_uid = " . local_channel()
|
||||||
. "; var netargs = '?f='; var profile_page = " . \App::$pager['page'] . "; </script>\r\n";
|
. "; var netargs = '?f='; var profile_page = " . \App::$pager['page'] . "; </script>\r\n";
|
||||||
|
|
||||||
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),[
|
\App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),[
|
||||||
'$baseurl' => z_root(),
|
'$baseurl' => z_root(),
|
||||||
'$pgtype' => 'display',
|
'$pgtype' => 'hq',
|
||||||
'$uid' => '0',
|
'$uid' => local_channel(),
|
||||||
'$gid' => '0',
|
'$gid' => '0',
|
||||||
'$cid' => '0',
|
'$cid' => '0',
|
||||||
'$cmin' => '0',
|
'$cmin' => '0',
|
||||||
@ -181,6 +184,7 @@ class Hq extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($load) {
|
if($load) {
|
||||||
|
|
||||||
$r = null;
|
$r = null;
|
||||||
|
|
||||||
$r = q("SELECT item.id as item_id from item
|
$r = q("SELECT item.id as item_id from item
|
||||||
@ -198,6 +202,7 @@ class Hq extends \Zotlabs\Web\Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
elseif($update) {
|
elseif($update) {
|
||||||
|
|
||||||
$r = null;
|
$r = null;
|
||||||
|
|
||||||
$r = q("SELECT item.parent AS item_id from item
|
$r = q("SELECT item.parent AS item_id from item
|
||||||
@ -238,7 +243,7 @@ class Hq extends \Zotlabs\Web\Controller {
|
|||||||
$items = [];
|
$items = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$o .= conversation($items, 'display', $update, 'client');
|
$o .= conversation($items, 'hq', $update, 'client');
|
||||||
|
|
||||||
if($updateable) {
|
if($updateable) {
|
||||||
$x = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 AND uid = %d and parent = %d ",
|
$x = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 AND uid = %d and parent = %d ",
|
||||||
@ -249,10 +254,6 @@ class Hq extends \Zotlabs\Web\Controller {
|
|||||||
|
|
||||||
$o .= '<div id="content-complete"></div>';
|
$o .= '<div id="content-complete"></div>';
|
||||||
|
|
||||||
if(($update && $load) && (! $items)) {
|
|
||||||
notice( t('Something went wrong.') . EOL );
|
|
||||||
}
|
|
||||||
|
|
||||||
return $o;
|
return $o;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -496,7 +496,7 @@ class Ping extends \Zotlabs\Web\Controller {
|
|||||||
$r = q("SELECT id, item_wall FROM item
|
$r = q("SELECT id, item_wall FROM item
|
||||||
WHERE item_unseen = 1 and uid = %d
|
WHERE item_unseen = 1 and uid = %d
|
||||||
$item_normal
|
$item_normal
|
||||||
AND author_xchan != '%s' $sql_extra ",
|
AND author_xchan != '%s'",
|
||||||
intval(local_channel()),
|
intval(local_channel()),
|
||||||
dbesc($ob_hash)
|
dbesc($ob_hash)
|
||||||
);
|
);
|
||||||
|
@ -513,6 +513,12 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
elseif ($mode === 'hq') {
|
||||||
|
$profile_owner = local_channel();
|
||||||
|
$page_writeable = true;
|
||||||
|
$live_update_div = '<div id="live-hq"></div>' . "\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
elseif ($mode === 'channel') {
|
elseif ($mode === 'channel') {
|
||||||
$profile_owner = App::$profile['profile_uid'];
|
$profile_owner = App::$profile['profile_uid'];
|
||||||
$page_writeable = ($profile_owner == local_channel());
|
$page_writeable = ($profile_owner == local_channel());
|
||||||
|
@ -437,6 +437,7 @@ function NavUpdate() {
|
|||||||
if($('#live-channel').length) { src = 'channel'; liveUpdate(); }
|
if($('#live-channel').length) { src = 'channel'; liveUpdate(); }
|
||||||
if($('#live-pubstream').length) { src = 'pubstream'; liveUpdate(); }
|
if($('#live-pubstream').length) { src = 'pubstream'; liveUpdate(); }
|
||||||
if($('#live-display').length) { src = 'display'; liveUpdate(); }
|
if($('#live-display').length) { src = 'display'; liveUpdate(); }
|
||||||
|
if($('#live-hq').length) { src = 'hq'; liveUpdate(); }
|
||||||
if($('#live-search').length) { src = 'search'; liveUpdate(); }
|
if($('#live-search').length) { src = 'search'; liveUpdate(); }
|
||||||
// if($('#live-cards').length) { src = 'cards'; liveUpdate(); }
|
// if($('#live-cards').length) { src = 'cards'; liveUpdate(); }
|
||||||
// if($('#live-articles').length) { src = 'articles'; liveUpdate(); }
|
// if($('#live-articles').length) { src = 'articles'; liveUpdate(); }
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
$(document).on('click', '#jot-toggle', function(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
$(this).toggleClass('active');
|
||||||
|
$(window).scrollTop(0);
|
||||||
|
$('#jot-popup').toggle();
|
||||||
|
$('#profile-jot-text').focus();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
function hqLiveUpdate(notify_id) {
|
function hqLiveUpdate(notify_id) {
|
||||||
|
|
||||||
if(typeof profile_uid === 'undefined') profile_uid = false; /* Should probably be unified with channelId defined in head.tpl */
|
if(typeof profile_uid === 'undefined') profile_uid = false; /* Should probably be unified with channelId defined in head.tpl */
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
[region=aside]
|
||||||
|
[widget=hq_controls][/widget]
|
||||||
|
[/region]
|
||||||
[region=right_aside]
|
[region=right_aside]
|
||||||
[widget=notifications][/widget]
|
[widget=notifications][/widget]
|
||||||
[/region]
|
[/region]
|
||||||
|
Reference in New Issue
Block a user