MyBB Community Forums

Full Version: preg_replace doesn't work after quickedit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I've added this code to function_post.php:
	
        $tag = "payment";
        $text_1=$post['message'];
	$text_2=explode('['.$tag.'=',$text_1);

	$text_3=explode("$pay]",$text_2[1]);
	$text_4=explode('[/',$text_3[1]);
	$text=$text_4[0];


	$post =preg_replace('#\[('.$tag.')(=)((?:[a-zA-Z0-9_.\/]*))\](.*?)\[/'.$tag.'\]#s',$text, $post);	

It replaces [payment=$pay] [/pay] with $text in post message.
It works perfectly! But when I edit the post via quickedit, after edit it doesn't replace [payment=$pay] [/pay] with $text!
For example if the post code is : [payment=xxx] KKK [/payment] , it will be displayed as it code and I have to Refresh The Page to see it as $text!

How can I solve this problem?
I think you've to edit ./xmlhttp.php file. Since quickedit is using this file so you've to try adding the code in;
else if($mybb->input['action'] == "edit_post")
{
//.....
}
(12-21-2011, 05:02 PM)Yaldaram Wrote: [ -> ]I think you've to edit ./xmlhttp.php file. Since quickedit is using this file so you've to try adding the code in;
else if($mybb->input['action'] == "edit_post")
{
//.....
}

Nope, Didn't work. Sad