A number of sites running the network ads were working well. Then I installed the newer version of ad_network.php, to try to get XHTML Validation. Now, though all my sites continue to display the ads as always, the network validator is saying that I am not running any ads. I look at the exact pages the validator says have no ads, and there they are, big as life, same as ever. My setup is this: I have a main directory, which is also the home directory of one site (which does not yet run the co-op ads); off that directory are numerous others which are each the root directory of some site I run, and there are in turn subdirectories off all those "root" directories. In the main directory, I have a copy of ad_network.php and of the ad_network_ads.txt file; each shtml file in the sites that are part of the network has a line like this in it where the ads go: <!--#include virtual="/SSI/coopads.php" -->In a subdirectory of that site's "root" directory (the quotation marks because it is the root of that site, but is a subdirectory of my files on that server) named SSI is, of course, a file named coopads.php, and it looks like this: <?php $crlf=chr(13).chr(10); $ad_file='ad_network.php'; // (include is relative to CALLING script's directory!) for ($i=0;$i<=11;$i++) { $phead=substr('../../../../../../../../../../',0,$i*3); if (file_exists ($phead.$ad_file)) { $ad_file=$phead.$ad_file; break; } } include ($ad_file); echo $crlf; echo ' <font size="1" color="#999999">Here are links to some other sites you might find interesting or useful:'.$crlf; echo ' <br />'.$crlf; echo ' <strong>'.$ad_network[0].' | '.$crlf. ' '.$ad_network[1].' | '.$crlf. ' '.$ad_network[2].' | '.$crlf. ' '.$ad_network[3].' | '.$crlf. ' '.$ad_network[4].'</strong>'.$crlf; echo ' <br />'.$crlf; echo ' (These are sponsored links to sites unrelated to this site, and we do not necessarily endorse or recommend any of them.)</font>'.$crlf; ?> PHP: What my PHP (4.3.8) returns as available variables can be seen by loading http://owlcroft.com/phpinfo.php. The full ad_network.php script I am using in my main directory is this: <?php 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); } srand (make_seed()); } if (!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS; $ad_file = 'ad_network_ads.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)) { $ads = file_get_contents ($ad_file); $ads = explode ('<ad_break>', $ads); $ads_temp = explode ('|', $ads[0]); 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?a=' . $_SERVER['SERVER_NAME'] . '&type=link'); if ($new_ad) { $ads_param = explode ('<ad_param>' , $new_ad); $new_ad = $ads_param[1]; $ads_temp = explode ('|', $ads_temp[0] . '|' . $ads_temp[1] . '|' . $ads_param[0]); } else { $ads_param = array_slice ($ads_temp, 2); } $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_slice ($ads, 0, $ads_temp[3] + 1); } $file = fopen($ad_file, 'r+'); if (flock ($file, LOCK_EX)) { fwrite ($file, implode ('<ad_break>', $ads)); ftruncate ($file, ftell($file)); flock ($file, LOCK_UN); } fclose ($file); $ad = $new_ad; } else { $ad = $ads[rand(1,count($ads) - 1)]; } $ad_network[] = $ad; while (count ($ad_network) < 5) { $ad_network[] = $ads[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); } ?> PHP: So what do I do?
At the end of your ad_network.php try adding this as a test: echo $_SERVER['REMOTE_ADDR']; PHP: To make sure your virtual SSI include is picking up the right IP address. It should be the IP address of the user looking at the page. I tested it on my end and it works, but maybe something weird happening there somehow.
I put this in the PHP: echo '<p align="center"><font size="1">Remote: '. $_SERVER['REMOTE_ADDR'].' and Local: '.$_SERVER['SERVER_ADDR']. '</font></p>'.$crlf; PHP: and it gave me this: Remote: 205.246.30.106 and Local: 216.92.102.94and my software told me that my local IP address at the time was: 205.246.30.106, which seems to be just what it should. I can say that the site still absolutely refusing to validate has a front page that can, and often does, take several seconds to fully load, owing to its reliance on several remote data sources eventually included into it. I don't know if that matters. It's very frustrating to have the ads plainly visible on one browser tab, while on another the Network validator is saying that they aren't there.
The one that had been the stickiest problem was http://seo-toys.com, but that has finally validated. But I had another love letter from the network awaiting me this morning, for another page on another site, and it, too, had a valid ad. I re-validated and it worked ok. So this is happening on an irregular but *sometimes* repetitive basis, which, I am well aware, makes diagnosis difficult or impossible. All I can say is that every page of every site calls the ads with one of two very similar "framing" (appearance-setting_ scripts, and both of those call the very same (not same code, same actual file) script, exactly as it was taken from the co-op net site. (I also just noticed a page that had, instead of 5 ads, 4 ads and a statement that the net-text file needs updating.) Most curious.
Now., on another site, which is on a separate server and was using the older ad_network.php file, I was getting messages in the ads that the ad_networks.php file needed updating. So I went and got the latest version, but the messages have not gone away. (site = omniknow.com)
I'm having this same problem, and nothing seems to work. My file is cgi, so I used the wraparound script. It shows the ads, but I can't get validated. When I try to call the ad_network.php file, the page just doesn't load. This really bums me out, as I just got a weight of over 60,000, now I can't even get validated. The site is http://www.clickhereforit.com , I have tried every solution on this board, and nothing seems to work. Is there anything else I can do? I've had this problem ever since the update. I've updated the ad_network.php file, flushed my txt file, and still get nothing. I have no problems running this script on http://www.shareourrevenue.com . I've talked to the guy who runs my host, and he says he'll move my site over to the other server, but it seems a little much to have to go through that much effort. Shawn, you said on another post, that the validation problem was on my server's end, can you give me an error message I can pass on to them? Maybe they can straighten it out. I know one of you wiz's have an answer, give it to me!
So this morning I sit down and find five network-dropped emails. In each case, the page "without ads" was the very front page of the affected site. In each case, the ads are on that--and every--page of the site, big as life. The sites today are: adamscountywa.com the-vegetable-site.com theinductionsite.com greatsfandf.com seo-toys.comI logged in and tried to get the first-listed of those to validate, and after two tries gave up. I am using, so far as I know, the very latest ad_network.php file, verbatim. I usually use a version that is slightly rearranged in appearance, to suit my personal preference for PHP-script layout, and commented, but this is the original, just as given. What do I do now??
OK, that was embarrassing, but I could swear I downloaded that file only a couple of days ago. But I took it again, and it was indeed different from what I had, and has (apparently) solved that problem. Next: I have seven sites tied to a Master eighth. The sum of the weight of the seven is 353,311 (as of a few minutes ago), but when I look at the Master page, I see for weight: Base: 67,500 Consolidation: 44,064 Aside from the point that the Base weight looks low--lower than it has been recently--why does the Consolidation not reflect the sum of the accounts tied to that Master? The amount it does show is that of one particular one of the seven. Sorry to be a nuisance, but it perplexes me. (As does the fact that a site's weight can change dramatically within a few seconds.)