span_dates parameter
Posted: 14 August 2007 07:46 AM   [ Ignore ]  
Lab Assistant
Avatar
RankRank
Total Posts:  223
Joined  01-14-2006

I’d like to request a span_dates=“yes” parameter on the weblog module (or Archive Month links), primarily for building events calendars with EE.

with the monthly archives, I’d like to display an entry with a post date of 10th June, that expires 22nd August to be displayed in the June, July and August monthly archives for that weblog.

currently EE will only display it in June as thats the start date… not very user friendly for an events calendar.?.?.

I’ve tried the repeet plugin, but it seems to list the event 30 times per month (as the event is on every day)... see this post here.

sorry if this has been discussed before but 4 hours of trying to get this to work is driving me insane,

Iain.

 Signature 

Weblog | New Zealand Web Design Agency

Profile
 
 
Posted: 31 August 2007 10:39 AM   [ Ignore ]   [ # 1 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  223
Joined  01-14-2006

Sorry but I’m desperately needing this feature guys..

If anyone thinks that they would be able to code a plugin that could do this, i’d be more than happy to donate and release to the community… I’m running out of time to deliver this for a site launch this month.

cheers

Iain.

 Signature 

Weblog | New Zealand Web Design Agency

Profile
 
 
Posted: 31 August 2007 10:56 AM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32911
Joined  05-14-2004

Hi, Iain - I would recommend posting on our Job Board or contacting some of the folks on our Pro Network to get this done, or get help with Repeet, which I do believe should handle this.

 Signature 
Profile
MSG
 
 
Posted: 31 August 2007 01:29 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
RankRankRank
Total Posts:  845
Joined  08-05-2005

I’d like to see an events module even more than a commerce module for exactly this reason.  I need this kind of functionality regularly.

Profile
 
 
Posted: 11 September 2007 09:31 PM   [ Ignore ]   [ # 4 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  223
Joined  01-14-2006

Very surprised that I’ve had no input on the two posts i wrote about this, so i hope this is $20 well spent…

 Signature 

Weblog | New Zealand Web Design Agency

Profile
 
 
Posted: 13 September 2007 11:56 PM   [ Ignore ]   [ # 5 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  223
Joined  01-14-2006

not sure if i should post this here,

I’ve kinda come up with a hacked up sql query for having the events span months accross the monthly archives. Seems to work but i’m sure its far too resource intensive and spanning accross december through January doesn’t work. Also, having month hyperlinks that have passed the current time removed from the monthly archive would be a great bonus.

If anyone can help refine this I’d be very, very, very appreciative. I’m a total novice with php and sql.

Template lives in sandbox/months/ and only works with a date call, ie sandbox/months/2007/09

Another template using regular weblog tags would be used for the events home page and category filtering.

<?php
$monthIs[
"01"] = "January";
$monthIs["02"] = "February";
$monthIs["03"] = "March";
$monthIs["04"] = "April";
$monthIs["05"] = "May";
$monthIs["06"] = "June";
$monthIs["07"] = "July";
$monthIs["08"] = "August";
$monthIs["09"] = "September";
$monthIs["10"] = "October";
$monthIs["11"] = "November";
$monthIs["12"] = "December";

$monthViewing = "$monthIs[{segment_4}]";
?>

<h1><a href="{path="sandbox"}">Event Calendar</a></h1>
<
h2> <?php echo "$monthViewing" ?> {segment_3} Events</h2>
<
hr />

<
div style="float:left; width: 450px;">

<
ul>
{exp:query limit="3" sql="SELECT L.entry_id as event_id, R.entry_id, L.weblog_id, title, url_title, entry_date, year, month, day, expiration_date, field_id_21
FROM exp_weblog_titles AS L LEFT JOIN exp_weblog_data AS R ON  R.entry_id = L.entry_id
WHERE expiration_date > '{current_time}'
AND year = '{segment_3}'
AND L.weblog_id ='6'
AND L.month <= '{segment_4}'
AND expiration_date >= '<?php echo strtotime("
1 $monthViewing 2007"), "\n"; ?>'
ORDER BY entry_date ASC"
}

{if no_results}
<h3>No events to display...</h3>{/if}

{exp
:weblog:entries entry_id="{event_id}" dynamic="off" show_future_entries="yes" disable="trackbacks|comments|categories" rdf="off"}
<li>
<
h3>{title}</strong><br /><em>{entry_date format="%d/%m/%y"} to {expiration_date format="%d/%m/%y"}</em></h3>
{event_summary}
</li>
{/exp:weblog:entries}

{paginate}
<hr />
<
p>Page {current_page} of {total_pages} pages.</p>
<
p>{if previous_page}<a href="{auto_path}">Previous Page</a>{/if}
{if next_page}
<a href="{auto_path}">Next Page</a>{/if}</p>
{/paginate}

{
/exp:query}
</ul>

</
div>

<
div style="float:left; width: 150px; margin-left:25px;">
<
h4>Browse by month</h4>
{exp:weblog:month_links weblog="events" limit="12" show_future_entries="yes" sort="asc" start_on="{current_time}"}
<p><a href="{path=sandbox/month}">{month}, {year_short}</a></p>
{/exp:weblog:month_links}
</div>

Image Attachments
events_dev.gif
Click thumbnail to see full-size image
 Signature 

Weblog | New Zealand Web Design Agency

Profile
 
 
Posted: 06 October 2007 06:13 AM   [ Ignore ]   [ # 6 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  173
Joined  03-07-2007

i’m not knowledgable about EE plugin/php structure, but there are some handy
SQL things you could look at. We used them in a (not EE) php website.

INTERVAL

WHERE enddate < ADDDATE(NOW(), INTERVAL 30 DAY)


this will let you also look into next year (like on dec 18 interval 30 day)

CASES (we used a check-box for multi-day events)

SELECT CASE use_enddate WHEN 1 THEN
  
IF(startdate>NOW(), startdate, NOW() ) ELSE startdate END AS show_from


If the event-startdate is later than now() then it would put the startdate in show_from,
however if the event is already running it would set the show_from to now() so that
events started in the past would show up in this month.

ps. Maybe have to look into if EE uses unix timestamps or mysql dates.
SELECT FROM_UNIXTIME(unix_timestamp, [format])

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: 65027 Total Logged-in Users: 22
Total Topics: 82117 Total Anonymous Users: 11
Total Replies: 441316 Total Guests: 199
Total Posts: 523433    
Members ( View Memberlist )