Forum

Get specific ads
 
Notifications
Clear all

Get specific ads

6 Posts
2 Users
0 Likes
830 Views
 wad
(@wad)
Posts: 25
Eminent Member
Topic starter
 

Hello,

I have this code to fetch specific ads by ad number

osc_query_item("id=(145,146,250,266)");

But the problem is that it only fetches one ad. Why is not all the specific ads fetched?

Is there another better way or a specific job?

Thank you

This topic was modified 8 months ago 2 times by wad
 
Posted : 19/07/2022 11:12 am
 wad
(@wad)
Posts: 25
Eminent Member
Topic starter
 

There is nobody

 
Posted : 23/07/2022 2:02 pm
 wad
(@wad)
Posts: 25
Eminent Member
Topic starter
 

I made this attempt

<?php osc_query_item("id=116").
osc_query_item("id=120").
osc_query_item("id=130").
osc_query_item("id=150").
osc_query_item("id=190").
osc_query_item("id=199").
osc_query_item("id=250");
if( osc_count_custom_items() == 0) { ?>
<p class="empty"><?php _e('No Listings', 'epsilon') ; ?></p>
<?php } else { ?>

But the problem is that the last ad is fetching this code only
osc_query_item("id=250");

The rest is not seen

 
Posted : 29/07/2022 1:16 pm
(@admin)
Posts: 43
Eminent Member Admin
 

You are missing the while loop, without loop you can only get the last item

 

<?php if (osc_count_custom_items() > 0) { ?>
    <div class="latest_ads">
        <?php while (osc_has_custom_items()) { ?>
        .........
        <?php } ?>
    </div>
<?php } ?>
 
Posted : 29/07/2022 4:59 pm
 wad
(@wad)
Posts: 25
Eminent Member
Topic starter
 
Posted by: @admin

You are missing the while loop, without loop you can only get the last item

 

<?php if (osc_count_custom_items() > 0) { ?>
    <div class="latest_ads">
        <?php while (osc_has_custom_items()) { ?>
        .........
        <?php } ?>
    </div>
<?php } ?>

Thanks for your reply
But this code is complete, same problem

<?php osc_query_item("id=116").
					  osc_query_item("id=120").
					  osc_query_item("id=130").
					  osc_query_item("id=150").
					  osc_query_item("id=190").
					  osc_query_item("id=199").
					  osc_query_item("id=250");
 if (osc_count_custom_items() > 0) { ?>
    <div class="latest_ads">
        <?php while (osc_has_custom_items()) { ?>
        .........
        <?php } ?>
    </div>
<?php } ?>

Tried it this way, same problem

<?php osc_query_item("id=116,120,130,150,190,199,250");

if (osc_count_custom_items() > 0) { ?>
<div class="latest_ads">
<?php while (osc_has_custom_items()) { ?>
.........
<?php } ?>
</div>
<?php } ?>

Only one ad is fetched

 

 
Posted : 31/07/2022 12:15 pm
 wad
(@wad)
Posts: 25
Eminent Member
Topic starter
 

I made more than one attempt
Unfortunately, only one ad is fetched
Is it possible that the script is not supported?

 
Posted : 06/08/2022 12:59 pm
Share: