02 Aug, 2002
Pre-post, but only have it show up when it's a "current" entry.
Posted by: Jennifer In: Scripts
(This script was originally written for Promoguy) The idea here is that you "pre-date" an entry. In Promo's case, he wanted to be able to write up his Monday Mission the day before, but not have it show up on his blog until it was actually Monday. Here's what you do:
Update 8/3/2002: (I've updated the script to a MUCH SIMPLER version thanks to PapaScott! It'll also let you control when the post shows up to the MINUTE!)
update 8/5/02: I've simplified the code further… I had some silly/stupid stuff in there before…
Step one:
"Install" the script below. (wanted to give you the instructions first, before I threw a bunch of code at you… so skip ahead to the code to do the installation…)
Step two:
Write your post, but save it as a draft.
Step three:
Once saved, you can edit the "date" of the post. Change the date to whatever day you want your post to actually show up.
Step four:
This time you save it, with "publish" as the Post Status instead.
That's it. It won't show up on your blog, until it's the date you set. (heh. I hope. Once again, only minimal testing has been done on this script… so, as always, use at your own risk)
NOW the code… There's alot of code (update: actually now there's ALOT less since I've updated it!), but no customization… you just need to copy and paste it in the right spot to get it to work… So, it's not as scary as it looks… ok? I promise. (the code below is shown as an example of what goes on the index template… additional code will probably be required if you use individual entries and you don't want to have it show the "next" entry (until it's the right time) on the previous post.) I'll put it on my "to-do" list, which just gets longer and longer…
After your <MTEntries> tag, put the code as you see it below (I included the MTEntries tag, just for reference…) (please see commented notes below for what goes where). The code you need to paste is in red (the "existing tags" are in black)
<MTEntries>
<?
if (time() > strtotime ("<$MTEntryDate format="%B %e, %Y %I:%M %p"$>"))
{
?>
<!– PUT THE REST OF YOUR MT TAGS FOR YOUR POST BELOW –>
<MTDateHeader>
<h2><$MTEntryDate format="%B %d, %Y"$></h2>
</MTDateHeader>
<a name="<$MTEntryID pad="1"$>"></a>
<h1><$MTEntryTitle$></h1>
<p><i><$MTEntryDate format="%I:%M %p"$></i></p>
<$MTEntryBody$>
<MTEntryIfExtended>
<p><a href="<$MTEntryLink$>#<$MTEntryID pad="1"$>">MORE…</a></p>
</MTEntryIfExtended>
<p align="right"><a href="<$MTEntryLink$>#<$MTEntryID pad="1"$>">permalink</a>
<MTEntryIfAllowComments> | <a href="<$MTEntryLink$>#comments">
<$MTEntryCommentCount$> comments
</p>
</MTEntryIfAllowComments>
</p>
<br>
<!— END OF ALL YOUR MT TAGS FOR YOUR ENTRY –>
<!– Make sure you add the next little lines below BEFORE your put your "/MTEntries" tag. –>
<? } ?>
</MTEntries>
Let me know if you run into any problems, so I can try to fix the script.