Purchase OIOpublisher now for just $47.

Take control of your ad space.

Click here to purchase

    • CommentAuthorthirdstep
    • CommentTimeNov 9th 2010
     

    Hi! First of all congrats on the great software.

    Question:
    1. In the purchase.php page when choosing banner ads, the "Banner Ad Pricing" chart shows the number of available slots, but makes no difference between immediately available ones (that will go live when purchase is approved) and queue slots.

    Any way I can implement this?

    2. Also, it would be great when choosing the banner ad zone and getting the zone page with the form for uploading and paying, that it would be mentioned if the ad will go live when approved or if it'll be entered into the queue.

    Any way of implementing this too?

    No problem coding it myself, but I need a bit of help. I took a look at purchase_banners.tpl and couldn't find the definition of $oiopub_purchase->chart in any other part of the php files.

    Thanks!

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeNov 10th 2010 edited
     
    Project Admin

    The actual chart itself you can find in the file "include/purchase.php" - it's a bit messy in there (each ad type has its own "chart" method), but everything is rendered from there.

    The one you'd want will be at the bottom, the "oiopub_purchase_banners" class.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorthirdstep
    • CommentTimeNov 13th 2010
     

    Found it. Thanks for the quick reply. I'll add some code and will post my changes here. Hopefully they'll be useful to others too.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorthirdstep
    • CommentTimeNov 20th 2010 edited
     

    Alright. I've modified the code of the banner chart, trying to show more clearly the difference between slots currently available and the queue slots for customers.

    I've fortunately found all needed functions already available in the include/functions.php file (the code was crystal clear too). So I just modified the include/purchase.php one.

    Below goes the modified banner chart code in case it helps somebody else. Simon, if you like the results, pls feel free to incorporate them.

    (I didn't use the code tags to display it below 'cause it displays it wrong for some reason, but the code indentations & tabs remain in the msg.)

    ---
    ... replaced by code below

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorthirdstep
    • CommentTimeJan 6th 2011
     

    Hi Simon. Since I read around you're working on version 2.5 I thought I'd post my latest version of the purchase banner chart here in case you found any part of it useful to incorporate into the latest version.

    I'm attaching an image and below goes the code. The only variable I hard coded in there is the # of impressions.

    Thanks again for all the great work on this plugin.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorthirdstep
    • CommentTimeJan 6th 2011 edited
     

    function chart($color1, $color2) {
    global $oiopub_set, $oiopub_db;
    $background = $color1;
    $display = "<tr><td width='200'><b>" . __oio("Zone") . "</b></td><td width='160'><b>" . __oio("# Available") . "</b></td><td width='100'><b>" . "Estimated Impressions". "</b></td><td><b>" . __oio("Pricing") . "</b></td></tr>\n";
    for($z=1; $z <= $oiopub_set->banners_zones; $z++) {
    $bz = "banners_" . $z;
    if($oiopub_set->{$bz}['enabled'] == 1) {
    if($oiopub_set->{$bz}['price'][0] > 0 || !empty($oiopub_set->{$bz}['link_exchange'])) {
    $pricing = array();
    $price_count = count($oiopub_set->{$bz}['price']);
    for($p=0; $p < $price_count; $p++) {
    if($oiopub_set->{$bz}['price'][$p] > 0 || !empty($oiopub_set->{$bz}['link_exchange'])) {
    $amount = empty($oiopub_set->{$bz}['price'][$p]) ? __oio("Banner Exchange") : ($oiopub_set->{$bz}['price'][$p] . " " . $oiopub_set->general_set['currency']);
    $pricing[] = $amount . ($oiopub_set->{$bz}['duration'][$p] == 0 ? "" : " <i>for " . $oiopub_set->{$bz}['duration'][$p] . " " . __oio("days") . "</i>");
    }
    }
    $class =
    $display .= "<tr style='background:$background;'>";
    $display .= "<td style='vertical-align:top'>";

    $display .="<a href='purchase.php?do=banner&zone=" . $z . "'>" . $oiopub_set->{$bz}['title'] . "</a>";

    $display .="<br /><i>" . $oiopub_set->{$bz}['width'] . "x" . $oiopub_set->{$bz}['height'] . " " . __oio("size") . "</i>";

    // Does the ad rotate?
    $rotates = $oiopub_set->{$bz}['rotator'];
    if ($rotates > 1 )
    {
    $display .="<br /><br /><span style='letter-spacing:-0.5px;'>* This zone rotates <span style=''>" . $rotates . " ads *</span></span>";
    }
    $display .= "</td>";
    $display .= "<td style='vertical-align:top'>";

    // calculate numbers
    $available_now = oiopub_spots_available(5, $z, false);
    $available_queue = $available_now + $oiopub_set->queue[5][$z];

    // slots available now?
    if ($available_now > 0)
    {
    $display .= $available_now . " of " . $oiopub_set->spots[5][$z] . " " . __oio("slot(s)");
    }
    else
    {
    $display .="<strong>Sold out!</strong><br />";

    // current slots full - check the queue
    if ( $available_queue > 0)
    {
    $display .= "Queue slot available. This ad will be queued</a><br /><br />";
    $est = oiopub_queue_estimate(5, $z);
    $display .="<i>Estimated activation date:<br>" . $est['date'] . "</i>";
    }
    else
    {
    if ($available_queue < 1)
    {
    $display .= "Queue is full.<br />";
    }
    $display .="<br /><i>Please check again in a few days.</i>";
    }
    }

    $display .= "</td>";
    $impressions = 111111;
    if ($rotates > 0 )
    {$impressions = $impressions/$rotates;}
    $display .= "<td style='vertical-align:top'>" . $impressions . "</td>";

    $display .= "<td style='vertical-align:top'>" . @implode("<br />", $pricing) . "</td>";
    $display .= "</tr>\n";
    if($background == $color1) {
    $background = $color2;
    } else {
    $background = $color1;
    }
    }
    }
    }
    return $display;
    }

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthoroxenjo30
    • CommentTimeMar 28th 2011
     

    mind if where this code should be place on the files? in what line? I would like to incorporate this as well.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorthirdstep
    • CommentTimeMar 30th 2011 edited
     

    Hi oxenjo30, glad to see the code is useful to you. Just look for the very last function on the "include/purchase.php" file of your OIO installation. It's at the bottom, around line 1036, look for the text: "function chart($color1, $color2) {". That's the one you have to replace.

    Remember to change the "$impressions = 111111;" to the number of page impressions of your site.

    Also, whenever you update to a new OIO version you'll have to make this change to the "include/purchase.php" file again.

    Actually, if more people find this one useful we may convince Simon to incorporate it. Right, Simon? :D

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorfanaticweb
    • CommentTimeJul 8th 2011 edited
     

    Hey Thirdstep, great hack, hopefully Simon will include it, although 2 concerns:

    How do you go by providing those estimated impressions? Are they actually based on real traffic data or did you just randomly improvise it yourself?

    This hack works great on the first landing page of the ad purchase, but if I go through the Drop down menu purchase (top of the page) and click on Continue with Purchase, I get the original layout, any chance to locate that file?

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorfanaticweb
    • CommentTimeAug 23rd 2011 edited
     

    Simon, if this can be approved on the next releases, it would be a great contribution, layout and clarification wise to the end users, making it extra dummy proof.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorjohnh44
    • CommentTimeAug 24th 2011
     

    Splendid work! This feature is a wonderful addition to Simon's great code. I, too, request that it be mainlined.

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

    Hi fanaticweb2 and johnh44. Thanks for the good words, I'm glad you find the code useful. Sorry if I haven't replied earlier, I was out of the loop for a while.

    @fanaticweb2: The estimated impressions are modified by entering your number in the "$impressions = 111111;" variable. You can use any stats method and enter that number yourself, but I'm sure it'd be quite easy to link it automatically to OIO's stats system.

    Regarding your other question, if you're using the drop down menu at the top of the page, I take it you're choosing something other than banners. If that is the case, the above code is only for the chart related to banners, you have to locate the corresponding chart for the other ad choices you are offering. I'd suggest you look for functions in the php files called "chart". Simon will be able to give a much better answer than me in this case. :)

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthornyunyu
    • CommentTimeAug 31st 2011
     

    Hi thirdstep, I was actually looking to do this myself.
    Can you tell me what is your purchase page so that I can take a look on it myself just as a demo?

    I'm still lost on where to edit to add available slots in the purchase page. Perhaps you could post the code with commenting?

    Thanks.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorthirdstep
    • CommentTimeSep 1st 2011 edited
     

    Hi nyunyu.

    > Can you tell me what is your purchase page so that I can take a look on it myself just as a demo?

    I'd prefer to keep my purchase page private. :)

    > I'm still lost on where to edit to add available slots in the purchase page. Perhaps you could post the code with commenting?

    All the info is in the posts above. "Look for the very last function on the "include/purchase.php" file of your OIO installation. It's at the bottom, around line 1036, look for the text: "function chart($color1, $color2) {". That's the one you have to replace."

    If you need to know where's the exact location to replace the available slots, you'd have to replace:
    $display .= "<td>" . oiopub_spots_available(5, $z) . " " . __oio("slot(s)") . "</td>";
    with:
    $display .= "<td>";

    // calculate numbers
    $available_now = oiopub_spots_available(5, $z, false);
    $available_queue = $available_now + $oiopub_set->queue[5][$z];

    // slots available now?
    if ($available_now > 0)
    {
    $display .= $available_now . " of " . $oiopub_set->spots[5][$z] . " " . __oio("slot(s)");
    }
    else
    {
    $display .="<strong>Sold out!</strong><br />";

    // current slots full - check the queue
    if ( $available_queue > 0)
    {
    $display .= "Queue slot available. This ad will be queued</a><br /><br />";
    $est = oiopub_queue_estimate(5, $z);
    $display .="<i>Estimated activation date:<br>" . $est['date'] . "</i>";
    }
    else
    {
    if ($available_queue < 1)
    {
    $display .= "Queue is full.<br />";
    }
    $display .="<br /><i>Please check again in a few days.</i>";
    }
    }
    $display .= "</td>";

    If this is not enough for you to be able to modify it, you'll probably need assistance from someone who codes php regularly. I'd recommend you to look for such help, or ask Simon to include these on the base OIO installation. :)

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorfanaticweb
    • CommentTimeSep 14th 2011
     

    I ended up removing the drop down menu since it was a duplicate presentation on the page (Drop down menu + detailed ad slots), now its less misleading and straight to the point, again, great tweak, thank you thirdstep.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorthirdstep
    • CommentTimeSep 15th 2011
     

    @fanaticweb2: Glad to hear you could customize it the way you want. You're very welcome.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorChadTheDJ
    • CommentTimeSep 15th 2011
     

    yeah I love your tweaks as well. I do will like this feature but I am to afraid to modify anything as I don't know this system. I would really like that estimated impressions showing the last 30 days always per zone. That will be a huge selling point on trying to sell the ads as there is nothing up front to show that.

    Simon, is this something you will do in the future or should I start learning how to modify your system?

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorSimon
    • CommentTimeSep 15th 2011 edited
     
    Project Admin

    @thirdstep - any chance you could attach the updated "include/purchase.php" file you're using for this particular change? I'll slot it into the official release.

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorfanaticweb
    • CommentTimeSep 18th 2011 edited
     

    I finally managed to stretch the table to 850 instead of 550 (had to replace all the 550 in the purchase_start.tpl file) NOW its beginning to breath a bit.

    I just noticed one thing: When the slot is full and a queue is available, we see the following under the #Available column:

    Sold out!
    Queue slot available. This ad will be queued in the waiting list.
    Estimated activation date:

    There's nothing displayed for the estimated activation date, I presume this is due to the fact that the ads that were purchased in this slot were set Subscription = yes and "0" days?

    Need help?  Quick start guide | Troubleshooting | All help topics
    • CommentAuthorthirdstep
    • CommentTimeSep 28th 2011
     

    @Simon: Great to hear that you're planning to incorporate this! A pleasure to contribute and it's an honor, too. :)

    > any chance you could attach the updated "include/purchase.php" file you're
    > using for this particular change?

    I have no problem at all. But you're better off using the version above and inserting it into your current "include/purchase.php". The one I'm using now is one I kept customizing to my needs, it incorporates counting rotation of banners per vertical row and other things that are not generic enough for all cases. It also has other functions in it modified, such as the "Accepting advertisement policy / terms and conditions" modification that I posted at this forum a while ago, which needs a modification also of one of the templates to add a checkbox HTML input to work:
    http://forum.oiopublisher.com/discussion/1547/accepting-advertisement-policy-terms-and-conditions-part-iii/

    BTW, sorry for the delay in replying. For some reason the forum msgs posted at OIO are not reaching my email. I'll check what's going on with that and will visit here more often just in case.

    @fanaticweb2: It may have something to do with that. It depends on the way estimated dates are calculated. But it's easy to fix.

    Replace:
    $display .="<i>Estimated activation date:<br>" . $est['date'] . "</i>";
    with
    if ($est['date'])
    {
    $display .="<i>Estimated activation date:<br>" . $est['date'] . "</i>";
    }

    That should do it.

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