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. stupot

    stupot Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #21
    That's the way it works, i was testing it on a non-full file but it will behave as suggested 900 seconds on a full file. Night night.
     
    stupot, Dec 30, 2004 IP
  2. TheBroker

    TheBroker Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #22
    Thanks Stu, Im going to put this version live tonight and test it out.
     
    TheBroker, Dec 30, 2004 IP
  3. TheBroker

    TheBroker Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #23
    Okay Stu, problem.

    I can call my page that includes your new file. It works fine, it pulls the ads and rotates and starts to fill the cache file.

    I can do this all day long with the file that has the include, and has the simple code which is posted on this forum. (ads(0),ads(1), etc)

    However, when I include the file that includes this new asp file, the server CPU hits 100%. It stays that way for about 30 seconds or so and then drops back down. I'll have to do some research to find out why it does this.

    I have no problem with the previous original asp file.
     
    TheBroker, Dec 30, 2004 IP
  4. stupot

    stupot Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #24
    Aren't these two things the same?

    Please post the code you use to display your ads and i will try and recreate the problem.
     
    stupot, Dec 31, 2004 IP
  5. TheBroker

    TheBroker Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #25
    It works fine if I add the ads=adnetwork, and then pull the ads with ads(0), ads(1) on a standard .asp file.

    But if I put the code on a file that is already included in another main page, it fails and goes 100% cpu.

    Think double include.

    It does this both if I use include virtual, or use the asp 'server.execute' command as well. Before, I could use server.execute and get around this problem.
     
    TheBroker, Dec 31, 2004 IP
  6. stupot

    stupot Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #26
    because the code has

    on error resume next

    in it any error or double function declaration will not stop the processing of the asp code it just moves to the next line, if the next line happens to be in a loop this will explain the 100% processing power of the server. The 30 seconds is more likely to be 20 as this is the default script timeout period. Comment out the on error resume next to find out what the error is. The only purpose of the on error resume next is to stop errors being delivered to the user if the ad server is not contactable.

    Stuart
     
    stupot, Dec 31, 2004 IP
  7. wrkalot

    wrkalot Well-Known Member

    Messages:
    285
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #27
    Any idea why I would get a "Variable ads Undefined" error when showing ads on a subdirectory page? If I "Dim ads" then I get a Typemismatch error. Works fine on pages that are in the root folder.
     
    wrkalot, Dec 31, 2004 IP
  8. mcmagalie

    mcmagalie Gecko

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #28
    My pages have "option explicit" and I had to add this to ad_network.asp :

    dim ad_params, ad_type, ad_file, ad_url, objFSO, objTextStreamR, AllLinks, NewTextLinks, newlink, spParam, LinksDate, ht, i, spLink, NewTextLink, objTextStreamW, attempt, r, j, adss

    and used this to display the ads :
    <% adss=ad_network
    response.write adss(0) & " - " & adss(1) %>

    Hope this works for you
     
    mcmagalie, Dec 31, 2004 IP
  9. wrkalot

    wrkalot Well-Known Member

    Messages:
    285
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #29
    Thanks... I'll give it a shot.
     
    wrkalot, Dec 31, 2004 IP
  10. stupot

    stupot Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #30
    just me being sloppy with my declarations try this one
     
    stupot, Jan 1, 2005 IP
  11. wrkalot

    wrkalot Well-Known Member

    Messages:
    285
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #31
    Works like a charm. Thank you so much for the work you have done!

    I had to dim "ads" at the top of the file, btw

    Happy New Year!
     
    wrkalot, Jan 1, 2005 IP
  12. Zinho

    Zinho Peon

    Messages:
    284
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #32
    I receive this error:

    Subscript out of range: '[number: 0]'

    /ad_network.asp, line 39

    when I tried this code.
    I have replaced the ad_network.asp code with the new one.
    I've tried to keep my old ad_network_ads.txt, to flush it and to delete it but I still receive errors.
    Can anyone gimme an idea of what happens behind the scene?
    I would like to help in the development but as I said I don't have time to do it,
    Thanks in advance.
     
    Zinho, Jan 1, 2005 IP
  13. stupot

    stupot Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #33
    I have looked at line 39 and can't see what situation you would get that error. Try deleting the ad_network_ads.txt file completely.
     
    stupot, Jan 2, 2005 IP
  14. dkalweit

    dkalweit Well-Known Member

    Messages:
    520
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    150
    #34
    FYI, this asp file spits out non-compliant <A HREF="...".... />...</A> HTML(note the "/" in the opening tag). I think Shawn fixed this in the php version, didn't he?


    --
    Derek
     
    dkalweit, Jan 2, 2005 IP
  15. stupot

    stupot Peon

    Messages:
    61
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #35
    It actually receives non compliant html from the ad server, any comments Shawn? I just did the conversion of the php script I found on this site. I can easily remove the / but this may stop the site validating properly.
     
    stupot, Jan 2, 2005 IP
  16. dkalweit

    dkalweit Well-Known Member

    Messages:
    520
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    150
    #36
    Yes, I noticed that(in the txt file). I modified my copy of the script to strip out the "/"'s at the end, and it's been validating so far...


    --
    Derek
     
    dkalweit, Jan 2, 2005 IP
  17. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #37
    You don't want to edit it out...
     
    digitalpoint, Jan 2, 2005 IP
  18. Arnica

    Arnica Peon

    Messages:
    320
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #38
    Stupot

    Your port doesn't quite tally with the php version. In the if... else... statement that inserts the class parameter if digitalpoint is requesting the page the 'else' condition is used to remove the '/' from the html output.

    Mick
     
    Arnica, Jan 2, 2005 IP
  19. mopacfan

    mopacfan Peon

    Messages:
    3,273
    Likes Received:
    164
    Best Answers:
    0
    Trophy Points:
    0
    #39
    I'm not getting the code to work. It does not seem to be getting anything from the ad server. :(

    Edit:

    I have it working on the 2000 server, but it won't work on the nt box because of the server.CreateObject("WinHttp.WinHttpRequest.5.1") line. NT does not support this method and I have not been able to figure out how to install whatever I need to make it work. I can't use server.CreateObject("microsoft.XMLHTTP") because it does not support the timeout property. So I guess my NT site will be out for a while till I can figure out how to overcome this issue. Any body else have any suggestions?
     
    mopacfan, Jan 7, 2005 IP
  20. longcall911

    longcall911 Peon

    Messages:
    1,672
    Likes Received:
    87
    Best Answers:
    0
    Trophy Points:
    0
    #40
    I've done the asp version install, but my test page reports a 'permission denied' error. (http://www.audience-response-rentals.com/forum/test.asp)

    The ad network text file is in my '/files' folder which is the same level as '/web' and '/logs' and is where my dbases are currently located. I read and write to the dbases so technically, that should not be the issue.

    It's a Win2003 hosted account, and XO does not allow access to .htaccess.

    Any hints on troubleshooting this would be appreciated.
     
    longcall911, Jan 8, 2005 IP