function violet_mobile_number() {
if (osc_item_id()) {
$user = User::newInstance()->findByPrimaryKey( osc_item_user_id() );
if($user['s_phone_mobile'] != ''){
if (osc_get_preference('hide_digits', 'violet') == '1') {
?>
<script type="text/javascript">
$(document).ready(function () {
var number = '<?php echo $user['s_phone_mobile']; ?>';
$('.set_<?php echo osc_item_id(); ?>').click(function () {
$(this).html(number);
});
});
</script>
<span class="disphone set_<?php echo osc_item_id(); ?>" title="<?php echo osc_esc_html(__('Click to show the number', 'violet')); ?>"><?php echo violet_replace_number_to_x($user['s_phone_mobile']); ?></span>
<?php
} else {
?>
<?php echo $user['s_phone_mobile']; ?>
<?php
}
}
} else if (osc_user()) {
if(osc_user_phone_mobile() != ''){
if (osc_get_preference('hide_digits', 'violet') == '1') {
?>
<script type="text/javascript">
$(document).ready(function () {
var number = '<?php echo osc_user_phone_mobile(); ?>';
$('.set_<?php echo osc_user_id(); ?>').click(function () {
$(this).html(number);
});
});
</script>
<span class="disphone set_<?php echo osc_user_id(); ?>" title="<?php echo osc_esc_html(__('Click to show the number', 'violet')); ?>"><?php echo violet_replace_number_to_x(osc_user_phone_mobile()); ?></span>
<?php
} else {
?>
<?php echo osc_user_phone_mobile(); ?>
<?php
}
}
}
}
function violet_phone_number() {
if (osc_item_id()) {
$user = User::newInstance()->findByPrimaryKey( osc_item_user_id() );
if($user['s_phone_land'] != ''){
if (osc_get_preference('hide_digits', 'violet') == '1') {
?>
<script type="text/javascript">
$(document).ready(function () {
var number = '<?php echo $user['s_phone_land']; ?>';
$('.set2_<?php echo osc_item_id(); ?>').click(function () {
$(this).html(number);
});
});
</script>
<span class="disphone set2_<?php echo osc_item_id(); ?>" title="<?php echo osc_esc_html(__('Click to show the number', 'violet')); ?>"><?php echo violet_replace_number_to_x($user['s_phone_land']); ?></span>
<?php
} else {
?>
<?php echo $user['s_phone_land']; ?>
<?php
}
}
} else if (osc_user()) {
if(osc_user_phone_land() != ''){
if (osc_get_preference('hide_digits', 'violet') == '1') {
?>
<script type="text/javascript">
$(document).ready(function () {
var number = '<?php echo osc_user_phone_land(); ?>';
$('.set2_<?php echo osc_user_id(); ?>').click(function () {
$(this).html(number);
});
});
</script>
<span class="disphone set2_<?php echo osc_user_id(); ?>" title="<?php echo osc_esc_html(__('Click to show the number', 'violet')); ?>"><?php echo violet_replace_number_to_x(osc_user_phone_land()); ?></span>
<?php
} else {
?>
<?php echo osc_user_phone_land(); ?>
<?php
}
}
}
}
function violet_replace_number_to_x($number) {
return substr($number,0,4).str_repeat("X", (strlen($number) - 4));
}