[EventCalendar] Formatting Output

Alex Tingle alex at firetree.net
Fri Oct 13 19:47:46 UTC 2006


Hi Dave,

On Wed, 11 Oct 2006 20:57:43 -0400
"Dave Sabol" <desabol at gmail.com> wrote:

> With what I put you through with my plug-in conflict, I wouldn't doubt
> you shudder just seeing my name...everybody has to be good at
> something, I guess I am good at being a pain in the...
> 
> Anyway.
> 
> When I was using 3.0.4 I was able to figure out how to limit what I
> was displaying in terms of date ranges etc., but with this version I
> am a bit uncertain...

You might to read this new bit of documentation I just wrote...

http://wpcal.firetree.net/advanced-queries/

That's correct, except that in all versions released so-far you have to
use '_' (underscore) instead of '-' dash when you are specifying a date.

> What I want to do is two-fold:
> 
> First on the widget, I want to have two separate date ranges appear.
> The first I want to appear is Todays Events. I'd like to have a header
> appear that says todays events and then list all events for today. I
> am thinking that part is easy to do.

I'm planning to add this. The "Number of events" would be set to "5 days"
or "1 day", rather than just a number.


> Then below it, under another header, I'd like to display the weeks
> events. Again, I know I can get the week number from php <?php
> date('w') ?>, and can compare it against the dates of my events. That
> might be heavy in terms of throughput and server load...so I'd be
> happy to show the next x days of events (lets say 5 days), again, I
> could use the current date and simply add my variable to it. Again
> doable, but I'm not sure how hard it would be.

Not sure about this. You want to have a sidebar widget that shows events
for the next N days, but NOT today? That sounds a bit complicated to me.

Tell you what, show the next seven days, but use Dunstan's "Time Since"
plugin to enable "human friendly" times.


> Now onto the category page. What I would like to do is limit the
> events as well. Perhaps have them broken out by month. I would
> obviously use a customized wp template to pull it off, but what would
> I do to make it all work? Could I use some of the functions that
> already exist or would I have to add my own query / code.

Use the advanced queries (documented in the page I linked above).


> I am not a php genius, far from it, I am just getting my arms around
> the possibilities. That said, I have been coding in .asp for over 10
> years, so I am sure I could muddle my way through it. I think a lot of
> folks would love to have some of the same flexibility /
> functionality...hence why I am submitting it to the mailing list.

To extend these advanced queries, look at ec3_filter_parse_query() in
eventcalendar3.php. It basically sets $ec3->range_from &
$ec3->range_before to min/max SQL date strings.

-Alex

-- 
:: Let me solve your problems: http://www.firetree.net/consulting/
:: alex.tingle AT firetree.net  +44-7901-552763 



More information about the EventCalendar mailing list