Author |
Topic |
rasure
Junior Member
289 Posts |
Posted - 03 December 2003 : 09:41:31
|
You might want to have alook Here before using this mod, its a much better version
Requires Private Message Mod I know this has been done a few times, but this one uses a browser session to prevent multiple popups. What it does if a user logs in and has a new private message/s it will pop up a window telling them so, on the popup page it will ask them if they want to read the PM/s and will able to click a link on the popup which will take them to their inbox (closing the popup window too), if they don't want to read the PM/s then they can just close the popup window and continue browsing without further popup, as this is a browser session, next time they visit the forum it will notify them again.
UPDATED(18 Jan 2004) This still uses a browser session, but now when someone goes to read their pm (privateread.asp) it will reset the session so they will get another popup if a new pm arrives, if they don't read the pm the session will continue as normal.
I'm still working on it so a popup will appear with every new pm regardless of whether they read them or not, I will post an update again when its complete and been fully tested
First of all copy the code below...
<!--#######PM Notify Popup by Rasure#######//-->
<%@ Language=VBScript %>
<%
Response.Buffer = True
strUsername = Request.Cookies("Snitz00User")("Name")
If strUsername = "" Then
Response.Redirect("login.asp?target=default.asp")
Else
%>
<script language="javascript" type="text/javascript">
<!--
function jump_to_inbox()
{
opener.document.location.href = "pm_view.asp";
window.close();
}
//-->
</script>
<title>New Private Message</title>
<body bgcolor="#442275" link="#ffffff" vlink="#ffffff" text="#ccccff" topmargin=0 leftmargin=0>
<p align="center">
<p align="center"> </p>
<p align="center"><b><font face="Verdana" color="#FFFF00" size="3">You
Have A New Private Message<br />Click <a href="pm_view.asp" onclick="jump_to_inbox();return false;" target="_new">Here</a> to go to your Inbox</font></b><br>
<p align="center"><a href="JavaScript:onClick=window.close()"><font face="Verdana" size="1"><b>Close Window</b></font></a></p>
<%
End If
%>
<!--#######END PM Notify Popup by Rasure#######//--> and save it as PM_Notify.asp and upload it to your forum directory (change the colours fonts etc to match your own forum colours).
Next in privatemess.asp or privatemess2.asp (depending on which you use, do not edit both though if you use both) find this code...
Response.Write " - You have <font color=""" & strForumLinkColor & """>"
if pmcount >=1 then and right after that code put in this code...
'####### PM Notify Popup by Rasure #######
If Request.Cookies("popupPMpopMod") <> "1" Then
Response.Cookies("popupPMpopMod") = "1"
Response.Write "<BODY onLoad=""PMRasureMod_PMpopMod('PM_Notify.asp')"">" & vbCrLf
Response.Write " <Script Language=JavaScript Type=""Text/JavaScript"">" & vbCrLf
Response.Write " <!--" & vbCrLf
Response.Write " function PMRasureMod_PMpopMod(url_pop)" & vbCrLf
Response.Write " {" & vbCrLf
Response.Write " var popwidth=350;" & vbCrLf
Response.Write " var popheight=250;" & vbCrLf
Response.Write " var popleft = (window.screen.width-350)/2;" & vbCrLf
Response.Write " var poptop = (window.screen.height-250)/2;" & vbCrLf
Response.Write "" & vbCrLf
Response.Write " PMNotifyMod_PMpopMod=window.open(url_pop,'PMNotifyMod'," & vbCrLf
Response.Write " 'toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=no,width='+ popwidth+',height='+ popheight+',left='+ popleft+',top='+ poptop);" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write "" & vbCrLf
Response.Write " // -->" & vbCrLf
Response.Write " </Script>"
End If'####### END PM Notify Popup by Rasure ####### Then in privateread.asp just below the includes near the top put this code...
If Request.Cookies("popupPMpopMod") = "1" Then Response.Cookies("popupPMpopMod") = ""
so it looks like this...
%> <!--#INCLUDE FILE="config.asp" --> <!--#INCLUDE FILE="inc_func_secure.asp" --> <!--#INCLUDE FILE="inc_func_member.asp" --> <!--#INCLUDE FILE="inc_header.asp" --> <% If Request.Cookies("popupPMpopMod") = "1" Then Response.Cookies("popupPMpopMod") = ""
Then upload to your forum directory. |
Psychic & Spiritual Development Resources |
Edited by - rasure on 02 March 2004 23:30:30 |
|
weeweeslap
Senior Member
USA
1077 Posts |
Posted - 03 December 2003 : 12:37:25
|
Thank you, this is what I have been looking for some time now. Thanks! WWS |
coaster crazy |
|
|
xx ENIGMA xx
Junior Member
166 Posts |
Posted - 03 December 2003 : 13:54:06
|
just tested this mod on your forum and I must say - very nice.... and just what I was looking for long ago, so I can now change how I do it now - thanks!
will give it an install now - nice work
EDIT: well after some further testing on your forum I can never get it to pop again even with a reply, new PM or having even logged out and back in again even though it shows me as having a PM waiting Yes I did delete PM's and retry several times.
any ideas? |
my little forum playground
|
Edited by - xx ENIGMA xx on 03 December 2003 14:04:41 |
|
|
rasure
Junior Member
289 Posts |
Posted - 03 December 2003 : 14:04:33
|
quote: Originally posted by xx ENIGMA xx EDIT: well after some further testing I can never get it to pop again even with a reply, new PM or having even logged out and back in again
any ideas?
As I say its session based, try it when you close the browser |
Psychic & Spiritual Development Resources |
Edited by - rasure on 03 December 2003 14:05:58 |
|
|
xx ENIGMA xx
Junior Member
166 Posts |
Posted - 03 December 2003 : 14:06:13
|
I may have missed that mentioned but I did forget to mention that I did close browser and reopen new one several times - possibly my browser settings affecting its operation?
EDIT: Ok I did get it to work again finally but I did logout, and then clicked link in this thread to go back and logged in and it didnt work.
So I then copied link, opened new browser, logged in and it then worked. Is this the correct steps? |
my little forum playground
|
Edited by - xx ENIGMA xx on 03 December 2003 14:11:03 |
|
|
rasure
Junior Member
289 Posts |
Posted - 03 December 2003 : 14:10:53
|
Ok, you sent a pm yes? did you read it before you logged out, or leave until you logged back in, I've found with sessions that with any browser window open during a session will affect it, so if you log out and close the browser, but still have another window open it thinks it the same session, just the way IE works I guess. |
Psychic & Spiritual Development Resources |
Edited by - rasure on 03 December 2003 14:16:34 |
|
|
AWD_ENVY
Junior Member
103 Posts |
Posted - 03 December 2003 : 14:17:17
|
What happens in this senerio:
User gets Popup User Cancels PM View, and contiunes reading current page. User goes to Pm's and reads. User begins reading forums again. Somone else sends user a PM.
Now because this is session based, and the user has alredy denied a previous PM moments before. Will they get a popup again ? or will it not popup because they previously denied a PMview in the same session ? |
|
|
xx ENIGMA xx
Junior Member
166 Posts |
Posted - 03 December 2003 : 14:18:45
|
see post just above your last one (i edited mine)
btw, any idea how this may act using netscape? |
my little forum playground
|
|
|
rasure
Junior Member
289 Posts |
Posted - 03 December 2003 : 14:26:04
|
quote: Originally posted by AWD_ENVY Now because this is session based, and the user has alredy denied a previous PM moments before. Will they get a popup again ? or will it not popup because they previously denied a PMview in the same session ?
No they wont get the popup again, not until next session, but for me the mod was better than to keep having popups on every page if they didn't want to read them at that time.
It works fine for what I want and probably other people, but I will have another look at the code to try and improve on it |
Psychic & Spiritual Development Resources |
|
|
rasure
Junior Member
289 Posts |
Posted - 03 December 2003 : 14:32:49
|
quote: Originally posted by xx ENIGMA xx btw, any idea how this may act using netscape?
Yes it works in Netscape, well it does in version 7.1 unless the user decides to block popups in their settings, it should work in most browsers as its mostly Javascript. |
Psychic & Spiritual Development Resources |
|
|
xx ENIGMA xx
Junior Member
166 Posts |
Posted - 03 December 2003 : 14:35:36
|
I dont mean to suggest that there is anything wrong with your mod or how it works etc. I am just trying to figure it's mechanics out 100% before I implement it on mine as my forums users are not very bright unfortunately
I may test it further though, and by no means would I either want continual popups. |
my little forum playground
|
|
|
rasure
Junior Member
289 Posts |
Posted - 03 December 2003 : 14:43:45
|
Yes I fully understand, I just made it really quick as its something I wanted, as most people tend to miss their pm`s, so I thought a popup would draw their attention to the fact
|
Psychic & Spiritual Development Resources |
Edited by - rasure on 03 December 2003 14:44:33 |
|
|
AWD_ENVY
Junior Member
103 Posts |
Posted - 03 December 2003 : 14:47:41
|
quote: Originally posted by rasure
quote: Originally posted by AWD_ENVY Now because this is session based, and the user has alredy denied a previous PM moments before. Will they get a popup again ? or will it not popup because they previously denied a PMview in the same session ?
No they wont get the popup again, not until next session, but for me the mod was better than to keep having popups on every page if they didn't want to read them at that time.
It works fine for what I want and probably other people, but I will have another look at the code to try and improve on it
Can you force a session reset when they view the Pm_View.asp page ? (<--- This might solve the issue)
I have users that are on the site for hours at a time... without this fix on my site, it would make for pissed off users I feel. |
|
|
xx ENIGMA xx
Junior Member
166 Posts |
Posted - 03 December 2003 : 15:07:56
|
I think AWD_ENVY is on to something here, this might be a nice addition to the mod is it's doable?
I think I will go ahead and use it in the state it is for now though because I like it. Hope AWD_ENVY's idea might be worth a try for you though rasure. |
my little forum playground
|
|
|
AWD_ENVY
Junior Member
103 Posts |
Posted - 03 December 2003 : 15:09:44
|
It's doable... I just looked at the code. You would just have to reset the status of the cookie when Pm_View.asp is viewed. Should be easy enough. |
|
|
Astralis
Senior Member
USA
1218 Posts |
Posted - 03 December 2003 : 15:45:33
|
Yeah, I've really been wanting to install this but hope the issues get settled. I'll appreciate your work! |
|
|
Topic |
|