Does anyone have the most up to date ASP code for the AdNetwork? I have some code that I used a little while back and got it banned finally today that ban was taken off.
I have one ASP version that may not be the best one, after searching around it looks like there is only one version out there. I'll try to write one and will post it here.
If you plan on making your own version, make SURE it does everything the PHP version does exactly the same. Makes sure you take into account things like file locking of the cache file, checking if it's writable BEFORE contacting the ad server, using the dynamic parameters properly, etc.
Word is, that if the .ASP version doesn't get updated all .ASP sites will fail validation soon. *waiting with fingers crossed*
Is there a post that explains the exact changes to the new php code so someone here good with asp can update the asp version? Id be happy to try if I knew what was changed and what functions require updating.
The old ASP code was not right to begin with, so is someone wants to do it right, it probably needs to be done from scratch.
Okay, is there any reference anywhere here that breaks down the functions of the current php code or do I have to do a crash course in php to mock the current code. Forget it, looks like Stupot has an update, Ill wait for that. Thanks!
ASP isn't my specialty, so I could be wrong, but a few things that might need to be fixed... Initial creation of the first ad should not make 5 requests to the ad server. Needs some sort of file locking mechanism when writing the file out, otherwise you are going to have problems on very high load sites. Cache file should save even if there is no ad (possibly ad server is down), this forces it to wait for the timeout before trying again for a new ad. Shouldn't there be a SaveFile() call after the GetNewLink(ad_url) call? (There is only after the first one.) One thing you want to be sure and check is how it acts if the ad server is not available. Test it by making it ads1.digitalpoint.com for example. Make sure the ad_network_ads.txt file is still written out (basically updating the timestamp) and that the params aren't nullified.
I have addressed all the above except for the file locking, what problems have you had with this? There is a line of code at the top which tells the script to continue if it hits any errors, this should just ignore any locking problems. The SaveFile() call is only used on the initial creation of the txt file.
The file locking will come into play with a very high load site... if it tries to write out the file at the same time by two different processes. Essentially they collide and you end up with an empty ad_network_ads.txt file. Normally it's not an issue because most sites don't get enough traffic to worry about a process overlapping that takes a couple milliseconds, but believe it or not, it was an issue with a couple sites already (originally I had no file locking), so that's why it was added.
Make sure you test it to see what happens to the ad_network_ads.txt file if the ad server is unavailable (change it to a bad address or something). Make sure the timestamp updates and the parameters are not wiped.
Done (min 4 seconds between retries), and it also caters for if someone has an old style or no txt file and the server isn't available it puts in default values NOW|216.9.35.51|abcdefgh|400|900|4. Going for some zzzz's 2 am here, any 'features' that shouldn't be there please reply here and i will fix tomorrow.
It should wait the normal 15 minutes (900 seconds) for another try... at least if the ad_network_ads.txt file already had 400 ads. If it's not full, then the 4 seconds would be right.