vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How can I use vBulletin's BBCode Parser/textarea outside of Forum? (https://vborg.vbsupport.ru/showthread.php?t=73547)

Oreamnos 12-31-2004 02:21 AM

How can I use vBulletin's BBCode Parser/textarea outside of Forum?
 
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:
PHP Code:

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

Quote:

Originally Posted by AN-net
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

Quote:

Originally Posted by AN-net
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:
PHP Code:

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.
PHP Code:

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.


All times are GMT. The time now is 01:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02013 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete