1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

AdNetwork ASP Code

Discussion in 'Co-op Advertising Network' started by Cyber-SEO, Dec 28, 2004.

  1. longcall911

    longcall911 Peon

    Messages:
    1,672
    Likes Received:
    87
    Best Answers:
    0
    Trophy Points:
    0
    #61
    Now that my hosting company fixed the directory structure, I tried displaying ads again, but still had just one. So, I used the following code in a test page to be sure I had the correct path, and that the folder was writable.

    Dim fso, MyFile
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set MyFile= fso.CreateTextFile("../files/testfile.txt", True) '************* use your full path and file name here
    MyFile.WriteLine("This is a test.")
    MyFile.Close​

    I then checked the target folder and sure enough a file had been created.

    With the correct path confirmed, I wound up modifying the ads_network.asp file to remove the slash in the server.mappath line. That then worked.

    This is what I changed it to, making the path relative rather than absolute.

    ad_file = Server.MapPath("../files/ad_network_ads.txt")​

    Also, a suggestion for stupot:
    You might want to 'Dim ads'. Reason is that WebWiz ASP forums use <% option explicit %> on each page and the so an undeclared variable error is returned. Thanks for all of your hard work. It's appreciated by many.
     
    longcall911, Jan 15, 2005 IP
  2. Design1

    Design1 Active Member

    Messages:
    388
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    78
    #62
    Alright, after thinking all was well for a few days I just logged in to see all my weight had disappeared. Now all of my sites with this new change are appearing as not showing any ads when validated, however they are clearly showing each ad when you view the site.

    Thanks !
     
    Design1, Jan 17, 2005 IP
  3. wrkalot

    wrkalot Well-Known Member

    Messages:
    285
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #63
    MapPath and I don't get along. I used the full path like this.

    
    'the (writable) path to ad_network_ads.txt
    [b]Const root_path="e:\web\public_html\mydomain\"[/b]
    Const fsoForReading = 1 
    Const fsoForWriting = 2 
    
    ' "link" for text link | "text" for text banner | "" (empty) for graphical banner
    ad_type = "link"
    
    'it must be a path with write privileges
    [b]ad_file = root_path & "ad_network_ads.txt"[/b]
    
    etc.....
    
    Code (markup):
     
    wrkalot, Jan 17, 2005 IP
  4. longcall911

    longcall911 Peon

    Messages:
    1,672
    Likes Received:
    87
    Best Answers:
    0
    Trophy Points:
    0
    #64
    Well after a good amount of time invested, ads display but my site will not validate. Unfortunately, it has been posted in another thread that ASP is not supported. So, no validation help is offered.

    Looks like I'm dead in the water :-(
     
    longcall911, Jan 17, 2005 IP
  5. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #65
    Don't give up just yet. There's still hope. I just need to find someone that can translate the php for me so I can update the asp.
     
    mopacfan, Jan 17, 2005 IP
  6. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #66
    Ok, here's the updated code. It was a very minor change, but without exam's help interpreting the php, I never would have figured it out. The query string had changed that get's sent to the server. The updated code is attached. Be sure to modify the code to replace your url, link type and ads.txt file location.

    Michael
     

    Attached Files:

    mopacfan, Jan 17, 2005 IP
  7. kdobson99

    kdobson99 Guest

    Messages:
    161
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #67
    Is anyone's asp working in the co-op? Everthing was fine yesterday. Ads are showing, but won't validate. I downloaded the new coopads.asp and renamed it as_network.asp and it still won't validate. Any help would be VERY appreciated.
     
    kdobson99, Jan 18, 2005 IP
  8. dkalweit

    dkalweit Well-Known Member

    Messages:
    520
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    150
    #68
    I just got 'invalidated' Email messages. I downloaded the coopads.asp and plunked it into my ad_network.asp file, updated the stuff in it to the appropriate paths, etc., and then deleted my ad_network.txt files, refreshed a few times to fill all 5 links, and now it's validating again. My 'invalid' file was still showing the ads just fine...


    --
    Derek
     
    dkalweit, Jan 18, 2005 IP
  9. kdobson99

    kdobson99 Guest

    Messages:
    161
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #69
    I just refreshed a few more times and it works fine now and validates. THanks
     
    kdobson99, Jan 18, 2005 IP
  10. sue

    sue Peon

    Messages:
    68
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #70
    The asp code doesn't work on my sites now as one of the parameters seems to have changed.. (Why???) All sites have failed to validate... :eek:
     
    sue, Jan 18, 2005 IP
  11. dkalweit

    dkalweit Well-Known Member

    Messages:
    520
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    150
    #71
    Read my post above. Have you tried these steps?


    --
    Derek
     
    dkalweit, Jan 18, 2005 IP
  12. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #72
    Mine was doing the same thing. It turns out that the query string values passed to the server had changed. The code would display the ads because nothing changed to that side of the application. Only after the four lines are updated as in the file I posted yesterday, will an asp site be able to re-validate.
     
    mopacfan, Jan 18, 2005 IP
  13. sue

    sue Peon

    Messages:
    68
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #73
    Yes thanks Derek, in the middle of it now.
    Does anyone know why it was changed?
     
    sue, Jan 18, 2005 IP
  14. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #74
    The official response is that "php is the only supported version" or something to that effect. Se we are all the bastard children of the coop. Such as it is, as long as someone can interpret the php, there are enough of us that can keep the asp up to date.
     
    mopacfan, Jan 18, 2005 IP
  15. stupot

    stupot Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #75
    All I had to do was change the a= to b= in the line which has the digitalpoint url in it. All works fine now. Strange that i didn't get an email about this change, Shawn usually sends one out.
     
    stupot, Jan 18, 2005 IP
  16. dkalweit

    dkalweit Well-Known Member

    Messages:
    520
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    150
    #76
    Far-be-it for the author to interpret or document his own code...

    --
    Derek
     
    dkalweit, Jan 18, 2005 IP
  17. dkalweit

    dkalweit Well-Known Member

    Messages:
    520
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    150
    #77
    He sends an Email if the php version needs updating(f*** the rest, basically). That seems to be working fine right now on my one php site.


    --
    Derek
     
    dkalweit, Jan 18, 2005 IP
  18. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #78
    One went out.
     
    digitalpoint, Jan 18, 2005 IP
  19. stupot

    stupot Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #79
    I got a message on the 7th Jan about the merge, I guess this is the one, my mistake I just didn't realise the impact (b=) it would have on the ASP.
     
    stupot, Jan 18, 2005 IP
  20. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #80
    That's the one. :) I don't know anything about the ASP, PERL ColdFusion or any other version of the ad_network file (other than PHP), but if the ad_network.php needs to be updated, than most certainly the others do as well.
     
    digitalpoint, Jan 18, 2005 IP