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
 Search_mod - Nil Keywords error
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 24 May 2008 :  07:35:22  Show Profile
If you select the members option dropdown box to display ie 'Display Member List vs. Text Box [0:Text Box;1:Member List]
strUseMemberDropDownBox = 1
When you press the search button without any words entered in the keywords input box, there is no error messages to pinpoint that the string is empty. All the search does is display all the pages..
However, when the strUseMemberDropDownBox = 0 The empty keywords input provides the right warning messages.. You must enter some search keywords and/or author or staff member in order to complete the search. There is no information with which to do a search.


The No Search Terms Entered routine seems part of an if/else statement at lines 859 onwards..
Any help will help settle the grey matter working overdrive and causing a headache..
thank you
andy<

Edited by - Andy Humm on 24 May 2008 07:36:50

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 24 May 2008 :  09:04:30  Show Profile
I believe that's by design, so you can get all posts by a particular member without regard to content.<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 24 May 2008 :  09:40:15  Show Profile
But surely the 'nil input check' routine which works in one scenario does not work with strUseMemberDropDownBox = 0<
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 24 May 2008 :  20:46:47  Show Profile
Why not? If you are searching for a particular word, group of words, or phrase; then you're not worried about the author. However, if you want to see all posts by an author, you cannot be expected to guess words from every post.<
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 24 May 2008 :  20:52:08  Show Profile  Visit leatherlips's Homepage
I think there may be a little confusion about the issue.

In the normal search.asp page if you select it to show members in a dropdown box then the following will happen:

If you do not enter any keywords it will tell you to enter keywords.

In the enhanced search_mod.asp if you select it to show members in a dropdown box then the following will happen:

If you do not enter any keywords it will display every post by every member.

It would be nice to have the search_mod.asp page behave the same way as the normal search.asp page in this manner.<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 24 May 2008 20:52:39
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 25 May 2008 :  00:54:23  Show Profile
I turned the drop-down list on for my search_mod and it works perfectly. If a member is selected and no keywords are used, it displays all posts by that member (by design). That can be limited with keywords if desired; however, they're not necessary.

If you want to ALWAYS require the keywords, you'll be eliminating part of the effectiveness for yourself. However, you can use an override (mLev) to give yourself the display all message option.

You only have two things to look for:

#1

if Request.QueryString("mode") = "DoIt" then
	if ((trim(Request.Form("Search")) <> "") or (Request.QueryString("MEMBER_ID") <> "") or (Request("SearchStaff") <> "") or (Request.Form("SearchMember") <> "")) then


Change to say:

if Request.QueryString("mode") = "DoIt" then


Where it has:

			SearchLink = "&SearchTerms=" & chkString(strKeyWords,"urlpath")
		end if


Delete the end if.


#2

		Response.Write	"      <p><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbCrLf &_
			"You must enter some search keywords and/or author or staff member in order to complete the search. There is no information with which to do a search." & _


Change to say:

		Response.Write	"      <p><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbCrLf &_
			"You must enter some search keywords to do a search." & _


That should give you want you want.<

Edited by - Carefree on 25 May 2008 01:26:24
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 25 May 2008 :  07:56:14  Show Profile  Visit leatherlips's Homepage
quote:
Originally posted by Carefree

I turned the drop-down list on for my search_mod and it works perfectly. If a member is selected and no keywords are used, it displays all posts by that member (by design).

That's not how mine works. If I do not select a member and do not enter any keywords, the results display every post by every user. Surley this is not by design?<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 25 May 2008 :  13:48:03  Show Profile
To mirror leatherlips, that is how mine works too.. But surely if NO data/keywords or members are selected, you should get a nil return. It is understood, or logic, if you selected a members name without any keyword, then Yes, you would pull all their posts..
<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 25 May 2008 :  14:20:14  Show Profile
My understanding of the search drop down box functionality. (Taken 'default state' as the drop down box is not touched on page load)

1. In default state, no member logged in, no key words entered, and search button submitted there should be no returns.
2. In default state, member logged in, no keywords entered, search button submitted, all logged in member posts in date range should display.
3. Dropdown selected to member, logged in/out, no keywords entered, search button submitted, search result pulls all that members posts
4. In default state, member logged in/out, keyword entered, search button submitted, search results pulls all members posts with that keyword

It appears that the drop down box should have the first stage option alias default with no affect on the search, thus there would or should be a nil return and the appropriate message to enter a keyword would be displayed..

I believe this is the code for the drop down options and maybe it needs revisiting to control the search if the parameters above are the correct way of search functionality..

		Response.Write	"<input name=""SearchMember"" value="""" size=""25"">  <a href=""members.asp""" & dWStatus("Current members of the forum...") & " tabindex=""-1""><acronym title=""Current members of the forum..."">Members</acronym></a>" & vbCrLf
else
Response.Write " <select name=""SearchMember"">" & vbCrLf &_
" <option value=""0"">All Members</option>" & vbCrLf
'## Forum_SQL
strSql = "SELECT MEMBER_ID, M_NAME "
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS"
strSql = strSql & " WHERE (M_STATUS = 1) AND (M_POSTS > 0)"
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>" & vbCrLf
next
end if
Response.Write " </select>" & vbCrLf
end if

<

Edited by - Andy Humm on 25 May 2008 14:21:20
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 25 May 2008 :  14:57:46  Show Profile
Further to above:
if you alter the code for the option value line 940
Response.Write " <select name=""SearchMember"">" & vbCrLf &_ " <option value=""0"">All Members</option>" & vbCrLf
and remove the 0

The seach functionality works except if you add any keyword and no member selected, submit the search you get an error
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'cLng'
/forumtest/inc_searchlog.asp, line 18

line 18 is
if strUseMemberDropDownBox = 1 then
strSLByMember = CLng(Request.Form("SearchMember"))

which is looking for an option value
I believe we must look at keeping a 0 value in line 940, but changing the parameter of what 0 is ie it should be a null..
<

Edited by - Andy Humm on 25 May 2008 14:58:44
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 17 May 2009 :  02:27:13  Show Profile
I was reviewing old topics and found this one had never been fixed.


Change line 382 from
 
	if ((sqlsearchtext <> "") or (Request.QueryString("MEMBER_ID") <> "") or (Request("SearchStaff") <> "") or (Request.Form("SearchMember") <> "")) then

to say

	if ((sqlsearchtext <> "") or (Request.QueryString("MEMBER_ID") <> "") or (Request("SearchStaff") <> "") or (Request.Form("SearchMember") <> 0)) then
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 19 May 2009 :  10:39:11  Show Profile
Thank you CF for spareing the time to sort this out
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 19 May 2009 :  15:44:11  Show Profile
You're welcome. Sorry I never got back to it a year ago.
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 21 May 2009 :  18:00:03  Show Profile
No problems, better late than never and I appreciate you are actively busy with other tasks too.
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.44 seconds. Powered By: Snitz Forums 2000 Version 3.4.07