aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/identity.php17
-rw-r--r--include/network.php1
-rw-r--r--include/widgets.php23
3 files changed, 34 insertions, 7 deletions
diff --git a/include/identity.php b/include/identity.php
index 0b9842caf..51744f7bf 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -484,7 +484,7 @@ function identity_basic_export($channel_id, $items = false) {
// use constants here as otherwise we will have no idea if we can import from a site
// with a non-standard platform and version.
- $ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION, 'server_role' => UNO );
+ $ret['compatibility'] = array('project' => PLATFORM_NAME, 'version' => RED_VERSION, 'database' => DB_UPDATE_VERSION, 'server_role' => get_server_role());
$r = q("select * from channel where channel_id = %d limit 1",
intval($channel_id)
@@ -913,7 +913,7 @@ function profile_load(&$a, $nickname, $profile = '') {
* @return HTML string 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) {
+function profile_sidebar($profile, $block = 0, $show_connect = true, $zcard = false) {
$a = get_app();
@@ -1050,14 +1050,18 @@ function profile_sidebar($profile, $block = 0, $show_connect = true) {
$channel_menu .= comanche_block($menublock);
}
- $tpl = get_markup_template('profile_vcard.tpl');
+ if($zcard)
+ $tpl = get_markup_template('profile_vcard_short.tpl');
+ else
+ $tpl = get_markup_template('profile_vcard.tpl');
require_once('include/widgets.php');
if(! feature_enabled($profile['uid'],'hide_rating'))
$z = widget_rating(array('target' => $profile['channel_hash']));
-
+
$o .= replace_macros($tpl, array(
+ '$zcard' => $zcard,
'$profile' => $profile,
'$connect' => $connect,
'$connect_url' => $connect_url,
@@ -1796,8 +1800,8 @@ function get_zcard($channel,$observer_hash = '',$args = array()) {
$cover_size = PHOTO_RES_COVER_425;
$pphoto = array('type' => $channel['xchan_photo_mimetype'], 'width' => 80 , 'height' => 80, 'href' => $channel['xchan_photo_m']);
}
- elseif($maxwidth <= 850) {
- $width = 850;
+ elseif($maxwidth <= 900) {
+ $width = 900;
$size = 'hz_medium';
$cover_size = PHOTO_RES_COVER_850;
$pphoto = array('type' => $channel['xchan_photo_mimetype'], 'width' => 160 , 'height' => 160, 'href' => $channel['xchan_photo_l']);
@@ -1832,6 +1836,7 @@ function get_zcard($channel,$observer_hash = '',$args = array()) {
}
$o .= replace_macros(get_markup_template('zcard.tpl'),array(
+ '$maxwidth' => $maxwidth,
'$scale' => $scale,
'$translate' => $translate,
'$size' => $size,
diff --git a/include/network.php b/include/network.php
index fe6b553e9..1d0159ea5 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1805,6 +1805,7 @@ function get_site_info() {
$data = Array(
'version' => $version,
'version_tag' => $tag,
+ 'server_role' => get_server_role(),
'commit' => $commit,
'url' => z_root(),
'plugins' => $visible_plugins,
diff --git a/include/widgets.php b/include/widgets.php
index 8073058c6..fa2b3de4d 100644
--- a/include/widgets.php
+++ b/include/widgets.php
@@ -8,7 +8,7 @@
require_once('include/dir_fns.php');
require_once('include/contact_widgets.php');
require_once('include/attach.php');
-
+require_once('include/Contact.php');
function widget_profile($args) {
$a = get_app();
@@ -16,6 +16,16 @@ function widget_profile($args) {
return profile_sidebar($a->profile, $block, true);
}
+function widget_zcard($args) {
+ $a = get_app();
+ $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false);
+ $channel = channelx_by_n($a->profile_uid);
+ return get_zcard($channel,get_observer_hash(),array('width' => 875));
+}
+
+
+
+
// FIXME The problem with the next widget is that we don't have a search function for webpages that we can send the links to.
// Then we should also provide an option to search webpages and conversations.
@@ -369,6 +379,17 @@ function widget_fullprofile($arr) {
return profile_sidebar($a->profile, $block);
}
+function widget_shortprofile($arr) {
+ $a = get_app();
+ if(! $a->profile['profile_uid'])
+ return;
+
+ $block = (((get_config('system', 'block_public')) && (! local_channel()) && (! remote_channel())) ? true : false);
+
+ return profile_sidebar($a->profile, $block, true, true);
+}
+
+
function widget_categories($arr) {
$a = get_app();