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
Calendar Script CommunityCustomizationHacks and Mods (Moderators: scott, DanO, Marty)Linking to Event type form external page
Pages: [1]   Go Down
Print
Author Topic: Linking to Event type form external page  (Read 351 times)
0 Members and 1 Guest are viewing this topic.
CatLovette
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« on: September 01, 2003, 05:26:00 PM »

Great script! Downloaded it today! I just about have it doing everything I want. But not this;

Say
I have an event called "event" which has an ID of 1
I add another event called "event2" with ID of 1
I add another event called "event2" with ID of 11

I want to link from an external page to show all events with ID 1

A search doesnt work because it will see 1 and 11 and list them.

How do I link to IDs/fields of a specific number exactly.

Thanks

Cat

Logged
eladyar
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #1 on: September 01, 2003, 09:45:00 PM »

It sounds like you are trying to categorize your events.

You can make a separate calendar for each event type and use the Meta Calendar plug in to show them all on one calendar or call each calendar to display the events only in that group.

You can make a drop down custom field for your categories and include it on the search page. Then your search will only match the category selected in the search.

You can edit the templates and include code to limit the display of events to those only matching specific criteria. See the CalendarScript docs for info about editing the templates.

If you are new to CalendarScript you should visit DanO's unofficial CalendarScript Addon Page. The Meta Calendar addon is available there, and so are many others. There are also some direct links to discussions in this forum that are very handy resources.

------------------
Dale Ray
http://www.sscsoftball.org

Logged

CatLovette
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #2 on: September 02, 2003, 01:15:00 AM »

Hiya, thanks yes I already have a few plugins installed.

"You can make a separate calendar for each event type and use the Meta Calendar plug in to show them all on one calendar or call each calendar to display the events only in that group."

There are too many event types to have a seperate cal. 1000s of possible types.

"You can make a drop down custom field for your categories and include it on the search page. Then your search will only match the category selected in the search."

Drop down is impossible as there are 1000s also.


"You can edit the templates and include code to limit the display of events to those only matching specific criteria. See the CalendarScript docs for info about editing the templates."

Yes this is what I was thinking but I dont know how!
I was thinking also I could link via the search if the search allows for ==1 (excuslive) or some other syntax!

Cat

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

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

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


WWW
« Reply #3 on: September 09, 2003, 03:18:00 PM »

** A search doesnt work because it will see 1 and 11 and list them. **

That is probably because of the way Perl's string comparison operator (eq) works. If I remember correctly, it only compares the 2 values up until the end of the first search term. So if one is shorter than the other, it only looks to see if the longer one starts with the shorter one.

The matching routine is contained in the sub DBMatch in the DBFile.pm file located in the calendarscript/lib directory.

You could try changing the order of the parameters in the string comparison routine to see if that helps. The following line:

if ($a eq $b) { return 1; }

would need to be changes to something like

if ($b eq $a) { return 1; }

or maybe even

if ($a eq $b && length($a) == length($b) ) { return 1; }

To compare the lengths of each as well.

Or you could try totally changing the string comparison operation to something like:

if ($a ~= /^$b$/) { return 1; }

Which should hopefully look for exact matches only.

All of these are untested and I have no idea what effects such a change may have on other parts of CalendarScript so use at your own risk and don't forget to make a back up of the original files just in case!

Dan O.

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

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: September 16, 2003, 08:24:00 PM »

** Or you could try totally changing the string comparison operation to something like: **

if ($a ~= /^$b$/) { return 1; }

The above may have to be more like:

if ($a ~= /^\$b$/) { return 1; }

JFYI

Dan O.


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

[This message has been edited by DanO (edited September 16, 2003).]

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