Not Solved [php]str_replace function
#1
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:
{$lang->new_custom_usertitle}
Any alternate solutions are welcome.
Regards
Reply
#2
Not Solved
You probably have a syntax issue or similar. You should post the actual code you're using.
Reply
#3
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
Reply
#4
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']);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)