Advertisement:

Author Topic: [TIP] Ads Between Listings  (Read 25270 times)

ayman83

  • Jr. Member
  • **
  • Posts: 82
Re: [TIP] Ads Between Listings
« Reply #75 on: October 18, 2017, 09:32:08 pm »
Sorry teaeo, it was my mistake by inserting the code in wrong way.
now the error was fixed, and the ad appears between listings.  :D
 
Please, may I have your advice on these topics:

How can I customize each category?
https://forums.osclass.org/general-help/how-can-i-customize-each-category/

How can I put a placeholder in any field?
https://forums.osclass.org/general-help/how-can-i-put-a-placeholder-in-any-field/?topicseen

 How to make premium listings in search page more than 5?
https://forums.osclass.org/general-help/how-to-make-premium-listings-in-search-page-more-than-5/
Regards,
« Last Edit: October 18, 2017, 09:58:08 pm by ayman83 »

p206ab

  • Sr. Member
  • ****
  • Posts: 343
Re: [TIP] Ads Between Listings
« Reply #76 on: November 26, 2017, 09:47:47 pm »
I finally managed to make it work in Infinity, but how do I apply this also for home page (latest items)?
Thanks.  ;)

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [TIP] Ads Between Listings
« Reply #77 on: November 27, 2017, 01:11:22 pm »
Sorry, I don't have access to any installation using Infinity theme anymore.

Regards

p206ab

  • Sr. Member
  • ****
  • Posts: 343
Re: [TIP] Ads Between Listings
« Reply #78 on: November 28, 2017, 12:13:33 am »
Sorry, I don't have access to any installation using Infinity theme anymore.

Regards

Well, since it's the same as bender, only renamed, do you possibly know how to make it there? I'll remake it for Infinity by myself then (and post it here for future reference).
Thanks.

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [TIP] Ads Between Listings
« Reply #79 on: November 28, 2017, 01:47:30 pm »
OK.

For Latest Listings on Bender you need to modify oc-content/themes/bender/loop.php

This block:

Code: [Select]
        if($type == 'latestItems'){
            while ( osc_has_latest_items() ) {
                $class = '';
                if($i%3 == 0){
                    $class = 'first';
                }
                bender_draw_item($class);
                $i++;
            }
        } elseif($type == 'premiums'){

Replace with:

Code: [Select]
        if($type == 'latestItems'){
            $adSense_middle_pos = ceil(osc_count_latest_items()/2);
            $ad_counter = 0;
            while ( osc_has_latest_items() ) {
                $class = '';
                if ($i % 3 == 0) {
                    $class = 'first';
                }
                bender_draw_item($class);
                $i++;

                $ad_counter++;
                if ($ad_counter == $adSense_middle_pos && bender_show_as() == 'list') {
                    //AdSense middle
                    ?>
                    <li class="listing-card">

                        // [Specific AdSense code here]

                    </li>
                <?php }
            }
        } elseif(
$type == 'premiums'){

Regards

p206ab

  • Sr. Member
  • ****
  • Posts: 343
Re: [TIP] Ads Between Listings
« Reply #80 on: November 28, 2017, 09:30:08 pm »
Thanks teseo, works like a charm.  :)
For infinity, all that is required is change the two bender words into infinity, the rest is the same, so

infinity_draw_item($class);
infinity_show_as() == 'list'


mrtsoftware

  • Sr. Member
  • ****
  • Posts: 343
Re: [TIP] Ads Between Listings
« Reply #81 on: February 05, 2018, 03:57:06 pm »
How to do same in Osclass Wizards theme?

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [TIP] Ads Between Listings
« Reply #82 on: February 05, 2018, 04:03:39 pm »

sewalaku

  • Newbie
  • *
  • Posts: 1
Re: [TIP] Ads Between Listings
« Reply #83 on: May 13, 2018, 09:31:42 am »
<?php
    /*
     *       Rich Responsive Osclass Themes
     *       
     *       Copyright (C) 2016 OSCLASS.me
     *
     *       This is Rich Osclass Themes with Single License
     * 
     *       This program is a commercial software. Copying or distribution without a license is not allowed.
     *         
     *       If you need more licenses for this software. Please read more here <http://www.osclass.me/osclass-me-license/>.
     */

    osc_get_premiums();
    if(osc_count_premiums() > 0) {
?>
<div class="lg-12 md-12">
<div class="bmw">
        <?php while(osc_has_premiums()) { ?>
           <div class="kontena lg-12 md-12 premium topper">
                <?php if( osc_images_enabled_at_items() ) { ?>
                 <div class="lg-2 md-2 xs-4 oner">
                     <?php if(osc_count_premium_resources()) { ?>
                        <a href="<?php echo osc_premium_url() ; ?>"><img src="<?php echo osc_resource_thumbnail_url() ; ?>" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" /></a>
                    <?php } else { ?>
                        <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" title="" alt="" />
                    <?php } ?>
                 </div>
                 <?php } ?>
                 <div class="lg-10 md-10 xs-8 twor">
                     <div class="judula"><h3><a href="<?php echo osc_premium_url() ; ?>"><?php echo osc_premium_title() ; ?></a></h3></div>
<div class="locatte"><span class="hargas"><?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled(osc_premium_category_id()) ) { ?><?php echo osc_format_price(osc_premium_price(), osc_premium_currency_symbol()); ?><?php } ?></span><span class="cat-label cat-label-label2"><i class="fa fa-star"></i> <?php _e('Premium', 'rich') ; ?></span></div>
                      <div class="localer mini-none"> <p><?php echo osc_highlight( osc_premium_description() ,300) ; ?></p></div>
                     <div class="localer">
                        <span><i class="fa fa-calendar"></i>  <?php echo osc_format_date(osc_premium_pub_date()); ?>  <i class="fa fa-map-marker"></i>  <?php echo osc_premium_city(); ?> <span class="mini-none">(<?php echo osc_premium_region(); ?>)</span> </span>
                     </div>
                 </div></div>
        <?php } ?>
<?php } ?>
<?php while(osc_has_items()) { ?>
             <div class="kontena lg-12 md-12 standart topper">
                <?php if( osc_images_enabled_at_items() ) { ?>
                  <div class="lg-2 md-2 xs-4 oner">
                     <?php if(osc_count_item_resources()) { ?>
                        <a href="<?php echo osc_item_url() ; ?>"><img src="<?php echo osc_resource_thumbnail_url() ; ?>" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" /></a>
                    <?php } else { ?>
                        <img src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" title="" alt="" />
                    <?php } ?>
                 </div>
                 <?php } ?>
                  <div class="lg-10 md-10 xs-8 twor">
                     <div class="judula"><h3>
                         <a href="<?php echo osc_item_url() ; ?>"><?php echo osc_item_title() ; ?></a></h3></div>
<div class="locatte"><span class="hargas"> <?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled() ) { ?><?php echo osc_format_price(osc_item_price()); ?><?php } ?></span><?php if( osc_item_is_premium() ) { ?>
                 <span class="cat-label cat-label-label2"><i class="fa fa-star"></i> <?php _e('Premium', 'rich') ; ?></span>
                 <?php } ?></div>
                    <div class="localer"> <p class="mini-none"><?php echo osc_highlight( osc_item_description() ,300) ; ?></p></div>
                    <div class="localer"><span><i class="fa fa-calendar"></i>  <?php echo osc_format_date(osc_item_pub_date()); ?> </span><span>  <i class="fa fa-map-marker"></i>  <?php echo osc_item_city(); ?> <span class="mini-none"(<?php echo osc_item_region(); ?>)</span> </span>
                     </div>
                     
                 </div>
              </div>
        <?php } ?>
   

</div>
</div>





this is my seacrh_list.php.
 :-[ :-[ :-[ :-[ FRIEND PLASE HELP MEE  PLASE
i can'at view ads

Ibowills

  • Newbie
  • *
  • Posts: 5
Re: [TIP] Ads Between Listings
« Reply #84 on: August 14, 2018, 08:22:46 am »
Hi,

New installation of osclass 3.8.0, default theme.  Only Country is appearing after I add. For region after I search and add, it says added but does not appear. While city no way to add at all. I want all region or cities to appear or drop down list. How to fix?

Aficionado

  • Guest
Re: [TIP] Ads Between Listings
« Reply #85 on: August 14, 2018, 12:22:10 pm »
Hi,

New installation of osclass 3.8.0, default theme.  Only Country is appearing after I add. For region after I search and add, it says added but does not appear. While city no way to add at all. I want all region or cities to appear or drop down list. How to fix?

What that question has to do with the topic ? Please do not post to old topics or irrelevant ones. Open a new Topic in the Proper Forum.

bgd

  • Jr. Member
  • **
  • Posts: 63
Re: [TIP] Ads Between Listings
« Reply #86 on: January 04, 2019, 02:29:08 pm »
Hello,

How I can display only 2 or 3 random ads beetwing listings? I can use only 3 google adsense ads because I use scrolling page.

« Last Edit: January 04, 2019, 07:40:08 pm by bgd »

bgd

  • Jr. Member
  • **
  • Posts: 63
Re: [TIP] Ads Between Listings
« Reply #87 on: January 11, 2019, 08:32:49 am »
anyone  please :'(

Darwazo

  • Full Member
  • ***
  • Posts: 113
Re: [TIP] Ads Between Listings
« Reply #88 on: April 12, 2019, 04:42:21 am »
Hi Teseo and all helping hands .....

i am using Veronika theme....& still learning in bits and pieces
I got help from theme forum but still this one is yet to be resolved ...

Pls. help me ....i want to put adsense ad after every 3rd ad listing in search result.....

Currently I had pasted Adsense in Ads Management Tab of theme but getting only ONE Ad.


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




Suggested solution which didn't work for me......or how to use this ...

---------------------------------------------------------------------------------------------
<?php $count = 0; ?>
<?php while(osc_has_items()) { ?>
<?php $count++; ?>
<?php if( $count/4 == 1 || $count/4 == 2 || $count/4 == 3  || $count/4 == 4) { ?>
<?php echo show_banner( 1 ); ?>

<?php } ?>
----------------------------------------------------------------------------------------------
darwazo.com
« Last Edit: April 12, 2019, 04:52:01 am by Darwazo »

casper

  • Newbie
  • *
  • Posts: 11
Re: [TIP] Ads Between Listings
« Reply #89 on: June 27, 2019, 03:49:20 pm »
Hi Teseo and all helping hands .....

i am using Veronika theme....& still learning in bits and pieces
I got help from theme forum but still this one is yet to be resolved ...

Pls. help me ....i want to put adsense ad after every 3rd ad listing in search result.....

Currently I had pasted Adsense in Ads Management Tab of theme but getting only ONE Ad.


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




Suggested solution which didn't work for me......or how to use this ...

---------------------------------------------------------------------------------------------
<?php $count = 0; ?>
<?php while(osc_has_items()) { ?>
<?php $count++; ?>
<?php if( $count/4 == 1 || $count/4 == 2 || $count/4 == 3  || $count/4 == 4) { ?>
<?php echo show_banner( 1 ); ?>

<?php } ?>
----------------------------------------------------------------------------------------------
darwazo.com

Code: [Select]
  <?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 if($c == 5) { ?>
      <?php echo veronika_banner('search_list'); ?>
    <?php ?>
    <?php $c++; ?>
  <?php ?>

Change the order number
<?php if($c == 3) { ?>