@frosticek
@bobyrou
Could You tell in which blok I should add that code?
1) <?php
if(osc_item_user_id() <> 0) {
$item_user = User::newInstance()->findByPrimaryKey(osc_item_user_id());
}
$mobile_found = true;
$mobile = $item_extra['s_phone'];
if($mobile == '' && osc_item_user_id() <> 0) { $mobile = $item_user['s_phone_mobile']; }
if($mobile == '' && osc_item_user_id() <> 0) { $mobile = $item_user['s_phone_land']; }
if($mobile == '') { $mobile = __('No phone number', 'veronika'); }
if(trim($mobile) == '' || strlen(trim($mobile)) < 4) {
$mobile = __('No phone number', 'veronika');
$mobile_found = false;
}
?>
or
2) <div class="phone<?php if(!$mobile_found) { ?> no-number<?php } ?>">
<a href="#" class="phone-block" data-item-id="<?php echo osc_item_id(); ?>" data-item-user-id="<?php echo osc_item_user_id(); ?>">
<i class="fa fa-phone"></i>
<span>
<?php
if(strlen($mobile) >= 4 && $mobile <> __('No phone number', 'veronika')) {
echo substr($mobile, 0, strlen($mobile) - 4) . 'xxxx';
} else {
echo $mobile;
}
?>
</span>
</a>
<?php if($mobile_found) { ?>
<a href="#" class="phone-show" data-item-id="<?php echo osc_item_id(); ?>" data-item-user-id="<?php echo osc_item_user_id(); ?>"><?php _e('Show', 'veronika'); ?></a>
<?php } ?>
</div>
(I tested both and it works on both, but which is correct).