diff options
author | Mario Vavti <mario@mariovavti.com> | 2021-12-03 13:46:41 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2021-12-03 13:46:41 +0100 |
commit | 1b0a17c7dba1ca2ff5cc6d943d37abb14a5ec73c (patch) | |
tree | 75fd03333e51465fa8512b17200eb604db25b166 | |
parent | fe7ecede700fe04631d23f36473e697ce2b364dc (diff) | |
parent | 60b145833c5c07898363d51838a942b876f60c3c (diff) | |
download | volse-hubzilla-1b0a17c7dba1ca2ff5cc6d943d37abb14a5ec73c.tar.gz volse-hubzilla-1b0a17c7dba1ca2ff5cc6d943d37abb14a5ec73c.tar.bz2 volse-hubzilla-1b0a17c7dba1ca2ff5cc6d943d37abb14a5ec73c.zip |
Merge branch 'dev'
-rw-r--r-- | CHANGELOG | 12 | ||||
-rw-r--r-- | Zotlabs/Daemon/Notifier.php | 6 | ||||
-rw-r--r-- | Zotlabs/Lib/Enotify.php | 2 | ||||
-rw-r--r-- | Zotlabs/Lib/Libsync.php | 12 | ||||
-rw-r--r-- | Zotlabs/Module/Channel.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Like.php | 6 | ||||
-rw-r--r-- | Zotlabs/Module/Profile_photo.php | 217 | ||||
-rw-r--r-- | Zotlabs/Module/Profiles.php | 2 | ||||
-rw-r--r-- | Zotlabs/Web/HttpMeta.php | 109 | ||||
-rw-r--r-- | Zotlabs/Widget/Fullprofile.php | 2 | ||||
-rw-r--r-- | Zotlabs/Widget/Profile.php | 4 | ||||
-rw-r--r-- | boot.php | 17 | ||||
-rw-r--r-- | include/channel.php | 7 | ||||
-rw-r--r-- | include/contact_widgets.php | 2 | ||||
-rw-r--r-- | include/text.php | 2 | ||||
-rw-r--r-- | view/css/mod_profile_photo.css | 4 | ||||
-rw-r--r-- | view/css/widgets.css | 6 | ||||
-rw-r--r-- | view/js/main.js | 23 | ||||
-rw-r--r-- | view/theme/redbasic/css/style.css | 56 | ||||
-rw-r--r-- | view/theme/redbasic/php/config.php | 12 | ||||
-rw-r--r-- | view/theme/redbasic/php/style.php | 6 | ||||
-rw-r--r-- | view/tpl/connstatus.tpl | 2 | ||||
-rw-r--r-- | view/tpl/profile_vcard.tpl | 149 | ||||
-rw-r--r-- | view/tpl/xchan_vcard.tpl | 6 |
24 files changed, 383 insertions, 284 deletions
@@ -1,3 +1,15 @@ +Hubzilla 6.4.1 (2021-12-03) + - Fix hubloc_site_id in fix_system_urls() on detected site rename events + - Fix duplicate deliveries if duplicate hublocs available + - Redesign profile vcard for improved responsive handling + - Fix profile photos not stored in profile photo folder + - Maximum width of content region is now calculated in rem for improved responsive handling + - Fix likes notices emited allthough they are disabled + - Fix page not reloaded after comment/like in mod photos - issue #1651 + - Port improved Lib/HttpMeta from zap + - Improved responsive aside + + Hubzilla 6.4 (2021-11-09) - Automatically connect the invitee with the inviting channel - Use the composer version of urlify diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 368a9229d..4ca109495 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -488,7 +488,7 @@ class Notifier { // Now we have collected recipients (except for external mentions, FIXME) // Let's reduce this to a set of hubs; checking that the site is not dead. - $hubs = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_dead from hubloc left join site on site_url = hubloc_url + $hubs = dbq("select hubloc.*, site.site_crypto, site.site_flags, site.site_dead from hubloc left join site on site_url = hubloc_url where hubloc_hash in (" . protect_sprintf(implode(',', self::$recipients)) . ") and hubloc_error = 0 and hubloc_deleted = 0" ); @@ -550,7 +550,9 @@ class Notifier { if (!array_key_exists($hub['hubloc_site_id'], $hub_env)) { $hub_env[$hub['hubloc_site_id']] = []; } - $hub_env[$hub['hubloc_site_id']][] = $er; + if (!in_array($er, $hub_env[$hub['hubloc_site_id']])) { + $hub_env[$hub['hubloc_site_id']][] = $er; + } } } } diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index d02dab739..fdc7d4567 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -256,7 +256,7 @@ class Enotify { $itemlink = $params['link']; - if (array_key_exists('item',$params) && (! activity_match($params['item']['verb'],ACTIVITY_LIKE))) { + if (array_key_exists('item',$params) && activity_match($params['item']['verb'],ACTIVITY_LIKE)) { if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) { logger('notification: not a visible activity. Ignoring.'); pop_lang(); diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php index c4f1b20ea..23573e837 100644 --- a/Zotlabs/Lib/Libsync.php +++ b/Zotlabs/Lib/Libsync.php @@ -768,14 +768,13 @@ class Libsync { // match as many fields as possible in case anything at all changed. - $r = q("select * from hubloc where hubloc_hash = '%s' and hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_id_url = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_site_id = '%s' and hubloc_host = '%s' and hubloc_addr = '%s' and hubloc_callback = '%s' and hubloc_sitekey = '%s' ", + $r = q("select * from hubloc where hubloc_hash = '%s' and hubloc_guid = '%s' and hubloc_guid_sig = '%s' and hubloc_id_url = '%s' and hubloc_url = '%s' and hubloc_url_sig = '%s' and hubloc_host = '%s' and hubloc_addr = '%s' and hubloc_callback = '%s' and hubloc_sitekey = '%s' ", dbesc($sender['hash']), dbesc($sender['id']), dbesc($sender['id_sig']), dbesc($location['id_url']), dbesc($location['url']), dbesc($location['url_sig']), - dbesc($location['site_id']), dbesc($location['host']), dbesc($location['address']), dbesc($location['callback']), @@ -784,6 +783,15 @@ class Libsync { if ($r) { logger('Hub exists: ' . $location['url'], LOGGER_DEBUG); + // generate a new hubloc_site_id if it's wrong due to historical bugs 2021-11-30 + + if ($r[0]['hubloc_site_id'] !== $location['site_id']) { + q("update hubloc set hubloc_site_id = '%s' where hubloc_id = %d", + dbesc(Libzot::make_xchan_hash($location['url'], $location['sitekey'])), + intval($r[0]['hubloc_id']) + ); + } + // update connection timestamp if this is the site we're talking to // This only happens when called from import_xchan diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php index 6261a2f06..4ebd2ee29 100644 --- a/Zotlabs/Module/Channel.php +++ b/Zotlabs/Module/Channel.php @@ -66,8 +66,7 @@ class Channel extends Controller { $sigdata = HTTPSig::verify(file_get_contents('php://input'), EMPTY_STR, 'zot6'); if ($sigdata && $sigdata['signer'] && $sigdata['header_valid']) { - $data = json_encode(Libzot::zotinfo(['address' => $channel['channel_address'], 'target_url' => $sigdata['signer']])); - + $data = json_encode(Libzot::zotinfo(['guid_hash' => $channel['channel_hash'], 'target_url' => $sigdata['signer']])); $s = q("select site_crypto, hubloc_sitekey from site left join hubloc on hubloc_url = site_url where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($sigdata['signer']) ); diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php index e3fe4a954..8b36e8396 100644 --- a/Zotlabs/Module/Like.php +++ b/Zotlabs/Module/Like.php @@ -91,6 +91,12 @@ class Like extends Controller { 'id' => $arr['item']['id'], 'html' => conversation($items, $conv_mode, true, $page_mode), ]; + + // mod photos + if (isset($_REQUEST['reload']) && $_REQUEST['reload']) { + $ret['reload'] = 1; + } + return $ret; } diff --git a/Zotlabs/Module/Profile_photo.php b/Zotlabs/Module/Profile_photo.php index d6c80b653..6681cdcf9 100644 --- a/Zotlabs/Module/Profile_photo.php +++ b/Zotlabs/Module/Profile_photo.php @@ -23,79 +23,79 @@ require_once('include/channel.php'); class Profile_photo extends \Zotlabs\Web\Controller { - + /* @brief Initalize the profile-photo edit view * * @return void * */ - + function init() { - + if(! local_channel()) { return; } - + $channel = \App::get_channel(); profile_load($channel['channel_address']); - + } - + /* @brief Evaluate posted values * * @param $a Current application * @return void * */ - + function post() { - + if(! local_channel()) { return; } - + $channel = \App::get_channel(); - + check_form_security_token_redirectOnErr('/profile_photo', 'profile_photo'); - + // Remove cover photo if(isset($_POST['remove'])) { - + $r = q("SELECT resource_id FROM photo WHERE photo_usage = %d AND uid = %d LIMIT 1", intval(PHOTO_PROFILE), intval(local_channel()) ); - + if($r) { q("update photo set photo_usage = %d where photo_usage = %d and uid = %d", intval(PHOTO_NORMAL), intval(PHOTO_PROFILE), intval(local_channel()) ); - + $sync = attach_export_data($channel,$r[0]['resource_id']); if($sync) Libsync:: build_sync_packet($channel['channel_id'],array('file' => array($sync))); } - + $_SESSION['reload_avatar'] = true; - + goaway(z_root() . '/profiles'); } - + if((array_key_exists('cropfinal',$_POST)) && (intval($_POST['cropfinal']) == 1)) { - + // logger('crop: ' . print_r($_POST,true)); // phase 2 - we have finished cropping - + if(argc() != 2) { notice( t('Image uploaded but image cropping failed.') . EOL ); return; } - + $image_id = argv(1); - + if(substr($image_id,-2,1) == '-') { $scale = substr($image_id,-1,1); $image_id = substr($image_id,0,-2); @@ -104,7 +104,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { // unless proven otherwise $is_default_profile = 1; - + if($_REQUEST['profile']) { $r = q("select id, profile_guid, is_default, gender from profile where id = %d and uid = %d limit 1", intval($_REQUEST['profile']), @@ -115,9 +115,9 @@ class Profile_photo extends \Zotlabs\Web\Controller { if(! intval($profile['is_default'])) $is_default_profile = 0; } - } + } + - $srcX = intval($_POST['xstart']); $srcY = intval($_POST['ystart']); $srcW = intval($_POST['xfinal']) - $srcX; @@ -128,36 +128,36 @@ class Profile_photo extends \Zotlabs\Web\Controller { dbesc(local_channel()), intval($scale)); if($r) { - + $base_image = $r[0]; $base_image['content'] = (($r[0]['os_storage']) ? @file_get_contents(dbunescbin($base_image['content'])) : dbunescbin($base_image['content'])); - + $im = photo_factory($base_image['content'], $base_image['mimetype']); if($im->is_valid()) { - + $im->cropImage(300,$srcX,$srcY,$srcW,$srcH); - + $aid = get_account_id(); - - $p = [ - 'aid' => $aid, - 'uid' => local_channel(), + + $p = [ + 'aid' => $aid, + 'uid' => local_channel(), 'resource_id' => $base_image['resource_id'], - 'filename' => $base_image['filename'], + 'filename' => $base_image['filename'], 'album' => t('Profile Photos'), 'os_path' => $base_image['os_path'], 'display_path' => $base_image['display_path'], 'photo_usage' => PHOTO_PROFILE, 'edited' => dbescdate($base_image['edited']) ]; - + $p['photo_usage'] = (($is_default_profile) ? PHOTO_PROFILE : PHOTO_NORMAL); - + $r1 = $im->storeThumbnail($p, PHOTO_RES_PROFILE_300); - + $im->scaleImage(80); $r2 = $im->storeThumbnail($p, PHOTO_RES_PROFILE_80); - + $im->scaleImage(48); $r3 = $im->storeThumbnail($p, PHOTO_RES_PROFILE_48); @@ -184,12 +184,12 @@ class Profile_photo extends \Zotlabs\Web\Controller { @unlink(dbunescbin($xx['content'])); } } - + return; } - + // If setting for the default profile, unset the profile photo flag from any other photos I own - + if($is_default_profile) { $r = q("update profile set photo = '%s', thumb = '%s' where is_default = 1 and uid = %d", @@ -206,10 +206,10 @@ class Profile_photo extends \Zotlabs\Web\Controller { dbesc($base_image['resource_id']), intval(local_channel()) ); - + send_profile_photo_activity($channel,$base_image,$profile); - + } else { $r = q("update profile set photo = '%s', thumb = '%s' where id = %d and uid = %d", @@ -219,19 +219,19 @@ class Profile_photo extends \Zotlabs\Web\Controller { intval(local_channel()) ); } - + // set $send to false in profiles_build_sync() to return the data - // so that we only send one sync packet. + // so that we only send one sync packet. $sync_profiles = profiles_build_sync(local_channel(),false); - + // We'll set the updated profile-photo timestamp even if it isn't the default profile, // so that browsers will do a cache update unconditionally // Also set links back to site-specific profile photo url in case it was - // changed to a generic URL by a clone operation. Otherwise the new photo may + // changed to a generic URL by a clone operation. Otherwise the new photo may // not get pushed to other sites correctly. - - $r = q("UPDATE xchan set xchan_photo_mimetype = '%s', xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s' + + $r = q("UPDATE xchan set xchan_photo_mimetype = '%s', xchan_photo_date = '%s', xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s' where xchan_hash = '%s'", dbesc($im->getType()), dbescdate($base_image['edited']), @@ -250,29 +250,29 @@ class Profile_photo extends \Zotlabs\Web\Controller { // Similarly, tell the nav bar to bypass the cache and update the avatar image. $_SESSION['reload_avatar'] = true; - + info( t('Shift-reload the page or clear browser cache if the new photo does not display immediately.') . EOL); - + // Update directory in background \Zotlabs\Daemon\Master::Summon(array('Directory',$channel['channel_id'])); - + } else notice( t('Unable to process image') . EOL); } - + goaway(z_root() . '/profiles'); return; // NOTREACHED } - + // A new photo was uploaded. Store it and save some important details // in App::$data for use in the cropping function - - + + $hash = photo_new_resource(); $importing = false; $smallest = 0; - + if($_REQUEST['importfile']) { $hash = $_REQUEST['importfile']; @@ -280,24 +280,21 @@ class Profile_photo extends \Zotlabs\Web\Controller { } else { require_once('include/attach.php'); - - $res = attach_store(\App::get_channel(), get_observer_hash(), '', array('album' => t('Profile Photos'), 'hash' => $hash, 'nosync' => true)); - - logger('attach_store: ' . print_r($res,true)); + $res = attach_store(\App::get_channel(), get_observer_hash(), '', array('album' => t('Profile Photos'), 'hash' => $hash, 'nosync' => true, 'source' => 'photos')); } - + if(($res && intval($res['data']['is_photo'])) || $importing) { $i = q("select * from photo where resource_id = '%s' and uid = %d order by imgscale", dbesc($hash), intval(local_channel()) ); - + if(! $i) { notice( t('Image upload failed.') . EOL ); return; } $os_storage = false; - + foreach($i as $ii) { if(intval($ii['imgscale']) < PHOTO_RES_640) { $smallest = intval($ii['imgscale']); @@ -307,53 +304,53 @@ class Profile_photo extends \Zotlabs\Web\Controller { } } } - + $imagedata = (($os_storage) ? @file_get_contents(dbunescbin($imagedata)) : dbunescbin($imagedata)); $ph = photo_factory($imagedata, $filetype); - + if(! $ph->is_valid()) { notice( t('Unable to process image.') . EOL ); return; } - + return $this->profile_photo_crop_ui_head($a, $ph, $hash, $smallest); // This will "fall through" to the get() method, and since - // App::$data['imagecrop'] is set, it will proceed to cropping - // rather than present the upload form + // App::$data['imagecrop'] is set, it will proceed to cropping + // rather than present the upload form } - - + + /* @brief Generate content of profile-photo view * * @param $a Current application * @return void * */ - - + + function get() { - + if(! local_channel()) { notice( t('Permission denied.') . EOL ); return; } - + $channel = \App::get_channel(); $pf = 0; $newuser = false; - + if(argc() == 2 && argv(1) === 'new') $newuser = true; - + if(argv(1) === 'use') { if (argc() < 3) { notice( t('Permission denied.') . EOL ); return; }; - + $resource_id = argv(2); - + $pf = (($_REQUEST['pf']) ? intval($_REQUEST['pf']) : 0); @@ -384,9 +381,9 @@ class Profile_photo extends \Zotlabs\Web\Controller { if($rr['imgscale'] == PHOTO_RES_PROFILE_80) $havescale = true; } - + // set an already loaded and cropped photo as profile photo - + if($havescale) { // unset any existing profile photos $x = q("UPDATE photo SET photo_usage = %d WHERE photo_usage = %d AND uid = %d", @@ -396,19 +393,19 @@ class Profile_photo extends \Zotlabs\Web\Controller { ); $edited = datetime_convert(); - + $x = q("UPDATE photo SET photo_usage = %d, edited = '%s' WHERE uid = %d AND resource_id = '%s' AND imgscale > 0", intval(PHOTO_PROFILE), dbescdate($edited), intval(local_channel()), dbesc($resource_id) ); - + $x = q("UPDATE xchan SET xchan_photo_date = '%s' WHERE xchan_hash = '%s'", dbescdate($edited), dbesc($channel['xchan_hash']) ); - + photo_profile_setperms(local_channel(),$resource_id,$_REQUEST['profile']); $sync = attach_export_data($channel,$resource_id); @@ -418,25 +415,25 @@ class Profile_photo extends \Zotlabs\Web\Controller { $_SESSION['reload_avatar'] = true; \Zotlabs\Daemon\Master::Summon(array('Directory',local_channel())); - + goaway(z_root() . '/profiles'); } - + $r = q("SELECT content, mimetype, resource_id, os_storage FROM photo WHERE id = %d and uid = %d limit 1", intval($r[0]['id']), intval(local_channel()) - + ); if(! $r) { notice( t('Photo not available.') . EOL ); return; } - + if(intval($r[0]['os_storage'])) $data = @file_get_contents(dbunescbin($r[0]['content'])); else - $data = dbunescbin($r[0]['content']); - + $data = dbunescbin($r[0]['content']); + $ph = photo_factory($data, $r[0]['mimetype']); $smallest = 0; if($ph->is_valid()) { @@ -445,7 +442,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { dbesc($r[0]['resource_id']), intval(local_channel()) ); - + if($i) { $hash = $i[0]['resource_id']; foreach($i as $ii) { @@ -455,7 +452,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { } } } - + if($multi_profiles) { \App::$data['importfile'] = $resource_id; } @@ -466,7 +463,7 @@ class Profile_photo extends \Zotlabs\Web\Controller { // falls through with App::$data['imagecrop'] set so we go straight to the cropping section } - + // present an upload form @@ -485,14 +482,14 @@ class Profile_photo extends \Zotlabs\Web\Controller { } $importing = ((array_key_exists('importfile',\App::$data)) ? true : false); - + if(! x(\App::$data,'imagecrop')) { - + $tpl = get_markup_template('profile_photo.tpl'); - + $o .= replace_macros($tpl,array( '$user' => \App::$channel['channel_address'], - '$info' => ((count($profiles) > 1) ? t('Your default profile photo is visible to anybody on the internet. Profile photos for alternate profiles will inherit the permissions of the profile') : t('Your profile photo is visible to anybody on the internet and may be distributed to other websites.')), + '$info' => ((count($profiles) > 1) ? t('Your default profile photo is visible to anybody on the internet. Profile photos for alternate profiles will inherit the permissions of the profile') : t('Your profile photo is visible to anybody on the internet and may be distributed to other websites.')), '$importfile' => (($importing) ? \App::$data['importfile'] : ''), '$lbl_upfile' => t('Upload File:'), '$lbl_profiles' => t('Select a profile:'), @@ -515,9 +512,9 @@ class Profile_photo extends \Zotlabs\Web\Controller { '$form_security_token' => get_form_security_token("profile_photo"), '$select' => t('Select existing photo'), )); - + call_hooks('profile_photo_content_end', $o); - + return $o; } else { @@ -539,10 +536,10 @@ class Profile_photo extends \Zotlabs\Web\Controller { )); return $o; } - + return; // NOTREACHED } - + /* @brief Generate the UI for photo-cropping * * @param $a Current application @@ -550,32 +547,32 @@ class Profile_photo extends \Zotlabs\Web\Controller { * @return void * */ - - - + + + function profile_photo_crop_ui_head(&$a, $ph, $hash, $smallest){ - + $max_length = get_config('system','max_image_length'); if(! $max_length) $max_length = MAX_IMAGE_LENGTH; if($max_length > 0) $ph->scaleImage($max_length); - + \App::$data['width'] = $ph->getWidth(); \App::$data['height'] = $ph->getHeight(); - + if(\App::$data['width'] < 500 || \App::$data['height'] < 500) { $ph->scaleImageUp(400); \App::$data['width'] = $ph->getWidth(); \App::$data['height'] = $ph->getHeight(); } - - + + \App::$data['imagecrop'] = $hash; \App::$data['imagecrop_resolution'] = $smallest; \App::$page['htmlhead'] .= replace_macros(get_markup_template("crophead.tpl"), array()); return; } - - + + } diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php index 73bae45e8..1512148b1 100644 --- a/Zotlabs/Module/Profiles.php +++ b/Zotlabs/Module/Profiles.php @@ -189,7 +189,6 @@ class Profiles extends \Zotlabs\Web\Controller { } $chan = \App::get_channel(); - profile_load($chan['channel_address'],$r[0]['id']); } } @@ -657,6 +656,7 @@ class Profiles extends \Zotlabs\Web\Controller { intval($id), intval(local_channel()) ); + if(! $r) { notice( t('Profile not found.') . EOL); return; diff --git a/Zotlabs/Web/HttpMeta.php b/Zotlabs/Web/HttpMeta.php index ceaa82162..7cf93dda9 100644 --- a/Zotlabs/Web/HttpMeta.php +++ b/Zotlabs/Web/HttpMeta.php @@ -6,71 +6,108 @@ namespace Zotlabs\Web; class HttpMeta { private $vars = null; - private $og = null; + private $og = null; function __construct() { - $this->vars = array(); - $this->og = array(); + $this->vars = []; + $this->og = []; + $this->ogproperties = []; } - function set($property,$value) { - if(strpos($property,'og:') === 0) - $this->og[$property] = $value; - else + //Set Meta Value + // Mode: + // 0 = Default - set if no value currently exists + // 1 = Overwrite - replace existing value(s) + // 2 = Multi - append to the array of values + function set($property,$value,$mode=0) { + $ogallowsmulti = ['image','audio','video']; + if (strpos($property,'og:') === 0) { + $count = 0; + foreach ($this->og as $ogk => $ogdata) { + if (strpos($ogdata['property'],$property) === 0) { + if ($mode == 1) { + unset($this->og[$ogk]); + unset($this->ogproperties[$property]); + } + elseif ($mode == 0) { + return; + } + elseif ($value == $ogdata['value']) { + return; + } + else { + $count++; + } + } + } + + if ($value !== null) { + //mode = 1 with value === null will delete the property entirely. + $components = explode(':',$property); + $ogp=$components[1]; + + if (!$count || in_array($ogp,$ogallowsmulti)) { + $this->og[]=['property'=>$property,'value'=>$value]; + $this->ogproperties[$property] = $property; + } + } + } else { $this->vars[$property] = $value; + } } function check_required() { - if( - ($this->og) - && array_key_exists('og:title',$this->og) - && array_key_exists('og:type', $this->og) - && array_key_exists('og:image',$this->og) - && array_key_exists('og:url', $this->og) - ) + if ( + in_array('og:title',$this->ogproperties) + && in_array('og:type', $this->ogproperties) + && (in_array('og:image',$this->ogproperties) + || in_array('og:image:url',$this->ogproperties)) + && (array_key_exists('og:url', $this->ogproperties) + || array_key_exists('og:url:secure_url', $this->ogproperties)) + && array_key_exists('og:description', $this->ogproperties) + ) { return true; + } return false; } function get_field($field) { - if(strpos($field,'og:') === 0) - $arr = $this->og; - else + if (strpos($field,'og:') === 0) { + foreach ($this->og as $ogdata) { + if (strpos($ogdata['property'],$field) === 0) { + $arr[$field][] = $ogdata['value']; + } + } + } + else { $arr = $this->vars; + } - if($arr && array_key_exists($field,$arr) && $arr[$field]) + if (isset($arr) && is_array($arr) && array_key_exists($field,$arr) && $arr[$field]) { return $arr[$field]; + } return false; } function get() { + // use 'name' for most meta fields, and 'property' for opengraph properties $o = ''; - if($this->vars) { - foreach($this->vars as $k => $v) { - $o .= '<meta property="' . $k . '" content="' . urlencode($v) . '" />' . "\r\n" ; + if ($this->vars) { + foreach ($this->vars as $k => $v) { + $o .= '<meta name="' . htmlspecialchars($k,ENT_COMPAT,'UTF-8',false) . '" content="' . htmlspecialchars($v,ENT_COMPAT,'UTF-8',false) . '" />' . "\r\n" ; } } - if($this->check_required()) { - $arrayproperties = [ 'og:image' ]; - foreach($this->og as $k => $v) { - if (in_array($k,$arrayproperties)) { - if (is_array($v)) { - foreach ($v as $v2) { - $o .= '<meta property="' . $k . '" content="' . $v2 . '" />' . "\r\n" ; - } - } else { - $o .= '<meta property="' . $k . '" content="' . $v . '" />' . "\r\n" ; - } - } else { - $o .= '<meta property="' . $k . '" content="' . $v . '" />' . "\r\n" ; - } + if ($this->check_required()) { + foreach ($this->og as $ogdata) { + $o .= '<meta property="' . htmlspecialchars($ogdata['property'],ENT_COMPAT,'UTF-8',false) . '" content="' . htmlspecialchars($ogdata['value'],ENT_COMPAT,'UTF-8',false) . '" />' . "\r\n" ; } } - if($o) + if ($o) { return "\r\n" . $o; + } return $o; } diff --git a/Zotlabs/Widget/Fullprofile.php b/Zotlabs/Widget/Fullprofile.php index d7340ef40..e8ed13811 100644 --- a/Zotlabs/Widget/Fullprofile.php +++ b/Zotlabs/Widget/Fullprofile.php @@ -11,6 +11,6 @@ class Fullprofile { $block = observer_prohibited(); - return profile_sidebar(\App::$profile, $block); + return profile_sidebar(\App::$profile, $block, true, true); } } diff --git a/Zotlabs/Widget/Profile.php b/Zotlabs/Widget/Profile.php index bffd910b6..8bd624c0f 100644 --- a/Zotlabs/Widget/Profile.php +++ b/Zotlabs/Widget/Profile.php @@ -7,7 +7,7 @@ class Profile { function widget($args) { $block = observer_prohibited(); - return profile_sidebar(\App::$profile, $block, true); + return profile_sidebar(\App::$profile, $block, true, false); } -}
\ No newline at end of file +} @@ -29,6 +29,8 @@ // composer autoloader for all namespaced Classes use Zotlabs\Lib\Crypto; +use Zotlabs\Lib\Libzot; +use Zotlabs\Lib\Config; require_once('vendor/autoload.php'); @@ -53,7 +55,7 @@ require_once('include/bbcode.php'); require_once('include/items.php'); define ( 'PLATFORM_NAME', 'hubzilla' ); -define ( 'STD_VERSION', '6.4' ); +define ( 'STD_VERSION', '6.5.1' ); define ( 'ZOT_REVISION', '6.0' ); define ( 'DB_UPDATE_VERSION', 1248 ); @@ -1527,8 +1529,6 @@ function check_config() { function fix_system_urls($oldurl, $newurl) { - require_once('include/crypto.php'); - logger('fix_system_urls: renaming ' . $oldurl . ' to ' . $newurl); // Basically a site rename, but this can happen if you change from http to https for instance - even if the site name didn't change @@ -1538,7 +1538,7 @@ function fix_system_urls($oldurl, $newurl) { // that they can clean up their hubloc tables (this includes directories). // It's a very expensive operation so you don't want to have to do it often or after your site gets to be large. - $r = q("select xchan.*, hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_url like '%s'", + $r = q("select xchan.*, hubloc.* from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_url like '%s' and hubloc_network = 'zot6'", dbesc($oldurl . '%') ); @@ -1586,13 +1586,14 @@ function fix_system_urls($oldurl, $newurl) { dbesc($rv['xchan_hash']) ); - $y = q("update hubloc set hubloc_addr = '%s', hubloc_url = '%s', hubloc_id_url = '%s', hubloc_url_sig = '%s', hubloc_host = '%s', hubloc_callback = '%s' where hubloc_hash = '%s' and hubloc_url = '%s'", + $y = q("update hubloc set hubloc_addr = '%s', hubloc_url = '%s', hubloc_id_url = '%s', hubloc_url_sig = '%s', hubloc_site_id = '%s', hubloc_host = '%s', hubloc_callback = '%s' where hubloc_hash = '%s' and hubloc_url = '%s'", dbesc($channel_address . '@' . $rhs), dbesc($newurl), - dbesc(str_replace($oldurl,$newurl,$rv['hubloc_id_url'])), - dbesc(($rv['hubloc_network'] === 'zot6') ? \Zotlabs\Lib\Libzot::sign($newurl,$c[0]['channel_prvkey']) : base64url_encode(Crypto::sign($newurl,$c[0]['channel_prvkey']))), + dbesc(str_replace($oldurl, $newurl,$rv['hubloc_id_url'])), + dbesc(Libzot::sign($newurl, $c[0]['channel_prvkey'])), + dbesc(Libzot::make_xchan_hash($newurl, Config::Get('system','pubkey'))), dbesc($newhost), - dbesc(($rv['hubloc_network'] === 'zot6') ? $newurl . '/zot' : $newurl . '/post'), + dbesc($newurl . '/zot'), dbesc($rv['xchan_hash']), dbesc($oldurl) ); diff --git a/include/channel.php b/include/channel.php index 927da3dcd..102a03489 100644 --- a/include/channel.php +++ b/include/channel.php @@ -1566,7 +1566,7 @@ function profile_edit_menu($uid) { * @return string (HTML) suitable for sidebar inclusion * Exceptions: Returns empty string if passed $profile is wrong type or not populated */ -function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = false) { +function profile_sidebar($profile, $block = 0, $show_connect = true, $details = false) { $observer = App::get_observer(); @@ -1622,6 +1622,7 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa $gender = ((x($profile,'gender') == 1) ? t('Gender:') : False); $marital = ((x($profile,'marital') == 1) ? t('Status:') : False); $homepage = ((x($profile,'homepage') == 1) ? t('Homepage:') : False); + $hometown = ((x($profile,'hometown') == 1) ? t('Hometown:') : False); $profile['online'] = (($profile['online_status'] === 'online') ? t('Online Now') : False); // logger('online: ' . $profile['online']); @@ -1662,18 +1663,18 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = fa $tpl = get_markup_template('profile_vcard.tpl'); $o .= replace_macros($tpl, array( - '$zcard' => $zcard, + '$details' => $details, '$profile' => $profile, '$connect' => $connect, '$connect_url' => $connect_url, '$location' => $location, + '$hometown' => $hometown, '$gender' => $gender, '$pdesc' => $pdesc, '$marital' => $marital, '$homepage' => $homepage, '$chanmenu' => $channel_menu, '$reddress' => $reddress, - '$rating' => '', '$contact_block' => $contact_block, '$change_photo' => t('Change your profile photo'), '$editmenu' => profile_edit_menu($profile['uid']) diff --git a/include/contact_widgets.php b/include/contact_widgets.php index a5f867b0f..875a519a5 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -246,7 +246,7 @@ function filecategories_widget($baseurl,$selected = '') { } -function common_friends_visitor_widget($profile_uid,$cnt = 25) { +function common_friends_visitor_widget($profile_uid,$cnt = 36) { if(local_channel() == $profile_uid) return; diff --git a/include/text.php b/include/text.php index 1b3a77dba..d46c089b5 100644 --- a/include/text.php +++ b/include/text.php @@ -987,7 +987,7 @@ function contact_block() { $shown = get_pconfig(App::$profile['uid'],'system','display_friend_count'); if($shown === false) - $shown = 25; + $shown = 36; if($shown == 0) return; diff --git a/view/css/mod_profile_photo.css b/view/css/mod_profile_photo.css index 1b7e15194..3b5f7f321 100644 --- a/view/css/mod_profile_photo.css +++ b/view/css/mod_profile_photo.css @@ -12,9 +12,5 @@ } #profile-photo-wrapper { - height: 300px; - width: 300px; - max-width: 300px; - max-height: 300px; overflow: hidden; } diff --git a/view/css/widgets.css b/view/css/widgets.css index b78725919..df77940dd 100644 --- a/view/css/widgets.css +++ b/view/css/widgets.css @@ -243,9 +243,9 @@ a.wikilist { /* contact block */ .contact-block-div .oneway-overlay { - font-size: 20px; - margin-left: -25px; - margin-top: 25px; + font-size: .9rem; + margin-left: -1.2rem; + margin-top: 2rem; opacity: 0.8; } diff --git a/view/js/main.js b/view/js/main.js index d3f4eff9a..0e16809e4 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1158,8 +1158,18 @@ function dolike(ident, verb) { if(typeof page_mode == typeof undefined) page_mode = ''; - $.get('like/' + ident.toString() + '?verb=' + verb + '&conv_mode=' + conv_mode + '&page_mode=' + page_mode, function (data) { + var reload = ''; + if(module == 'photos') + reload = 1; + + $.get('like/' + ident.toString() + '?verb=' + verb + '&conv_mode=' + conv_mode + '&page_mode=' + page_mode + '&reload=' + reload, function (data) { if(data.success) { + + // mod photos + if (data.reload) { + window.location.href = window.location.href; + } + // this is a bit tricky since the top level thread wrapper wraps the whole thread if($('#thread-wrapper-' + data.orig_id).hasClass('toplevel_item')) { var wrapper = $('<div></div>').html( data.html ).find('#wall-item-outside-wrapper-' + data.id); @@ -1381,7 +1391,14 @@ function post_comment(id) { "item", form_data + '&conv_mode=' + conv_mode, function(data) { - if(data.success) { + if (data.success) { + + //mod photos + if (data.reload) { + window.location.href = data.reload; + } + + localStorage.removeItem("comment_body-" + id); $("#comment-edit-preview-" + id).hide(); $("#comment-edit-text-" + id).val('').blur().attr('placeholder', aStr.comment); @@ -1392,7 +1409,7 @@ function post_comment(id) { commentBusy = false; var tarea = document.getElementById("comment-edit-text-" + id); - if(tarea) { + if (tarea) { commentClose(tarea, id); $(document).off( "click.commentOpen"); } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 346e46c6b..16a7624f8 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -24,15 +24,15 @@ body { aside#region_1 { border-right: 1px solid transparent; - width: $left_aside_widthpx; - min-width: $left_aside_widthpx; - max-width: $left_aside_widthpx; + width: $left_aside_widthrem; + min-width: $left_aside_widthrem; + max-width: $left_aside_widthrem; } aside#region_3 { - width: $right_aside_widthpx; - min-width: $left_aside_widthpx; - max-width: $right_aside_widthpx; + width: $right_aside_widthrem; + min-width: $left_aside_widthrem; + max-width: $right_aside_widthrem; } aside#left_aside_wrapper, @@ -49,7 +49,7 @@ main { #overlay { position: fixed; top: 0; - left: $left_aside_widthpx; + left: $left_aside_widthrem; width: 100vw; height: 100vh; background: rgba(0, 0, 0, .3); @@ -400,34 +400,20 @@ footer { color: #444444; } -.vcard { - margin-bottom: 10px; - padding: 0px 10px 10px 10px; +.vcard-card { background-color: rgba(254,254,254,0.5); - border: 1px solid rgba(254,254,254,0.5); - border-radius: $radius; - word-wrap: break-word; -} - -.vcard dl, -.vcard .title { - margin-top: 10px; - margin-bottom: 0px; } -.connect-btn-wrapper { - margin-bottom: 10px; - +.vcard { + word-wrap: break-word; } .profile-edit-side-link { - padding: 3px 0px; opacity: 0; - filter:alpha(opacity=30); - float: right; + filter:alpha(opacity=0); } -.vcard:hover .profile-edit-side-link { +.card:hover .profile-edit-side-link { opacity: 1; filter:alpha(opacity=100); } @@ -435,15 +421,6 @@ footer { #profile-photo-wrapper img { width: 100%; height: 100%; - max-width: 300px; - max-height: 300px; -} - -#profile-photo-wrapper { - width: 251px; - height: 251px; - margin-bottom: 10px; - border-radius: $radius; } #hide-friends-yes-label, @@ -571,8 +548,8 @@ footer { } .contact-block-img { - width:47px; - height:47px; + width: 2.95rem; + height: 2.95rem; margin-bottom: 3px; } @@ -1191,7 +1168,6 @@ img.mail-conv-sender-photo { .widget { background-color: rgba(254,254,254,.5); - border: 1px solid rgba(254,254,254,.5); border-radius: $radius; } @@ -1530,8 +1506,8 @@ blockquote { } main { - left: -$left_aside_widthpx; - width: calc( 100% + $left_aside_widthpx ); + left: -$left_aside_widthrem; + width: calc( 100% + $left_aside_widthrem ); } main.region_1-on { diff --git a/view/theme/redbasic/php/config.php b/view/theme/redbasic/php/config.php index 0a779529d..0de475fe5 100644 --- a/view/theme/redbasic/php/config.php +++ b/view/theme/redbasic/php/config.php @@ -32,7 +32,7 @@ class RedbasicConfig { } function get() { - if(! local_channel()) { + if(! local_channel()) { return; } @@ -59,7 +59,7 @@ class RedbasicConfig { } function post() { - if(!local_channel()) { + if(!local_channel()) { return; } @@ -89,7 +89,7 @@ class RedbasicConfig { if(get_pconfig(local_channel(), 'redbasic', 'advanced_theming')) $expert = 1; - + $o .= replace_macros(get_markup_template('theme_settings.tpl'), array( '$submit' => t('Submit'), '$baseurl' => z_root(), @@ -98,19 +98,19 @@ class RedbasicConfig { '$title' => t("Theme settings"), '$narrow_navbar' => array('redbasic_narrow_navbar',t('Narrow navbar'),$arr['narrow_navbar'], '', array(t('No'),t('Yes'))), '$nav_bg' => array('redbasic_nav_bg', t('Navigation bar background color'), $arr['nav_bg']), - '$nav_icon_colour' => array('redbasic_nav_icon_colour', t('Navigation bar icon color '), $arr['nav_icon_colour']), + '$nav_icon_colour' => array('redbasic_nav_icon_colour', t('Navigation bar icon color '), $arr['nav_icon_colour']), '$nav_active_icon_colour' => array('redbasic_nav_active_icon_colour', t('Navigation bar active icon color '), $arr['nav_active_icon_colour']), '$link_colour' => array('redbasic_link_colour', t('Link color'), $arr['link_colour'], '', $link_colours), '$banner_colour' => array('redbasic_banner_colour', t('Set font-color for banner'), $arr['banner_colour']), '$bgcolour' => array('redbasic_background_colour', t('Set the background color'), $arr['bgcolour']), - '$background_image' => array('redbasic_background_image', t('Set the background image'), $arr['background_image']), + '$background_image' => array('redbasic_background_image', t('Set the background image'), $arr['background_image']), '$item_colour' => array('redbasic_item_colour', t('Set the background color of items'), $arr['item_colour']), '$comment_item_colour' => array('redbasic_comment_item_colour', t('Set the background color of comments'), $arr['comment_item_colour']), '$font_size' => array('redbasic_font_size', t('Set font-size for the entire application'), $arr['font_size'], t('Examples: 1rem, 100%, 16px')), '$font_colour' => array('redbasic_font_colour', t('Set font-color for posts and comments'), $arr['font_colour']), '$radius' => array('redbasic_radius', t('Set radius of corners'), $arr['radius'], t('Example: 4px')), '$shadow' => array('redbasic_shadow', t('Set shadow depth of photos'), $arr['shadow']), - '$converse_width' => array('redbasic_converse_width',t('Set maximum width of content region in pixel'),$arr['converse_width'], t('Leave empty for default width')), + '$converse_width' => array('redbasic_converse_width',t('Set maximum width of content region in rem'),$arr['converse_width'], t('Leave empty for default width')), '$top_photo' => array('redbasic_top_photo', t('Set size of conversation author photo'), $arr['top_photo']), '$reply_photo' => array('redbasic_reply_photo', t('Set size of followup author photos'), $arr['reply_photo']), '$advanced_theming' => ['redbasic_advanced_theming', t('Show advanced settings'), $arr['advanced_theming'], '', [t('No'), t('Yes')]] diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php index 3ea94f9aa..6ba0d569e 100644 --- a/view/theme/redbasic/php/style.php +++ b/view/theme/redbasic/php/style.php @@ -101,7 +101,7 @@ if (! $radius) if (! $shadow) $shadow = '0'; if (! $converse_width) - $converse_width = '790'; + $converse_width = '1250'; //unit: rem if(! $top_photo) $top_photo = '2.3rem'; if(! $reply_photo) @@ -120,8 +120,8 @@ if(file_exists('view/theme/redbasic/css/style.css')) { $x .= $schemecss; } - $left_aside_width = 288; - $right_aside_width = 288; + $left_aside_width = 21; //unit: rem + $right_aside_width = 21; //unit: rem $main_width = $left_aside_width + $right_aside_width + intval($converse_width); diff --git a/view/tpl/connstatus.tpl b/view/tpl/connstatus.tpl index 667775f3a..869345682 100644 --- a/view/tpl/connstatus.tpl +++ b/view/tpl/connstatus.tpl @@ -1 +1 @@ -<i class="fa fa-fw fa-comments oneway-overlay text-{{if $perminfo.connpermcount == 3}}success{{elseif $perminfo.connpermcount > 0}}warning{{else}}danger{{/if}}" title="{{$perminfo.connperms}}"></i> +<i class="fa fa-comments oneway-overlay text-{{if $perminfo.connpermcount == 3}}success{{elseif $perminfo.connpermcount > 0}}warning{{else}}danger{{/if}}" title="{{$perminfo.connperms}}"></i> diff --git a/view/tpl/profile_vcard.tpl b/view/tpl/profile_vcard.tpl index 13caf5603..8ebc9a311 100644 --- a/view/tpl/profile_vcard.tpl +++ b/view/tpl/profile_vcard.tpl @@ -1,60 +1,107 @@ -<div class="vcard h-card"> - {{if ! $zcard}} - <div id="profile-photo-wrapper">{{if $editmenu}}<a href="profile_photo" title="{{$change_photo}}">{{/if}}<img class="photo u-photo" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.fullname}}">{{if $editmenu}}</a>{{/if}}</div> - {{/if}} - {{if $connect}} - <div class="connect-btn-wrapper"><a href="{{$connect_url}}" class="btn btn-block btn-success btn-sm"><i class="fa fa-plus"></i> {{$connect}}</a></div> - {{/if}} - {{if ! $zcard}} - {{if $editmenu.multi}} - <div class="dropdown float-end"> - <a class="dropdown-toggle" data-bs-toggle="dropdown" href="#" ><i class="fa fa-pencil" title="{{$editmenu.edit.1}}"></i></a> - <div class="dropdown-menu dropdown-menu-end" role="menu"> - {{foreach $editmenu.menu.entries as $e}} - <a href="profiles/{{$e.id}}" class="dropdown-item"><img class="menu-img-1" src='{{$e.photo}}'> {{$e.profile_name}}</a> - {{/foreach}} - <a href="profile_photo" class="dropdown-item">{{$editmenu.menu.chg_photo}}</a> - {{if $editmenu.menu.cr_new}}<a href="profiles/new" id="profile-listing-new-link" class="dropdown-item">{{$editmenu.menu.cr_new}}</a>{{/if}} +<div class="rounded mb-3 vcard-card h-card"> + <div class="card"> + <div class="row"> + <div class="col-4" style="width: 7rem;"> + {{if $editmenu}} + <a href="profile_photo" title="{{$change_photo}}"> + {{/if}} + <div id="profile-photo-wrapper"> + <img class="rounded-start u-photo" src="{{$profile.photo}}?rev={{$profile.picdate}}" alt="{{$profile.fullname}}" style="width: 6rem; height:6rem;"> + </div> + {{if $editmenu}} + </a> + {{/if}} + </div> + <div class="col-7 m-1 p-0"> + {{if $editmenu.multi}} + <div class="dropdown float-end"> + <a class="profile-edit-side-link float-end" data-bs-toggle="dropdown" href="#" ><i class="fa fa-pencil" title="{{$editmenu.edit.1}}"></i></a> + <div class="dropdown-menu dropdown-menu-end" role="menu"> + {{foreach $editmenu.menu.entries as $e}} + <a href="profiles/{{$e.id}}" class="dropdown-item"><img class="menu-img-1" src='{{$e.photo}}'> {{$e.profile_name}}</a> + {{/foreach}} + <a href="profile_photo" class="dropdown-item">{{$editmenu.menu.chg_photo}}</a> + {{if $editmenu.menu.cr_new}} + <a href="profiles/new" id="profile-listing-new-link" class="dropdown-item">{{$editmenu.menu.cr_new}}</a> + {{/if}} + </div> + </div> + {{elseif $editmenu}} + <a class="profile-edit-side-link float-end" href="{{$editmenu.edit.0}}" ><i class="fa fa-pencil" title="{{$editmenu.edit.1}}"></i></a> + {{/if}} + + <div class="text-truncate"> + <strong class="fn p-name">{{$profile.fullname}}{{if $profile.online}}<i class="fa fa-fw fa-asterisk text-danger ps-2" title="{{$profile.online}}"></i>{{/if}}</strong> + </div> + <div class="text-truncate"> + <small class="text-muted p-adr">{{$profile.reddress}}</small> + </div> + {{if $connect}} + <div class="mt-1"> + <a href="{{$connect_url}}" class="btn btn-success btn-sm" rel="nofollow"> + <i class="fa fa-plus"></i> {{$connect}} + </a> + </div> + {{/if}} + </div> </div> </div> - {{elseif $editmenu}} - <a class="profile-edit-side-link" href="{{$editmenu.edit.0}}" ><i class="fa fa-pencil" title="{{$editmenu.edit.1}}"></i></a> - {{/if}} - {{/if}} - - {{if ! $zcard}} - <div class="fn p-name">{{$profile.fullname}}{{if $profile.online}} <i class="fa fa-asterisk online-now" title="{{$profile.online}}"></i>{{/if}}</div> - {{if $reddress}}<div class="reddress">{{$profile.reddress}}</div>{{/if}} - {{/if}} - {{if $pdesc}}<div class="title">{{$profile.pdesc}}</div>{{/if}} - {{if $location}} - <dl class="location"><dt class="location-label">{{$location}}</dt> - <dd class="adr h-adr"> - {{if $profile.address}}<div class="street-address p-street-address">{{$profile.address}}</div>{{/if}} - <span class="city-state-zip"> - <span class="locality p-locality">{{$profile.locality}}</span>{{if $profile.locality}}, {{/if}} - <span class="region p-region">{{$profile.region}}</span> - <span class="postal-code p-postal-code">{{$profile.postal_code}}</span> - </span> - {{if $profile.country_name}}<span class="country-name p-country-name">{{$profile.country_name}}</span>{{/if}} - </dd> + {{if $details}} + <div class="vcard ps-2 pe-2"> + {{if $profile.pdesc}} + <div class="pb-3 pt-2">{{$profile.pdesc}}</div> + {{/if}} + {{if $location}} + <dl class=""> + <dt class="location-label">{{$location}}</dt> + <dd class="adr h-adr"> + {{if $profile.address}} + <div class="street-address p-street-address">{{$profile.address}}</div> + {{/if}} + <div class="city-state-zip"> + <span class="postal-code p-postal-code">{{$profile.postal_code}}</span> + <span class="locality p-locality">{{$profile.locality}}</span> + </div> + {{if $profile.region}} + <div class="region p-region">{{$profile.region}}</div> + {{/if}} + {{if $profile.country_name}} + <div class="country-name p-country-name">{{$profile.country_name}}</div> + {{/if}} + </dd> + </dl> + {{/if}} + {{if $hometown}} + <dl class=""> + <dt class="hometown-label">{{$hometown}}</dt> + <dd class="p-hometown">{{$profile.hometown}}</dd> + </dl> + {{/if}} + {{if $gender}} + <dl class=""> + <dt class="gender-label">{{$gender}}</dt> + <dd class="p-gender">{{if $profile.gender_icon}}<i class="fa fa-{{$profile.gender_icon}}"></i> {{/if}}{{$profile.gender}}</dd> + </dl> + {{/if}} + {{if $marital}} + <dl class=""> + <dt class="marital-label"><span class="heart"><i class="fa fa-heart"></i> </span>{{$marital}}</dt> + <dd class="marital-text">{{$profile.marital}}</dd> </dl> + {{/if}} + {{if $homepage}} + <dl class="pb-2"> + <dt class="homepage-label">{{$homepage}}</dt> + <dd class="homepage-url u-url">{{$profile.homepage}}</dd> + </dl> + {{/if}} + <div class="hcard-addon"></div> + </div> {{/if}} - - {{if $gender}}<dl class="mf"><dt class="gender-label">{{$gender}}</dt> <dd class="p-gender">{{if $profile.gender_icon}}<i class="fa fa-{{$profile.gender_icon}}"></i> {{/if}}{{$profile.gender}}</dd></dl>{{/if}} - - {{if $marital}}<dl class="marital"><dt class="marital-label"><span class="heart"><i class="fa fa-heart"></i> </span>{{$marital}}</dt><dd class="marital-text">{{$profile.marital}}</dd></dl>{{/if}} - - {{if $homepage}}<dl class="homepage"><dt class="homepage-label">{{$homepage}}</dt><dd class="homepage-url u-url">{{$profile.homepage}}</dd></dl>{{/if}} - -<div class="hcard-addon"></div> </div> -<div class="clear"></div> - -{{$rating}} - +{{if $details}} {{$chanmenu}} - {{$contact_block}} +{{/if}} diff --git a/view/tpl/xchan_vcard.tpl b/view/tpl/xchan_vcard.tpl index 2fd9bec1d..a5568f283 100644 --- a/view/tpl/xchan_vcard.tpl +++ b/view/tpl/xchan_vcard.tpl @@ -1,11 +1,11 @@ <div class="card mb-3 h-card"> <div class="row"> - <div class="col-4"> + <div class="col-4" style="width: 7rem;"> <a href="{{$link}}" > - <img class="u-photo" src="{{$photo}}" alt="{{$name}}" width="80px" height="80px"> + <img class="u-photo rounded-start" src="{{$photo}}" alt="{{$name}}" style="width: 6rem; height:6rem;"> </a> </div> - <div class="col-7 m-1"> + <div class="col-7 m-1 p-0"> <div class="text-truncate"> <strong class="fn p-name">{{$name}}</strong> </div> |