Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2004, 02:21 AM
Oreamnos's Avatar
Oreamnos Oreamnos is offline
 
Join Date: Dec 2004
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 12-31-2004, 03:08 AM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

use include('./includes/functions_bbcodeparse.php'); in your php script
Reply With Quote
  #3  
Old 12-31-2004, 03:10 AM
Oreamnos's Avatar
Oreamnos Oreamnos is offline
 
Join Date: Dec 2004
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #4  
Old 12-31-2004, 08:36 AM
Oreamnos's Avatar
Oreamnos Oreamnos is offline
 
Join Date: Dec 2004
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How can I go about recreating a textarea that functions like this one outside of the forum?
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...
Reply With Quote
  #5  
Old 12-31-2004, 02:51 PM
AN-net's Avatar
AN-net AN-net is offline
 
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 01-03-2005, 05:24 AM
Oreamnos's Avatar
Oreamnos Oreamnos is offline
 
Join Date: Dec 2004
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #7  
Old 01-03-2005, 12:54 PM
Michael Morris's Avatar
Michael Morris Michael Morris is offline
 
Join Date: Nov 2003
Location: Knoxville TN
Posts: 774
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 01-04-2005, 08:00 AM
Oreamnos's Avatar
Oreamnos Oreamnos is offline
 
Join Date: Dec 2004
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

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
Reply With Quote
  #9  
Old 01-04-2005, 08:45 AM
Oreamnos's Avatar
Oreamnos Oreamnos is offline
 
Join Date: Dec 2004
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:21 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.06584 seconds
  • Memory Usage 2,247KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete