Jeg har en webappilaktion hvor brugerne har mulighed på logge sig på med et brugernavn og password.
Jeg prøver arbejde med Asp skriptet som skal vise online users i en tabel. Hvis de online user er logget på skal der vises der usernavn..!..
Jeg har en scpript der gøre det....Men den gøre almulig osgså...som jeg ik fatter....nogen som kan gøre den ENKEL?
........................................................................
<%
'//[][][][][][][][][][][][][][] MWPX - NEXT ! [][][][][][][][][][][][][][][][][]//
'//[] All code, files, images, and layouts copyright (c) 2005 by: []//
'//[] Smiley, Stribling, Taylor, Vaz & Reaume []//
'//[] []//
'//[] Released April 2005 []//
'//[] []//
'//[] No portion of this code may be used in any other fashion without []//
'//[] the express written consent of all parties listed above. Any violation []//
'//[] of our copyright will be met with swift prosecution. []//
'//[] []//
'//[] This code is governed by our commercial license. []//
'//[] You are free to modify the code for your own portal site, but may []//
'//[] not receive any compensation for using our code. []//
'//[] []//
'//[] Support can be found at
http://www.mwpx.com or by sending []//
'//[] Email to admin@mwpx.com []//
'//[] []//
'//[][][][][][][][][][][][][][] MWPX - NEXT! [][][][][][][][][][][][][][][][[][]//
CurPageInfoChk = "1"
function CurPageInfo ()
strOnlineQueryString = ChkActUsrUrl(Request.QueryString)
PageName = "Active User List"
PageAction = "Viewing<br>"
PageLocation = "active_users.asp"
CurPageInfo = PageAction & " " & "<a href=" & PageLocation & ">" & PageName & "</a>"
end function
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<!--#INCLUDE FILE="inc_top.asp" -->
<%
tempArr = split(strWebmaster, ",")
strSiteOwner = tempArr(0)
nRefreshTime = Request.Cookies(strTempCookieType & "Reload")
if Request.form("cookie") = "1" then
if strSetCookieToForum = 1 then
Response.Cookies(strTempCookieType & "Reload").Path = strTempCookieType
end if
Response.Cookies(strTempCookieType & "Reload") = Request.Form("RefreshTime")
Response.Cookies(strTempCookieType & "Reload").expires = strForumTimeAdjust + 365
nRefreshTime = Request.Form("RefreshTime")
end if
if nRefreshTime = "" then
nRefreshTime = 0
end if
ActiveSince = Request.Cookies(strTempCookieType & "ActiveSince")
'## Do Cookie stuffs with show last date
if Request.form("cookie") = "2" then
ActiveSince = Request.Form("ShowSinceDateTime")
if strSetCookieToForum = 1 then
Response.Cookies(strTempCookieType & "ActiveSince").Path = strTempCookieType
end if
Response.Cookies(strTempCookieType & "ActiveSince") = ActiveSince
end if
mypage = request("whichpage")
If mypage = "" then
mypage = 1
end if
mypagesize = request.cookies("paging")("pagesize")
If mypagesize = "" then
mypagesize = 15
end if
%>
<script language="JavaScript">
<!--
function autoReload()
{
document.ReloadFrm.submit()
}
//-->
</script>
<script language="JavaScript">
<!--
function SetLastDate()
{
document.LastDateFrm.submit()
}
//-->
</script>
<script language="JavaScript">
<!--
function jumpTo(s) {if (s.selectedIndex != 0) top.location.href = s.options[s.selectedIndex].value;return 1;}
// -->
</script>
<table width="95%" border=0>
<tr>
<td >
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><img src="images/icons/icon_folder_open.gif" border="0"> <a href="default.asp">Home</a><br>
<img src="images/icons/icon_bar.gif" border="0"><img src="images/icons/icon_folder_open_topic.gif" border="0"> Active Users </font><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>">(Last Updated <%=strForumTimeAdjust %>)</font>
</td>
<td align="right">
<form id="formEle" name="ReloadFrm" action="active_users.asp" method="post"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><br>
<select name="RefreshTime" size="1" onchange="autoReload();">
<option value="0" <% if nRefreshTime = "0" then Response.Write(" SELECTED")%>>Don't reload automatically</option>
<option value="1" <% if nRefreshTime = "1" then Response.Write(" SELECTED")%>>Reload page every minute</option>
<option value="5" <% if nRefreshTime = "5" then Response.Write(" SELECTED")%>>Reload page every 5 minutes</option>
<option value="10" <% if nRefreshTime = "10" then Response.Write(" SELECTED")%>>Reload page every 10 minutes</option>
<option value="15" <% if nRefreshTime = "15" then Response.Write(" SELECTED")%>>Reload page every 15 minutes</option>
<option value="30" <% if nRefreshTime = "30" then Response.Write(" SELECTED")%>>Reload page every 30 minutes</option>
</select>
<input type="hidden" name="Cookie" value="1">
</font>
</form>
</td>
</tr>
</table>
<SCRIPT>
<!--
if (document.ReloadFrm.RefreshTime.options[document.ReloadFrm.RefreshTime.selectedIndex].value > 0) {
reloadTime = 60000 * document.ReloadFrm.RefreshTime.options[document.ReloadFrm.RefreshTime.selectedIndex].value
self.setInterval('autoReload()', 60000 * document.ReloadFrm.RefreshTime.options[document.ReloadFrm.RefreshTime.selectedIndex].value)
}
//-->
</SCRIPT>
<%
mwpThemeTableCustomCode = "cellpadding=0 border=0 cellspacing=0 width=70% align=center"
mwpThemeBlock_open()
%>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> align=center valign=top nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><B>Username</B></FONT></td>
<% if (mlev = 4 or mlev = 3) then %>
<td <%= mwpThemeBlock_subTitleCell %> align=center valign=top nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><B>IP Address</B></FONT></td>
<% end if %>
<td <%= mwpThemeBlock_subTitleCell %> align=center valign=top nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><B>Last Action</B></FONT></td>
<td <%= mwpThemeBlock_subTitleCell %> align=center valign=top nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><B>Logged On</B></FONT></td>
<td <%= mwpThemeBlock_subTitleCell %> align=center valign=top nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><B>Last Active</B></FONT></td>
<td <%= mwpThemeBlock_subTitleCell %> align=center valign=top nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strHeadFontColor %>"><B>Online Time</B></FONT></td>
</tr>
<%
set rs = Server.CreateObject("ADODB.Recordset")
'## Forum_SQL
strSql ="SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.M_BROWSE, " & strTablePrefix & "ONLINE.DateCreated, " & strTablePrefix & "ONLINE.LastChecked, " & strTablePrefix & "ONLINE.CheckedIn "
strSql = strSql & " FROM " & strMemberTablePrefix & "ONLINE "
strSql = strSql & " ORDER BY " & strTablePrefix & "ONLINE.DateCreated, " & strTablePrefix & "ONLINE.CheckedIn DESC"
rs.cachesize = 20
rs.open strSql, my_Conn, 3
i = 0
If rs.EOF or rs.BOF then '## No categories found in DB
Response.Write ""
Else
rs.movefirst
num = 0
rs.pagesize = mypagesize
maxpages = cint(rs.pagecount)
maxrecs = cint(rs.pagesize)
rs.absolutepage = mypage
howmanyrecs = 0
rec = 1
do until rs.EOF or (rec = mypagesize+1)
if strI = 0 then
CColor = strAltForumCellColor
else
CColor = strForumCellColor
end if
strTheUserID = rs("UserID")
strTheUserID = OnlineSQLdecode(strTheUserID)
if Right(rs("UserID"), 5) <> "Guest" then
strSql = "SELECT " & strMemberTablePrefix & "MEMBERS.MEMBER_ID, " & strMemberTablePrefix & "MEMBERS.M_NAME, " & strTablePrefix & "ONLINE.UserID "
strSql = strSql & " FROM " & strTablePrefix & "MEMBERS, " & strTablePrefix & "ONLINE "
strSql = strSql & " WHERE " & strMemberTablePrefix & "MEMBERS.M_NAME = '" & rs("UserID") & "' "
set rsMember = my_Conn.Execute (strSql)
end if
if Right(rs("UserID"), 5) = "Guest" then
num = num + 1
end if
strOnlineDateCheckedIn = ChkDate(rs("CheckedIn"))
strOnlineDateCheckedIn = strOnlineDateCheckedIn & ChkTime(rs("CheckedIn"))
strOnlineLastDateChecked = ChkDate(rs("LastChecked"))
strOnlineLastDateChecked = strOnlineLastDateChecked & ChkTime(rs("LastChecked"))
strOnlineTotalTime = DateDiff("n",strOnlineDateCheckedIn,strOnlineLastDateChecked)
If strOnlineTotalTime > 60 then
' they must have been online for like an hour or so.
strOnlineHours = 0
do until strOnlineTotalTime < 60
strOnlineTotalTime = (strOnlineTotalTime - 60)
strOnlineHours = strOnlineHours + 1
loop
strOnlineTotalTime = strOnlineHours & " Hours " & strOnlineTotalTime & " Minutes"
Else
strOnlineTotalTime = strOnlineTotalTime & " Minutes"
End If
%>
<tr bgcolor="<% =CColor %>">
<% if Right(rs("UserID"), 5) = "Guest" then %>
<td valign="middle" align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">Guest #<% =num %></font></td>
<% else %>
<td valign="middle" align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>">
<% if strUseExtendedProfile then
Response.Write("<a href=""pop_profile.asp?mode=display&id="& rsMember("MEMBER_ID") & """>")
else
Response.Write("<a href=""JavaScript
enWindow2('pop_profile.asp?mode=display&id=" & rsMember("MEMBER_ID") & "')"">")
end if
Response.Write(rs("UserID") & "</a></font>")
%>
<% end if %>
<% if mlev = 3 then %>
<td valign="middle" align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><% =rs("UserIP")%></font></td>
<% end if
if mlev = 4 then %>
<td valign="middle" align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><a href="
http://ws.arin.net/cgi-bin/whois.pl?queryinput=<%=rs("UserIP")%>" target="_blank"><% =rs("UserIP")%></a></font></td>
<% end if
if lcase(rs("UserID"))= strSiteOwner and not lcase(strDBNTUserName) = strSiteOwner then
LastUserAction = "Invisible"
else
LastUserAction = rs("M_BROWSE")
end if
%>
<td valign="middle" align="center"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><% =LastUserAction%></A></font></td>
<td align="center" valign="middle" width="100" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strDefaultFontColor %>"><%=strOnlineDateCheckedIn%></FONT></td>
<td align="center" valign="middle" width="100" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>" color="<% =strDefaultFontColor %>"><%=strOnlineLastDateChecked%></FONT></td>
<td align="center" valign="middle" width="100" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>" color="<% =strDefaultFontColor %>"><%=strOnlineTotalTime%></FONT></td>
</tr>
<%
rs.MoveNext
strI = strI + 1
if strI = 2 then
strI = 0
end if
rec = rec + 1
loop
end if
mwpThemeBlock_close()%>
<table width="70%" align="right">
<tr>
<td width="60%"> </td>
<td width="40%" align="left">
<% if maxpages > 1 then %>
<table border=0>
<tr>
<td valign="top"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Pages: </b></font></td>
<td valign="top"><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% Call Paging() %></font></td>
</tr>
</table>
<% else %>
<% end if %>
</td>
</tr>
</table>
<br><br>
<center>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>-1" color="<% =strCategoryFontColor %>">
<a href="default.asp">Return to Home</A>
</FONT>
</center>
<!--#INCLUDE FILE="inc_footer.asp" -->
<%
sub Paging()
if maxpages > 1 then
if Request.QueryString("whichpage") = "" then
pge = 1
else
pge = Request.QueryString("whichpage")
end if
scriptname = request.servervariables("script_name")
Response.Write("<table border=0 width=100% cellspacing=0 cellpadding=1 align=top><tr>")
for counter = 1 to maxpages
if counter <> cint(pge) then
ref = "<td align=right bgcolor=" & strPageBGColor & "><font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & ">" & " " & widenum(counter) & "<a href='" & scriptname
ref = ref & "?whichpage=" & counter
ref = ref & "&pagesize=" & request.cookies("paging")("pagesize")
if top = "1" then
ref = ref & ">"
ref = ref & "</font><b><font face='" & strDefaultFontFace & "' "
ref = ref & "color='" & strHeadFontColor & "'"
ref = ref & ">" & counter & "</font></b></a></td>"
Response.Write ref
else
ref = ref & "'>" & counter & "</font></a></td>"
Response.Write ref
end if
else
Response.Write("<td align=right bgcolor=" & strPageBGColor & "><font face=" & strDefaultFontFace & " size=" & strDefaultFontSize & ">" & " " & widenum(counter) & "<b>" & counter & "</b></font></td>")
end if
if counter mod 15 = 0 then
Response.Write("</tr><tr>")
end if
next
Response.Write("</tr></table>")
end if
top = "0"
end sub
%>