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)
 mini, mini, mini-mod: PM alert!
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

giorgiusx
Starting Member

28 Posts

Posted - 03 February 2003 :  08:05:56  Show Profile
When you have new PM, an alert will be displayed.
(need private messages mod to run!)

In privatemess.asp look for these lines:
(near bottom of file)

if pmcount >=1 then
Response.Write "<font color=""#000000"" size=""3""><b>" & pmcount & "</b></font>"

add below it:

Response.Write "<script>" & vbNewLine & _
"alert (""You have e new PM!\nTake a look in your InBox!!"");" & vbNewLine & _
"</script>"

_____________________
You can sobstitute it with another javascript opening a new window, sound, ecc...

I think usefoul!

blink_26
Starting Member

3 Posts

Posted - 03 February 2003 :  11:04:37  Show Profile
I did this as well, but you need to set a bolean field in the Database to check if this has been displayed before.

Otherwise, someone might want to look at something before reading messages and they will always get that popup.
Go to Top of Page

giorgiusx
Starting Member

28 Posts

Posted - 03 February 2003 :  11:43:46  Show Profile
no, no, no, no....just first time you enter in forum it pop-up!
if you read it, then it not pop-up more.

if you prefer to look at something before...i think it's a good reminder. Or not?
Go to Top of Page

laser
Advanced Member

Australia
3859 Posts

Posted - 03 February 2003 :  15:09:12  Show Profile
I asked about this the other day, but couldn't find the code - thanks giorgiusx


[edit]
I changed the line to :

"alert (""You have a new PM!\nClick on the Private Messages link at the top of this page to read"");" & vbNewLine & _

Fixing the typo, and making it more "dumbed down", I know people who would read your message and go to their email Inbox
[/edit]

Edited by - laser on 03 February 2003 15:20:41
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 07 February 2003 :  12:06:46  Show Profile  Visit MarcelG's Homepage
I've used a 'real' popup!
We use a framespage for our Intranet, and I've created a 'hidden' frame (a frame with a height of zero..)
In this hidden frame I open the file startpage.asp.
Startpage.asp checks if there are any unread messages on the forum, and if so, pops up a new window with pm_view.asp loaded.

BTW, we use NT authentication, so maybe it only works if this is used.
BTW2, i've modded the file active_users.asp, and added the case="startpage.asp", to show people who only have this file opened to be 'outside the forums'.

Just copy the code below, and paste it into startpage.asp or something like that.
<%
'#################################################################################
'## Copyright (C) 2000-02 Michael Anderson, Pierre Gorissen,
'##                       Huw Reddick and Richard Kinser
'##
'## This program is free software; you can redistribute it and/or
'## modify it under the terms of the GNU General Public License
'## as published by the Free Software Foundation; either version 2
'## of the License, or any later version.
'##
'## All copyright notices regarding Snitz Forums 2000
'## must remain intact in the scripts and in the outputted HTML
'## The "powered by" text/logo with a link back to
'## http://forum.snitz.com in the footer of the pages MUST
'## remain visible when the pages are viewed on the internet or intranet.
'##
'## This program is distributed in the hope that it will be useful,
'## but WITHOUT ANY WARRANTY; without even the implied warranty of
'## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'## GNU General Public License for more details.
'##
'## You should have received a copy of the GNU General Public License
'## along with this program; if not, write to the Free Software
'## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
'##
'## Support can be obtained from support forums at:
'## http://forum.snitz.com
'##
'## Correspondence and Marketing Questions can be sent to:
'## reinhold@bigfoot.com
'##
'## or
'##
'## Snitz Communications
'## C/O: Michael Anderson
'## PO Box 200
'## Harpswell, ME 04079
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<META HTTP-EQUIV="Refresh" CONTENT="300">
<% 
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_USERNAME = '" & 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
%>
<script language="JavaScript">
<!--

function genericPopup(popupAddress)
{new_window = window.open(popupAddress,'PrivateMessage',
'toolbar=0,menubar=0,status=0,location=0,width=800,height=400,resizable=1,left=125,top=125')}

// -->
</script>
<%
response.write" " & vbNewline & _
" <body onLoad=""genericPopup('pm_view.asp')"">" & vbNewline
end if 
end if
%>


Any suggestions for improvement are welcome. I've now included almost anything that was included on default.asp, but maybe this can be limited to less includes ?

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 07 February 2003 12:10:32
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 07 February 2003 :  21:02:01  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Well if you want in my opinion a better way, take a look at the website im working on right now at http://www.simpersonals.com and send yourself a PM. It pops up a couple JS questions and updates the database to show this message has been displayed. There is a complete admin option in the myhome area that allows you to select different options. I will be adding an option soon to turn off the JS popups.

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

blink_26
Starting Member

3 Posts

Posted - 11 February 2003 :  16:38:27  Show Profile
This is the one that I'm using.... I used Javascript to give the option to View the PM if the user wants. It also has a audiable sound aleart as well(like a pager).




<%
'#######################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

%>
<EMBED SRC="newmsg.wav" WIDTH=1 HEIGHT=1 HIDDEN="true" AUTOSTART="true" LOOP="false" volume="100"></EMBED>
<script language=javascript>

if (true){
agree = confirm('You have a new Private Message!\n Would you like to go to your PM folder now ?');
if (agree) document.location.href=('pm_view.asp')
}
</script>

<%
END IF
END IF
'#################END :Adding pager message notification.: ###########################
%>

Edited by - blink_26 on 11 February 2003 16:40:01
Go to Top of Page

EDGEY
Starting Member

38 Posts

Posted - 12 February 2003 :  13:23:46  Show Profile  Visit EDGEY's Homepage  Send EDGEY an AOL message  Send EDGEY an ICQ Message
blink 26, where are you putting that code?

---
http://www.edgey.net
http://www.mp3.com/edgey
http://www.thoughtbludgeon.com
'intellect in rational movement tries to kill emotion, in doing so, only kills itself.'
'when you're holding a hammer, everything looks like a nail.'
AIM: SINIBYTE | ICQ: 126370648
---
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 12 February 2003 :  16:33:13  Show Profile  Visit MarcelG's Homepage
Blink, thanks! That's usefull!!

Edgey, you can put that code for example in default.asp, or just in inc_header.asp (if you want to show it on virtually any page).
You can also, just like me, create a completely new page, which includes all the necessary code, ánd includes this piece of code.
As long as you include the following files at the start of your new page it should work:

<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 12 February 2003 :  19:14:32  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
but if they dont go right to there PM and keep browsing the pages, the code you posted show popup a new message every page view

quote:
Originally posted by blink_26

This is the one that I'm using.... I used Javascript to give the option to View the PM if the user wants. It also has a audiable sound aleart as well(like a pager).




<%
'#######################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

%>
<EMBED SRC="newmsg.wav" WIDTH=1 HEIGHT=1 HIDDEN="true" AUTOSTART="true" LOOP="false" volume="100"></EMBED>
<script language=javascript>

if (true){
agree = confirm('You have a new Private Message!\n Would you like to go to your PM folder now ?');
if (agree) document.location.href=('pm_view.asp')
}
</script>

<%
END IF
END IF
'#################END :Adding pager message notification.: ###########################
%>


Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

giorgiusx
Starting Member

28 Posts

Posted - 19 February 2003 :  18:05:16  Show Profile
No....simply insert the code only in default.asp, forum.asp e topic.asp.
Only if u insert the code in inc_header will be show in every page.
Good mod...it's work fine...
I write all the code in an external file that i include in pages above.
Go to Top of Page

Locnar
New Member

89 Posts

Posted - 18 June 2003 :  17:03:04  Show Profile  Visit Locnar's Homepage
I really like the "beep" part of this and have uploaded a cool beeper sound. The only problem is that it only beeps AFTER you click "cancel". It does not beep when message pops up, or even when clicking "OK", only when clicking cancel and going to the regular forums. Any ideas how to fix this so it beeps as the message pops up?

Thanks.

Locnar
Just your basic forums ---> www.duncanet.com/forums
Star Wars Galaxies ---> www.duncanet.com/forum/sitenews.asp
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.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07