fix category links in card bodies

This commit is contained in:
zotlabs 2017-08-29 19:38:07 -07:00
parent 1f42d23332
commit 973f15438a

View File

@ -659,14 +659,23 @@ class Item extends \Zotlabs\Web\Controller {
// BBCODE end alert // BBCODE end alert
if(strlen($categories)) { if(strlen($categories)) {
$cats = explode(',',$categories); $cats = explode(',',$categories);
foreach($cats as $cat) { foreach($cats as $cat) {
if($webpage == ITEM_TYPE_CARD) {
$catlink = z_root() . '/cards/' . $channel['channel_address'] . '?f=&cat=' . urlencode(trim($cat));
}
else {
$catlink = $owner_xchan['xchan_url'] . '?f=&cat=' . urlencode(trim($cat));
}
$post_tags[] = array( $post_tags[] = array(
'uid' => $profile_uid, 'uid' => $profile_uid,
'ttype' => TERM_CATEGORY, 'ttype' => TERM_CATEGORY,
'otype' => TERM_OBJ_POST, 'otype' => TERM_OBJ_POST,
'term' => trim($cat), 'term' => trim($cat),
'url' => $owner_xchan['xchan_url'] . '?f=&cat=' . urlencode(trim($cat)) 'url' => $catlink
); );
} }
} }