PDA

View Full Version : We demand an official technical support to hide the phone number !



nirvano
June 1, 2016, 12:19 AM
We demand an official technical support to hide the phone number !

its very important to avoid programs Find phone numbers ( bot and spam )

The developer team enabled attention to this very important B)

All scripts hide the phone number !!!


And we know that Flynax is the best and strongest

1693

Viktor
June 1, 2016, 05:52 AM
Hello,

Do you want to hide phone number for non logged users or for all?

Wei Hong
June 1, 2016, 08:23 AM
I think for all if the best option, user just have to click to reveal.

nirvano
June 1, 2016, 11:27 AM
all users must click a button to display the phone number

the importance of prohibited extracting phone number from the bot and spam !

nirvano
June 4, 2016, 02:32 PM
the problem is solved .... B)

benyezza
June 4, 2016, 06:46 PM
Yes, the best is to hinde first part for phone number like :


****8314 click tu reveal

Wei Hong
June 5, 2016, 06:24 AM
the problem is solved .... B)

Please share how did you solve it. :(

Wei Hong
June 5, 2016, 06:27 AM
Yes, the best is to hinde first part for phone number like :


****8314 click tu reveal

This is the best scenario

nirvano
June 5, 2016, 07:12 PM
I can not convince the official Flynax team has to make corrections or changed in the script :blink:

I would like to thank all of Niall Boylan and Ameer Hassan For their cooperation :)

this my exemple http://goo.gl/wCVAoX (http://goo.gl/wCVAoX)

nirvano
June 5, 2016, 07:13 PM
This is the best scenario

Yes .... This is the best scenario

Mahmood Al lawati
September 26, 2017, 10:45 AM
Hello

could you please share what you did or maybe PM it.

i would appreciate it a lot

Wei Hong
January 18, 2018, 09:55 AM
Can you share how to make phone number hidden, only show the last 4 digit and with text click to reveal?

Rudi
January 19, 2018, 06:25 AM
Can you share how to make phone number hidden, only show the last 4 digit and with text click to reveal?

Hello,

You can use this code for phone type fields in tpl file:



{if $sidebar}
<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="your_field_key"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');;
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');;
});
});
});
{/literal}
</script>
{/if}


* where your_field_key is a key of your phone field

in js file omit <script> and {literal} elements

Wei Hong
January 19, 2018, 07:42 AM
Hello,

You can use this code for phone type fields in tpl file:



<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="your_field_key"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');;
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');;
});
});
});
{/literal}
</script>


* where your_field_key is a key of your phone field

in js file omit <script> and {literal} elements

Hi Rudi,

Thank you for your guide, I was going to test it out but I'm unsure. What tpl file do you mean? Did you mean field.tpl?
And what js file do you mean? Was it lib.js?

Rudi
January 19, 2018, 09:32 AM
I meant that you can add it to some tpl or js file (lib.js for example)

in case of tpl it's better to add this code to templates > your template > tpl > blocks > listing_details_seller.tpl > add it to the end of the file

Wei Hong
January 20, 2018, 04:17 AM
Hi Rudi,

It worked very great. One more question. Is there anyway that I can make it so the first click will reveal all phone number. And click again to actually call it?
Because now the function work so that user click and make call at the first click.

Right now phone number show: *********1234
Can I add text: "Click to reveal" under the *********1234 ?

Thank you

nirvano
January 20, 2018, 06:21 PM
Hello Rudi;

Please can you help me and everyone used General wilde template, i have this code of listing_details_seller.tpl


<!-- bottom listing details seller -->

{if $contact}
{assign var='seller_info' value=$contact}
{/if}


<div class="row seller-short">
<div class="col-sm-6 {if $sidebar}col-md-12{else}col-md-6 col-xs-12{/if}{if $seller_info.Listings_count && $seller_info.Own_page && !$owner_page} button-exists{/if}">
{if !$block.Header && !$sidebar}
{assign var='get_more_phrase' value='blocks+name+get_more_details'}
<h3>{$lang.$get_more_phrase}</h3>
{/if}

<div class="clearfix relative">
{if $seller_info.Photo}
<div class="picture{if $config.account_thumb_width > 120} landscape{/if}">
{if $seller_info.Own_page && !$owner_page}<a target="_blank" title="{$lang.visit_owner_page}" href="{$seller_info.Personal_address}">{/if}
<img {if !empty($seller_info.Photo)}class="photo"{/if} style="background-image: url('{$smarty.const.RL_FILES_URL}{$seller_info.Pho to}');{if $config.account_thumb_width}width: {$config.account_thumb_width}px;{/if}{if $config.account_thumb_height}height: {$config.account_thumb_height}px;{/if}" alt="{$lang.seller_thumbnail}" src="{$rlTplBase}img/blank.gif" />
{if $seller_info.Own_page && !$owner_page}</a>{/if}
</div>
{/if}
<ul class="seller-info">
<li class="name">
{if $seller_info.Own_page && !$owner_page}<a title="{$lang.visit_owner_page}" href="{$seller_info.Personal_address}">{/if}
{if !empty($seller_info.company_name)}{$seller_info.co mpany_name}{else}{$seller_info.Full_name}{/if}
{if $seller_info.Own_page && !$owner_page}</a>{/if}


{if $seller_info.Type}
{assign var='type_replace' value=`$smarty.ldelim`account_type`$smarty.rdelim` }
{assign var='date_replace' value=`$smarty.ldelim`date`$smarty.rdelim`}
{assign var='date' value=$seller_info.Date|date_format:$smarty.const. RL_DATE_FORMAT}
<div class="type">{$lang.account_type_since_data|replace:$type_repla ce:$seller_info.Type_name|replace:$date_replace:$d ate}</div>
{/if}
</li>
{if $seller_info.Fields.about_me.value}
<li class="about">{$seller_info.Fields.about_me.value}</li>
{/if}


{if $owner_page}
{if $seller_info.Listings_count && !$contact}

<li class="counter">
<span class="counter">{$seller_info.Listings_count}</span>
<span>{$lang.listings}</span>
</li>
{/if}
{else}
{if $seller_info.Listings_count && $seller_info.Own_page}
<a class="button low" href="{$seller_info.Personal_address}#listings" title="{$lang.account_listings}">{phrase key='account_listings'}</a>
{/if}
{/if}
</ul>
</div>


{assign var='show_owner_details' value=false}


{foreach from=$owner_short_details item='item'}
{if !$item.Map && !empty($item.value) && $item.Details_page && $item.Key != 'First_name' && $item.Key != 'Last_name' && $item.Key != 'about_me'}
{assign var='show_owner_details' value=true}
{break}
{/if}
{/foreach}


{if $owner_short_details && $show_owner_details}
<div class="owner-details">
{if !$allow_contacts}<h3 class="cd-caption">{$lang.contact_details}</h3>{/if}
<div class="info-table">
<div{if !$allow_contacts} class="masked"{/if}>
{foreach from=$owner_short_details item='item'}
{if !$item.Map && !empty($item.value) && $item.Details_page && $item.Key != 'First_name' && $item.Key != 'Last_name' && $item.Key != 'about_me'}
{include file='blocks'|cat:$smarty.const.RL_DS|cat:'field_o ut.tpl' small=true}
{/if}
{/foreach}


{if $seller_info.Display_email}
<div class="table-cell small">
<div class="name">{$lang.mail}</div>
<div class="value">{if $allow_contacts}{encodeEmail email=$seller_info.Mail}{else}{assign var='mail_replace' value=`$smarty.ldelim`field`$smarty.rdelim`}{$lang .fake_value|replace:$mail_replace:$lang.mail}{/if}</div>
</div>
{/if}


{if !$allow_contacts}
<div class="login-mask">
<div class="restricted-content">
{if $isLogin}
<p>{$lang.contacts_not_available}</p>
<span>
<a class="button" title="{$lang.registration}" href="{pageUrl key='my_profile'}#membership">{$lang.change_plan}</a>
</span>
{else}
<p>{$lang.contact_details_hint}</p>
<span>
<a href="javascript://" class="button login">{$lang.sign_in}</a> <span>{$lang.or}</span> <a title="{$lang.registration}" href="{pageUrl key='registration'}">{$lang.sign_up}</a>
</span>
{/if}
</div>
</div>
{/if}
</div>
</div>
</div>
{/if}


{rlHook name='listingDetailsSellerBox'}
</div>


{if !$is_owner && $config.messages_module && ($isLogin || (!$isLogin && $config.messages_allow_free)) && !$contact}
<div class="col-sm-6 {if $sidebar}col-md-12 form{else}col-md-6 col-xs-12{/if}">
{if !$allow_send_message}<h3 class="cd-caption">{$lang.contact_the_owner}</h3>{/if}
<div{if !$allow_send_message} class="masked"{/if}>
{include file='blocks'|cat:$smarty.const.RL_DS|cat:'contact _seller_form.tpl'}
{if !$allow_send_message}
<div class="login-mask">
<div class="restricted-content">
{if $isLogin}
<p>{$lang.contact_form_not_available}</p>
<span>
<a class="button" title="{$lang.registration}" href="{pageUrl key='my_profile'}#membership">{$lang.change_plan}</a>
</span>
{else}
<p>{$lang.contact_owner_hint}</p>
<span>
<a href="javascript://" class="button login">{$lang.sign_in}</a> <span>{$lang.or}</span> <a title="{$lang.registration}" href="{pageUrl key='registration'}">{$lang.sign_up}</a>
</span>
{/if}
</div>
</div>
{/if}
</div>
</div>
{/if}


<script class="fl-js-static">
{literal}
$(document).ready(function(){
$('a.login').flModal({
caption: '',
source: '#login_modal_source',
width: 'auto',
height: 'auto'
});
});
{/literal}
</script>
</div>


<!-- bottom listing details seller end -->





the code to add with is my key phone field


<script>{literal}
$(document).ready(function(){
var phones = $('div[id*="$seller_info.phone"] .value a');


$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);


phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');;
phone.css('cursor', 'pointer');


$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');;
});
});
});
{/literal}
</script>

i have problem in php 7 :(

think you

Mousa Lotfi
January 22, 2018, 08:33 PM
Hello All


I used this code in field_out_value.tpl file:


{if $item.Key == 'phone'}

listing_details

<script>
{literal}
$('#number').click(function() {
$(this).find('span').text( $(this).data('last') );
});
{/literal}
</script>

{/if}

Good work in side block but not work in listing details.

Amir Khalid
January 26, 2018, 12:18 PM
Hello everyone,

is it possible to add a text over the hidden phone number, i want to show a text "Show Number" instead of caracters ****** . look the attached image

Wei Hong
January 27, 2018, 05:36 AM
Hello everyone,

is it possible to add a text over the hidden phone number, i want to show a text "Show Number" instead of caracters ****** . look the attached image

Yes this look great. Can we do that Rudi, Viktor, Mike, Curtis?

Viktor
January 27, 2018, 10:04 AM
Hello All,

Yes, we can do it of course but you need to create new ticket and we will create it as a small customization.

Muhammad Saleem
February 18, 2018, 11:21 AM
Yes this look great. Can we do that Rudi, Viktor, Mike, Curtis?


Hi
I need this click and reveal phone # for my site as well. How much does it cost?

Thanks
Azhar

Wei Hong
March 28, 2018, 08:48 AM
Hi Rudi,

For your previous code:

<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="phone"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');;
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');;
});
});
});
{/literal}
</script>

When I click on number it immediately trigger call. How can I make it so first click is reveal phone, then second click will trigger call function?

Rudi
March 29, 2018, 08:59 AM
Hi Wei Hong,

change:


$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');;
});


to:


$(phone).filter('.mask').click(function(e){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');

e.preventDefault();
$(phone).unbind('click').bind('click');
});

Wei Hong
March 29, 2018, 09:07 AM
Hi Wei Hong,

change:


$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');;
});


to:


$(phone).filter('.mask').click(function(e){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');

e.preventDefault();
$(phone).unbind('click').bind('click');
});


Thanks Rudi,

Works great. :))

nirvano
March 31, 2018, 11:37 PM
Thanks Rudi,

Works great. :))


How i make this code ?

i add it in the header or something !

Wei Hong
April 1, 2018, 06:04 AM
How i make this code ?

i add it in the header or something !

in listing_detail.tpl or sidebar_seller_detail.tpl

Wei Hong
May 2, 2018, 06:06 AM
Hello,

You can use this code for phone type fields in tpl file:



{if $sidebar}
<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="your_field_key"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');;
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');;
});
});
});
{/literal}
</script>
{/if}


* where your_field_key is a key of your phone field

in js file omit <script> and {literal} elements

Hi Rudi, can you modify the code above for a 'number type' listing field (not phone type) with key 'beru_phone' so that when user input this number: 0123456789. It will show 01-2345-6789 on listing detail page? This is because in another country they have different format.

Rudi
May 2, 2018, 02:05 PM
Hello,

It can be used like this:



$(document).ready(function(){
var phones = $('#df_field_<your_field_key> .value');

$(phones).each(function(){
$(this).text($(this).text().replace(/\D/g,''));

var unformatted = $(this).text();
$(this).text(unformatted.replace(/(.)(?=(\d{4})+$)/g,'$1-'));

var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).toggleClass('mask');
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).toggleClass('mask');
});
});
});

Wei Hong
May 2, 2018, 05:56 PM
Hello,

It can be used like this:



$(document).ready(function(){
var phones = $('div[id*="your_field_key"] .value a');

$(phones).each(function(){

var unformatted = $(this).text();
$(this).text(unformatted.replace(/(.)(?=(\d{4})+$)/g,'$1-'));

var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');
});
});
});


Hi Rudi,

Thank you for your help. But it's weird I think it only works for phone type listing field. Even though I input correct field_key of 'beru_phone,' which is number type listing field, it doesn't change anything. :(

This is what i have in listing detail page


<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="beru_phone"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');;
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');;
});
});
});
{/literal}
</script>
{/if}

Viktor
May 3, 2018, 03:27 AM
Hello Wei Hong,
If you want only 1 phone field and you know exactly key I suggest you yo use my code because it is easier and faster:


<script type="text/javascript">
{literal}
$(document).ready(function(){
var phone = $('#df_field_beru_phone div.value a');
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');;
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');;
});
});
{/literal}
</script>

Rudi
May 3, 2018, 03:55 AM
sorry, I forgot to change selector for number type field, it should go like this:

var phones = $('#df_field_<your_field_key> .value');

Wei Hong
May 3, 2018, 05:11 AM
Dear Rudi and Viktor,

Thank you both for your recommendations. So I combined two of your solutions and managed to make it works for number type field "beru_phone." But not what I was looking for. This is the code I had tried in listing_details.tpl page


<script type="text/javascript">
{literal}
$(document).ready(function(){
var phones = $('#df_field_beru_phone .value');

$(phones).each(function(){

var unformatted = $(this).text();
$(this).text(unformatted.replace(/(.)(?=(\d{4})+$)/g,'$1-'));

var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');
});

});
});
{/literal}
</script>

User input in beru_phone and it show on detail page 123456789012. With code above it show *********012, but click on it it still show 123456789012.
I'm looking to make it show as 1234-5678-9012. Also it doesn't need masked since this is public phone number on yellow page.

So I tried to remove masked featured and hope it will change 123456789012 to 1234-5678-9012 with this code


<script type="text/javascript">
{literal}
$(document).ready(function(){
var phones = $('#df_field_beru_phone .value');

$(phones).each(function(){

var unformatted = $(this).text();
$(this).text(unformatted.replace(/(.)(?=(\d{4})+$)/g,'$1-'));

var phone = $(this);
var default_value = phone.text();
});
});
{/literal}
</script>

But nothing changed. :((((
On listing detail page still show 123456789012
Hu hu hu (T_T)

Rudi
May 3, 2018, 05:20 AM
Actually, I provided necessary code below, check carefully, see my 3d post from the top

Wei Hong
May 3, 2018, 05:34 AM
Actually, I provided necessary code below, check carefully, see my 3d post from the top

Yes Rudi, I read your reply yesterday when you provided this code below:


$(document).ready(function(){
var phones = $('div[id*="your_field_key"] .value a');

$(phones).each(function(){

var unformatted = $(this).text();
$(this).text(unformatted.replace(/(.)(?=(\d{4})+$)/g,'$1-'));

var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask');
phone.css('cursor', 'pointer');

$(phone).filter('.mask').click(function(){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask');
});
});
});

I guess the red part is what change 123456789012 to 1234-5678-9012? I added it in my last try, it doesn't change anything
Or did you mean your reply a few hours ago?

It only have the following correction


sorry, I forgot to change selector for number type field, it should go like this:

var phones = $('#df_field_<your_field_key> .value');

:(

Rudi
May 3, 2018, 07:57 AM
I've corrected that post and now it should work properly, check it
The reason is that the field was surrounded by spaces and I've added a code which trims them

Wei Hong
May 3, 2018, 09:16 AM
I've corrected that post and now it should work properly, check it
The reason is that the field was surrounded by spaces and I've added a code which trims them

Yes Rudi, I just tried it again and it worked perfectly. Thank you very much

Blackred
May 3, 2018, 08:13 PM
How is it when you have to create a new field? 'telephone' ?

Blackred
July 7, 2018, 07:50 AM
How is it when you have to create a new field? 'telephone' ?

Wei Hong
July 8, 2018, 06:40 AM
How is it when you have to create a new field? 'telephone' ?

You can try changing ID to telephone. It should work

Radoslav Stanoev
October 11, 2018, 02:01 PM
Hello Rodi, Are you able to add this change for version 4.7? Thanks a lot!!!!!

Rudi
October 11, 2018, 04:24 PM
Hello Radoslav,

You can add this code the same way to your script following the instructions below as it's not a part of 4.7

Wei Hong
December 23, 2018, 01:01 AM
Hi Rudi,

I'm using this code to hide number by *********1234


<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="phone"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var chars_to_mask = default_value.length - 4;
var mask_phone = Array(chars_to_mask + 1).join("*") + default_value.substring(chars_to_mask);

phone.text(mask_phone).removeAttr('href').toggleCl ass('mask_number');
phone.css('cursor', 'pointer');

$(phone).filter('.mask_number').click(function(sho w){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask_number');

show.preventDefault();
$(phone).unbind('click').bind('click');
});
});
});
{/literal}
</script>

Is there anyway if I could modify the code above so the phone number show a text:

Click here to show

Instead of

*******1234

Thank you

Peter Fulopp
December 23, 2018, 08:53 AM
Hello Radoslav,

You can add this code the same way to your script following the instructions below as it's not a part of 4.7

Hi Rudi,

I've inserted the code (same code as in Wei Hong's comment) into my v. 4.7 but unfortunately nothing happened. It doesn't hide any part of the phone field in any of the blocks. I've inserted the code into: listing_details_seller.tpl, listing_details_sidebar.tpl, and contact_seller_form.tpl. My phone field key is "phone" so didn't change anything in the code, just inserted it as is.

Any ideas what I've done wrong?

Rudi
December 24, 2018, 02:54 AM
Is there anyway if I could modify the code above so the phone number show a text:

Click here to show

Instead of

*******1234


Hello,

Use this code


<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="phone"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var text = "Your text";

phone.text(text).removeAttr('href').toggleClass('m ask_number');
phone.css('cursor', 'pointer');

$(phone).filter('.mask_number').click(function(sho w){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask_number');

show.preventDefault();
$(phone).unbind('click').bind('click');
});
});
});
{/literal}
</script>


insert your text instead of 'Your text'

Rudi
December 24, 2018, 03:03 AM
Hi Rudi,

I've inserted the code (same code as in Wei Hong's comment) into my v. 4.7 but unfortunately nothing happened. It doesn't hide any part of the phone field in any of the blocks.


Hello,

Maybe content is not updated on the page, try to refresh your browser page
also make sure that you insert the code correctly in your tpl file, it should be wrapped with:



<script>
{literal}

...

{/literal}
</script>

Wei Hong
December 24, 2018, 05:05 AM
Hello,

Use this code


<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="phone"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var text = "Your text";

phone.text(text).removeAttr('href').toggleClass('m ask_number');
phone.css('cursor', 'pointer');

$(phone).filter('.mask_number').click(function(sho w){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask_number');

show.preventDefault();
$(phone).unbind('click').bind('click');
});
});
});
{/literal}
</script>


insert your text instead of 'Your text'

I love you Rudi,

Merry Xmas to you and Flynax team

Wei Hong
January 1, 2019, 03:57 AM
Hello,

Use this code


<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="phone"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var text = "Your text";

phone.text(text).removeAttr('href').toggleClass('m ask_number');
phone.css('cursor', 'pointer');

$(phone).filter('.mask_number').click(function(sho w){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask_number');

show.preventDefault();
$(phone).unbind('click').bind('click');
});
});
});
{/literal}
</script>


insert your text instead of 'Your text'

Happy New Year Flynax Team,

Hi Rudi,

I noticed that if internet connection is slow or sometimes lag a bit, the page show the phone number first for example: 415-123-4567, then a second later it is hidden as your code takes effect to be: "Click here to show" I think it is because the code wasn't fully loaded

Is there anyway if we can prevent the phone number not to show before script is fully loaded, that way there phone number won't be revealed if connection lag/slow

Thanks

Wei Hong
January 3, 2019, 08:41 AM
Happy New Year !!!

Rudi
January 4, 2019, 03:44 AM
Hello,

Happy New Year!

go to your template > css > style.css > add the following style:


.phone .value a {
display: none;
}


and change in jquery code:


phone.css('cursor', 'pointer');


to:


phone.css('cursor', 'pointer').css('display', 'block');

Wei Hong
January 4, 2019, 11:40 AM
Hello,

Happy New Year!

go to your template > css > style.css > add the following style:


.phone .value a {
display: none;
}


and change in jquery code:


phone.css('cursor', 'pointer');


to:


phone.css('cursor', 'pointer').css('display', 'block');


Thanks Rudi, it works great for phone. But when I create another css for email the css doesn't work. Here is phone code works OK:


<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="phone"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var text = {/literal}'{$lang.click_to_view}'{literal};

phone.text(text).removeAttr('href').toggleClass('m ask_number');
phone.css('cursor', 'pointer').css('display', 'block');

$(phone).filter('.mask_number').click(function(sho w){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask_number');

show.preventDefault();
$(phone).unbind('click').bind('click');
});
});
});
{/literal}
</script>

Here is email code similar, it hide the email with text OK, just the css display: none; not working


<script>
{literal}
$(document).ready(function(){
var emails = $('div[id*="email"] .value a');

$(emails).each(function(){
var email = $(this);
var default_value = email.text();
var text = {/literal}'{$lang.click_to_view}'{literal};

email.text(text).removeAttr('href').toggleClass('m ask_text');
email.css('cursor', 'pointer').css('display', 'block');

$(email).filter('.mask_text').click(function(show) {
$(this).text(default_value);
$(this).attr('href', 'mailto:' + default_value).toggleClass('mask_text');

show.preventDefault();
$(email).unbind('click').bind('click');
});
});
});
{/literal}
</script>

Here is the css:

.phone .value a,
.email .value a {
display: none;
}

Does email use different css?

Rudi
January 4, 2019, 03:01 PM
For email field use this style:



.owner-details .value span[id^="encoded_email"] {
display: none;
}

Wei Hong
January 5, 2019, 08:18 AM
For email field use this style:



.owner-details .value span[id^="encoded_email"] {
display: none;
}


Thanks Rudi,

It works great

Peter Fulopp
January 7, 2019, 06:53 AM
I changed the code to the one Wei Hong cited below your reply and it works now as it should.

Thanks very much.

Happy New Year Flynax Team and everyone on the forum!

Robert Engelke
April 5, 2019, 11:50 PM
Where is the file located for this jquery code:

phone.css('cursor', 'pointer');

Brian Jester
May 18, 2019, 12:34 AM
Where is the file located for this jquery code:

phone.css('cursor', 'pointer');

I am not exactly sure which one your after, but to give a bit of help, I did a quick search and it could be any of the these files:

templates/your template/js/jquery.fancybox.source.js
templates/your template/js/lib.js
templates/your template/js/map_utility.js
templates/your template/js/swiper.jquery.min.js
templates/your template/js/jquery.fancybox.js

Edit: My mistake you said jQuery code. Again, this was a quick search for the file that contain some of that code you provided.

libs/jquery/jquery.ui.js
libs/jquery/fancy.back.js
libs/jquery/jquery.fancybox_source.js
libs/jquery/colorpicker/css/colorpicker.css
libs/jquery/colorpicker/index.html
libs/jquery/fancybox/helpers/jquery.fancybox-buttons.css
libs/jquery/fancybox/jquery.fancybox.css
libs/jquery/slider/jslider.css
libs/jquery/jquery.fancybox.js
libs/jquery/jquery.qtip.js
libs/jquery/jquery.jcrop.js

* remember to replace your template in the path above with 'your template' name.

kiowa
August 31, 2019, 06:52 AM
im adding the code to the bottom of the file as per instruction. just wont hide the number. any help please?

Dhanish Jose
February 22, 2020, 03:21 PM
Is this still needs to be done manually buy changing the code, or is it handled in the new versions?

Viktor
February 24, 2020, 02:44 AM
Yes, need to do it manually.

Peter Jonsson
May 22, 2020, 07:02 AM
This isn't working for me. And how come this isn't standard yet :/

Can someone tell me where exactly to put all things?

Some code I don't find that I need to change, like jquery.
I use the auto-nova template

Rudi
May 22, 2020, 01:50 PM
Maybe you did something wrong,

if you have support you can create a ticket and we'll help you

Daniel Odeh
August 8, 2020, 07:43 AM
Good day All,
Please how do one hide Phone Number on Contact Details for Visitors not login? In Your escort demo, I can see visitors cant see the phone number on contact details for escort.

Thanks.

Rudi
August 10, 2020, 04:50 PM
Hello,

You can achieve it by using membership plans (Basic Settings > Accounts > Membership plans > enable)

Daniel Odeh
August 11, 2020, 07:22 PM
Hello,

You can achieve it by using membership plans (Basic Settings > Accounts > Membership plans > enable)

My membership plans are enable and even when i create a plan that view contact is uncheck, the phone number still display to the user.

Rudi
August 12, 2020, 02:18 AM
You'd better create a ticket to check the issue

Olcay Birgun
February 25, 2022, 07:52 PM
will this code hide the phone number with a box and when you click on it it shows the phone ?
if yes!
please can someone tell me if it work also with general_nova template and where to set this code


thanks




<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="phone"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var text = {/literal}'{$lang.click_to_view}'{literal};

phone.text(text).removeAttr('href').toggleClass('m ask_number');
phone.css('cursor', 'pointer').css('display', 'block');

$(phone).filter('.mask_number').click(function(sho w){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask_number');

show.preventDefault();
$(phone).unbind('click').bind('click');
});
});
});
{/literal}
</script>

Peter Jonsson
February 26, 2022, 07:19 AM
Navigate to templates/YOURTEMPLATE/tpl/blocks/listing_details_seller.tpl
Add the code at the bottom.


The code below will hide the number with a text.



<script>
{literal}
$(document).ready(function(){
var phones = $('div[id*="phone"] .value a');

$(phones).each(function(){
var phone = $(this);
var default_value = phone.text();
var text = "Show Number";

phone.text(text).removeAttr('href').toggleClass('m ask_number');
phone.css('cursor', 'pointer');

$(phone).filter('.mask_number').click(function(sho w){
$(this).text(default_value);
$(this).attr('href', 'tel:' + default_value).toggleClass('mask_number');

show.preventDefault();
$(phone).unbind('click').bind('click');
});
});
});
{/literal}
</script>


But if you wait some more days/weeks it will be come as an option to the script in the new update.