Advertisement:

Author Topic: [TIP] Ads Between Listings  (Read 20686 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: 307
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: 307
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: 307
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

  • issues
  • Hero Member
  • *
  • Posts: 6146
  • Hardliner
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.