Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 02:35 pm EST

Geeklog Forums

TinyMCE and GL 1.3.11 - integration instruction


Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
I've decided to write this because this is by far the easiest integration of a WYSIWG editor with Geeklog. Hopefully you'll find it usefull.
1. First of all go to TinyMCE website and grab a copy of the editor in their Download section.

2. Unpack the archive into your public_html directory. You should have a directory called tinymce created.

3. In a header.thtml file of your theme, after title tag paste this piece of code

Text Formatted Code
<script language="javascript" type="text/javascript" src="{site_url}/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>











 


4. If you want this feature available for everyone, read on, if TinyMCE is for Story Admins only go to point 5.
You keep reading this meaning you want this for everyone Wink
Do the following:
- copy the submitstory.thtml into submitstory_advanced.thtml
- edit the submitstory_advanced.thtml file and add this piece of code at the begining of the file
Text Formatted Code
<script language="javascript" type="text/javascript">
        // Notice: The simple theme does not use all options some of them are limited to the advanced theme
        tinyMCE.init({
                mode : "textareas",
                theme : "simple"
        });
</script>












 

- save it Wink

5. To enable TinyMCE for Story Admins do the following:
- copy the storyeditor.thtml into storyeditor_advanced.thtml
- edit storyeditor_advanced.thtml and add the following piece of code at the begining of the file
Text Formatted Code
<script language="javascript" type="text/javascript">
        // Notice: The simple theme does not use all options some of them are limited to the advanced theme
        tinyMCE.init({
                mode : "textareas",
                theme : "advanced"
        });
</script>












 

- save it Wink
6. Now edit your config.php
go to
Text Formatted Code
$_CONF['advanced_editor'] = false;











 

and set it to true.
Go to
Text Formatted Code
$_CONF['postmode']      = 'plaintext';  // can be 'plaintext' or 'html'










 
and set it to html
Save it Wink

7. Go edit your lib-common.php
go to
Text Formatted Code
function COM_refresh( $url )
{
    return "<html><head><meta http-equiv="refresh" content="0; URL=$url"></head></html>n";
}







 

and change to this
Text Formatted Code

function COM_refresh( $url )
{
header ("Location: " . str_replace ( '&amp;', '&', $url) );
return "<html><head><meta http-equiv=\"refresh\" content=\"0; URL=$url\"></head></html>n";
}










 


This solves the issue described in this thread

Final notes:
You will have to update the $_CONF['user_html'] and $_CONF['admin_html'], but it's up to you what you want to make available. For sure you will have to add strong tag to $_CONF['user_html'] because regular bold seems to be malfunctioning (this has been discussed here) . This editor has a lot more to offer and once you have it running do not hesitate and experiment Mr. Green

Good luck Very Happy
--EDIT--
I updated the bit that goes to lib-common.php COM_refresh. Thanks to heretic
Geeklog Polish Support Team
 Quote

Status: offline

SidiMustafa

Forum User
Newbie
Registered: 09/12/05
Posts: 12
Location:[NL]
awake
Hi, very well put together HOW-TO,

I tried it out, but when i did a page refreshed, i realized that i was not able to get into my website....

Somehow i remembered i had this problem before, and noted that it was because of sound erronous code in the lib-common.php

So i started looking into your code, step by step...after a while i realized that it's supposed to be this:

Text Formatted Code

function COM_refresh( $url )
{
header ("Location: " . str_replace ( '&', '&', $url) );
    return "<html><head><meta http-equiv="refresh" content="0; URL=$url"></head></html>n";
}

 


instead of what u had posted....

bascailly what i realized was that the "" was missing between "refresh" "content" etc...

but do hope, i was correct. cause once i made those changes, it worked flawlessy..

regards
sidi


PS NOTE...
Now, Now, while previewing my message, i realized exactly what the problem is......
In the code provided by the original poster, the "backslash" in the lib-common.php is missing...

I tried to post the correct code, thinking it was a typo, but while previewing before posting, i realized that all "backslashes" are automatically removed (filterd out by the forum software)..

So, if u are going to implement this, please double check your coding in the lib-common.php....after doing a copy and paste from the posters code

Check your old code, and look for those missing backslashes

~~~ The science of doing it right ~~~
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Well spotted SidiMustafa Smile
Thank you
Robert
Geeklog Polish Support Team
 Quote

Status: offline

yankidank

Forum User
Junior
Registered: 04/03/05
Posts: 17
How difficult would this be to integrate into the forums of a geeklog site?

By the way, thanks for the instructions. I have it working like a charm on my own site. If anyone wants to see what it looks like use the link above. I altered some of the code for the row and colum size to make it fit properly.
 Quote

Status: offline

SidiMustafa

Forum User
Newbie
Registered: 09/12/05
Posts: 12
Location:[NL]
Hi Yankidank

Two things, do u care to share the code that u used to adjust the settings of tinymce, i was trying to get it adjusted myself, my my small knowled of coding, didn't reach to far..

thanks in advance

next, according to the site of TinyMce, it's O/S, Platform independant, so i guess, it should be easy to get it work in the forum software,
I don't know which forum software u are using, but i did a fast search on GOOGLLLLLLEEE,
with TinyMCE and PHPBBB, and found lots of of hits
~~~ The science of doing it right ~~~
 Quote

ldfoo

Anonymous
Hi
Interesting, I don't know if this should be the case but found the tiny_mce code in the header slowed down my site when using a full implementation. Putting the code normally put in the header, directly at top of storyeditor_advanced.thtml gave faster overall site performance while giving full editor access to admin.

Text Formatted Code
<!-- tinyMCE -->
<script language="javascript" type="text/javascript" src="../../tiny_mce/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
        tinyMCE.init({
                mode : "specific_textareas",
        theme : "advanced",
                plugins : "table,advhr,advimage,paste,contextmenu,ibrowser,imanager,fullscreen,advlink,emotions,insertdatetime,preview,flash,searchreplace,print",
                theme_advanced_buttons1_add_before : "fontselect,fontsizeselect",
                theme_advanced_buttons1_add : "",
                theme_advanced_buttons2_add : "ibrowser,separator,insertdate,inserttime,preview,separator",
                theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
                theme_advanced_buttons3_add_before : "fullscreen,imanager,tablecontrols,separator,pastetext,pasteword",
                theme_advanced_buttons3_add : "emotions,flash,advhr,separator,print,forecolor,backcolor",
                theme_advanced_toolbar_location : "top",
                theme_advanced_toolbar_align : "left",
                theme_advanced_path_location : "bottom",
        plaintext_create_paragraphs : "false",
                content_css : "example_full.css",
            plugin_insertdate_dateFormat : "%d-%m-%y",
            plugin_insertdate_timeFormat : "%H:%M:%S",
                extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
                external_link_list_url : "example_link_list.js",
                external_image_list_url : "example_image_list.js",
                flash_external_list_url : "example_flash_list.js"
//              file_browser_callback : "fileBrowserCallBack"
        });

//      function fileBrowserCallBack(field_name, url, type) {
                // This is where you insert your custom filebrowser logic
//              alert("Filebrowser callback: " + field_name + "," + url + "," + type);
//      }
</script>
<!-- /tinyMCE -->
 


BTW - The Geeklog cvs has a very nice editor implementation using fckeditor - I haven't tested it for overall site speed on a shared hosting server but will be nice if the speed problems I found with tiny_mce are overcome Wink
 Quote

Status: offline

yankidank

Forum User
Junior
Registered: 04/03/05
Posts: 17
In response to SidiMustafa:

Open up the storyeditor_advanced.thtml and submitstory_advanced.thtml and edit the line that looks like:

Text Formatted Code
<td><textarea name="introtext" cols="75" rows="20" wrap="virtual">{story_bodytext}</textarea></td>
 


That's not the original code, that's what I changed it to so that it would fit my site better. Just change the cold and rows numbers until it fits. You will want to do this with 2 lines in the storyeditor_advanced.thtml file. Once for story_introtext and once for story_body text just below it. submitstory_advanced.thtml only has one area to change.
 Quote

Status: offline

beewee

Forum User
Full Member
Registered: 08/05/03
Posts: 969
Location:The Netherlands, where else?
Does the Admin has an image upload facility? And cropping/resizing?

**EDIT/UPDATE**

from TinyMCE site:
We just released updated versions of MCFileManager and MCImageManager, a lot of backend changed on these versions, fixes and extra options added. We included language support for them as well, currently only Swedish and English.

Dutch Geeklog sites about camping/hiking:
www.kampeerzaken.nl | www.campersite.nl | www.caravans.nl | www.caravans.net
 Quote

ldfoo

Anonymous

The iBrowser plugin is very well featured third party plugin suited to several editors incl tiny_MCE . It allows upload and manipulation. The author also has a file manager plugin available from the same site.

rgds
 Quote

Status: offline

yankidank

Forum User
Junior
Registered: 04/03/05
Posts: 17
Is it possible to integrate this into the forum plugin? I'm not sure what I would lose or gain by doing this.
 Quote

Status: offline

kreative

Forum User
Chatty
Registered: 08/15/04
Posts: 53
Location:Verona, Italy
Hello friends,
thanks for this topic, I just installed TiniMCE and it works ok!

I have only a problem: BOLD letters don't are bold, they become plain test.. I am unable to make bold words.... I see the words in bold when I'm in the editor window, but when I read the home page of my site all letters return in plain format. Links and other features works ok.

Any suggestion for my problem?
Thanks!
 Quote

Status: offline

kreative

Forum User
Chatty
Registered: 08/15/04
Posts: 53
Location:Verona, Italy
OK I solved the "bold" question but I have another problem: "mailto:" links don't works, example:

Link: mailtoMadxx@xxx.com
Converted to: http://www.mysite.com/xxx@xxx.com

TinyMCE converts mailto: in my site address.

Can someone help me?
 Quote

Theophile

Anonymous
How did you solve the bold issue?
 Quote

Status: offline

Robin

Forum User
Full Member
Registered: 02/15/02
Posts: 725
Dear Theophile, have you carefully read the first post in this thread Question
Quote by Robin:
Final notes:
You will have to update the $_CONF['user_html'] and $_CONF['admin_html'], but it's up to you what you want to make available. For sure you will have to add strong tag to $_CONF['user_html'] because regular bold seems to be malfunctioning (this has been discussed here) .

Geeklog Polish Support Team
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by kreative: TinyMCE converts mailto: in my site address.

You have to add it to the list of allowed protocols in config.php:
Text Formatted Code
// list of protocols that are allowed in links                                
$_CONF['allowed_protocols'] = array ('http', 'https', 'ftp');
 

But then again, who really uses mailto: any more? Any email address you enter there will only attract spam ...

bye, Dirk
 Quote

Status: offline

kreative

Forum User
Chatty
Registered: 08/15/04
Posts: 53
Location:Verona, Italy
Hmmm.. Dirk, do you suggest me to use the mail form instead the mailto: ?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by kreative: Dirk, do you suggest me to use the mail form instead the mailto: ?

That's what I'd do.

bye, Dirk
 Quote

All times are EST. The time is now 02:35 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content