Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-20-2009, 07:32 PM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default WYSIWYG editor

Has anyone figured out how to add the editor to 4.0 custom scripts? I am trying to figure out but why try to reinvent the wheel if someone already figured it out.

Thanks
Steve
Reply With Quote
  #2  
Old 11-23-2009, 10:04 AM
micheal332001 micheal332001 is offline
 
Join Date: Apr 2004
Posts: 1,112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i would like to know this as well.

I have it working on my scripts but its layout is all wrong.
Attached Images
File Type: gif editor.gif (6.8 KB, 0 views)
Reply With Quote
  #3  
Old 11-23-2009, 01:25 PM
xman_79's Avatar
xman_79 xman_79 is offline
 
Join Date: Jun 2006
Location: Romania
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the template :

Code:
<script type="text/javascript" src="clientscript/vbulletin-editor.js?v={vb:raw vboptions.simpleversion}"></script>

<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}vbulletin-formcontrols.css" />
<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}editor.css" />
<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}bbcode.css" />

<form class="vbform block" action="file.php" method="post" name="vbform" onsubmit="return vB_Editor['{vb:raw editorid}'].prepare_submit(this.inputname.value, {vb:raw vboptions.postminchars})">

<div class="wysiwyg_block">
<div class="blockbody formcontrols">
<div class="blockrow">
	{vb:raw messagearea}
</div>
</div>
</div>

<div class="blockfoot actionbuttons">
<div class="group">
	<input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
	<input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
	<input type="hidden" name="do" value="mydo" />
	<input type="submit" class="button" name="sbutton" id="{vb:raw editorid}_save" value="{vb:rawphrase myphrase}" accesskey="s" tabindex="2" />
</div>
</div>

</form>
the php file

PHP Code:

require_once(DIR '/includes/functions_editor.php');
$editorid construct_edit_toolbar('',1,'signature',1,1,($vbulletin->userinfo['userid']));

In your $templater->register add

$templater
->register('editorid'$editorid);
$templater->register('messagearea'$messagearea); 
Reply With Quote
  #4  
Old 11-23-2009, 01:43 PM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well thank you xman_79. That will help quite a bit.

You can submit the article or I can submit an article, your call xman_79.
Reply With Quote
  #5  
Old 11-23-2009, 02:02 PM
xman_79's Avatar
xman_79 xman_79 is offline
 
Join Date: Jun 2006
Location: Romania
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Welcome ..

My problem is : I don't speack english ...
Reply With Quote
  #6  
Old 11-23-2009, 02:11 PM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xman_79 View Post
Welcome ..

My problem is : I don't speack english ...
No worries, I will put the article up then. I'm gonna test the code to make sure it works and test various ways but over all I'm confident it works.
Reply With Quote
  #7  
Old 11-23-2009, 06:04 PM
micheal332001 micheal332001 is offline
 
Join Date: Apr 2004
Posts: 1,112
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by xman_79 View Post
the template :

Code:
<script type="text/javascript" src="clientscript/vbulletin-editor.js?v={vb:raw vboptions.simpleversion}"></script>

<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}vbulletin-formcontrols.css" />
<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}editor.css" />
<link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}bbcode.css" />

<form class="vbform block" action="file.php" method="post" name="vbform" onsubmit="return vB_Editor['{vb:raw editorid}'].prepare_submit(this.inputname.value, {vb:raw vboptions.postminchars})">

<div class="wysiwyg_block">
<div class="blockbody formcontrols">
<div class="blockrow">
    {vb:raw messagearea}
</div>
</div>
</div>

<div class="blockfoot actionbuttons">
<div class="group">
    <input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
    <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
    <input type="hidden" name="do" value="mydo" />
    <input type="submit" class="button" name="sbutton" id="{vb:raw editorid}_save" value="{vb:rawphrase myphrase}" accesskey="s" tabindex="2" />
</div>
</div>

</form>
the php file

PHP Code:

require_once(DIR '/includes/functions_editor.php');
$editorid construct_edit_toolbar('',1,'signature',1,1,($vbulletin->userinfo['userid']));

In your $templater->register add

$templater
->register('editorid'$editorid);
$templater->register('messagearea'$messagearea); 
Thankyou very much that worked great.
Reply With Quote
  #8  
Old 11-23-2009, 07:55 PM
xman_79's Avatar
xman_79 xman_79 is offline
 
Join Date: Jun 2006
Location: Romania
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Steve M View Post
Well thank you xman_79. That will help quite a bit.

You can submit the article or I can submit an article, your call xman_79.
Quote:
Originally Posted by Steve M View Post
No worries, I will put the article up then. I'm gonna test the code to make sure it works and test various ways but over all I'm confident it works.
If you want to publish this article you can also publish my article "How can I use the quick editor" published in the French-language in vbulletin-ressources.com .

My name is Suleiman .

http://www.vbulletin-ressources.com/...ad.php?t=17708
Reply With Quote
  #9  
Old 11-24-2009, 02:29 AM
Mythotical Mythotical is offline
 
Join Date: Jun 2004
Location: Booneville, AR, USA
Posts: 1,428
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Done and done, thanks, I went off of your article on that site to finish up mine.
Reply With Quote
  #10  
Old 11-24-2009, 09:00 PM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

abDoes anyone know how to activate the new attachment option in the code above?

I see this in newthread

PHP Code:
        require_once(DIR '/packages/vbattach/attach.php');
        
$values "values[f]=$foruminfo[forumid]";
        
$attach = new vB_Attach_Display_Content($vbulletin'vBForum_Post');
        
$attachmentoption $attach->fetch_edit_attachments($posthash

$poststarttime$postattach0$values$editorid$attachcount);
        
$contenttypeid $attach->fetch_contenttypeid();
    require_once(
DIR '/includes/functions_file.php');
    
$attachinfo = array(
        
'auth_type'     => (empty($_SERVER['AUTH_USER']) AND empty($_SERVER

['REMOTE_USER'])) ? 1,
        
'posthash'      => $posthash,
        
'poststarttime' => $poststarttime,
        
'userid'        => $vbulletin->userinfo['userid'],
        
'contenttypeid' => $contenttypeid,
        
'max_file_size' => fetch_max_upload_size(),
        
'values'        => array(
            
'f' => $foruminfo['forumid']
        ) 
and then

PHP Code:
require_once(DIR '/includes/functions_editor.php');
$editorid construct_edit_toolbar('',1,'nonforum',1,1,($vbulletin->userinfo['userid']),'fe','',$attachinfo); 
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 03: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.05075 seconds
  • Memory Usage 2,304KB
  • Queries Executed 14 (?)
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
  • (2)bbcode_code
  • (4)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete