Parse BBCode (in 3.5)
If you want to parse BBCodes somewhere in your hacks/scripts (assuming that global.php is already required):
PHP Code:
All parameters except $text can be omitted and will use the defaults then. |
Can this only be used to go from BBCode --> HTML? Or can it also go from HTML --> BBCode?
|
Yes, Class vB_CodeParser can only be userd for BBCode -> HTML.
For limited HTML -> BBCode use convert_wysiwyg_html_to_bbcode() in functions_wysiwyg.php |
Kirby,
Thanks. I've noticed that convert_ can handle < and > properly, but leaves " as " - not " . Any ideas? |
How can I do this in vB 3.0.7?
|
Could this be used to fix the /me problem in quotes for 3.5 RC 1?
|
Search is my friend.
Thanks for posting this, was looking for a hint and this saved me lots of time. |
help for a noob please :) if i have the following...
PHP Code:
parsed text = My Review! but i just get HTML Code:
[url=http://www.mysite.com/reviews.php?id=4661][b]My Review![/b][/url] |
How do you do this if it's like forum.yoursite.com? And that directory has a password?
|
Quote:
thanks kirby! |
And how do you define them? ;)
|
Quote:
PHP Code:
|
Kirby, how would one go about adding this to the FAQ manager?
|
In my case I had to use the following code:
Code:
GLOBAL $parser; |
Well, I've fiddled with all the suggestions here for the last 2 hours and I still can't get anything to work! Here's the errors I get:
Fatal error: Call to a member function on a non-object in /home/httpd/vhosts/biorust.com/subdomains/forums/httpdocs/includes/class_bbcode.php on line 181 Fatal error: Call to a member function on a non-object in /home/httpd/vhosts/biorust.com/subdomains/forums/httpdocs/includes/functions.php on line 4308 |
Wrong Thread.
Please post a new Thread in vB 3.5 Modification Questions and attach the Code you are using. These errors mean that the vBulletin Registry Object ($vbulletin) does not have a valid reference for the database object. |
Quote:
|
Quote:
It will not parse simply by including the variables. |
I'm trying to get an index page (www.ultimatemetal.com) to work with the same code I used to have. It worked fine in 3.0.7 . The only issue is the bbcode stuff (which is why I am in this thread :) ). I exchanged the code I had:
require_once('includes/functions_bbcodeparse.php'); with the code at the beginning of this post: require_once('includes/class_bbcode.php'); $parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list()); $parsed_text = $parser->do_parse($text, $do_html, $do_smilies, $do_bbcode, $do_imgcode, $do_nl2br, $cachable);; I get this same error message with both: Quote:
Am I brainfarting on something here? Quote:
|
Well, the parse_bbcode() call needs to be $parser->do_parse() instead :)
|
Excellent! works....still in the middle of learning all this code so, I thank you for the help! :)
|
can this be used to allow bb code in custom titles?
nvm i got it |
nm I got it! Thanks so much!
|
What do i need to do to make it turn non-bbcoded url's into links (like what vb does when you just type a url into the post without using bbcode)?
|
I've been trying to get this to work in the member.php file so that bbcode will be parsed for user profiles --
PHP Code:
|
Help???
|
Quote:
are you sure the profile fields have things to be parsed? are the things you are trying to parse being excluded by a 'false' default setting of the function? |
Quote:
Yah, it just comes out as the text with bbcode showing. Not that I know of... the code above is what I'm using and all I want is for BBcode to work for a custom profile field. |
Try this:
PHP Code:
|
Quote:
I know that's 3.0, so maybe it's changed? Does anyone know the correct syntax for me? I just need BBcode to be parsed in custom profile field 27. |
Someone, anyone, PLEASE help ....
|
Quote:
|
just a quick one... got this working great for including posts on my front page, but it is trying to find the smilies in /images/smilies, when infact they're in /community/images/smilies....
is there a quick fix around this built into the vbcodeparser class? or should I just use str_replace on the outputted string? cheers! |
Anyone know any way to parse $thread[preview] - I can't figure out where or how to do it for the life of me. It's in functions_forumdisplay.php ..
Found it. Much easier then I thought. |
Quote:
Code:
$parsed_text = str_replace("images/smilies","community/images/smilies",$parsed_text); |
I have a custom bbcode [mp3] [/mp3] which shows an inline media player. I have struggled with this for hours but cannot come up with a solution to make it so only registered members can see it. All I really need is to prevent guest from viewing it.
|
This is so frustrating. I am trying to create a plugin that will parse html in certain userinfo fields.
So far I have this as a plugin in member_complete: PHP Code:
|
Quote:
|
Hi,
The following code will display posts on a non forum page in the home directory. However, when I try to parse the bbcode it doesn't work. Any ideas? PHP Code:
|
Why won't this work I'm trying to make it parse my page stuff it's loading it form the db and it just won't parse my php code is:
PHP Code:
|
All times are GMT. The time now is 10:56 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|