1
massacre
How do I make "Real Name" required on registration?
  • 2005/11/13 1:47

  • massacre

  • Just popping in

  • Posts: 48

  • Since: 2005/8/10


The docs on this are out of date: https://xoops.org/modules/smartfaq/faq.php?faqid=478&com_id=23675&com_rootid=23675&com_mode=flat&com_order=0&

Does anyone have instructions for hacking the profile module (looks like you have to work with /include/forms.php as well as the register.php). I'm not solid enough to figure this out yet and was hoping someone has this already done and could relay the required changes to make it work.

Thanks!

2
m0nty
Re: How do I make "Real Name" required on registration?
  • 2005/11/13 1:50

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


*edit* wasn't thinking of 2.0.13.2 not 2.2.3

ok in 2.2.3

open modules/profile/include/forms.php

find on line 388 or thereabouts:

$elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_REALNAME'name'2575$user->getVar('name''e')), 'required' => 0);


replace with :

$elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_REALNAME'name'2575$user->getVar('name''e')), 'required' => 1);


basically you're just changing the '0' to a '1' right at the end of the line..

3
massacre
Re: How do I make "Real Name" required on registration?
  • 2005/11/16 15:36

  • massacre

  • Just popping in

  • Posts: 48

  • Since: 2005/8/10


Hmmm... that seems to simply make it required when I edit a profile. If I logout and attempt to register it doesn't add the field to the form. Am I missing something?

4
SLEO577
Re: How do I make "Real Name" required on registration?
  • 2005/11/16 16:07

  • SLEO577

  • Not too shy to talk

  • Posts: 110

  • Since: 2005/6/27


Yes....for XOOPS version 2.2.3a

open modules/profile/include/forms.php

find on line 259 or thereabouts:

$elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_DISPLAYNAME"uname"$uname_size75$user->getVar('uname''e')), 'required' => true);
    
$weights[0][] = 0;


Add just below the above script:

$elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_REALNAME"name"$name_size75$user->getVar('name''e')), 'required' => true);
    
$weights[0][] = 0;


That's should be all you need to get it in your registration form in addition to what Monty posted above

5
m0nty
Re: How do I make "Real Name" required on registration?
  • 2005/11/16 16:11

  • m0nty

  • XOOPS is my life!

  • Posts: 3337

  • Since: 2003/10/24


hmmm ok.. try this aswell >

open profile/register.php

find on line 52:

$newuser->setVar('loginname', isset($_POST['loginname']) ? trim($_POST['loginname']) : '');


add after:

$newuser->setVar('name', isset($_POST['name']) ? trim($_POST['name']) : '');


find on line 93:

echo _PROFILE_MA_DISPLAYNAME.": ".$newuser->getVar('uname')."";


add after:

echo _PROFILE_MA_REALNAME.": ".$newuser->getVar('name')."";


save & close

open profile/include/forms.php

find on line 259/260:

$elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_DISPLAYNAME"uname"$uname_size75$user->getVar('uname''e')), 'required' => true);
    
$weights[0][] = 0;


add after:

$elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_REALNAME"name"$uname_size75$user->getVar('name''e')), 'required' => true);
    
$weights[0][] = 0;


(if you don't want the max size of the name to be controlled by the username size then change $uname_size to a numeric value ie. 30 will make it max of 30 characters)

*EDIT*

as SLEO says, but he used $name_size in his, which isn't defined anywhere so will not function right. u have to use $uname_size or enter a numeric number like i mentioned.

if you do actually want to use $name_size instead you would have to define a value for it and do more hacking in xoops_version and language files to add an option to set the max amount and minimum amount in admin.. (not worth the effort i don't think)

6
CiberEspia
Re: How do I make "Real Name" required on registration?

I go to test now?
Mario Burga
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>Adictoshp.org|Web Blog<<
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

7
massacre
Re: How do I make "Real Name" required on registration?
  • 2005/12/5 18:51

  • massacre

  • Just popping in

  • Posts: 48

  • Since: 2005/8/10


Phew... Had to read that a few times. Seems like I have it setup now. Hopefully it works! Thanks m0nty

Oops! you too Sleo!

8
sabahan
Re: How do I make "Real Name" required on registration?
  • 2006/5/3 15:54

  • sabahan

  • Quite a regular

  • Posts: 317

  • Since: 2006/3/4 5



9
sabahan
Re: How do I make "Real Name" required on registration?
  • 2006/5/3 16:11

  • sabahan

  • Quite a regular

  • Posts: 317

  • Since: 2006/3/4 5


Quote:

just ignore...problem solved

10
tzvook
Re: How do I make "Real Name" required on registration?
  • 2006/10/24 14:26

  • tzvook

  • Just can't stay away

  • Posts: 875

  • Since: 2003/2/1 2


Thanks m0nty & Sleo, you saved me a lot of time ... I began doing it myself and decided to go to the forum first and .... well ... found this

Actually one feature is missing, I did that in the past, but may be a nice feature to be in the profile module ...
in each field, along with the "required field" ability, to have also "send in confirmation/activetion mail.

Login

Who's Online

311 user(s) are online (249 user(s) are browsing Support Forums)


Members: 0


Guests: 311


more...

Donat-O-Meter

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

Latest GitHub Commits