*

Ghany

  • ****
  • 227 posts
how i can add adsense code after every 6listings in search list.php? help me here
thank u.........
Unlock the power of visibility without breaking the bank - https://www.adycart.in/

*

RP

  • ***
  • 38 posts
Re: how can i add adsense code for every 6 listings in search list.php
« Reply #1 on: June 17, 2016, 02:18:37 PM »
Hello,
Congratulations on your page looks great.

I wanted to ask you a question, I see no charge for highlight or premium, which you generate by google Adsense is profitable enough for you ?, ie, giving enough to pay for servers, developments, and wages?

Thank you.

I love share www.koohala.com  :) 8)
I love to share http://www.koohala.com :) 8)

*

MB Themes

Re: how can i add adsense code for every 6 listings in search list.php
« Reply #2 on: June 17, 2016, 04:18:55 PM »
@Ghany
In file:
oc-content/themes/zara/search_list.php

Find code:
Code: [Select]
<?php while(osc_has_items()) { ?>
Replace with:
Code: [Select]
<?php $count 0?>
<?php while(osc_has_items()) { ?>
  <?php $count++; ?>

  <?php if( gmp_strval(gmp_div_r($count"6")) ) { ?>
    ... your banner ...
  <?php ?>

There might be problem with part:
Code: [Select]
<?php if( gmp_strval(gmp_div_r($count"6")) ) { ?>

I have never tested it, if it does not work, then replace it with:
Code: [Select]
<?php if( $count/== || $count/== || $count/== 3  || $count/== || $count/== || $count/== 6) { ?>
Rest is on you.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Ghany

  • ****
  • 227 posts
Re: how can i add adsense code for every 6 listings in search list.php
« Reply #3 on: June 17, 2016, 05:58:49 PM »
 @frosticek

i tried what you say, the two ways was not worked for me,  :( :( :( :(

is there any other option to work?
Unlock the power of visibility without breaking the bank - https://www.adycart.in/

*

MB Themes

Re: how can i add adsense code for every 6 listings in search list.php
« Reply #4 on: June 17, 2016, 09:01:43 PM »
@Ghany
No there is not.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Schurli

  • **
  • 16 posts
Re: how can i add adsense code for every 6 listings in search list.php
« Reply #5 on: September 01, 2016, 10:31:42 AM »
@Ghany
In file:
oc-content/themes/zara/search_list.php

Find code:
Code: [Select]
<?php while(osc_has_items()) { ?>
Replace with:
Code: [Select]
<?php $count 0?>
<?php while(osc_has_items()) { ?>
  <?php $count++; ?>

  <?php if( gmp_strval(gmp_div_r($count"6")) ) { ?>
    ... your banner ...
  <?php ?>


There might be problem with part:
Code: [Select]
<?php if( gmp_strval(gmp_div_r($count"6")) ) { ?>

I have never tested it, if it does not work, then replace it with:
Code: [Select]
<?php if( $count/== || $count/== || $count/== 3  || $count/== || $count/== || $count/== 6) { ?>
Rest is on you.

Hello,
it does not work for me.
Can someone help me please?

This is my Code:
Code: [Select]
<?php $count 0?>
  <?php while(osc_has_items()) { ?>
  <?php $count++; ?>

  <?php if( gmp_strval(gmp_div_r($count"6")) ) { ?>
  <?php echo show_banner( {BANNER_GROUP_1} ); ?>
  <?php ?>

*

MB Themes

Re: how can i add adsense code for every 6 listings in search list.php
« Reply #6 on: September 04, 2016, 07:30:27 PM »
@Schruli
You should probably replace {BANNER_GROUP_1} with ID or Shortname of group.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Schurli

  • **
  • 16 posts
Re: how can i add adsense code for every 6 listings in search list.php
« Reply #7 on: September 04, 2016, 08:21:05 PM »
@frosticek
not Works for my the Banner.

This is my Code:
Code: [Select]
<?php $count 0?>
<?php while(osc_has_items()) { ?>
<?php $count++; ?>
<?php if( $count/== || $count/== || $count/== 3  || $count/== 4) { ?>
<?php echo show_banner( {1} ); ?>
<?php ?>

*

MB Themes

Re: how can i add adsense code for every 6 listings in search list.php
« Reply #8 on: September 05, 2016, 08:47:58 AM »
@Schruli
Again, {} are placeholder signs, correct code would be:
Code: [Select]
<?php echo show_banner); ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Schurli

  • **
  • 16 posts
Re: how can i add adsense code for every 6 listings in search list.php
« Reply #9 on: September 06, 2016, 09:39:42 AM »
@frosticek
Oh, ok, it Works  ;D

*

MB Themes

Re: how can i add adsense code for every 6 listings in search list.php
« Reply #10 on: September 06, 2016, 09:43:43 AM »
@Schurli
Cool ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Darwazo

  • ***
  • 81 posts
Re: how can i add adsense code for every 6 listings in search list.php
« Reply #11 on: April 12, 2019, 02:03:55 AM »
Hi Frosticek

This didn't work for me.....pls. help me.....

I have put adsense code in theme Ads management - search list

I tried your and others options but didnt work.....


My current relevant code on search list is :


  <?php $c = 1; ?>
  <?php while(osc_has_items()) { ?>

    <?php veronika_draw_item($c, 'list'); ?>

    <?php if($c == 3) { ?>
      <?php echo veronika_banner('search_list'); ?>
    <?php } ?>

    <?php $c++; ?>
  <?php } ?>
</div>


Thanks