
06-05-2002, 04:37 PM
|
|
|
Join Date: Oct 2001
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally posted by Logician
[B]
Yep good catch. I have to work on that for sometime but here is quick fix for you if you need to use " in the title:
In newsconfig.php, find:
preg_match("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);
and replace it as:
preg_match("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", $news[$i][pagetext], $matches1);
and find:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^\"]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);
and replace it as:
$news[$i][pagetext]= preg_replace("/(\[)(news)(])(\r\n)*([^`]*)(\[\/news\])/siU", "" ,$news[$i][pagetext]);
it should do the trick..
This is not a bug. As I said in my original post the script parses ALL your smilies and message icons and SOME of your important vb code. This behaviour is intentional. I could add a feature to parse all your vb code, but I didnt want to add an extra SQL query as this script is intended to be a main page script which means it will run so many times and every query we save in such a script will significiantly increases your SQL performance. Therefore I just added the feature to parse only important vb codes like [i] [u] [email] [url] and [image]. If you want to add others, you can do it with little PHP knowledge and some practise:
Check the code:
$news[$i][pagetext]= preg_replace("/(\[)(b)(])(.*)(\[\/b\])/siU", "<b>\\4</b>",$news[$i][pagetext]);
You can use this sample to add extra vbcode. For example add this line after them:
$news[$i][pagetext]= preg_replace("/(\[)(center)(])(.*)(\[\/center\])/siU", "<div align='center'>\\4</div>",$news[$i][pagetext]);
Not tested but this should parse [center] tag correctly.
Regards,
Logician
|
THANKS!
What code would I add in order to parse list tags? I regularily use bulleted lists on my page, and would like to continue to do so. Is that possible?
|