MyBB Community Forums

Full Version: [noparse]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
does anybody know how i might go about making a [noparse] mod

or if there is already one, where could i find it?
never mind, i made itWink
ok, i'm having problems with my code, can anybody tell me what i'm doing wrong

PHP Code:
function postify($message$allowhtml="no"$allowmycode="yes"$allowsmilies="yes"$allowimgcode="yes")
{
    global 
$db$settings$theme;

    if(
$allowhtml != "yes")
    {
        
//$message = str_replace("&","&",$message);
        
$message preg_replace("#&(?!\#[0-9]+;)#si""&"$message); // fix & but allow unicide
        
$message str_replace("<","&lt;",$message);
        
$message str_replace(">","&gt;",$message);
        
$message str_replace("��""&nbsp;&nbsp;"$message);
    }
    
$message dobadwords($message);
    
    
//grabs the no parse text
    
preg_match_all("/\[noparse\](.+)\[\/noparse\]/mi"$message$matchesPREG_SET_ORDER);
    
    
//
    
if($allowmycode != "no")
    {
        
$message domycode($message$allowimgcode);
    }

    if(
$allowsmilies != "no")
    {
        
$message dosmilies($message);
    }
    
    
//main Noparse code by nitemare
    //debuged by -dt- <[email protected]>
    
preg_match_all("/\[noparse\](.+)\[\/noparse\]/mi"$message$matches2PREG_SET_ORDER);
    
    
$message str_replace($matches2[0],$matches[0],$message);
    
$message preg_replace('/\[noparse\](.+)\[\/noparse\]/',"$1",$message);

    
    
$message nl2br($message);
    
    
    
    return 
$message;


with this mod when ever i post something between the tags, and then the exact same thing outside the tags, the one out side teh tags no longer works
oohh.. i've just noticed this thread... I've made a plugin for mybb 1.0 that add the tag noparse. go here: http://mods.mybboard.com/forum/showthread.php?tid=420

btw, nitemare: it seems that you didn't scape the brackets in the regular expression... i didn't tested, but that seems to be a possible error