IPB

Welcome Guest ( Log In | Register )

Movable Type

We're moving to movabletype.org!

At long last, we're moving to forums powered by, well, Movable Type itself. You'll want to bookmark http://forums.movabletype.org/ for future reference, and in the meantime you can view these old forums as a read-only archive of past posts. Thanks for being part of the community!

 
Reply to this topicStart new topic
> Displaying Entries From The Current Date Forward?
aejordan
post Jun 13 2008, 12:42 PM
Post #1





Group: Members
Posts: 22
Joined: 19-January 03
Member No.: 6,449



I'm transitioning a site to MT4. We use it as a CMS and one of the features is an event calendar. To get the calendar, events are published on the date they will occur (i.e. in the future). I used to be able to use the SomeDays plugin to display entries from [today] forward; however, that plugin isn't compatible with MT4. So far I've been pretty successful figuring out how to replace functionality from old plugins with the improved functionality in the template tags, but I'm still working on this one.

It seems like I should be able to use an If statement...if the date is equal to or greater than today, then publish these events. But I can't figure out how I would tell it to look at today's date.

It would be a time-saver if someone else already knows how to do this! Thanks.

Angela
Go to the top of the page
 
+Quote Post
Su-
post Jun 13 2008, 04:00 PM
Post #2





Group: Members
Posts: 1,665
Joined: 15-June 06
Member No.: 35,860



QUOTE (aejordan @ Jun 13 2008, 03:42 PM) *
I used to be able to use the SomeDays plugin to display entries from [today] forward; however, that plugin isn't compatible with MT4.

Says who/what?
Just making sure you're not assuming this in absence of a definite statement one way or the other(Which I don't recall seeing.) If you've actually already tried using the plugin and it didn't work, that's obviously another matter, and have you tried contacting Chad about it? But it's relatively uncommon for a strictly code-based plugin like this to break on upgrade.
I haven't used it with a 4.x install myself, unfortunately, so couldn't say.

This post has been edited by Su-: Jun 13 2008, 04:02 PM
Go to the top of the page
 
+Quote Post
aejordan
post Jun 15 2008, 05:43 AM
Post #3





Group: Members
Posts: 22
Joined: 19-January 03
Member No.: 6,449



QUOTE (Su- @ Jun 13 2008, 07:00 PM) *
QUOTE (aejordan @ Jun 13 2008, 03:42 PM) *
I used to be able to use the SomeDays plugin to display entries from [today] forward; however, that plugin isn't compatible with MT4.

Says who/what?
Just making sure you're not assuming this in absence of a definite statement one way or the other(Which I don't recall seeing.) If you've actually already tried using the plugin and it didn't work, that's obviously another matter, and have you tried contacting Chad about it? But it's relatively uncommon for a strictly code-based plugin like this to break on upgrade.
I haven't used it with a 4.x install myself, unfortunately, so couldn't say.


Good point. I had the plugin installed in the previous 3.17 installation, and when I upgraded that installation to 4.1 it (and many other plugins) no longer worked - as in they caused errors during rebuilding. I've subsequently made a clean install and imported the data from the old install. I suppose it's possible that SomeDays might work on the clean install. Doesn't hurt to try it out.
Go to the top of the page
 
+Quote Post
aejordan
post Jun 15 2008, 06:43 AM
Post #4





Group: Members
Posts: 22
Joined: 19-January 03
Member No.: 6,449



UPDATE: I installed the SomeDays plugin, and while it's not throwing any errors during the rebuild process, it's also not working. I've tried different combinations of tags, but it generates no output. Doesn't make sense.
Go to the top of the page
 
+Quote Post
aejordan
post Jun 17 2008, 06:32 PM
Post #5





Group: Members
Posts: 22
Joined: 19-January 03
Member No.: 6,449



So here's the code I've tried to use instead, and this doesn't work either. Does it have something to do with the fact that what's being compared is of numeric value?? And yes, I've checked to make sure that there are actually entries that would be output with these criteria.

<mt:SetVarBlock name="SystemDate">
<mt:Date />
</mt:SetVarBlock>

<mt:If tag="EntryDate" eq="SystemDate">
<MTEntries category="Calendar">
<p><$MTEntryDate format="%b %e"$> <a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></p>
</MTEntries>
<mt:Else>
<mt:If tag="EntryDate" gt="SystemDate">
<MTEntries category="Calendar">
<p><$MTEntryDate format="%b %e"$> <a href="<$MTEntryPermalink$>"><$MTEntryTitle$></a></p>
</MTEntries>
</mt:If>
</mt:Else>
</mt:If>
Go to the top of the page
 
+Quote Post
OtherNiceMan
post Jun 17 2008, 10:59 PM
Post #6





Group: Members
Posts: 2,039
Joined: 4-January 04
From: UK
Member No.: 19,351



At the moment you are comparing two strings, this is probably the problem, I need to double check the if syntax. What you need to do is convert the dates to 'numbers'.

Change the system date format to %Y%m%d this outputs the date in ISO8601 format, without any separators this becomes a number (20080618 is today's dates), in this format you can use GT, LT easily.





--------------------
Rob Kenny
The Composing Stick Movable Type Tricks & Tips
Twitter|Flickr|Vox
Sites I manage: Darren Kenny: Professional Cyclist O.B.E
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 11.25.09 - 01:06 AM