Advertisement:

Author Topic: Premium Ads Show Duplicate  (Read 3900 times)

TechGuy23

  • Full Member
  • ***
  • Posts: 229
  • We are STARPCLASS 2016
Premium Ads Show Duplicate
« on: June 16, 2013, 05:23:52 pm »
What a wonderful Premium Ad service. Im using it with my paypal email address only as standard as im not sure how to set the rest up for API. This is not a current issue. The issue is when someone posts a premium Ad it shows Duplicate in Carousel for Osclass. I am not sure where the problem is and i was hoping someone could iddue a quick and easy fix. I know there is a spam plugin but i dont want to use that yet. I would rather get a quick fix issued.

Also the Make Ad Premium button on item.php i believe anyone can make it premium and im not sure how to fix this.


rcraig12

  • Newbie
  • *
  • Posts: 4
Re: Premium Ads Show Duplicate
« Reply #1 on: August 02, 2013, 05:00:56 pm »
I had the same problem. A little investigation found that the file search_list.php is the culprit!

Look for the code that reads:

<?php while ( osc_has_items() ) { ?> then directly under it insert the following code : <?php if(!osc_item_is_premium()) { ?>

Farther down the file you will come across:

    <?php } ?>
<?php } ?>

insert another set of tags the same and you will be done! It will look like this :

    <?php } ?>
    <?php } ?>
<?php } ?>

thats all there is to it really. No more duplicate content :)


creat15

  • Full Member
  • ***
  • Posts: 218
Re: Premium Ads Show Duplicate
« Reply #2 on: August 29, 2013, 11:25:47 am »
I had the same problem. A little investigation found that the file search_list.php is the culprit!

Look for the code that reads:

<?php while ( osc_has_items() ) { ?> then directly under it insert the following code : <?php if(!osc_item_is_premium()) { ?>

Farther down the file you will come across:

    <?php } ?>
<?php } ?>

insert another set of tags the same and you will be done! It will look like this :

    <?php } ?>
    <?php } ?>
<?php } ?>

thats all there is to it really. No more duplicate content :)

hi thank's for tutorial

this is works  ;D

scoodek

  • Newbie
  • *
  • Posts: 18
Re: Premium Ads Show Duplicate
« Reply #3 on: December 30, 2013, 12:49:42 am »
 :) thanks for this, works a treat!

frosticek

  • Hero Member
  • *****
  • Posts: 3948
Re: Premium Ads Show Duplicate
« Reply #4 on: December 30, 2013, 01:04:02 am »
@TechisTheme Creations
Actually it is not bug.
Suppose we have following listings:
list 1 - premium
list 2 - regular
list 3 - premium
list 4 - regular

There will be 2 loops using arrays: osc_has_items() and osc_has_premiums()
Means you will have in final list:
loop 1 (premium loop): list 1, list 3
loop 2 (regular loop): list 1, list 2, list 3, list 4

Why?
Because even list 1 and list 3 are premiums, they are still also considered as regular  :)

Adyyda

  • Sr. Member
  • ****
  • Posts: 435
Re: Premium Ads Show Duplicate
« Reply #5 on: December 08, 2015, 08:25:47 pm »
Because even list 1 and list 3 are premiums, they are still also considered as regular  :)

Hello. Do you know how to hide the standard ads that are marked as premium ads? I do not like duplicated ads. Thanks

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Premium Ads Show Duplicate
« Reply #6 on: December 08, 2015, 09:20:50 pm »
Hi,

Do you mean Premiums that are already being shown in the same page, or it's just that you want to totally exclude any Premium in the "normal" list? ???

Regards

Adyyda

  • Sr. Member
  • ****
  • Posts: 435
Re: Premium Ads Show Duplicate
« Reply #7 on: December 08, 2015, 09:28:55 pm »
If a ad is marked as premium, do not show it olso as standard in the whole website.

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: Premium Ads Show Duplicate
« Reply #8 on: December 09, 2015, 12:36:31 am »
Hm... What I can do is to provide code to hide them only on search lists, they might still appear on Latest Ads and some special modules... ???

Add this at the very bottom of your theme functions.php:
Notes:
1.- Take care not to leave blank lines after this.
2.- If your theme functions.php doesn't end with ?> skip first line of my code.

Code: [Select]
<?php
function cust_exclude_premiums_from_list() {
    
Search::newInstance()->addConditions('b_premium = 0');
}

osc_add_hook('search_conditions''cust_exclude_premiums_from_list');
?>


Regards

WORLDSERVED

  • Newbie
  • *
  • Posts: 2
Re: Premium Ads Show Duplicate
« Reply #9 on: October 08, 2018, 05:04:45 pm »
hi Teseo any idea to apply the function to latest items. because latest items if the default list on the homepage and it will be nice if we can avoid the repeat as you have done with search pages.
Thank you