{php} $bannerRows = []; if (!empty($tplconfig['theme']['ad_slots']['banner1']['ad_data']) && is_array($tplconfig['theme']['ad_slots']['banner1']['ad_data'])) { foreach ($tplconfig['theme']['ad_slots']['banner1']['ad_data'] as $row) { if (!is_array($row)) { continue; } if (strtolower(trim((string)($row['active'] ?? 'off'))) !== 'on') { continue; } $expireAt = isset($row['date']) ? trim((string)$row['date']) : ''; if ($expireAt !== '') { $expireTs = strtotime($expireAt); if ($expireTs !== false && $expireTs < time()) { continue; } } if (empty($row['image']) || empty($row['url'])) { continue; } $bannerRows[] = $row; } } if (!empty($bannerRows)) { usort($bannerRows, function ($a, $b) { $oa = intval($a['order'] ?? 0); $ob = intval($b['order'] ?? 0); if ($oa === $ob) { return 0; } return $oa < $ob ? -1 : 1; }); } {/php} {if condition="($tplconfig['theme']['ads']['btn'] eq 1 || ($tplconfig['theme']['ads']['btn'] eq 2 && isset($user['group_id']) && $user['group_id'] lt 3))"} {if condition="!empty($bannerRows)"} {volist name="bannerRows" id="bannerOne"}
{if condition="!empty($bannerOne.height)"} {else/} {/if}
{/volist} {/if} {/if}