Search Log MOD update - Postet den (3505 Views)
Advanced Member
Etymon
Innlegg: 2396
2396
The Search Log MOD came out in May of 2003, which was several years before the most current version of Snitz Forums 2000.
In the current version of Snitz Forums 2000, you can manually change the code in search.asp to either search by typing in a member's name into the Search By Member: input box, or you can choose a member's name from a drop down menu. This option is set in line 43 of search.asp ...
Code:
Dim strUseMemberDropDownBox
strUseMemberDropDownBox = 0

However, when the Search Log MOD came out, I think the dropdown menu was standard code, and the blank input box was not.
The dropdown menu provides a numerical value when selected, but the code for the blank input box does not, which is why the returned results produce the following error:

Code:
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'cInt'

/forum/inc_searchlog.asp, line 33

In inc_searchlog.asp, on Line 32, change:

Code:
  strSLByMember = CInt(Request.Form("SearchMember"))

... to the following code:

Code:
	if trim(Request.Form("SearchMember")) <> "" then
strSLByMember = GetMemberID(Request("SearchMember"))
else
strSLByMember = 0
end if
   
 Sidestørrelse 
Postet den
Advanced Member
Etymon
Innlegg: 2396
2396
An alternate code offered to me by Carefree via email is the following:

Code:

	strSLByMember = 0

If Trim(Request("SearchMember")) > "" Then
If IsNumeric(Trim(Request("SearchMember"))) Then
strSLByMember = GetMemberID(Request("SearchMember"))
else
strSLByMember = 0
end if
End If
Postet den
Advanced Member
Carefree
Innlegg: 4224
4224
Didn't realize that was a text field. This is the simplest method:

Code:
strSLByMember = 0
If Trim(Request("SearchMember")) > "" Then strSLByMember = GetMemberID(Trim(Request("SearchMember")))
Postet den
Advanced Member
Etymon
Innlegg: 2396
2396
It's actually looking for a number, which is the reason for using GetMemberID.
Postet den
Advanced Member
Etymon
Innlegg: 2396
2396
The text field in the GUI, that the user sees, is requiring a member name.
The code that processes the text field takes the member name and converts it to a member id by using the function GetMemberID()
Postet den
Advanced Member
Carefree
Innlegg: 4224
4224
Yep, so my last reply is the simplest method. 2 lines and does it all.
Postet den
Advanced Member
Etymon
Innlegg: 2396
2396
2 lines or more ... what matters is if the person coding understands what the code does. Snitz is more about learning than about competing on who's code is shortest. smile
Postet den
Advanced Member
Carefree
Innlegg: 4224
4224
Well, if anyone reads this who still codes in classic Snitz (.asp format), I hope they learned something from this topic.
 
Du må legge inn en melding