*

bobyrou

  • ****
  • 109 posts
Hide all phone number digits AFTER first 4 digits
« on: May 06, 2017, 09:31:50 PM »
Hi, can you please help me out. I am trying to Hide all phone number digits AFTER first 4 digits. At the moment hides the last 4 digits of phonenumber.

*

bobyrou

  • ****
  • 109 posts
Re: Hide all phone number digits AFTER first 4 digits
« Reply #1 on: May 07, 2017, 10:36:39 PM »
Forgot to add the printscreen to help you what I mean: http://imgur.com/IUQka60

*

Ivanko

  • *****
  • 391 posts
Re: Hide all phone number digits AFTER first 4 digits
« Reply #2 on: May 07, 2017, 11:20:27 PM »
in item.php

you can find and modify this function

Code: [Select]
<?php 
if(strlen($mobile) >= and $mobile <> __('No phone number''veronika')) {
echo 
substr($mobile0strlen($mobile) - 4) . 'xxxx'
} else {
echo 
$mobile;
}
?>

*

bobyrou

  • ****
  • 109 posts
Re: Hide all phone number digits AFTER first 4 digits
« Reply #3 on: May 08, 2017, 11:04:33 AM »
Thanks for pointing me, and what do I need to change there?

*

bobyrou

  • ****
  • 109 posts
Re: Hide all phone number digits AFTER first 4 digits
« Reply #4 on: May 08, 2017, 12:43:06 PM »
I just tried your solution but it still shows number and also weird. Printscreen: http://imgur.com/OniH07g

*

Ivanko

  • *****
  • 391 posts
Re: Hide all phone number digits AFTER first 4 digits
« Reply #5 on: May 08, 2017, 12:57:10 PM »
make it like this

Code: [Select]

<?php 
if(strlen($mobile) >= and $mobile <> __('No phone number''veronika')) {
echo 
'xxxxxxxxxx'
} else {
echo 
$mobile;
?>
« Last Edit: May 08, 2017, 01:01:07 PM by Ivanko »

*

bobyrou

  • ****
  • 109 posts
Re: Hide all phone number digits AFTER first 4 digits
« Reply #6 on: May 08, 2017, 03:23:12 PM »
well, it still doesn't, shows up a close unexpected error

*

Ivanko

  • *****
  • 391 posts
Re: Hide all phone number digits AFTER first 4 digits
« Reply #7 on: May 08, 2017, 03:27:40 PM »
well, it still doesn't, shows up a close unexpected error

find:
Code: [Select]
<?php 
if(strlen($mobile) >= and $mobile <> __('No phone number''veronika')) {
echo 
substr($mobile0strlen($mobile) - 4) . 'xxxx'
} else {
echo 
$mobile;
}
?>

replace with:
Code: [Select]
<?php 
if(strlen($mobile) >= and $mobile <> __('No phone number''veronika')) {
echo 
'xxxxxxxxxx'
} else {
echo 
$mobile;
}
?>
« Last Edit: May 08, 2017, 03:29:15 PM by Ivanko »

*

bobyrou

  • ****
  • 109 posts
Re: Hide all phone number digits AFTER first 4 digits
« Reply #8 on: May 09, 2017, 10:28:17 AM »
thanks for the solution. Is there a way I can Hide everything after 4 digits, e.g. 0745 xxxxxxx ?

*

Ivanko

  • *****
  • 391 posts
Re: Hide all phone number digits AFTER first 4 digits
« Reply #9 on: May 09, 2017, 11:44:26 AM »
you can do what ever you like, you can check php manual for custom settings