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];?>
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.
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
Open up wordpad, save a blank file as ad_network_ads.txt and save it over the old one. Are your ads validating?
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
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.
Something has changed Now that I have uploaded again the default ad_network.php file I have only 5 identical ads
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?
I´m absolutely shure that the ad_network.php file is the one on the setup page, I haven´t changed it at all
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?
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):
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];?>
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); } ?>
Does the ad_network.php file you are using have this in the code:? // Last update: Jan 21, 2005 8:51 am PHP: