Advertisement:

Author Topic: osc_user_phone () not works  (Read 551 times)

mikereese

  • Newbie
  • *
  • Posts: 3
osc_user_phone () not works
« on: May 18, 2016, 11:45:25 pm »
Hi all,
Recently i use this function to hide the last numbers of osc_user_phone ():

jQuery
Code: [Select]
<script>
$(document).ready(function(){
$("#showPhone").click(function () {
$("#showPhone").hide();
$("#hidePhone").show();
});
$("#hidePhone").click(function () {
$("#showPhone").show();
$("#hidePhone").hide();
});
});
</script>

HTML
Code: [Select]
<?php _e('user phone'); ?> :
<span><a href="#"  id="hidePhone" style="display: none;"><?php echo osc_user_phone_mobile(); ?></a></span>
<span><a href="#"  id="showPhone"><?php echo substr(osc_user_phone_mobile(),0,-4).'XXXX'?></a></span>

Up here everything is ok. If complete the Phone Cell field in User profile is ok, the phone number show in item page.
If post a new ad, without account and complete the Cell Phone input, the phone number not showing in item page.

from item-post.php, problem is here (i hope)  :-\
Code: [Select]
<div class="control-group">
<label class="control-label" for="phoneMobile"><?php _e('Cell phone''infinity'); ?></label>
<div class="controls">
<?php UserForm::mobile_text(osc_user()); ?>
</div>
</div>

and from user-profile.php, the cell phone input:

Code: [Select]
<div class="control-group">
                <label class="control-label" for="phoneMobile"><?php _e('Cell phone''infinity'); ?></label>
                <div class="controls">
                    <?php UserForm::mobile_text(osc_user()); ?>
                </div>
            </div>

the same code that item-post.php

How do input field to work and when user posted new ad the phone number show in the item page.

Thanks Guys,
Regards
« Last Edit: May 18, 2016, 11:47:43 pm by mikereese »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: osc_user_phone () not works
« Reply #1 on: May 20, 2016, 08:12:37 pm »
Hi,

Quote
osc_user_phone_mobile()

If not registered user, no record on t_user table, so no data at all.

"Phone" is not a standard field on Ad publishing. What do you use to store that information, a custom field, some plugin? ???

Regards