*

7ala

  • ****
  • 144 posts
I have this code to fetch user ads
« on: January 06, 2022, 03:26:55 PM »
I have this code to fetch user ads
The first problem is that member ads are fetched on the same page as the item
The original is that the user's advertisements are fetched without the advertisement in the element
It means new advertisements from the member other than the advertisement on the item's page
If we change this
Code: [Select]
findByUserID(osc_item_user_id(), 1, 6);

findByUserID(osc_item_user_id(), 0, 6);

All ads will be fetched from the member with the same ad on the item's page
But what I want is to show ads other than the one on the item's page

second command
If a member has only one ad, this should disappear
Code: [Select]
<div class="products-from"><a href="<?php echo osc_user_public_profile_urlosc_item_user_id() ); ?>" ><?php printf(__('Products ''Them')); ?><?php echo osc_item_contact_name(); ?></a></div>But it is still visible without ads


Code: [Select]
<?php
if (osc_item_user_id() != '') {
    
$aItems Item::newInstance()->findByUserID(osc_item_user_id(), 16);
    
View::newInstance()->_exportVariableToView('items'$aItems);
    
?>

    <div class="box user-products">
       <div class="products-from"><a href="<?php echo osc_user_public_profile_urlosc_item_user_id() ); ?>" ><?php printf(__('Products ''Them')); ?><?php echo osc_item_contact_name(); ?></a></div>
                      <?php
        
while (osc_has_items()) {
            if (
osc_count_item_resources()) {
                
osc_get_item_resources();
                
?>
« Last Edit: January 06, 2022, 03:28:55 PM by 7ala »

*

7ala

  • ****
  • 144 posts
Re: I have this code to fetch user ads
« Reply #1 on: January 12, 2022, 08:59:17 AM »
 :( :(

*

MB Themes

Re: I have this code to fetch user ads
« Reply #2 on: January 12, 2022, 01:04:46 PM »
@7ala
It is hard to identify problem without complete code and without testing.
You may review other topics where custom listing search (quering) was used (  ... new Search() ... ).
Ie: https://forums.osclasspoint.com/ideas-improvements-and-tips-24/ad-redirect-_-to-via-htaccess/msg24427/#msg24427
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots