add img orig helper

This commit is contained in:
Name
2022-08-23 10:21:45 +03:00
parent afffd9e13f
commit 26e97c04e6
2 changed files with 21 additions and 1 deletions

View File

@@ -17,4 +17,23 @@ function picbook($item, $width, $height) {
return IMGSRV.'price/'.$width.'x'.$height.'/'.$fileimg; return IMGSRV.'price/'.$width.'x'.$height.'/'.$fileimg;
}
function picbook_orig($item){
$id = $item['price_id'];
$img = $item['priceimg'];
if (in_array($img, array('jpg', 'jpeg', 'gif', 'png', 'JPG'))){
$fileimg = $id . '.' . $img;
}
else
$fileimg = $img;
return 'https://argumenti.ru/pub/images/price/'.$fileimg;
} }

View File

@@ -13,7 +13,8 @@
<?$link = SITE.'product/'.$book['priceslug']?> <?$link = SITE.'product/'.$book['priceslug']?>
<a href="<?=$link?>" target="_blank"> <a href="<?=$link?>" target="_blank">
<!--<img src="<?//=picbook($book, 180, 280)?>" alt="<?//=$book['pricename']?>">--> <!--<img src="<?//=picbook($book, 180, 280)?>" alt="<?//=$book['pricename']?>">-->
<img src="https://argumenti.ru/pub/images/price/<?=$book['priceimg']?>" alt="<?=$book['pricename']?>"> <img src="<?=picbook_orig($book)?>" alt="<?=$book['pricename']?>">
<!--<img src="https://argumenti.ru/pub/images/price/<?=$book['priceimg']?>" alt="<?=$book['pricename']?>">-->
</a> </a>
<?if ($book['priceauthor_id'] > 0):?> <?if ($book['priceauthor_id'] > 0):?>