2005-09-19, 04:23 AM
2005-09-19, 07:14 AM
never mind, i made it
2005-09-20, 05:32 AM
ok, i'm having problems with my code, can anybody tell me what i'm doing wrong
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
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("<","<",$message);
$message = str_replace(">",">",$message);
$message = str_replace("��", " ", $message);
}
$message = dobadwords($message);
//grabs the no parse text
preg_match_all("/\[noparse\](.+)\[\/noparse\]/mi", $message, $matches, PREG_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, $matches2, PREG_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
2005-09-28, 09:52 PM
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
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