showing 5 entries from todays date?
Posted: 07 September 2004 05:06 PM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  193
Joined  01-21-2004

Hi all!

I’m trying to show a list of the last 5 entries from today’s date.  I’m not sure how to do this.  I think if you look at the code you can see what I’m trying to put together.

Here’s what I’ve tried so far….

{exp:weblog:entries weblog="lunch" display_by="day"  limit="5" category="5" show_future_entries="yes"}



On {entry_date format
=' %l, %F %d'} we are serving <b><a href="{title_permalink="main/lunch_details"}">{title}</a></b>.
<
br />

{/exp:weblog:entries}

What I’m getting is just the last 5 entries, not the last 5 from todays date.  Any suggestions would be warmly welcomed. 

Thank you!!

-Bill

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 07 September 2004 05:14 PM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

I’m not really sure, but perhaps something in this thread is appropriate?  I’m a bit tired so that may not be what you’re after… =)

 Signature 
Profile
MSG
 
 
Posted: 07 September 2004 06:34 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  193
Joined  01-21-2004

Thank you LisaJill!

I tried the suggestions but I still wasn’t able to grab the entries from today’s date; although the thread you linked to /is/ exactly what I am aiming for.

This is what I’m trying to do.

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 07 September 2004 06:35 PM   [ Ignore ]   [ # 3 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  193
Joined  01-21-2004

oops.  wrong url.  try this one: http://www.edgartown.mv.k12.ma.us/index.php/main/lunch/

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 07 September 2004 06:36 PM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

you linked back to this thread….

The solution to that was Chris’ baby, but if you can say WHAT about it didn’t work and the exact code you tried, I an give it a shot.. =)

 Signature 
Profile
MSG
 
 
Posted: 07 September 2004 07:13 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  193
Joined  01-21-2004

Hiya LisaJill grin

Here’s the code I just tried (taken from the post you noted)

<?php

global $LOC;
$current_time = date('Y-m-d H:i, $LOC->now);

?>

{exp:weblog:entries weblog="lunch" limit ="5" start_on="<?php echo $current_time; ?>"}

(I have php turned on input, and $current_time is being parsed correctly)

Instead of giving me what I want, which is 5 days of lunches from today’s date, I get the last 5 days of entries.

This is not a critical aspect of the site, but it would be neat for parents and kids to be able to see this weeks lunches. grin

tia!

Bill

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 07 September 2004 07:15 PM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

Oh!  It’s showing the past rather than the future… did you try setting show_future_entries=“yes” ?

 Signature 
Profile
MSG
 
 
Posted: 07 September 2004 07:20 PM   [ Ignore ]   [ # 7 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  193
Joined  01-21-2004

Ah…

I made sure show_future_entries, and the same thing…but now it’s showing only the last 5 entries I entered…not the 5 entries from the current date. 

Did you see the plaintext url I posted?  I think it shows what I want to do…


Thank you LisaJill, I really appreciate your help grin

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 07 September 2004 07:24 PM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

Yea I saw it, I understand what you want to do….  I have something similar happening on my event calendar but I only need the entries for the month showing, not just future ones, so I haven’t really delved into it. :(  I’m not sure why it’s doing that.. are there 5 entries in the nexxt 5 days?

 Signature 
Profile
MSG
 
 
Posted: 08 September 2004 03:51 AM   [ Ignore ]   [ # 9 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  193
Joined  01-21-2004

Hiya LisaJill

There sure are…I think I have about 7 from todays date (Sept 8th)

Thanks again!

-Bill

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 09 September 2004 05:20 AM   [ Ignore ]   [ # 10 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  193
Joined  01-21-2004

Hi LisaJill!

Any suggestions? grin  I’m sure it is straight forward, I can’t seem to see this solution.

Warmly,

Bill

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 09 September 2004 05:22 AM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

Unfortunately no; this eclipses my experience so I’m not sure.  Perhaps playing with the sort order may help, but I’m not sure.  I am curious if you didn’t have 5 entries in the past if it would show 5 entries in the future wink  But it’s a live site so playing with that may not be an option.

 Signature 
Profile
MSG
 
 
Posted: 09 September 2004 10:01 AM   [ Ignore ]   [ # 12 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Hm, this might work, but I will have to go create a bunch of test entries to go test it.

<?php

global $LOC;
$current_time = date(‘Y-m-d H:i’, $LOC->now);
$future_time = date(‘Y-m-d H:i’, $LOC->now+60*60*24*5);

?>

{exp:weblog:entries weblog=“lunch” limit =“5” start_on=”<?php echo $current_time; ?>” stop_before=”<?php echo $future_time; ?>” show_future_entries=“yes”}

 Signature 
Profile
 
 
Posted: 09 September 2004 10:14 AM   [ Ignore ]   [ # 13 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Seems to display five entries from the next five days for me.  bmackenty, if you could test it out, I would be much obliged.

 Signature 
Profile
 
 
Posted: 10 September 2004 04:12 AM   [ Ignore ]   [ # 14 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  193
Joined  01-21-2004

Brilliant.  Just right.

I had to make one very small change, though:

<?php

global $LOC;
$current_time = date('Y-m-d H:i', $LOC->now);
$future_time = date('Y-m-d H:i', $LOC->now+60*60*24*5);

  
?>


{exp
:weblog:entries weblog="lunch" limit ="5" start_on="<?php echo
$current_time; ?>"
stop_before="<?php echo $future_time; ?>" show_future_entries="yes"
[b]sort="asc"[/b]}

<a href="{title_permalink="main/lunch_details"}">{title}</a> <br />

{/exp:weblog:entries}

I added sort=asc, so the entries were in order. 
Please feel free to visit our school lunch page to see this wonderful code in action.

Thank you everyone!!

-Bill

 Signature 

http://www.mackenty.org
—————————————————————
Text-based gaming is alive and well!
http://community.pennmush.org

Profile
 
 
Posted: 10 September 2004 07:31 AM   [ Ignore ]   [ # 15 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  7534
Joined  08-05-2002

Ooo, nice.  You might consider putting the day of the week next to the lunch so they know which day it is coming exactly.

 Signature 
Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64939 Total Logged-in Users: 63
Total Topics: 81912 Total Anonymous Users: 37
Total Replies: 440330 Total Guests: 271
Total Posts: 522242    
Members ( View Memberlist )