Page 1 of 1

Popfetcher doesn't handle image in entry

Posted: Wed Aug 20, 2008 9:10 pm
by DwB
I'm using the popfetcher-plugin (v1.30) with the newest s9y.
I've read several threads handling problems with the popfetcher but none could help.

I'm sending an email and using cronjob.de the email is parsed in that way correctly as the subject, category and text is shown correctly, only my attachements (image only) is just inserted into the media but not into the entry.

I tried several setting, starting from "Use plaintext attachments as entry body?", "First text attachment is entry body, the rest extended" being dis- and enabled, using plain-text, removing and not removing advertisement, still no solution for the image-problem. I also tried to send different image-types like JG, PNG or GIF.

GDLib is installed.

Posted: Thu Aug 21, 2008 10:01 am
by DwB
Okay after doing some debuging I found the problem: I used a delimiter and the function stripText() deletes anything after this delimiter. Unfortunally attachements are stored after my delimiter in $entry['body']. So sending an email without delimiter works, showing the image in the post.

Re: Popfetcher doesn't handle image in entry

Posted: Mon Feb 09, 2009 4:27 pm
by DwB
And with a little work-around, images within an entry having a delimiter also works.

Just change

Code: Select all

$msgbody = implode("<br />\n",        $postbody);
to

Code: Select all

$msgbody = $postbody[0];
$this->stripText($msgbody);
$msgbody .= $postbody[1];
in serendipity_event_popfetcher.php on line 1078.

$postbody is an array, having the text in [0]. So I decided to remove everything after the delimiter here and adding the image afterwards.
Still have to prove how it works when sending more than one image, but I didn't tested it in the origin as well. So just a little dirty work-around.

Re: Popfetcher doesn't handle image in entry

Posted: Tue May 26, 2009 2:38 pm
by DwB
Now sending emails with more than one image couldn't be handled with the above code.
Instead get the size of the array $postbody and iterate through it. Use this code:

Code: Select all

                    $msgbody .= $postbody[0];
                    $this->stripText($msgbody);
                    for ($j=1; $j<sizeof($postbody); $j++)
                    	$msgbody .= $postbody[$j];