Buy Robux
Featured Items on ROBLOX
query('SELECT * FROM assets WHERE AssetType != 9 AND isPrivate != 1 ORDER BY AssetID, Sales DESC LIMIT 22')->fetchAll();
function timeAgo($timestamp) {
$time = time() - $timestamp;
$units = [
31536000 => 'year',
2592000 => 'month',
604800 => 'week',
86400 => 'day',
3600 => 'hour',
60 => 'minute',
1 => 'second'
];
foreach ($units as $unitSeconds => $unitName) {
if ($time >= $unitSeconds) {
$numUnits = floor($time / $unitSeconds);
return $numUnits . ' ' . $unitName . ($numUnits > 1 ? 's' : '') . ' ago';
}
}
return 'Just now';
}
foreach ($stmt as $asset) {
$id = htmlspecialchars($asset['AssetID']);
$name = htmlspecialchars($asset['Name']);
$price = $asset['RobuxPrice'];
$creatorID = htmlspecialchars($asset['CreatorID']);
$sales = number_format($asset['Sales']);
$favorited = number_format($asset['Favorites']);
$updated = htmlspecialchars(timeAgo($asset['Updated_At'])); // Format this as needed
$stmt = $pdo->prepare('SELECT * FROM users where UserId = :uid');
$stmt->execute(['uid' => $asset['CreatorID']]);
$user = $stmt->fetch(PDO::FETCH_ASSOC);
$created_by = $user['Username'];
// Generate a URL-friendly version of the name
$urlName = urlencode(str_replace(' ', '-', $name));
$link = "/$urlName-item?id=$id";
$price_to_display = "
$price
";
if($price == 0){
$price_to_display = '
Free';
}elseif($asset['TixPrice'] > 0 && $price == 0){
$price_to_display = "
$price
";
}
if ($passedamount < 4) {
// Big featured items
echo "
Updated: $updated
Sales: $sales
Favorited: $favorited times
";
} else {
// Small catalog items
echo "
Updated: $updated
Sales: $sales
Favorited: $favorited times
";
}
$passedamount++;
if ($passedamount == 4) {
echo '
';
}
}
?>