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


Login with username, password and session length

Search

 
Advanced search

8016 Posts in 1849 Topics- by 2099 Members - Latest Member: roi
Pages: [1]   Go Down
Print
Author Topic: Day of the week in search result  (Read 193 times)
0 Members and 1 Guest are viewing this topic.
KTF
New Member
*

Karma: 0
Offline Offline

Posts: 0

Web Librarian


WWW
« on: October 23, 2003, 11:43:00 AM »

Hi!

I'd like to display Day of the week in the search result like this:

October 23, 2003 Thursday

The below is what I have for Search View currently. (No day of the week dusplayed) What should I add to make it happen?

TIA,
KTF
P.S. We love your script/plugins!

----------------
<%-- SEARCH VIEW --%>
<% } elsif ($VIEW eq "Search") { %>
<FORM NAME="mainform" ACTION="<%= $CGI_URL %>"METHOD="POST">
<INPUT TYPE="hidden" NAME="QUERY_STRING" VALUE="<%=$QUERY_STRING%>">
<INPUT TYPE="hidden" NAME="fromTemplate" VALUE="<%=$thisTemplate%>">
<INPUT TYPE="hidden" NAME="command" VALUE="search">
<INPUT TYPE="hidden" NAME="view" VALUE="Search">
<TABLE BORDER="0">
<% if ($userMessage ne "") { %>
<TR>
<TD></TD>
<TD ALIGN="left" VALIGN="top">
<SPAN CLASS="messagetext">
<%= $userMessage %>
</SPAN>
</TD>
</TR>
<% } %>
<% $fieldnames = &main: BGetSearchFields($db);
foreach $field (@$fieldnames) { %>
<TR>
<TD ALIGN="RIGHT"><SPAN CLASS="text"><B><%= $db->{'properties'}->{$field}->{'name'} | | $field %> : </B></SPAN></TD>
<TD><%= &main::GetSearchFieldInput($db->{'properties'}->{$field},$field,$search_params) %></TD>
</TR>
<% } %>
<TR>
<TD ALIGN="RIGHT"><SPAN CLASS="text"><B>Between : </B></SPAN></TD>
<TD>
<SELECT NAME="start_month"><%= &HTML::monthNameOptions($in{start_month} | | $TODAY_MONTH) %></SELECT>
<SELECT NAME="start_date"><%= &HTML::dateOptions($in{start_date} | | $TODAY_DATE) %></SELECT>
<SELECT NAME="start_year"><%= &HTML::yearOptions($in{start_year} | | $TODAY_YEAR) %></SELECT>
<SPAN CLASS="text">and </SPAN>
<SELECT NAME="end_month"><%= &HTML::monthNameOptions($in{end_month} | | $TODAY_MONTH) %></SELECT>
<SELECT NAME="end_date"><%= &HTML::dateOptions($in{end_date} | | $TODAY_DATE) %></SELECT>
<SELECT NAME="end_year"><%= &HTML::yearOptions($in{end_year} | | ($TODAY_YEAR+1)) %></SELECT>
</TD>
</TR>
<TR>
<TD ALIGN="CENTER" COLSPAN="2">
<INPUT CLASS="button" TYPE="submit" VALUE="Search">
</TD>
</TR>
<% IF SEARCH RESULT %>
<TR>
<TD COLSPAN="2" ALIGN="center">
<SPAN CLASS="text">
<u><B>Search Results</B></u><BR>
<% IF SEARCH RESULTS EXIST %>
No Matches
<% ELSE %>
<% @$SEARCH_RESULTS = sort {$a->{schedule}->{start} <=> $b->{schedule}->{start} } @$SEARCH_RESULTS; %>
<TABLE BORDER="1" CELLPADDING="1" CELLSPACING="0">
<TR>
<TH><SPAN CLASS="text">Date</SPAN></TH>
<TH><SPAN CLASS="text">Time</SPAN></TH>
<TH><SPAN CLASS="text">Title</SPAN></TH>
<TH><SPAN CLASS="text">Location</SPAN></TH>
</TR>
<% FOREACH SEARCH RESULT %>
<TR><TD>
<SPAN CLASS="text">
<%=$MONTH_NAMES->[$EVENT->{schedule}->{nextoccurrence}->{month}-1]%> <%=$EVENT->{schedule}->{nextoccurrence}->{date}%>, <%=$EVENT->{schedule}->{nextoccurrence}->{year}%>
</SPAN>
</TD>
<td><%= &Date::formatTime($EVENT->{schedule}->{start_time}, $Config->get("time_format")); %> - <%= &Date::formatTime($EVENT->{schedule}->{end_time}, $Config->get("time_format")); %></td>
<TD><A HREF="<%=$CGI_URL_QUERYSTRING%>view=Event&event_id=<%= EVENT FIELD(id) %>" STYLE="text-decoration:underline;"><%= EVENT FIELD(title) %></A></TD>
<TD><SPAN CLASS="text"><%= EVENT FIELD(location) %></SPAN></TD></TR>
<% /FOREACH %>
</TABLE>
<% /IF %>
</SPAN>
</TD>
</TR>
<% /IF %>
</TABLE>
</FORM>

<% } %>
<%-- END OF VIEWS --%>

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 217

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


WWW
« Reply #1 on: October 24, 2003, 01:11:00 PM »

** What should I add to make it happen? **

That would not be easy as the week day as far as I can tell is not supplied in the returned event data from the search function.

Dan O.

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

Logged
KTF
New Member
*

Karma: 0
Offline Offline

Posts: 0

Web Librarian


WWW
« Reply #2 on: October 24, 2003, 03:15:00 PM »

Thanks for your reply DanO!

I'm a novice on scripting, so please bear with my idea--

I could see display of day of the week name in the list view. So I tried to tweak and add {dayname} or {day_names} but seems like search view works entirely different on this.
Is it right?

So is there any way I could have week day names to the returned event data?  To do that, only way is to create a field for week day name? Then, each add event requires to fill this filed and it can be searchable.

hmmm. What do you recommend?

KTF

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