id, $id)) { WebContextManager::Redirect("/catalog/view?id=". $id . ""); } } catch (Exception $e) { $alert = ""; } } // ... //Query $q = $pdo->prepare("SELECT * FROM assets WHERE id = :i"); $q->bindParam(":i", $id, PDO::PARAM_INT); $q->execute(); if($q->rowCount() > 0) { $i = $q->fetch(PDO::FETCH_OBJ); $sales = itemSalesCount($id); $itemrender = getAssetRender($id); $ownerrender = getPlayerRender($i->CreatorId); $itemtypeint = $i->AssetTypeId; $approved = $i->IsApproved; $description = ''; //handle item descriptions if (empty($i->Description)) { $description = 'No description available.'; //default description if none is set } else { $description = cleanOutput($i->Description); } // ... //proper named category $types = assetTypeArray(); //so we can show the item type and view the proper image $itemtype = $types[$i->AssetTypeId]; // ... //redirect if a game if ($i->AssetTypeId == 9) { WebContextManager::Redirect("/games/view?id=" . $id); } // ... $buy_button = ""; $confirmbuy_button = ""; if (User::OwnsAsset($user->id, $id)) { //already owns the hat $buy_button = ''; $confirmbuy_button = ''; // ... } else { if ($i->IsForSale == 0 || isAssetModerated($id)) { //offsale $buy_button = ''; $confirmbuy_button = ''; // ... } else { $price = 0; if ($i->PriceInAlphabux == 0) { $ButtonText = ""; $src = ""; if ($i->AssetTypeId == 10) //models { $ButtonText = "Take"; } else { $ButtonText = "FREE!"; $src = getCurrentThemeAlphabuxLogo(); } $buy_button = ''; $confirmbuy_button = ''; // ... } else { //aw, its paid $buy_button = ''; $confirmbuy_button = ''; // ... } } } //only allow shirts, pants and t shirts to be modified by the end user (admins can regardless) $configbutton_html = ""; if ($itemtypeint == 2 or $itemtypeint == 11 or $itemtypeint == 12 or $user->IsAdmin()) { if (isOwner($id) && !isAssetModerated($id)) //owner of the item or admin { $configbutton_html = << Configure EOT; } } // ... $body = '
'.$alert.'
'.cleanOutput($i->Name).'
'.$configbutton_html.'
'. ($itemtypeint == 3 && $approved ? '
Item Description

'.$description.'


Item Stats
Sales:

'.$sales.'

Created:

'.date("m/d/Y", $i->Created).'

Item Type:

'.$itemtype.'


'.$buy_button.'
'; } else { //item doesnt exist WebContextManager::Redirect("/404"); } } else { //no url parameter WebContextManager::Redirect("/"); } pageHandler(); $ph->pageTitle(cleanOutput($i->Name)); $ph->body = $body; $ph->output();