ciao ho guardato nel forum e ho visto qualcosa ma non riesco a inglobarlo in questo script
che vi mostro sotto visualizza la paginazione classica:
record 1
record 2
record 3
io vorrei fare questo tipo di paginazione
record 1 record 2
record 3 record 4
per un massimo di 6 o 8 record per pagina e poi in automatico dare la possbilità di passare alla pg sucessiva ecco il codice... chi mi aiuta?
Codice PHP:
<%
dim objConn, iPageSize, iPageCurrent, strSQL, objRS, reccount, iPageCount, iRecordsShown, cont, da_pag, fino_a_pag, i
iPageSize = 2 'NUMERO RECORD PER PAGINA
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If
strSQL = "SELECT * FROM promo where visualizza=true ORDER BY id desc"
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.PageSize = iPageSize
objRS.CacheSize = iPageSize
objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText
reccount = objRS.recordcount
iPageCount = objRS.PageCount
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1
If iPageCount = 0 Then
Response.Write "
<table><td align='center'><font face='verdana' size='2' color='#000000'>[b]<div align='center'>Non sono stati trovate Promozioni & offerte</div>[/b]</td></table></p>"
Else
objRS.AbsolutePage = iPageCurrent
iRecordsShown = 0
%>
<table width="100%" height="100%" border="1" cellspacing="0" cellpadding="0">
<tr>
<%
'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL
'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA
cont=1
Do While iRecordsShown < iPageSize And Not objRS.EOF
Dim Rig, bg
Rig = Rig + 1
If Rig Mod 2 = 0 then
bg = "sfolongform"
Else
bg = "sfo_form_padova"
End if
Dim Rig1, bg1
Rig1 = Rig1 + 1
If Rig1 Mod 2 = 0 then
bg1 = "sedelongareblu"
Else
bg1 = "sfo_arancio_padova"
End if
%>
<tr>
<td colspan="2" <%Response.Write "class = " & bg & ""%>><div align="left" class="standard">[b]<%= (iPageSize*iPageCurrent)-iPageSize+Cont %>[/b].[b]<% response.write(ucase(objRS("titolo"))) %> [/b]</div></td>
</tr>
<tr>
<td colspan="2" height="4"></td>
</tr>
<tr>
<td width="9%">
<% ' verifica che se c'è una img mette l'img altrimenti mette no_img.gif
if objRS("img") <>"" Then %>
[img]../img/software/<%=(objRS([/img]" height="60" width="90" border="1" hspace="1" vspace="1">
<% else %>
[img]../img/no_img.gif[/img]
<% end if %>
</td>
<td width="91%" valign="top"><div align="justify" class="standard">[img]<%response.write percorso%>img/freccia.gif[/img]
<%=(objRS("descrizione"))%>
<% if objRS("pagina") <>"" Then %>
[[url="<%=(objRS("]" class="collegtop" title="Leggi la recensione completa">Leggi la recensione completa[/url]]</div></td>
<% else %>
[[url="pagina_software.asp?software=<%=(objRS("]" class="collegtop" title="Leggi la recensione completa">Leggi la recensione completa[/url]]</div></td>
<% end if %>
</tr>
<tr>
<td colspan="2" height="5"></td>
</tr>
<td colspan="2" height="1" <%Response.Write "class = " & bg1 & ""%>></td>
</tr>
<td colspan="2" height="15"></td>
</tr>
<%
Cont = Cont + 1
'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB
iRecordsShown = iRecordsShown + 1
objRS.MoveNext
Loop
'PULIZIA DEGLI OGGETTI ADO
objRS.Close
Set objRS = Nothing
%>
</table>
<%End if%>
<%If ipagecount <> 1 Then%>
<center>
<table border="0" height="100%">
<tr valign="middle">
<td width="50%" align="center" valign="middle">
[b]<span class="standard">[
<%if iPageCurrent-2 > 0 and iPageCurrent > 2 then%>
[url="promo_computer.asp?page=1"][img]<%response.write percorso%>img/first.gif[/img][/url]
<%end if%>
<%if iPageCurrent > 1 then%>
[url="promo_computer.asp?page=<%=iPageCurrent-1%>"][img]<%response.write percorso%>img/pre.gif[/img][/url]
<%end if%>
<%if iPageCount > 2 then
if iPageCurrent-2 < 1 then da_pag = 1 else da_pag = iPageCurrent-2
if iPageCurrent+2 > iPageCount then fino_a_pag = iPageCount else fino_a_pag = iPageCurrent+2
else
da_pag = 1
fino_a_pag = iPageCount
end if%>
<%for i = da_pag to fino_a_pag%>
<%if i = iPageCurrent then%>
<font class="linkinterno"><%=i%></font>
<%else%>
[url="promo_computer.asp?page=<%=i%>"]<%=i%>[/url]
<%end if%>
<%next%>
<%if iPageCurrent > 0 and iPageCurrent < iPageCount then%>
[url="promo_computer.asp?page=<%=iPageCurrent+1%>"][img]<%response.write percorso%>img/next.gif[/img][/url]
<%end if%>
<%if iPageCurrent+1 < iPageCount then%>
[url="promo_computer.asp?page=<%=iPageCount%>"][img]<%response.write percorso%>img/last.gif[/img][/url]
<%end if%>
]</span>[/b]
</td>
</tr>
<tr>
<td colspan="2" align="center"><font face="verdana" size="1" color="#000000">
<center>
Pagina
<font color="#FF0000">[b]<%=iPageCurrent%>[/b]</font>
di
<font color="#FF0000">[b]<%=iPageCount%>[/b]</font>
</center>
</font></td>
</tr>
</table>
</center>
<%end if%>
<%
objConn.Close
Set objConn = Nothing
%>
questo è il codice per visualizzare il tutto in colonne:
Codice PHP:
<%'creo il recordset
dim NumeroColonne, id
if not objRS.EOF then
NumeroColonne = 2
%>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<% cont=0
while not objRS.EOF
cont=cont+1
if ((cont-1) mod NumeroColonne)=0 then%>
<tr><%
end if%>
<td>
<table cellpadding="0" border="1" cellspacing="0">
<tr>
<td rowspan="3"></td>
<td>[b]prova[/b]</td>
<tr>
<td>
[b]<%= objRS("DESCRIZIONE")%>[/b]
€ <%= objRS("prezzo")%>
</td>
</tr>
<tr>
<td colspan="2">[url="prodotto.asp"]Dettagli[/url]</td>
</tr>
</table>
</td><%
if (cont mod NumeroColonne)=0 then%>
</tr><%
end if
id = id+1
objRS.movenext
wend
for i=((cont mod NumeroColonne)+1) to NumeroColonne%>
<td>ciao</td><%
next%>
</table><%
end if%>
solo che non riesco ad implementralo con il primo codice che vi ho mostrato..