aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorM. Dent <dentm42@gmail.com>2018-10-31 01:25:41 +0100
committerM. Dent <dentm42@gmail.com>2018-10-31 01:25:41 +0100
commit046d264688aae76874fa22870f4bed77192335c2 (patch)
tree53e520893cfc6a6a3aaa7e05fe7ffd16bb9212fe /Zotlabs
parent944e168120ee1619ddc3d7d2ba06c34e59e3e803 (diff)
parent1eac4db491e6c597b56752b7915fdcafc529ed5e (diff)
downloadvolse-hubzilla-046d264688aae76874fa22870f4bed77192335c2.tar.gz
volse-hubzilla-046d264688aae76874fa22870f4bed77192335c2.tar.bz2
volse-hubzilla-046d264688aae76874fa22870f4bed77192335c2.zip
Merge branch 'forum-ping' into 'dev'
fix forum ping results - the term query requires xchan_name instead of… See merge request hubzilla/core!1358
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Ping.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index 75e8843d6..cf5b2e004 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -635,7 +635,6 @@ class Ping extends \Zotlabs\Web\Controller {
$forums = get_forum_channels(local_channel());
if($forums) {
- $perms_sql = item_permissions_sql(local_channel());
$item_normal = item_normal();
$fcount = count($forums);
$forums['total'] = 0;
@@ -644,14 +643,14 @@ class Ping extends \Zotlabs\Web\Controller {
$p = q("SELECT oid AS parent FROM term WHERE uid = %d AND ttype = %d AND term = '%s'",
intval(local_channel()),
intval(TERM_FORUM),
- dbesc($forums[$x]['xchan_hash'])
+ dbesc($forums[$x]['xchan_name'])
);
$p_str = ids_to_querystr($p, 'parent');
$p_sql = (($p_str) ? "OR parent IN ( $p_str )" : '');
- $r = q("select sum(item_unseen) as unseen from item
- where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and item_unseen = 1 $perms_sql $item_normal",
+ $r = q("select count(id) as unseen from item
+ where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and item_unseen = 1 $item_normal",
intval(local_channel()),
dbesc($forums[$x]['xchan_hash']),
dbesc($forums[$x]['xchan_hash'])