Free Myspace Layouts - TV News - Web Hosting - Wordpress Themes - Advertising

PDA

View Full Version : Cold Fusion version of Coop Ad Network Code


Nitin M
Aug 22nd 2004, 12:55 am
Shawn --- hope this is okay to post... if not, let me know how you would prefer it get out to people that need it.

The code in the attached file should be saved as ad_network.cfm in the root directory of the website. Also create a file name ad_network_ads.txt in the root directory and initialize it with a 0 (the number zero).

Then in your footer, add the following lines:

<cfinclude template="./ad_network.cfm">
<cfoutput>#ad_network#</cfoutput>

Any problems/bugs, post them here. I have it running on one site I just added to the network and seems to be running fine.

dazzlindonna
Aug 22nd 2004, 5:58 am
Thanks so much! Shawn, I've set this up, and it appears that it will work, but my new account needs manual validation, as auto validation doesn't work. Can you do that? Thanks!

digitalpoint
Aug 22nd 2004, 9:15 am
What's the URL you are running it on?

dazzlindonna
Aug 22nd 2004, 9:18 am
www.christmas-corner.com . seems to be working fine, shawn. <big smile>

digitalpoint
Aug 22nd 2004, 9:24 am
Actually, you are already validated... were just talking about your individual ad being approved (which it is now)?

dazzlindonna
Aug 22nd 2004, 9:25 am
Somehow it got validated between the time I asked the question and you answered it. :)

digitalpoint
Aug 22nd 2004, 9:26 am
Wasn't from me, would have had to been from your end. :)

dazzlindonna
Aug 22nd 2004, 9:43 am
I'm getting old and very forgetful. Perhaps I magically did something to make it happen, and don't remember. In any case, it's all working beautifully.

amaze
Jan 8th 2005, 12:12 pm
Any update to this file to accomadate Shawns changes?!

Nitin M
Jan 11th 2005, 12:11 pm
Sorry all... working on it right now... hopefully be posting it in the next couple of hours ...

Stretch
Jan 11th 2005, 3:03 pm
Good news Nitin M. Thanks in advance.

Nitin M
Jan 12th 2005, 1:42 pm
I wouldn't usually post without a bit more testing but I get the feeling a couple of people might be waiting on this ...

I think the code is fairly well documented, so if you need to tweak the appearance of multiple ads, you would do that at around line 83.

Change the filename to ad_network.cfm, of course. I could not get the system working with a blank or non-existent ad_network_ads.txt file, so use the attached starter file.

If all works as it should, you should see all the parameters in the ad_network_ads.txt get changed (the only info in the baseline ad_network_ads.txt file) except the IP address after the first pageview is performed.

I'll try to be on a few times today/tomorrow if anyone has problems installing this...

Stretch
Jan 13th 2005, 2:44 am
Seems to be working great for me Nitin :)

amaze
Jan 14th 2005, 1:29 am
Yeah works fine for me but after a while the "ad_network.php file needs updating" message appears?!

Stretch
Jan 14th 2005, 2:05 am
It doesn't appear to be doing that for me. My ad_network_ads.txt is now 28kb and the update message is not in it. I'll keep checking though.

Nitin M
Jan 14th 2005, 7:19 am
I haven't seen this on my sites. But, I did post the code very early ... before any of my own sites had reached the full cache size.

I'll step through and do some more testing. If you want to email me your ad_network_ads.txt file that would be helpful in figuring out why you're seeing what you're seeing.

nitin[@]ultimaterank.com

<edit - ADDED>

Did you edit the ad_network.cfm file in any way? On the footer of one of the sites in your sig I see the message "Unable to Retrieve" which I am guessing is the error handler I put in. But, in the original file I have posted the message is "Unable to Retrieve Ad", so I am wondering if you made any modifications to the file. In the cfcatch you can simply change the type from "any" to "xx" to see the full error messages if you are working on some tweaks to the code.

</edit>

Thanks!

amaze
Jan 14th 2005, 8:15 am
Werid seems (fingers crossed) to be OK now I think I had a rouge version kicking about!

H-Man
Jan 14th 2005, 1:47 pm
I still can't get the tag to validate. http://www.hobza.com

The adds are at the bottom of the page. Any ideas?

Thanks in advance.

Dave

Stretch
Jan 14th 2005, 4:34 pm
Ads need to be on every page to validate.

H-Man
Jan 17th 2005, 8:18 am
Then how come when I click on some of the ads, there aren't any ads on the page? Isn't the validator just checking the one page?

Stretch
Jan 17th 2005, 11:08 am
No, the validator checks multiple pages from the site at random so you must have the ads on every page - it is a requirement of joining the network.

A site doesn't have to be in the network to have ads pointing at it. A person with an account can create an ad that points at any site they wish so long as it adheres to the ad guidelines: http://www.digitalpoint.com/tools/ad-network/guidelines.html

Nitin M
Jan 17th 2005, 2:36 pm
There does seem to be something going on with my version that causes the "needs updating" message to be returned from DP after a certain amount of time or pageviews .... I'll be looking at this and hopefully posting the solution as well later tonight ...

digitalpoint
Jan 17th 2005, 3:22 pm
Assuming the parameters are being taken into account, it might be as simple as the URL you are requesting to the ad server.

Nitin M
Jan 18th 2005, 6:41 am
Shawn, is there any server side validation performed on the a URL param?
I'm wondering if a difference in the Cold Fusion CGI.SERVER_NAME variable vs. the PHP $_SERVER['SERVER_NAME'] might have something to do with this...

digitalpoint
Jan 18th 2005, 7:03 am
No, I don't think that would matter.

Nitin M
Jan 18th 2005, 9:47 am
Doh! I guess I missed an update notice announcement too ... just stumbled onto this by reading the ASP thread ... it seems the url param was changed from a to b .... I need to look through the rest of the code and make sure no other changes are there but for right now, these files will correct the immediate problem ...

ALSO --- ANOTHER CHANGE I MADE ...

The files should now be named ad_network.cfm and ad_network_ads.cfm (not ad_network_ads.txt). I really didn't like the idea of someone being able to download the ad_network_ads.txt file and see all coop participants. Hopefully a similar change is made to all running versions as a measure of protection (even if it is overly paranoid).