We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Some Moblog Questions

Development and Programming

Deron Sizemore's avatar
Deron Sizemore
1,033 posts
17 years ago
Deron Sizemore's avatar Deron Sizemore

I am using the Freeform module to allow visitors to upload a photo to the photo gallery portion of the site. Once uploaded, a new entry is created and marked as “pending” so that I can review it.

This all works great except for that moblog isn’t automatically checking the moblog email address for new submissions. I’ve went as far as setting the “time between checks” interval to “1” which as I understand it, will check for new emails every “1” minute? That doesn’t seem to work either. The only way I’ve been able to get it to work is to actually go into the Modules tab of the CP, click on moblog, and then “check moblog.” Once I manually check, it inserts the new entry just like it should.

Also, is there any way that I can be notified at my main email address whenever a new entry has been submitted??

Thanks, Deron

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hi Deron,

Me again!! 😉

That got me the first time I saw it as well. You can set up a template in EE that has the Check Moblog Tag in it to do what you need. There is no actual automation to this side of things but if you have a very simple template with that tag in it then you could always run a cron job to hit this template at times that you specify.

I thought the exact same thing when I saw that and thought it would auto-check but what it actually means is that if you say checked using the tag at 12:00 then you quickly checked again at say 12:00:10 (10 seconds later) then it wouldn’t do anything. You would have to wait until 12:01 for it to work again.

Make any sense?

Glad you are getting it all working now though.

Best wishes,

Mark

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
17 years ago
Deron Sizemore's avatar Deron Sizemore

Oh, that stinks! 😊

Well, what about this. I’m using Freeform (as you know), and I’ve got a custom “thank you” page set up so that once the form is submitted, it returns “thank-you”. I could simply place the check moblog tag inside of the “thank-you” template and then set the time between checks interval to “1” or maybe even “.1” if that would work? So once the form is submitted, it automatically checks the moblog. That would work wouldn’t it?

Also, what about receiving an email notification to my main email address when someone posts an entry through the moblog? Is that possible? I went to my “notification preferences” in the weblog and set it to enable recipient list when new entry is posted and put in my email, but that doesn’t do anything in this case when using moblog.

Thanks again

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

Now you’re thinking! 😉

The only problem with that is that it may not pick up the image that was just uploaded. As soon as the image has sent via the form that is when the moblog e-mail will be received so to say on the server end. If you are then going right away to a page that checks the moblog then you may or may not have success. Probably best to give it a few tries and see what you get.

As to the recipient list thingy. I didn’t think the moblog preferences had one, do they?

If you are instead talking about the Freeform form then you can use the notify=”[email protected]|[email protected]” parameters to enable you to receive a notification if that’s what you mean?

And you thought it was going to be easy? 😉

Hope that helps?

Best wishes,

Mark

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
17 years ago
Deron Sizemore's avatar Deron Sizemore

That may be the easiest way to do it. I just didn’t know if moblog had that functionality (guess not 😉) and didn’t know if there was a way to be notified by setting the notification preferences in the weblog administration area… because there is that page when you view the preferences of your weblog that will let you notify an email address each time a new entry is submitted, but I guess that it means when submitted through the control panel and not moblog.

Thanks Mark, I’ll give all of these a try.

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

No problem. Let me know how you get on 😉

Best wishes,

Mark

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
17 years ago
Deron Sizemore's avatar Deron Sizemore

Ok, I’m back from testing.

Adding my email to the notify list along with the moblog email works great. The only downside to this is that I added a couple more variables to the notification email freeform template so that I could see who uploaded the image and what their email address is:

Submitted on: {entry_date} Name: {name} E-Mail: {email} Gallery Image Name: {imageName} Gallery Image Description: {imageDescription} Attachment: {attachments}{filename}{/attachments} —————————————————————————————— {entry_title}{imageName} {imageDescription}{/entry_title} {field:gallery-image}https://ellislab.com/asset/images/ent-partner-logo/{attachments}{filename}{/attachments}{/field:gallery-image} {field:gallery-image-name}{imageName}{/field:gallery-image-name} {field:gallery-image-description}{imageDescription}{/field:gallery-image-description}

and when I get the notification email, it also includes the stuff at the bottom (below the “——”) which is only needed for the moblog. But I can deal with it being at the bottom of the email. The important thing is that I get notified when a new entry is submitted.

Now, I went to my “thank-you” template and inserted this line:

{exp:moblog:check silent="true" which="gallery"}

I then went to my moblog preferences and set the time interval check to “0” at first and then when that didn’t work I set it to “1” thinking that maybe “0” wasn’t allowed? Still no automatic update with submitting the entry into the gallery weblog under the “edit” tab. Once I go manually “check moblog” it finds the entry and shows up, but not until then.

Is there still something I’m missing here?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

Hiya,

The tag should definitely work but sometimes you do have to hit the template with that tag a couple of times before it registers. If the moblog e-mail has only just been sent then it (the tag) probably won’t update the moblog until a minute later. That is where you are having problems I think.

I know what you want, you want it to be immediate but then you would need a process running on your server 100% of the time to check the moblog and this would probably end up taking an inordinate amount of processing time so not really an option.

I’m not sure that you can set the preference in the moblog to 0 as that would pretty much mean check forever but as this is more of a manual process then it probably wouldn’t make much sense either. I couldn’t see anything in the documentation about that number though so one of the EE admin folk would probably be able to answer that better.

The way I use my moblog is probably not what you want but I have an un-read mail widget on my computer that alerts me to when new moblog e-mails have come in and then I go and check them using the tag. This way it always finds a new entry as it has definitely already been received on the server end. The best I can think of is to set up some sort of cron job to hit that template every minute or so but that still I would think is going to put a slight strain on your system.

Also if you have people uploading images to a gallery I would think that you want to check them first to ensure that no-one has uploaded anything distasteful and so this would mean a manual check anyway?

Sorry that I can’t be of more help on this one but I don’t think that the moblog was ever meant to be a totally automated process but then maybe one of the EE admins can pop in here with some other ideas on this.

Hope this helps a bit though.

Best wishes,

Mark

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
17 years ago
Deron Sizemore's avatar Deron Sizemore

No, you’ve been a huge help Mark.

If that’s how the module works, not much I can do about it. I do have the notification email working now, so that when new entries are submitted, I get a notification email so I have to go in and mark the entry to “open” anyway so it’s essentially one extra click to go manually press the “check moblog” button. No big deal. I’m just trying to be as lazy as possible here. 😉

Thanks Mark. Again I appreciate everything.

Do you think setting the time check interval in the moblog preferences to “1” would take up to much resources? Is it more idea to set it to something like “10” or “15”?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen

No problem with the help. Always ready to help out a fellow EEer (Hmm think i just made up a word there! 😊 ) whenever I can 😊

As to that being the way it works I could be wrong but that is the way that it has always seemed to me and I have never come across anything in the documentation to say otherwise but hopefully one of the EE crew can come in here to confirm the exact operation of the module though.

As to the time check period this is another one that I never really got although I think that is due to the way I am using the module though. As I know when the e-mails are there I just set it to the lowest value I could so that I could always get the moblog entries when I needed. If someone posted at say 10:00 and then someone else at 10:05 I may already be in the process of getting the first moblog entry and this way I can get the other one fairly quickly also.

I’d say though that if you are auto-closing the status on an entry so that you can check the items first though then this is probably the best option as it is only one click after all! You really are getting lazy aren’t you 😉 😉

Hope you get everything going the way you need. Any more help you need then you know where I am.

Best wishes,

Mark

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
17 years ago
Deron Sizemore's avatar Deron Sizemore

Well it looks like placing the moblog check tag inside of the “thank-you” template works, BUT (there’s always a but, right?) only after you refresh. Once you click submit on the form, the thank-you page loads, but that doesn’t trigger the moblog check tag for whatever reason. If I refresh that page, then it works. Go figure.

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
17 years ago
Deron Sizemore's avatar Deron Sizemore

Ok, ran into another snag here.

It seems that two images are being uploaded here. What happens is that the FreeForm is filled out and then submitted. I get a notification email sent to the moblog email as well as my personal email so I know when a new image is uploaded. Nothing fancy. As soon as I click submit on the form, if I check my remote server, the image is uploaded instantly (as it should be). Then, I go into the moblog module and click “check moblog” to retrieve the new entry. It finds the entry and places it into the Edit tab under the “gallery” weblog and sets it to “pending.” I notice then, if I go back and check my remote server, at this point (once I click “check moblog”) it uploads another identical image to the directory. So, if my first initial image is called “test.jpg” once the moblog is checked, it will upload a second identical one called “test1.jpg.”

Not sure why this is happening?

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen
Well it looks like placing the moblog check tag inside of the “thank-you” template works, BUT (there’s always a but, right?) only after you refresh. Once you click submit on the form, the thank-you page loads, but that doesn’t trigger the moblog check tag for whatever reason. If I refresh that page, then it works. Go figure.

Hi Deron,

As I mentioned before I don’t think you will get it to work in this way. If you think of it in this way. You send the form and upload the image. As soon as that has happened you are returned back to the page with the Check Moblog Tag on it. The e-mail by this time may not have reached the server and also as the tag has never been run before the 1 minute or whatever you set it to won’t come into play until the next time that you refresh the page. That’s the way I have noticed it to work anyway.

Hope that helps a bit?

Best wishes,

Mark

       
Deron Sizemore's avatar
Deron Sizemore
1,033 posts
17 years ago
Deron Sizemore's avatar Deron Sizemore

Hey Mark, sorry I guess I just wasn’t totally following what you were saying earlier in the thread and to be honest, I’m still not sure if I completely understand the time interval stuff. Maybe like you, it’s because of how I’m using the moblog module?

Do you have any idea about the double upload of the image? It’s still doing this after removing the moblog check from the “thank-you” template, so I don’t think that was causing the problem.

Thanks Mark

       
Mark Bowen's avatar
Mark Bowen
12,637 posts
17 years ago
Mark Bowen's avatar Mark Bowen
Hey Mark, sorry I guess I just wasn’t totally following what you were saying earlier in the thread…

That would be because I ramble on a lot 😉

As to your problem with the double image post I’m not really too sure what is going on there at all. I don’t know if this helps at all but I have included the code from my Freeform template here below just in case it fires anything off at all?

{field:photos-body}{photos_body}{/field:photos-body}

{field:photos-tags}{photos_tags}{/field:photos-tags}

{field:photos-download}{attachments}{filename}{/attachments}{/field:photos-download}

{field:photos-photographers-name}{photos_photographers_name}{/field:photos-photographers-name}

{field:photos-id}{photos_id}{/field:photos-id}

As to understanding the moblog check time I am hoping that one of the EE admin crew can come in here to explain that a little better than I can. I am pretty sure in my own head that I understand the concept but being able to put that into words is proving a little difficult at the moment.

Any EE admins listening at all?

Anyway hope you get it all sorted out soon.

I feel like it’s all my fault that you are having these problems as I was the one that said doing this was an easy way to upload images and get an entry into the EE system. It is though honest! 😉

Best wishes,

Mark

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.