Ir para conteúdo
Fórum Script Brasil

wsales

Membros
  • Total de itens

    22
  • Registro em

  • Última visita

Sobre wsales

wsales's Achievements

0

Reputação

  1. Oi Galera to precisando de uma ajudinha. Seguinte: Eu to incluindo uma paginação em um resultado de um busca ate ai tudo bem consegui fazer ele exibe certinho os resultados a la em baixo ele colocar as páginas 1,2,34,... Porem quando clica em um desses numeros pra pular pra pagina seguinte ele pula, porem mostras todos os resultados do banco e não obdece a paginação. alguém pode dizer onde ta esse erro?? abaixo o código. <% Busca = Ucase (Request.form("buscando")) %> <html> <head> <title>Buscando</title> </head> <style type="text/css"> a:link, a:visited { text-decoration: none } a:hover { text-decoration: none } a:active { text-decoration: none } </style> <body> <br> <% Set banco=server.CreateObject("ADODB.Connection") banco.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=E:\home\onlineon1\web\busca2\AllBusca.mdb" Set rs=server.CreateObject ("ADODB.RecordSet") sql = "SELECT * FROM allbusca WHERE palavrachave LIKE '%"&busca&"%'" rs.open sql, banco,3,3 '############## paginacao Introdução ################# '------- Coloque aqui a quantidade de registros que você deseja por página -------- Const NumPorPage = 15 'Verifica qual a página solicitada Dim PagAtual IF Request.QueryString("PagAtual") = "" Then PagAtual = 1 'Primeira página Else PagAtual = Request.QueryString("PagAtual") End If 'Cria conexão com o Banco de Dados, já abrir anteriormente 'Criado anteriormente Set RS = Server.CreateObject("ADODB.Recordset") '>>> FIZ EM CIMA rs.CursorLocation = 3 Acerta a posição do cursor . 3 ou adUseClient rs.CacheSize = NumPorPage 'Define o tamanho do Cache = para o número de registros 'Cria a String SQL '>>> FIZ EM CIMA Dim SQLpag '>>> FIZ EM CIMA SQLpag = "SELECT * FROM jogos" '>>> FIZ EM CIMA RS.Open SQLpag, Conn Abre o RecordSet rs.MoveFirst 'Move o RecorSet para o início rs.PageSize = NumPorPage 'Coloca a quantidade de páginas Dim TotalPages 'Pega o número total de páginas TotalPages = rs.PageCount rs.AbsolutePage = PagAtual 'Configura a página atual '############## paginacao Introdução - FIM ################# Count = 0 'Zera o contador 'Inicia a Função DO, utilizando a quantidade de páginas especificadas 'Ou seja ele irá executar a ação até que o valor Count seja menor que "20" como está no nosso exemplo i = 0 DO WHILE NOT rs.EOF And Count < rs.PageSize 'paginacao And Count < rs.PageSize ' ----- linhas coloridas ------- if i mod 2<>0 then cor = "#F4F4F4" else cor = "#e1e1e1" end if '------------------------------- if rs.recordcount > 10 then rs.movefirst Response.write "<Table cellpading = 0 cellspacing = 0>" while not rs.EOF if Not Left(Ucase(rs("URL")),7) = "HTTP://" then curl="http://"&rs("URL") else curl = rs("URL") end if %> <br> <br> <table width="100%"> <Tr> <td width="95"><A HREF=<%=curl%>><img src="<%=rs("foto")%>" width="90" height="68" border="0" alt=""></a></td> <td> <font color="silver" size="2" face="arial, verdana, tahoma"><%=rs("data")%> <br> <font color="#4a494b" size="3" face="arial, verdana, tahoma"><strong><%=rs("titulo")%></strong></font> <br> <A HREF=<%=curl%>><font color="#4a494b" size="3" face="arial, verdana, tahoma"><% desc = Replace (rs.fields("descricao"),chr(10),"<BR>") Response.write desc %></font></a> <br> </td> </tr> <tr> <td colspan="2"><hr size="1" color="#c0c0c0" width="100%"></td> </tr> <% i = i+1 Count = Count + 1 'paginacao rs.movenext wend Response.write "</table>" Else Response.write busca End if LOOP %> <%'Coloca o Nº página atual / Nº Total de páginas 'Response.Write("<B><font color=""#006600"" size=""2"" face=""Arial""><strong> Página " & Pag'Atual & " de " & TotalPages & " </strong></font></B> - ") 'Mostra os botões: Anterior e Próximo, utilizando da opção de IF var01 = Len(PagAtual) 'Lê o tamanho do numero var02 = var01 - 1 'subtrai um da variavel , retirando o digito menos sig. var03 = Left(PagAtual,var02) 'obtem os digitos mais sig. do numero var04 = Right(PagAtual,1) 'obtem o digito menos sig. do numero var05 = var03 & 0 ' Acrecenta ZERO no final IF var04 <> 0 THEN ' condição se o digito menos sig. é Zero inicial = var05 + 1 final = inicial + 9 ELSE inicial = var05 - 9 final = var05 END IF indice_i = var04 - 1 'ultimo digito - 1 indice_f = 10 - var04 ' 10 - digito menos sig. If CInt(final) > CInt(TotalPages) Then final = TotalPages IF PagAtual > 1 THEN 'Se for a primeira página, Mostra apenas o botão Próximo e Ultima Response.Write("<B><font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='buscando2.asp?PagAtual=" & 1 & "'>") Response.Write("<img src='images/primeira.gif'border='0' alt='Primeira página'>") Response.Write("</a></font></B> ") Response.Write("<B><font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='buscando2.asp?PagAtual=" & PagAtual - 1 & "'>") Response.Write ("<img src='images/anterior.gif' border='0' alt='Página anterior'>") Response.Write("</a></font></B> ") IF PagAtual > 10 THEN Response.Write("<B><font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='buscando2.asp?PagAtual=" & inicial - 1 & "'>") Response.Write("...") Response.Write("</a></font></B> ") ELSE Response.Write("<B><font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("....") Response.Write("</font></B> ") END IF Else Response.Write("<B><font color=""#EEEEEE"" size=""2"" face=""Arial"">") Response.Write("<img src='images/primeira.gif' border='0' alt='Primeira página'>") Response.Write("</font></B> ") Response.Write("<B><font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("<img src='images/anterior.gif' border='0' alt='Página anterior'>") Response.Write("</font></B> ") Response.Write("<B><font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("...") Response.Write("</font></B> ") End If '---------------------- NUMEROS --------------------------- For i = inicial To final If CInt(i)=CInt(PagAtual) Then Response.Write "<font color=""#660066"" size=""2"" face=""Arial"">[ <B>" & i & "</B> <font color=""#660066"">]</font> " END IF If CInt(i) < CInt(PagAtual) Then Response.Write "<font color=""#660066"" size=""2"" face=""Arial""><a href='buscando2.asp?PagAtual=" & i & "' style='color=#666666'>" & i & "</a></font> " END IF If CInt(i) > CInt(PagAtual) Then Response.Write "<font color=""#660066"" size=""2"" face=""Arial""><a href='buscando2.asp?PagAtual=" & i & "'>" & i & "</a></font> " END IF Next IF CInt(PagAtual) <> CInt(TotalPages) THEN p1 = Left(PagAtual,var02) p2 = Left(TotalPages,var02) p3 = Left(TotalPages,var02) & 0 IF (p1 > PagAtual) or ((PagAtual <= 10) and (TotalPages > 10)) THEN Response.Write("<B><font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='buscando2.asp?PagAtual=" & final + 1 & "'>") Response.Write("...") Response.Write("</a></font></B> ") ELSE Response.Write("<B><font color=""#CCCCCC"" size=""2"" face=""Arial"">") Response.Write("...") Response.Write("</font></B> ") END IF Response.Write("<B><font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='buscando2.asp?PagAtual=" & PagAtual + 1 & "'>") Response.Write("<img src='images/proxima.gif' border='0' alt='Próxima página'>") Response.Write("</a></font></B> ") Response.Write("<B><font color=""#660066"" size=""2"" face=""Arial"">") Response.Write("<a href='buscando2.asp?PagAtual=" & TotalPages & "'>") Response.Write("<img src='images/ultima.gif' border='0' alt='Ultima página'>") Response.Write("</a></font></B> ") ELSE Response.Write("<B><font color=""#666666"" size=""2"" face=""Arial"">") Response.Write("...") Response.Write("</font></B> ") Response.Write("<B><font color=""#666666"" size=""2"" face=""Arial"">") Response.Write("<img src='images/proxima.gif' border='0' alt='Próxima página'>") Response.Write("</font></B> ") Response.Write("<B><font color=""#666666"" size=""2"" face=""Arial"">") Response.Write("<img src='images/ultima.gif' border='0' alt='Ultima página'>") Response.Write("</font></B> ") End If Rs.Close Set RS = Nothing banco.Close Set Conn = Nothing %> </body> valeu!!
  2. Galeria to com uma bronca preciso de 3 colunas dm div que role 2 e uma fique fixada parecido com o efeito do facebook exemplo Coluna 1 coluna 2 coluna 3 Fica fixa rola e para fica rolando até o final da pagina no meio da pagina fiz esse codigo abaixo mas só consigo rola 1 ou duas simultaneamente e elas precisam rola individualmente. alguém tem uma ideia?
  3. Ola pessoa como faço para exibir os usuarios cadastrados num banco db.php esse baixo: arquivo db.php <?php $valida[] = ""; ?><?php $valida[senhor1] = "teste1"; ?><?php $valida[senhor2] = "teste2"; ?> eu queria criar uma pagina para exibir assim: Usuario: senhor 1 Usuario: senhor 2 Mas to apanhan do sou iniciante em php
  4. Galera to puxando imagem em um sistema de noticias do mas a bronca é que quando a materia vai sem imagem fica aparecendo uma pequeno quadro como se estivesse faltando a imagem, como faço para colocar uma imagem padrão?? to usando esse cosigo para puxar a image <img src="<%=rs("foto")%>" border="0">
  5. Ola pessoal to quebrando cabeça ainda com aquele blog, a bronca agora é essa, como eu aumento o limite de registro por pagina?? tente de tudo e na conegui. abaix o codigo para você darem uma maõzinha <% @ Language=VBScript %> <% Option Explicit %> <!--#include file="common.asp" --> <% '**************************************************************************************** '** Copyright Notice '** '** Web Wiz NewsPad(TM) '** http://www.webwiznewspad.com '** '** Copyright (C)2001-2011 Web Wiz Ltd. All Rights Reserved. '** '** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS UNDER LICENSE FROM WEB WIZ LTD. '** '** IF YOU DO NOT AGREE TO THE LICENSE AGREEMENT THEN WEB WIZ LTD. IS UNWILLING TO LICENSE '** THE SOFTWARE TO YOU, AND YOU SHOULD DESTROY ALL COPIES YOU HOLD OF 'WEB WIZ' SOFTWARE '** AND DERIVATIVE WORKS IMMEDIATELY. '** '** If you have not received a copy of the license with this work then a copy of the latest '** license contract can be found at:- '** '** http://www.webwiz.co.uk/license '** '** For more information about this software and for licensing information please contact '** 'Web Wiz' at the address and website below:- '** '** Web Wiz Ltd, Unit 10E, Dawkins Road Industrial Estate, Poole, Dorset, BH15 4JD, England '** http://www.webwiz.co.uk '** '** Removal or modification of this copyright notice will violate the license contract. '** '**************************************************************************************** '*************************** SOFTWARE AND CODE MODIFICATIONS **************************** '** '** MODIFICATION OF THE FREE EDITIONS OF THIS SOFTWARE IS A VIOLATION OF THE LICENSE '** AGREEMENT AND IS STRICTLY PROHIBITED '** '** If you wish to modify any part of this software a license must be purchased '** '**************************************************************************************** 'Set the response buffer to true as we maybe redirecting Response.Buffer = True 'Make sure this page is not cached Response.Expires = -1 Response.ExpiresAbsolute = Now() - 2 Response.AddHeader "pragma","no-cache" Response.AddHeader "cache-control","private" Response.CacheControl = "No-Store" 'see if the web front end is active Call WebFrontEnd() 'Dimension variables Dim strSearchCriteria 'Holds the search criteria Dim intCategory 'Holds the category we are looking at Dim lngNewsletterID 'Holds saved newsletter ID Dim strNewsletterSubject 'Holds saved newsletter Subject Dim strNewsletterNote 'Holds saved newsletter Note Dim dtmNewsletterDate 'Holds saved newsletter Date sent Dim blnDisplay 'Set to true if displayed to public Dim blnHTMLFormat 'Set to true if in HTML format Dim sarryBlogPost 'Array to hold post recordset Dim sarryMemberDetails 'Holds the members details Dim intTotalRecords 'Total number of records in array Dim lngTotalRecordsPages 'Total number of pages Dim intStartPosition 'Start position in array Dim intEndPosition 'End position in array Dim intCurrentRecord 'Current record position Dim intRecordPositionPageNum 'Current page position Dim intRecordsPerPage 'Records displayed on each page Dim intPageLinkLoopCounter 'Loop counter for displaying links to other pages Dim strCategoryName 'Holds the name of the category Dim strCanonicalURL 'Holds Canonical URL Dim strPostLink 'Holds the link for the post Dim lngNoOfComments 'Holds the number of comments Dim strPageTitle 'Holds the page title for the page Dim strUserID 'Holds the users ID Dim strBlogPost 'Holds the blog post Dim strBlogPostSubject 'Holds the blog post subject Dim blnActiveMember Dim strCatDescription Dim strPostStartDate Dim strPostEndDate blnActiveMember = False 'Number of records per page intRecordsPerPage = intBlogPostsPerPage 'If this is the first time the page is displayed then the Forum Topic record position is set to page 1 If isNumeric(Request.QueryString("PN")) = false Then intRecordPositionPageNum = 1 ElseIf Request.QueryString("PN") < 1 Then intRecordPositionPageNum = 1 'Else the page has been displayed before so the Forum Topic record postion is set to the Record Position number Else intRecordPositionPageNum = IntC(Request.QueryString("PN")) End If 'Read in if there is a post month If isDate(Request.QueryString("Y") & "-" & Request.QueryString("M")) Then strPostStartDate = internationalDateTime(Request.QueryString("Y") & "-" & Request.QueryString("M") & "-1") strPostEndDate = internationalDateTime(Request.QueryString("Y") & "-" & Request.QueryString("M") & "-" & getMonthDayNo(Request.QueryString("M"),Request.QueryString("Y"))) End If 'Read in if there is a post date If isDate(Request.QueryString("DATE")) Then strPostStartDate = internationalDateTime(Request.QueryString("DATE")) strPostEndDate = internationalDateTime(Request.QueryString("DATE")) End If 'Response.Write(strPostDate) 'Get the category to be displayed If isNumeric(Request.QueryString("CAT")) = false Then intCategory = 0 Else intCategory = IntC(Request.QueryString("CAT")) End If 'Get the search critiria if this is a search (clean it up incase of SQL injection If NOT Request.QueryString("KW") = "" Then strSearchCriteria = formatSQLInput(Trim(Mid(Request.QueryString("KW"), 1, 20))) End If 'If we are within a category, read in the category name (done before main sql as some posts are not in categories) If intCategory > 0 Then strSQL = "SELECT " & strDbTable & "Category.Cat_Name, " & strDbTable & "Category.Description " & _ "FROM " & strDbTable & "Category " & _ "WHERE " & strDbTable & "Category.Cat_ID = " & intCategory & ";" 'Set error trapping On Error Resume Next 'Query the database rsCommon.Open strSQL, adoCon 'If an error has occurred write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occurred while executing SQL query on database.", "get_cat_name", "default.asp") 'Disable error trapping On Error goto 0 'If records returned read em in If NOT rsCommon.EOF Then strCategoryName = rsCommon("Cat_Name") strCatDescription = rsCommon("Description") 'Use the blog description as the description meta tag strBlogMetaDescription = strCatDescription End If rsCommon.Close End If 'Initalise the strSQL variable with an SQL statement to query the database strSQL = "SELECT " & strDbTable & "Newsletter.Newsletter_ID, " & strDbTable & "Newsletter.Newsletter_subject, " & strDbTable & "Newsletter.Newsletter_date, " & strDbTable & "Newsletter.Newsletter, " & strDbTable & "Newsletter.Author, " & strDbTable & "Newsletter.Allow_Comments, " & strDbTable & "Newsletter.Private " & _ "From " & strDbTable & "Newsletter" & strDBNoLock & " " 'If we are requiring a category we need to join the table If intCategory > 0 Then strSQL = strSQL & ", " & strDbTable & "NewsCat" & strDBNoLock & " " & _ "WHERE " & strDbTable & "Newsletter.Newsletter_ID = " & strDbTable & "NewsCat.Newsletter_ID " & _ "AND " & strDbTable & "NewsCat.Cat_ID = " & intCategory & " " & _ "AND " & strDbTable & "Newsletter.Blog_publish = " & strDBTrue & " " Else strSQL = strSQL & "WHERE " & strDbTable & "Newsletter.Blog_publish = " & strDBTrue & " " End If 'If we have a date then include this in the WHERE clause If isDate(strPostStartDate) Then strSQL = strSQL & "AND (" & strDbTable & "Newsletter.Newsletter_date BETWEEN " & formatDbDate(strPostStartDate) & " AND " & formatDbDate(strPostEndDate) & ")" End If 'If a search cretiria is selected then run a where like query If strSearchCriteria <> "" Then strSQL = strSQL & "AND (" & strDbTable & "Newsletter.Newsletter_subject Like '%" & strSearchCriteria & "%' OR " & strDbTable & "Newsletter.Newsletter Like '%" & strSearchCriteria & "%')" End If strSQL = strSQL & "ORDER BY " & strDbTable & "Newsletter.Newsletter_date DESC;" 'SQL Query Array Look Up table '0 = Newsletter_ID '1 = Newsletter_subject '2 = Newsletter_date '3 = Description '4 = Author '5 = Allow_Comments '6 = Private 'Set error trapping On Error Resume Next 'Query the database rsCommon.Open strSQL, adoCon 'If an error has occurred write an error to the page If Err.Number <> 0 Then Call errorMsg("An error has occurred while executing SQL query on database.", "get_newsletter_data", "default.asp") 'Disable error trapping On Error goto 0 'If records returned read them into an array If NOT rsCommon.EOF Then 'Read in the newsletter recordset into an array sarryBlogPost = rsCommon.GetRows() 'Count the number of records intTotalRecords = Ubound(sarryBlogPost,1) + 1 'Count the number of pages for the topics using FIX so that we get the whole number and not any fractions lngTotalRecordsPages = FIX(intTotalRecords / intRecordsPerPage) 'If there is a remainder or the result is 0 then add 1 to the total num of pages If intTotalRecords Mod intRecordsPerPage > 0 OR lngTotalRecordsPages = 0 Then lngTotalRecordsPages = lngTotalRecordsPages + 1 'Start position intStartPosition = ((intRecordPositionPageNum - 1) * intRecordsPerPage) 'End Position intEndPosition = intStartPosition + intRecordsPerPage 'Get the start position intCurrentRecord = intStartPosition End If 'Clean up rsCommon.Close 'If this page is above the maximum number of pages in the blog then send a 404 header status If intRecordPositionPageNum > lngTotalRecordsPages AND intTotalRecords <> 0 Then Response.Status = "404 Not Found" 'See if the user is allowed to view the blog post and if logged in update any blog post codes If isArray(sarryBlogPost) Then 'Read in the users ID code strUserID = Trim(Mid(Request.Cookies(strCookiePrefix)("UID"), 1, 33)) 'Clean up the USER ID address getting rid of unwanted characters strUserID = IDcharacterStrip(strUserID) 'Get the users details from the database If strUserID <> "" Then 'Initalise the strSQL variable with an SQL statement to query the database strSQL = "SELECT " & strDbTable & "Members.Name, " & strDbTable & "Members.Email, " & strDbTable & "Members.Company, " & strDbTable & "Members.Address1, " & strDbTable & "Members.Address2, " & strDbTable & "Members.City, " & strDbTable & "Members.State, " & strDbTable & "Members.Country, " & strDbTable & "Members.Postcode, " & strDbTable & "Members.Active " & _ "FROM " & strDbTable & "Members" & strDBNoLock & " " & _ "WHERE " & strDbTable & "Members.ID_Code = '" & strUserID & "';" 'Query the database rsCommon.Open strSQL, adoCon 'If a record is not returned then the user is not a subscriber If NOT rsCommon.EOF Then 'Read in if the member is active blnActiveMember = CBool(rsCommon("Active")) 'Place member deatils in array sarryMemberDetails = rsCommon.GetRows() End If 'Close db rsCommon.Close End If End If 'Call sub routime to create links to mutiple pages If strSearchCriteria <> "" AND intCategory > 0 Then strLinkPage = ("default.asp?KW=" & strSearchCriteria & "&CAT=" & intCategory & "&") ElseIf strSearchCriteria <> "" Then strLinkPage = ("default.asp?KW=" & strSearchCriteria & "&") ElseIf intCategory > 0 Then strLinkPage = ("default.asp?CAT=" & intCategory & "&") Else 'Call sub routime to create links to mutiple pages strLinkPage = ("default.asp?") End If 'if a category build the link title If strCategoryName <> "" Then strLinkPageTitle = SeoUrlTitle(strCategoryName, "&amp;t=") 'If URL Rewriting is enabled create the canonical to the page for improved SEO If NOT Request.ServerVariables("HTTP_X_ORIGINAL_URL") = "" OR NOT Request.ServerVariables("HTTP_X_REWRITE_URL") = "" Then If intCategory > 0 AND intRecordPositionPageNum = 1 Then strCanonicalURL = strNewsPadURI & SeoUrlTitle(strCategoryName, "") & "_cat" & intCategory & ".html" ElseIf intCategory > 0 Then strCanonicalURL = strNewsPadURI & SeoUrlTitle(strCategoryName, "") & "_cat" & intCategory & "_page" & intRecordPositionPageNum & ".html" ElseIf intRecordPositionPageNum = 1 Then strCanonicalURL = strNewsPadURI Else strCanonicalURL = strNewsPadURI & SeoUrlTitle(strNewsPadName, "") & "_page" & intRecordPositionPageNum & ".html" End If 'Else canonical without URL rewriting Else If intCategory > 0 AND intRecordPositionPageNum = 1 Then strCanonicalURL = strNewsPadURI & "default.asp?CAT=" & intCategory & SeoUrlTitle(strCategoryName, "&t=") ElseIf intCategory > 0 Then strCanonicalURL = strNewsPadURI & "default.asp?CAT=" & intCategory & "&PN=" & intRecordPositionPageNum & SeoUrlTitle(strCategoryName, "&t=") ElseIf intRecordPositionPageNum = 1 Then strCanonicalURL = strNewsPadURI Else strCanonicalURL = strNewsPadURI & "default.asp?PN=" & intRecordPositionPageNum End If End If %> <!--#include file="includes/browser_page_encoding_inc.asp" --> <html> <head> <title>Blog </title> </head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <% Session.LCID = 1046 ' Brazil %> <STYLE type=text/css>BODY { BACKGROUND-REPEAT: repeat-y } TD { FONT-FAMILY: arial,verdana,helvetica,sans-serif; FONT-SIZE: 13px } A:link { COLOR: #4F8B52; TEXT-DECORATION: none } A:visited { COLOR: #4F8B52 } A:active { COLOR: #4F8B52 } A:hover { COLOR: #1A2E1B } </STYLE> <body leftmargin="0" topmargin="0" bgcolor="#EFF8EF"> <% 'If there are no topics to display, show a message saying so If intTotalRecords <= 0 Then 'If there are no Topic's to display then display the appropriate error message Response.Write(vbCrLf & " <tr>" & _ vbCrLf & " <td><br />" & _ vbCrLf & " <table width=""230"" align=""center"" class=""errorTable"" cellspacing=""1"" cellpadding=""1"">" & _ vbCrLf & " <tr>" & _ vbCrLf & " <td><img src=""" & strImagePath & "error.png"" alt=""" & strTxtError & """ align=""absmiddle"" /> <strong>" & strTxtError & "</strong>") 'Select which message to display If strSearchCriteria <> "" Then Response.Write(strTxtYourSearchFailedToFindResults) ElseIf intCategory > 0 Then Response.Write(strTxtThereAreNoNewsBulletinsToDisplay & " " & strTxtInThisCategory) Else Response.Write(strTxtThereAreNoNewsBulletinsToDisplay) End If Response.Write(".</td>" & _ vbCrLf & " </tr>" & _ vbCrLf & " </table>" & _ vbCrLf & "") 'Else there the are topic's so write the HTML to display the topic names and a discription Else 'Do....While Loop to loop through the recorset to display the blog posts Do While intCurrentRecord < intEndPosition 'If there are no topic records left to display then exit loop If intCurrentRecord >= intTotalRecords Then Exit Do 'SQL Query Array Look Up table '0 = Newsletter_ID '1 = Newsletter_subject '2 = Newsletter_date '3 = Description '4 = Author '5 = Allow_Comments '6 = Private 'Read in the post strBlogPost = sarryBlogPost(3,intCurrentRecord) strBlogPostSubject = sarryBlogPost(1,intCurrentRecord) 'If URL Rewriting is enabled create the canonical to the page for improved SEO If NOT Request.ServerVariables("HTTP_X_ORIGINAL_URL") = "" OR NOT Request.ServerVariables("HTTP_X_REWRITE_URL") = "" Then strPostLink = SeoUrlTitle(strBlogPostSubject, "") & "_post" & sarryBlogPost(0,intCurrentRecord) & ".html" 'Else canonical without URL rewriting Else strPostLink = "post.asp?id=" & sarryBlogPost(0,intCurrentRecord) & SeoUrlTitle(sarryBlogPost(1,intCurrentRecord), "&t=") End If 'If a private post and not an active member tell the user they need to be logged in If BoolC(sarryBlogPost(6,intCurrentRecord)) AND blnActiveMember = False Then strBlogPost = strTxtThisNewsletterIsPrivate & ". <a href=""sign_up.asp"">" & strTxtClickToSubscribe & "</a>" End If %> <table cellpadding="0" cellpadding="0" width="230"> <tr> <td>&nbsp;</td><td><% 'If a private post then do not have the post subject as a link If BoolC(sarryBlogPost(6,intCurrentRecord)) AND blnActiveMember = False Then Response.Write("<h52>" & strBlogPostSubject & "</h5>") 'Else display the post subject as a link Else Response.Write("<hr size=""-1"" color=""#CDE5CD"" width=""255""><strong><a href=""" & strPostLink & """ title=""" & strBlogPostSubject & """ class=""h5"">" & strBlogPostSubject & "</a></strong>") End If %> </td> </tr> </table> <% 'Move to the next record intCurrentRecord = intCurrentRecord + 1 Loop End If %> </body> </html>
  6. Ssistema que to usando é um blog desses caras aqui: http://www.webwiznewspad.com o blog é massa porem não tem essa opção de exiber por data as mensagens anteriores
  7. Ola galera tenho um blog em asp e queria saber como faço para que ele exiba ao lado as materias postadas: exemplo abaixo Novembro Tem certeza que voce não acredita em Papai Noel?? Vereador prezo por roubo na camara dos vereadores Dezembro Natal terá neve em São Paulo Copa 2014 ainda falta muita coisa para ser feito Mega Sena pode fazer um milhonario na MEga da Vira do ano. Eu queria que ficasse assim , já tenho um blog porem não tenho isso alguém ai tem uma função para isso? Grato
  8. ninguém para dar um humilde ajuda, sou novato em php por isso to apanhando nisso!!!
  9. é que hoje ela chama a foto apliada na mesma pagina e eu queria que ela abrisse a foto ampliada ao clicar numa lightbox, tentei mexer no codigo mas não consegui fazer com que ao clicar na imagem thumbs abrisse a foto grande numa lightbox. Essa é a bronca.
  10. Pessoal to quebrando cabeça pois sei muito de PHP não mas o sistema de galeria brasil é muuito bom, dai to tentando colocar a galeria para abrir as mensagem ampliadas num lightbox mas to levando a maior surra. segue abaixo cidigo galeria.html <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> <link rel="stylesheet" href="templates/css/lightbox.css" type="text/css" media="screen" /> <script src="templates/js/prototype.js" type="text/javascript"></script> <script src="templates/js/scriptaculous.js?load=effects" type="text/javascript"></script> <script src="templates/js/lightbox.js" type="text/javascript"></script> <link href="templates/{$config.template}/css/galeria.css" type="text/css" rel="stylesheet" /> <script src="core/js/mootools.js" type="text/javascript"></script> <script src="core/js/mootools-tips.js" type="text/javascript"></script> <script src="core/js/system.js" type="text/javascript"></script> <script src="core/js/galeria.js" type="text/javascript"></script> <script src="core/js/tooltips.js" type="text/javascript"></script> {literal} <script type="text/javascript"> window.addEvent('domready', function() { {/literal} Galeria.imagem.escolher({$capa.img_codigo}); {literal} }); </script> {/literal} <title>{$galeria.gal_local} - {$galeria.gal_data}</title> </head> <body> <div id="container"> <div id="header"> <h2>{$galeria.gal_titulo}</h2> <h3>{$galeria.gal_local} - {$galeria.gal_data}</h3> </div> <div id="lista"> <div id="imagens"> {foreach item=imagem from=$imagens} <a href="#{$imagem.img_codigo}" {if $imagem.img_mensagem}title="{$imagem.img_mensagem}" class="tips"{/if} onclick="Galeria.imagem.escolher({$imagem.img_codigo});" rel="lightbox" > <img src="imagem.php?gal={$galeria.gal_pasta}&img={$imagem.img_nome_arquivo}&thumb=1" alt="{$imagem.img_mensagem}" /> </a> {foreachelse} Nenhuma Imagem encontrada {/foreach} </div> <div id="paginacao"> {$paginacao} </div> </div> <div id="imagem"> </div> <div id="footer"> </div> </div> </body> </html>
  11. Ai galera peguei o sistema de noticias do Cido Silva uma massa mas to querendo que uma página liste todas as últimas noticias , independente da classe tipo assim: Esportes A copa 2010 esta chegando e a africa esta muito otimista Internacional Alqueda ameaça com bombas seleciones do mundo Nacional Chuvas do rio fazemos muitas vitimas. Estava adptando o codigo abaixo mas não to conseguindo alguém pode dá uma mão ai?? <% @Language = VBScript %><%session.LCID=1046%> <%strNoticias = Request.QueryString("Noticias") if strNoticias <> "" then stringConexao = "Provider=Microsoft.JET.OLEDB.4.0; Data Source=" & Server.MapPath("dados/dados.mdb") Set RsConexao = Server.CreateObject("ADODB.Connection") RsConexao.Open stringConexao strSQL = "SELECT * FROM Noticias WHERE Noticia LIKE '%"& Noticias &"%'" Set RS = RsConexao.Execute(strSQL) %> <!-- desenvolvido pelo Cido Silva - --> <STYLE type=text/css>BODY { SCROLLBAR-FACE-COLOR: #f8f8f8; SCROLLBAR-HIGHLIGHT-COLOR: #1E7BEF; SCROLLBAR-SHADOW-COLOR: #1E7BEF; SCROLLBAR-3DLIGHT-COLOR: #fcfcfc; SCROLLBAR-ARROW-COLOR: #1E7BEF; SCROLLBAR-TRACK-COLOR: #fcfcfc; SCROLLBAR-DARKSHADOW-COLOR: #fdf5e3 } .style5 { FONT-WEIGHT: bold; FONT-SIZE: 10px; FONT-FAMILY: Tahoma, Verdana, Arial } </STYLE> </STYLE> <STYLE> A:link { Color:#4BA0F7 ;TEXT-DECORATION: none } A:visited { Color:#4BA0F7 ;TEXT-DECORATION: none } A:active { Color:#4BA0F7 ;TEXT-DECORATION: none } A:hover { Color:#FF0000 ;TEXT-DECORATION: underline; background-color:yellow } </STYLE> <meta name="generator" content="Namo WebEditor v5.0"> <body bgcolor="white" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0"> <table align="center" cellpadding="0" cellspacing="0"> <tr> <td width="749"> <p></p> </td> </tr> </table> <table align="center" cellpadding="0" cellspacing="0" width="635"> <tr> <td width="125" valign="top" height="39"> </td> <td width="510" valign="top" height="39"> <p align="center"><font face="Arial Black" color="red"> </font><p> <font face="Arial"><span style="font-size:10pt;"><%While not RS.EOF response.write "" & RS("Classe") & "<BR>" response.write ("<a href=""Mostra.asp?Noticias=" & RS("ID") & "&classe=" & RS("Classe1") & """>" & RS("tópico") & "</a>") & "<BR><BR>" RS.MoveNext Wend end if %> </span></font></p> </td> </tr> </table>
  12. podem fechar o tópico resolvi com ajuda de amigo klonder do forum.imaster vou deixar aqui o codigo caso algum precise enquete que vota na image e contabiliza voto. <html> <head> <title>Enquete</title> <script language="JavaScript" type="text/javascript"> <!-- //Definindo as variáveis: var objRadio; var i; var checado = 0; function selecionar(e) { objRadio = document.forms["form1"].elements["u_input"]; if (e==1) { objRadio[0].checked = true; } if (e==2) { objRadio[1].checked = true; } } function votar() { objRadio = document.forms["form1"].elements["u_input"]; for (i=0; i < objRadio.length; i++) { if (objRadio[i].checked == true) { checado = 1; if(confirm("Você escolheu a figura: "+(i+1)+"\nDeseja prosseguir?")) { document.form1.submit(); } } } if (checado == 0) { alert("Por favor, selecione uma opção."); return false; } } --> </script> </head> <body> <% 'Two varibles are passed into the db 'u_input is the value if the user entered a response to 'the vote/poll question....IP is the address of the user u_input=request.form("u_input") u_ip=request.servervariables("remote_addr") ' if the user did not enter anything in the poll on this visit ' then display the poll question and possible choices if u_input = "" then %> <form name="form1" action="<%= request.servervariables("script_name") %>" method="post"> Selecione uma opção: <br><img src="figura1.gif" border="0" onClick="selecionar(1)"><input type="radio" name="u_input" value="1"> <br><img src="figura2.gif" border="0" onClick="selecionar(2)"><input type="radio" name="u_input" value="2"> <br><br> <input type="button" value="Votar" onClick="votar();"> </form> <% else ' if the user did input a choice on the vote/ballot ' check to see if their ip address is already in the db accessdb="votes_db" cn="driver={Microsoft Access Driver (*.mdb)};" cn=cn & "dbq=" & server.mappath(accessdb) set rs = server.createobject("ADODB.Recordset") sql = "select ip from ballot where ip ='" & u_ip & "'" rs.Open sql, cn if rs.eof then ' if the user has not voted previously indicate it been_here_before="No" end if rs.close if been_here_before = "No" then ' Since the user has not voted previously their input ' their vote will be added to the db sql = "insert into ballot (ip, selection" & u_input &") " sql = sql & "values ('" & u_ip & "',1)" rs.Open sql, cn end if 'This will summerize and count the records in the db sql= "select distinctrow sum(selection1) as sum_selection1, " sql= sql & "sum(selection2) AS sum_selection2, count(*) AS total_votes " sql= sql & "FROM ballot;" rs.Open sql, cn total1=rs ("sum_selection1") total2=rs ("sum_selection2") count=rs ("total_votes") %> <br> <br> <br> <br> <br> <br> A<img src="images/blue.jpg" height="10" width="<%= (total1/count)*100 %>"> <%= formatnumber((total1/count)*100,1) %>%<br> B<img src="images/yellow.jpg" height="10" width="<%= (total2/count)*100 %>"> <%= formatnumber((total2/count)*100,1) %>%<br> Total Votes: <%= formatnumber(count,0,0) %><br> <% if been_here_before <> "No" then %> <% else %> <% end if %> <br> The I.P. Address is <%= u_ip %> <% end if %> </body> </html>
×
×
  • Criar Novo...