123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|484|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Web Development -> PHP Blog stuff

Wed, 18 Aug 2010, 09:43
waroffice
Afternoon,

Im updating a blog script me and a friend wrote, i kinda fell out with him so im stuck with the basic model.

I have updated a lot of it but just wanted a place to ask a few questions without cloging up the shoutbox.

My first question is.

In the blog contents i have it so certain html tags are allowed. how would i make it so i could, for example, use (code) tags to show code or other tags?

thanks
Wed, 18 Aug 2010, 09:47
waroffice
I had the idea of replacing all (code) entries with like "<div id='code'>etc etc etc" then replacing (/code) with the close tags, "</div>"

Will that work?
Wed, 18 Aug 2010, 09:51
waroffice
so i can get the effect on this page without using images.

Solsticerpg.com
Wed, 18 Aug 2010, 10:10
JL235
There are existing technologies to do this. First code should be wrapped in CDATA blocks and second you can use the CSS 'white-space' property to maintain whitespace within your code divs.

There are also pieces of special text you can use for embedding < and > characters in text. Instead of < you can write '& lt' (but without the whitespace). You can see more here.
Thu, 19 Aug 2010, 01:46
waroffice
I was kinda looking to write it myself, don't learn anything if you just copy and paste someone elses code.

I will google it and see what i can find.

Cheers for the CSS whitespace tip.
Thu, 19 Aug 2010, 04:43
waroffice
I seem to have sorted it so far, i just need a hand with the CSS, it looks like there is too much space between the lines but cant remember how to fix it.

solsticerpg.com/index.php?id=16
Thu, 19 Aug 2010, 05:12
waroffice
this is my code



had to put { } round the closing code tag
Fri, 20 Aug 2010, 00:27
Jayenkai
Just a quick note, although <pre> lets you look nice and formatted, the reason I've used a text area, instead, is for copy+paste reasons.
Pain in the ass to copy from a none-separated area.

Consider making a BBCode.php file, shoving in a BBCode($txt) function, and then using that for any/all needs.
Organise now before it gets all messy later!
Because, it WILL get messy!! With [b], [i], [u], [url] and more, it gets insanely big, really really fast!

(oh, and to show a [b] on Socoder, simple double the brackets.)

-=-=-
''Load, Next List!''