PDA

View Full Version : Newsletter tutorial using Dreamweaver


slec75
04-21-2009, 09:19 AM
Hi,

I try to make my own newsletter's application with the help of this tutorial :
http://dreamgratuit.canalblog.com/archives/2008/05/01/9025822.html

I use the Google Translator to get the english version of these pages. But sometimes, the translation is really bizare. I have to instal and set up FCK Editor (http://dreamgratuit.canalblog.com/archives/2007/05/30/5133353.html)

Everything runs perfectly at localhost but doesn't work properly for the distant host...

edbr
04-21-2009, 09:28 AM
go to fck site and check their instructions

student101
04-21-2009, 09:11 PM
Everything runs perfectly at localhost but doesn't work properly for the distant host...
I have setup some tuts on FCKeditor's forum... Here is a guide for you so long:
In order to have FCKeditor work with certain not up to date or clued up hosts;
You may need to have this setup:
* register_long_arrays - not required
* register_globals - not required
* disabled safe_mode - odd but required
* magic quotes - not required
There may be a patch for safe_mode to stay enabled and FCKeditor run along side it - really not sure

How to get this thing to work??? [edit.. PHP Method below edit]

<?php include_once("../FCKeditor/fckeditor.php") ; ?>

// Please note the spelling of FCKeditor
In BETWEEN the <head tags> (normally above </head>)add this;
<script type="text/javascript" src="../FCKeditor/fckeditor.js"></script>
<script type="text/javascript">
window.onload = function()
{
var oFCKeditor = new FCKeditor( 'data' ) ; //The textareas name
oFCKeditor.BasePath = "../FCKeditor/" ;
oFCKeditor.Height = "400" ;
oFCKeditor.Width = "100%" ;
oFCKeditor.ToolbarSet = 'Default' ; //The toolbar you want to use
oFCKeditor.ReplaceTextarea() ;
}
</script>

Now with these ADDitions you should now have a workin copy of FCKeditor in Dreamweaver (ASP, PHP, Whatever you use, etc...)
How to go about getting the correct paths?
(/FCKeditor/editor/filemanager/connectors/<yourversion>/config.php)
$Config['UserFilesPath'] = 'uploads/' ; //uploads directory
Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.
$Config['UserFilesAbsolutePath'] = '/var/www/vhosts/example.com/webfiles/uploads/' ;
When an image is inserted into the editor it is a virtual path "/path/image.gif".
How to get the full path "http://www.example.com/path/image.gif"?
* open "editor/filemanager/browser/default/frmresourceslist.html"
* edit the line below "oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )" which should be around line 65
* from: var sLink = '<a href="#" onclick="OpenFile(\'' + ProtectPath( fileUrl ) + '\');return false;">' ;
to: var sLink = '<a href="#" onclick="OpenFile(\'http://www.example.com' + fileUrl + '\');return false;">' ;

Now it will insert the full path to your image in the editor window.
(note: you have to close your browser and reopen to take effect)

You may be able to use this method below instead of above... // I have not tested this method, my above methods work fine.
$Config['UserFilesPath'] = 'http://'.$_SERVER['HTTP_HOST'].'/FCKeditor/uploadfiles/' ;
$Config['UserFilesAbsolutePath'] = $_SERVER['DOCUMENT_ROOT'].'/FCKeditor/uploadfiles/' ;

I hope that covers most of the beginner Q & A's
Cheers

slec75
04-22-2009, 08:34 AM
Thanks for help.
I solve this problem : i used a wrong path because Apache servers are sensitive to capitals...

student101
04-22-2009, 08:50 AM
Thanks for help.
I solve this problem : i used a wrong path because Apache servers are sensitive to capitals...
After I saw that editor, I was baffled for some time with the paths and so on...
Glad you got it sorted, just remember to safe gaurd that config.php file with a username/password system.