_ck_ Can you help me with some of your regular expression code?
-
Hi I’m currently modifying your wiki post script(source once i’ve finished it) and I’m combining looking at your bbcode plugin and I’m trying to add a simple <wiki>something</wiki> tag and I’m having a trouble getting my head around how you do it.
Looking at this code:
$complex1 = array('wiki' => array('a','href'),'img' => array('img','src'));
foreach($complex1 as $bbcode=>$html){
if($bbcode=='wiki') {
var_dump($text);
/*$text = preg_replace('/(.+?)[/'.$bbcode.']/is','<'.$html[0].' '.$html[1].'="$1">',$text);*/
}
else {$text = preg_replace('/(.+?)[/'.$bbcode.']/is','<'.$html[0].' '.$html[1].'="$1">$1</'.$html[0].'>',$text);}
}
Now I was thinking removing everything after ‘wiki’ would work but nothing works. It calls var_dump at the moment but it calls it for all posts in the topic.
Any ideas? I haven’t used regular expressions before so I’m a bit lost.
- You must be logged in to reply to this topic.