MyBB Community Forums

Full Version: set default profile options
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I want to set default profile options for new users. how to do it. default profile plugin not giving enough options to edit the profile. i want to set values for messaging and notification.

[Image: jyBn8cP.jpg]
Which ones are you wanting checked/chosen and which ones do you not want checked/chosen?
If you want to set the defaults 1-6 as in your screen shot, you have to make a core file edit in member.php, starting at line 1095. Default accepting buddy requests is already unchecked (I think).

Variable values you want to set are either "checked=\"checked\"" or ''.

Defaults set in member.php:
1097              $allownoticescheck = "checked=\"checked\"";
1098              $hideemailcheck = '';
1099              $emailnotifycheck = '';
1100              $receivepmscheck = "checked=\"checked\"";
1101              $pmnoticecheck = " checked=\"checked\"";
1102              $pmnotifycheck = '';

[attachment=38380]

Other variables are also set in that code block.

This cross-reference has extraordinary value.
https://crossreference.mybb.de/nav.html?...index.html

Remember that core edits will require you to keep track and evaluate during all future upgrades. If you think themes and plugins can go haywire after an upgrade, wait until you have to manage core edits. Don't just make notes of what you did, write a book. You will need to refer to it again. Smile
(2017-02-14, 07:10 PM)Nicole-Studios Wrote: [ -> ]Which ones are you wanting checked/chosen and which ones do you not want checked/chosen?

i want to checked as in the image for newly registered users.

[Image: 687474703a2f2f692e696d6775722e636f6d2f6a...502e6a7067]

(2017-02-14, 08:31 PM)HLFadmin Wrote: [ -> ]If you want to set the defaults 1-6 as in your screen shot, you have to make a core file edit in member.php, starting at line 1095. Default accepting buddy requests is already unchecked (I think).

Variable values you want to set are either "checked=\"checked\"" or ''.

Defaults set in member.php:
1097              $allownoticescheck = "checked=\"checked\"";
1098              $hideemailcheck = '';
1099              $emailnotifycheck = '';
1100              $receivepmscheck = "checked=\"checked\"";
1101              $pmnoticecheck = " checked=\"checked\"";
1102              $pmnotifycheck = '';



Other variables are also set in that code block.

This cross-reference has extraordinary value.
https://crossreference.mybb.de/nav.html?...index.html

Remember that core edits will require you to keep track and evaluate during all future upgrades. If you think themes and plugins can go haywire after an upgrade, wait until you have to manage core edits. Don't just make notes of what you did, write a book. You will need to refer to it again. Smile


i will do as you guided and share the results here. thank you for the brief explanation.

PS: i edited as you guided. but for newly registered users don't have the settings i checked. please help me with this
The core edit I suggested works for members that register after the changes made. I edited out all default checkmarks, resulting in this screenshot captured during registration.
[attachment=38388]

If you have existing registered members, then you can edit their profile in ACP / Users / Profile, or you can make changes in the database using phpMyAdmin.

Some questions: how many users profiles do you want to change. You said "newly registered". Does that exclude members who have changed their profile preferences already?

And, if you want to force a setting and not permit user to change it after, that's something else entirely.
(2017-02-15, 10:31 AM)HLFadmin Wrote: [ -> ]The core edit I suggested works for members that register after the changes made. I edited out all default checkmarks, resulting in this screenshot captured during registration.


If you have existing registered members, then you can edit their profile in ACP / Users / Profile, or you can make changes in the database using phpMyAdmin.

Some questions: how many users profiles do you want to change. You said "newly registered". Does that exclude members who have changed their profile preferences already?

And, if you want to force a setting and not permit user to change it after, that's something else entirely.


i think i have been not presented my problem properly. sorry for the mess i made before. here its in detailed.

i have removed the below part(attached image) in the member_register template. now i understand why the changes in the member.php have not been changed for the new user.

what i require is
set values (checked or unchecked) without displaying it in register form. user can change those after. but for newly register users should have the values i set for profile.

since i removed from member_register new users get all the values unchecked.


how can i achieve this ?
Default values for new members being registered after you modify members.php are saved that way since you have not permitted any changes in the registration form.

1. How many registered users do you have to change their profile because they registered before the modification in members.php?

I asked that because if you have 100, I'd recommend you edit the database, but if it's 10, I'd recommend you edit their profile in ACP / Users. It's only a matter of efficiency.

Also, paste your code from member_register template

Just to make sure, I modified my test forum as discussed here.

1. member.php was edited so options had no checkmarks
2. edited member_register template so there were no options visible.
3. registered a new member only with username, password and email.
4. used ACP to edit the new member's account settings and verified options were not checked.

As you have described it, this method works for members who sign up after mods are made.

It sounds like what you want to do is fix the member account settings that were registered before the defaults were changed.
1. How many registered users do you have to change their profile because they registered before the modification in members.php?

am moving for mybb from another. so now i don't have any users in the forum. i want to made the changes for the new users who register.

can you give a member_register template sample code with options hidden. i have removed the options code completely. so i think anything not passing to the database.

here my member_register


<html>
<head>
<title>{$mybb->settings['bbname']} - {$lang->registration}</title>
{$headerinclude}
<script src="{$mybb->asset_url}/jscripts/validate/jquery.validate.min.js"></script>
</head>
<body>
{$header}
<form action="member.php" method="post" id="registration_form"><input type="text" style="visibility: hidden;" value="" name="regcheck1" /><input type="text" style="visibility: hidden;" value="true" name="regcheck2" />
{$regerrors}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->registration}</strong></td>
</tr>
<tr>
<td width="50%" class="trow1" valign="top">
<fieldset class="trow2">
<legend><strong>{$lang->account_details}</strong></legend>
<table cellspacing="0" cellpadding="{$theme['tablespace']}" width="100%">
<tr>
<td colspan="2"><span class="smalltext"><label for="username">{$lang->username}</label></span></td>
</tr>
<tr>
<td colspan="2"><input type="text" class="textbox" name="username" id="username" style="width: 100%" value="{$username}" /></td>
</tr>
{$passboxes}
<tr>
<td width="50%" valign="top"><span class="smalltext"><label for="email">{$lang->email}</label></span></td>
<td width="50%" valign="top"><span class="smalltext"><label for="email2">{$lang->confirm_email}</label></span></td>
</tr>
<tr>
<td width="50%" valign="top"><input type="text" class="textbox" name="email" id="email" style="width: 100%" maxlength="50" value="{$email}" /></td>
<td width="50%" valign="top"><input type="text" class="textbox" name="email2" id="email2" style="width: 100%" maxlength="50" value="{$email2}" /></td>
</tr>
<tr>
	<td colspan="2" style="display: none;" id="email_status">&nbsp;</td>
</tr>
{$hiddencaptcha}
</table>
</fieldset>
{$requiredfields}
{$customfields}
{$referrer}
{$regimage}
{$questionbox}
</td>
<br />
</tr>
</table>
<br />
<div align="center">
<input type="hidden" name="regtime" value="{$time}" />
<input type="hidden" name="step" value="registration" />
<input type="hidden" name="action" value="do_register" />
<input type="submit" class="button" name="regsubmit" value="{$lang->submit_registration}" />
</div>
</form>
<script type="text/javascript">
<!--
$().ready(function() {
	// validate registration_form
	$("#registration_form").validate({
		rules: {
          username: {
            required: true,
            minlength: {$mybb->settings['minnamelength']},
			maxlength: {$mybb->settings['maxnamelength']},
			remote:{
				url: "xmlhttp.php?action=username_availability",
				type: "post",
              	dataType: "json",
				data:
				{
					my_post_key: my_post_key
				},
			},
          },
          email: {
				required: true,
				email: true,
          },
          email2: {
				required: true,
				email: true,
				equalTo: "#email"
          },
		},
		messages: {
            username: {
              		minlength: "{$lang->js_validator_username_length}",
              		maxlength: "{$lang->js_validator_username_length}",
            },
          	email: "{$lang->js_validator_invalid_email}",
			email2: "{$lang->js_validator_email_match}",
		}
	});

   {$validator_extra}
});
// -->
</script>
{$footer}
</body>
</html>
It looks like your template code is functionally equivalent to mine.
Yours may be based on a theme published from an earlier version.
I am working with a clean 1.8.10 installation for testing purposes.

So, you don't have new members yet. This is good.
Post your member.php as an attachment. I want to see your modifications.
If something is not working right, it may be result of a typo.
I'd like to compare files. Easiest if you upload here.
yes it is from a theme published for a earlier version.

here i attached member.php
Pages: 1 2