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

Reply
 
Thread Tools Display Modes
  #1  
Old 02-26-2017, 06:48 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How can I add a vB textarea to my mod?

So I have a textarea I have added to newthread page, and the data posted, is returned within the post with the following variable.
Code:
<div><font size="1"><pre>$post[mod_changelog]</pre></font></div>
I have wrapped it in a pre tag to prevent html, but this can easily be taken advantage of.

How can I make it like the default textareas? so the textarea
1. does not allow html
2. allows bbcode

been scratching my head for a couple days on this one.
Reply With Quote
  #2  
Old 02-26-2017, 07:53 PM
PinkMilk PinkMilk is offline
 
Join Date: May 2010
Location: Earth
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Might help Using the vBulletin Input Cleaner Class
Reply With Quote
Благодарность от:
MarkFL
  #3  
Old 02-28-2017, 10:16 AM
paradoxG(r)eek paradoxG(r)eek is offline
 
Join Date: Feb 2017
Location: Thessaloniki, Greece
Posts: 297
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

1.- PHP File

Code:
$show['wysiwyg'] = ($vbulletin->options['allow_bbcode'] ? is_wysiwyg_compatible() : 0);
$istyles_js = construct_editor_styles_js();
$show['qr_require_click'] = 0;
$editorid = construct_edit_toolbar($ad["description"], 0, '', 1, 1, false, 'fe');
$messagearea = "
		<script type=\"text/javascript\">
		<!--
			var require_click = false;
			var threaded_mode = 1;
			var is_last_page = false;
		// -->
		</script>
		$messagearea
";
Replace $ad["description"] with your own field

Template:

Code:
$messagearea
If you want to use Quick Reply editor instead the full editor then use 'qr' instead of 'fe' at:
Code:
$editorid = construct_edit_toolbar($ad["description"], 0, '', 1, 1, false, 'fe');
--------------- Added [DATE]1488284668[/DATE] at [TIME]1488284668[/TIME] ---------------

I think that I was out of topic before .... Thought that you want to add vb Editor to textarea.

Code:
require_once(DIR . '/includes/class_bbcode.php');
$any_variable_name = convert_wysiwyg_html_to_bbcode($vbulletin->GPC['your_field_name']);
Reply With Quote
  #4  
Old 03-01-2017, 07:58 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, I have tried a lot of things. too many to post, but I am not getting this.

so let me explain a little more.

the textarea i have added to newthread page (its under the message box) think of it as a sub message.

it stores its info in sql by itself and at the moment is set to no_html

now i want to return that data on the showthread page (within the original post) but with it allowing bbcode and not allowing html.

I show the variable for the "sub message" content within showthread lets say $submessage

so could I use something like
Code:
$submessage = convert_wysiwyg_html_to_bbcode($vbulletin->GPC['????????']);
in hook ???????

but the bbcode php should already be where I am trying to use this.
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 08:23 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04068 seconds
  • Memory Usage 2,195KB
  • 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
  • (6)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (1)post_thanks_box_bit
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete