diff options
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r-- | Zotlabs/Module/Item.php | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 574a90c1a..e1ba2b2f0 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -743,6 +743,8 @@ class Item extends Controller { $webpage = $parent_item['item_type']; } + + if ((!$allow_empty) && (!strlen($body))) { if ($preview) killme(); @@ -807,7 +809,6 @@ class Item extends Controller { $post_tags = []; - if ($mimetype === 'text/bbcode') { require_once('include/text.php'); @@ -919,15 +920,7 @@ class Item extends Controller { $cats = explode(',', $categories); foreach ($cats as $cat) { - if ($webpage == ITEM_TYPE_CARD) { - $catlink = z_root() . '/cards/' . $channel['channel_address'] . '?f=&cat=' . urlencode(trim($cat)); - } - elseif ($webpage == ITEM_TYPE_ARTICLE) { - $catlink = z_root() . '/articles/' . $channel['channel_address'] . '?f=&cat=' . urlencode(trim($cat)); - } - else { - $catlink = $owner_xchan['xchan_url'] . '?f=&cat=' . urlencode(trim($cat)); - } + $catlink = $owner_xchan['xchan_url'] . '?f=&cat=' . urlencode(trim($cat)); $post_tags[] = [ 'uid' => $profile_uid, @@ -1040,7 +1033,7 @@ class Item extends Controller { $parent_mid = $parent_item['mid']; - // Fallback so that we alway have a thr_parent + // Fallback so that we always have a thr_parent if (!$thr_parent) $thr_parent = $mid; @@ -1048,36 +1041,7 @@ class Item extends 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 : $uuid); - } - 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 ($webpage == ITEM_TYPE_ARTICLE) { - $plink = z_root() . '/articles/' . $channel['channel_address'] . '/' . (($pagetitle) ? $pagetitle : $uuid); - } - if (($parent_item) && ($parent_item['item_type'] == ITEM_TYPE_ARTICLE)) { - $r = q("select v from iconfig where iconfig.cat = 'system' and iconfig.k = 'ARTICLE' and iconfig.iid = %d limit 1", - intval($parent_item['id']) - ); - if ($r) { - $plink = z_root() . '/articles/' . $channel['channel_address'] . '/' . $r[0]['v']; - } - } - if ((!$plink) && ($item_thread_top)) { - // $plink = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . gen_link_id($mid); - // $plink = substr($plink,0,190); $plink = $mid; } |