boardom Forum Index boardom
b2 message board
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[request] need htmlarea to attach

 
Post new topic   Reply to topic    boardom Forum Index -> Hacks
View previous topic :: View next topic  
Author Message
name_me



Joined: 31 Jan 2003
Posts: 12
Location: Ukraine

PostPosted: Tue Apr 08, 2003 8:18 am    Post subject: [request] need htmlarea to attach Reply with quote

Hello ppl! Smile

Can someone attach htmlarea instead of post textarea content in post editor? It's awesome WYSIWYG html editor written on java.

Look at it by yourself

http://www.interactivetools.com/products/htmlarea/

It's a pity, but am failed (though am not really good at html/php)..
Back to top
View user's profile Send private message
alanp



Joined: 14 Sep 2003
Posts: 35

PostPosted: Fri Nov 21, 2003 12:59 am    Post subject: Reply with quote

did you still need help with this? I've installed the same program you're talking about.
Back to top
View user's profile Send private message
name_me



Joined: 31 Jan 2003
Posts: 12
Location: Ukraine

PostPosted: Fri Nov 21, 2003 12:00 pm    Post subject: Reply with quote

alanp wrote:
did you still need help with this? I've installed the same program you're talking about.

That's will be great Smile
Back to top
View user's profile Send private message
stevem



Joined: 15 Mar 2003
Posts: 15

PostPosted: Fri Nov 21, 2003 9:20 pm    Post subject: Reply with quote

I'd also be interested in how to install htmlarea. I have used it elsewhere but haven't tried it with b2 and would appreciate help in doing so.
Back to top
View user's profile Send private message
stevem



Joined: 15 Mar 2003
Posts: 15

PostPosted: Sat Nov 22, 2003 11:20 pm    Post subject: Reply with quote

I have had a go at installing htmlarea and have had some success. But

  1. I couldn't get the latest version (which is a beta anyway) to work so I used the stable version 2
  2. using htmlarea means that the current buttons (quicktags) and smilies don't work as the textbox they expect are no longer there, so I have disabled them (in b2config.php).
I hope that others will be able to improve on what I've done.

I have used the minimum changes to current files (just one addition in each of 2 files) and put all the new code in 2 new files which can then be easily altered.
I have put the htmlarea files in the top directory /htmlarea. Change the path if necessary in htmlarea_head.php

b2header.php
Code:
AFTER
<html>
<head>

ADD
<?php include($b2inc."/htmlarea_head.php"); ?>


b2include/b2edit.form.php
Code:
AFTER
<?php } else { ?>
<textarea rows="9" cols="40" style="width:100%" name="content" tabindex="4" wrap="virtual"><?php echo $content ?></textarea><br />
<?php } ?>

ADD
<?php
$textarea="content";
include_once($b2inc."/htmlarea_echo.php");
?>


Upload 2 new files to the include directory

include/htmlarea_head.php
Change the path in line 3 to wherever you uploaded htmlarea
Code:
<!-- START : EDITOR HEADER - INCLUDE THIS IN ANY FILES USING EDITOR -->
<script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "../htmlarea/"; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver > 0) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
<!-- END : EDITOR HEADER -->


include/htmlarea_echo.php
alter config.bodyStyle to whatever you like
Code:
<?php
        echo "\n\n".'<script language="javascript1.2" defer>'."\n";
        echo 'var config = new Object();'."\n";
        echo 'config.width = "100%";'."\n";
        echo 'config.debug = 0;'."\n";
        echo 'config.bodyStyle = \'background-color: "#f0f0f0"; font-family: "Verdana"; font-size: x-small;\';'."\n";
        echo 'editor_generate'.
           '("'.$textarea.'",config);'."\n";
     echo '</script>'."\n\n";
?>


I hope this is helpful
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    boardom Forum Index -> Hacks All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2 © 2001, 2002 phpBB Group