TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 18, 2024, 09:37:58 AM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 112
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 114
  • Total: 114

Alternative Article Editor

Started by KapaBG, February 13, 2008, 06:13:52 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

KapaBG

go to Administration Center/TinyPortal/Settings Use the WYSIWYG editor?:

  • No
  • yes, FCKeditor
  • yes, WhizzyWig
thats all  :'(

its very narrow, poor and tiranosaurus choice for cool articles and content  :tickedoff: and wisywig on other forum themes transforming to the [censored]ingFaq  :laugh:, because styles in this editors are fixing :coolsmiley: but my big intellectual power help to you in this case  O0 ahahaha

i found the brilliant inline html editor with great speed and cool size NicEdit - micro transparent whysiwig editor seems to special ready for TinyPortal. this is simple two files: one buttons gif 3kb and one jscript 30 kb. thats all! :buck2:

installation is simple:
make directory in forum root NicEditor and copy this two files (nicEditorIcons.gif and nicEdit.js). remember this  path for next using.

need make very easy changings in next files :
  • Themes/default/languages/TPortalAdmin.english.php
  • Themes/default/languages/TPortalAdmin.russian.php
  • Themes/default/languages/TPortalAdmin.russian-utf8.php
  • Sources/TPmodules.php
  • Sources/TPortalAdmin.php
  • Themes/default/TPmodules.template.php
  • Themes/default/TPortalAdmin.template.php
  • Themes/default/TPprofile.template.php

in langauage files need add one string
Themes/default/languages/TPortalAdmin.english.php
$txt['tp-myalteditor']='yes, My alternative editor';
Themes/default/languages/TPortalAdmin.russian.php
$txt['tp-myalteditor']='Мой альтернативный редактор';
Themes/default/languages/TPortalAdmin.russian-utf8.php
$txt['tp-myalteditor']='╨Ь╨╛╨╣ ╨░╨╗╤М╤В╨╡╤А╨╜╨░╤В╨╕╨▓╨╜╤Л╨╣ ╤А╨╡╨┤╨░╨║╤В╨╛╤А';

Themes/default/TPprofile.template.php
find <input name="tpwysiwyg" type="radio" value="0" ' , ($context['TPortal']['selected_member_choice'] =='0' || $context['TPortal']['selected_member_choice'] == '1') ? 'checked' : '' , '> '.$txt['tp-no'].'<br />
<input name="tpwysiwyg" type="radio" value="2" ' , $context['TPortal']['selected_member_choice'] =='2' ? 'checked' : '' , '> '.$txt['tp-fckeditor'].'<br />
<input name="tpwysiwyg" type="radio" value="3" ' , $context['TPortal']['selected_member_choice'] =='3' ? 'checked' : '' , '> '.$txt['tp-whizzyeditor'].'<br />
and add after <input name="tpwysiwyg" type="radio" value="4" ' , $context['TPortal']['selected_member_choice'] =='4' ? 'checked' : '' , '> '.$txt['tp-myalteditor'].'<br />


Themes/default/TPortalAdmin.template.php
find <input name="tp_use_wysiwyg" type="radio" value="0" ' , $context['TPortal']['use_wysiwyg']=='0' ? 'checked' : '' , '> '.$txt['tp-no'].'<br />
<input name="tp_use_wysiwyg" type="radio" value="2" ' , ($context['TPortal']['use_wysiwyg']=='2' || $context['TPortal']['use_wysiwyg']=='1') ? 'checked' : '' , '> '.$txt['tp-fckeditor'].'<br />
<input name="tp_use_wysiwyg" type="radio" value="3" ' , $context['TPortal']['use_wysiwyg']=='3' ? 'checked' : '' , '> '.$txt['tp-whizzyeditor'].'<br />
and add after <input name="tp_use_wysiwyg" type="radio" value="4" ' , $context['TPortal']['use_wysiwyg']=='4' ? 'checked' : '' , '> '.$txt['tp-myalteditor'].'<br />

Themes/default/TPmodules.template.php
find // tinyMCE
// FCKeditor
if($context['TPortal']['use_wysiwyg']>0 && $context['TPortal']['use_wysiwyg']<4 && $mg['useintro']!=-1){
need replace <4 to <5
and nextly find <input name="tp_wysiwyg" type="radio" value="2" ' , $context['TPortal']['use_wysiwyg']=='2' ? 'checked' : '' , '> '.$txt['tp-fckeditor'].'<br />
<input name="tp_wysiwyg" type="radio" value="3" ' , $context['TPortal']['use_wysiwyg']=='3' ? 'checked' : '' , '> '.$txt['tp-whizzyeditor'].'<br />
and add after <input name="tp_wysiwyg" type="radio" value="4" ' , $context['TPortal']['use_wysiwyg']=='4' ? 'checked' : '' , '> '.$txt['tp-myalteditor'].'<br />

Sources/TPortalAdmin.php
find if($context['TPortal']['use_wysiwyg']=='2' || $context['TPortal']['use_wysiwyg']=='1')
$context['html_headers'] .= '
<script language="javascript" type="text/javascript" src="'. $boardurl .'/FCKeditor/fckeditor.js"></script>';
elseif($context['TPortal']['use_wysiwyg']=='3')
$context['html_headers'] .=
'<script language="JavaScript" type="text/javascript" src="'. $boardurl. '/wysiwyg/whizzywig.js"></script>';
and add after elseif($context['TPortal']['use_wysiwyg']=='4')
$context['html_headers'] .=
'<script language="JavaScript" type="text/javascript" src="'. $boardurl. '/nicEditor/nicEdit.js"></script>';

nextly find // Whizzywig
elseif($context['TPortal']['use_wysiwyg']=='3')
$context['html_headers'] .= '
<script language="JavaScript" type="text/javascript">
function FullEditor(BodyName)
{
buttonPath = "'.$boardurl.'/wysiwyg/btn/";
cssFile="";
imageBrowse = "'.$boardurl.'/wysiwyg/whizzypic.php?d=tp-images/Image";
linkBrowse = "";
makeWhizzyWig(BodyName, "all");
}
function SmallerEditor(BodyName)
{
buttonPath = "'.$boardurl.'/wysiwyg/btn/";
cssFile="";
imageBrowse = "";
linkBrowse = "";
makeWhizzyWig(BodyName, "formatblock fontname fontsize newline bold italic underline | left center right |  undo redo  | color hilite rule | clean html");
}
</script>';
and add after // nicEdit
elseif($context['TPortal']['use_wysiwyg']=='4')
$context['html_headers'] .= '
<script language="JavaScript" type="text/javascript">
function FullEditor(BodyName)
{
bkLib.onDomLoaded(function() {
new nicEditor({fullPanel : true,
iconsPath : \''.$boardurl.'/nicEditor/nicEditorIcons.gif\'}
).panelInstance(BodyName);});
}
function SmallerEditor(BodyName)
{
bkLib.onDomLoaded(function() {
new nicEditor({iconsPath : \''.$boardurl.'/nicEditor/nicEditorIcons.gif\'}).panelInstance(BodyName);});
}
</script>';


Sources/TPmodules.php analogically
find if($context['TPortal']['use_wysiwyg']=='2' || $context['TPortal']['use_wysiwyg']=='1')
$context['html_headers'] .= '
<script language="javascript" type="text/javascript" src="'. $boardurl .'/FCKeditor/fckeditor.js"></script>';
elseif($context['TPortal']['use_wysiwyg']=='3')
$context['html_headers'] .=
'<script language="JavaScript" type="text/javascript" src="'. $boardurl. '/wysiwyg/whizzywig.js"></script>';
and add after elseif($context['TPortal']['use_wysiwyg']=='4')
$context['html_headers'] .=
'<script language="JavaScript" type="text/javascript" src="'. $boardurl. '/nicEdit/nicEditor.js"></script>';

next find // Whizzywig
elseif($context['TPortal']['use_wysiwyg']=='3')
$context['html_headers'] .= '
<script language="JavaScript" type="text/javascript">
function FullEditor(BodyName)
{
buttonPath = "'.$boardurl.'/wysiwyg/btn/";
cssFile="";
imageBrowse = "'.$boardurl.'/wysiwyg/whizzypic.php?d=tp-images/Image";
linkBrowse = "";
makeWhizzyWig(BodyName, "all");
}
function SmallerEditor(BodyName)
{
buttonPath = "'.$boardurl.'/wysiwyg/btn/";
cssFile="";
imageBrowse = "";
linkBrowse = "";
makeWhizzyWig(BodyName, "formatblock fontname fontsize newline bold italic underline | left center right |  undo redo  | color hilite rule | clean html");
}
</script>';
and add after // nicEdit
elseif($context['TPortal']['use_wysiwyg']=='4')
$context['html_headers'] .= '
<script language="JavaScript" type="text/javascript">
function FullEditor(BodyName)
{
bkLib.onDomLoaded(function() {
new nicEditor({fullPanel : true,
iconsPath : \''.$boardurl.'/nicEditor/nicEditorIcons.gif\'}
).panelInstance(BodyName);});
}
function SmallerEditor(BodyName)
{
bkLib.onDomLoaded(function() {
new nicEditor({iconsPath : \''.$boardurl.'/nicEditor/nicEditorIcons.gif\'}).panelInstance(BodyName);});
}
</script>';


cool!  :up: you made it!  :2funny: set wysiwig radiobox in TinyPortal settings to "'yes, My alternative editor'" and test article editing in new tool  ::)

need two things in this tool ???:
  • automatic replace string "hxxp://..." and mail address to links (without manual anchor input)
  • pictures upload
second thing may doing with temp swithing to [censored]Editor ^-^

add my karma plus!  :up: and join me to TinyPortal beta tester too O0

G6Cad

Thank you for posting.
Just to clear some things out.
The wysiwyg editor was removed cause it was way to buggy, and also the security was dreadful.
Bloc have checked several other editors and i dont really know what he have in mind regarding what editor to use right now.

I will add to this that I hope you have checked it's saftey so the sites that starts to use this doesent get hacked through it. The prime things for SMF and TP is safe scripts  :)

bloc

Hm, I really like this one, its very fast and lightweight. Does not come with image uploading, but that can be done by TP anyway. I will try it out.

feline

A little bit tooo simple ..  ???
It's not that, what i uderstand as wysiwyg editor  ::)

Fel

Ken.

The authors website.

I sent him a note and invited him to join in the discussion.  :)
" If everything seems under control, you're not going fast enough." - Mario Andretti
Yesterday When I was Young.

Xarcell

I like the fact that it's lightweight, fast, xhtml, and cross-browser complaint. Pretty much everything Bloc said.


feline

Quote from: Ken. on February 13, 2008, 12:01:43 PM
The authors website.

I sent him a note and invited him to join in the discussion.  :)
I have look at the site Ken.
And I need no discussion .. I love the comfort that I have with my xhtml editor  ::)

Fel

KapaBG

feline, your editor is great, but it is not quckly for some bad speed lines. and open second windows is not quckly open (as ms word :) )
not comforting, but rich features.

secondary, have problem in utf-8 and wincp mode (in russian).
thirdly, not a wysiwig in non standad themes (not using theme styles on the flight :) ).

but not bad, instead F@cKeditor!

you may insert your favorite xtml-editor with way above! my to do list is hack your blog mod for using nicEdit too ;) best way - user must selfselect comfortable tools for best working

feline

Quote from: Grand Duke on February 13, 2008, 06:52:54 PM
secondary, have problem in utf-8 and wincp mode (in russian).
What's is that problem? Give me a example please, so I can fix that ...

Quote
thirdly, not a wysiwig in non standad themes (not using theme styles on the flight :) ).
comming soon ...

Quote
you may insert your favorite xtml-editor with way above!
that i have do long time ago  8)

Fel

KapaBG

feline, problems with russian is not typical. if language is russian-utf8 problem is not anywhere. but if russian (cp1251) need little manual configurations in xhtml files. and after this, second popup windows (colors, links, etc) have utf-8

it is not big problem, but my goal now - try to inject lightweight nicEdit. it is not easy. need many find and replace

but your work is very nice and accurate, your code and db query is perfect!