Clan [+35] Forum
Clan [+35] Forum
[+35] Hovedkvarter | Profil | Tilmeld | Aktive emner | Forummedlemmer | S�gning | FAQ
Brugernavn:
Kodeord:
Husk kodeord
Glemt dit kodeord?

 Alle fora
 Computere
 [+35] Jumpy's strange world of computers
 NU skal jeg sku have lidt hjælp
 Nyt emne  Svar p� emnet
 Vis printervenlig version
Forfatter Forrige emne Emne N�ste emne  

[+35]Jumpman
[+35] Server Admin, [+35] Member of COW - G5

Denmark
6728 indl�g

Skrevet - 23 Feb 2012 :  10:33:14  Vis profil  Bes�g [+35]Jumpman's hjemmeside  Svar med Quote
Det så lang tid siden jeg har rodet med .asp og mysql databaser er der en der lige kan hjælpe her, for den viser de første 10 emner men så er det jo meningen at der skal være et links til de næste 10 osv osv.

http://www.clandisa.dk/clan35/bans.asp

<%@ Language="VBScript" %>

<% '## Using Option Explicit requires that all variables are declared ## %>
<% Option Explicit %>

<!-- #INCLUDE FILE="../inc_config.asp" -->

<%
Response.Buffer = True

'## Open connection to database
Call OpenDataBase

'## Building the SQL string
Set rsbans = myConn.Execute("SELECT mysql_bans.* FROM mysql_bans;")

'## Counting numbers of members
Set rsAntal = myConn.Execute("select Count(*) As M_COUNT from mysql_bans")
strAntal = rsAntal("M_COUNT")
rsAntal.close
Set rsAntal = nothing
%>

<html>

<head>
<meta http-equiv="Content-Language" content="da">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>[+35] Ban List</title>
</head>

<body text="#E3D096" bgcolor="#000000" SCROLL="yes" BOTTOMMARGIN="0" TOPMARGIN="0" RIGHTMARGIN="0" LEFTMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">


<div align="center">


<table width="98%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="100%" class="main_text"><h1 align="center">Der er i øjeblikket <%=strAntal%> bans i databasen</h1></td>
	</tr>
</table>

</div>
<div align="center">

<table width="98%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="100%" class="content_text">

<div align="center">

<table border="1" cellpadding="0" cellspacing="0" width="98%">
<%
Response.Write "<tr>" & vbNewLine & _
				"<td width=""25%"" valign=""top"" class=""content_text"" bgcolor=""#3E3F31""><font color=""#DACEA8""><b><u>Nick</u></b></font>" & vbNewLine & _
				"</td>" & vbNewLine & _
				"<td width=""15%"" valign=""top"" class=""content_text"" bgcolor=""#3E3F31""><font color=""#DACEA8""><b><u>SteamID</u></b></font>" & vbNewLine & _
				"</td>" & vbNewLine & _
				"<td width=""30%"" valign=""top"" class=""content_text"" bgcolor=""#3E3F31""><font color=""#DACEA8""><b><u>Ban Reason</u></b></font>" & vbNewLine & _
				"</td>" & vbNewLine & _
				"<td width=""10%"" valign=""top"" class=""content_text"" bgcolor=""#3E3F31""><font color=""#DACEA8""><b><u>Ban Length</u></b></font>" & vbNewLine & _
				"</td>" & vbNewLine & _
				"<td width=""20%"" valign=""top"" class=""content_text"" bgcolor=""#3E3F31""><font color=""#DACEA8""><b><u>Banned by</u></b></font>" & vbNewLine & _
				"</td>"
Response.Write "</tr>"

DIM mySQL, objRS
mySQL = "SELECT * FROM mysql_bans"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.CursorType = 1
objRS.Open mySQL, myConn

DIM intPageRecords, intRecords, intRecordCount, intCurrentPage
DIM intNumberOfPages, intDisplayPage
intPageRecords = Request.Querystring("page")
IF intPageRecords = "" THEN intPageRecords = 1 : intRecords = 1
intRecords = intPageRecords
intPageRecords = ((intPageRecords - 1) * 10) +1
intRecordCount = 0

IF NOT objRS.EOF THEN
objRS.Move (intPageRecords - 1)
DO WHILE intRecordCount < 10 and NOT objRS.EOF

'## Write the HTML to display the current record in the recordset
Response.Write "<tr>" & vbNewLine & _
				"<td width=""25%"" valign=""top"" class=""content_text"" bgcolor=""#2E2F21""><font color=""#DACEA8"">"
Response.Write (objRS("player_name"))
Response.Write "</font></td>" & vbNewLine & _

				"<td width=""15%"" valign=""top"" class=""content_text"" bgcolor=""#2E2F21""><font color=""#DACEA8"">"
Response.Write (objRS("steam_id"))
Response.Write "</font></td>" & vbNewLine & _

				"<td width=""30%"" valign=""top"" class=""content_text"" bgcolor=""#2E2F21""><font color=""#DACEA8"">"
Response.Write (objRS("ban_reason"))
Response.Write "</font></td>" & vbNewLine & _

				"<td width=""10%"" valign=""top"" class=""content_text"" bgcolor=""#2E2F21""><font color=""#DACEA8"">"
Response.Write (objRS("ban_length"))
Response.Write "</font></td>" & vbNewLine & _

				"<td width=""20%"" valign=""top"" class=""content_text"" bgcolor=""#2E2F21""><font color=""#DACEA8"">"
Response.Write (objRS("banned_by"))
Response.Write ("<br />")
Response.Write	"</font></td>" & vbNewLine & _
				"</td>"
Response.Write "</tr>"

'## Move to next record i the result list
objRS.MoveNext
intRecordCount = intRecordCount +1
Loop
END IF
%>



	<tr>
		<td class="content_text" bgcolor="#3E3F31"><font color=""#DACEA8""><b><u><div class="hr">
		<%=intPageRecords%> - <%=intPageRecords+(intRecordCount-1)%> of <%=(objRS.RecordCount)%> banned players</u></b></font>

		</td>
		<td colspan="4" align="right" class="content_text" bgcolor="#3E3F31"><font color=""#DACEA8""><b><u><div class="hr">
		<p>Scroll Through More banned players
		<%
		intCurrentPage = Request.Querystring("page")
		IF intCurrentPage = "" THEN intCurrentPage = 1
		intNumberOfPages = int(objRS.RecordCount \ 10)
		IF objRS.RecordCount MOD 10<> 0 THEN intNumberOfPages = intNumberOfPages + 1
		Response.Write("Pages: [")
		FOR intDisplayPage = 1 TO intNumberOfPages
		IF Cint(intDisplayPage) = Cint(intCurrentPage) THEN
		Response.Write " <b>" & intDisplayPage & "</b> "
		ELSE
		Response.Write " <a href=""page.asp?page=" & intDisplayPage & """>" & intDisplayPage &_
		"</a> "
		END IF
		NEXT
Response.Write ("]   ")
		%>
		</u></b></font></div></td>
	</tr>
</table>
</table>
		</td>
	</tr>
</div>

<%
'## Close connection to server again
Call CloseDataBase
%>

</body>
</html>
  Forrige emne Emne N�ste emne  
 Nyt emne  Svar p� emnet
 Vis printervenlig version
Hop til:
Clan [+35] Forum © 2000-2002 Snitz Communications Go To Top Of Page
Tilpasset ældre læsere - vist på [:)] 0.25 sek. Snitz Forums 2000