htmlspecialchars((string)$v, ENT_QUOTES, 'UTF-8'); $shopSession = ''; if (($loggedin ?? false) === true) { $shopSession = bin2hex(random_bytes(32)); $_SESSION['shop_session'] = $shopSession; } if (empty($shop['enabled'])) { echo '

' . t('buypoints.disabled') . '

' . t('buypoints.disabled_text') . '

'; return; } $outfitFallbackIds = array(136,137,138,139,140,141,142,147,148,149,150,155,156,157,158,252,269,270,279,288,324,336,366,431,433,464,466,471,513,514,542,128,129,130,131,132,133,134,143,144,145,146,151,152,153,154,251,268,273,278,289,325,335,367,430,432,463,465,472,512,516,541); $shopCategories = array( 'outfits' => array('label' => t('shop.cat_outfits'), 'items' => array()), 'mounts' => array('label' => t('shop.cat_mounts'), 'items' => array()), 'items' => array('label' => t('shop.cat_items'), 'items' => array()), 'premium' => array('label' => t('shop.cat_premium'), 'items' => array()), 'misc' => array('label' => t('shop.cat_misc'), 'items' => array()), ); foreach ((array)$shop_list as $offerId => $offer) { switch ((int)($offer['type'] ?? 0)) { case 1: $shopCategories['items']['items'][$offerId] = $offer; break; case 2: $shopCategories['premium']['items'][$offerId] = $offer; break; case 5: $shopCategories['outfits']['items'][$offerId] = $offer; break; case 6: $shopCategories['mounts']['items'][$offerId] = $offer; break; default: $shopCategories['misc']['items'][$offerId] = $offer; break; } } $visibleCategories = array_filter($shopCategories, static fn($category): bool => !empty($category['items'])); $firstCategory = true; $renderImage = static function (array $offer, string $category) use ($config, $outfitFallbackIds, $znxShopH): string { $type = (int)($offer['type'] ?? 0); $itemId = $offer['itemid'] ?? 0; $count = (int)($offer['count'] ?? 0); if ($category === 'outfits' && !empty($config['show_outfits']['shop'])) { $ids = is_array($itemId) ? array_values($itemId) : array($itemId); $html = ''; foreach (array_slice($ids, 0, 2) as $id) { $html .= ''; } return $html; } if ($category === 'mounts' && !empty($config['show_outfits']['shop'])) { $outfitId = $outfitFallbackIds[array_rand($outfitFallbackIds)]; return ''; } if (!empty($config['shop']['showImage']) && (int)$itemId > 0 && $type !== 3 && $type !== 4) { return ''; } $icon = $type === 2 ? 'VIP' : ($type === 3 ? 'SEX' : ($type === 4 ? 'NAME' : 'ITEM')); return ''; }; $offerMeta = static function (array $offer, string $category) use ($znxShopH): string { $count = (int)($offer['count'] ?? 0); if ($category === 'premium') return $znxShopH(t('shop.days', array('count' => $count))); if ($category === 'items' && $count > 1) return $count . 'x'; if ($category === 'misc') return $count === 0 ? t('common.unlimited') : $count . 'x'; if ($category === 'outfits' && $count > 0) return 'Addons ' . $count; return ''; }; ?>

.

: 0

$category): ?>
$offer): ?>