Purchase OIOpublisher now for just $47.

Take control of your ad space.

Click here to purchase

    • CommentAuthorthirdstep
    • CommentTimeMar 30th 2011 edited

    Hi Simon. I finally customized OIO by adding a checkbox for customers to explicitly accept an advertising policy / terms and conditions.

    I wanted to share the code in case it's useful to someone else. If you consider it's worth it, it would be great if you could add it as an option to OIO.

    Since this could be used for legal stuff, to everyone that reads this, allow me to say that I offer no guarantees that this works and it's provided as is for helping others code their own solutions.

    Here goes:
    - Customize purchase_banners.tpl template at: OIO plugin -> settings -> themes -> purchase_banners.tpl
    . Add above the HTML captcha code this new code with a checkbox for agreeing with the advertising policy.
    <td><div style="float:left"><input type="checkbox" name="oio_agree" value="on" <?php if ($item->misc['agreement'] == "on") {echo "checked";} ?>></div><div style="float:left; padding-left:5px; margin-top:-1px;">I have read and agree to the Advertising Policy and Terms and Conditions.</div></td>

    - Edit the include/purchase.php file
    . Look for the first occurrence of "function data($type)" - make sure it's the first one, because there's a similar second one further down called "function data($item, $input_data)".
    . Right below the line "$this->item->payment_log = "";", add this code that takes the value of the form's checkbox that comes from purchase_banners.tpl:
    $this->item->misc['agreement'] = oiopub_clean($this->input['oio_agree']);
    . Look for the function "function errors($type)". Below the lines:
    if($type == "insert") {
    //child class data
    $this->item = $this->child_class->errors($this->item);

    if($this->item->misc['agreement'] != "on")
    $this->item->misc['error'] = true;
    $this->item->misc['info'] .= "<li class='error'>" . "You must read and agree to the Advertising Policy and Terms and Conditions in order to proceed."."</li>";

    That's it! Remember to change the text Advertising Policy / Terms and Conditions to the one you're using. Also, when you update OIO remember to incorporate the changes to the include/purchase.php file again. If you update it normally, the purchase_banners.tpl changes should remain.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeMar 30th 2011
    Project Admin

    Thanks for sharing. :)

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorthirdstep
    • CommentTimeMar 31st 2011

    You're very welcome. OIO is excellent software, and so is the support you provide on these forums. I'm glad if I can contribute in any way.

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