Diferior CMS on steroids
+1942 / 12804907 ( online 30 )

TinyMCE integration


Avatar
Forum posts: 9
ZigmunD (Junior member) @ 09 03 12 - 15:58:31 (edited 09 03 12 - 22:22:38)
TinyMCE integration ^_^

At first, disable all caching in admin section!

1. Go to http://tinymce.moxiecode.com and download latest TinyMCE package archive.

2. Extract /jscripts/tiny_mce from the archive to your site to the /static/tiny_mce directory.

3. Open /templates/skio/index.tpl.php and insert at line #18 before style tag (remove <?php and ?>):
<?php <script type="text/javascript" src="/static/tiny_mce/tiny_mce.js"></script> ?>

4. Open /tpl_resources/skio/scripts/javascript.js and add at the end of file after read_cookie function:
tinyMCE.init({ theme : "advanced", mode : "exact", elements : "txt,msg,comment", plugins : "bbcode", convert_urls : false, theme_advanced_buttons1 : "bold,italic,underline,|,undo,redo,link,unlink,image,forecolor,blockquote,|,code ", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_toolbar_location : "bottom", theme_advanced_toolbar_align : "center", entity_encoding : "raw", add_unload_trigger : false, remove_linebreaks : false, });

Wheee! Now we have TinyMCE! :-)
Image

But that is not all. Out smilies and preview buttons dosn't work. Let's fix it! :-)

Smilies:
1. Open /tpl_resources/skio/scripts/javascript.js and insert at line #288 after add_bbcode function:
// Smilies to TinyMCE function add_smile ( smile ) { tinyMCE.execCommand('mceInsertContent', false, smile) }

2. Open /templates/skio/pm.tpl.php and replace line #133 with:
<a href="javascript:add_smile(' {$k|escape:'javascript'} ')">{img src="`$imurl`smilies/`$v`.gif" alt="`$k`"}</a>

3. Open /templates/skio/file.tpl.php and replace line #297 with:
<a href="javascript:add_smile(' {$k|escape:'javascript'} ')">{img src="`$imurl`smilies/`$v`.gif" alt="`$k`"}</a>

4. Open /templates/skio/forum.tpl.php and replace two lines #272 and #322 with:
<a href="javascript:add_smile(' {$k|escape:'javascript'} ')">{img src="`$imurl`smilies/`$v`.gif" alt="`$k`"}</a>

5. Open /templates/skio/read.tpl.php and replace line #109 with:
<a href="javascript:add_smile(' {$k|escape:'javascript'} ')">{img src="`$imurl`smilies/`$v`.gif" alt="`$k`"}</a>

Press F5 on some page to make browser refresh files. OK, now our smilies works well.
Image

Preview button:
1. Open /tpl_resources/skio/scripts/upload.js, delete line #14 then replace line #17 with:
var data = 'content='+ escape ( tinyMCE.activeEditor.getContent() ) +'&cat='+ category.value +'&post='+ escape ( header.value);

Now prewiew button works well.
Image

At last we need to delete default bbcode buttons.
1. Open /templates/skio/upload.tpl.php and remove lines from #55 to #75.
2. Open /templates/skio/post.tpl.php and remove lines from #32 to #56

BBButtons gone away. :-)
Image

That's all folks! Now you can enable caching. :-)

Known issues:
1. There is no font size tag in TinyMCE editor.
2. No [ code ] tag too. :(

I will fix it in a time. Maybe. :-)
Avatar
Forum posts: 9
ZigmunD (Junior member) @ 09 03 12 - 16:50:49 (edited 09 03 12 - 16:51:06)
Instructions in russian / инструкции на русском: [url=http://zigmund.kz/2009/03/прикручиваем-tinymce-к-diferior/]http://zigmund.kz/2009/03/прикручиваем-tinymce-к-diferior/[/url]
Avatar
Blog posts: 12
Added downloads: 2
Comments: 18
Forum posts: 573
UnrealX (Lead code monkey) @ 09 03 12 - 20:48:22
This is awesome, I'll most likely include this in the next version ;)
Good job, ZigmunD!
Forum posts: 98
p2pmylife (Talks a lot) @ 09 03 12 - 21:20:11
WTF that's what I try to do with FCKEditor since the beginning ... I will look at the way you do this to implement my FCK ...

Thanks a lot :D
Forum posts: 98
p2pmylife (Talks a lot) @ 09 03 13 - 07:57:15
Im so sorry but that ... dont work !

I do exactly what you've said in your post, and tinyMCE bar dont appear despite there is no bugs or errors ...

o_O
Avatar
Forum posts: 9
ZigmunD (Junior member) @ 09 03 13 - 13:24:20
Im so sorry but that ... dont work !

I do exactly what you've said in your post, and tinyMCE bar dont appear despite there is no bugs or errors ...

o_O

Post your site's url.
Forum posts: 98
p2pmylife (Talks a lot) @ 09 03 13 - 23:18:18
Watch my profile ;) !
Forum posts: 98
p2pmylife (Talks a lot) @ 09 03 14 - 10:50:25
Navigator error : tynyMCE.init , this object cant handle this propriety or this method (under IE)
Avatar
Forum posts: 9
ZigmunD (Junior member) @ 09 03 14 - 12:12:21 (edited 09 03 14 - 12:13:15)
I have no IE and can not check.

There are some error on you site:
1. An error in /tpl_resources/skio/scripts on line #307. That is why TineMCE doesn't work, I think.
2. Some pages include self recursively in header, where should be .swf logo.
Image
Avatar
Blog posts: 12
Added downloads: 2
Comments: 18
Forum posts: 573
UnrealX (Lead code monkey) @ 09 03 14 - 12:30:36
My guess would be that recursion occurs due to .swf not being placed in a pass-through directory (static, tpl_resources, etc) or the URL to it is relative.
Forum posts: 98
p2pmylife (Talks a lot) @ 09 03 15 - 13:08:39
Ok that work, curiously, that was due to a „@*\“ javascript comment forget for the xmlhttprequest function I've previously uncomment for my work on the form >_< , thanks a lot for your help guys !

^_^
Forum posts: 98
p2pmylife (Talks a lot) @ 09 03 15 - 13:57:33 (edited 09 03 15 - 14:15:38)
For a full options WYSIWYG bar, just replace the tinymce.init function by this one :

tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emo tions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,cont extmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtm lxtras,template,imagemanager,filemanager", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycen ter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselec t", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent ,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,in sertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell, media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite, abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,blockquote,pagebreak,|,in sertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", // Comment this line to hide the location bar theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } });

Font size, animation embedding, and so on are now enabled ...

Im wondering how can you set a simple TinyMCE bar for comments and a full TinyMCE bar for upload or post ?

Because its the same for all of this (forum,comment,upload and post) ...
Forum posts: 98
p2pmylife (Talks a lot) @ 09 03 17 - 21:48:55
I've dont understand why „code“ and „quote“ bbcode are not interpreted by Diferior :

That's what appears in the comment if if I make a quote or a code text embedding for example with TMCE :

<p class="quoteStyle">test <p class="codeStyle">test

Why its a <p> markup ? Doesnt it normally a <span> which is used in both of systems (Diferior native BBcode and TinyMCE) to replace BBCode to html code ?

I've find this for Diferior in text.php functions :

<span class="post_quote"> and <span class="post_code\">

and this for TMCE :

<span class="quoteStyle"> <span class="codeStyle">

The error seems to be caused by the css class ...

So is it possible to synchronise the code between this 2 BBCode functions ?
Avatar
Blog posts: 12
Added downloads: 2
Comments: 18
Forum posts: 573
UnrealX (Lead code monkey) @ 09 03 18 - 14:54:53
You could try assigning additional class names to post_quote and post_code CSS descriptions.
Like so:
.post_quote, .quoteStyle { ..... }
Forum posts: 98
p2pmylife (Talks a lot) @ 09 03 22 - 19:57:41
Well, If you want to set a bbcode WYSIWYG for the comments instead of the same editor for the whole site, you can use the selector, its easy and very usefull :

tinyMCE.init({ ... mode : "specific_textareas", editor_selector : "mceEditor" });

tinyMCE.init({ ... mode : "specific_textareas", editor_selector : /(mceEditor|mceRichText)/ });

<textarea id="myarea1" class="mceEditor">This will be an editor.</textarea> <textarea id="myarea2">This will NOT be an editor.</textarea>

Now you can set the bbcode bar for the comments, and the advanced bar for the posts !

;)
Forum posts: 7
albertpaul68 (Junior member) @ 11 06 10 - 12:05:52
Instructions in russian / инструкции на русском: [url=http://zigmund.kz/2009/03/прикручиваем-tinymce-к-diferior/]http://zigmund.kz/2009/03/прикручиваем-tinymce-к-diferior/[/url]

Thanks for sharing this information. I really like your way of expressing the opinions and sharing the information. It is good to move as chance bring new things in life, paves the way for advancement, etc. But it is well known to everyone that moving to new location with bulk of goods is not an easy task to move or shift from one place to other place because I have experienced about that and I face the problem like that. There I go to village near to my city faced that problem there.
testking ,
ccie ,
ccna ,
ccnp ,
ccvp ,
a+ certification ,
mcp ,
pmp ,
cisa ,
ccia ,
Comments: 33
Forum posts: 8
Oakle78 (Advanced member) @ 11 08 24 - 08:53:46
Elinor forms an attachment chi hair products to the gentle and courteous Edward Ferrars, chi flat iron unaware that he is already secretly engaged. chi flat irons After their move, cheap chi flat irons Marianne meets Willoughby, a dashing young zebra chi flat iron man who leads her into undisciplined behaviour, chi straighteners on sale so that she ignores the pink chi flat iron attentions of the faithful (but older) Colonel Brandon. chi digital flat iron The contrast between the sisters' chi turbo 2 inch characters is eventually resolved as both find love and chi 2 inch flat iron lasting happiness.
Comments: 4
Forum posts: 1
heibe (Junior member) @ 11 09 20 - 04:13:07
emu bronte boot
emu boot black
EMU Australia Boots
emu jolie slippers
EMU Boots
EMU Boots günstig
emu cuddles slippers
emu chalet boot
EMU boots Bronte Hi
emu hip button
nice ugg classic tall comfortable
beautiful ugg classic tall boots cardy
EMU boots Hi Hipper
emu bronte hi
prefect christian louboutin uk
buy ugg boots
emu boot stockists
EMU boots Paddington Hi
emu bronte lo
australian sheepskin slippers
EMU boots Bronte Lo
shoes free shipping both ways
ugg uk
Best seller
emu australia
Schn?ppchen bei EMU Boots
emu barossa boot
moncler outlet
tienda moncler
Moncler
moncler usa
Moncler Daunenjacken
normal winter Moncler clothing
moncler down jackets
Moncler Online Shop
lightness moncler jacket sale
black moncler jacket
Moncler Damen
Chaquetas moncler men jacket
colored moncler jackets
Moncler Herren
cheap moncler Kids jackets
moncler sweaters shop
Moncler Kinder
Moncler jackets for women
Moncler Vest
moncler womens jacket
Moncler Stiefel
moncler jacket women
Moncler Accessories
moncler sale
moncler 2010
Comments: 416
Forum posts: 19
afra99 (Immortal) @ 11 10 20 - 09:42:38
With the arrival of louboutin shoes store cold weather, many stylish christian louboutin on sale with discount price are on hot selling. Various of christian louboutin uk sale attract many people’s attention. Including many louboutin pumps online celebrities. It seems that no one could resist the charm of discount christian louboutin shoes. Are you ready to buy cheap louboutins sale them? If yes,come on.
Comments: 416
Forum posts: 19
afra99 (Immortal) @ 11 10 20 - 09:52:03
A Now,let discount christian louboutin shoes Over The Knee Boots to make your christian louboutin online life is full of colors and surprises. What you need to do is pay more attention to cheap louboutin shoes the latest discount louboutins in the world. Then you can not hesitate to get the new fashion louboutin shoes sale to change your dress style. I am sure do that christian louboutin discount shoes will bring you many happiness.
« Previous 1-20 21-40 Next »