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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2006, 04:23 AM
timcult timcult is offline
 
Join Date: Jan 2006
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default WYSIWYG editor on admincp page?

I am a newbie to VBulletin. I'm wondering if it is possible to use the WYSIWYG editor on an admincp page (for a custom field), and if it's possible how it is achieved. I understand functions_editor.php is needed, but I'm not sure how to display the editor and assign it a variable.

Thanks for your help!

TIM
Reply With Quote
  #2  
Old 04-12-2006, 10:39 PM
drewbee drewbee is offline
 
Join Date: Mar 2006
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am looking for this same thing as well, sorta of. I am looking for a way to use the WYSIWYG editor on a VBADVANCED page. If anyone knows how, please feel free to splurge the information!
Reply With Quote
  #3  
Old 06-19-2006, 10:02 PM
gulldarek gulldarek is offline
 
Join Date: Dec 2001
Location: London, UK
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Pretty easy. Not sure about 3.5 or 3.0 but in vB 3.6:

PHP Code:
// #################### PRE-CACHE TEMPLATES AND DATA ######################

$phrasegroups = array('posting');
$specialtemplates = array('bbcodecache');
$globaltemplates = array(
      
// message stuff 3.5
      
'editor_toolbar_on',
      
'editor_smilie',
      
// message area for wysiwyg / non wysiwyg
      
'editor_clientscript',
      
'editor_toolbar_off',
      
// javascript menu builders
      
'editor_jsoptions_font',
      
'editor_jsoptions_size',
      
// smiliebox templates
      
'editor_smiliebox',
      
'editor_smiliebox_category',
      
'editor_smiliebox_row',
      
'editor_smiliebox_straggler'
);

// ########################## REQUIRE BACK-END ############################
require_once('./global.php');

require_once(
DIR '/includes/functions_editor.php');

$style $db->query_first_slave("
  SELECT *
  FROM " 
TABLE_PREFIX "style
  WHERE (styleid = " 
$vbulletin->userinfo['styleid'] . ")
    OR styleid = " 
$vbulletin->options['styleid'] . "
  ORDER BY styleid " 
iif($vbulletin->userinfo['styleid'] > $vbulletin->options['styleid'], 'DESC''ASC') . "
  LIMIT 1
"
);
define('STYLEID'$style['styleid']);

// now get all the templates we have specified
cache_templates($globaltemplates$style['templatelist']);
unset(
$globaltemplates);

// #############################################################################
// get style variables
$stylevar fetch_stylevars($style$vbulletin->userinfo);

$editorid construct_edit_toolbar(
  
'',
  
0,
  
'',
  
false,
  
false,
  
false
); 
Now, you must print $messagearea variable somehow. I think, that the best way is to:

PHP Code:
print_label_row($vbphrase['wysiwyg_editor'], $messagearea); 
You also have to wrap that in <form> </form> with:

PHP Code:
<?php echo (!is_browser('webtv') ? " onsubmit=\"return vB_Editor[$editorid].prepare_submit(0, 0)\"" ''); ?>
added as a parameter to the <form opening tab (just put that code before closing > of the opening tag).

You'll have some problems with getting right path to .js, .css and .gif files. You can edit these in editor_clientscript and editor_toolbar_on templates but be aware that these files will disappear outside of /admincp/ folder. You've to ways to get that done without a harm:

1) include conditionals like <if condidition="$show[acp_wysiwyg]">../</if>

2) make new set of these templates and new includes/functions_editor.php with replaced template names.

I hope I've helped you somehow. That code isn't the prettiest one but it works. If you wan't more details, help or better code then ask here or via pm.
Reply With Quote
  #4  
Old 11-16-2006, 02:00 PM
Antivirus's Avatar
Antivirus Antivirus is offline
 
Join Date: Sep 2004
Location: Black Lagoon
Posts: 1,090
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks for sharing gulldarek, it's pretty useful information.
Reply With Quote
  #5  
Old 11-21-2006, 10:05 PM
timetunnel timetunnel is offline
 
Join Date: Sep 2005
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello.

Looks like good stuff, gulldarek. I'm sure I can use this in the future.

Q: What would have to be changed to use the WYSIWYG editor on form fields NOT in a forum but elsewhere on vB?

Thanks in advance.
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 10:20 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03454 seconds
  • Memory Usage 2,216KB
  • 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
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete