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)
 Last Seen Not Working From Portal
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

RebelTech
Average Member

USA
613 Posts

Posted - 04 October 2003 :  17:24:47  Show Profile  Visit RebelTech's Homepage  Send RebelTech an ICQ Message
This code works if I run it directly. But is does not work from a portal page in the same directory:
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_func_common.asp" -->
<!--#INCLUDE FILE="inc_header_short.asp" -->
<%


dim intTopPosters
dim intPageViews
dim intLastSeen
dim intReadTopics
dim intRepliedTopics
dim boolPM, boolBookmarks

'---------------------------------------------------------
intTopPosters		= 5	' number of top posters to display
intLastSeen			= 5	' number of members last seen to display
intReadTopics		= 5	' number of top read topics to display
intRepliedTopics	= 5	' number of top replied to topics to display

boolPM 				= 0		' Private Message Statistics 0=off, 1=on
boolBookmarks 		= 0		' Bookmark/Buddy Statistics 0=off, 1=on
'-------------------------------------------------------------


	dim SQLMemberCount, RSMEmberCount
	SQLMemberCount = "SELECT COUNT(MEMBER_ID) AS MemberCount FROM " & strMemberTablePrefix & "MEMBERS WHERE M_NAME not like '%iamviet %'"
	Set RSMemberCount = my_Conn.execute(SQLMemberCount)
	intMemberCount = RSMemberCOUNT("MemberCount")
	set RSMEmberCount = nothing	
%>

<a name="#lastseen">
<table align="center" width="100%" cellspacing="1" cellpadding="3" bgcolor="<%=strTableBorderColor%>">
  <tr>
    <td align="left" bgcolor="<%=strHeadCellColor%>" width="100%">
      <font face="<%=strDefaultFontFace%>" size="<%=strDefaultFontSize%>" color="<%=strHeadFontColor%>"><b>
      <%= intLastSeen%> Members Last Seen
      </b></font>
    </td>
  </tr>
  <tr>
    <td align="center" bgcolor="<%=strForumCellColor%>">
    <%=displayLastSeen%>
    
    </td>
  </tr>
</table>

<%



	

function DisplayLastSeen()
	dim rs
	set rs = server.CreateObject("adodb.recordset")
	
	strSql = "SELECT TOP " & intLastSeen & " member_id, m_name, m_lastheredate FROM " & strMemberTablePrefix & "MEMBERS ORDER BY M_LASTHEREDATE DESC"
	rs.Open strSql, my_Conn
	%>
	<table border="0" cellpadding="0" cellspacing="5" width="100%">
		<tr>
			<td valign="middle" width="10%"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><b>No.</b></font></td>
			<td valign="middle" align="left"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><b>Member Name</b></font></td>
			<td valign="middle" align="center" width="30%"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><b>Last Seen</b></font></td>
		</tr>
		<% 
		intCounter = 1
		do while not rs.EOF%>
			<tr>
				<td><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><%= intCounter%>.</font></td>
				<td align="left"><a href="pop_profile.asp?mode=display&id=<%=rs("member_id")%>"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><%= rs("m_name")%></font></a></td>
				<td align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">
		  			<% minutesTotal = datediff("n",strtodate(rs("m_lastheredate")),strForumTimeAdjust)
		  			hoursTotal = int(minutesTotal / 60)
		  			daysSince = int(hoursTotal / 24)
		  			hoursSince = hoursTotal mod 24
		  			minutesSince = minutestotal mod 60
		  			if daysSince = 1 then Response.Write daysSince & " day, "
		  			if daysSince > 1 then Response.Write daysSince & " days, "			
					if hoursSince = 1 then Response.Write hoursSince & " hour, "		  
		 			if hoursSince > 1 then Response.Write hoursSince & " hours, "
		  			Response.Write minutesSince
			  		%> minutes ago.</font>
				</td>
			</tr>
			<%
			intCounter = intCounter + 1
			rs.movenext
		loop
		rs.Close
		%>
	</table>
	<%
end function

%>


I get this error:

Microsoft VBScript compilation error '800a0411' 

Name redefined 

/forum/inc_adovbs.asp, line 14 

Const adOpenForwardOnly = 0
------^


What am I doing wrong?

dayve
Forum Moderator

USA
5820 Posts

Posted - 04 October 2003 :  18:34:39  Show Profile  Visit dayve's Homepage
all this means is that you have declared the constant adOpenForwardOnly twice.
One place it was declared was in the file inc_adovbs.asp on line 14. Now you need to find out
where the other one is since you have not provided all the code. Once you find it, you can
probably omit it or comment it out.


Edited by - dayve on 04 October 2003 18:35:02
Go to Top of Page

RebelTech
Average Member

USA
613 Posts

Posted - 04 October 2003 :  19:23:41  Show Profile  Visit RebelTech's Homepage  Send RebelTech an ICQ Message
Thank you! I had included config.asp as well as a couple of others a second time.
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.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07