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/O Code)
 PM Link in Active Users
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 05 June 2008 :  03:31:02  Show Profile  Reply with Quote
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

 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.
<

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 05 June 2008 :  04:18:11  Show Profile  Reply with Quote
You cannot call a value from a sql group (rs) without creating one.

Re-read the private messaging mod. The routines to add PMs to active users are already done, you probably skipped them because you added the PMs first.<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 05 June 2008 :  07:45:01  Show Profile  Reply with Quote
Carefree, I have revisited the PM Mod and prior to installing it I already had the Active Users incorporated. The PM Mod, makes no mention to PM Links in Active Users just the LangMODS_Ls3kAU4_1033 alterations for PM pages..<
Go to Top of Page

Carefree
Advanced Member

Philippines
4217 Posts

Posted - 05 June 2008 :  09:16:50  Show Profile  Reply with Quote
Look for this:

		Response.Write getCurrentIcon(strIconProfile,fLang(strLangMOD_Ls3kAU_01460) & " " & rsAM("M_NAME") & fLang(strLangMOD_Ls3kAU_01470),"hspace=""0""") & "</a>" & vbNewLine


After that, add the following:

		'************pm mod****************
		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
		'***********pm mod end*************
<
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 05 June 2008 :  11:14:05  Show Profile  Reply with Quote
Carefree that is the code I had at the top of this thread and it did not turn off the icon and link when members disabled private messages from the PM Options.

I added an 'if' statement at the beginning
If strDBNTUserName <> "" and Trim(rs("M_PMRECEIVE")) = "1" and strPMStaus = "1" Then which works with members.asp and pop_profile.asp however, does not here.
I adjusted the code to:
If strDBNTUserName <> "" and strPMStatus = "1" Then and the enabling and disabling only worked with admin controlling the facility from PM Maintenance.

We have established that the M_PMRECEIVE="1" needs to be functional for the enable/disable to work from members too.

The code proded above will only insert a hard icon and not able to disable.

The plot thickens..


<
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 05 June 2008 :  12:08:14  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
active_users.asp

find line 124-125

'## Ls3k - Get Online Members information, and print whatever we get
strSql = "SELECT ME.MEMBER_ID, ME.M_NAME, ME.M_AUHIDE, AU.AU_IP, AU.AU_LOGINTIME, AU.AU_LASTACTIVETIME, AU.AU_LASTPAGE, ME.M_ICQ, ME.M_YAHOO, ME.M_AIM, ME.M_MSN, ME.M_LEVEL, AU.AU_QUERYSTRING, AU.AU_USER_AGENT " & _


change it to this - added part in red


'## Ls3k - Get Online Members information, and print whatever we get
strSql = "SELECT ME.MEMBER_ID, ME.M_PMRECEIVE, ME.M_NAME, ME.M_AUHIDE, AU.AU_IP, AU.AU_LOGINTIME, AU.AU_LASTACTIVETIME, AU.AU_LASTPAGE, ME.M_ICQ, ME.M_YAHOO, ME.M_AIM, ME.M_MSN, ME.M_LEVEL, AU.AU_QUERYSTRING, AU.AU_USER_AGENT " & _



then find line 699

    response.write getCurrentIcon(strIconProfile,fLang(strLangMOD_Ls3kAU_01460) & " " & rsAM("M_NAME") & fLang(strLangMOD_Ls3kAU_01470),"hspace=""0""") & "</a>" & VBNewLine


and add this under it

	If strDBNTUserName <> "" and Trim(rsAM("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


i havent tested it, but i woud limage it will work<

© 1999-2010 MaD2ko0l
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 05 June 2008 :  13:30:18  Show Profile  Reply with Quote
Mad2ko0l, initially I tried that and got an error:
Microsoft VBScript compilation error '800a03f8'
Expected 'Sub'
/forum/active_users.asp, line 948
end if
----^

I removed the last end if and The active_users page.asp displays but the PM Link is missing. I have PM enabled both on Admin Maintenance and PM Options. It seems its not picking up M_PMRECEIVE in the AND statement, because if I remove the and Trim(rsAM("M_PMRECEIVE")) = "1" the icon shows but is only controlled (enabled/disabled) by admin PM Maintenance and not individual member PM Options

??<
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 05 June 2008 :  14:25:12  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
check you code, because i have only added the sql statement m_PMRECIEVE...the if statement was the same as your apart from this bit

If strDBNTUserName <> "" and Trim(rsAM("M_PMRECEIVE")) = "1" and strPMStaus = "1" Then

rsAM was changed from just rs

i will test it on my forums in a sec and see what i can come up with<

© 1999-2010 MaD2ko0l
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 05 June 2008 :  15:54:44  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
  If strDBNTUserName <> "" and Trim(rsAM("M_PMRECEIVE")) = "1" and strPMStatus = "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


u missed the "t" from strPMStatus<

© 1999-2010 MaD2ko0l
Go to Top of Page

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 05 June 2008 :  16:13:11  Show Profile  Reply with Quote
Thanks everso much, what a silly mistake the missing 't'
I thank you for your effort and Carfree too.
I'm off for a short while for a cuppa... T
andy<
Go to Top of Page

MaD2ko0l
Senior Member

United Kingdom
1053 Posts

Posted - 05 June 2008 :  17:32:25  Show Profile  Visit MaD2ko0l's Homepage  Reply with Quote
lol, glad i could help<

© 1999-2010 MaD2ko0l
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.62 seconds. Powered By: Snitz Forums 2000 Version 3.4.07