Uutiset:

Join the Facebook Fan Page.

Main Menu
Advertisement:

Coding in posts

Aloittaja Happyhansha, maaliskuu 11, 2006, 07:34:42 IP

« edellinen - seuraava »

Happyhansha

I'm trying to make some extra features for a forum theme I'm working on, and I'm beginning to realize it will require some very basic php applied directly in posts. I've read a bunch of threads here stating that that's a bad idea and a security risk, but I think I can get by if I can just allow somewhere between 4 and 8 variables to be recognizable in posts, and aliased to code applied behind the scenes. So, if anyone knows a good way to do this without allowing all php to be allowed in posts, please let me know. I believe this should be possible using something similar to the way smileys work in smf.

Also, I'm wondering how to make echo statements that allow nothing but text and bb code inside them (no php.) If anyone has suggestions on this (although I would assume that one's pretty simple) please post as well :)

Thanks in advance!

Dannii

What exactly do you want to do and allow?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Happyhansha

I'm hoping to make a check box that, when checked removes all content in pages that is marked with specific code. This would allow the posters to post whatever they want, but not be afraid to view the forums at work or at school.

So far I've added a check box that sets a cookie which keeps the box checked, and which the code could look for to see if the content should be taken out. I can write a fairly simple php if then statement that says something like: if this cookie equals yes, then echo this content, else echo the content the poster wrote originally.

I'd then make some image to be placed instead of the content informing the user that content has been removed there.

I think I can do it using something similar to bb code, but my main concerns are how to add that, and how to make sure the page doesn't get broken with whatever they put inside the echo statement.

Advertisement: