try this code...it is a smei updated version:
<%
response.buffer = true
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_header.asp" -->
<%
set rs = server.CreateObject("ADODB.RecordSet")
set rsactive_users = server.CreateObject("ADODB.RecordSet")
If trim(strDBNTUserName)="" Then
' No user/password so ask user
response.write "<br><br><P><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><center><b>You need to login to create or view buddys.</b><br><br>If you have not registered then you can <a href=""register.asp"">do so</a> for free.</P>" & vbNewLine
Response.End
End If
' Got password details so do it
Select Case Request.QueryString("mode")
Case "add"
strBuddy = Request.QueryString("id")
testSql ="SELECT * FROM "& strTablePrefix & "Buddys WHERE BudMemberID=" & getmemberID(strDBNTUserName) & " and BudBudID=" & strBuddy
rs.Open testSql, my_Conn
If rs.BOF or rs.EOF Then
' Buddy doesn't already exist so add it
insSql = "INSERT INTO "& strTablePrefix & "Buddys (BudMemberID, BudBudID) VALUES ("
insSql = insSql & getmemberID(strDBNTUserName) & ", "
insSql = insSql & strBuddy & ")"
my_conn.Execute (insSql)
End If
Response.Write "<br><center><p><font size="" & strDefaultFontSize & ""><b>Buddy Added!</b></font></p>" & vbNewLine & _
"<p><font face="" & strDefaultFontFace & "" size="" & strDefaultFontSize & "">" & vbNewLine & _
"You can view any of your buddy list<br>" & vbNewLine & _
"at any time by clicking the "My Buddy List" link by the login window.<br> " & vbNewLine & _
"</font></p></center>" & vbNewLine & _
" <div align=""center""><font face="" & strDefaultFontFace & "" size=""2""><a href=""default.asp"">Go Back to Main Page</a></font>" & vbNewLine & _
"</div>" & vbNewLine & _
" <p> <p> <p>" & vbNewLine
Case "delete"
i = request("i")
aBudCheck = split(i, ",")
dim ibudloop
for ibudloop = 0 to UBound(aBudCheck)
' Delete selected Buds
delSQL = "Delete From "& strTablePrefix & "Buddys where Buddy_ID=" & aBudCheck(ibudloop)
my_conn.Execute delSQL
next
response.write "<br><center><font face=""" & strDefaultFontFace & """ size=3><b>Selected Buddys Deleted!</b></font><br>" & vbNewLine & _
"<a href=""default.asp""><br>Back to Forum<br></a></center>" & vbNewLine & _
"<meta http-equiv=""Refresh"" content=""2; URL=default.asp"">"
Case "deleteAll"
delBuddy = split(Request.Form("delBuddy"), ",")
delSQL = "Delete From "& strTablePrefix & "Buddys where BudMemberID=" & getmemberID(strDBNTUserName)
my_conn.Execute delSQL
response.write "<br><center><font face=""" & strDefaultFontFace & """ size=3><b>All Buddys Deleted!</b></font><br>" & vbNewLine & _
"<a href=""default.asp"">Back to Forum</a></center>" & vbNewLine
Case default
If trim(strDBNTUserName)="" Then
Response.Write " <p align=""center""><font face="" & strDefaultFontFace & "" size="" & strHeaderFontSize & "">Invalid UserName or Password</font></p>" & vbNewLine & _
" <p align=""center""><font face="" & strDefaultFontFace & "" size="" & strDefaultFontSize & ""><a href=""JavaScript:history.go(-1)"">Go Back To Retry</a></font></p>" & vbNewLine
Response.end
end if
'### Returns List of Your Buddies
strSql = "SELECT " & strMemberTablePrefix & "Buddys.Buddy_ID, " & strMemberTablePrefix & "Buddys.budmemberid, " & strMemberTablePrefix & "Buddys.budbudid, " & strMemberTablePrefix & "members.m_name, " & strMemberTablePrefix & "members.member_id"
strSql = strSql & " FROM ("& strMemberTablePrefix & "Members INNER JOIN " & strMemberTablePrefix & "Buddys ON " & strMemberTablePrefix & "Members.Member_ID=" & strMemberTablePrefix & "Buddys.budbudID)"
strSql = strSql & " where ("& strMemberTablePrefix & "Buddys.budmemberid=" & getmemberID(strDBNTUserName) & ")"
rs.Open strSQL, my_Conn
'###
'### Returns Buddies Who Are Online
strSqlactive_users = "SELECT " & strMemberTablePrefix & "MEMBERS.M_NAME," & strMemberTablePrefix & "ACTIVE_USERS.AU_LASTPAGE"
strSqlactive_users = strSqlactive_users & " FROM (" & strMemberTablePrefix & "ACTIVE_USERS INNER JOIN " & strMemberTablePrefix & "MEMBERS ON " & strMemberTablePrefix & "ACTIVE_USERS.MEMBER_ID =" & strMemberTablePrefix & "MEMBERS.MEMBER_ID) INNER JOIN " & strMemberTablePrefix & "BUDDYS ON " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strMemberTablePrefix & "BUDDYS.BUDMEMBERID"
'response.write strsql
rsactive_users.open strSqlactive_users, my_Conn
'###
Response.Write " <table width=""100%"" border=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td><form name=""LastDateFrm"" action=""buddy.asp"" method=""post""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & getCurrentIcon(strIconFolderOpen,"","") & " <a href=""default.asp"">All Forums</a><br />" & vbNewLine & _
" " & getCurrentIcon(strIconBar,"","") & getCurrentIcon(strIconFolderOpenTopic,"","") & " My Buddies<br />" & vbNewLine & _
" " & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBlank,"","") & getCurrentIcon(strIconBlank,"","") & "</font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
"<br>" & vbNewLine & _
"<form Action=""buddy.asp?mode=delete"" method=""post"" id=""form1"" name=""form1"">" & vbNewLine & _
"<table bgcolor=""" & strTableBorderColor & """ align=""center"" border=""0"" cellPadding=""3"" cellSpacing=""1"" width=""60%"">" & vbNewLine & _
"<tr>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ align=""center"" width=""100""><font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strFooterFontSize & """><b>Contact</b></font></td>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strFooterFontSize & """><b>Buddy</b></font></td>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ align=""center""><font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strFooterFontSize & """><b>Online Status</b></font></td>" & vbNewLine & _
" <td bgcolor=""" & strHeadCellColor & """ align=""center"" width=""50""><font face=""" & strDefaultFontFace & """ color=""" & strHeadFontColor & """ size=""" & strFooterFontSize & """><b>Delete <a href=""buddy.asp?mode=deleteAll"" title=""Delete all buddys"">All</a></b></font></td>" & vbNewLine & _
"</tr>" & vbNewLine
If rs.Eof OR rs.Bof Then
Response.Write "<td colspan=4 bgcolor='" & strForumCellColor & "'><font face='" & DefaultFontFace & "' size='2'><b>No Buddies Found</b></font></td>"
Else
' List buddies
do until rs.eof
if not rsactive_users.eof then
if rsactive_users("M_NAME")= rs("m_name") then
'onlinestatus = rsactive_users("AU_LASTPAGE")
onlinestatus = "Online"
rsactive_users.movenext
else
onlinestatus = "Offline"
end if
end if
if xx=0 then
CColor = strAltForumCellColor
else
CColor = strForumCellColor
End if
strSql3 = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strTablePrefix & "ACTIVE_USERS.MEMBER_ID "
strSql3 = strSql3 & " FROM " & strTablePrefix & "MEMBERS, " & strTablePrefix & "ACTIVE_USERS "
strSql3 = strSql3 & " WHERE " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & rs("M_NAME") & "' "
set rsMember = my_Conn.Execute (strSql3)
'### Added for Icons
strSql2 = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_STATUS, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strMemberTablePrefix & "MEMBERS.M_LEVEL, " & strMemberTablePrefix & "MEMBERS.M_EMAIL, " & strMemberTablePrefix & "MEMBERS.M_COUNTRY, " & strMemberTablePrefix & "MEMBERS.M_HOMEPAGE, " & strMemberTablePrefix & "MEMBERS.M_ICQ, " & strMemberTablePrefix & "MEMBERS.M_YAHOO, " & strMemberTablePrefix & "MEMBERS.M_AIM, " & strMemberTablePrefix & "MEMBERS.M_TITLE, " & strMemberTablePrefix & "MEMBERS.M_POSTS, " & strMemberTablePrefix & "MEMBERS.M_LASTPOSTDATE, " & strMemberTablePrefix & "MEMBERS.M_LASTHEREDATE, " & strMemberTablePrefix & "MEMBERS.M_DATE "
'response.write strsql2
' strSql2 = strSql2 & " FROM " & strMemberTablePrefix & "MEMBERS WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID =" & rsMember("MEMBER_ID")
strSql2 = strSql2 & " FROM " & strMemberTablePrefix & "MEMBERS WHERE " & strMemberTablePrefix & "MEMBERS.MEMBER_ID =" & getmemberID(strDBNTUserName) & ""
set rs2 = my_Conn.Execute (strSql2)
'###
Response.Write " <tr>" & vbNewLine & _
" <td align=""left"" bgcolor=""" & Ccolor & """>" & vbNewLine & _
" <font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strDefaultFontColor & """></font>" & vbNewLine
if (strAIM = "1") then
if Trim(Member_AIM) <> "" then
Response.Write " <a href=""JavaScript:openWindow('pop_messengers.asp?mode=AIM&ID=" & ChkString(rs2("M_AIM") & "')"">" & getCurrentIcon(strIconAIM,"Send " & ChkString(M_NAME,"display") & " an AOL message","align=""absmiddle"" hspace=""6""")) & "</a>" & vbNewLine
end if
end if
if (strICQ = "1") then
if Trim(Member_ICQ) <> "" then
Response.Write " <a href=""JavaScript:openWindow('pop_messengers.asp?mode=ICQ&ID=" & TMember_ID & "')"">" & getCurrentIcon(strIconICQ,"Send " & ChkString(Member_Name,"display") & " an ICQ Message","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (strMSN = "1") then
if Trim(Member_MSN) <> "" then
Response.Write " <a href=""JavaScript:openWindow('pop_messengers.asp?mode=MSN&ID=" & TMember_ID & "')"">" & getCurrentIcon(strIconMSNM,"Click to see " & ChkString(Member_Name,"display") & "'s MSN Messenger address","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
if (strYAHOO = "1") then
if Trim(Member_YAHOO) <> "" then
Response.Write " <a href=""http://edit.yahoo.com/config/send_webmesg?.target=" & ChkString(Member_YAHOO, "urlpath") & "&.src=pg"" target=""_blank"">" & getCurrentIcon(strIconYahoo,"Send " & ChkString(Member_Name,"display") & " a Yahoo! Message","align=""absmiddle"" hspace=""6""") & "</a>" & vbNewLine
end if
end if
If (Member_PM = "1" and strPMStatus = "1") Then
if Trim(Member_PM) <> "" then
Response.Write " <a href=""privatesend.asp?method=Topic&mname=" & ChkString(Member_Name,"display") & """>" & getCurrentIcon(strIconPmprivatemessage,"Send " & ChkString(Member_Name,"display") & " a Private Message","align=""absmiddle"" hspace=""0""") & "</a>" & vbNewLine
End If
End IF
%>
<a href="privatesend.asp?method=Topic&mname=<% =rsMember("M_NAME") %>"><img src="<%=strImageURL %>icon_privatemessage.gif" width="11" height="17" alt="Send <% = ChkString(rsMember("M_NAME"),"display") %> a Private Message" border="0" hspace="4"></a>
<% if strICQ = "1" and Trim(rs2("M_ICQ")) <> "" then %>
<a href="JavaScript:openWindow('pop_messengers.asp?mode=ICQ&ICQ=<% =ChkString(rs2("M_ICQ"), "JSurlpath") %>&M_NAME=<% =ChkString(rsMember("M_NAME"),"display") %>')"><img src="http://online.mirabilis.com/scripts/online.dll?icq=<% =chkstring(rs2("M_ICQ"), "urlpath") %>&img=5" height="15" width="15" alt="Send <% =ChkString(rsMember("M_NAME"),"display") %> an ICQ Message" border="0" hspace="4"></a>
<% end if %>
<% if strYAHOO = "1" and Trim(rs2("M_YAHOO")) <> "" then %>
<a href="JavaScript:openWindow('http://edit.yahoo.com/config/send_webmesg?.target=<% =ChkString(rs2("M_YAHOO"), "JSurlpath") %>&.src=pg')">
<img src="http://opi.yahoo.com/online?u=<%=rs2("M_YAHOO")%>&m=g" border="0" alt="Send <% =ChkString(rsMember("M_NAME"),"display") %> a Yahoo message" hspace="4"></a>
<% end if %>
<% if strAIM = "1" and Trim(rs2("M_AIM")) <> "" then %>
<a href="JavaScript:openWindow('pop_messengers.asp?mode=AIM&AIM=<% =ChkString(rs2("M_AIM"), "JSurlpath") %>&M_NAME=<% =ChkString(rsMember("M_NAME"),"JSurlpath") %>')"><img src="<%= strImageURL %>icon_aim.gif" height="15" width="15" alt="Send <% =ChkString(rsMember("M_NAME"),"display") %> an AOL instant message" border="0" hspace="4"></a>
<% end if %>
</td>
<%
Response.Write "<td bgcolor='" & CColor & "' align=center><font face='" & strDefaultFontFace & "' color=" & strForumFontColor & " size='2'>"
Response.Write "<a href='pop_profile.asp?mode=display&id=" & rs("BudbudID") & "'>" & FormatStr(left(rs("m_name"), 50)) & "</a></b><font size=-2></td>"
Response.Write "<TD bgcolor=" & CColor & " align=center><font face=" & strDefaultFontFace & " color=" & strForumFontColor & " size=2>" & OnlineStatus & "</td>"
Response.Write "<TD bgcolor=" & CColor & " align=left><font face=" & strDefaultFontFace & " color=" & strForumFontColor & " size=2><input type=checkbox name=""i"" value=""" & rs("Buddy_ID") & """></td></tr>"
rs.MoveNext
rsMember.movenext
rs2.movenext
onlinestatus = "Offline"
xx=xx+1
If xx=2 then
xx=0
end if
loop
End If
%>
<tr>
</table>
<div align="center">
<input type="submit" name="del" value="Delete Selected Buddys">
</div>
</form>
<div align="center"><font face="<% =strDefaultFontFace %>" size="2"><a href="default.asp">Go Back</a></font>
</div>
<%
End Select
set rs = nothing
set rsactive_users = nothing
%>
<!--#include file="inc_footer.asp"-->