2 Replies Latest reply on Jan 23, 2016 3:16 PM by andersonlweb

    System of rotating banners with problems

    andersonlweb

      I have a system of rotating banners with views of statistics and clicks, but I'm having trouble with Google IPS (66.249.xxx.xxx) being inserted into the views of the banners. How to fix it?

       

      Thanks
      Anderson

        • 1. Re: System of rotating banners with problems
          Dave Ferguson Level 3

          Can you share the code for this issue?

           

          --Dave

          • 2. Re: System of rotating banners with problems
            andersonlweb Level 1

            I put a condition to "contains" before the query, and decided a little, instances of Google IPs decreased

            Thanks


            <CFSET Session.Pagina = "eventos">

             

            <CFQUERY NAME="abreshopping" DATASOURCE="novosite_mysql">

            SELECT id FROM publicidade WHERE secao = '#session.pagina#' and ativo = '1'

            </CFQUERY>

             

            <CFSET Lista="">

            <CFLOOP QUERY="abreshopping">

            <CFSET Lista=ListAppend(variables.lista, abreshopping.id)></CFLOOP>

             

            <cfset totalitens = ListLen(variables.lista)>

            <cfset item = RandRange(1, #variables.totalitens#)>

            <cfset banner = ListGetAt(variables.lista, variables.item)>

             

            <CFQUERY NAME="ShowShopping" DATASOURCE="novosite_mysql">

            SELECT * FROM publicidade WHERE (id = #variables.banner#)

            </CFQUERY>

             

            <CFOUTPUT QUERY="ShowShopping">

              <CFQUERY NAME="voto" DATASOURCE="novosite_mysql">

              UPDATE publicidade SET n = #n#,

                                         exibicao = exibicao+1

                  WHERE n = #n#

              </CFQUERY>

             

              <CFIF '#cgi.REMOTE_ADDR#' CONTAINS '66.249'>

              <CFELSE>

              <CFQUERY NAME="abres" DATASOURCE="novosite_mysql">

              INSERT INTO cliques (n, exibicao, secao, referencia, titulo, cliques, data, hora, ip, codigo) VALUES ('#n#','1','#session.pagina#','#cgi.HTTP_Referer#','#T#','','#DateFormat(Now(), "dd/mm/yyyy")#','#TimeFormat(Now(), "HH:MM")#','#cgi.REMOTE_ADDR#','#RandRange(1000,4000)#')

              </CFQUERY>

              </CFIF>

             

            </CFOUTPUT>

            <cfoutput query="ShowShopping"><a href="contabanner.cfm?id=#n#&secao=#secao#&codigo=#Materia#" target="_new"><img src="banners/#banner#" border="0" alt="#anunciante#" title="#anunciante#"></a></cfoutput><br><br>