WordPress.org

Ready to get started?Download WordPress

Forums

Floating images, wrapping text: Postie challenge (3 posts)

  1. vnomad
    Member
    Posted 7 years ago #

    Greetings!
    I'm getting ready to hit the road where I post by email using Postie to retrieve my words of wisdom and images.

    The posts look better when the text flows around the images, so I added classes to wrap right or left in layout.css, in the entry section:
    `.entry .il
    {
    size: auto;
    float: left;
    margin:0 12px 0 0;
    }`

    Then, as an example, in my post I write this to float an image fetched by Postie:
    `<div class = "ir">
    #img1#
    *Click to see at full size*
    </div>`

    This works fine when I go to Postie in the CP options and manually fetch the email. However, the formatting code is stripped from the post when it is fecthed using cronless Postie and several other strategies to automate the posting-by-email. (unfortunately I do not have access to Crontab on my server so I have not tried that)

    To see me messing aroung with this can of worms you might take a peek at my WordPress 2.2 at:
    http://www.afoto.com/wordpress

    When fetched manually, the emailed post shows this html for the image: `
    <div class = "ir"> <!--Mime Type of File is image/jpeg --><div class="postie-image-div"><img src="http://www.afoto.com/wordpress/wp-photos/thumb.20070602-152132-1.jpg" alt="phenomOnMk.jpg" title="phenomOnMk.jpg" style="border: none;" class="postie-image" /></div> *Click to see at full size* </div>`

    But when fetched with automation my div tag for the image is stripped, somehow, somewhere parsed out . . but WHY?

    I'll be experienting a bit more to make this work, but maybe someone here can point me in the right direction?

    TIA,
    Dagfinn

  2. vnomad
    Member
    Posted 7 years ago #

    OKOKOK! It turns out that you need to run Postie with a cookie set- i.e. from the CP or from a browser that still has a valid cookie to offer. When Postie is croned, there is no cookie of course, and so lots of styling and stuff is parsed out in the process, I presume for very valid security reasons.

    My solution was to crone a "robot" user agent that will first log in to WP as admin to get a cookie set in its cookieJar, and then GET Postie. This way the CSSses, custom <DIV>s etc. stay put, and now my images are floating and the text is wrapping according to my custom classes.

    I'm sure someone who knows WP better will be making a more elegant solution to this, ah, feature.

  3. suedti
    Member
    Posted 6 years ago #

    Hi vnomad!

    I´m having the same problems.
    Could you post your "robot"-script so I can try if it works also with me?

    thanks

    suedti

Topic Closed

This topic has been closed to new replies.

About this Topic