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] 2   Go Down
Print
Author Topic: search problem?  (Read 991 times)
0 Members and 1 Guest are viewing this topic.
delicia
New Member
*

Karma: 0
Offline Offline

Posts: 7


WWW
« on: May 16, 2002, 11:21:00 AM »

i want search results to list all events that match search criteria -- not just the first match. i tested here on demo and it works similar to mine.

however, i have a problem with mine -- i entered a recurring monthly event on mine when i first set it up several months ago. the search will not find that event at all. when i tested the same event on the demo calendar here it worked ok, listing the first match. was there a bug or something with the recurring events and do i need to delete them and reenter them to get them to work with search?

Logged
TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #1 on: May 16, 2002, 06:35:00 PM »

You are searching within the correct time frame (unless it's not bounded), aren't you?  If you are, I don't think there are any bugs related to monthly recurring events.  Can I get a URL so I can see the problem for myself?

------------------
David Whittaker
http://www.uabcm.com/
http://www.csworkbench.com/

Logged

delicia
New Member
*

Karma: 0
Offline Offline

Posts: 7


WWW
« Reply #2 on: May 16, 2002, 08:55:00 PM »

not sure what you mean by bounded. www.berkeley-lake.ga.us/index.shtml  -- i searched for council which is a monthly meeting but it doesn't show.

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

Logged
TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #3 on: May 17, 2002, 01:28:00 AM »

This seems to be a bug to me.  You can only search for a recurring event if the first occurence of the event is in the range you have specified.  Here's the fix.  Open up your calendarscript/lib/Event.inc file.  In it you will find several subroutines.  The one you are interested in is sub search (the first big one).  Now look down about halfway through that subroutine, and find this line:

$event_id_index = $schedule_db->{'fieldindex'}->{'event_id'};

on the next line, place this piece of code:

$event_start_index = $schedule_db->{'fieldindex'}->{'start'};

Now look down about 7 lines below that, and find this one:

next if $schedules->{$values[$event_id_index]};

on the next line, place this bit of code:

if ($starttime) { next if (($values[$event_start_index] < $starttime) | | ($values[$event_start_index] > $endtime)); }

That should do it.  The problem was, the getNextOccurence function doesn't return the next occurence for bounded events (events that were added as recurring events, but have a start and end date).  For bounded events, it only returns whether the specific event that was passed in (the first one we came to, originally) is between the start and end times.  If not, it doesn't show up in the search results.  So, we did our own checking for bounded events with the two code additions above.

------------------
David Whittaker
http://www.uabcm.com/
http://www.csworkbench.com/

Logged

TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #4 on: May 17, 2002, 01:30:00 AM »

Don't forget, UBB doesn't like putting two |'s (pipes) right next to each other, so you have to remove the space between the | | so they will be right next to each other after you copy it into your code.

------------------
David Whittaker
http://www.uabcm.com/
http://www.csworkbench.com/

Logged

delicia
New Member
*

Karma: 0
Offline Offline

Posts: 7


WWW
« Reply #5 on: May 17, 2002, 12:43:00 PM »

thanks, i'll try to add this code over the weekend.

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

Logged
keetra
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #6 on: May 23, 2002, 08:39:00 AM »

The first message in this thread said:
"i want search results to list all events that match search criteria -- not just the first match."

I would like to do the same thing, but am not sure how to do that.  I added in the code suggested by Dave, but that seems to only fix the issue with the recurring event only showing up in the search results when the first instance of the recurring event falls within the time range searched.  Can someone shed some light on how to accomplish the original problem?  Thanks!

~Keetra

[This message has been edited by keetra (edited May 23, 2002).]

Logged
TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #7 on: May 23, 2002, 07:51:00 PM »

Ok, if you want to show ALL occurrences instead of the next occurrence, that shouldn't be too tough.  Open the calendarscript/lib/Event.inc file again.  Then find the search subroutine again.  Now, there are only a few changes to make.  Find:

      next if $schedules->{$values[$event_id_index]};

and comment it out (put a # on the beginning of the line).  Then find (3 lines down):

      $schedules->{$values[$event_id_index]} = $schedule_db->makeRecord($line);

and replace that with this:

      push(@$events, {'details'=>$details->{$id}, 'schedule'=>$schedule_db->makeRecord($line) });

Finally, right after "close(DB);" put this line:

   return $events.

Please note:  you must have made the changes above for this to work.  I haven't had time to test it, but I'm fairly sure it will work. Enjoy!

------------------
David Whittaker
http://www.uabcm.com/
http://www.csworkbench.com/

Logged

keetra
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #8 on: May 28, 2002, 09:01:00 AM »

Hi Dave,

Well, your suggestions *almost* work.  This is what I get:

First Occurrence     Title     Description
None
None
None
None
None
None
etc.

It looks like it is looping through the events and listing multiple occurances, but it is not displaying the actual information for the events.  Unfortunately, I'm just getting started in Perl, so I haven't been able to figure it out myself.  Any more advice?  Thanks!

~Keetra

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

Logged
TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #9 on: May 28, 2002, 06:03:00 PM »

Well, since that modification doesn't populate next occurrence, we have to take that into account in the default.html.  So look for this section of code in the search view section:
code:

<% IF NEXT OCCURRENCE EXISTS %>
<%=$MONTH_NAMES->[$EVENT->{schedule}->{nextoccurrence}->{month}-1]%> <%=$EVENT->{schedule}->{nextoccurrence}->{date}%>, <%=$EVENT->{schedule}->{nextoccurrence}->{year}%>
<% ELSE %>
None
<% /IF %>

and change it to this:

code:

<%=$MONTH_NAMES->[$EVENT->{schedule}->{month}-1]%> <%=$EVENT->{schedule}->{date}%>, <%=$EVENT->{schedule}->{year}%>

That should make the schedule part show up correctly.  Are the title and description showing up?

------------------
David Whittaker
http://www.uabcm.com/
http://www.csworkbench.com/

Logged

mooredp
New Member
*

Karma: 0
Offline Offline

Posts: 0

Librarian


« Reply #10 on: June 03, 2002, 09:16:00 PM »

David,

I edited the default.html file and it got a little better:

Occurrence Title Description
June 3,    
June 4,    
June 5,    
June 6,    
June 7,  


It displays the day and date, but no year, title or description. Do you have a next step we can implement? I'm sure it has to be something else i the default.html file, but I don't know what.

THanks so much.

David P. Moore
Huntsville, AL
mooredp@email.uah.edu

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

Logged

David P. Moore
Huuntsville, AL
mooredp@email.uah.edu
TubaDave
New Member
*

Karma: 0
Offline Offline

Posts: 0

Student


WWW
« Reply #11 on: June 04, 2002, 12:56:00 AM »

My bad.  Back in the calendarscript/lib/Event.inc file, I told you to change a line to this:

push(@$events, {'details'=>$details->{$id}, 'schedule'=>$schedule_db->makeRecord($line) });

Well, that's slightly off.  Change it to this and see what happens:

push(@$events, {'details'=>$details->{$values[$event_id_index]}, 'schedule'=>$schedule_db->makeRecord($line) });

That should fix it.

------------------
David Whittaker
http://www.uabcm.com/
http://www.csworkbench.com/

Logged

TechnoShroom
New Member
*

Karma: 0
Offline Offline

Posts: 14


WWW
« Reply #12 on: August 20, 2002, 03:04:00 PM »

Ok I followed the instructions TubaDave gave to delicia and it didn't seem to work for unbounded recurring events at all. <P>If you have an event that occurs on wednesday's and fridays and you never entered a start or end date you still can't find it through the search.  I don't want to list every occurrence just the next one.  (I know this is a minor point because if you look at the standard week view I have then you'll see it but I'd like it to show up if people search for a particular event type. )
« Last Edit: August 24, 2008, 07:54:31 PM by TechnoShroom » Logged
kayleigh
New Member
*

Karma: 0
Offline Offline

Posts: 0

Computer Analyst


WWW
« Reply #13 on: August 21, 2002, 05:19:00 PM »

This code checks only for bounded events (events that recur at whatever interval from this date to that date). I'm guessing your event is unbounded (it occurs every M, W, F, & Sa until the end of time). I wish David would reappear because I'm really bad at trying to decipher & fix code. The only way I'd know how to fix it is set the event to reoccurfor the year & change it annually; not a good answer.

PS: one line of code is incorrect above. It should read:

return $events;

------------------
Stephanie Meemken
Webmaster, Minnesota Jaycees

http://www.mnjaycees.org/

Logged

Stephanie Meemken
Webmaster, Minnesota Jaycees

http://www.mnjaycees.org/
haagendoss
New Member
*

Karma: 0
Offline Offline

Posts: 0


WWW
« Reply #14 on: October 09, 2002, 11:39:00 AM »

has anyone figured out how to show all the events in an occurrence.. i followed the steps included in this topic and ended with the results:

October 21,
October 22,
October 23,

it is showing the correct dates for the occurences but is not showing the year or the title or description... any ideas?!? help would be appreciated...

jason

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

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