Author |
Topic |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 30 June 2021 : 02:23:04
|
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 ...
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:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'cInt'
/forum/inc_searchlog.asp, line 33
In inc_searchlog.asp, on Line 32, change:
strSLByMember = CInt(Request.Form("SearchMember"))
... to the following code:
if trim(Request.Form("SearchMember")) <> "" then
strSLByMember = GetMemberID(Request("SearchMember"))
else
strSLByMember = 0
end if |
Edited by - Etymon on 01 July 2021 06:52:08 |
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 30 June 2021 : 06:50:31
|
An alternate code offered to me by Carefree via email is the following:
strSLByMember = 0
If Trim(Request("SearchMember")) > "" Then
If IsNumeric(Trim(Request("SearchMember"))) Then
strSLByMember = GetMemberID(Request("SearchMember"))
else
strSLByMember = 0
end if
End If
|
Edited by - Etymon on 01 July 2021 06:50:59 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 09 July 2021 : 18:22:19
|
Didn't realize that was a text field. This is the simplest method:
strSLByMember = 0
If Trim(Request("SearchMember")) > "" Then strSLByMember = GetMemberID(Trim(Request("SearchMember")))
|
Edited by - Carefree on 09 July 2021 18:33:25 |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 10 July 2021 : 06:58:00
|
It's actually looking for a number, which is the reason for using GetMemberID. |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 16 July 2021 : 00:53:31
|
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() |
Edited by - Etymon on 16 July 2021 00:54:21 |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 16 July 2021 : 01:48:04
|
Yep, so my last reply is the simplest method. 2 lines and does it all. |
|
|
Etymon
Advanced Member
United States
2385 Posts |
Posted - 16 July 2021 : 03:01:45
|
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. |
|
|
Carefree
Advanced Member
Philippines
4207 Posts |
Posted - 17 July 2021 : 14:26:39
|
Well, if anyone reads this who still codes in classic Snitz (.asp format), I hope they learned something from this topic. |
|
|
|
Topic |
|