Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
[HOW TO] Add WYSIWYG Editor to Your Modifications
Mythotical
Join Date: Jun 2004
Posts: 1,428

by Mythotical Mythotical is offline 23 Nov 2009

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:

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.
Attached Images
File Type: jpg editor.jpg (20.4 KB, 474 views)
File Type: png file.png (3.5 KB, 314 views)
Attached Files
File Type: xml vbulletin-plugins.xml (414 Bytes, 114 views)

Last edited by Mythotical; 20 Jan 2012 at 02:19..
Views: 25245
Reply With Quote
Comments
  #2  
Old 25 Nov 2009, 08:56
RS_Jelle's Avatar
RS_Jelle RS_Jelle is offline
 
Join Date: Jul 2005
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.

__________________
Now released: DownloadsII 6.0.9 (for vB 4.x) and 5.1.2 (for vB 3.7.x and 3.8.x)
Minatica.be - Belgian/Dutch computer and technology site
Reply With Quote
  #3  
Old 25 Nov 2009, 10:14
zbahadir's Avatar
zbahadir zbahadir is offline
 
Join Date: Jun 2006
Location: TRABZON/TR
Real name: Zafer BAHADIR
Thanks.
__________________
Bilgivadisi
Reply With Quote
  #4  
Old 25 Nov 2009, 17:27
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Originally Posted by RS_Jelle View Post
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.

Last edited by Mythotical; 25 Nov 2009 at 17:53.
Reply With Quote
  #5  
Old 25 Nov 2009, 21:35
RS_Jelle's Avatar
RS_Jelle RS_Jelle is offline
 
Join Date: Jul 2005
Originally Posted by Steve M View Post
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).
__________________
Now released: DownloadsII 6.0.9 (for vB 4.x) and 5.1.2 (for vB 3.7.x and 3.8.x)
Minatica.be - Belgian/Dutch computer and technology site
Reply With Quote
  #6  
Old 25 Nov 2009, 22:28
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Originally Posted by RS_Jelle View Post
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.
Reply With Quote
  #7  
Old 13 Dec 2009, 16:06
MaryTheG(r)eek MaryTheG(r)eek is offline
 
Join Date: Oct 2006
Real name: Maria
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
Reply With Quote
  #8  
Old 13 Dec 2009, 18:02
Mythotical Mythotical is offline
 
Join Date: Jun 2004
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?
Reply With Quote
  #9  
Old 13 Dec 2009, 18:18
MaryTheG(r)eek MaryTheG(r)eek is offline
 
Join Date: Oct 2006
Real name: Maria
Originally Posted by Steve M View Post
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
Reply With Quote
  #10  
Old 13 Dec 2009, 18:21
Mythotical Mythotical is offline
 
Join Date: Jun 2004
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.
Reply With Quote
  #11  
Old 13 Dec 2009, 18:31
MaryTheG(r)eek MaryTheG(r)eek is offline
 
Join Date: Oct 2006
Real name: Maria
Originally Posted by Steve M View Post
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
Reply With Quote
  #12  
Old 13 Dec 2009, 18:39
Mythotical Mythotical is offline
 
Join Date: Jun 2004
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
Reply With Quote
  #13  
Old 13 Dec 2009, 18:42
MaryTheG(r)eek MaryTheG(r)eek is offline
 
Join Date: Oct 2006
Real name: Maria
Originally Posted by Steve M View Post
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
Reply With Quote
  #14  
Old 13 Dec 2009, 18:43
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Possibly, if you need help narrowing down where it may come from, I'll gladly help you out.
Reply With Quote
  #15  
Old 14 Dec 2009, 16:45
AndrewD AndrewD is offline
 
Join Date: Jul 2002
Real name: Andrew
Bug? Request for check

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.
Attached Files
File Type: php aaaatest.php (1.2 KB, 62 views)
File Type: txt aaaatest.txt (2.9 KB, 62 views)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 20:15.

Layout Options | Width: Wide Color: