Purchase OIOpublisher now for just $47.

Take control of your ad space.

Click here to purchase

    • CommentAuthoraddamroy
    • CommentTimeJan 2nd 2013 edited
     

    Where would I edit the actual output of the text ads?

    I built a little container (with a background image via css) to put the ads in via a div.

    I need a way to automatically have my div tags around the output when it displays.

    For example I need the output to be,

    <div class="outeradvertisingcontainer">
    <div class="inneradvertisingcontainer">
    OIO TEXT AD HERE
    </div>
    </div>

    Where would I add those two div tags in the files to wrap the output with it? Doesn't matter if it's banner ads or text ads as the ads will still be in the same container.

    Besides that, might be a good feature addition to be able to insert custom code in the OIO interface to load above and below ads for each ad zone when they're displayed

    (I'm using the standalone installation and the javascript option to display ads, if that matters)

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 2nd 2013 edited
     
    Project Admin

    I think the easiest way to do it for all zones automatically, is via OIO's "include/output.php" file:

    FIND

    //cache buster
    $output = str_replace(array("[timestamp]", "[cachebuster]"), md5(uniqid(mt_rand(), true)), $output);

    ADD BELOW

    if($output) {
    $before = ''; //add before html code here
    $after = ''; //add after html code here
    $output = $before . $output . $after;
    }

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 2nd 2013 edited
     

    Thanks Simon.

    How could I to do it separately for text ads, and one for banner ads?

    I would also love to know how to do it per ad zone too if you don't mind.

    I'm trying to offer advertising on my site but want all the ads to be inside my custom frame (the divs).

    I should have mentioned that in my original post because the divs are different for each ad zone size so I actually do need to know the above lol :/

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 3rd 2013
     

    I just tried the code you provided so I can work with just one ad zone for now and it doesn't work.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 3rd 2013 edited
     
    Project Admin

    I can't see any reason why that php code wouldn't work - what's the actual code you've put in? (including the before and after html)

    P.S. if you want different div containers for different zones, wouldn't it be easiest to place the html around the ad zone code manually?

    <div class="outeradvertisingcontainer">
    <div class="inneradvertisingcontainer">
    <script type="text/javascript" src="/url/to/oio/js.php?type=link&zone=1"></script>
    </div>
    </div>

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 3rd 2013
     

    Sorry, it did work actually. I had other ad zones on the same page while I was testing and it through me off a little bit because it did some weird stuff as a result :)

    A per ad zone, conditional I could put in a file somewhere to wrap my divs around them would be great.

    Right now I'm running just one ad zone because the CSS classes for those divs are built for that specific ad zone size.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 3rd 2013
     
    Project Admin

    No problem, thanks for confirming.

    I might just be mis-understanding the purpose, but I'm not really convinced that per ad zone container html needs to be handled by OIO. When you place the ad code on the site, you can just add the container code there as well.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 3rd 2013 edited
     

    Essentially the divs are just some formatting and a 'background image' that's just slightly bigger than the ad zone. So the ad itself is essentially overlayed on top of an image.

    If I just put the ad code inside the divs on my site, the divs will still be there even if there are no ads in rotation. I have empty=0 on my js.

    If I put the divs in the ad code output itself, the background image 'frame' i created with the divs via css, will only be there when there are ads, and won't be when there are none.

    And since a 728x90 ad zone, and a 250x250 ad zone for example, each need a separate css class and background image to display their ads in, I need to use different divs for each ad one (unless they're the same size).

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 3rd 2013 edited
     
    Project Admin

    Ah ok, I understand. I've made a small change to allow custom html before / after a zone. File updates required to use this functionality:

    * /js.php
    * /js_http.php
    * /include/output.php

    Example usage (with OIO's javascript code):

    <?php
    $before = urlencode('<div class="hello">');
    $after = urlencode('</div>');
    ?>
    <script type="text/javascript" src="/url/to/oio/js.php?type=banner&zone=1&markup_before=<?php echo $before; ?>&markup_after=<?php echo $after; ?>"></script>

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 3rd 2013 edited
     

    Hmm That's mixing php and javascript in the same string though idk if i can do that without modifying the site files themselves too. I uploaded the new files anyway.

    Unless I can add those before and after variables in the output file for each ad zone somehow instead of adding the php to the code we have to add to the site?

    Maybe I'm not understanding how that works.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 3rd 2013 edited
     
    Project Admin

    You don't strictly need to urlencode the html using php - you can just add the raw html straight into the url.

    e.g. markup_before=<div class='hello'>&markup_after=</div>

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 3rd 2013 edited
     

    Oh sweet!

    That does exactly what I need it to.

    Best damn product/support ever.

    Maybe future versions of oio can have new input fields in the admin area for custom HTML before/after the output for each adzone. Just a thought.

    Awesome, thanks!

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 4th 2013
     
    Project Admin

    No problem, glad it worked.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 16th 2013
     

    Simon this has a little bit of a problem because of the inability to use double quotes " in the HTML before and after the output.

    I have an HTML link in there, <a href </a> etc etc, however I have to use ' single quotes, like <a href='link here' instead of "link here"

    Some people are reporting the link being incorrect and leading to http://www.mydomain.com/'http://www.mydomain.com/advertising

    Notice the appended single quote. I think it's a browser issue I doubt everyone is having the problem since it works fine for me, but it would be nice to get this to the point where using double quotes in the before/after HTML won't break the script.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 16th 2013 edited
     
    Project Admin

    You should be able to use double-quotes in the url, but the best option is to use the urlencode option (php code a few posts up) to do that (as the javascript code itself already uses double-quotes).

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 16th 2013
     

    I just sent in a support ticket with all the details, literally just before I got the new reply email.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 16th 2013
     

    And unfortunately I cannot use PHP here :(

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 16th 2013 edited
     
    Project Admin

    Here are the other options I can think of, if you can't use php:

    1.) Flip the quotes around - use single quotes for the javascript code 'src' attribute and double quotes in the "markup" sections.

    2.) URLencode the html elsewhere and then manually copy & paste it into the "markup" sections.

    3.) Place the html code around OIO's javascript tag manually, rather than injecting it using the "markup" sections.

    P.S. I did try #1 with the sample code you emailed, using chrome, and it seemed to work ok.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoraddamroy
    • CommentTimeJan 16th 2013
     

    #1 also worked fine in Chrome for me, however Internet Explorer still has the same issue.

    So now firefox and chrome are good its just ie lol

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeJan 16th 2013
     
    Project Admin

    Hmmm see if option #2 works any better with IE. Here's an online urlencoder.

    You'll need to encode the html for markup_before and markup_after separately (don't include the &markup_before= though).

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