MyBB Community Forums

Full Version: Disable/Delete
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

i would like to disable or delete the following things:

#1: [attachment=29646]

and the ignore option from (usercp.php?action=editlists). So only the edit buddy list option will be there.

See here: [attachment=29647]

How can i do that? Any help will be appreciated.

Thanks & Regards,
k1R@

Found the solution for the ignore list.
Anyone else who likes to remove the ignore option, replace the following code with the whole code on (templates -> your template -> User Control Panel Templates -> usercp_editlists):
<html>
<head>
	<title>{$mybb->settings['bbname']} - {$lang->edit_lists}</title>
	{$headerinclude}
	<script type="text/javascript" src="jscripts/usercp.js"></script>
	<script type="text/javascript">
		lang.remove_buddy = '{$lang->confirm_remove_buddy}';
		lang.remove_ignored = '{$lang->confirm_remove_ignored}';
		lang.adding_buddy = '{$lang->adding_buddy}';
		lang.adding_ignored = '{$lang->adding_ignored}';
	</script>
</head>
<body>
	{$header}
	<table width="100%" border="0" align="center">
	<tr>
		{$usercpnav}
		<td valign="top">

		<form action="usercp.php" method="post" id="buddy" onsubmit="return UserCP.addBuddy('buddy');">
			<input type="hidden" name="action" value="do_editlists" />
			<input type="hidden" name="manage" value="buddy" />
			<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
			<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
				<tr>
					<td class="thead" align="center"><strong>{$lang->edit_buddy_list}</strong></td>
				</tr>
				<tr>
					<td class="trow1">
						<fieldset>
							<legend><strong>{$lang->add_buddies}</strong></legend>
							<span class="smalltext">{$lang->add_buddies_desc}</span><br />
							<div style="width: 120px; float: left; text-align: right;"><strong>{$lang->username_or_usernames}</strong></div>
							<div style="margin-left: 130px;"><input type="text" name="add_username" id="buddy_add_username" style="width: 60%;" class="textbox" /> <input type="submit" value="{$lang->add_to_buddies}" id="buddy_submit" class="button" /></div>
							<script type="text/javascript" src="jscripts/autocomplete.js?ver=1400"></script>
							<script type="text/javascript">
							<!--
								if(use_xmlhttprequest == "1")
								{
									new autoComplete("buddy_add_username", "xmlhttp.php?action=get_users", {valueSpan: "username", delimChar: ","});
								}
							// -->
							</script>
						</fieldset>
						<fieldset id="buddy_container">
							<legend><strong>{$lang->current_buddies}</strong></legend>
							<ul id="buddy_list" style="list-style: none;">
								{$buddy_list}
							</ul>
						</fieldset>
					</td>
				</tr>
			</table>
		</form>
		<br />

Still looking for the solution of the (options remove).

Found it. Just had to remove the specific lines in usercp_options template. Even if it looks abit weird now, in the end, it is what i wanted.

But i just noticed the sideboxes as example removed with it..

I had to restore it. ATTENTION: I recommend you to not change the options page in general, it is also removing the purpose of the default options. So if you as example have checked the sidebox or quicky reply before and remove this options from the template, then all these will be disabled too. I only wanted to have it like its hidden, so no one could change this. I hope MyBB gives in their next versions the possibility for the adminstrator to show and hide and create the default usercp content as desirable.
It is possible with template edits and without any issues. For example to remove the avatar setting, you can edit this:
<td valign="top" width="1"><input type="checkbox" class="checkbox" name="showavatars" id="showavatars" value="1" {$showavatarscheck} /></td>
to this:
<input type="hidden" name="showavatars" id="showavatars" value="1" />
Do it for all inputs you want to remove - change type to hidden, remove class, remove the checked variable for checkboxes. Also convert selects to hidden inputs with a default value. Then after fixing all inputs/selects (remember about {$stylelist}) remove the rest (tables, labels, spans etc.).

There is 1 thing left though - the sideboxes setting is inserted into cache not to editable template, so it's like invisible in it, and removing the friendly redirect options will break it because it's needed for insertion (that's why I love that method so much...). To fix it, either add this:
<input type="hidden" name="showsidebox" id="showsidebox" value="1" />

to template (downside - won't disappear automatically after deactivation/uninstall...) or modify the plugin file to insert hidden input as well ($usercp_option in inc.plugins/adv_sidebox.php and $find to change insertion place).

EDIT: Forgot last thing - to make everyone use the same settings, even those who changed it before, template changes are the first step. The next step is to use queries to change the seetings for everyone. See this topic for guidance: http://community.mybb.com/thread-44380.html
Edit: delayed response

first requirement needs modifying a lengthy code from usercp_options template - can you attach its code in a file
and for the second one, see this reply