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/public_html/radio/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/domains/soundstudiopro.com/public_html/radio/ADMIN_GUIDE.md
# Admin Guide: Managing Live Radio

## 🎯 Accessing the Admin Panel

1. **Login as Admin:**
   - Go to `/admin.php`
   - Must have `is_admin = 1` in users table

2. **Navigate to Live Radio:**
   - Select "📻 Live Radio Management" from the dropdown menu
   - Or go directly to: `/admin.php?tab=radio-live`

---

## 📊 What You Can Manage

### **1. View All Streams**
- See all radio streams (active and inactive)
- View station name, call sign, status
- See current listener count
- See total votes per stream
- View when stream started

### **2. Stream Controls**

#### **Start/Stop Streams**
- **Start:** Activate an offline stream
- **Stop:** Deactivate a live stream
- Useful for moderation or maintenance

#### **View Live Player**
- Click "View" button to see the public-facing player
- Opens in new tab
- See what listeners see

#### **Clear Votes**
- Remove all votes for a stream
- Useful if votes are spam or need reset
- Doesn't affect queue, just vote counts

#### **Delete Stream**
- Permanently remove a stream
- ⚠️ **Warning:** This cannot be undone
- Use with caution

---

## 📈 Dashboard Stats

The admin panel shows:

- **Total Streams:** All streams ever created
- **Active Streams:** Currently live streams
- **Current Listeners:** Total listeners across all streams
- **Total Votes:** All votes ever cast
- **Active Stations:** Stations with active subscriptions

---

## 🔧 Common Admin Tasks

### **Task 1: Stop a Problematic Stream**
1. Find the stream in the table
2. Click "Stop" button
3. Confirm the action
4. Stream goes offline immediately

### **Task 2: Restart a Stream**
1. Find the offline stream
2. Click "Start" button
3. Stream becomes live again

### **Task 3: Moderate Votes**
1. If votes seem suspicious/spam
2. Click "Clear Votes" for that stream
3. Vote counts reset to 0
4. Listeners can vote again

### **Task 4: View Stream Activity**
1. Click "View" button
2. Opens live player in new tab
3. See current track, listeners, votes
4. Test the listener experience

### **Task 5: Clean Up Old Streams**
1. Find streams that are no longer needed
2. Click "Delete" button
3. Confirm deletion
4. Stream and all related data removed

---

## 🛡️ Admin Permissions

**What Admins Can Do:**
- ✅ View all streams
- ✅ Start/stop any stream
- ✅ Delete streams
- ✅ Clear votes
- ✅ View live players
- ✅ See all statistics

**What Admins Cannot Do:**
- ❌ Create streams (stations do this)
- ❌ Play tracks (stations control this)
- ❌ Modify station settings (stations manage their own)

**Why:** Admins moderate and oversee, but stations control their own content.

---

## 📋 Stream Information Displayed

For each stream, you see:

| Column | Description |
|--------|-------------|
| **Station** | Station name and call sign |
| **Stream Name** | Name of the stream |
| **Status** | 🔴 LIVE or ⚫ OFFLINE |
| **Listeners** | Current active listeners |
| **Votes** | Total votes cast |
| **Started** | When stream was last started |
| **Actions** | Control buttons |

---

## 🚨 Troubleshooting

### **Problem: Stream won't start**
- Check if station subscription is active
- Verify stream exists in database
- Check for database errors

### **Problem: No streams showing**
- Run migration: `/radio/migrations/add_live_streaming_tables.php`
- Check if stations have created streams
- Verify database connection

### **Problem: Listeners not counting**
- Check `radio_listeners` table
- Verify SSE endpoint is working
- Check for JavaScript errors in browser console

### **Problem: Votes not working**
- Check `radio_votes` table
- Verify vote endpoint: `/radio/api/live/vote.php`
- Check for duplicate vote prevention

---

## 🔍 Advanced: Database Queries

If you need to check things manually:

```sql
-- See all active streams
SELECT * FROM radio_streams WHERE is_live = 1;

-- See current listeners
SELECT * FROM radio_listeners WHERE disconnected_at IS NULL;

-- See recent votes
SELECT * FROM radio_votes ORDER BY voted_at DESC LIMIT 50;

-- See now playing
SELECT * FROM radio_now_playing WHERE ended_at IS NULL;

-- See queue
SELECT * FROM radio_stream_queue WHERE played_at IS NULL ORDER BY vote_count DESC;
```

---

## 📊 Monitoring Best Practices

### **Daily Checks:**
- Review active streams
- Check listener counts
- Monitor for unusual activity

### **Weekly Reviews:**
- Analyze stream statistics
- Review vote patterns
- Check for abandoned streams

### **Monthly Analysis:**
- Total streams created
- Peak listener counts
- Most voted tracks
- Station engagement

---

## 🎯 Quick Actions Reference

| Action | Button | Location |
|--------|--------|----------|
| Start Stream | "Start" (green) | Actions column |
| Stop Stream | "Stop" (red) | Actions column |
| View Player | "View" (gray) | Actions column |
| Clear Votes | "Clear Votes" (gray) | Actions column |
| Delete Stream | "Delete" (red) | Actions column |

---

## 🔗 Related Admin Pages

- **Stations:** Manage radio stations (if you have station management)
- **Users:** Manage user accounts
- **Tracks:** Manage music tracks
- **Analytics:** View platform analytics

---

## 💡 Pro Tips

1. **Monitor Peak Times:** Check listener counts during peak hours
2. **Vote Patterns:** Watch for unusual voting (potential spam)
3. **Stream Health:** Regularly check active streams are actually playing
4. **Clean Up:** Delete old/inactive streams to keep table clean
5. **Test Experience:** Use "View" to see what listeners see

---

## 🆘 Need Help?

- **Database Issues:** Check error logs
- **Stream Not Working:** Verify station subscription
- **Missing Features:** Check if migration ran successfully
- **Performance:** Monitor database query times

---

## ✅ Summary

As admin, you can:
- ✅ Monitor all live streams
- ✅ Start/stop streams for moderation
- ✅ View real-time statistics
- ✅ Manage votes and clean up data
- ✅ Delete unwanted streams

**Access:** `/admin.php?tab=radio-live`

The admin panel gives you full oversight and control over the live radio system! 🎉


CasperSecurity Mini