Order or Sort by question
Posted: 08 July 2005 02:57 AM   [ Ignore ]  
Research Assistant
RankRankRank
Total Posts:  349
Joined  05-22-2005

I have a weblog and it has a calendar, which works fine. I would like to display, above the calendar, the next 7 entries, starting with the current day, but having trouble. I can have the next 7 entries appear, but they start at the first entry, not the current day.

I was using this:

{exp:weblog:entries weblog=”{master_weblog_name}” display_by=“day” limit=“7”
sort=“asc” show_future_entries=“yes”}

So I want only the current date, followed by the entries for the next 7 future days, make sense?

How do I do it?

Profile
 
 
Posted: 08 July 2005 09:38 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
RankRankRank
Total Posts:  349
Joined  05-22-2005

No takers?

Profile
 
 
Posted: 08 July 2005 10:09 AM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  06-19-2002

Have some patience, Andy!  You originally posted at 4am for me, 2am for Rick and Paul, so pretty much everyone in the US was asleep for several hours there. [grin]

The secret for you here is to use the “start_on=” parameter to set the starting date to “today”.  You’ll need to enable PHP in the Template and set it for “input” parsing.  Then use something like:

<?php
global $LOC;
$current_time = gmdate('Y-m-d H:i A' , $LOC->now);
?>

{exp
:weblog:entries weblog="{master_weblog_name}" display_by="day" limit="7"
sort="asc" show_future_entries="yes" start_on="<?php echo $current_time; ?>"}

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 08 July 2005 12:58 PM   [ Ignore ]   [ # 3 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  33276
Joined  05-14-2004

Wiki’d.

 Signature 
Profile
MSG
 
 
Posted: 10 July 2005 01:25 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
RankRankRank
Total Posts:  349
Joined  05-22-2005

Hello Chris and thanks. Sorry for not being patient, thought you guys never slept.

That worked great, but…
Now the calendar that is just below doesn’t display the date, but the tag instead.

The code in the calendar, at least the top part, is:

<div class=“titleKids”>Детская программа</div>
{exp:weblog:calendar switch=“calendarToday|calendarCell”
show_future_entries=“yes”}
<table class=“calendarBG” border=“0” cellpadding=“2” cellspacing=“2”>
<tr>
<th class=“calendarHeader”>
<div class=“calendarMonthLinks”><a href=”{previous_path=fun/index}”><<</a></div>
</th>
<th class=“calendarHeader” colspan=“5”>{date format=”%F
%Y”}</th>

What can I do? Can I close that php code in the exp before it, and would that help? If so, how, I know squat about php. I placed the clobal you gave at the top of the page, was that right? It did work.

Thanks again. cool smile

Profile
 
 
Posted: 10 July 2005 09:03 AM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  06-19-2002

The code I gave you already had the PHP “closed”.  However, you need to make sure you close that {exp:weblog:entries} tag before you use the {exp:weblog:calendar} tag.

 Signature 

Chris Curtis
chriscurtis.org

Profile
 
 
Posted: 10 July 2005 09:11 AM   [ Ignore ]   [ # 6 ]  
Research Assistant
RankRankRank
Total Posts:  349
Joined  05-22-2005

Thanks Chris, yes, it is closed yet I still have the problem. I have a calendar on every page that displays correctly, only on the page where I added your code is there a problem.

To make sure, the opening global goes at the top of the page right?, then I only added your code (copy and paste) so I know its right.

Profile
 
 
Posted: 10 July 2005 09:44 AM   [ Ignore ]   [ # 7 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  9853
Joined  06-19-2002

That PHP can go anywhere in the Template before the {exp:weblog:entries} tag where you echo out the PHP variable.

Can you link to a page where you’re having the problem so that we can see it?  Also, copy the full code for that Template to a text file and then attach it here or link to it on your server so that we can compare what we see to your Template code.

 Signature 

Chris Curtis
chriscurtis.org

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: 66467 Total Logged-in Users: 25
Total Topics: 84861 Total Anonymous Users: 15
Total Replies: 455331 Total Guests: 164
Total Posts: 540192    
Members ( View Memberlist )