aboutsummaryrefslogtreecommitdiffstats
path: root/include/channel.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/channel.php')
-rw-r--r--include/channel.php38
1 files changed, 17 insertions, 21 deletions
diff --git a/include/channel.php b/include/channel.php
index 22b5bcde1..fe67f5304 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -94,8 +94,10 @@ function validate_channelname($name) {
*/
call_hooks('validate_channelname', $arr);
- if (x($arr, 'message'))
+ if (!empty($arr['message']))
return $arr['message'];
+
+ return null;
}
@@ -217,8 +219,8 @@ function create_identity($arr) {
}
$name = escape_tags($arr['name']);
- $pageflags = ((x($arr,'pageflags')) ? intval($arr['pageflags']) : PAGE_NORMAL);
- $system = ((x($arr,'system')) ? intval($arr['system']) : 0);
+ $pageflags = ((!empty($arr['pageflags'])) ? intval($arr['pageflags']) : PAGE_NORMAL);
+ $system = ((!empty($arr['system'])) ? intval($arr['system']) : 0);
$name_error = validate_channelname($arr['name']);
if($name_error) {
$ret['message'] = $name_error;
@@ -1632,19 +1634,19 @@ function profile_sidebar($profile, $block = 0, $show_connect = true, $details =
$connect_url = z_root() . '/connect/' . $profile['channel_address'];
}
- if((x($profile,'address') == 1)
- || (x($profile,'locality') == 1)
- || (x($profile,'region') == 1)
- || (x($profile,'postal_code') == 1)
- || (x($profile,'country_name') == 1))
+ if(!empty($profile['address'])
+ || !empty($profile['locality'])
+ || !empty($profile['region'])
+ || !empty($profile['postal_code'])
+ || !empty($profile['country_name']))
$location = t('Location:');
$profile['homepage'] = linkify($profile['homepage'],true);
- $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);
+ $gender = ((!empty($profile['gender'])) ? t('Gender:') : False);
+ $marital = ((!empty($profile['marital'])) ? t('Status:') : False);
+ $homepage = ((!empty($profile['homepage'])) ? t('Homepage:') : False);
+ $hometown = ((!empty($profile['hometown'])) ? t('Hometown:') : False);
$profile['online'] = (($profile['online_status'] === 'online') ? t('Online Now') : False);
// logger('online: ' . $profile['online']);
@@ -2428,7 +2430,7 @@ function get_zcard($channel, $observer_hash = '', $args = array()) {
$cover = [ 'href' => z_root() . '/images/default_cover_photos/' . $default_cover . '/' . $cover_width . '.png' ];
}
- $o .= replace_macros(get_markup_template('zcard.tpl'), array(
+ return replace_macros(get_markup_template('zcard.tpl'), array(
'$maxwidth' => $maxwidth,
'$scale' => $scale,
'$translate' => $translate,
@@ -2437,8 +2439,6 @@ function get_zcard($channel, $observer_hash = '', $args = array()) {
'$pphoto' => $pphoto,
'$zcard' => $zcard
));
-
- return $o;
}
@@ -2505,17 +2505,13 @@ function get_zcard_embed($channel, $observer_hash = '', $args = array()) {
$cover = [ 'href' => z_root() . '/images/default_cover_photos/' . $default_cover . '/' . $cover_width . '.png' ];
}
- $o .= replace_macros(get_markup_template('zcard_embed.tpl'),array(
+ return replace_macros(get_markup_template('zcard_embed.tpl'),array(
'$maxwidth' => $maxwidth,
- '$scale' => $scale,
- '$translate' => $translate,
'$size' => $size,
'$cover' => $cover,
'$pphoto' => $pphoto,
'$zcard' => $zcard
));
-
- return $o;
}
/**
@@ -3106,7 +3102,7 @@ function pchan_to_chan($pchan) {
}
function channel_url($channel) {
- return (($channel) ? z_root() . '/channel/' . $channel['channel_address'] : z_root());
+ return ((isset($channel['channel_address'])) ? z_root() . '/channel/' . $channel['channel_address'] : z_root());
}
function get_channel_hashes() {