6 identical ads

Discussion in 'Co-op Advertising Network' started by roberto, Feb 16, 2005.

  1. #1
    Hi

    My web site shows 6 ads, but they are always the same ad how can I fix it?

    I have the new ad_network.php file and all my pages load a footer.html file that has the following script:
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');?> <?php echo $ad_network[0];?>
    <div align="center">- <?php echo $ad_network[1];?> - <?php echo $ad_network[2];?>
    - <?php echo $ad_network[3];?> - </div>
    <?php echo $ad_network[4];?>
     
    roberto, Feb 16, 2005 IP
  2. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #2
    First of all, you only get credit for the first 5. In this case the 6th ad is a "free one" for other Coop Members.

    You will slowly get more and more variety of ads as visitors come to the page. You could hit refresh a few times to also achieve this but don't do that too many times (2 or 3 times is enough to be sure you get variety)

    Basically it takes time to pull down all the ads.
     
    yfs1, Feb 16, 2005 IP
  3. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I refreshed my page 3 times and I still have the same 6 ads, as it had being happening since the begining, a couple of days ago
     
    roberto, Feb 16, 2005 IP
  4. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Try clearing your ad_network.txt file
     
    yfs1, Feb 16, 2005 IP
  5. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I don´t know how to do it
     
    roberto, Feb 16, 2005 IP
  6. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Open up wordpad, save a blank file as ad_network_ads.txt and save it over the old one.

    Are your ads validating?
     
    yfs1, Feb 16, 2005 IP
  7. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I´ve created a new blank ad_network_ads.txt file, then I uploaded it to my web site and nothing changed, I still see 6 identical ads

    Yes my site is validating
     
    roberto, Feb 16, 2005 IP
  8. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Did yuo make your site in Dreamweaver? Sounds like they are hardcoded in there.
     
    T0PS3O, Feb 16, 2005 IP
  9. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #9
    What is your URL?
     
    digitalpoint, Feb 16, 2005 IP
  10. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    roberto, Feb 16, 2005 IP
  11. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #11
    Looks like you are not using the default ad_network.php file. Copy/paste it from the setup instructions and make sure you don't make any changes to it.
     
    digitalpoint, Feb 16, 2005 IP
  12. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Something has changed
    Now that I have uploaded again the default ad_network.php file I have only 5 identical ads
     
    roberto, Feb 16, 2005 IP
  13. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #13
    Not really sure to be honest.. your cache only seems to be saving one ad for whatever reason. Are you SURE you have not changed the ad_network.php file at all?
     
    digitalpoint, Feb 16, 2005 IP
  14. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    I´m absolutely shure that the ad_network.php file is the one on the setup page, I haven´t changed it at all
     
    roberto, Feb 17, 2005 IP
  15. T0PS3O

    T0PS3O Feel Good PLC

    Messages:
    13,219
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    0
    #15
    The cache file has different ads but your output script seems to only get 1 at the time and multiplies that.

    Could you paste here your echo code again please?
     
    T0PS3O, Feb 17, 2005 IP
  16. Scott

    Scott Peon

    Messages:
    273
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Looks to me as if there's something wrong with the way you're echoing them. Based off your first post, you should start at "0" not "1" in the array.

    <div align="center"><?=$ad_network[0] . ' - ' . $ad_network[1] . ' - ' . $ad_network[2] . ' - ' . $ad_network[3] . ' - ' . $ad_network[4]; ?></div>
    Code (markup):
     
    Scott, Feb 17, 2005 IP
  17. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    This is my echo code:

    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');?> <?php echo $ad_network[0];?>
    <div align="center">- <?php echo $ad_network[1];?> - <?php echo $ad_network[2];?>
    - <?php echo $ad_network[3];?> - </div>
    <?php echo $ad_network[4];?>
     
    roberto, Feb 18, 2005 IP
  18. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #18
    It's not a problem with that part, it's a problem with the ad_network.php file.
     
    digitalpoint, Feb 18, 2005 IP
  19. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    This is it:

    ad_break>', $ads);
    $ads_temp = explode ('|', $ads[0]);

    $file = fopen($ad_file, 'r+');
    if (flock ($file, LOCK_EX|LOCK_NB, $would_block) && !$would_block) {
    if ((count ($ads) < $ads_temp[3] + 1 && $ads_temp[0] + $ads_temp[5] < time()) || $ads_temp[0] + $ads_temp[4] < time()) {
    $new_ad = file_get_contents ('http://ads.digitalpoint.com/network.php?b=' . $_SERVER['SERVER_NAME']);
    if ($new_ad) {
    $ads_param = explode ('<ad_param>' , $new_ad);
    $new_ad = $ads_param[1];
    unset ($ads_param[1]);
    $ads_temp = explode ('|', $ads_temp[0] . '|' . $ads_temp[1] . '|' . $ads_param[0]);
    } else {
    $ads_param = array_slice ($ads_temp, 2, 4);
    }
    $ads[0] = time() . '|' . gethostbyname('validate.digitalpoint.com') . '|' . implode ('|', $ads_param);
    if ($new_ad) {
    $ads[] = $new_ad;
    if (count ($ads) > $ads_temp[3] + 1) $ads = array_merge ((array)$ads[0], (array)array_slice ($ads, -$ads_temp[3]));
    }
    fwrite ($file, implode ('<ad_break>', $ads));
    ftruncate ($file, ftell($file));
    $ad_network[] = $new_ad;
    }
    flock ($file, LOCK_UN);
    fclose ($file);
    }
    while (count ($ad_network) < 5) {
    $ad_network[] = $ads[mt_rand(1,count($ads) - 1)];
    }
    foreach ($ad_network as $key => $ad) {
    if ($ads_temp[1] == $_SERVER['REMOTE_ADDR'] || $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR']) {
    $ad_network[$key] = str_replace ('" />', '" class="' . $ads_temp[2] . '" />', $ad);
    } else {
    $ad_network[$key] = str_replace ('" />', '">', $ad);
    }
    }
    } else {
    $ad_network[] = 'You must set the "ad_network_ads.txt" file to be writable.';
    }
    if (substr (@$_SERVER['DOCUMENT_NAME'], -6) == '.shtml') {
    ini_set ('zlib.output_compression', 0);
    echo end ($ad_network);
    }

    ?>
     
    roberto, Feb 19, 2005 IP
  20. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #20
    Does the ad_network.php file you are using have this in the code:?

     // Last update: Jan 21, 2005 8:51 am
    PHP:
     
    ResaleBroker, Feb 19, 2005 IP