Hi,
The element where each ad is wrapped on may vary from theme to theme, the key to adapt this code to your theme is here:
<?php $ad_counter++;
if ($ad_counter == $adSense_middle_pos) {
//AdSense middle ?>
<tr><td colspan="2">
// [Specific AdSense code here]
</td></tr>
<?php }
Themes Modern, Minimalist, Bender and Infinity (already mentioned in this thread) and others use an HTML table, yours seems to use a div, so replace this block:
<?php while(osc_has_items()) { ?>
<?php if(!osc_item_is_premium()) { ?>
<div class="item-list well">
<div class="text">
<p class="price">$ <?php if (osc_price_enabled_at_items()) {echo osc_item_formated_price();?></p>
<h3><a href="<?php echo osc_item_url();?>"><?php echo osc_item_title();}?></a></h3>
<p><strong><?php if (osc_item_city() != '') {echo osc_item_city();}if (osc_item_region() != '') {echo ' (' . osc_item_region() . ')';}echo ' - ' . osc_format_date(osc_item_pub_date()); echo ' - Total Views: '.ItemStats::newInstance()->getViews(osc_item_id()); ?> </strong> - <strong>expired : <?php echo time_diff1(osc_item_pub_date());?></strong></p>
<p><?php echo osc_highlight(strip_tags(osc_item_description()));?></p>
<p><a title="" href="<?php echo osc_item_url() ; ?>" class="btn pull-right">See More... <strong>»</strong></a></p>
</div>
<?php if( osc_images_enabled_at_items() ) { ?>
<div class="photo">
<?php if(osc_count_item_resources()) { ?>
<a href="<?php echo osc_item_url() ; ?>"><img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="125px" height="125px" title="" alt="" /></a>
<?php } else { ?>
<img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" width="125px" height="125px" title="" alt="" />
<?php } ?>
</div>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
with:
<?php
$adSense_middle_pos = ceil(osc_count_items()/2);
$ad_counter = 0;
while(osc_has_items()) { ?>
<?php if(!osc_item_is_premium()) { ?>
<div class="item-list well">
<div class="text">
<p class="price">$ <?php if (osc_price_enabled_at_items()) {echo osc_item_formated_price();?></p>
<h3><a href="<?php echo osc_item_url();?>"><?php echo osc_item_title();}?></a></h3>
<p><strong><?php if (osc_item_city() != '') {echo osc_item_city();}if (osc_item_region() != '') {echo ' (' . osc_item_region() . ')';}echo ' - ' . osc_format_date(osc_item_pub_date()); echo ' - Total Views: '.ItemStats::newInstance()->getViews(osc_item_id()); ?> </strong> - <strong>expired : <?php echo time_diff1(osc_item_pub_date());?></strong></p>
<p><?php echo osc_highlight(strip_tags(osc_item_description()));?></p>
<p><a title="" href="<?php echo osc_item_url() ; ?>" class="btn pull-right">See More... <strong>»</strong></a></p>
</div>
<?php if( osc_images_enabled_at_items() ) { ?>
<div class="photo">
<?php if(osc_count_item_resources()) { ?>
<a href="<?php echo osc_item_url() ; ?>"><img src="<?php echo osc_resource_thumbnail_url() ; ?>" width="125px" height="125px" title="" alt="" /></a>
<?php } else { ?>
<img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" width="125px" height="125px" title="" alt="" />
<?php } ?>
</div>
<?php } ?>
</div>
<?php } ?>
<?php $ad_counter++;
if ($ad_counter == $adSense_middle_pos) {
//AdSense middle ?>
<div class="item-list well">
// [Specific AdSense code here]
</div>
<?php }
<?php } ?>
As you can see the opening table-specific tags
<tr><td colspan="2"> are replaced with
<div class="item-list well">and the closing table-specific tags
</td></tr> are replaced with
</div>Regards