the txt file..

Discussion in 'Co-op Advertising Network' started by DomainMagnate, Apr 10, 2006.

  1. #1
    Shawn, just wondering, what is that txt file for?
    I see it stores all the links but why?

    Hope you can take some time to explain if you don't mind thanks :p
     
    DomainMagnate, Apr 10, 2006 IP
    exam likes this.
  2. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's a cache file so you don't have to get the links off digitalpoint.com for each and every pageview on your site.
     
    exam, Apr 10, 2006 IP
  3. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,932
    Likes Received:
    1,022
    Best Answers:
    0
    Trophy Points:
    455
    #3
    how frequently is it changed..?
     
    DomainMagnate, Apr 10, 2006 IP
  4. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The ads server sends you a timeout (I think it might be 30 min. right now, but Shawn can change that dynamically depending on server load) and whenever that time period passes, the code retrieves a new ad from the server, saves it in the cache file and dumps the oldest ad from the file.
     
    exam, Apr 10, 2006 IP
  5. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,932
    Likes Received:
    1,022
    Best Answers:
    0
    Trophy Points:
    455
    #5
    thank exam.
    there're tags like <id>32547<ad_break>
    how would a server know which page is it? They're saved after a visitor clicks on the ad, so does the server store all links and then assigns a number to each one or somehting like that..?
     
    DomainMagnate, Apr 10, 2006 IP
  6. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I'm not totally sure, this is your cue Shawn :)
     
    exam, Apr 10, 2006 IP
  7. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,932
    Likes Received:
    1,022
    Best Answers:
    0
    Trophy Points:
    455
    #7
    something tells me I won't get from Shawn anything more than "I don't know why you keep asking this"
    ;)
     
    DomainMagnate, Apr 10, 2006 IP
  8. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Then I guess you'll need to figure out how it works on your own. {shrug}
     
    exam, Apr 10, 2006 IP
  9. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,932
    Likes Received:
    1,022
    Best Answers:
    0
    Trophy Points:
    455
    #9
    {shrug} I'm trying :)
    but I'm just a human ..
     
    DomainMagnate, Apr 10, 2006 IP
  10. exam

    exam Peon

    Messages:
    2,434
    Likes Received:
    120
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I guess you have to be the master of the universe to understand Shawn's code. :D
     
    exam, Apr 10, 2006 IP
    DomainMagnate likes this.
  11. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #11
    As others have said, the .txt file stores settings (which can be set on the server's end if needed). The "id" tags have nothing to do with what page an ad is displayed on, that's the internal system ID for the ad (for tracking impressions).

    As far as how it knows what ad to display on what page (if you are running static ads), I'm a mother f'ing genius and came up with a way to do it without needing to store a file that cross references every page/ad. This is the "magic" line of code that does it (from ad_network PHP file):
    $ads_next = (hexdec(substr(md5($_SERVER['SERVER_NAME'] . $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'] . $_SERVER['QUERY_STRING']), 0, 6)) % (count($ads) - 1 - $ads_x)) + 1;
    PHP:
     
    digitalpoint, Apr 10, 2006 IP
    exam likes this.
  12. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,932
    Likes Received:
    1,022
    Best Answers:
    0
    Trophy Points:
    455
    #12
    thanks Shawn, nice idea, I thought about hash, but didn't know how to implement it. :)


    PS. Can I take the master of the universe title if it's not in use now? ;)


    ADDED: another little question then Shawn, the txt file probable contains just a part of the database, so is it so and how is it selected? Or does it contain it all? And how frequently is it updated?

    thanks
     
    DomainMagnate, Apr 10, 2006 IP
  13. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #13
    Updated every 30 minutes. It's only a small slice of the database (caches 1000 ads per file/site).
     
    digitalpoint, Apr 10, 2006 IP
  14. DomainMagnate

    DomainMagnate Illustrious Member

    Messages:
    10,932
    Likes Received:
    1,022
    Best Answers:
    0
    Trophy Points:
    455
    #14
    thanks, Shawn, last little question, why should it be on every page of the site.

    As I see it, it may still work if it's not on every page, cause the hash function and the formula doesn't depend on the number of pages, but only on the number of links..? :confused:

    thanks
     
    DomainMagnate, Apr 11, 2006 IP
  15. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #15
    How many pages it's run on has nothing to do with the PHP code.
     
    digitalpoint, Apr 11, 2006 IP