| Author |  Topic  | 
              
                | rasureJunior Member
 
   
 
                289 Posts | 
                    
                      |  Posted - 03 December 2003 :  20:25:09     
 |  
                      | You could try this, I've added the code to that mod below, is that included in default only? or part of the header?
 If its only in default then the popup will only occur on the default page.
 
 '################ UK MKIV's ACTIVE USER HEADER MOD #####################
' this mod goes in place of the active users/PM mod below on line 672 - 683
' Get Private Message count for display..........................
if strDBType = "access" then
	strSqL = "SELECT count(M_TO) as [pmUserCount] "
else
	strSqL = "SELECT count(M_TO) as pmUserCount "
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)
pmUserCount = rsPM("pmUserCount")
rsPM.close
set rsPM = nothing
%><!--#include file="inc_activeusers_data.asp"--><%
'## Forum_SQL - Get newest membername and id from DB
 strSql = "SELECT M_NAME, MEMBER_ID FROM " & strMemberTablePrefix & "MEMBERS " &_
 " WHERE M_STATUS = 1 AND MEMBER_ID > 1 " &_
 " ORDER BY MEMBER_ID desc;"
set rs = Server.CreateObject("ADODB.Recordset")
rs.open TopSQL(strSql,1), my_Conn
if not rs.EOF then
	NewMember_Name = chkString(rs("M_NAME"), "display")
	NewMember_Id = rs("MEMBER_ID")
else
	NewMember_Name = ""
end if
rs.close
set rs = nothing
	
Response.Write	"				<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"">" &vbCrLf &_
		"				<tr>" &vbCrLf &_
		"					<td bgcolor=""" & strTableBorderColor & """>" &vbCrLf &_		
		"						<TABLE WIDTH=""100%"" BORDER=""0"" CELLSPACING=""1"" CELLPADDING=""4"">" &vbCrLf &_
		"						<TR>" &vbCrLf &_
		"							<TD align=""center"" bgcolor="""& strHeadCellColor &""" nowrap valign=""top""><font face="""& strDefaultFontFace &""" size="""& strDefaultFontSize &""" color="""& strCategoryFontColor &"""> </font></td>" &vbCrLf &_
		"						</TR>" &vbCrLf &_	
		"						<TR>" &vbCrLf &_
		"							<TD align=""center"" bgcolor="""& strForumCellColor &""" nowrap valign=""top""><font size="""& strFooterFontSize &""">" &_
		"								[ <a href=""active_users.asp"">Active Members</a>: "& intActiveMembers &" | Guests: "& intActiveGuests &" ] [ Total: "& intTotalActiveUsers &" ] "
if NewMember_Name <> "" then 
	Response.Write	"[ Newest Member: <span class=""spnMessageText"">" & profileLink(NewMember_Name,NewMember_Id) & " ]</span>" & vbNewline
end if
Response.Write  "[ "
if pmUserCount >=1 then
'####### PM Notify Popup by Rasure #######
Response.Write "<BODY onLoad=""PMNotify_PM('PM_Notify.asp')"">" & vbCrLf
Response.Write " <Script Language=JavaScript Type=""Text/JavaScript"">" & vbCrLf
Response.Write " <!--" & vbCrLf
Response.Write " var ckTemp = document.cookie;" & vbCrLf
Response.Write "" & vbCrLf
Response.Write " function setCookie(name, value) {" & vbCrLf
Response.Write " if (value != null && value != """")" & vbCrLf
Response.Write " document.cookie=name + ""="" + escape(value) + "";"";" & vbCrLf
Response.Write " ckTemp = document.cookie;" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write "" & vbCrLf
Response.Write " function getCookie(name) {" & vbCrLf
Response.Write " var index = ckTemp.indexOf(name + ""="");" & vbCrLf
Response.Write " if(index == -1) return null;" & vbCrLf
Response.Write " index = ckTemp.indexOf(""="", index) + 1;" & vbCrLf
Response.Write " var endstr = ckTemp.indexOf("";"", index);" & vbCrLf
Response.Write " if (endstr == -1) endstr = ckTemp.length;" & vbCrLf
Response.Write " return unescape(ckTemp.substring(index, endstr));" & vbCrLf
Response.Write " }" & vbCrLf
Response.Write "" & vbCrLf
Response.Write " function PMNotify_PM(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 " var temp = getCookie(""popupPM"");" & vbCrLf
Response.Write " if(!temp==1) {" & vbCrLf
Response.Write " setCookie(""popupPM"",1);" & vbCrLf
Response.Write "" & vbCrLf
Response.Write " PrivateMessage_PM=window.open(url_pop,'PrivateMessage'," & 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 "" & vbCrLf
Response.Write " // -->" & vbCrLf
Response.Write " </Script>"
'####### END PM Notify Popup by Rasure #######
	Response.Write "<font color=""" & strActiveLinkColor & """><b>" & pmUserCount & "</b></font>"
else
	Response.Write pmUserCount
end if
Response.Write	" new <span class=""spnMessageText""><a href=""pm_view.asp"">message"
if pmUserCount <>1 then
	Response.Write	"s"
end if
Response.Write	"</a></span> ]"
Response.Write	"							</font></td>" &vbCrLf &_
		"						</TR>" &vbCrLf &_		
		"						</table>" &vbCrLf &_
		"					</td>" &vbCrLf &_
		"				</tr>" &vbCrLf &_
		"				</table>" &vbCrLf
'############################################################ |  
                      | Psychic & Spiritual Development Resources
 |  
                      |  |  | 
              
                | xx ENIGMA xxJunior Member
 
   
 
                166 Posts | 
                    
                      |  Posted - 03 December 2003 :  20:28:36   
 |  
                      | I will try this and thank you for working so much on it for me.... I know I'm beyond or was
 beyond baffled by all this
  
 I am guessing you added the include into your inc_header
 for another reason at another time? And if I decide to
 add the include in my inc_header.asp as you have done,
 can you elaborate as to why you added it and where exactly
 I should add it if I attempt it that way?
 |  
                      | 
 my little forum playground
 
 |  
                      | Edited by - xx ENIGMA xx on 03 December 2003  20:30:16
 |  
                      |  |  | 
              
                | xx ENIGMA xxJunior Member
 
   
 
                166 Posts | 
                    
                      |  Posted - 03 December 2003 :  20:43:27   
 |  
                      | I just tried on a guess where to put the include in inc_header and it still didnt work. I added it
 at the very top where there already was 1 include.
 
 %>
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="privatemess.asp"-->
<% |  
                      | 
 my little forum playground
 
 |  
                      |  |  | 
              
                | rasureJunior Member
 
   
 
                289 Posts | 
                    
                      |  Posted - 03 December 2003 :  20:47:57     
 |  
                      | Did you try the above code first? if the above code is part of your default via include
 (or in the code itself) then it should work.
 
 If the above code does work then I would use that
 to save confusion, but I will still work on the original
 code for improvement.
 
 The only reason I had the pm include in my
 header was to include the pm bit on every page
 So no matter where users are on the forum they can see
 if they have a new PM or not, just my personal preference.
 |  
                      | Psychic & Spiritual Development Resources
 |  
                      | Edited by - rasure on 03 December 2003  20:52:22
 |  
                      |  |  | 
              
                | xx ENIGMA xxJunior Member
 
   
 
                166 Posts | 
                    
                      |  Posted - 03 December 2003 :  20:51:35   
 |  
                      | I did not try it 1st since you mentioned 
 quote:If its only in default then the popup will only occur on the default page.
 
 
 So I took a shot at the other guessing since you also
 use MKIV's active users/PM header mod.
 
 I guess i'll try it now though
 |  
                      | 
 my little forum playground
 
 |  
                      |  |  | 
              
                | rasureJunior Member
 
   
 
                289 Posts | 
                    
                      |  Posted - 03 December 2003 :  20:54:24     
 |  
                      | quote:Originally posted by xx ENIGMA xx
 So I took a shot at the other guessing since you also
 use MKIV's active users/PM header mod.
 
 
 I don't use that mod, I just customized yours for you
 so the popup will work with your forum
  |  
                      | Psychic & Spiritual Development Resources
 |  
                      | Edited by - rasure on 03 December 2003  20:55:12
 |  
                      |  |  | 
              
                | xx ENIGMA xxJunior Member
 
   
 
                166 Posts | 
                    
                      |  Posted - 03 December 2003 :  20:58:07   
 |  
                      | ok, the one on top of your forum looks almost identical. Anyways, that worked now
  but it did show the lines from PM_Notify for some reason.
 
 '##############
 
 '##############
 
 so I removed those. What is the downside of me using this
 from default.asp instead of inc_header.asp now?
 |  
                      | 
 my little forum playground
 
 |  
                      |  |  | 
              
                | rasureJunior Member
 
   
 
                289 Posts | 
                    
                      |  Posted - 03 December 2003 :  21:46:46     
 |  
                      | Glad you got it working  there isnt really a downside, as when most people log in they will be on default.asp anyway, so will be notified of any pm`s 
 When I get to sort out the code to display a popup for each new pm then having it in the header may be better, that way your users will be notified of new pm/s whatever page they go to, but for now as long as its working best to leave it as it is, until I modify the code
  |  
                      | Psychic & Spiritual Development Resources
 |  
                      |  |  | 
              
                | xx ENIGMA xxJunior Member
 
   
 
                166 Posts | 
                    
                      |  Posted - 03 December 2003 :  21:53:21   
 |  
                      | thanks for all your help on this, I've wanted a simple popup for a long time and have it now.
 |  
                      | 
 my little forum playground
 
 |  
                      |  |  | 
              
                | rasureJunior Member
 
   
 
                289 Posts |  | 
              
                | weeweeslapSenior Member
 
     
 
                USA1077 Posts
 | 
                    
                      |  Posted - 04 December 2003 :  02:27:26     
 |  
                      | hi rasure, I tried the last post here, one above mine, and it still requires that privatemess.asp be in the inc_header.asp file. I added the privatemess.asp include to the footer and it worked fine, but I don't want privatemess.asp to be displayed anywhere but the default.asp page, got another idea for this to work without privatemess.asp being there? Or maybe know of a way that I can include privatemess.asp in my inc_footer.asp or inc_header.asp but have it not display anything?
 WWS
 |  
                      | coaster crazy
 |  
                      |  |  | 
              
                | weeweeslapSenior Member
 
     
 
                USA1077 Posts
 | 
                    
                      |  Posted - 04 December 2003 :  02:30:52     
 |  
                      | in my inc_header.asp I use this to determine the # of pm's 
 
	If strPageSetup<>1 Then
	' Get Private Message count for display
	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
	End If
and this to display it on the page
 
 
	Response.Write "                      <tr>" & vbCrLf
	Response.Write "                        <td width=""100%"" class=""navleft"" nowrap>  <a href=""" & strBaseURL & "forum/pm_view.asp"" class=""navleft"">Private Messages (" & pmcount & ")</a>  </td>" & vbCrLf
	Response.Write "                      </tr>" & vbCrLf
 
  Any ideas? Thanks in advance! WWS
 |  
                      | coaster crazy
 |  
                      |  |  | 
              
                | weeweeslapSenior Member
 
     
 
                USA1077 Posts
 | 
                    
                      |  Posted - 06 December 2003 :  13:47:50     
 |  
                      | hmmm I thought I saw a reply here before  |  
                      | coaster crazy
 |  
                      |  |  | 
              
                | rasureJunior Member
 
   
 
                289 Posts | 
                    
                      |  Posted - 06 December 2003 :  16:22:55     
 |  
                      | Yes there was, I removed cus it wasn't working correctly, have to seriously test anything before I post next time
  the code on first page is ok though
  
 |  
                      | Psychic & Spiritual Development Resources
 |  
                      | Edited by - rasure on 06 December 2003  16:23:42
 |  
                      |  |  | 
              
                | weeweeslapSenior Member
 
     
 
                USA1077 Posts
 |  | 
              
                
                |  Topic  |  |