1
L1ghtn1n
Making real name a required field - XOOPS 2.0.16
  • 2007/10/9 18:51

  • L1ghtn1n

  • Just popping in

  • Posts: 6

  • Since: 2007/10/5


I have tried everything here a few times over
https://xoops.org/modules/smartfaq/faq.php?faqid=478

And read here
https://xoops.org/modules/newbb/viewtopic.php?topic_id=43464&forum=7&post_id=194373#forumpost194373

modules/profile/include/forms.php ....... I dont have any profile folder anywhere.

Does anyone know how for XOOPS 2.0.16?

2
Catzwolf
Re: Making real name a required field - XOOPS 2.0.16
  • 2007/10/9 18:58

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


2.16 does not come with the profiles module, that came with the infamous 2.2+ versions.

You will have to edit two files, 1st:
modules/system/admin/users/userform.php.

and change this line 134 (ish)

Form:

$form->addElement($name_text);


to:

$form->addElement($name_texttrue);


The next file to open is:

kernel/user.php

And change line (73)

From:

$this->initVar('name'XOBJ_DTYPE_TXTBOXnullfalse60);


To:

$this->initVar('name'XOBJ_DTYPE_TXTBOXnulltrue60);


And that should do it for you.

ATB

Catz

3
L1ghtn1n
Re: Making real name a required field - XOOPS 2.0.16
  • 2007/10/9 19:49

  • L1ghtn1n

  • Just popping in

  • Posts: 6

  • Since: 2007/10/5


Thank you for the fast reply.

I tried it and it made no change.
I rechecked the edits twice.

Could it require a server reboot?

4
mboyden
Re: Making real name a required field - XOOPS 2.0.16
  • 2007/10/9 20:06

  • mboyden

  • Moderator

  • Posts: 484

  • Since: 2005/3/9 1


You can also use the module SmartProfile from SmartFactory. Make sure and find the CVS version (dated 2007-06-15) in their forums (at least until something past the 1.0 release is released) since there are still a few bugs with the 1.0 release. It's from the developers that gave you the profiles module in the 2.2.x fork and they effectively ported that over to 2.0.x branch. There is a lot more flexibility in using that setup, although there is still some room for improvements. You can read more about it the article on my site which has been updated with CVS release info. Caveat: it requires PHP5, although my article has instructions on how to make it PHP4 compatible.
Pessimists see difficulty in opportunity; Optimists see opportunity in difficulty. --W Churchill

XOOPS: Latest | Debug | Hosting and Web Development

5
skenow
Re: Making real name a required field - XOOPS 2.0.16
  • 2007/10/9 20:07

  • skenow

  • Home away from home

  • Posts: 993

  • Since: 2004/11/17


I think that will only make the field required if they edit their profile.

If you want to require the real name when they register, you will need to edit register.php and include/registerform.php to add the field.

Proceed with caution - I haven't been real accurate with my code snippets, lately

in register.php, around line 144

echo _US_EMAIL.": ".$myts->htmlSpecialChars($email)."";
[
color=ff0000]// start of addition
echo _US_REALNAME.": ".$myts->htmlSpecialChars($name)."";
// end of addition[/color]
if ($url != '') {


and around line 153

<input type='hidden' name='uname' value='".$myts->htmlSpecialChars($uname)."' />
[
color=ff0000]// start of addition
<input type='hidden' name='name' value='".$myts->htmlSpecialChars($name)."' />
// end of addition[/color]
<input type='hidden' name='email' value='".$myts->htmlSpecialChars($email)."' />";


and around line 185

}
[
color=ff0000]// start of addition
$newuser->setVar('name'$name);
// end of addition[/color]
$newuser->setVar('user_avatar','blank.gif'true);


and finally, around line 240

$xoopsMailer->assign('SITEURL'XOOPS_URL."/");
[
color=ff0000]// start of addition
$xoopsMailer->assign('REALNAME'$myts->oopsStripSlashesGPC($name));
// end of addition[/color]
$member_handler =& xoops_gethandler('member');


in include/registerform.php, around line 71

$reg_form->addElement(new XoopsFormText(_US_NICKNAME"uname"$uname_size$uname_size$myts->htmlSpecialChars($uname)), true);
[
color=ff0000]// start of addition
$reg_form->addElement(new XoopsFormText(_US_REALNAME"name"3060$myts->htmlSpecialChars($name)), true);
// end of addition[/color]
$reg_form->addElement($email_tray);

6
L1ghtn1n
Re: Making real name a required field - XOOPS 2.0.16
  • 2007/10/9 21:48

  • L1ghtn1n

  • Just popping in

  • Posts: 6

  • Since: 2007/10/5


Following the directions of catzwolf
I noticed no change.. but I only looked for
changes in new user regeneration.

Following the directions of skenow
I got a blank page when trying to register a new user.

When using mboyden's SmartProfile I was able to make
name a required field when editing a profile only.
Not when registering a new user.

I guess I never clarified this point.
I want new users to be required to give real name.

Login

Who's Online

436 user(s) are online (61 user(s) are browsing Support Forums)


Members: 0


Guests: 436


more...

Donat-O-Meter

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

Latest GitHub Commits