vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO] Add WYSIWYG Editor to Your Modifications (https://vborg.vbsupport.ru/showthread.php?t=228693)

Mythotical 01-19-2012 03:54 AM

Quote:

Originally Posted by Cadellin (Post 2289513)
If you get it working I don't suppose you could write up an improved article? It would be great to be able to update my mods to use WYSIWYG once again.

Sure will, guaranteed. I'm about to test it now that I'm out of classes until Friday.

--------------- Added [DATE]1326984759[/DATE] at [TIME]1326984759[/TIME] ---------------

So far I have ran into a couple of issues. I will have things ironed out later today and then I'll update my article.

Cadellin 01-19-2012 05:13 PM

I can't tell you how happy that makes me :)

Cheeky I know but could you cover how to load contents into the editor at startup? I.e. Using it to edit something rather than create afresh.

It's something I never managed to find an explanation of how to do in vB-Editor and my own attempts ended in failure. - Thanks!

Hippy 01-19-2012 08:19 PM

thanks steve_m

Mythotical 01-19-2012 09:18 PM

Quote:

Originally Posted by Cadellin (Post 2289905)
I can't tell you how happy that makes me :)

Cheeky I know but could you cover how to load contents into the editor at startup? I.e. Using it to edit something rather than create afresh.

It's something I never managed to find an explanation of how to do in vB-Editor and my own attempts ended in failure. - Thanks!

I will try to include that.

Quote:

Originally Posted by Hippy (Post 2289969)
thanks steve_m

No problem

--------------- Added [DATE]1327024413[/DATE] at [TIME]1327024413[/TIME] ---------------

I have updated the article. I am now testing on the latest release of vBulletin.

Cadellin 01-21-2012 06:25 PM

Thanks Steve :)

[S]Could you clarify by what you mean by "Make sure you have this code in the area where your template containing the editor is to be called" as my editor isn't loading - the smilies etc.. are but there is just a blank space where the editor should be.

Thanks[/S]

EDIT: Fixed

Code:

// get special data templates from the datastore
$specialtemplates = array('smiliecache','bbcodecache'); 
// pre-cache templates used by all actions
$globaltemplates = array('yourtemplatename');
define('GET_EDIT_TEMPLATES', true); 
// pre-cache templates used by specific actions
$actiontemplates = array();

must be below

Code:

require_once('./includes/functions_user.php');
require_once('./includes/functions_editor.php');
require_once('./includes/functions_bigthree.php');

The example template I originally used to base all my files off has them the other way around so I suspect I won't be the only one.

EDIT2:

Steve could you also advise about parsing the output of the new WYSIWYG? The old one had a special function I seem to remember but I can't find it.

Mythotical 01-21-2012 07:53 PM

Quote:

Originally Posted by Cadellin (Post 2290652)
Thanks Steve :)

[s]Could you clarify by what you mean by "Make sure you have this code in the area where your template containing the editor is to be called" as my editor isn't loading - the smilies etc.. are but there is just a blank space where the editor should be.

Thanks[/s]

EDIT: Fixed

Code:

// get special data templates from the datastore
$specialtemplates = array('smiliecache','bbcodecache'); 
// pre-cache templates used by all actions
$globaltemplates = array('yourtemplatename');
define('GET_EDIT_TEMPLATES', true); 
// pre-cache templates used by specific actions
$actiontemplates = array();

must be below

Code:

require_once('./includes/functions_user.php');
require_once('./includes/functions_editor.php');
require_once('./includes/functions_bigthree.php');

The example template I originally used to base all my files off has them the other way around so I suspect I won't be the only one.

EDIT2:

Steve could you also advise about parsing the output of the new WYSIWYG? The old one had a special function I seem to remember but I can't find it.

Make sure you installed the provided plugin. Then you $messagearea where you want it to appear.

If nothing else zip up your files and templates in a file and I'll have a look at it.

Cadellin 01-21-2012 08:01 PM

Thanks Steve - switching around the special templates and includes fixed the issue. My issue now is cleaning up the output from the editor for MYSQL and then parsing it again for display.

Mythotical 01-21-2012 08:37 PM

Quote:

Originally Posted by Cadellin (Post 2290687)
Thanks Steve - switching around the special templates and includes fixed the issue. My issue now is cleaning up the output from the editor for MYSQL and then parsing it again for display.

Like I said, I'm willing to look over your code for you if you wish. Just let me know.

Cadellin 01-21-2012 11:28 PM

Thanks for the offer Steve but I've now got everything working satisfactorily including editing which is a bonus.

Mythotical 01-21-2012 11:33 PM

Quote:

Originally Posted by Cadellin (Post 2290759)
Thanks for the offer Steve but I've now got everything working satisfactorily including editing which is a bonus.

Great to hear. Good luck.


All times are GMT. The time now is 12:33 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.04423 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete