Olá eu tenho um código de livro de visitas e o que eu quero fazer é o seguinte:
Este livro exibe 8 mensagens (1 linha) uma abaixo da outra, o que eu quero é fazer com que ele exiba as 8 menagens só que em duas colunas, ou seja em uma coluna ele mostra 4 mensagens e na outra as outras 4. Estou colocando o código abaixo, pois já tentei modificar e não consegui, alguém pode me ajudar?
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="include/common.asp" -->
<%
Dim rsguest
Dim vpage
Dim page
Dim Block
Dim Blocks
Dim i
Dim totale
Dim maxpages
Dim PagStart
Dim PagStop
Dim RemainingRecords
Dim msg
Block = Request.querystring("Block")
page = Request.querystring("page")
If Block="" Then Block=1
If page="" Then page=1
%>
<html>
<head>
<title><% = Uguestname %></title>
<!--#include file="include/metatag.inc" -->
<LINK href="include/styles.css" rel=stylesheet>
</head>
<!--#include file="include/header.asp" -->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="600" align="center" valign="top">
<%
Set rsguest = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT message.* FROM message ORDER BY msg_id DESC;"
msg = "<div align center><br><br>" & strLangErrorMessageNomessage1 & "</div>"
rsguest.Open strSQL, adoCon, 1, 3
rsguest.PageSize = intRecordsPerPage
If NOT rsguest.EOF Then rsguest.AbsolutePage = page
If rsguest.EOF Then
Response.Write msg
Else
totale = rsguest.RecordCount
For u=1 to intRecordsPerPage
If rsguest.EOF Then Exit For
msg_name = rsguest("Name")
msg_email= rsguest("Email")
msg_city = rsguest("City")
msg_country = rsguest("Country")
msg_homepage= rsguest("Homepage")
msg_icq =rsguest("Icq")
message= rsguest("Message")
msg_date =rsguest("Date")
%>
<table width="489" border="0" cellspacing="2" cellpadding="2" align="center" class="tablemenu">
<tr>
<td align="right" width="479"><b><%=formatDateTIME( msg_date, vbLongDate )%></b> <% = strLangGlobAt %> <b><%=formatDateTIME( msg_date, vbShortTime )%></b></td>
</tr>
<tr>
<td width="479"> </td>
</tr>
<tr>
<td align="justify" width="479"><% = message %></td>
</tr>
<tr>
<td width="479"> </td>
</tr>
<tr>
<td width="479"><div class="hrblue"><img src="images/spacer.gif"></div></td>
</tr>
<tr>
<td align="right" valign="top" width="479"><img src="images/author.gif" align="absmiddle"> <b><% = msg_name %></b> <% If msg_email <>"" Then response.write"| <a href=mailto:" & msg_email & "><img src='images/author_email.gif' align='absmiddle' border='0' alt='" & strLangFormEmail & "'></a> " %>
<% If msg_city <>"" Or msg_country <> "" Then response.write "| <img src='images/author_from.gif' align='absmiddle'> "%>
<% If msg_city <>"" then response.write msg_city & " "
If msg_country <>"" then response.write "<i>" & msg_country & "</i> "%>
<% If msg_homepage <>"" Then response.write "| <a href='" & msg_homepage & "' target='_blank'><img src='images/author_homepage.gif' align='absmiddle' border='0' alt='" & strLangFormHomepage & "'></a> "%>
<% If msg_icq <>"" Then response.write "| <a href=""Javascript:openWin('icq_message.asp?icq=" & msg_icq & "','Icqmessanger','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=330,left=0,top=0')""><img src=""http://web.icq.com/whitepages/online?icq=" & msg_icq & "&img=5"" border='0' alt='" & strLangAltSendIcq & msg_name & "' align='absmiddle'></a> "%>
</td>
</tr>
</table>
<br>
<%
rsguest.movenext
Next
%>
<br><br>
<%
'paginazione
Response.Write "<table width=""90%"" align=""center"" border=""0"" cellspacing=""0"" cellpadding=""0"" height=""20""><tr><td align=""center"" width=""30%"">"
maxpages = int(totale / intRecordsPerPage)
If (totale mod intRecordsPerPage) <> 0 Then
maxpages = maxpages + 1
End If
Blocks=0
Blocks = int(maxpages / PagesPerBlock)
If (maxpages mod PagesPerBlock) <> 0 Then
Blocks = Blocks + 1
End If
Response.Write "" & strLangGlobPage & " " & page & " " & strLangGlobOf & " " & maxpages & "</td>"
Response.Write "<td align=""center"" width=""70%"">"
PagStop=Block*PagesPerBlock
PagStart=(PagStop-PagesPerBlock)+1
i=0
If maxpages>1 Then
For vpage=PagStart to PagStop
i=i+1
If Block=1 Then i=0
If i=1 And Block>1 Then
Response.Write "<A href='" & request.servervariables("SCRIPT_NAME") & "?Block=" & _
(Block-1)& "&page=" & vpage-1 & "' title='" & strLangNavAltPagePrev & "'>" & _
"<img src='images/frecciasx.gif' border='0'><img src='images/frecciasx.gif' border='0'></A> "
End If
RemainingRecords = totale-(vpage*intRecordsPerPage)
If RemainingRecords > 0 Then
If vpage=CInt(page) Then
Response.Write"<b>" & vpage & "</b> "
Else
Response.Write "<A href='" & request.servervariables("SCRIPT_NAME") & "?Block=" & Block & _
"&page=" & vpage & "'>" & vpage & "</A> "
End If
Else
If vpage=CInt(page) Then
Response.Write"<b>" & vpage & "</b> "
Else
Response.Write "<A href='" & request.servervariables("SCRIPT_NAME") & "?Block=" & Block & _
"&page=" & vpage & "'>" & vpage & "</A> "
End If
Exit For
End If
If vpage=PagStop And Blocks>1 and int(Block-1)<int(Blocks) Then
Response.Write " <A href='" & request.servervariables("SCRIPT_NAME") & "?Block=" & (Block+1) & _
"&page=" & vpage+1 & "' title='" & strLangNavAltPageNext & "'>" & _
"<img src='images/freccia.gif' border='0'><img src='images/freccia.gif' border='0'></A>"
End If
Next
End If
Response.Write "</td></tr></table>"
%>
<% End If %>
<br><br>
<%
rsguest.Close
Set rsguest = Nothing
Set strCon = Nothing
Set adoCon = Nothing
%>
</td>
<!--#include file="include/menu.asp" -->
</tr>
</table>
<!--#include file="include/footer.asp" -->
Pergunta
Mateustg
Olá eu tenho um código de livro de visitas e o que eu quero fazer é o seguinte:
Este livro exibe 8 mensagens (1 linha) uma abaixo da outra, o que eu quero é fazer com que ele exiba as 8 menagens só que em duas colunas, ou seja em uma coluna ele mostra 4 mensagens e na outra as outras 4. Estou colocando o código abaixo, pois já tentei modificar e não consegui, alguém pode me ajudar?
<%@LANGUAGE="VBSCRIPT"%> <!--#include file="include/common.asp" --> <% Dim rsguest Dim vpage Dim page Dim Block Dim Blocks Dim i Dim totale Dim maxpages Dim PagStart Dim PagStop Dim RemainingRecords Dim msg Block = Request.querystring("Block") page = Request.querystring("page") If Block="" Then Block=1 If page="" Then page=1 %> <html> <head> <title><% = Uguestname %></title> <!--#include file="include/metatag.inc" --> <LINK href="include/styles.css" rel=stylesheet> </head> <!--#include file="include/header.asp" --> <table width="760" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td width="600" align="center" valign="top"> <% Set rsguest = Server.CreateObject("ADODB.Recordset") strSQL = "SELECT message.* FROM message ORDER BY msg_id DESC;" msg = "<div align center><br><br>" & strLangErrorMessageNomessage1 & "</div>" rsguest.Open strSQL, adoCon, 1, 3 rsguest.PageSize = intRecordsPerPage If NOT rsguest.EOF Then rsguest.AbsolutePage = page If rsguest.EOF Then Response.Write msg Else totale = rsguest.RecordCount For u=1 to intRecordsPerPage If rsguest.EOF Then Exit For msg_name = rsguest("Name") msg_email= rsguest("Email") msg_city = rsguest("City") msg_country = rsguest("Country") msg_homepage= rsguest("Homepage") msg_icq =rsguest("Icq") message= rsguest("Message") msg_date =rsguest("Date") %> <table width="489" border="0" cellspacing="2" cellpadding="2" align="center" class="tablemenu"> <tr> <td align="right" width="479"><b><%=formatDateTIME( msg_date, vbLongDate )%></b> <% = strLangGlobAt %> <b><%=formatDateTIME( msg_date, vbShortTime )%></b></td> </tr> <tr> <td width="479"> </td> </tr> <tr> <td align="justify" width="479"><% = message %></td> </tr> <tr> <td width="479"> </td> </tr> <tr> <td width="479"><div class="hrblue"><img src="images/spacer.gif"></div></td> </tr> <tr> <td align="right" valign="top" width="479"><img src="images/author.gif" align="absmiddle"> <b><% = msg_name %></b> <% If msg_email <>"" Then response.write"| <a href=mailto:" & msg_email & "><img src='images/author_email.gif' align='absmiddle' border='0' alt='" & strLangFormEmail & "'></a> " %> <% If msg_city <>"" Or msg_country <> "" Then response.write "| <img src='images/author_from.gif' align='absmiddle'> "%> <% If msg_city <>"" then response.write msg_city & " " If msg_country <>"" then response.write "<i>" & msg_country & "</i> "%> <% If msg_homepage <>"" Then response.write "| <a href='" & msg_homepage & "' target='_blank'><img src='images/author_homepage.gif' align='absmiddle' border='0' alt='" & strLangFormHomepage & "'></a> "%> <% If msg_icq <>"" Then response.write "| <a href=""Javascript:openWin('icq_message.asp?icq=" & msg_icq & "','Icqmessanger','toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=0,width=400,height=330,left=0,top=0')""><img src=""http://web.icq.com/whitepages/online?icq=" & msg_icq & "&img=5"" border='0' alt='" & strLangAltSendIcq & msg_name & "' align='absmiddle'></a> "%> </td> </tr> </table> <br> <% rsguest.movenext Next %> <br><br> <% 'paginazione Response.Write "<table width=""90%"" align=""center"" border=""0"" cellspacing=""0"" cellpadding=""0"" height=""20""><tr><td align=""center"" width=""30%"">" maxpages = int(totale / intRecordsPerPage) If (totale mod intRecordsPerPage) <> 0 Then maxpages = maxpages + 1 End If Blocks=0 Blocks = int(maxpages / PagesPerBlock) If (maxpages mod PagesPerBlock) <> 0 Then Blocks = Blocks + 1 End If Response.Write "" & strLangGlobPage & " " & page & " " & strLangGlobOf & " " & maxpages & "</td>" Response.Write "<td align=""center"" width=""70%"">" PagStop=Block*PagesPerBlock PagStart=(PagStop-PagesPerBlock)+1 i=0 If maxpages>1 Then For vpage=PagStart to PagStop i=i+1 If Block=1 Then i=0 If i=1 And Block>1 Then Response.Write "<A href='" & request.servervariables("SCRIPT_NAME") & "?Block=" & _ (Block-1)& "&page=" & vpage-1 & "' title='" & strLangNavAltPagePrev & "'>" & _ "<img src='images/frecciasx.gif' border='0'><img src='images/frecciasx.gif' border='0'></A> " End If RemainingRecords = totale-(vpage*intRecordsPerPage) If RemainingRecords > 0 Then If vpage=CInt(page) Then Response.Write"<b>" & vpage & "</b> " Else Response.Write "<A href='" & request.servervariables("SCRIPT_NAME") & "?Block=" & Block & _ "&page=" & vpage & "'>" & vpage & "</A> " End If Else If vpage=CInt(page) Then Response.Write"<b>" & vpage & "</b> " Else Response.Write "<A href='" & request.servervariables("SCRIPT_NAME") & "?Block=" & Block & _ "&page=" & vpage & "'>" & vpage & "</A> " End If Exit For End If If vpage=PagStop And Blocks>1 and int(Block-1)<int(Blocks) Then Response.Write " <A href='" & request.servervariables("SCRIPT_NAME") & "?Block=" & (Block+1) & _ "&page=" & vpage+1 & "' title='" & strLangNavAltPageNext & "'>" & _ "<img src='images/freccia.gif' border='0'><img src='images/freccia.gif' border='0'></A>" End If Next End If Response.Write "</td></tr></table>" %> <% End If %> <br><br> <% rsguest.Close Set rsguest = Nothing Set strCon = Nothing Set adoCon = Nothing %> </td> <!--#include file="include/menu.asp" --> </tr> </table> <!--#include file="include/footer.asp" -->Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados