Help - Search - Members - Calendar
Full Version: Automatic Scheduled Posting
Movable Type Community Forum > Additional Resources > Tips and Tricks
Songdog
I will be away on vacation, computerless, for a few weeks and would like to schedule a few entries to be auto-published during my trip. I know that I can pre-date the entries, but unless someone rebuilds for me I assume they won't appear. Has anyone worked out a completely automatic way to publish entries on future dates?
medic119
There is a plugin just for this.  I can't remember the name but just search the Plugins forum.
kadyellebee
I don't know if I've seen a plugin to do this, but I know that the ScriptyGoddess site has this:Scripts: Pre-post, but only have it show up when it's a "current" entry.

Hope that helps!
Kristine
Songdog
Thank you both! The script Kristine suggested looks like it should work, so I'll give that a try and report back.
medic119
Thants the thing I was taling about.  For some reason I thought it was a plugin....
Songdog
Works like a charm! It took me a while to try it; I've been busy. But thank you for the suggestion!

I have only one frustration, and it's a small one: my pings get sent out when I initially publish the entry. It'd be nice if they could get sent out when it went live. I can't think of an easy way for Ben and Mena to implement this one, but it'd be nice ... wink.gif
Michael Greenhalgh
The Script Goddesses are great for this kind of thing, but there is one warning to go with the pre-date code. It relies on your server time, as opposed to your local time, which means that when I implemented it, two entries I'd just made vanished because my server time was obviously behind my own time.

I was actually here to see if anyone could suggest a workaround for this, as I would really like to use it.
kadyellebee
I posted a possible fix over there - untested as I haven't played with this script before, but it might help someone - it involves replacing the top php code with this:
CODE
<?
$time = date("F d, Y h:i A", strtotime("-3 hours"));
$mttime = strtotime("<$MTEntryDate format="%B %d, %Y %I:%M %p"$>");
if ($time > $mttime)
{
?>

Basically what it does is allow you to set an offset of -3 hours because its based on the date() code instead of the time() code.  And I compared MT's date formats with the PHP date formats to get the funky letters in there smile.gif

Kristine
kadyellebee
Okay, so I missed a step in this.  Try this instead:

CODE
<?
$time = date("F d, Y h:i A", strtotime("-3 hours"));
$mttime = date("F d, Y h:i A", strtotime("<$MTEntryDate format="%B %d, %Y %I:%M %p"$>"));
if ($time > $mttime)
{
?>

I believe that is going to be more likely to work because it puts both of them in date format - the original was just giving me a unix timestamp so the comparison wasn't helpful.

Kristine
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.