Not Solved [php]str_replace function
Not Solved
I am learning how to make a plugin for MyBB.
How do i use the function str_replace to look for this:
<td><input type="text" class="textbox" name="usertitle" size="25" maxlength="{$mybb->settings['customtitlemaxlength']}" value="{$newtitle}" /></td>
I keep getting errors.I guess the code is too complex. It worked with texts like:
Any alternate solutions are welcome.
Not Solved
You probably have a syntax issue or similar. You should post the actual code you're using.
Not Solved
if(!$templates->cache['modcp_editprofile']) $templates->cache('modcp_editprofile');
				$templates->cache['modcp_editprofile'] = str_replace('{$lang->new_custom_usertitle}', "
				<p>I will not allow Title change</p>", $templates->cache['modcp_editprofile']);
The code above replaces 'New Custom User Title: (leave blank to use existing)' with my codes

How would i replace the box with my codes?
Sorry for late reply, i had problems with my localhost
Not Solved
I managed to solve it.
	$templates->cache['modcp_editprofile'] = str_replace('											<td><input type="text" class="textbox" name="usertitle" size="25" maxlength="{$mybb->settings[\'customtitlemaxlength\']}" value="{$newtitle}" /></td>', "",$templates->cache['modcp_editprofile']);

Forum Jump:

Users browsing this thread: 1 Guest(s)