Advertisement:

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

abdul ghany syed

  • Jr. Member
  • **
  • Posts: 55
  • I love awesome Classifieds
Re: [TIP] Ads Between Listings
« Reply #60 on: August 26, 2017, 12:19:45 am »
Hi,

Any updates on gallery view option?  :D

Sorry, this still applies:

https://forums.osclass.org/tips-and-tricks/(tip)-ads-between-listings/msg136758/#msg136758

The above methods not worked for me in veronika theme

As said, this is only for List view (I can see Veronika uses Gallery view as default), and even for List view you need to understand the logic of the code to adapt it to your theme.

Regards

Thanks for your confirmation...

jacques1966

  • Newbie
  • *
  • Posts: 43
  • Wannabe Advertising Mogul
Re: [TIP] Ads Between Listings
« Reply #61 on: September 16, 2017, 07:51:04 am »
www.cbay.it

Dude !!!
I like your site - the sliders all work very professional !

What theme are you using?

Any chance of sending me the code?


Aficionado

  • Guest
Re: [TIP] Ads Between Listings
« Reply #62 on: September 16, 2017, 01:26:36 pm »
www.cbay.it

Dude !!!
I like your site - the sliders all work very professional !

What theme are you using?

Any chance of sending me the code?


jacques1966

  • Newbie
  • *
  • Posts: 43
  • Wannabe Advertising Mogul
Re: [TIP] Ads Between Listings
« Reply #63 on: September 17, 2017, 02:49:58 pm »
Thanks Aficionado

I didn't think of doing a "inspect" to look for the theme name.

Is this theme still available? [I typed "Celio" in the theme search at osclass markets - but nada]


cartagena68

  • issues
  • Hero Member
  • *
  • Posts: 1198
Re: [TIP] Ads Between Listings
« Reply #64 on: September 17, 2017, 04:58:17 pm »
I think is a modified version of infinity theme, but i think is no more available on osclass market.

jacques1966

  • Newbie
  • *
  • Posts: 43
  • Wannabe Advertising Mogul
Re: [TIP] Ads Between Listings
« Reply #65 on: September 18, 2017, 05:31:18 am »
I think is a modified version of infinity theme, but i think is no more available on osclass market.

Sadly so it seems..... :-[

ala

  • Full Member
  • ***
  • Posts: 213
Re: [TIP] Ads Between Listings
« Reply #66 on: September 22, 2017, 02:51:16 pm »
i want to add absent code in search page for veronika theme , how can i do? please help me,
this is loop-single.php

goodisme

  • Newbie
  • *
  • Posts: 24
Re: [TIP] Ads Between Listings
« Reply #67 on: September 26, 2017, 12:33:45 pm »
Hi Guys , i use sahara theme. i tried using the provided codes but it is not working. see the coding for my search-list.php

Code: [Select]
<div class="catalogi"><h4><?php _e("Special Ads"'sahara'); ?></h4></div>
<div class="product-pages">
<?php while ( osc_has_premiums() ) { ?>
                    <div class="list-product premi">
                         <div class="product-kiri">
<div class="label-premium hidden-vera-up"><?php _e("Special"'sahara'); ?><b></b></div>
                                <div class="ribbon ribbon-green">
                                <div class="banner">
                                    <div class="text"><?php _e("Special"'sahara'); ?></div>
                                </div></div>
                               <?php if( osc_count_premium_resources() ) { ?>
                                      <a class="arve" href="<?php echo osc_premium_url() ; ?>"><img class="gambars" src="<?php echo osc_resource_thumbnail_url() ; ?>" alt="<?php echo osc_esc_html(osc_premium_title()) ; ?>" title="<?php echo osc_esc_html(osc_premium_title()) ; ?>"></a>
                                <?php } else { ?>
                                      <a href="<?php echo osc_premium_url() ; ?>"><img class="gambars" src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="<?php echo osc_esc_html(osc_premium_title()) ; ?>" title="<?php echo osc_esc_html(osc_premium_title()) ; ?>"/></a>
                                <?php ?>
                          </div>
                          <div class="product-tengah">
                             
                              <h3 class="judul"><a href="<?php echo osc_premium_url() ; ?>"><?php echo osc_premium_title(); ?> </a></h3>
                              <?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled(osc_premium_category_id()) ) { ?>
                             <div class="pricemini pricolor hidden-xs-up" style="color:#2F4F4F">
              <?php echo osc_format_price(osc_premium_price(), osc_premium_currency_symbol()); ?>
                     </div>   
                            <?php ?>
                              <div class="kontens"><p><?php echo osc_highlightstrip_tagsosc_premium_description() ) ); ?></p></div>
                              <div class="loc"><?php if(osc_premium_city()!='' ) { ?><span class="lokas"><strong><i class="fa fa-map-marker" style="color:red"></i></strong>
                              <?php echo osc_premium_city(); ?></span>
                              <?php ?>
                              <?php if(osc_premium_region()!='' ) { ?>&middot;
                              <span class="lokas2"><?php echo osc_premium_region(); ?></span>
                              <?php ?> <span class="catt"><strong><i class="fa fa-book" style="color:brown"></i></strong> <?php echo osc_premium_category($locale ""); ?></span> <span class="datt"><strong><i class="fa fa-calendar" style="color:orange"></i></strong> <?php echo osc_format_date(osc_premium_pub_date()); ?></span></div>
<?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled(osc_premium_category_id()) ) { ?>
<div class="tags price-wrap  hidden-xs-down">
<span class="tag-head"><p class="post-price"><?php echo osc_format_price(osc_premium_price(), osc_premium_currency_symbol()); ?></p></span>
</div>
 <?php ?>
                         </div>
                    </div>
              <?php ?>

<?php ?></div>
<div class="catalog"><h4 style="margin-top:10px;color: #2F4F4F !important;font-weight: bold !important;text-align: center;font-size: 1em;border-bottom: 1px solid #ddd;"><?php _e("Latest Ads"'sahara'); ?></h4></div>
<div class="product-pages">
<?php  $adSense_middle_pos ceil(osc_count_items()/2);
while ( 
osc_has_items() ) { ?>

                      <div class="<?php osc_run_hook("highlight_class"); ?> list-product news reguler">
                      <div class="product-kiri">
<?php if( osc_item_is_premium() ) { ?>
<div class="label-premium  hidden-vera-up"><?php _e("Special"'sahara'); ?><b></b></div>
<?php ?>
                           <?php if( osc_item_is_premium() ) { ?> <div class="ribbon ribbon-green">
                                <div class="banner">
                                    <div class="text"><?php echo osc_esc_html(__('Special','sahara')); ?></div>
                                </div></div><?php ?>
                           <?php if( osc_images_enabled_at_items() ) { ?>
                           <?php if(osc_count_item_resources()) { ?>
                               <a class="arve" href="<?php echo osc_item_url(); ?>"><img class="gambars" src="<?php echo osc_resource_thumbnail_url(); ?>" alt="<?php echo osc_esc_html(osc_item_title()) ; ?>" title="<?php echo osc_esc_html(osc_item_title()) ; ?>"></a>
                          <?php } else { ?>
                                <a href="<?php echo osc_item_url(); ?>"><img class="gambars" src="<?php echo osc_current_web_theme_url('images/no_photo.gif') ; ?>" alt="<?php echo osc_esc_html(osc_item_title()) ; ?>" title="<?php echo osc_esc_html(osc_item_title()) ; ?>"/></a>
                          <?php ?>
                          <?php ?>
                     </div>
                     <div class="product-tengah">
                            <h3 class="judul"><a alt="<?php echo osc_esc_html(osc_item_title()) ; ?>" title="<?php echo osc_esc_html(osc_item_title()) ; ?>" href="<?php echo osc_item_url(); ?>"><?php echo osc_item_title(); ?></a></h3>
                            <?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled() ) { ?>
                            <div class="pricemini pricolor hidden-xs-up" style="color:#2F4F4F;">
              <?php echo osc_format_price(osc_item_price()); ?>
                     </div>   
                     <?php ?>
                            <div class="kontens"><p><?php echo osc_highlightstrip_tagsosc_item_description() ) ); ?></p></div>
                            <div class="loc"><?php if(osc_item_city()!='' ) { ?><span class="lokas"><strong><i class="fa fa-map-marker" style="color:red"></i></strong>
                            <?php echo osc_item_city(); ?></span>
                            <?php ?>
                            <?php if(osc_item_region()!='' ) { ?>&middot;
                            <span class="lokas2"><?php echo osc_item_region(); ?></span>
                            <?php ?> <span class="catt"><strong><i class="fa fa-book" style="color:brown"></i></strong> <?php echo osc_item_category($locale ""); ?></span> <span class="datt"><strong><i class="fa fa-calendar" style="color:#FFFC42"></i></strong> <?php echo osc_format_date(osc_item_pub_date()); ?></span></div>
<?php if( osc_price_enabled_at_items() && osc_item_category_price_enabled() ) { ?>
 <div class="tags price-wrap  hidden-xs-down">
<span class="tag-head"><p class="post-price"><?php echo osc_format_price(osc_item_price()); ?></p></span>
</div>                           
<?php ?>
                      </div>
                      </div>
           
            <?php if ($i+== $adSense_middle_pos) {
         
//AdSense middle ?>

        <div class="list-product news reguler">

         // [Specific AdSense code here]

         </div>
<?php }
« Last Edit: September 26, 2017, 02:01:14 pm by goodisme »

Aficionado

  • Guest
Re: [TIP] Ads Between Listings
« Reply #68 on: September 28, 2017, 07:55:43 pm »
Has anyone applied this to OsclassWizards theme ?

p206ab

  • Sr. Member
  • ****
  • Posts: 343
Re: [TIP] Ads Between Listings
« Reply #69 on: October 09, 2017, 08:17:24 pm »
Did something change in 3.7.4. or am I doing something wrong?
I've tried editing loop in infinity and bender on two separate installations, one fresh test just for this purpose, but I'm not seeing anything, regardless what I insert in adsense code part..text, image...?

ayman83

  • Jr. Member
  • **
  • Posts: 82
Re: [TIP] Ads Between Listings
« Reply #70 on: October 17, 2017, 06:37:02 pm »
I use AiClassy theme, I think that theme is bender dependant.
However, I have no result when I insert the specific code for bender.
I use the latest version of OSClass 3.7.4.
Does it have changes that prevent that code from working?

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [TIP] Ads Between Listings
« Reply #71 on: October 18, 2017, 02:31:59 pm »
Hi,

Has anyone applied this to OsclassWizards theme ?

For Osclass Wizards you need to modify oc-content/themes/osclasswizards/loop-search-list.php

1.-

Code: [Select]
        else {
            while (osc_has_items()) {

Replace with:

Code: [Select]
        else {
            $adSense_middle_pos = ceil(osc_count_items() / 2);
            $ad_counter = 0;

            while (osc_has_items()) {

2.- And, at the end of the script:

Code: [Select]
  <?php
        
}
  }
?>

</ul>

Replace with:

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

                    <li class="listing-card">
                        <div class="list_space">
                            // [Specific AdSense code here]
                        </div>
                    </li>
                <?php
                
}
            }
        } 
?>

</ul>

Regards

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [TIP] Ads Between Listings
« Reply #72 on: October 18, 2017, 02:36:59 pm »
Hi,

Did something change in 3.7.4. or am I doing something wrong?
I've tried editing loop in infinity and bender on two separate installations, one fresh test just for this purpose, but I'm not seeing anything, regardless what I insert in adsense code part..text, image...?

Things have changed in the last 3 years, see here for updated Bender code, and here for Infinity.

Regards

ayman83

  • Jr. Member
  • **
  • Posts: 82
Re: [TIP] Ads Between Listings
« Reply #73 on: October 18, 2017, 07:55:49 pm »
I am glad for your help teseo, appreciate your efforts and thank you for everything.

unfortunately, the code you updated for Bender theme makes this error in the attached image, can you help me again to fix it?


teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: [TIP] Ads Between Listings
« Reply #74 on: October 18, 2017, 08:58:59 pm »
I can't help you, I don't have that theme.

Regards