Advertisement:

Author Topic: Adverts between listings on twitter theme? [ SOLVED]  (Read 2047 times)

Akhim

  • Newbie
  • *
  • Posts: 34
Adverts between listings on twitter theme? [ SOLVED]
« on: April 20, 2015, 12:25:37 am »
I found a topic on how to do this started by Keerthi and Contributed immensely by Teseo.

http://forums.osclass.org/tips-and-tricks/(tip)-ads-between-listings/30/

But there is nothing on it about twitter theme. Does anyone know how to? Do i edit search.php, search_list.php, or search_gallery.php. which line and codes do i edit? Thank you in Advance
« Last Edit: April 23, 2015, 08:51:09 am by Akhim »

Akhim

  • Newbie
  • *
  • Posts: 34
Re: Adverts between listings on twitter theme? [ SOLVED]
« Reply #1 on: April 23, 2015, 08:54:41 am »
 :)
« Last Edit: May 24, 2015, 08:10:22 pm by Akhim »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Adverts between listings on twitter theme? [ SOLVED]
« Reply #2 on: April 23, 2015, 01:13:43 pm »
You're welcome, :) regards.

Akhim

  • Newbie
  • *
  • Posts: 34
Re: Adverts between listings on twitter theme? [ SOLVED]
« Reply #3 on: May 24, 2015, 08:07:49 pm »
I just want to post Teseo's solution here so a to help other people rather than rummaging through the lengthy topic.


Hi,

Yes, each theme can have a different HTML structure. This should work for Twitter:

search-list.php:

1.- Look for this line:

Code: [Select]
<?php while ( osc_has_items() ) { ?>
and replace it with:

Code: [Select]
<?php $adSense_middle_pos ceil(osc_count_items()/2);
    
$ad_counter 0;
    while ( 
osc_has_items() ) { ?>


2.- Replace:

Code: [Select]
    <?php ?>
<?php ?>
<div class="pagination">

with:

Code: [Select]
    <?php $ad_counter++;
        if (
$ad_counter == $adSense_middle_pos) {
            
//AdSense middle ?>

        <div class="line span11 columns">
            [Specific AdSense code here]
        </div>
        <?php }
    } 
?>

<?php ?>
<div class="pagination">

Replace "[Specific AdSense code here]" with your actual AdSense code.