On the active_users.asp page, I have added a PM icon & link next to the Active Members, Members profile icon, similar to the idea that is given in members.asp (with the PM Mod installed).
Using the following code in active_users.asp (please excuse colours but it may help explanation...)
The new code is between '******pm mod***
red is added 'if' statement1
orange is alternative 'if' statement2
green is existing code around lines 944
Code:
response.write getCurrentIcon(strIconProfile,fLang(strLangMOD_Ls3kAU_01460) & " " & rsAM("M_NAME") & fLang(strLangMOD_Ls3kAU_01470),"hspace=""0""") & "</a>" & VBNewLine
'************pm mod****************
'If strDBNTUserName <> "" and strPMStatus = "1" Then
If strDBNTUserName <> "" and Trim(rs("M_PMRECEIVE")) = "1" and strPMStaus = "1" Then
Response.Write " <a href=""privatesend.asp?method=Topic&mname=" & ChkString(rsAM("M_NAME"),"display") & """>" & getCurrentIcon(strIconPmprivatemessage,"Send " & ChkString(rsAM("M_NAME"),"display") & " a Private Message","align=""absmiddle"" hspace=""0""") & "</a>" & vbNewLine
End If
'***********pm mod end*************
if strICQ = "1" and Trim(rsAM("M_ICQ")) <> "" then
Trying to achieve the same functionality to control the pm link from members PM Options, and the Admin control, I have used the 'if' statement1 (red) from pop_profile.asp and members.asp but receive the following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'rs'
/forum/active_users.asp, line 948 However if I use the 'if' statement2 (orange) the PM Link/Icon displays and no errors. However if a member switches off the PM facility from PM_options.asp, the PM Link still shows. But as admin, I can turn the link off from admin option PM Maintenance.
The error message could be mismatching the rs string
and Trim(rs("M_PMRECEIVE")) = "1"
Only a novice with code, I wonder if someone could provide a solution to get rid of the mis match.
Learning thoughts: Do we need a sql to pull the M_PMRECEIVE to get the AND statement to work?
If I change statement1 from
If strDBNTUserName <> "" and Trim(rs("M_PMRECEIVE")) = "1" and strPMStaus = "1" Then
to
If strDBNTUserName <> "" and M_PMRECEIVE = "1" and strPMStaus = "1" Then
I get no error and the PM Link/Icon does not display
Any help in getting this functionality to work would be greatly appreciated..Incidentally, when the PM icon/link is displaying it works correctly to link to the PM options.
<