Skip to main content
Participant
Jan 23, 2016 5:04 PM UTC
Question

System of rotating banners with problems

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

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Dave Ferguson
    Participating Frequently
    Jan 23, 2016 8:58 PM UTC

    Can you share the code for this issue?

    --Dave

    Translate
    Participant
    Jan 23, 2016 11:16 PM UTC

    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>

    Translate