PDA

View Full Version : How can I add a vB textarea to my mod?


Dr.CustUmz
02-26-2017, 06:48 PM
So I have a textarea I have added to newthread page, and the data posted, is returned within the post with the following variable.
<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.

PinkMilk
02-26-2017, 07:53 PM
Might help Using the vBulletin Input Cleaner Class (https://vborg.vbsupport.ru/showthread.php?t=119372)

paradoxG(r)eek
02-28-2017, 10:16 AM
1.- PHP File


$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:


$messagearea


If you want to use Quick Reply editor instead the full editor then use 'qr' instead of 'fe' at:

$editorid = construct_edit_toolbar($ad["description"], 0, '', 1, 1, false, 'fe');


--------------- Added 1488284668 at 1488284668 ---------------

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


require_once(DIR . '/includes/class_bbcode.php');
$any_variable_name = convert_wysiwyg_html_to_bbcode($vbulletin->GPC['your_field_name']);

Dr.CustUmz
03-01-2017, 07:58 PM
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 $submessage = convert_wysiwyg_html_to_bbcode($vbulletin->GPC['????????']);
in hook ???????

but the bbcode php should already be where I am trying to use this.