My site only shows 1 ad

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

  1. #1
    According to the script that I have received, my site should be showing 5 ads, but it´s showing only one

    The following is the script that I´m using:

    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[0].' '.$ad_network[1].' '.$adnetwork[2].' '.$ad_network[3].' '.$ad_network[4];
    ?>

    regards
    Roberto
     
    roberto, Feb 10, 2005 IP
  2. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #2
    You might try this:
     
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo implode (', ', $ad_network);
    ?>
    PHP:
     
    ResaleBroker, Feb 10, 2005 IP
  3. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It still shows only one ad
     
    roberto, Feb 10, 2005 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Are you using an old ad_network.php file?
     
    digitalpoint, Feb 10, 2005 IP
  5. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #5
    Did you modify the ad_network.php file?

    What type of pages are you running; PHP, HTML, etc.?

    What is the URL?
     
    ResaleBroker, Feb 10, 2005 IP
  6. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I was using an old ad_network file.
    I changed for the new one and now I see no ads at all, I only see an error message that says:

    Parse error: parse error, unexpected T_STRING in /home/easyhome/www/www/ad_network.php on line 37


    >
     
    roberto, Feb 10, 2005 IP
  7. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #7
    Make sure you do not edit the ad_network.php file.
     
    digitalpoint, Feb 10, 2005 IP
  8. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    I haven´t edited the file, this is the script that I´m using:

    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 10, 2005 IP
  9. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #9
    You might consider going back and uploading a fresh copy of the ad_network.php to your server. Or if nothing else, comparing the fresh copy against the file you currently have on your server.
     
    ResaleBroker, Feb 10, 2005 IP
  10. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I have already uploaded the fresh copy of the ad_network.php file to my server, and was the one that I told you before.

    As it doesn´t work, I have returned to the old ad_network.php file that at least shows one ad.

    Maybe you can help me with my footel.html file. This file has the following script:
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[0];
    ?>

    is there any way to change it so it calls five time the ad_network.php file?
     
    roberto, Feb 10, 2005 IP
  11. ResaleBroker

    ResaleBroker Active Member

    Messages:
    1,665
    Likes Received:
    50
    Best Answers:
    0
    Trophy Points:
    90
    #11
    That's why only one (1) ad is showing.

    You might try this script or the one in your first post:
     
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo implode (', ', $ad_network);
    ?>
    PHP:
     
    ResaleBroker, Feb 10, 2005 IP