MyBB-Plugins Forums
Removing Mycode from posts before calculating points - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: MyBB 1.8.x (http://forums.mybb-plugins.com/Forum-MyBB-1-8-x)
+--- Forum: NewPoints (http://forums.mybb-plugins.com/Forum-NewPoints--49)
+--- Thread: Removing Mycode from posts before calculating points (/Thread-Removing-Mycode-from-posts-before-calculating-points)



Removing Mycode from posts before calculating points - Helixagon - 03-13-2016

Hi there,

I'm trying to make it so that the mycode tags themselves are eliminated from posts so that they are not counted. I found in my forum that when posts are pasted into the rich text editor from the outside (such as from Word documents) it adds a lot of unnecessary mycode formatting which inflates points gain drastically.

I'm trying to edit this part to include mycode as well as quotes and quoted text, but I'm not well versed in regex. Would anyone be able to help me? Thank you very much in advance.

Code:
        // calculate points ber character bonus
        // let's see if the number of characters in the post is greater than the minimum characters
        $post_wo_quotes = preg_replace("/\[quote.*?\](.*?)\[\/quote\]((\s)*(\[\/quote])*)*/is", '', $post['message']);



No Permission

Unfortunately you do not have sufficient rights to view replies in this thread.