Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Help retrieving calendar records  (Read 415 times)
0 Members and 1 Guest are viewing this topic.
hockalees
New Member
*

Karma: 0
Offline Offline

Posts: 0


« on: January 13, 2002, 01:17:00 AM »

I am trying to figure out if CS will do what I need... and so far so good!

I am stumped on an easy one (I think)... I set up a template that gives me a monthly list view with bullets and dates and hyperlinks to events.  It works just as I'd hoped.  I invoke it with a "...calendar.pl?template=main.htm&duration=31d" call.

However, I created a couple of customized fields, "Category" and "Group" with the hopes of creating lists on different pages that are subsets of the one that's working now.  I'd like to simulate an SQL statement like:

select * from calendar where duration = "31d" AND category = "Music"

I invoke the same "...calendar.pl?template=music.htm&duration=31d" type call, and in the music.htm file, my line looks like:

&getEvents( {'duration'=>$in{duration} , 'Group'=>'Music' } );

And it still pulls out all the events during that month, not jsut the Music ones.  What am I doing wrong?

Logged
Scott
Guest
« Reply #1 on: January 14, 2002, 10:55:00 AM »

You can't filter events in the getEvents call, unfortunately. You'll need to get all the events in the range, and then filter them in the template itself when displaying.

See this thread for an example: http://www.calendarscript.com/support/forum/Forum4/HTML/000081.html

------------------
Scott
CalendarScript.com


Logged
hockalees
New Member
*

Karma: 0
Offline Offline

Posts: 0


« Reply #2 on: January 14, 2002, 08:24:00 PM »

I thought about this one this morning... I realized I either have to mod the GetEvents func in calendar.pl to recognize the "category" field (ugh) or get get all recs and parse out the ones I want.

MemoBug's efforts look just like what I need to figure this out.  Thanks guys.

------------------

Logged
vr6
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #3 on: October 28, 2003, 06:00:00 PM »

Our calendar using different categories which are color coded. We would like to display a listing of just one category of events using something similar to the ssi.html or the sampleG.html. What would be the method for doing this?

Sorry for being so vague but I am still new to this script.

Thanks!

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #4 on: October 28, 2003, 07:33:00 PM »

** What would be the method for doing this? **

Using a conditional (on whichever event field) in the template you want them displayed on to skip the printing of unwanted events. eg.

IF wanted event
  print it
ELSE
  skip it

(of course you'd have to use the proper Perl coding)

I think the previous forum message "Different categories idea" shows a couple of different conditional examples.

Dan O.

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: