aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-06-02 00:01:19 -0700
committerzotlabs <mike@macgirvin.com>2018-06-02 00:01:19 -0700
commit5f612521da11cd4b9245909bf0a99a7431272e93 (patch)
tree690b4d2eda5a99256549c9ae210065e0d3033fbb /Zotlabs
parenta6ab3dd36a78adbdd67ae9e7e25a3281cbcf9a58 (diff)
parent53efd4e470f10e123209ed63b90213b20a87e011 (diff)
downloadvolse-hubzilla-5f612521da11cd4b9245909bf0a99a7431272e93.tar.gz
volse-hubzilla-5f612521da11cd4b9245909bf0a99a7431272e93.tar.bz2
volse-hubzilla-5f612521da11cd4b9245909bf0a99a7431272e93.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Ping.php61
-rw-r--r--Zotlabs/Widget/Activity_filter.php7
-rw-r--r--Zotlabs/Widget/Activity_order.php3
-rw-r--r--Zotlabs/Widget/Notifications.php15
4 files changed, 86 insertions, 0 deletions
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index bb80adc41..a43d9863e 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -39,6 +39,7 @@ class Ping extends \Zotlabs\Web\Controller {
$result['info'] = array();
$result['pubs'] = 0;
$result['files'] = 0;
+ $result['forums'] = 0;
if(! $_SESSION['static_loadtime'])
$_SESSION['static_loadtime'] = datetime_convert();
@@ -622,6 +623,66 @@ class Ping extends \Zotlabs\Web\Controller {
if(! ($vnotify & VNOTIFY_BIRTHDAY))
$result['birthdays'] = 0;
+
+
+#### unseen forum
+
+ $perms_sql = item_permissions_sql(local_channel()) . item_normal();
+
+ $xf = false;
+
+ $x1 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'send_stream' and v = '0'",
+ intval(local_channel())
+ );
+ if($x1) {
+ $xc = ids_to_querystr($x1,'xchan',true);
+
+ $x2 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'tag_deliver' and v = '1' and xchan in (" . $xc . ") ",
+ intval(local_channel())
+ );
+
+ if($x2) {
+ $xf = ids_to_querystr($x2,'xchan',true);
+
+ // private forums
+ $x3 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'post_wall' and v = '1' and xchan in (" . $xc . ") and not xchan in (" . $xf . ") ",
+ intval(local_channel())
+ );
+ if($x3) {
+ $xf = ids_to_querystr(array_merge($x2,$x3),'xchan',true);
+ }
+ }
+ }
+
+ $sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 ");
+
+ $r1 = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 $sql_extra order by xchan_name",
+ intval(local_channel())
+ );
+
+ if(! $r1) {
+ $result['forums'] = 0;
+ }
+ else {
+ $fcount = count($r1);
+ $r1['total'] = 0;
+ for($x = 0; $x < $fcount; $x ++) {
+ $r = q("select sum(item_unseen) as unseen from item
+ where uid = %d and owner_xchan = '%s' and item_unseen = 1 $perms_sql ",
+ intval(local_channel()),
+ dbesc($r1[$x]['xchan_hash'])
+ );
+ if($r[0]['unseen']) {
+ $r1[$x]['unseen'] = $r[0]['unseen'];
+ $r1['total'] = $r1['total'] + $r[0]['unseen'];
+ }
+ else {
+ unset($r1[$x]);
+ }
+ }
+ $result['forums'] = $r1['total'];
+ }
+
$x = json_encode($result);
$t8 = dba_timer();
diff --git a/Zotlabs/Widget/Activity_filter.php b/Zotlabs/Widget/Activity_filter.php
index b9c68da30..a123b739a 100644
--- a/Zotlabs/Widget/Activity_filter.php
+++ b/Zotlabs/Widget/Activity_filter.php
@@ -111,6 +111,13 @@ class Activity_filter {
if(x($_GET,'search')) {
$filter_active = 'search';
+ $tabs[] = [
+ 'label' => t('Search'),
+ 'icon' => 'search',
+ 'url' => z_root() . '/' . $cmd . '/?f=&search=' . $_GET['search'],
+ 'sel' => 'active disabled',
+ 'title' => t('Panel search'),
+ ];
}
$reset = [];
diff --git a/Zotlabs/Widget/Activity_order.php b/Zotlabs/Widget/Activity_order.php
index 93bfc5a26..534d6caee 100644
--- a/Zotlabs/Widget/Activity_order.php
+++ b/Zotlabs/Widget/Activity_order.php
@@ -84,18 +84,21 @@ class Activity_order {
$tabs[] = [
'label' => t('Commented Date'),
+ 'icon' => '',
'url'=>z_root() . '/' . $cmd . '?f=&order=comment' . $filter,
'sel'=> $commentord_active,
'title' => t('Order by last commented date'),
];
$tabs[] = [
'label' => t('Posted Date'),
+ 'icon' => '',
'url'=>z_root() . '/' . $cmd . '?f=&order=post' . $filter,
'sel'=> $postord_active,
'title' => t('Order by last posted date'),
];
$tabs[] = array(
'label' => t('Date Unthreaded'),
+ 'icon' => '',
'url' => z_root() . '/' . $cmd . '?f=&order=unthreaded' . $filter,
'sel' => $unthreaded_active,
'title' => t('Order unthreaded by date'),
diff --git a/Zotlabs/Widget/Notifications.php b/Zotlabs/Widget/Notifications.php
index fc78a2a39..1be467ba6 100644
--- a/Zotlabs/Widget/Notifications.php
+++ b/Zotlabs/Widget/Notifications.php
@@ -111,6 +111,21 @@ class Notifications {
'label' => t('Mark all notices seen')
]
];
+
+ $notifications[] = [
+ 'type' => 'forums',
+ 'icon' => 'comments-o',
+ 'severity' => 'secondary',
+ 'label' => t('Forums'),
+ 'title' => t('Forums'),
+ 'viewall' => [
+ //'url' => 'notifications/system',
+ //'label' => t('View all notices')
+ ],
+ 'markall' => [
+ //'label' => t('Mark all notices seen')
+ ]
+ ];
}
if(local_channel() && is_site_admin()) {