| Re: Overload the images on the search.php page |
| by alain01 on 2021/10/21 7:37:51 Ok, so much the better, this solution was my preference. Thank you for this information on good practices |
| Re: Overload the images on the search.php page |
| by Mamba on 2021/10/21 7:33:00 Always choose readability!!! Or you will come back few months later and will waste a lot of time trying to understand what you've written!
|
| Re: Overload the images on the search.php page |
| by alain01 on 2021/10/21 6:58:45 Ok, So, last question The result is same but I want to know if a solution is better: Readable test: le="color: #000000"><?php <{if file_exists($path_image_full_overloaded)}> <div class="d-inline"><img src="<{$url_image_overloaded}>" title="<{$data.image_title}>" alt="<{$data.image_title}>"/> <a href="<{$data.link}>"><{$data.link_title}></a></div> <{else}> <div class="d-inline"><img src="<{$data.image_link}>" title="<{$data.image_title}>" alt="<{$data.image_title}>"/> <a href="<{$data.link}>"><{$data.link_title}></a></div> <{/if}> or Condensed test : le="color: #000000"><?php <div class="d-inline"> <img src=<{if file_exists($path_image_full_overloaded)}>"<{$url_image_overloaded}>"<{else}>"<{$data.image_link}>"<{/if}> title="<{$data.image_title}>" alt="<{$data.image_title}>"/> <a href="<{$data.link}>"><{$data.link_title}></a> </div>
|
| Re: Overload the images on the search.php page |
| by Mamba on 2021/10/21 1:24:42 Congratulations!!! I glad to hear that it all worked out for you!!!
|
| Re: Overload the images on the search.php page |
| by alain01 on 2021/10/21 0:38:56 Yesssssssssssssssssssss § I found it ! Thank you zyspec for your explanation and Mamba for your examples and links. I found a solution with paramaters, no hard coded. It was hard for me but it works. Code : le="color: #000000"><?php <{foreach item=data from=$search.module_data}> <{assign var="url_image_overloaded" value=$xoops_imageurl|cat:$data.image_link}> <{assign var="path_image_begin_overloaded" value=$xoops_rootpath|cat:"/themes/"|cat:$xoops_theme}> <{assign var="path_image_full_overloaded" value=$path_image_begin_overloaded|cat:"/"|cat:$data.image_link}> <{if file_exists($path_image_full_overloaded)}> <img src="<{$url_image_overloaded}>" alt="<{$data.image_title}>"/ title="<{$data.image_title}>"> <a href="<{$data.link}>"><{$data.link_title}></a> <{else}> <img src="<{$data.image_link}>" title="<{$data.image_title}>" alt="<{$data.image_title}>"/> <a href="<{$data.link}>"><{$data.link_title}></a> <{/if}> <br /> <{/foreach}>
|