Created
August 12, 2008 17:22
-
-
Save markpasc/5094 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mt:Order> | |
<mt:Entries lastn="10"> | |
<mt:OrderItem> | |
<mt:SetVarBlock name="order_by"><mt:EntryDate utc="1" format="%Y%m%d%H%M%S"></mt:SetVarBlock> | |
<mt:Include module="Entry"> | |
<mt:SetVarBlock name="last_entry_yday"><mt:EntryDate format="%j"></mt:SetVarBlock> | |
<mt:SetVarBlock name="last_entry_year"><mt:EntryDate format="%Y"></mt:SetVarBlock> | |
</mt:OrderItem> | |
</mt:Entries> | |
<mt:SetVarBlock name="current_yday"><mt:Date format="%j"></mt:SetVarBlock> | |
<mt:If name="current_yday" lt="last_entry_yday"> | |
<!-- Account for dates crossing the year boundary --> | |
<mt:SetVarBlock name="last_entry_last_day_of_year"><mt:Var name="last_entry_year">1231000000</mt:SetVarBlock> | |
<mt:SetVarBlock name="last_entry_days_in_year"><mt:Date name="%j" ts="$last_entry_last_day_of_year"></mt:SetVarBlock> | |
<mt:SetVar name="current_yday" op="add" value="$last_entry_days_in_year"> | |
</mt:If> | |
<!-- Calculate how many days ago the last entry was --> | |
<mt:SetVarBlock name="days_of_entries"><mt:Var name="current_yday"></mt:SetVarBlock> | |
<mt:SetVar name="days_of_entries" op="sub" value="$last_entry_yday"> | |
<mt:ActionStreams days="$days_of_entries"> | |
<mt:OrderItem> | |
<mt:SetVarBlock name="order_by"><mt:StreamActionDate utc="1" format="%Y%m%d%H%M%S"></mt:SetVarBlock> | |
<mt:Include module="Action"> | |
</mt:OrderItem> | |
</mt:ActionStreams> | |
</mt:Order> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment