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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 PM Search 1.00 MOD
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Etymon
Advanced Member

United States
2385 Posts

Posted - 17 July 2008 :  11:51:13  Show Profile  Visit Etymon's Homepage  Reply with Quote
Download Location: SnitzBitz

This is a modified standard Snitz search.asp. This MOD allows a member to search for keywords in his/her inbox, outbox, or inbox and outbox. It also lets the member search in the title or the entire PM.

Currently, this MOD is set up for searching only the private messages that the member has sent or received.

If you are an administrator and you want to search your members' mailboxes in addition to your own, contact me, and I'll work that into a future version as an option.

The .zip contains only one file: pm_search.asp. I can include instructions for installing it, an image icon, and also search terms highlighting in the next version. There are no database upgrades and no additional files. It uses the same files as search.asp. You'll have to make a link to it for now. Remember, this is just the first version.

My username at SnitzBitz is WhoHasItWhere.
<

Edited by - Etymon on 17 July 2008 12:03:13

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 01 August 2008 :  04:49:14  Show Profile  Reply with Quote
See your EMail. I sent you a revision.<
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 01 August 2008 :  06:42:48  Show Profile  Reply with Quote
Etymon, line 328 in the pm_search.asp may need updating, it put you back to search.asp.

Also I have noticed that if I search in the Inbox only, I will not come back with a returned result, but if I select the Outbox or the Inbox and Outbox from the drop down I get results back. Great work on it by the way.<

Cheers,

David Greening
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 01 August 2008 :  08:56:10  Show Profile  Visit Etymon's Homepage  Reply with Quote
Thanks guys for the help! I'll take a look at it as soon as I can. <
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 01 August 2008 :  09:17:14  Show Profile  Visit modifichicci's Homepage  Reply with Quote
to fix it:
lines 251 -258

if cLng(Request.Form("SearchPM")) = 0 then
strSql3 = strSql3 & " AND P.M_OUTBOX= " & cLng(Request.Form("SearchPM")) & " "
elseif cLng(Request.Form("SearchPM")) = 1 then
strSql3 = strSql3 & " AND P.M_OUTBOX= " & cLng(Request.Form("SearchPM")) & " "
elseif cLng(Request.Form("SearchPM")) = 2 then
strSql3 = strSql3 & " AND (P.M_OUTBOX = 1 "
strSql3 = strSql3 & " OR P.M_OUTBOX = 2) "
end if


changed to:

if cLng(Request.Form("SearchPM")) = 1 then
strSql3 = strSql3 & " AND P.M_OUTBOX= 0 AND (P.M_TO = " & MemberID & "))"
elseif cLng(Request.Form("SearchPM")) = 2 then
strSql3 = strSql3 & " AND P.M_OUTBOX= 1 AND (P.M_FROM = " & MemberID & "))"
elseif cLng(Request.Form("SearchPM")) = 3 then
strSql3 = strSql3 & " AND (P.M_OUTBOX = 0 "
strSql3 = strSql3 & " OR P.M_OUTBOX = 1) AND (P.M_FROM = " & MemberID & " OR P.M_TO = " & MemberID & ")) "
end if



lines 503 - 511

if OutBox_ID = "0" then
Response.Write "privatesent.asp"
elseif OutBox_ID = "1" then
Response.Write "privateread.asp"
elseif OutBox_ID = "2" and Topic_Author = MemberID then
Response.Write "privatesent.asp"
elseif OutBox_ID = "2" and Topic_Recipient = MemberID then
Response.Write "privateread.asp"
end if


changed to:

if OutBox_ID = 2 then
Response.Write "privatesent.asp"
elseif OutBox_ID = 1 then
Response.Write "privateread.asp"
elseif OutBox_ID = 2 and Topic_Author = MemberID then
Response.Write "privatesent.asp"
elseif OutBox_ID = 1 and Topic_Recipient = MemberID then
Response.Write "privateread.asp"
elseif OutBox_ID = 3 then
Response.Write "privateread.asp"
end if


lines 628 - 630

" <option value=""0"">Inbox</option>" & vbNewLine & _
" <option value=""1"">Outbox</option>" & vbNewLine & _
" <option value=""2"">Inbox and Outbox</option>" & vbNewLine


changed to

" <option value=""1"">Inbox</option>" & vbNewLine & _
" <option value=""2"">Outbox</option>" & vbNewLine & _
" <option value=""3"">Inbox and Outbox</option>" & vbNewLine


I think that lines from 564 to 562 could be deleted
the same for lines from 516 to 528
the same for lines from 446 to 465
line 328 :
change search.asp to pm_search.asp<

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 01 August 2008 :  09:32:39  Show Profile  Visit Etymon's Homepage  Reply with Quote
Change the following from this:

		if cLng(Request.Form("SearchPM")) = 0 then
			strSql3 = strSql3 & " AND P.M_OUTBOX= " & cLng(Request.Form("SearchPM")) & " "
		elseif cLng(Request.Form("SearchPM")) = 1 then
			strSql3 = strSql3 & " AND P.M_OUTBOX= " & cLng(Request.Form("SearchPM")) & " "
		elseif cLng(Request.Form("SearchPM")) = 2 then
			strSql3 = strSql3 & " AND (P.M_OUTBOX = 1 "
			strSql3 = strSql3 & " OR P.M_OUTBOX = 2) "
		end if


to this:

		if cLng(Request.Form("SearchPM")) = 0 then
			strSql3 = strSql3 & " AND (P.M_FROM <> " & MemberID & ")"
		elseif cLng(Request.Form("SearchPM")) = 1 then
			strSql3 = strSql3 & " AND (P.M_TO <> " & MemberID & ")"
		end if


Note that if you send a message to yourself, this doesn't account for that.

modifichicci, I haven't tried your fix. The code above will show the messages in your inbox, outbox, and inbox/outbox. You may be fixing some other errors along the way that I haven't discovered. Thanks for your help too!<

Edited by - Etymon on 01 August 2008 10:00:19
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 01 August 2008 :  10:11:40  Show Profile  Reply with Quote
Etymon,

your fix worked nice and easy. Now getting results from the search.
<

Cheers,

David Greening
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 01 August 2008 :  10:55:13  Show Profile  Visit Etymon's Homepage  Reply with Quote
quote:
Originally posted by Classicmotorcycling

Etymon,

your fix worked nice and easy. Now getting results from the search.




Thanks David!

CareFree has packaged together a really nice installation guide with a pic for the search and some other fixes and tweaks of his own. When We get these errors all corrected, I'll upload the newest version of the MOD to SnitzBitz.

Thank again for all the help guys/gals!
<
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 01 August 2008 :  12:29:44  Show Profile  Visit Etymon's Homepage  Reply with Quote
For anyone who is interested in testing the next unofficial version(s), contact me through my forum member profile e-mail here at Snitz (You have to login first ). We're throwing around some ideas via e-mail.<
Go to Top of Page

modifichicci
Average Member

Italy
787 Posts

Posted - 01 August 2008 :  12:48:19  Show Profile  Visit modifichicci's Homepage  Reply with Quote
That is true.. but it search only in outbox or only in inbox, i think it's missed the double option.. but I could be wrong..
you have to change also lines 503-511 to point to the correct link and lines 628-630 if you abort double check..

Edit: I haven't tryed your fix but are you sure that setting the query to P.M_FROM <> " & MemberID or P.M_TO <> " & MemberID you don't restrict the search to member PM but it takes on all PM?

Because the select command is bring on the PM table, with only a WHERE on subject or message and then you query on P.M_FROM that is NOT members bringing on the search or P.M_TO that is NOT the same members
<

Ernia e Laparocele
Forum di Ernia e Laparocele
Acces - MySql Migration Tutorial
Adamantine forum

Edited by - modifichicci on 01 August 2008 12:58:58
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 01 August 2008 :  15:33:25  Show Profile  Reply with Quote
The latest version (that I just mailed back to Etymon) searches in/out/both boxes and restricts members to their own PMs. Works just the way it should.<
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 01 August 2008 :  17:10:06  Show Profile  Visit Etymon's Homepage  Reply with Quote
quote:
Originally posted by modifichicci


Edit: I haven't tryed your fix but are you sure that setting the query to P.M_FROM <> " & MemberID or P.M_TO <> " & MemberID you don't restrict the search to member PM but it takes on all PM?



Hi M,

P.M_FROM = " & MemberID & " OR P.M_TO = " & MemberID

That means the same as "the person sending or receiving is not the same as the member doing the query". In other words, "omit the member doing the search from the results".

Thanks for the thoughts though. It's great to have other opinions and thoughts!

Etymon
<
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 01 August 2008 :  17:32:56  Show Profile  Visit Etymon's Homepage  Reply with Quote
You guys,

I modded the search.asp file in a hurry when I was trying to find a previous conversation between me an a client. It was a really quick hack, so I am sure you are going to find errors. I invite you all to do so because it will only help all of us.

By the way, two things ...

Though it doesn't seem to produce results when queried by non forum members, pm_search.asp needs to be isolated for only forum members with something like:

if mlev < 1 then
    Response.Redirect   strForumURL
else
    'Do the pm_search.asp code'
end if


Also, this bit of code doesn't seem to need to be in there:


		if mlev <> 4 then
			strSql3 = strSql3 & " AND (P.M_FROM = " & MemberID
			strSql3 = strSql3 & " OR P.M_FROM = " & MemberID & ")"
		end if


I'm just listing things as I observe them. If you all see something else holler. <
Go to Top of Page

Carefree
Advanced Member

Philippines
4207 Posts

Posted - 01 August 2008 :  18:04:16  Show Profile  Reply with Quote
Simplify that routine, Etymon. Put this at the top before includes.

if mLev<1 then Response.Redirect strForumURL

That's it, all you need.<
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 01 August 2008 :  18:50:28  Show Profile  Visit Etymon's Homepage  Reply with Quote
Yes, that will work just fine. I am totally tired today. Thanks CareFree!

Don't forget the Response.End after the Response.Redirect

Response.Redirect strForumURL
Response.End
<

Edited by - Etymon on 01 August 2008 18:51:35
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000 Version 3.4.07