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?