Advertisement:

Author Topic: how to create hot listing per category?  (Read 2259 times)

creat15

  • Full Member
  • ***
  • Posts: 218
how to create hot listing per category?
« on: October 15, 2014, 12:44:23 pm »
Hi :)

i want to ask

I want to ask how to make hot listings per category? like theme  "Alterego"

Code: [Select]
<div class="left_element shadow">
    <h3>
        <span class="realestate"></span>
<?php _e('Hot Real Estate Ads!''alterego'); ?>
    </h3>
    <ul class="hot_items_cat">
    <?php osc_query_item("category=XY");
        if( 
osc_count_custom_items() == 0) { ?>

            <p class="empty"><?php _e('No Listings''alterego') ; ?></p>
<?php } else { ?>
        <?php while ( osc_has_custom_items() ) { ?>
                <li><a href="<?php echo osc_item_url() ; ?>"><?php echo osc_item_title() ; ?></a></li>
        <?php ?>
<?php }; ?>
    </ul>
</div>

css code :

Code: [Select]
.left_element.shadow h3 {
    color: #f75e0b;
    padding: 8px 0px;
    margin: 0px 0px 5px;
    border-bottom: 2px solid #DDDDDD;
    font: 17px 'Antic Slab',Tahoma,Geneva,sans-serif;
}
.realestate {
    background: url(../images/sprite-2.png) no-repeat scroll -272px 0px transparent;
    width: 25px;
    height: 19px;
    display:inline-block;
}
.left_element.shadow ul li {
    background: url(../images/grey-arrow-right.png) no-repeat scroll left 12px transparent;
    list-style: none outside none;
    padding: 8px 0px 8px 13px;
}

I have to replace this code as instructed above

<?php osc_query_item("category=XY");


but the result is an error, all ad listings in all categories appear (I've installed the plugin popular_ads), not per category of ad listings that appears

please help me
« Last Edit: October 22, 2014, 09:29:40 am by creat15 »

creat15

  • Full Member
  • ***
  • Posts: 218
Re: how to create hot listing per category?
« Reply #1 on: October 15, 2014, 03:46:28 pm »
please help  :-[

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: how to create hot listing per category?
« Reply #2 on: October 15, 2014, 06:41:25 pm »
you would use http://doc.osclass.org/Display_only_certain_type_of_listings
which is what is being used, but it looks like you forgot to add the function.

may I also recommend that you turn on your debug, it will help you immensely as you are creating your site.

creat15

  • Full Member
  • ***
  • Posts: 218
Re: how to create hot listing per category?
« Reply #3 on: October 16, 2014, 08:18:57 pm »
you would use http://doc.osclass.org/Display_only_certain_type_of_listings
which is what is being used, but it looks like you forgot to add the function.

may I also recommend that you turn on your debug, it will help you immensely as you are creating your site.

hi :)

thank you for replying to this thread, can you help me by giving a few examples of different functions for displaying listings per category

===========================================================================

edited =

i tried with this code

Quote
Code: [Select]
<div class="left_element shadow">
    <h3>
        <span class="realestate"></span>
<?php _e('Hot Real Estate Ads!''alterego'); ?>
    </h3>
    <ul class="hot_items_cat">
    <?php osc_query_item("category=XY");
        if( 
osc_count_custom_items() == 0) { ?>

            <p class="empty"><?php _e('No Listings''alterego') ; ?></p>
<?php } else { ?>
        <?php while ( osc_has_custom_items() ) { ?>
                <li><a href="<?php echo osc_item_url() ; ?>"><?php echo osc_item_title() ; ?></a></li>
        <?php ?>
<?php }; ?>
    </ul>
</div>

css code :

Code: [Select]
.left_element.shadow h3 {
    color: #f75e0b;
    padding: 8px 0px;
    margin: 0px 0px 5px;
    border-bottom: 2px solid #DDDDDD;
    font: 17px 'Antic Slab',Tahoma,Geneva,sans-serif;
}
.realestate {
    background: url(../images/sprite-2.png) no-repeat scroll -272px 0px transparent;
    width: 25px;
    height: 19px;
    display:inline-block;
}
.left_element.shadow ul li {
    background: url(../images/grey-arrow-right.png) no-repeat scroll left 12px transparent;
    list-style: none outside none;
    padding: 8px 0px 8px 13px;
}

I have to replace this code as instructed above

<?php osc_query_item("category=XY");


I tried just now, but there is a little error that ads on the category appears twice, examples like this

category A

- Selling clothes pink girl
- Selling girl dress in blue

category B

- Selling men's shirt in red
- Selling clothes pink girl (ads in category A, category B appears on, this duplication ad)

how to avoid duplication of ads on different categories?

Please Help me...
thanks before :)
« Last Edit: October 16, 2014, 10:30:26 pm by creat15 »

creat15

  • Full Member
  • ***
  • Posts: 218
Re: how to create hot listing per category?
« Reply #4 on: October 18, 2014, 08:56:46 am »
not answer  :-[

please help me  :-[

creat15

  • Full Member
  • ***
  • Posts: 218
Re: how to create hot listing per category?
« Reply #5 on: October 20, 2014, 11:23:47 am »
sorry, me bump/up  :-[

please help me  :-[

creat15

  • Full Member
  • ***
  • Posts: 218
Re: how to create hot listing per category?
« Reply #6 on: October 21, 2014, 10:29:50 am »
please help  :-[

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: how to create hot listing per category?
« Reply #7 on: October 21, 2014, 10:37:08 pm »
sorry, Im not here as often as Id like to be and I am not such a good php coder. did you check what is not working(or is not there) in your functions.php file?

creat15

  • Full Member
  • ***
  • Posts: 218
Re: how to create hot listing per category?
« Reply #8 on: October 22, 2014, 09:26:22 am »
sorry, Im not here as often as Id like to be and I am not such a good php coder. did you check what is not working(or is not there) in your functions.php file?

thanks for reply  :)

same i am not such a good php code  :-[

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: how to create hot listing per category?
« Reply #9 on: October 22, 2014, 09:04:55 pm »
are you conflicting your code?

creat15

  • Full Member
  • ***
  • Posts: 218
Re: how to create hot listing per category?
« Reply #10 on: October 23, 2014, 08:16:15 am »
are you conflicting your code?

thanks for reply

not, the code does not conflict
persists listings per category, but it appears the same two listings per category

display the above code if I run like this :

category A

- Selling clothes pink girl
- Selling girl dress in blue

category B

- Selling men's shirt in red
- Selling clothes pink girl (ads in category A, category B appears on, this duplication ad)

I want to like the picture below look hot listing per category are not the same

can you help me?

thanks before
« Last Edit: October 23, 2014, 08:21:55 am by creat15 »

creat15

  • Full Member
  • ***
  • Posts: 218
Re: how to create hot listing per category?
« Reply #11 on: October 28, 2014, 06:21:31 am »
up...up...

please help me  :-[