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>
Click thumbnail to see full-size image