1
Cavan
New field info not output to user profile
  • 2005/4/12 2:57

  • Cavan

  • Friend of XOOPS

  • Posts: 218

  • Since: 2004/11/28


I've added the field "Location" to the registration form, in registerform.php and register.php, but the information is not being output to the user's profile. What did I miss?

2
hyperpod
Re: New field info not output to user profile
  • 2005/4/12 3:16

  • hyperpod

  • Quite a regular

  • Posts: 359

  • Since: 2004/10/4


Well, that sounds like half done.

Did you add the field to the database table?

Also, you would need to edit the userinfo.php to actually print the data from the database.

Hope that helps...

3
Cavan
Re: New field info not output to user profile
  • 2005/4/12 3:53

  • Cavan

  • Friend of XOOPS

  • Posts: 218

  • Since: 2004/11/28


The field user_from is already in the the xoops_users table, the location is already in the userinfo.php, so maybe I have the wrong variable somewhere?

Should I be using $user_from rather than $location in the register.php instead?

I'll try it and see what happens...

4
Cavan
Re: New field info not output to user profile
  • 2005/4/12 4:14

  • Cavan

  • Friend of XOOPS

  • Posts: 218

  • Since: 2004/11/28


No, didn't work. Okay, so this is what I have so far:

registerform.php, line 80
$reg_form->addElement(new XoopsFormText(_US_LOCATION"user_from"2625$user_from), true);


register.php, line 159
echo _US_LOCATION.": ".$myts->makeTboxData4Preview($user_from)."<br />";


register.php, line 181
<input type='hidden' name='location' value='".$myts->makeTboxData4PreviewInForm($user_from)."' />


this is/was already in userinfo.php
$xoopsTpl->assign('user_location'$thisUser->getVar('user_from'));


and this already in system_userinfo.html
<tr valign="top">
          <
td class="head"><{$lang_location}></td>
          <
td class="odd"><{$user_location}></td>
        </
tr>


So, what am I missing or am I still using the wrong variable somewhere?

5
m0nty
Re: New field info not output to user profile
  • 2005/4/12 6:53

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


those line numbers look wrong compared to my register.php

which XOOPS version you using?

using your info above i just edited my register.php, registerform.php and it worked fine altho i edited different lines...

http://66.195.18.220/~wwcncom/chddemo/register.php

you probably haven't quite entered it correctly..

also i made 1 extra addition to register.php

i added the line:

$newuser->setVar('location'$user_from);


just below the line:

$newuser->setVar('email'$email);



i can't tell exactly from your post as the line numbers are different, but you need to make sure that the line tag is right.. "; on the end if it's the last row, but if there's a line after it you need to omit the ";

ie register.php lines 166 & 167

<input type='hidden' name='email' value='".$myts->makeTboxData4PreviewInForm($email)."' />
<
input type='hidden' name='location' value='".$myts->makeTboxData4PreviewInForm($user_from)."' />";

6
Cavan
Re: New field info not output to user profile
  • 2005/4/12 18:13

  • Cavan

  • Friend of XOOPS

  • Posts: 218

  • Since: 2004/11/28


m0nty,

Here's a few bits from my register.php (FYI, I use XOOPS 2.0.7.3), lines 155-186:
//        OpenTable();
        
echo "<h5><strong><p>Please review the following information:</p></strong></h5>";
        echo 
_US_USERNAME.": ".$myts->makeTboxData4Preview($uname)."<br />";
        echo 
_US_NAME.": ".$myts->makeTboxData4Preview($name)."<br />";
        echo 
_US_LOCATION.": ".$myts->makeTboxData4Preview($user_from)."<br />";
        echo 
_US_EMAIL.": ".$myts->makeTboxData4Preview($email)."<br />";
        
//if ( $user_avatar != '' ) {
        //    echo _US_AVATAR.": <img src='uploads/".$user_avatar."' alt='' /><br />";
        //}
        
if ( isset($url) && $url != '' ) {
            
$url formatURL($myts->makeTboxData4Preview($url));
            echo 
_US_WEBSITE.": $url<br />";
        }
        
$f_timezone = ($timezone_offset 0) ? 'GMT '.$timezone_offset 'GMT +'.$timezone_offset;
        echo 
_US_TIMEZONE.": $f_timezone<br />";
        echo 
"<h5><strong><p><strong>If the above information to be correct, please click the Finish button below to receive your registration e-mail.</strong></p>
          <p>IMPORTANT NOTE: If you are using an online e-mail provider such as Yahoo, AOL or MSN, you may need to check your Trash or Junk mail folder for your registration e-mail. To prevent this from happening in the future, please add our web address to your Safe or Trusted sites list in your email settings.</p></strong></h5>"
;
        echo 
"<form action='register.php' method='post'>
        <input type='hidden' name='uname' value='"
.$myts->makeTboxData4PreviewInForm($uname)."' />
        <input type='hidden' name='name' value='"
.$myts->makeTboxData4PreviewInForm($name)."' />
        <input type='hidden' name='email' value='"
.$myts->makeTboxData4PreviewInForm($email)."' />";
        
//echo "<input type='hidden' name='user_avatar' value='".$myts->makeTboxData4PreviewInForm($user_avatar)."' />";
        
$user_viewemail = isset($user_viewemail) ? intval($user_viewemail) : 0;
        echo 
"<input type='hidden' name='user_viewemail' value='".$user_viewemail."' />
        <input type='hidden' name='timezone_offset' value='"
.(float)$timezone_offset."' />
        <input type='hidden' name='url' value='"
.$myts->makeTboxData4PreviewInForm($url)."' />
        <input type='hidden' name='location' value='"
.$myts->makeTboxData4PreviewInForm($user_from)."' />
        <input type='hidden' name='pass' value='"
.$myts->makeTboxData4PreviewInForm($pass)."' />
        <input type='hidden' name='vpass' value='"
.$myts->makeTboxData4PreviewInForm($vpass)."' />
        <input type='hidden' name='user_mailok' value='"
.intval($user_mailok)."' />
        <br /><br /><input type='hidden' name='op' value='finish' /><input type='submit' value='"
_US_FINISH ."' /></form>";
//        CloseTable();


these are lines 194-218 (same file):
case 'finish':
    include 
'header.php';
    
$uname trim($uname);
    
$email trim($email);
    
$name trim($name);
    
$pass trim($pass);
    
$vpass trim($vpass);
    
$stop userCheck($uname$email$pass$vpass);
    if ( empty(
$stop) ) {
        
$member_handler =& xoops_gethandler('member');
        
$newuser =& $member_handler->createUser();
        if ( isset(
$user_viewemail) ) {
            
$newuser->setVar('user_viewemail',$user_viewemail);
        }
        if ( isset(
$attachsig) ) {
            
$newuser->setVar('attachsig',$attachsig);
        }
        
$name = isset($name) ? $name '';
        
$newuser->setVar('name'$name);
        
$newuser->setVar('uname'$uname);
        
$newuser->setVar('email'$email);
        
$newuser->setVar('location'$user_from);
        if ( isset(
$url) && $url!='' ) {
            
$newuser->setVar('url'formatURL($url));
        }


Does this look okay? I don't see anything wrong here or maybe I'm just going blind...?

Edit: I can post the whole file if you like, just let me know. Thanks for helping out here.

Login

Who's Online

138 user(s) are online (72 user(s) are browsing Support Forums)


Members: 0


Guests: 138


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits