diff options
author | Mario <mario@mariovavti.com> | 2022-06-01 07:00:21 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-06-01 07:00:21 +0000 |
commit | e63f0438415bb364f3085286ca2f199e83ab187b (patch) | |
tree | b107429276ebfc92dc9b4f78e302a4967e5bf0a6 /include | |
parent | c5f33baf27d80e2a7ad7307eacd3137609eeb089 (diff) | |
parent | 33dd0c83e377b8adf00559337d13784ec136cecb (diff) | |
download | volse-hubzilla-7.4.tar.gz volse-hubzilla-7.4.tar.bz2 volse-hubzilla-7.4.zip |
Merge branch '7.4RC'7.4
Diffstat (limited to 'include')
-rw-r--r-- | include/contact_widgets.php | 91 | ||||
-rw-r--r-- | include/conversation.php | 2 | ||||
-rw-r--r-- | include/event.php | 15 | ||||
-rw-r--r-- | include/features.php | 8 | ||||
-rw-r--r-- | include/items.php | 7 | ||||
-rw-r--r-- | include/nav.php | 27 | ||||
-rw-r--r-- | include/photos.php | 6 |
7 files changed, 31 insertions, 125 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php index 1ae8b17c5..182f674ca 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -59,7 +59,6 @@ function fileas_widget($baseurl,$selected = '') { )); } - function categories_widget($baseurl,$selected = '') { if(! feature_enabled(App::$profile['profile_uid'],'categories')) @@ -124,96 +123,6 @@ function categories_widget($baseurl,$selected = '') { return ''; } - -function cardcategories_widget($baseurl,$selected = '') { - - if(! feature_enabled(App::$profile['profile_uid'],'categories')) - return ''; - - $sql_extra = item_permissions_sql(App::$profile['profile_uid']); - - $item_normal = "and item.item_hidden = 0 and item.item_type = 6 and item.item_deleted = 0 - and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0 - and item.item_blocked = 0 "; - - $terms = array(); - $r = q("select distinct(term.term) - from term join item on term.oid = item.id - where item.uid = %d - and term.uid = item.uid - and term.ttype = %d - and term.otype = %d - and item.owner_xchan = '%s' - $item_normal - $sql_extra - order by term.term asc", - intval(App::$profile['profile_uid']), - intval(TERM_CATEGORY), - intval(TERM_OBJ_POST), - dbesc(App::$profile['channel_hash']) - ); - if($r && count($r)) { - foreach($r as $rr) - $terms[] = array('name' => $rr['term'], 'selected' => (($selected == $rr['term']) ? 'selected' : '')); - - return replace_macros(get_markup_template('categories_widget.tpl'),array( - '$title' => t('Categories'), - '$desc' => '', - '$sel_all' => (($selected == '') ? 'selected' : ''), - '$all' => t('Everything'), - '$terms' => $terms, - '$base' => $baseurl, - )); - } - - return ''; -} - - -function articlecategories_widget($baseurl,$selected = '') { - - if(! feature_enabled(App::$profile['profile_uid'],'categories')) - return ''; - - $sql_extra = item_permissions_sql(App::$profile['profile_uid']); - - $item_normal = "and item.item_hidden = 0 and item.item_type = 7 and item.item_deleted = 0 - and item.item_unpublished = 0 and item.item_delayed = 0 and item.item_pending_remove = 0 - and item.item_blocked = 0 "; - - $terms = array(); - $r = q("select distinct(term.term) - from term join item on term.oid = item.id - where item.uid = %d - and term.uid = item.uid - and term.ttype = %d - and term.otype = %d - and item.owner_xchan = '%s' - $item_normal - $sql_extra - order by term.term asc", - intval(App::$profile['profile_uid']), - intval(TERM_CATEGORY), - intval(TERM_OBJ_POST), - dbesc(App::$profile['channel_hash']) - ); - if($r && count($r)) { - foreach($r as $rr) - $terms[] = array('name' => $rr['term'], 'selected' => (($selected == $rr['term']) ? 'selected' : '')); - - return replace_macros(get_markup_template('categories_widget.tpl'),array( - '$title' => t('Categories'), - '$desc' => '', - '$sel_all' => (($selected == '') ? 'selected' : ''), - '$all' => t('Everything'), - '$terms' => $terms, - '$base' => $baseurl, - )); - } - - return ''; -} - function filecategories_widget($baseurl,$selected = '') { $perms = permissions_sql(App::$profile['profile_uid']); diff --git a/include/conversation.php b/include/conversation.php index c0238b8ae..1d6295df7 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -773,7 +773,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa $conv_link_module = 'hq'; } - $conv_link = ((in_array($item['item_type'],[ ITEM_TYPE_CARD, ITEM_TYPE_ARTICLE] )) ? $item['plink'] : z_root() . '/' . $conv_link_module . '/' . gen_link_id($conv_link_mid)); + $conv_link = z_root() . '/' . $conv_link_module . '/' . gen_link_id($conv_link_mid); $contact = []; diff --git a/include/event.php b/include/event.php index 3d3dda035..f62c22792 100644 --- a/include/event.php +++ b/include/event.php @@ -85,7 +85,7 @@ function format_event_obj($jobject) { 'startTime' => (($arr['adjust']) ? datetime_convert('UTC','UTC',$arr['dtstart'], ATOM_TIME) : datetime_convert('UTC','UTC',$arr['dtstart'],'Y-m-d\\TH:i:s-00:00')), 'content' => bbcode($arr['description']), 'location' => [ 'type' => 'Place', 'content' => $arr['location'] ], - 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/x-multicode' ], + 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/bbcode' ], 'url' => [ [ 'mediaType' => 'text/calendar', 'href' => z_root() . '/events/ical/' . $event['event_hash'] ] ], 'actor' => Activity::encode_person($r[0],false), ]; @@ -141,8 +141,15 @@ function format_event_obj($jobject) { '$event_tz' => ['label' => t('Timezone'), 'value' => (($tz === date_default_timezone_get()) ? '' : $tz)] )); + + $description = []; + + if (strpos($object['source']['content'], '[/event-description]') !== false) { + preg_match("/\[event\-description\](.*?)\[\/event\-description\]/ism", $object['source']['content'], $description); + } + $event['content'] = replace_macros(get_markup_template('event_item_content.tpl'), array( - '$description' => $object['content'], + '$description' => ((isset($description[1]))? zidify_links(smilies(bbcode($description[1]))) : EMPTY_STR), '$location_label' => t('Location:'), '$location' => ((array_path_exists('location/name', $object)) ? zidify_links(smilies(bbcode($object['location']['name']))) : EMPTY_STR) )); @@ -1215,7 +1222,7 @@ function event_store_item($arr, $event) { 'startTime' => (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtstart'], ATOM_TIME) : datetime_convert('UTC', 'UTC', $arr['dtstart'], 'Y-m-d\\TH:i:s-00:00')), 'content' => bbcode($arr['description']), 'location' => [ 'type' => 'Place', 'name' => $arr['location'] ], - 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/x-multicode' ], + 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/bbcode' ], 'url' => [ [ 'mediaType' => 'text/calendar', 'href' => z_root() . '/events/ical/' . $event['event_hash'] ] ], 'actor' => Activity::encode_person($r[0], false), 'attachment' => Activity::encode_attachment($r[0]), @@ -1375,7 +1382,7 @@ function event_store_item($arr, $event) { 'startTime' => (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtstart'], ATOM_TIME) : datetime_convert('UTC', 'UTC', $arr['dtstart'], 'Y-m-d\\TH:i:s-00:00')), 'content' => bbcode($arr['description']), 'location' => [ 'type' => 'Place', 'name' => bbcode($arr['location']) ], - 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/x-multicode' ], + 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/bbcode' ], 'url' => [ [ 'mediaType' => 'text/calendar', 'href' => z_root() . '/events/ical/' . $event['event_hash'] ] ], 'actor' => Activity::encode_person($z, false), 'attachment' => Activity::encode_attachment($item_arr), diff --git a/include/features.php b/include/features.php index 584d9cdfb..e57859aa8 100644 --- a/include/features.php +++ b/include/features.php @@ -373,6 +373,14 @@ function get_features($filtered = true, $level = (-1)) { t('If location data is available on uploaded photos, link this to a map.'), false, get_config('feature_lock','photo_location'), + ], + + [ + 'adult_photo_flagging', + t('Flag Adult Photos'), + t('Provide photo edit option to hide inappropriate photos from default album view'), + false, + get_config('feature_lock','adult_photo_flagging'), ] ], diff --git a/include/items.php b/include/items.php index 8a2faa623..d4c27ab28 100644 --- a/include/items.php +++ b/include/items.php @@ -3219,6 +3219,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false } + $arr['title'] = $item['title']; $arr['tgt_type'] = $item['tgt_type']; $arr['target'] = $item['target']; @@ -4830,7 +4831,10 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body, $match = null; // match img and zmg image links if(preg_match_all("/\[[zi]mg(.*?)\](.*?)\[\/[zi]mg\]/",$body,$match)) { - $images = $match[2]; + + // The URI can be in both places + $images = array_merge($match[1], $match[2]); + if($images) { foreach($images as $image) { if(! stristr($image,z_root() . '/photo/')) @@ -4848,6 +4852,7 @@ function fix_attached_photo_permissions($uid,$xchan_hash,$body, dbesc($image_uri), intval($uid) ); + if($r && $r[0]['folder']) { $f = q("select * from attach where hash = '%s' and is_dir = 1 and uid = %d limit 1", dbesc($r[0]['folder']), diff --git a/include/nav.php b/include/nav.php index b9b24e34c..c2c87232b 100644 --- a/include/nav.php +++ b/include/nav.php @@ -83,7 +83,8 @@ function nav($template = 'default') { if ($observer) { $userinfo = [ 'icon' => $observer['xchan_photo_m'] . '?rev=' . strtotime($observer['xchan_photo_date']), - 'name' => $observer['xchan_addr'], + 'addr' => $observer['xchan_addr'], + 'name' => $observer['xchan_name'], ]; } @@ -499,29 +500,6 @@ function channel_apps($is_owner = false, $nickname = null) { ]; } - if ($p['view_pages'] && Apps::system_app_installed($uid, 'Cards')) { - $tabs[] = [ - 'label' => t('Cards'), - 'url' => z_root() . '/cards/' . $nickname, - 'sel' => ((argv(0) == 'cards') ? 'active' : ''), - 'title' => t('View Cards'), - 'id' => 'cards-tab', - 'icon' => 'list' - ]; - } - - if ($p['view_pages'] && Apps::system_app_installed($uid, 'Articles')) { - $tabs[] = [ - 'label' => t('Articles'), - 'url' => z_root() . '/articles/' . $nickname, - 'sel' => ((argv(0) == 'articles') ? 'active' : ''), - 'title' => t('View Articles'), - 'id' => 'articles-tab', - 'icon' => 'file-text-o' - ]; - } - - if ($has_webpages && Apps::system_app_installed($uid, 'Webpages')) { $tabs[] = [ 'label' => t('Webpages'), @@ -533,7 +511,6 @@ function channel_apps($is_owner = false, $nickname = null) { ]; } - if ($p['view_wiki'] && Apps::system_app_installed($uid, 'Wiki')) { $tabs[] = [ 'label' => t('Wikis'), diff --git a/include/photos.php b/include/photos.php index 5bceb516d..9e4e8923d 100644 --- a/include/photos.php +++ b/include/photos.php @@ -359,13 +359,13 @@ function photo_upload($channel, $observer, $args) { $scale = 1; $width = $url[1]['width']; $height = $url[1]['height']; - $tag = (($r1) ? '[zmg=' . $width . 'x' . $height . ']' : '[zmg]'); + $tag = (($r1) ? '[zmg=' . $url[1]['href'] . ']' : '[zmg]'); } else { $scale = 2; $width = $url[2]['width']; $height = $url[2]['height']; - $tag = (($r2) ? '[zmg=' . $width . 'x' . $height . ']' : '[zmg]'); + $tag = (($r2) ? '[zmg=' .$url[2]['href'] . ']' : '[zmg]'); } $author_link = '[zrl=' . z_root() . '/channel/' . $channel['channel_address'] . ']' . $channel['channel_name'] . '[/zrl]'; @@ -379,7 +379,7 @@ function photo_upload($channel, $observer, $args) { $summary = (($args['body']) ? $args['body'] : '') . '[footer]' . $activity_format . '[/footer]'; $obj_body = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo_hash . ']' - . $tag . z_root() . "/photo/{$photo_hash}-{$scale}." . $ph->getExt() . '[/zmg]' + . $tag . $filename . '[/zmg]' . '[/zrl]'; $url[] = [ |