diff options
author | Andrew Manning <andrewmanning@grid.reticu.li> | 2017-08-27 23:47:14 +0000 |
---|---|---|
committer | Andrew Manning <andrewmanning@grid.reticu.li> | 2017-08-27 23:47:14 +0000 |
commit | acacea5efe76cb56f610ae30c5396e7b63be1e40 (patch) | |
tree | cd80b3f52e5a3e54c082c1ef1c3e1fff98341bd9 /Zotlabs/Module/Item.php | |
parent | 49b38bd71b27427cad1c390d81bda3b7d38d8393 (diff) | |
parent | 187f19b1704b8a877b53a3e66c67ec26383a3ee9 (diff) | |
download | volse-hubzilla-acacea5efe76cb56f610ae30c5396e7b63be1e40.tar.gz volse-hubzilla-acacea5efe76cb56f610ae30c5396e7b63be1e40.tar.bz2 volse-hubzilla-acacea5efe76cb56f610ae30c5396e7b63be1e40.zip |
Merge remote-tracking branch 'upstream/dev' into doco
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r-- | Zotlabs/Module/Item.php | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 797b46f93..a86106b6a 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -734,10 +734,8 @@ class Item extends \Zotlabs\Web\Controller { if($parent_item) $parent_mid = $parent_item['mid']; - - if($webpage == ITEM_TYPE_CARD && $pagetitle) { - $plink = z_root() . '/cards/' . $channel['channel_address'] . '/' . $pagetitle; - } + + // Fallback so that we alway have a thr_parent @@ -748,6 +746,21 @@ class Item extends \Zotlabs\Web\Controller { $item_thread_top = ((! $parent) ? 1 : 0); + + // fix permalinks for cards + + if($webpage == ITEM_TYPE_CARD) { + $plink = z_root() . '/cards/' . $channel['channel_address'] . '/' . (($pagetitle) ? $pagetitle : substr($mid,0,16)); + } + if(($parent_item) && ($parent_item['item_type'] == ITEM_TYPE_CARD)) { + $r = q("select v from iconfig where iconfig.cat = 'system' and iconfig.k = 'CARD' and iconfig.iid = %d limit 1", + intval($parent_item['id']) + ); + if($r) { + $plink = z_root() . '/cards/' . $channel['channel_address'] . '/' . $r[0]['v']; + } + } + if ((! $plink) && ($item_thread_top)) { $plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . $mid; } |