ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Mo-Moproblems with the MoBlog - Part 2

January 15, 2011 2:01am

Subscribe [4]
  • #1 / Jan 15, 2011 2:01am

    Robfletcher

    149 posts

    So, I finally got this working semi-good.

    I made a PHP form that has a title field, description textarea, and fileupload type.

    User fills these out and hits submit.

    The form is connected to a PHP Script that grabs the title, description, and image and emails it to an email address.  The title is subject, the description is the body, and the image is the attachment.

    The moblog brings in the content in the correct fields now too. yippee!

    I have subject dropping into the title field, the body dropping into the description field, and the image dropping into its own field.  I made the image field the default field.

    All this is working! But there is one small problem, one problem that is so annoying and i don’t know how to fix it. I am someone out there knows how to fix this.

    So, in EE CP I edit my entry to see what the data is…Here is what it looks like:
    For example: https://ellislab.com/asset/images/pronet-logo/0219091509.jpg

    But, in my template on the page, for whatever reason when an entry comes in through the moblog it wraps the attachment with a tag.  So, in my HTML when i view the source I see this in my img=src”” tag.

    <a href="http://mydomain.org/UploadFiles/filedir4/0219091509.jpg">http://mydomain.org/UploadFiles/filedir4/0219091509.jpg</a>

    This is causing the images to be broken. Sucks. I’m almost there.

    Any advice?

    p.s. I have also already set the field format type to “none”. And i set the channel option so that img urls are not allowed because i want to wrap the URLS with my own img tag.  Eventually going to link up phpThumb to do some thumbnail stuff.

    Thanks in advance!

  • #2 / Jan 15, 2011 5:30pm

    Greg Salt

    3988 posts

    Hi CDPRfletcher,

    If you look in the DB (exp_channel_data table) are these paragraph tags in the saved data? Had you already saved this data before changing the field format to ‘none’?

    Cheers

    Greg

  • #3 / Jan 16, 2011 2:22am

    Robfletcher

    149 posts

    I checked and they are not in the saved table data.

    I have the format set to none and everytime i post something through the form the entries get the tags. I don’t have any tags when i submit via the control panel in the Publish tab.

    Is this issue with the moblog?

  • #4 / Jan 16, 2011 5:38pm

    Greg Salt

    3988 posts

    Hi CDPRfletcher,

    Which version and build of EE are you using on this site?

    Cheers

    Greg

  • #5 / Jan 16, 2011 6:52pm

    Robfletcher

    149 posts

    Sorry, I included all of that in the original post about the moblog that i made but i don’t see the reference link to that thread anymore.

    Here is my server specs:

    Windows Server, IIS7, PHP5, EE2.1.3 (i just recently updated my EE2 install.)

    Basically, what i have done is found that if I submit an entry through the EE2 CP, it works fine. It doesn’t add the tags.

    IF i submit anything through the Moblog, I get the contents wrapped in tags regardless of what the settings are in the CP for the Moblog settings.

    I’ve checked the Channel -> Custom Fields settings for the field i am submitting the image too and I’ve tried both <br> and NONE.  It doesn’t matter which one its set too when the Moblog captures the data and the entry is added it will still add “” around my image URL in my entry.

    I have everything set to NONE and i am going to run some more tests.

    Can u tell me what all places I need to set the permissions for a single field to accept “no” formatting?

    Not sure what is causing this at all.

  • #6 / Jan 17, 2011 9:43am

    Sue Crocker

    26054 posts

    Can u tell me what all places I need to set the permissions for a single field to accept “no” formatting?

    Are you talking about from a PHP coding standpoint, or a database standpoint?

  • #7 / Jan 17, 2011 10:04am

    Robfletcher

    149 posts

    I meant within the EE2 control panel.

    I did some more tests late last night. The test i did last night was i open gmail, sent an email to my special email address with a photo attached, sent it.

    I go to my website and I see the image doesnt show up. The file is on the server and the message is in my blog.

    But because it came from the moblog, it doesn’t show up.

    However, I can only get the photo to appear if I go to the EE2 Control Panel and go to the Custom Field Settings for that particular field and if i change the format to either
    or NONE (I need to change it from one or the other to get that checkbox to appear where it will update all existing fields. I check that checkbox), hit submit.

    I go to my blog and TADA the image appears.

    So, is this a bug?

    Seems like the textarea field that i want to embed an image into is always locked into XHTML mode (or something else) that wraps the URL with an HTML paragraph tag.  When i really just want that field to have a format of NONE from the get go.

    What do you think?

    Could you try to replicate this error on your side? 

    And could you tell me all of the places in EE2 Control Panel where I should make the format style equal to NONE. I might be missing it somewhere.

  • #8 / Jan 17, 2011 10:06am

    Robfletcher

    149 posts

    oh yeah and another test i did was i wrote a short PHP script that removes the HTML paragraph from around the URL using PHPs strip_tags parameter. Then i drop my url variable into a <img > tag. This still doesn’t change anything. The image still doesn’t show up.

    I don’t understand what’s going on. :(

  • #9 / Jan 17, 2011 2:09pm

    Robfletcher

    149 posts

    any chance someone can report back to me on this? This is quite a mystery.  Can you open this up as a bug?

    What other information do you need from me?

  • #10 / Jan 17, 2011 3:56pm

    Robfletcher

    149 posts

    hmm, well here is the Moblog Template I am using.

    {field name="AdDescription" format="none"}
    {text}
    {/field}
    
    {field name="AdMoBlogImage" format="none"}
    {images}{file}{/images}
    {/field}

    Does this look correct? Everything is getting dropped into the right fields, it just outputs the img URL with a paragraph tag wrapped around it.  This, as you can imagine, breaks the img src tag.  but like i also said if i then go to the settings for that custom field and switch it from either “none” or “
    ” and tell it to update all fields currently, that will allow the images to be displayed.

    Naturally that’s not how someone would expect it to work.

    Anything else that i can do? got some suggestions?

  • #11 / Jan 18, 2011 3:38am

    John Henry Donovan

    12339 posts

    CDPRfletcher,

    I can’ replicate this locally. Can you check your email please

  • #12 / Jan 18, 2011 11:57am

    Robfletcher

    149 posts

    I did and just replied. Thanks.

  • #13 / Jan 18, 2011 12:48pm

    Robfletcher

    149 posts

    I was looking at the exp_channel_data table and looking at the data.

    I have a column called field_id_16 which contains my image url in it and then there is a field_ft_16 field and in all of the fields except the very last one (which consequently is the one that does not display) there is a NULL value instead of “none” in that field.

    Could this be the problem?  Maybe if i submit from the moblog i’m getting a blank value in that field which is not telling the other field what type of formatting to use?

    could that be the problem?

  • #14 / Jan 18, 2011 4:52pm

    Robfletcher

    149 posts

    I didn’t hear from anyone today so I decided to run a simple test. My suspicion from my last is correct.

    I send an email to my special email address, attach an image and send it. I go to my moblog preference screen and click “check” button.

    I go to the website, hit refresh, the image is broken like it was before.

    I then go to mysql Administrator, check exp_channel_data and i see field_ft_17 has a null value when it should say “none” in it.  That field is not being populated automatically.  So, i manually type in “none” in the field_ft_17 and apply those changes.

    I go back to my website, hit refresh, the image appears.

    How to fix it so it fills in “none” into that field? That is the problem.

  • #15 / Jan 18, 2011 5:17pm

    Robfletcher

    149 posts

    Something else I just realized is that when I click the “Check Moblog” link in the EE2 CP, the little loading icon just keeps going and going. It never actually stops. Perhaps its getting hung up somewhere in its operations.  This occurs only when i specify a default field to insert data into. In this case, I selected the Image field as the default field.  The moblog template handles putting the text into the description field. 

    This is also weird. If i choose the description field as the default field then the text + the image get dropped into the description field.

    If i set the image field (its a textarea) to the default then i can get the image to go in it and the text goes in the description.

    I use the same template in the preferences and can only get it to work this way.

    Now if only we can get the field_ft_17 to get its value then everything will be peachy.

    HELP!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases