Refactor ad description handling for improved compatibility and readability in ad_recommendation.php
This commit is contained in:
parent
b441f6ae37
commit
da1210cfce
@ -166,7 +166,11 @@ if ($stmt && $stmt->num_rows > 0) {
|
|||||||
<div class="ad-recommendation__content">
|
<div class="ad-recommendation__content">
|
||||||
<span class="ad-recommendation__badge">Empfehlung des Tages</span>
|
<span class="ad-recommendation__badge">Empfehlung des Tages</span>
|
||||||
<h2><?= $rModel ?></h2>
|
<h2><?= $rModel ?></h2>
|
||||||
<p><?= (mb_strlen($rDesc) > 120) ? mb_substr($rDesc, 0, 120) . '...' : $rDesc ?></p>
|
<?php
|
||||||
|
$descLen = function_exists('mb_strlen') ? mb_strlen($rDesc) : strlen($rDesc);
|
||||||
|
$descShort = $descLen > 120 ? (function_exists('mb_substr') ? mb_substr($rDesc, 0, 120) : substr($rDesc, 0, 120)) . '...' : $rDesc;
|
||||||
|
?>
|
||||||
|
<p><?= $descShort ?></p>
|
||||||
<a href="productpage.php?id=<?= $rID ?>" class="ad-recommendation__btn">Jetzt ansehen ›</a>
|
<a href="productpage.php?id=<?= $rID ?>" class="ad-recommendation__btn">Jetzt ansehen ›</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="ad-recommendation__image-wrapper">
|
<div class="ad-recommendation__image-wrapper">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user