Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Event Calendar Search function....
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

bobby131313
Senior Member

USA
1163 Posts

Posted - 21 November 2007 :  14:09:46  Show Profile  Visit bobby131313's Homepage
Searched and didn't see any mention of it which kinda surprised me. Has anyone come up with a search function that just searches events?

I guess if you have all your events in one forum it's no big deal to use the regular search function but I have mine across several.

Switch the order of your title tags

muzishun
Senior Member

United States
1079 Posts

Posted - 21 November 2007 :  17:06:27  Show Profile  Visit muzishun's Homepage
As far as I know, there isn't anything made already, but I don't see why you couldn't just modify search.asp to include the appropriate code. I don't have a copy of the forum with a calendar MOD available nearby, but in search.asp, you could add something like this (don't forget to add the code to check whether events are enabled and all that jazz):

This code is all from a fresh download of 3.4.06, so your line numbers may vary.

At line 724 add the follwing:

" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Search Events:</font></b></td>" & vbNewLine
Response.Write " <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle"">" & vbNewLine & _
" <select name=""SearchEvents"">" & vbNewLine & _
" <option value=""0"">Topics & Events</option>" & vbNewLine & _
" <option value=""1"">Topics Only</option>" & vbNewLine & _
" <option value=""2"">Events Only</option>" & vbNewLine & _
" </select>" & vbNewLine & _
" </td>" & vbNewLine
Response.Write " </tr>" & vbNewLine & _


That and the surrounding area should look like this:

if strUseMemberDropDownBox = 0 then
Response.Write " <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><input name=""SearchMember"" value="""" size=""25""></font></td>" & vbNewLine
else
Response.Write " <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle"">" & vbNewLine & _
" <select name=""SearchMember"">" & vbNewLine & _
" <option value=""0"">All Members</option>" & vbNewLine
'## Forum_SQL
strSql = "SELECT MEMBER_ID, M_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " WHERE M_STATUS = " & 1
strSql = strSql & " ORDER BY M_NAME ASC;"

set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, adOpenForwardOnly, adLockReadOnly, adCmdText

if rs.EOF then
recMemberCount = ""
else
allMemberData = rs.GetRows(adGetRowsRest)
recMemberCount = UBound(allMemberData,2)
meMEMBER_ID = 0
meM_NAME = 1
end if

rs.close
set rs = nothing

if recMemberCount <> "" then
for iMember = 0 to recMemberCount
MembersMemberID = allMemberData(meMEMBER_ID, iMember)
MembersMemberName = allMemberData(meM_NAME, iMember)
Response.Write " <option value=""" & MembersMemberID & """>" & ChkString(MembersMemberName,"display") & "</option>" & vbNewline
next
end if
Response.Write " </select>" & vbNewLine & _
" </td>" & vbNewLine
end if
Response.Write " </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right"" valign=""middle""><b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>Search Events:</font></b></td>" & vbNewLine
Response.Write " <td bgColor=""" & strPopUpTableColor & """ align=""left"" valign=""middle"">" & vbNewLine & _
" <select name=""SearchEvents"">" & vbNewLine & _
" <option value=""0"">Topics & Events</option>" & vbNewLine & _
" <option value=""1"">Topics Only</option>" & vbNewLine & _
" <option value=""2"">Events Only</option>" & vbNewLine & _
" </select>" & vbNewLine & _
" </td>" & vbNewLine
Response.Write " </tr>" & vbNewLine & _

" <tr>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""center"" valign=""middle"" colspan=""2""><input type=""submit"" value=""Search""></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </form>" & vbNewLine


Then just add the check to the SQL string at the top.

Around line 293 add the following:

Select Case Request.Form("SearchEvents")
Case 0
'Do Nothing, we want all topics, including events
Case 1
strSql3 = strSql3 & " AND T.IS_EVENT = False"
Case 2
strSql3 = strSql3 & " AND T.IS_EVENT = True"
Case Else
'Do Nothing, we want all topics, including events
End Select


That and the surrounding area should look like this:

if cLng(Request.QueryString("MEMBER_ID")) <> 0 then
strSql3 = strSql3 & " AND (M.MEMBER_ID = " & cLng(Request.QueryString("MEMBER_ID")) & " "
strSql3 = strSql3 & " OR R.R_AUTHOR = " & cLng(Request.QueryString("MEMBER_ID")) & ") "
end if
if strPrivateForums = "1" and mLev < 4 then
strSql3 = strSql3 & " AND F.FORUM_ID IN (" & allAllowedForums & ")"
end if
strSql3 = strSql3 & " AND F.F_TYPE = 0"
Select Case Request.Form("SearchEvents")
Case 0
'Do Nothing, we want all topics, including events
Case 1
strSql3 = strSql3 & " AND T.IS_EVENT = False"
Case 2
strSql3 = strSql3 & " AND T.IS_EVENT = True"
Case Else
'Do Nothing, we want all topics, including events
End Select


strSql4 = " ORDER BY C.CAT_ORDER, C.CAT_NAME, F.F_ORDER, F.F_SUBJECT, T.T_LAST_POST DESC"


As I said, I don't actually have a copy of the Events Calendar MOD in front of me, so I'm not 100% sure the field is called "IS_EVENT", but I think it's something similar. At the very least, this should help you move in the right direction.

As always, back up your file before doing this.... I mashed it up in a few minutes, so it's untested and could well contain errors.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 21 November 2007 :  17:33:26  Show Profile  Visit bobby131313's Homepage
Thanks! I'll probably won't get a chance to play with it until Friday. Will post back with results.

Thanks Again!

Switch the order of your title tags
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 21 November 2007 :  18:18:44  Show Profile  Visit muzishun's Homepage
Please do. As I was writing that, I thought it would be a good addition to the Events Calendar. If it works well enough for you, I'll probably write it up (or add it to my list of things to write up ) and post it to Snitzbitz as an add-on for the MOD.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 18 January 2008 :  13:24:28  Show Profile  Visit muzishun's Homepage
I have packaged this up as an official add-on to the Events Calendar mod. You can download the full code here.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.39 seconds. Powered By: Snitz Forums 2000 Version 3.4.07