Purchase OIOpublisher now for just $47.

Take control of your ad space.

Click here to purchase

    • CommentAuthorCasteloes
    • CommentTimeSep 17th 2008
     

    In my blog i have two images zones. One zone to 125x125 banners and the other to 468x60 banners and if i choose to display available slots it display that i have 7 images slots available. It's possible to separate this and put something like that:
    6 125x125 slots available
    1 468x60 slot available.

    Thanks

    • CommentAuthorSimon
    • CommentTimeSep 17th 2008 edited
     
    Project Admin

    Custom function should do the trick. Copy and paste it into include/output.php and then call it where you want it in your theme (untested at this point):

    function oiopub_open_slots_bz($title='') {
    global $wpdb, $oiopub_set, $oiopub_misc;
    if($oiopub_set->enabled == 1 && $oiopub_set->banners_total > 0) {
    $output = ""; $res = ""; $total = array();
    $items = $wpdb->get_results("SELECT item_type FROM ".$oiopub_misc->dbtable_purchases." WHERE item_status<'2' AND item_channel='5'");
    if(!empty($items)) {
    foreach($items as $i) {
    $total[$i->item_type] -= 1;
    }
    }
    for($z=1; $z <= $oiopub_set->banners_zones; $z++) {
    $bz = "banner" . $z;
    $free = ($oiopub_set->$bz->cols * $oiopub_set->$bz->rows * $oiopub_set->$bz->rotator) + $oiopub_set->$bz->queue + intval($total[$z]);
    $output .= "<li><a rel='nofollow' href='".$oiopub_misc->plugin_url."/purchase.php?do=banner&zone=" . $z . "'>" . $free . "</a> " . $oiopub_set->$bz->title . " slots available</li>\n";
    }
    if(!empty($output)) {
    echo $title;
    echo "<ul class=\"oio-openslots\">\n";
    echo $output;
    echo "</ul>\n";
    }
    }
    }

    eg. <?php oiopub_open_slots_bz(); ?>

    • CommentAuthorCasteloes
    • CommentTimeSep 18th 2008
     

    So i copy the code to output.php and then to call it where i want in theme use "<?php oiopub_open_slots_bz(); ?>" is this?

    • CommentAuthorSimon
    • CommentTimeSep 18th 2008
     
    Project Admin

    Correct.

    • CommentAuthorCasteloes
    • CommentTimeSep 19th 2008
     

    It's works well thanks.