[mod] Embedding images in Content section

3rd party code for phpList

Re: [mod] Embedding images in Content section

Postby thomi » 12:38pm, Wed 30 Mar, 2011

hey all

btw. today i installed a fresh 2.10.13 and enabled above for embedding images.. worked like a charme ;)..
just be aware while you go trough config.php to create the "uploadimages" folder... i have created it inside phplist, same level as the admin folder... i know, some would say, put them out of phplist.. but why.. just images.. and they will be spreaded to the users ;)...

also set...
Code: Select all
define ("EMBEDUPLOADIMAGES",1);

...at the end of config.php (before ?>) and your done...

kind regards
thomi
thomi
PL Nut
 
Posts: 23
Joined: 3:02pm, Tue 21 Sep, 2010

Re: [mod] Embedding images in Content section

Postby infovrager » 3:04pm, Fri 22 Apr, 2011

Hi,
I tried with the newest version of phplist, adapting the config file and putting the uploadimages folder as above ,but I still only get to send messages with a link to the location of the image I want to embed. I didn't make any other changes ...
The template images are correctly embedded, though, and are displayed immediately when opening the message in outlook.
I use php 5.2.16 on a shared server.
Any hints on what to check?
Thanks in advance!
paul
infovrager
phpList newbie
 
Posts: 2
Joined: 2:43pm, Fri 22 Apr, 2011

Re: [mod] Embedding images in Content section

Postby afatac » 12:25pm, Sat 21 May, 2011

Tested embedding images in message successfully with 2.10.14 today.

In config/config.php, line 555
Code: Select all
define("FCKIMAGES_DIR","uploadimages");


also added this at the end of config.php but before ?>
Code: Select all
define ("EMBEDUPLOADIMAGES",1);


Images uploaded in FCKeditor are stored in /lists/uploadimages/image/

However, I notice this does not work when the images are uploaded to subfolder e.g.
/lists/uploadimages/image/test_folder/

Can someone verify this?

If this is true, is there a way to overcome this issue?
afatac
phpLister
 
Posts: 7
Joined: 10:49am, Sat 09 May, 2009

Re: [mod] Embedding images in Content section

Postby infovrager » 2:55pm, Fri 03 Jun, 2011

Just wanted to let you know ... after a fresh install of 2.10.14 everything is OK.
Thanks for this usefull function!
infovrager
phpList newbie
 
Posts: 2
Joined: 2:43pm, Fri 22 Apr, 2011

Re: [mod] Embedding images in Content section

Postby afatac » 11:01pm, Wed 21 Sep, 2011

However, I notice this does not work when the images are uploaded to subfolder e.g.
/lists/uploadimages/image/test_folder/

Can someone verify this?

If this is true, is there a way to overcome this issue?


Tested on 2.10.17 today. Like 2.10.14, the image is embedded successfully for image file that is stored in /lists/uploadimages/image/ , but not successfully for image file that is stored in /lists/uploadimages/image/test_folder/

Hope there will be an improvement in the near future.
afatac
phpLister
 
Posts: 7
Joined: 10:49am, Sat 09 May, 2009

Re: [mod] Embedding images in Content section

Postby kvdv » 9:59am, Mon 03 Oct, 2011

However, I notice this does not work when the images are uploaded to subfolder e.g.
/lists/uploadimages/image/test_folder/
Can someone verify this?

Having the same problem of not embedding images from subfolders in version 2.10.16
However, the results can vary.
Animated .gif from subfolders will not embed, some .jpg will embed, others not.
So indeed, I can verify having the same problem of not correctly embedding images from subfolders.
kvdv
phpList newbie
 
Posts: 1
Joined: 9:49am, Mon 03 Oct, 2011

Re: [mod] Embedding images in Content section

Postby thomi » 9:54am, Fri 11 Nov, 2011

I installed 2.10.17 now.. and this config part isn't integrated in config.php, please add it in future releases..

Code: Select all
define ("EMBEDUPLOADIMAGES",1);


thanks
thomi
thomi
PL Nut
 
Posts: 23
Joined: 3:02pm, Tue 21 Sep, 2010

Re: [mod] Embedding images in Content section

Postby rhertogh » 1:42pm, Thu 22 Mar, 2012

Fix for PHPList 2.10.17 (Thanks to RJC)

REPLACE:

Code: Select all
function filesystem_image_exists($filename) {
      ##  find the image referenced and see if it's on the server
      $elements = parse_url($filename);
      $localfile = basename($elements['path']);
      return
        is_file($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/image/'.$localfile)
        || is_file($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/'.$localfile)
        ## commandline
        || is_file('../'.FCKIMAGES_DIR.'/image/'.$localfile)
        || is_file('../'.FCKIMAGES_DIR.'/'.$localfile);
    }

    function get_filesystem_image($filename) {
      ## get the image contents
      $elements = parse_url($filename);
      $localfile = basename($elements['path']);
      if (is_file($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/'.$localfile)) {
        return base64_encode( file_get_contents($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/'.$localfile));
      } elseif (is_file($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/image/'.$localfile)) {
        return base64_encode( file_get_contents($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/image/'.$localfile));
      } elseif (is_file('../'.FCKIMAGES_DIR.'/'.$localfile)) {   ## commandline
        return base64_encode( file_get_contents('../'.FCKIMAGES_DIR.'/'.$localfile));
      } elseif (is_file('../'.FCKIMAGES_DIR.'/image/'.$localfile)) {
        return base64_encode( file_get_contents('../'.FCKIMAGES_DIR.'/image/'.$localfile));
      }
      return 0;
    }


WITH:
Code: Select all
function filesystem_image_exists($filename) {
      ##  find the image referenced and see if it's on the server
      $elements = parse_url($filename);
      $localfile = basename($elements['path']);
      return
        is_file($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/image/'.$localfile)
        || is_file($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/'.$localfile)
        || is_file($_SERVER['DOCUMENT_ROOT'].$filename)
        ## commandline
        || is_file('../'.FCKIMAGES_DIR.'/image/'.$localfile)
        || is_file('../'.FCKIMAGES_DIR.'/'.$localfile);
    }

    function get_filesystem_image($filename) {
      ## get the image contents
      $elements = parse_url($filename);
      $localfile = basename($elements['path']);
      if (is_file($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/'.$localfile)) {
        return base64_encode( file_get_contents($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/'.$localfile));
      } elseif (is_file($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/image/'.$localfile)) {
        return base64_encode( file_get_contents($_SERVER['DOCUMENT_ROOT'].$GLOBALS['pageroot'].'/'.FCKIMAGES_DIR.'/image/'.$localfile));
      } elseif (is_file($_SERVER['DOCUMENT_ROOT'].$filename)) {
        return base64_encode( file_get_contents($_SERVER['DOCUMENT_ROOT'].$filename));
      } elseif (is_file('../'.FCKIMAGES_DIR.'/'.$localfile)) {   ## commandline
        return base64_encode( file_get_contents('../'.FCKIMAGES_DIR.'/'.$localfile));
      } elseif (is_file('../'.FCKIMAGES_DIR.'/image/'.$localfile)) {
        return base64_encode( file_get_contents('../'.FCKIMAGES_DIR.'/image/'.$localfile));
      }
      return 0;
    }
rhertogh
phpList newbie
 
Posts: 1
Joined: 1:28pm, Thu 22 Mar, 2012

Re: [mod] Embedding images in Content section

Postby jeanmich » 11:45am, Wed 20 Jun, 2012

This is not fixed in .10.18, and this patch works again with this version.
But more precisely, we have to use urldecode:

Code: Select all
|| is_file($_SERVER['DOCUMENT_ROOT'].urldecode($filename))


Code: Select all
} elseif (is_file($_SERVER['DOCUMENT_ROOT'].urldecode($filename))) {
        return base64_encode( file_get_contents($_SERVER['DOCUMENT_ROOT'].urldecode($filename)));
jeanmich
phpList newbie
 
Posts: 1
Joined: 11:40am, Wed 20 Jun, 2012

Re: [mod] Embedding images in Content section

Postby thomi » 5:41am, Fri 31 Aug, 2012

Hello

i just upgraded to latest 2.10.19 and following code isn't in config/config.php:

Code: Select all
define ("EMBEDUPLOADIMAGES",1);


please ADD this code into next releases, it easy, simple ;) embeddig images in newsletters should be default on...

nice day
thomi
thomi
PL Nut
 
Posts: 23
Joined: 3:02pm, Tue 21 Sep, 2010

Re: [mod] Embedding images in Content section

Postby ejay56 » 6:06am, Fri 09 Nov, 2012

I know this is an old post, but i had to do a lot of googling to get an answer. Just posting again to help -

For those who wish to display their phplist newsletter images on outlook/macMail, hotmail, yahoo mail, gmail by embedding the images to the outgoing email & NOT by hosting the images on your website - do this:

1. Use the latest phplist (i am using version 2.10.17)

as mentioned many times before this

2. Open config/config.php and add this line anywhere - define("EMBEDUPLOADIMAGES",1);

3. Change define("FCKIMAGES_DIR","uploadedimages"); to define("FCKIMAGES_DIR","attachments");
The attachments folder already exist in the public_html

4. Login to phplist >> new message >> press insert image button >> "you will see browse server button" >> press upload button and insert the image.

hope it helps someone.
ejay56
phpList newbie
 
Posts: 1
Joined: 5:53am, Fri 09 Nov, 2012

Re: [mod] Embedding images in Content section

Postby cranky69 » 3:06pm, Fri 04 Jan, 2013

I saw all existing posts onto this thing.
Now it didn't works - i am using phplist 2.10.19 - i get the browser upload window, but i get also the message:
This connector is disabled. Please check the /editor/filemanager/connectors/php/config.php.

So, because i am using an FCKupgrade (version 2.6.9) i taked filemanager/connectors/phplist/config.php and put into
filemanager/connectors/php/

Now system says:
the server didn't replay with a proper XML data - check your configuration -
what i need to solve that ?
cranky69
phpLister
 
Posts: 7
Joined: 1:07pm, Sat 19 May, 2012

Re: [mod] Embedding images in Content section

Postby cranky69 » 3:17pm, Fri 04 Jan, 2013

OK, i did wrong operations.
I undo the above operations. I open the filemanager/connectors/php/config.php files, and edit the line:

Code: Select all
$Config['Enabled'] = false ;

TO
Code: Select all
$Config['Enabled'] = true ;

AND
Code: Select all
$Config['UserFilesPath'] = ''

TO
Code: Select all
$Config['UserFilesPath'] = '/uploadimages/'


Now it works, and it embed the image into message. But i think that can will be security risk....
cranky69
phpLister
 
Posts: 7
Joined: 1:07pm, Sat 19 May, 2012

Re: [mod] Embedding images in Content section

Postby tiaris » 5:46pm, Sat 26 Jan, 2013

Than you for information ejay56

I spend a couple of hours on testing sending e-mail with embedded images...

The only thing was to add define("EMBEDUPLOADIMAGES",1); in my config.php file !
tiaris
phpList newbie
 
Posts: 2
Joined: 5:26pm, Sat 26 Jan, 2013

Re: [mod] Embedding images in Content section

Postby Helveticus » 12:37pm, Wed 07 Aug, 2013

thomi wrote:hey all

btw. today i installed a fresh 2.10.13 and enabled above for embedding images.. worked like a charme ;)..
just be aware while you go trough config.php to create the "uploadimages" folder... i have created it inside phplist, same level as the admin folder... i know, some would say, put them out of phplist.. but why.. just images.. and they will be spreaded to the users ;)...

also set...
Code: Select all
define ("EMBEDUPLOADIMAGES",1);

...at the end of config.php (before ?>) and your done...

kind regards
thomi


I did the things mentioned but it does not work. I don't get any button for uploading images to the server. See my screenshot in the appendix.

What is the problem? Perhaps because I'm using a german version of the editor?

I'm using phpList 2.10.19.

Edit: I also tried setting to chmod 755 as mentioned here http://docs.phplist.com/UsingFCKEditor.html. Did not help.
Attachments
screenshot.jpg
screenshot.jpg (88.56 KiB) Viewed 10887 times
Helveticus
PL Geek
 
Posts: 64
Joined: 10:22pm, Sun 28 Jul, 2013

PreviousNext

Return to Contributions: Plug-ins, Add-ons, Mods

Who is online

Users browsing this forum: No registered users and 1 guest