agreed.
as asked for earlier in this thread, the ability to enable/disable users from changing their displayname once set.
open up modules/profile/xoops_version.php
find:
le="color: #000000"><?php $modversion['config'][22]['name'] = 'allowed_groups'; $modversion['config'][22]['title'] = '_PROFILE_MI_ALLOWVIEWACC'; $modversion['config'][22]['description'] = '_PROFILE_MI_ALLOWVIEWACC_DESC'; $modversion['config'][22]['formtype'] = 'group_multi'; $modversion['config'][22]['valuetype'] = 'array'; $modversion['config'][22]['default'] = array(XOOPS_GROUP_ADMIN, XOOPS_GROUP_USERS); $modversion['config'][22]['category'] = 'settings';
Add Right Afterle="color: #000000"><?php $modversion['config'][23]['name'] = 'allow_chgdisplayname'; $modversion['config'][23]['title'] = '_PROFILE_MI_ALLOWCHGUNAME'; $modversion['config'][23]['description'] = '_PROFILE_MI_ALLOWCHGUNAME_DESC'; $modversion['config'][23]['formtype'] = 'yesno'; $modversion['config'][23]['valuetype'] = 'int'; $modversion['config'][23]['default'] = 0; $modversion['config'][23]['category'] = 'settings';
Save fileOpen modules/profile/language/english/modinfo.php
Add (anywhere)le="color: #000000"><?php define("_PROFILE_MI_ALLOWCHGDISPLAYNAME", "Allow users to change their display name?"); define("_PROFILE_MI_ALLOWCHGDISPLAYNAME_DESC", "");
save file
Open modules/profile/edituser.php
Findle="color: #000000"><?php if ($xoopsModuleConfig['allow_chgmail'] == 1) { $edituser->setVar('email', $email); }
Add right afterle="color: #000000"><?php if ($xoopsModuleConfig['allow_chgdisplayname'] == 1) { $edituser->setVar('uname', $myts->stripSlashesGPC(trim($_POST['uname']))); }
Findle="color: #000000"><?php $edituser->setVar('name', $myts->stripSlashesGPC(trim($_POST['name']))); $edituser->setVar('uname', $myts->stripSlashesGPC(trim($_POST['uname'])));
REPLACE withle="color: #000000"><?php $edituser->setVar('name', $myts->stripSlashesGPC(trim($_POST['name'])));
Findle="color: #000000"><?php $edituser->setVar('loginname', $myts->stripSlashesGPC(trim($_POST['loginname']))); $edituser->setVar('email', $email);
REPLACE withle="color: #000000"><?php $edituser->setVar('loginname', $myts->stripSlashesGPC(trim($_POST['loginname']))); $edituser->setVar('uname', $myts->stripSlashesGPC(trim($_POST['uname']))); $edituser->setVar('email', $email);
SAVE File
open modules/profile/include/forms.php
Findle="color: #000000"><?php $elements[0][] = array('element' => new XoopsFormText(_PROFILE_MA_DISPLAYNAME, 'uname', 25, 75, $user->getVar('uname', 'e')), 'required' => 1); $weights[0][] = 0;
REPLACE WITHle="color: #000000"><?php $uname_tray = new XoopsFormElementTray(_PROFILE_MA_DISPLAYNAME, '<br />'); if ($user->isNew() || $xoopsModuleConfig['allow_chgdisplayname'] == 1 || $xoopsUser->isAdmin()) { $uname_text = new XoopsFormText('', 'uname', 30, 60, $user->getVar('uname')); } else { $uname_text = new XoopsFormLabel('', $user->getVar('uname')); } $uname_tray->addElement($uname_text, ($user->isNew() || $xoopsModuleConfig['allow_chgdisplayname'] == 1)); $elements[0][] = array('element' => $uname_tray, 'required' => 0); $weights[0][] = 0;
Save File.
now goto admin, and update the profiles module from the modules admin page.
you're finished!
you can now select whether users can change their display name from the extended profile general preferences screen.