![]() |
Parse bbcode in any php file
What would I need to put at the top of a PHP file (that calls my rules template) to make it so any bbcode in the template will be parsed, like smilie code?
|
PHP Code:
|
I did the first part but basically all the php file has in it is the
eval('print_output("' . fetch_template('rules') . '");'); which calls the template. How would I parse that? |
PHP Code:
|
Here's what I have for the php file that calles the rules template. That didn't work, KirbyDE, for some reason. ;)
PHP Code:
|
you may use this:
PHP Code:
|
That almost worked. I got a IE runtime error, some invalid character. It wouldn't load the editor for some reason.
|
hmm, maybe it parses some bbcode where you don't want them to be parsed?
but i don't think that's avoidable. normally you shouldn't parse bb code in templates at all ;) |
Can I just parse smilies? That is all I really need to be parsed in this template.
|
Erm ... why don't you just put in the appropriate <IMG>-Tags?
Would be easier IMHO. |
I never thought of that. Thank you. ;)
But for future reference, would there be any way to do something like this? They do it in the newreply for pagetext but I'm not sure how to set something like that up for something like this. |
well you can parse just the smilies with the pars_bbcode2 function, the several 1's stand for parsing options, (HTML, bbcode, smilies, imgs...) just set it the right way :)
and always allow html parsing or your templates would result in a very funny thing ^^ |
I tried that but all I got what the html code for the file. It looked really strange. I just went ahead and did a path to the image file. It was alot easier than trying to figure out what I did wrong. ;)
|
I'm trying to parse BBCode in a PHP script, but it gives errors when its not in the same directory as the forums..
I chdir("forums/"); before including global.php and it eliminates the file not found errors from the includes, but it still doesn't work.. I get: Fatal error: Call to a member function on a non-object in /www/forums/includes/functions.php on line 899 When I use the same code from within the forums directory, it works just fine.. Why? |
All times are GMT. The time now is 02:07 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|