Auto commit: 2026-02-19T19:49:57.800Z

This commit is contained in:
Flatlogic Bot 2026-02-19 19:49:57 +00:00
parent c9509afe45
commit c3d9e7fcf2
4 changed files with 29 additions and 6 deletions

View File

@ -46,12 +46,13 @@ if ($method === 'GET') {
");
$topRequester = $topStmt->fetchColumn();
$stmt = db()->prepare("SELECT m.*, f.points, f.is_fan_of_month FROM messages m LEFT JOIN fans f ON m.username = f.name ORDER BY m.created_at DESC LIMIT 50");
$stmt = db()->prepare("SELECT m.*, f.points, f.loyalty_points, f.is_fan_of_month FROM messages m LEFT JOIN fans f ON m.username = f.name ORDER BY m.created_at DESC LIMIT 50");
$stmt->execute();
$messages = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach ($messages as &$msg) {
$points = $msg['points'] ?? 0;
$loyalty = $msg['loyalty_points'] ?? 0;
$msg['level_color'] = '#94a3b8';
$msg['level_emoji'] = '';
@ -62,6 +63,10 @@ if ($method === 'GET') {
$msg['level_color'] = '#facc15';
$msg['level_emoji'] = '👑';
$msg['is_top_listener'] = true;
} elseif ($loyalty > 0) {
$msg['level_color'] = '#00e676'; // Neon Green for Loyalty
$msg['level_emoji'] = $loyalty >= 500 ? '🎖️' : '🏅';
$msg['is_loyal'] = true;
} elseif ($msg['is_fan_of_month']) {
$msg['level_color'] = '#facc15';
} elseif ($points >= 2500) {

View File

@ -12,6 +12,7 @@ $stmt = $db->prepare("
v.country_code,
v.last_activity,
f.points,
f.loyalty_points,
f.is_fan_of_month
FROM visitor_logs v
LEFT JOIN fans f ON v.username = f.name

View File

@ -15,6 +15,16 @@ try {
$stmt = $pdo->prepare("UPDATE dj_tips SET thanked_at = NOW() WHERE id = ?");
$stmt->execute([$tipId]);
// Award loyalty points to the sender
$stmt = $pdo->prepare("SELECT sender_name FROM dj_tips WHERE id = ?");
$stmt->execute([$tipId]);
$sender = $stmt->fetchColumn();
if ($sender) {
$stmt = $pdo->prepare("UPDATE fans SET loyalty_points = loyalty_points + 50 WHERE name = ?");
$stmt->execute([$sender]);
}
echo json_encode([
"success" => true,
"message" => "¡Has agradecido la donación!"

View File

@ -2603,12 +2603,13 @@ $twitter_link = "https://twitter.com/";
const isVeryActive = (new Date() - new Date(user.last_activity)) < 60000;
const flagUrl = user.country_code ? `https://flagcdn.com/w20/${user.country_code.toLowerCase()}.png` : null;
const isTopFan = user.points > 10 || user.is_fan_of_month == 1;
const userColor = getUserColor(user.username);
const isLoyal = user.loyalty_points > 0;
const userColor = isLoyal ? "#00e676" : getUserColor(user.username);
return `
<div style="display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.03); padding: 10px 15px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); transition: all 0.3s; position: relative;">
<div style="display: flex; align-items: center; justify-content: space-between; background: rgba(255,255,255,0.03); padding: 10px 15px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.05); transition: all 0.3s; position: relative; ${isLoyal ? "box-shadow: 0 0 10px rgba(0, 230, 118, 0.1);" : ""}">
<div style="display: flex; align-items: center; gap: 10px;">
<div style="width: 38px; height: 38px; background: ${userColor}; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); position: relative; ${isVeryActive ? `box-shadow: 0 0 0 2px rgba(255,255,255,0.1), 0 0 12px ${userColor};` : ''}">
<div style="width: 38px; height: 38px; background: ${userColor}; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.3); position: relative; ${isVeryActive ? `box-shadow: 0 0 0 2px rgba(255,255,255,0.1), 0 0 12px ${userColor};` : ''} ${isLoyal ? "animation: pulse 2s infinite;" : ""}">
${user.username.charAt(0).toUpperCase()}
${isVeryActive ? '<span style="position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; background: #25D366; border: 2px solid #000; border-radius: 50%;"></span>' : ''}
</div>
@ -2616,7 +2617,8 @@ $twitter_link = "https://twitter.com/";
<div style="font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 6px;">
${user.username}
${flagUrl ? `<img src="${flagUrl}" style="width: 16px; height: auto; border-radius: 2px; vertical-align: middle;" title="${user.country_code}">` : ''}
${isTopFan ? `<span style="background: #FFD700; color: #000; font-size: 0.6rem; padding: 2px 6px; border-radius: 10px; font-weight: 800; text-transform: uppercase;">TOP</span>` : ''}
${isLoyal ? `<span style="background: #00e676; color: white; font-size: 0.55rem; padding: 2px 6px; border-radius: 10px; font-weight: 800; text-transform: uppercase;"><i class="bi bi-shield-fill-check"></i> LEAL</span>` : ""}
${isTopFan && !isLoyal ? `<span style="background: #FFD700; color: #000; font-size: 0.6rem; padding: 2px 6px; border-radius: 10px; font-weight: 800; text-transform: uppercase;">TOP</span>` : ''}
</div>
<div style="font-size: 0.7rem; opacity: 0.6;">
<i class="bi bi-clock"></i> ${timeAgo(user.last_activity)}
@ -2836,8 +2838,13 @@ $twitter_link = "https://twitter.com/";
}
// Si el color es el gris por defecto (#94a3b8) o no tiene, usamos el color dinámico por nombre
const nameColor = (msg.level_color && msg.level_color !== '#94a3b8') ? msg.level_color : getUserColor(msg.username);
let nameColor = (msg.level_color && msg.level_color !== '#94a3b8') ? msg.level_color : getUserColor(msg.username);
const levelEmoji = msg.level_emoji || '';
if (msg.is_loyal) {
div.style.borderLeft = "4px solid #00e676";
div.style.background = "rgba(0, 230, 118, 0.05)";
}
if (isLike) {
div.style.background = isMe ? 'rgba(255, 68, 68, 0.25)' : 'rgba(255, 68, 68, 0.15)';