migrania
Member
Tanks to @teseo (from osc4u) None of the code below are mine.
I think it's important to rescue it, before the site where it was posted disappears.
THEME BENDER
you need to modify oc-content/themes/bender/loop.php
This block at the end of the script:
Replace it with:
Important note: I've programmed this in a way that will only work for List View, to insert a single "fake regular ad" on Gallery View would scramble the symmetry of the grid layout.
You'd need to insert 4 AdSenses to keep things pretty...
I think it's important to rescue it, before the site where it was posted disappears.
THEME BENDER
you need to modify oc-content/themes/bender/loop.php
This block at the end of the script:
Code:
while(osc_has_items()) {
$i++;
$class = false;
if($i%4 == 0){
$class = 'last';
}
$admin = false;
if(View::newInstance()->_exists("listAdmin")){
$admin = true;
}
bender_draw_item($class,$admin);
Replace it with:
Code:
$adSense_middle_pos = ceil(osc_count_items()/2);
$ad_counter = 0;
while(osc_has_items()) {
$i++;
$class = false;
if($i%4 == 0){
$class = 'last';
}
$admin = false;
if(View::newInstance()->_exists("listAdmin")){
$admin = true;
}
bender_draw_item($class,$admin);
$ad_counter++;
if ($ad_counter == $adSense_middle_pos && bender_show_as() == 'list') {
//AdSense middle ?>
<li class="listing-card">
// [Specific AdSense code here]
</li>
<?php }
Important note: I've programmed this in a way that will only work for List View, to insert a single "fake regular ad" on Gallery View would scramble the symmetry of the grid layout.
