[noparse]
#1
does anybody know how i might go about making a [noparse] mod

or if there is already one, where could i find it?
Reply
#2
never mind, i made itWink
Reply
#3
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
Reply
#4
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

[Image: choli_av.php]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)