Webmastersite.net
Register Log In

Disappearing "0" in the member field

Comments on Disappearing "0" in the member field

tilma


Usergroup: Customer
Joined: May 17, 2005

Total Topics: 3
Total Comments: 10
tilma
Posted May 20, 2005 - 2:09 PM:

I've added the member field "phone number" to my directory.

While testing I saw in the member profile that the 0 on the beginning of the phone number has disappeared (editmembers.tpl shows the same). After editing it again and saving it, the 0 is still not there.

I removed the field and added it again (text, tried also integer), but that isn't the solution.

The problem appears only in custom fields AND the content of the field has only numbers in it.

How can I solve this?


Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 23, 2005 - 7:42 PM:

tilma wrote:
I've added the member field "phone number" to my directory.


If you actually named it that it shouldn't work at all since with a space it's an illegal name.

Anyhow, I've added a new link field 'phone' and edited a link to put 05555555 in that field. I come back to edit it again and it's still there, 05555555. So, you need to give me instructions to reproduce whatever you're doing differently.
tilma


Usergroup: Customer
Joined: May 17, 2005

Total Topics: 3
Total Comments: 10
tilma
Posted May 24, 2005 - 8:19 AM:

Well, I don't think there's anything wrong with my templates, because all the data without a 0 on the beginning is saved correctly. I have no spaces in the field, the example was incorrect...

I even uploaded the original editmembers.tpl en viewprofile.tpl but the problem still exists.

While testing the fields further more, I discovered that it looks like a (how do you say that in english?) rounding problem:

2.27890 wil be saved as 2.28
06 will be saved as 6
and so on, with 2 decimals behind the comma.

This occurs in all member fields, even the username field.
I uploaded the php files all over again (which is crazy because I changed anything except the cron in timedactions.php, but you try everything...)

I will send you a pm with login data to try it yourself.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 24, 2005 - 6:47 PM:

Well, I was adding it as a link field instead of a member field, but I don't see how that'd really make a difference. Will check with a member field anyhow.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7868
Paul
Posted May 25, 2005 - 3:21 PM:

Figured it out, it is members-specific. In classes/members.php, replace the update function with



function update($fields)

{

global $db, $settings, $language, $newid, $plurallinks;



if ($fields == 'all') $memberlist = explode(',', $settings->memberfields);

else $memberlist = explode(',', $fields);

$num = sizeof($memberlist);

for ($count=0; $count<$num; $count++)

{

if ($memberlist[$count] == 'links') $memberlist[$count] = $plurallinks;

if (!$this->groupcanusehtml) $this->$memberlist[$count] = striphtml($this->$memberlist[$count]);

$toupdate .= $memberlist[$count] .'=';

$toupdate .= "'". encodeit($this->$memberlist[$count]) ."'";

$toupdate .= ', ';

}
$toupdate = trim($toupdate, ', ');
$result = $db->updatelist('memberstable', $toupdate, $newid .'='. $this->id);

return true;

}


Will upload in a few days.
tilma


Usergroup: Customer
Joined: May 17, 2005

Total Topics: 3
Total Comments: 10
tilma
Posted May 25, 2005 - 4:55 PM:

Thanks!

It's displaying the right numbers now.
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



This thread is closed, so you cannot post a reply.