Osclass Support Forums

Osclass theme support => CareerJob Osclass Jobs Theme => Topic started by: developGr on November 20, 2020, 09:23:01 AM

Title: Diplay item.php image on the search.php
Post by: developGr on November 20, 2020, 09:23:01 AM
I want to use the image of the item.php to be show in the search.php instead of the profile picture of company that its set at the user-profile.php
Title: Re: Diplay item.php image on the search.php
Post by: MB Themes on November 24, 2020, 02:50:19 PM
@developGr
In loop-single.php (-premium.php) search for:
Code: [Select]
          <img src="<?php echo careerjob_profile_picture(osc_item_user_id(), 'small'); ?>" alt="<?php echo osc_esc_html((osc_item_user_id() > $user['s_name'] : osc_item_contact_name())); ?>"/>

Replace it with:
Code: [Select]
          <img src="<?php echo osc_resource_thumbnail_url(); ?>" alt="<?php echo osc_esc_html(osc_item_title()); ?>"/>
You may check sigma/bender theme for more clarity on functions to be used.
Title: Re: Diplay item.php image on the search.php
Post by: developGr on November 25, 2020, 01:30:42 PM
when i make those steps i am getting that:
Title: Re: Diplay item.php image on the search.php
Post by: developGr on November 25, 2020, 01:32:12 PM
and
Title: Re: Diplay item.php image on the search.php
Post by: MB Themes on November 25, 2020, 01:34:37 PM
@developGr
Checkout docs.
https://docs.osclasspoint.com/hitems-php
https://docs.osclasspoint.com/hpremium-php

osc_resource_thumbnail_url() is proper function to get listing pictures.
Title: Re: Diplay item.php image on the search.php
Post by: developGr on November 25, 2020, 02:56:13 PM
so what is the problem?
Title: Re: Diplay item.php image on the search.php
Post by: MB Themes on November 25, 2020, 03:33:12 PM
@developerGr
You will have to be able to investigate by yourself how to fix problems caused by your modifications.
Try to put following functions before img tag:
Code: [Select]
<?php osc_count_item_resources(); ?>
it may reload resources.
Title: Re: Diplay item.php image on the search.php
Post by: developGr on November 26, 2020, 06:41:25 AM
ok now the images are showing just fine the only prob its that for the users that has not any images yet the code that its loading for each one in the results its that:

<img src="https://domain.com/NEW/0_thumbnail."


how can i load the...oc-content/themes/careerjob/images/profile-64.png if the user has not yet uploaded any image at the listing?


what code i have now in "loop-single.php"

         <div class="front">
            <?php osc_count_item_resources(); ?>
          <img src="<?php echo osc_resource_thumbnail_url(); ?>" alt="<?php echo osc_esc_html(osc_item_title()); ?>"/>
         </div>
Title: Re: Diplay item.php image on the search.php
Post by: MB Themes on November 26, 2020, 09:46:07 AM
@developGr
Basically you change this:
Code: [Select]
<?php echo osc_resource_thumbnail_url(); ?>
into:
Code: [Select]
<?php echo (osc_count_item_resources() > osc_resource_thumbnail_url() : osc_base_url() . 'oc-content/themes/careerjob/images/profile-64.png'); ?>
Title: Re: Diplay item.php image on the search.php
Post by: developGr on November 26, 2020, 11:37:13 AM
Now it works!!