[solved] FCKEDITOR - embedded images - bad URL

Solutions for other phpList version 2 users
Forum rules
Please do not ask questions here, this is for Solutions you have discovered or come across.

[solved] FCKEDITOR - embedded images - bad URL

Postby mlapl1 » 10:32pm, Sun 20 Sep, 2009

I am experiencing a strange problem with FCKEditor.

I can upload an image and insert it in a message. The system automatically generates a URL. This URL is not a real URL but is the content of the variable $pageroot in config.php - which is the path to phplist underneath the web server's root (apache).

PHPlist does not live in a domain or subdomain of its own.

In other instances of fckeditor that I run, a correct URL or filepath is generated by FCKEditor - and the graphic is visible in the email which is sent.

However, in this case, the $pageroot is inserted as is and I finish up with a URL which looks like
http://newsletter/list/public_html/lists instead of
http://mydomain.com/newsletter/list/public_html/lists

and of course, the graphic is not seen.

In other words, the domain name is not added to the beginning of the URL.

I can fix this problem by typing the correct URL manually in the fckeditor image insert box - but it is not a good solution.

Any ideas on how I can fix the problem?
Thanks a lot
Andrew
mlapl1
phpLister
 
Posts: 14
Joined: 4:19am, Fri 18 Sep, 2009

Re: FCKEDITOR - embedded images - bad URL

Postby jeremykay » 7:55pm, Mon 21 Sep, 2009

Here's a solution that I found here:

Open the file:
/PATH_TO_PHPLIST/admin/FCKeditor/editor/filemanager/connectors/phplist/basexml.php

FIND:
Code: Select all
   // Add the current folder node.
   echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder, $command ) ) . '" />' ;

REPLACE WITH:
Code: Select all
  //get the complete URL
  $serverURL = "http://".$_SERVER['HTTP_HOST'];

   // Add the current folder node.
   echo '<CurrentFolder path="' . ConvertToXmlAttribute( $currentFolder ) . '" url="' . $serverURL . ConvertToXmlAttribute( GetUrlFromPath( $resourceType, $currentFolder, $command ) ) . '" />' ;
jeremykay
phpList newbie
 
Posts: 4
Joined: 5:39pm, Fri 21 Aug, 2009


Return to Answers, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests