T O P I C R E V I E W |
Etymon |
Posted - 17 July 2008 : 11:51:13 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. < |
14 L A T E S T R E P L I E S (Newest First) |
Etymon |
Posted - 01 August 2008 : 18:50:28 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 < |
Carefree |
Posted - 01 August 2008 : 18:04:16 Simplify that routine, Etymon. Put this at the top before includes.
if mLev<1 then Response.Redirect strForumURL
That's it, all you need.< |
Etymon |
Posted - 01 August 2008 : 17:32:56 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. < |
Etymon |
Posted - 01 August 2008 : 17:10:06 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 < |
Carefree |
Posted - 01 August 2008 : 15:33:25 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.< |
modifichicci |
Posted - 01 August 2008 : 12:48:19 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 < |
Etymon |
Posted - 01 August 2008 : 12:29:44 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.< |
Etymon |
Posted - 01 August 2008 : 10:55:13 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! < |
Classicmotorcycling |
Posted - 01 August 2008 : 10:11:40 Etymon,
your fix worked nice and easy. Now getting results from the search. < |
Etymon |
Posted - 01 August 2008 : 09:32:39 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!< |
modifichicci |
Posted - 01 August 2008 : 09:17:14 to fix it: lines 251 -258
changed to:
lines 503 - 511
changed to:
lines 628 - 630
changed to
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< |
Etymon |
Posted - 01 August 2008 : 08:56:10 Thanks guys for the help! I'll take a look at it as soon as I can. < |
Classicmotorcycling |
Posted - 01 August 2008 : 06:42:48 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.< |
Carefree |
Posted - 01 August 2008 : 04:49:14 See your EMail. I sent you a revision.< |