This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

developGr

  • ***
  • 39 posts
Diplay item.php image on the search.php
« 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

*

MB Themes

Re: Diplay item.php image on the search.php
« Reply #1 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.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

developGr

  • ***
  • 39 posts
Re: Diplay item.php image on the search.php
« Reply #2 on: November 25, 2020, 01:30:42 PM »
when i make those steps i am getting that:

*

developGr

  • ***
  • 39 posts
Re: Diplay item.php image on the search.php
« Reply #3 on: November 25, 2020, 01:32:12 PM »
and

*

MB Themes

Re: Diplay item.php image on the search.php
« Reply #4 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.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

developGr

  • ***
  • 39 posts
Re: Diplay item.php image on the search.php
« Reply #5 on: November 25, 2020, 02:56:13 PM »
so what is the problem?

*

MB Themes

Re: Diplay item.php image on the search.php
« Reply #6 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.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

developGr

  • ***
  • 39 posts
Re: Diplay item.php image on the search.php
« Reply #7 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>
« Last Edit: November 26, 2020, 07:52:32 AM by developGr »

Marked as best answer by frosticek on November 26, 2020, 12:45:15 PM
*

MB Themes

Re: Diplay item.php image on the search.php
« Reply #8 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'); ?>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

developGr

  • ***
  • 39 posts
Re: Diplay item.php image on the search.php
« Reply #9 on: November 26, 2020, 11:37:13 AM »
Now it works!!