Hi, I was searching for PHP Navigation and I found this post, then I found this BBCode Parser topic; It made me wonder if it was possible, through using PHP Navigation, to include files fully parsed by the BBCode Parser. I'm not a coder, so can you please show me a code if it's possible?
PHP Navigation with BBCode Parser?
Started by Ten Kabuto, Sep 22 2007 11:24 AM
1 reply to this topic
#1
Posted 22 September 2007 - 11:24 AM
#2
Posted 01 October 2007 - 04:10 PM
I think i get what you mean...
Something like this ?
Thats the basic idea using "file_get_contents"...you can customise from that .
Something like this ?
<?php
function BBCode ($string) {
$search = array(
'\[b\](.*?)\[\/b\]\',
'\[i\](.*?)\[\/i\]\',
'\[u\](.*?)\[\/u\]\',
'\[img\](.*?)\[\/img\]\',
'\[url\=(.*?)\](.*?)\[\/url\]\',
'\[code\](.*?)\[\/code\]\'
);
$replace = array(
'<b>\\1</b>',
'<i>\\1</i>',
'<u>\\1</u>',
'<img src="\\1">',
'<a href="\\1">\\2</a>',
'<code>\\1</code>'
);
return preg_replace($search, $replace, $string);
}
if ($_GET['id'])
{
$filename = $_GET['id'] . '.htm';
}
$contents = file_get_contents($filename);
echo bbcode_replace($contents);
?>
Thats the basic idea using "file_get_contents"...you can customise from that .
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
