View previous topic :: View next topic |
Author |
Message |
winwintoo
Joined: 13 Sep 2004 Posts: 3
|
Posted: Mon Sep 13, 2004 11:20 pm Post subject: How do I include code snippets within posts? |
|
|
I'd like to be able to include code snippets in my blog posts like you can in posts to this bb for example like this:
Code: |
function add_magic_quotes($array) {
foreach ($array as $k => $v) {
if (is_array($v)) {
$array[$k] = add_magic_quotes($v);
} else {
$array[$k] = addslashes($v);
}
}
return $array;
}
|
The editor in b2 doesn't have a "code" button and the blockquote button doesn't do it. I tried manually entering <code></code> but that didn't work either - the snippet gets treated like code and won't print on the page.
Any suggestions??
Thanks, Margaret |
|
Back to top |
|
 |
Sigg3
Joined: 03 Jul 2003 Posts: 643 Location: Oslo, Norway
|
Posted: Tue Sep 14, 2004 8:56 am Post subject: |
|
|
You can use the HTML tag <pre> which shows pre-formatted text like code or ascii art (http://www.sigg3.net/myself/daman.html)
i.e.
Code: | <pre>
<html>
<body>
</pre> |
will show up like in BBCodes's <code> _________________ Sigg3 dot net - because you're worth it! | b2 Cafelog Resource Center |
|
Back to top |
|
 |
|