Purchase OIOpublisher now for just $47.

Take control of your ad space.

Click here to purchase

  1.  

    Hello OIO folks.

    I am looking to do something that is potentially not available in the current version of OIO Publisher and am looking for possibly some direction on how to achieve this.

    As of now I have some code that uses pushState to update the url and triggers Google Analytics to count that update as a page view. Since I am figuratively changing pages using ajax, this all makes sense, but I am not technically triggering a page refresh of any type. So I am looking to send a trigger to OIO that initiates the ad refresh WITHOUT having to load the page.

    Since the OIO publisher zone codes are available as JS, and the JS allows you to trigger an ad change on a timer, I would imagine triggering the ad change on a CLICK would be totally possible.

    I am asking here because I would like some input from OIO devs on where to look for relevant functions and would also like to know if there are any concerns that could stop this project in it's tracks. It would also be good to know if this functionality is going to be available in the near future as part of the core.

    I am totally interested on making my patch (if I get to that point) available to the public as well so anyone interested in jumping on board, i would welcome you.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeMay 31st 2015
     
    Project Admin

    If you want to refresh a zone onclick, rather than via the timer, I think the code you'd be interested in would be the following section of OIO's "/js.php" file:

    if(data.query && data.refresh > 0) {
    var obj = this;
    setTimeout(function() {
    fragment.id = data.id;
    <?php if($refresh_hide) { ?>
    fragment.style.visibility = "hidden";
    <?php } ?>
    data.query += "&refreshed=1";
    obj.insert_script(data.query.split(','));
    }, (data.refresh * 1000));
    }

    You could replace the setTimeout call with an onclick event listener.

    Need help?  Quick start guide | Troubleshooting | All help topics
  2.  

    Thanks for sending me in the right direction. I will get on it right away.

    Any thoughts as to how to extend this code WITHOUT having to later a core file? Can I maybe grab the trigger and run some JS outside of the OIOPub. files first?

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJun 7th 2015
     
    Project Admin

    Probably not without re-factoring the current code or copying a lot of it to an external file to accommodate that scenario.

    Need help?  Quick start guide | Troubleshooting | All help topics