vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=228693

[HOW TO] Add WYSIWYG Editor to Your Modifications
by Mythotical
23 Nov 2009 19:44

3 Attachment(s)
I do this as a free service, I am a student however and all donations are welcome. You can click on the Paypal icon to make a donation: https://www.paypalobjects.com/en_US/..._donate_LG.gif

I will add instructions for pulling data when editing a file.


This article was done for vB 3.5 and later, I now bring you the article for vB 4.0 in regards to the editor in modifications.

Working Versions: Currently 4.1.10
Testing Versions: NONE

This tutorial will provide you the proper method for including the WYSIWYG editor in your modifications. I have tested this and it works so following this tutorial will provide a working editor. You are welcome to tweak it to your liking so that you get different output's or vice versa.

Lets begin.

Step 1. Make sure you have already added the row to your database table. The new row to add is:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

You can alter that to be messagearea, message, description, etc and it will work just the same.

Step 2. Open your template containing your form.
Step 3. Install the provided plugin xml file.
Step 3. Add the following lines of code.

Now add this in place of your opening form tag (Remember to change your action to your correct file):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Step 4. Add the following to your php file.

Open the file you wish to add your editor to (Make sure you have this code in the area where your template containing the editor is to be called):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Then edit your template register and add the following:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add this line to your php file after you define special templates, global templates, etc:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add these to your specialtemplates:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Step 5. Save and close your file, upload and test. Make sure you saved your template as well.

This is a short article/tutorial and I hope many find it useful. Even though I did not come up with the code or discover the code, I am happy to help others out as I was helped out.

Preview provided at attachments.

RS_Jelle 25 Nov 2009 08:56

Instead of adding all these templates to globaltemplates, you could add this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Even better, use action templates:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


zbahadir 25 Nov 2009 10:14

Thanks. :)

Mythotical 25 Nov 2009 17:27

Quote:

Originally Posted by RS_Jelle (Post 1920594)
Instead of adding all these templates to globaltemplates, you could add this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Even better, use action templates:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Thanks, I'll update the article to reflect your suggestion.

I should ask what that does since I have never seen that code before. I'm sure others will question as well.

RS_Jelle 25 Nov 2009 21:35

Quote:

Originally Posted by Steve M (Post 1920764)
Thanks, I'll update the article to reflect your suggestion.

I should ask what that does since I have never seen that code before. I'm sure others will question as well.

It just caches the editor templates, in an easier way :)

From /includes/class_bootstrap.php:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

+ If you don't do it this way, this mod won't work (if it gets ported to vB4).

Mythotical 25 Nov 2009 22:28

Quote:

Originally Posted by RS_Jelle (Post 1920856)
It just caches the editor templates, in an easier way :)

From /includes/class_bootstrap.php:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

+ If you don't do it this way, this mod won't work (if it gets ported to vB4).

Ah great info, thank you for clarifying, I have included it in the article as well. I plan to go change my ported mods to include that as well.

MaryTheG(r)eek 13 Dec 2009 16:06

I've followed the instruction, editors works as it must works, but in all pages there is that dammit yellow triangle at browser's status bar with error:
vB_XHTML_Ready has not been definied
URI: http://www.microhellas.com/main/clie...tor.js?v=400b5


Maria

Mythotical 13 Dec 2009 18:02

Maria, can you show me the page that you get the yellow triangle? I don't get the triangle so I'm a bit concerned right now, oh yeah, what browser you viewing the page in?

MaryTheG(r)eek 13 Dec 2009 18:18

Quote:

Originally Posted by Steve M (Post 1929987)
Maria, can you show me the page that you get the yellow triangle? I don't get the triangle so I'm a bit concerned right now, oh yeah, what browser you viewing the page in?

Sure. http://www.microhellas.com/main/support.php

Thank you so much. By the way. IE8

Maria

Mythotical 13 Dec 2009 18:21

Hmmmm, I opened it in IE8 but I get no error report. Let me check a few things and I'll post back.

Your welcome.

MaryTheG(r)eek 13 Dec 2009 18:31

Quote:

Originally Posted by Steve M (Post 1929995)
Hmmmm, I opened it in IE8 but I get no error report. Let me check a few things and I'll post back.

Your welcome.

Thank you for taking the time to help me. If you want, I've post the full product at:
http://www.vbulletin.org/forum/showthread.php?t=230112
but I think that I follown your instructions step by step.

Maria

Mythotical 13 Dec 2009 18:39

Apparently that error triangle is from subscriptions portion. Might be a bug with vB. I have tried to replicate it and even tried adding new tickets and such, still no error on my end. Sorry I couldn't provide more info than that. I'm actually sitting here scratching my head over it. LOL

MaryTheG(r)eek 13 Dec 2009 18:42

Quote:

Originally Posted by Steve M (Post 1930011)
Apparently that error triangle is from subscriptions portion. Might be a bug with vB. I have tried to replicate it and even tried adding new tickets and such, still no error on my end. Sorry I couldn't provide more info than that. I'm actually sitting here scratching my head over it. LOL

Ok:-)) Let to see if anybody report it in my post. My site is not the stablest on the net, actually it has nothing, so maybe something else causes it.

take care
Maria

Mythotical 13 Dec 2009 18:43

Possibly, if you need help narrowing down where it may come from, I'll gladly help you out.

Bug? Request for check
by AndrewD
14 Dec 2009 16:45

2 Attachment(s)
I've spent today tearing my hair out in updating the wysiwig editor from vb3.8 to v4.0 in a product I handle. Eventually, I tried reproducing the problem using the code suggested here, and the same problem arose. Basically, when in full WYSIWIG mode, the text entered into the message box is not being returned to the server, unless one first refreshes the page. In standard mode (obtained either by using the control switch in the editor, or by setting the appropriate vb options), everything works fine. This means that the problem cropped up with IE and Firefox but not with Google Chrome or Safari, which always use the standard editor.

For some reason, though, this problem does not seem to crop up in, e.g., the standard VB editpost code.

Possibilities are that I've made a mistake (quite possible...), or there's a bug in vb4.0 (I'm testing with RC2), or there's a switch/file that we're overlooking.

The attached files are, as far as I can tell, a straight copy of the material posted at the start of this article, within a script that simply keeps re-presenting the form along with a record of the message entered by the user the previous time round. I'd be very grateful if someone can independently test this, and let me know if I'm going crazy or not.

The two files are a php script to be loaded into the forum directory, and a template.


All times are GMT. The time now is 13:21.

Powered by vBulletin® Version 3.8.14
Copyright © 2020, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.