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)
 Private message alert in inc_top.asp
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Webbo
Average Member

United Kingdom
982 Posts

Posted - 27 June 2002 :  04:23:35  Show Profile  Visit Webbo's Homepage
Hi everyone,

Is there a way of displaying an alert in the inc_top file when a user has a new private message?
Something along the lines of an image with a little text to notify the member.

Thanks, Dave

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 27 June 2002 :  06:50:55  Show Profile
I got this code from the privatemess.asp file.

In the inc_top.asp file find this code around line 362


<% if (mlev = 4) or (lcase(strNoCookies) = "1") then %>
<tr>
<td align="center">
<font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>">
<a href="admin_home.asp">Admin Options</a>
</font>
</td>
</tr>
<% end if %>
</form>
<% end if %>


After that add this


<% if strDBNTUserName <> "" then
' Get Private Message count for display on Default.asp
if strDBType = "access" then
strSqL = "SELECT count(M_TO) as [pmcount] "
else
strSqL = "SELECT count(M_TO) as pmcount "
end if
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS , " & strTablePrefix & "PM "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & strDBNTUserName & "'"
strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_TO "
strSql = strSql & " AND " & strTablePrefix & "PM.M_READ = 0 "

Set rsPM = my_Conn.Execute(strSql)
pmcount = rsPM("pmcount")

rsPM.close
set rsPM = nothing

if pmCount > 0 then
response.write"you have mail"
end if
end if
%>


you could change the response.write"you have mail" bit to output an image if you had one etc. I only had a quick look to see if it appeared on the dafault.asp page, but it should appear on every page.


I feel sorry for people who don't drink. When they wake up in the morning, that's as good as they're going to feel all day.
--Frank Sinatra


Edited by - Hamlin on 27 June 2002 06:51:22
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 27 June 2002 :  07:38:20  Show Profile  Visit Webbo's Homepage
Thanks Hamlin,

Works a treat.

I have added a table around it and made the alert linked to the pm_view.asp file.
Included at the end of inc_top.asp it shows the alert above the forum's folder tree::


<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td width="100%">
<% if strDBNTUserName <> "" then
' Get Private Message count for display on Default.asp
if strDBType = "access" then
strSqL = "SELECT count(M_TO) as [pmcount] "
else
strSqL = "SELECT count(M_TO) as pmcount "
end if
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS , " & strTablePrefix & "PM "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & strDBNTUserName & "'"
strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_TO "
strSql = strSql & " AND " & strTablePrefix & "PM.M_READ = 0 "
Set rsPM = my_Conn.Execute(strSql)
pmcount = rsPM("pmcount")
rsPM.close
set rsPM = nothing

if pmCount > 0 then
response.write" " & vbNewline & _
" <a href=""pm_view.asp""><acronym title=""Click to read Message"">You have a new Private Message</acronym></a>" & vbNewline
end if
end if
%>
</td>
</tr>
</table>



Just got to make an image now

Dave


(Sorry about the lack of spaces/formatting but for some reason when I paste or copy from here I can't seem to lose it)

Edited by - Webbo on 27 June 2002 07:44:09
Go to Top of Page

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 27 June 2002 :  07:45:33  Show Profile
I actually forgot to put the <tr><td align="center"> and </td></tr> tags around it in my post, i had it under the admin options link, but glad it works .


I feel sorry for people who don't drink. When they wake up in the morning, that's as good as they're going to feel all day.
--Frank Sinatra
Go to Top of Page

Webbo
Average Member

United Kingdom
982 Posts

Posted - 27 June 2002 :  08:29:51  Show Profile  Visit Webbo's Homepage
Finally all sorted::

<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td width="100%"><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>">
<% if strDBNTUserName <> "" then
' Get Private Message count for display on Default.asp
if strDBType = "access" then
strSqL = "SELECT count(M_TO) as [pmcount] "
else
strSqL = "SELECT count(M_TO) as pmcount "
end if
strSql = strSql & " FROM " & strMemberTablePrefix & "MEMBERS , " & strTablePrefix & "PM "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & strDBNTUserName & "'"
strSql = strSql & " AND " & strMemberTablePrefix & "MEMBERS.MEMBER_ID = " & strTablePrefix & "PM.M_TO "
strSql = strSql & " AND " & strTablePrefix & "PM.M_READ = 0 "
Set rsPM = my_Conn.Execute(strSql)
pmcount = rsPM("pmcount")
rsPM.close
set rsPM = nothing

if pmCount > 0 then
response.write" " & vbNewline & _
" <a href=""pm_view.asp""><img border=""0"" src=""icon_newmessage.gif""><acronym title=""Click to read Message"">You have a new Private Message</acronym></a>" & vbNewline
end if
end if
%>
</font>
</td>
</tr>
</table>




Using this image:

Thanks,

Dave
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07