How to synchronize two ads ?

Discussion in 'PHP' started by jinch, Sep 28, 2012.

  1. #1
    Hello, I want to display randomly several sets of two banners (a skycraper and a leaderboard) on my website.
    But I would like to have them synchronised.

    Example: If the leaderboard A is displayed, the skycraper A will be displayed too.

    Anyone got any idea on how to do this ?

    Thanks you for your help.
    Best regards,
     
    jinch, Sep 28, 2012 IP
  2. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #2
    At which level? If you use server side script then isn't it easy?
     
    JamesColin, Sep 28, 2012 IP
  3. jinch

    jinch Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    Thanks for your answer!
    What do you mean by server side script ?
     
    jinch, Sep 28, 2012 IP
  4. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #4
    php for instance, if you prepare your page with php before sending it to the visitor, then you can plan to synchrinize the ads being displayed.

    Now if you display your ads via javascript, so client side, then it must be possible also with shared/global variables, but honestly I never coded in javascript, only took scripts and modify them a little, but for sure it is possible.
     
    JamesColin, Sep 29, 2012 IP
  5. jinch

    jinch Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    My page is in php, do you have any lead for a script who could allow me to do that ?
     
    jinch, Sep 29, 2012 IP
  6. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #6
    Not a script, I don't. But it's easy, no?
    If you plan on displaying one leaderboard A then display the related skycraper A
    For instance you can put them in an array..
    $myads = Array(
    Array("leaderboard A","skycraper A"),
    Array("leaderboard B","skycraper B"),
    Array("leaderboard C","skycraper C"),
    );

    then you can do
    shuffle($myads);
    to randomize the ads.

    And then when you display you use:
    $myads[0][0] for leaderboard
    $myads[0][1] for skycraper
     
    JamesColin, Sep 29, 2012 IP
  7. jinch

    jinch Greenhorn

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #7
    Sorry I don't know much about php. I understand what you're saying but I don't know if I could code it. Thanks a lot for having taking some some of your time to help me ;)
     
    jinch, Sep 29, 2012 IP
  8. JamesColin

    JamesColin Prominent Member

    Messages:
    7,874
    Likes Received:
    164
    Best Answers:
    1
    Trophy Points:
    395
    Digital Goods:
    1
    #8
    You're welcome, if you invest a few hours learning the bases of php with tutorials online, you'll find that it is very useful to customize some little things on any site, like wordpress or drupal cms.
     
    JamesColin, Sep 29, 2012 IP