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/Code)
 "New Private Message" alert mod
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

AWD_ENVY
Junior Member

103 Posts

Posted - 19 June 2002 :  11:18:23  Show Profile
Not sure if someone already did this, but I wanted this feature......

If a new messages is recived it alearts the user, and prompts them with a javascript box to read the message. It works just like the pager, only the pager window doesn't have to be up.

Someone might want to get creative and make a DB check modification to make it only aleart once insted of everytime a page loads. Also maybe add some variables to turn the feature on/off in the admin section.


You must have the PM pager MOD to take advantage of this.....

Make the following a page called "inc_pm_alert.asp"

<%
'###############################################################################Adding pager message notification. #####################################

if strDBNTUserName <> "" Then

' Get Private Message count
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")

if pmcount >= 1 then

strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strTablePrefix & "PM.M_ID, " & strTablePrefix & "PM.M_TO, " & strTablePrefix & "PM.M_SUBJECT, " & strTablePrefix & "PM.M_SENT, " & strTablePrefix & "PM.M_FROM, " & strTablePrefix & "PM.M_READ "
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 & " ORDER BY " & strTablePrefix & "PM.M_SENT DESC"

Set rsMessage = my_Conn.Execute(strSql)
%>
<EMBED SRC="newmsg.wav" WIDTH=1 HEIGHT=1 HIDDEN="true" AUTOSTART="true" LOOP="false" volume="100"></EMBED>
<script language=javascript>

if (window.print) {
agree = confirm('You have a new Private Message!\n Would you like to view it now ?');
if (agree) window.open('pm_pop_read.asp?id=<% =rsMessage("M_ID") %>','_blank','width=490,height=340,top=75,left=220,scrollbars=yes')
else window.close();
}
</script>

<%
END IF
END IF


'############################################################################### END :Adding pager message notification: ###########################
%>



Then Place <!--#INCLUDE FILE="inc_pm_alert.asp" --> Just "after" the <!--#INCLUDE FILE="inc_top.asp" --> line on the pages you want it to go off.....



I've installed it on the following pages.... default.asp,topic.asp,forum.asp

Edited by - AWD_ENVY on 19 June 2002 17:26:52

blackinwhite
Average Member

Turkey
657 Posts

Posted - 20 June 2002 :  05:58:39  Show Profile
someone did something similar to this using VB script.

it was
<SCRIPT LANGUAGE="VBscript">
returnvalue=MsgBox ("Yeni özel mesajý okumak ister misiniz?",36,"Özel Mesajýnýz Var!")
If returnvalue=6 Then
window.location="pm_view.asp?read=ok"
Else
End If
</SCRIPT>


yours seems more detailed solution for this.

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 22 June 2002 :  13:04:41  Show Profile  Visit dayve's Homepage
quote:

someone did something similar to this using VB script.

it was
<SCRIPT LANGUAGE="VBscript">
returnvalue=MsgBox ("Yeni özel mesajý okumak ister misiniz?",36,"Özel Mesajýnýz Var!")
If returnvalue=6 Then
window.location="pm_view.asp?read=ok"
Else
End If
</SCRIPT>


yours seems more detailed solution for this.





I posted my version awhile ago too which was a little simpler and extremely effective. by the way, b&w, the snippet you posted is not Netscape compatible because VBScript does not work client side on NS.


http://www.nineinchnailz.com

Edited by - dayve on 22 June 2002 13:04:59
Go to Top of Page

stwilson
Junior Member

USA
385 Posts

Posted - 15 August 2002 :  02:51:55  Show Profile  Visit stwilson's Homepage
quote:

I posted my version awhile ago too which was a little simpler and extremely effective. by the way, b&w, the snippet you posted is not Netscape compatible because VBScript does not work client side on NS.



Would you mind posting it again? I have searched and searched and searched but could not find it.

STW

Shannon
RidingArizona.com
Go to Top of Page

MarkJH
Senior Member

United Kingdom
1722 Posts

Posted - 05 September 2002 :  12:50:20  Show Profile  Visit MarkJH's Homepage
Ditto.

I installed the PM Pager mod but it isn't really what i'm after.

Dayve, what i'm after is something that'll popup whenever the member gets a new PM. They can then click on the popup box either to close it or to close the popup and go directly to their inbox.

Is this what your code does?

Bandlink.net - http://www.bandlink.net/
Bandlink Music Forums - http://www.bandlink.net/forum/
Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 05 September 2002 :  13:13:34  Show Profile  Visit Lydecker's Homepage
nice mod (the top post) but it ends up opening up windows (pop-ups) and tring to install plugins!

Does anyone have a 3.4.02 version working??

THanks
Go to Top of Page

philgsy
Starting Member

United Kingdom
18 Posts

Posted - 05 September 2002 :  18:43:37  Show Profile  Visit philgsy's Homepage  Send philgsy a Yahoo! Message
quote:
Originally posted by Lydecker

nice mod (the top post) but it ends up opening up windows (pop-ups) and tring to install plugins!

Does anyone have a 3.4.02 version working??

THanks



There is a line of code, which you can add
check out the post by CaNgo here: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=33717&whichpage=4

It will put up an alert box, every time the user goes anywhere on the forum while they have new mail. It asks them if they want to read it, and if they say "Yes" wether to open a new windoe for the inbox, or load it in the current page.
(You cant stop it though. If you dont read your mail, it will keep coming up, until you read...!)
Hope this helps in some small way...
Go to Top of Page

DoraMoon
Average Member

Taiwan
661 Posts

Posted - 05 September 2002 :  20:47:38  Show Profile
quote:
Originally posted by Lydecker

nice mod (the top post) but it ends up opening up windows (pop-ups) and tring to install plugins!

you can include this file in inc_footer.asp, so it wo'nt freeze the page load when the alert window popup.
</html>
<!--#INCLUDE FILE="inc_pm_alert.asp"-->
<%
my_Conn.Close
set my_Conn = nothing
%>


and it play a sound file newmsg.wav when new PM coming.. i think most of browsers should support this "plugin".

anyway, you can refer to the post philgsy mentioned above. and try to do some tweak to fit your need.. (yeah~ i think it need some tweak to make it better. )

~......~.~~
Go to Top of Page

vasanthm
Starting Member

35 Posts

Posted - 06 September 2002 :  00:20:53  Show Profile
It looks like some one si tryin to copy my code and idea... Well ok below is the code.. But i have still not added the feature of turning it off... Add this in the inc_footer.asp file.. it works perfect..... I had already posted this in the PM thread... I hvae got another add in mod there which shows all the message to the admin... Check it out...


find this line in the inc_footer.asp and add the below code under it
'## END - REMOVAL, MODIFICATION OR CIRCUMVENTING THIS CODE
WILL VIOLATE THE SNITZ FORUMS 2000 LICENSE AGREEMENT





If Instr(Request.ServerVariables("Path_Info"), "pm_view.asp") < 1  then

	if MemberID > 0 then 
		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 " <script language=""JavaScript""> { input_box=confirm(""You have a new private message. Click OK to view it, or cancel to hide this prompt.""); if (input_box==true) { second_box=confirm(""Open in new window?\n\n(Press cancel to open your Inbox in the current window.)""); if (second_box==true) { window.open('pm_view.asp?s=','pmnew','width=600,height=500,menubar=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,top=50,left=50'); } else { window.location=""pm_view.asp?s=""; }} else { }} // </script>" 
			end if 
		end if 
	end if 
End If

 



Go to Top of Page

Lydecker
Junior Member

United Kingdom
297 Posts

Posted - 06 September 2002 :  08:59:21  Show Profile  Visit Lydecker's Homepage
Can someone explain why when I use the code:
<EMBED SRC="newmsg.wav" WIDTH=1 HEIGHT=1 HIDDEN="true" AUTOSTART="true" LOOP="false" volume="100"></EMBED>

It SERIOUSLY reduces the audio quality in playback?

Thanks
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.26 seconds. Powered By: Snitz Forums 2000 Version 3.4.07