Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Bottom
Multiple IP addresses in Banners Configuration
  • Posted: 22.08.2003, 00:59
     
    toxick
    rank:
    Freshman Freshman
    registered:
     August 2003
    Status:
    offline
    last visit:
    17.09.03
    Posts:
    2
    I work on my site from home and from work...Two different IP's. I was getting tired of artificially inflating my banner impression numbers (or having to change my IP in the banners configuration section every time I went to work, or came home) so I modified includes/pnBanners.php @ line 72. (0.7.2.6-Phoenix RC3)

    Replace:

    if ($myIP == $myhost) {

    with

    if ( ereg($myhost, $myIP) ) {

    Then, in the banners configuration, you can put a bunch of IPs on the same line. I use a space as a delimiter, but there's no reason you couldn't use a comma or something else...probably. YMMV.

    Just thought someone else may be having the same problem...
  • Posted: 01.09.2003, 00:35
     
    Indigaz
    rank:
    Freshman Freshman
    registered:
     June 2003
    Status:
    offline
    last visit:
    03.11.05
    Posts:
    20
    This is a good one. I had the same issue with a site I was running. Nice job.
  • Posted: 18.09.2003, 01:04
     
    toxick
    rank:
    Freshman Freshman
    registered:
     August 2003
    Status:
    offline
    last visit:
    17.09.03
    Posts:
    2
    I have also "fixed" modules/News/article.php so that it doesn't increment the view counter for a story if the user is coming from one of the "admin ips", as specified by the banners config.

    @ around line 90:

    $myIP = pnConfigGetVar('myIP');
    $remote = getenv("REMOTE_ADDR");

    if ( ! ereg($remote, $myIP) )
    {
    $column = &$pntable['stories_column'];
    $dbconn->Execute("UPDATE $pntable[stories] SET $column[counter]=$column[counter]+1 WHERE $column[sid]='" . pnVarPrepForStore($sid) . "'");
    }

    I basially encapsulated the SQL update that was already there inside of a little ereg, similar to what I did with includes/pnBanners.php

    Look at me, ain't I neat?

    No. I'm not.

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula