View Full Version : How can I use vBulletin's BBCode Parser/textarea outside of Forum?
Oreamnos
12-31-2004, 02:21 AM
I am interested in using BBCode on other areas of my site outside of the forums directory. I have 2 questions regarding that:
1. Is it possible to reproduce vBulletin's standard editor (ie. textarea) with the formatting features like bold, size, color, align, etc... I want to allow my members to format some other text they are submitting without using a Rich Text Area. I dont really want to use a Java Applet.
2. How can I take advantage of vB's BBCode parser when i go to echo the text? Is there away to do something like this:echo bbcode($users_description);
I am purchasing some software and the folks whom I am getting it from said they would put it in for a charge but I would rather just take advantage of vB's because it's what i am looking for and it's so powerful.
Thanks for your help!
Eric
AN-net
12-31-2004, 03:08 AM
use include('./includes/functions_bbcodeparse.php'); in your php script;)
Oreamnos
12-31-2004, 03:10 AM
use include('./includes/functions_bbcodeparse.php'); in your php script;)
Thanks! And what will that give me? The text area? Only the parser? Both?
Oreamnos
12-31-2004, 08:36 AM
How can I go about recreating a textarea that functions like this one outside of the forum?http://eslhq.com/textEditor.jpg
I have copied and pasted the code and I can make it look like this but when I click on BOLD or UNDERLINE it does not insert the BBCode into the textarea. I figured since it was javascript it would be easy to just copy and paste the JS code to get this thing working... but no luck...
AN-net
12-31-2004, 02:51 PM
with the code i gave you will be able to parse bbcode to recreate that you need to copy the new post template and replace all the php vars with actual urls and u need to include the correct javascript files.
Oreamnos
01-03-2005, 05:24 AM
with the code i gave you will be able to parse bbcode to recreate that you need to copy the new post template and replace all the php vars with actual urls and u need to include the correct javascript files.
Thanks for your info, but I am feeling a bit slooooww here. I can't find the new post template. Here is a list of the templates that I see:
# New Posting Templates [? ?]
* newattachment [Customize]
* newattachmentbit [Customize]
* newattachment_errormessage [Customize]
* newpoll [Customize]
* newpost_attachment [Customize]
* newpost_attachmentbit [Customize]
* newpost_disablesmiliesoption [Customize]
* newpost_errormessage [Customize]
* newpost_preview [Customize]
* newpost_quote [Customize]
* newpost_threadmanage [Customize]
* newpost_usernamecode [Customize]
* newreply [Customize]
* newreply_reviewbit [Customize]
* newreply_reviewbit_ignore [Customize]
* newreply_reviewbit_ignore_global [Customize]
* newthread [Customize]
Which one of these do I use or am i under the wrong category?
Thanks
Eric
Michael Morris
01-03-2005, 12:54 PM
newthread and newreply are the templates used for new posts, dending on whether they are - well - new replies or new threads.
The actual editor of the message is in the editor templates group.
Oreamnos
01-04-2005, 08:00 AM
OK, I finally got the standard editor textarea. Actually, i was making that way harder than it was. Just forgot to include one of the JS files. :o
Next problem: When I use include('./includes/functions_bbcodeparse.php'); it makes a bunch of calls to undefined functions. The first one being :Fatal error: Call to undefined function: htmlspecialchars_uni() in /home/mysite/public_html/eslhq/esl_forums/includes/functions_bbcodeparse.php on line 336
Basically my code looks like this:
include('../esl_forums/includes/functions_bbcodeparse.php');
echo parse_bbcode($_POST['message']);
Can you help me get around this? Thanks
Oreamnos
01-04-2005, 08:45 AM
OK, i found the answer. At least this works for me so i thought I'd share it for those who are having the same problem as me. chdir("../forums");
require_once('global.php');
require_once('includes/functions_bbcodeparse.php');
Use the chdir() function to set the directory so that the includes in the global and bbcodeparse scripts get included.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.