fix regression in pubstream tag view, use correct prefixes in pub_tagadelic() and some whitespace fixes

This commit is contained in:
Mario
2025-07-30 16:22:08 +00:00
parent 50f5fcb16b
commit e98f019b16
2 changed files with 21 additions and 32 deletions

View File

@@ -137,7 +137,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
'$page' => ((\App::$pager['page'] != 1) ? \App::$pager['page'] : 1),
'$search' => '',
'$xchan' => '',
'$order' => 'comment',
'$order' => 'post',
'$file' => '',
'$cats' => '',
'$tags' => (($hashtags) ? urlencode($hashtags) : ''),
@@ -173,17 +173,15 @@ class Pubstream extends \Zotlabs\Web\Controller {
$site_firehose_sql = " and owner_xchan in (select channel_hash from channel where channel_system = 0 and channel_removed = 0) ";
}
if(Config::Get('system','public_list_mode'))
$page_mode = 'list';
else
$page_mode = 'client';
$page_mode = 'client';
$blog_mode = Config::Get('system',' public_list_mode');
if ($blog_mode) {
$page_mode = 'list';
}
if(x($hashtags)) {
$sql_extra .= protect_sprintf(term_query('item', $hashtags, TERM_HASHTAG, TERM_COMMUNITYTAG));
$sql_extra_order = " ORDER BY item.created DESC ";
$thread_top = '';
}
$net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
@@ -247,30 +245,20 @@ class Pubstream extends \Zotlabs\Web\Controller {
}
}
// Then fetch all the children of the parents that are on this page
$parents_str = '';
if($r) {
$items = items_by_parent_ids($r);
$items = items_by_parent_ids($r, blog_mode: $blog_mode);
// use effective_uid param of xchan_query to help sort out comment permission
// for sys_channel owned items.
xchan_query($items, true, local_channel());
$items = fetch_post_tags($items,true);
if (!$hashtags) {
$items = conv_sort($items, $ordering);
}
$items = conv_sort($items, $ordering);
}
}
$mode = (($hashtags) ? 'pubstream-new' : 'pubstream');
$o .= conversation($items,$mode,$update,$page_mode);
$o .= conversation($items, 'pubstream', $update, $page_mode);
if($mid)
$o .= '<div id="content-complete"></div>';

View File

@@ -323,14 +323,14 @@ function pubtagblock($net,$site,$limit,$recent = 0,$safemode = 1, $type = TERM_H
$link = z_root() . '/pubstream';
if($r) {
$url = $link . '?tag=';
$tpl = get_markup_template('tagcloud.tpl');
$o .= replace_macros($tpl, [
'$title' => t('Trending'),
'$baseurl' => $url,
'$tags' => $r,
]);
if ($r) {
$url = $link . '?tag=';
$tpl = get_markup_template('tagcloud.tpl');
$o .= replace_macros($tpl, [
'$title' => t('Trending'),
'$baseurl' => $url,
'$tags' => $r,
]);
}
return $o;
@@ -371,9 +371,10 @@ function pub_tagadelic($net, $site, $limit, $recent, $safemode, $type) {
$arr = [
"SELECT term, count(term) AS total FROM term LEFT JOIN item ON term.oid = item.id
WHERE term.ttype = %d
AND otype = %d
AND item_type = %d
AND item_private = 0
AND term.otype = %d
AND item.item_type = %d
AND item.item_private = 0
AND item.id = item.parent
$uids $item_normal $site_firehose_sql $sql_extra
GROUP BY term ORDER BY total DESC %s",
intval($type),