Error --- setting up network

Discussion in 'Co-op Advertising Network' started by mrdjkcool, Apr 12, 2005.

  1. #1
    I am getting this error on www.internationalcandlecorp.us.com

    Warning: main(ad_network_224.php): failed to open stream: No such file or directory in /home/internat/public_html/inc_footer1.php on line 18

    Warning: main(): Failed opening 'ad_network_224.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:../:../../:../../../:../../../../') in /home/internat/public_html/inc_footer1.php on line 18


    Anyone know how i can get this going?
     
    mrdjkcool, Apr 12, 2005 IP
  2. king_cobra

    king_cobra Peon

    Messages:
    373
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    did u put the ad_network_224.php file in the public_html folder?

    If this is done please post the inc_footer1.php file here. I will try to help u.
     
    king_cobra, Apr 12, 2005 IP
  3. mrdjkcool

    mrdjkcool Guest

    Messages:
    105
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes it HAS been added to that area. I basically went in my account to "setup instructions" today and copy and pasted the code.
     
    mrdjkcool, Apr 12, 2005 IP
  4. king_cobra

    king_cobra Peon

    Messages:
    373
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Paste the inc_footer1.php code here.
     
    king_cobra, Apr 12, 2005 IP
  5. mrdjkcool

    mrdjkcool Guest

    Messages:
    105
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Here you go!

    <?php
    // Last update: Apr 5, 2005 11:55 am

    if (!function_exists('file_get_contents')) {
    function file_get_contents($url) {
    $handle = fopen($url, 'r');
    $string = fread($handle, 4096000);
    fclose($handle);
    return $string;
    }
    }

    if (!function_exists('make_seed')) {
    function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
    }
    mt_srand (make_seed());
    }

    if (!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;

    $ad_file = 'ad_network_ads_224.txt';
    for ($i = 0; $i <= 11; $i++) {
    $p = substr ('../../../../../../../../../../', 0, $i * 3);
    if (file_exists ($p . $ad_file)) {
    $ad_file = $p . $ad_file;
    break;
    }
    }

    if (is_writable ($ad_file)) {
    $ad_network = array();
    $ads = file_get_contents ($ad_file);
    $ads = explode ('<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?c=' . $_SERVER['SERVER_NAME'] . '&type=link');
    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) {
    $split = explode ('<id>', $ad);
    $ad_ids[] = $split[1];
    $ad = $split[0];
    $output = $ads_temp[1] == $_SERVER['REMOTE_ADDR'] || $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR'];
    if ($output) {
    $ad_network[$key] = str_replace ('" />', '" class="' . $ads_temp[2] . '" />', $ad);
    } else {
    $ad_network[$key] = str_replace ('" />', '">', $ad);
    }
    }
    $ad_network = implode (' I ', $ad_network);
    if ($ads_temp[6] && ($output || preg_match('#(' . str_replace ('-', '|', $ads_temp[7]) . ')#si', $_SERVER['HTTP_USER_AGENT'])) && !$_SERVER['HTTPS']) $ad_network .= '<img src="http://ads.digitalpoint.com/t-' . implode ('-', $ad_ids) . '.gif" width="1" height="1" />';
    } else {
    $ad_network = 'You must set the ad network .txt file to be writable.';
    }
    if (substr (@$_SERVER['DOCUMENT_NAME'], -6) == '.shtml') {
    ini_set ('zlib.output_compression', 0);
    echo $ad_network;
    }

    ?>
     
    mrdjkcool, Apr 12, 2005 IP
  6. king_cobra

    king_cobra Peon

    Messages:
    373
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #6
    This is the ad_network.php file. post the footer.php file.
     
    king_cobra, Apr 12, 2005 IP
  7. mrdjkcool

    mrdjkcool Guest

    Messages:
    105
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Here it is. Thanks for all your help!


    <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#F6ECD8">
    <tr>
    <td>
    <table cellpadding="0" cellspacing="0" border="0" align="center" bgcolor="#F6ECD8">

    <tr>
    <td height="68" align="center" valign="top" class="bodytext" >
    <h2 align="center"><strong><font size="2">International Candle
    Corporation does not endorse or promote the information
    provided by the author of this article. International Candle
    Corp is a leading International Candle Distributor. </font></strong></h2>

    <p align="center"><a href="http://www.intlcandle.com/" target="_blank">International
    Candle Corporation</a></p>
    <p align="center">&nbsp; <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network_224.php');
    echo $ad_network;
    ?></p></td>
    </tr>

    </table>


    </td>
    </tr>
    </table>
     
    mrdjkcool, Apr 13, 2005 IP