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/USER_GUIDE.md
# 📻 Radio System - Complete User Guide

**How to Use SoundStudioPro Radio Platform**

---

## 🚀 Quick Start (5 Minutes)

### Step 1: Run Database Migrations

**First, create all the database tables:**

1. **Create Radio Stations Table:**
   - Visit: `/migrations/add_radio_station_system.php`
   - Or run: `php migrations/add_radio_station_system.php`
   - ✅ Creates `radio_stations` and related tables

2. **Create Live Streaming Tables:**
   - Visit: `/radio/migrations/add_live_streaming_tables.php`
   - ✅ Creates live streaming tables

3. **Fix Call Sign Length:**
   - Visit: `/radio/migrations/fix_call_sign_length.php`
   - ✅ Updates call_sign column size

4. **Add Password System:**
   - Visit: `/radio/migrations/add_password_to_stations.php`
   - ✅ Adds password field

5. **Add Stream ID Column:**
   - Visit: `/radio/migrations/add_stream_id_to_stations.php`
   - ✅ Links stations to streams

**✅ All migrations complete? You're ready to go!**

---

## 👤 For Radio Stations

### **Registering a New Station**

1. **Go to Registration Page:**
   - Visit: `/radio/register.php`
   - Or: `https://soundstudiopro.com/radio/register.php`

2. **Fill Out the Form:**
   - **Station Name:** Your radio station name
   - **Call Sign:** Optional (e.g., "KISS-FM")
   - **Station Type:** Local, Regional, National, Internet, or Podcast
   - **License Tier:** Choose your subscription tier
     - **Local:** $99/month, 500 plays
     - **Regional:** $299/month, 2,000 plays
     - **National:** $999/month, unlimited plays
   - **Contact Info:** Name, email, phone
   - **Password:** Optional (auto-generated if left blank)
   - **Location:** City, state, country

3. **Submit:**
   - Click "Register"
   - You'll be redirected to subscription page
   - Complete payment to activate

4. **Get Your API Credentials:**
   - After registration, you'll receive:
     - **API Key:** For API authentication
     - **API Secret:** Keep this secure!
   - Save these - you'll need them for API calls

---

### **Logging In**

1. **Go to Login Page:**
   - Visit: `/radio/login.php`

2. **Enter Credentials:**
   - **Email:** Your station contact email
   - **Password:** Your password (or API secret if you haven't set one yet)

3. **Access Dashboard:**
   - After login, you'll see your station dashboard
   - URL: `/radio/dashboard/`

---

### **Using the Dashboard**

#### **Main Dashboard** (`/radio/dashboard/index.php`)

**What You Can See:**
- Station information
- Subscription status
- Play count (current month)
- Play limit remaining
- Quick stats

**What You Can Do:**
- View your station details
- Access live stream management
- View API credentials (if implemented)

---

#### **Live Stream Management** (`/radio/dashboard/live_stream.php`)

**Starting a Stream:**

1. **Click "Start Stream"**
2. **Enter Stream Details:**
   - Stream Name (e.g., "Morning Show")
   - Stream URL (optional - if you have external stream)
3. **Click "Start"**
4. ✅ Your stream is now live!

**Playing a Track:**

1. **Find a Track:**
   - Use the track browser/search
2. **Click "Play Now"**
   - Updates "Now Playing" display
   - Listeners see the track immediately

**Managing Queue:**

1. **View Queue:**
   - See upcoming tracks
   - See vote counts
2. **Add to Queue:**
   - Select tracks to queue
   - Tracks with more votes play first
3. **Remove from Queue:**
   - Click remove on unwanted tracks

**Stopping a Stream:**

1. **Click "Stop Stream"**
2. ✅ Stream goes offline
3. Listeners see "Offline" message

---

### **Using the API**

#### **Authentication**

All API requests require authentication:

```http
Authorization: Bearer YOUR_API_KEY:YOUR_API_SECRET
```

**Example:**
```http
Authorization: Bearer abc123def456:secret789xyz
```

#### **Available Endpoints**

**Catalog:**
```http
GET /radio/api/v1/catalog/tracks
GET /radio/api/v1/catalog/tracks/{id}
```

**Play Logging:**
```http
POST /radio/api/v1/plays
GET /radio/api/v1/plays
```

**Playlists:**
```http
GET /radio/api/v1/playlists
POST /radio/api/v1/playlists
GET /radio/api/v1/playlists/{id}/tracks
POST /radio/api/v1/playlists/{id}/tracks
```

**Live Streaming:**
```http
POST /radio/api/v1/stream/start
POST /radio/api/v1/stream/stop
POST /radio/api/v1/stream/now_playing
GET /radio/api/v1/stream/status
GET /radio/api/v1/stream/queue
```

**Analytics:**
```http
GET /radio/api/v1/analytics/overview
```

**Station Info:**
```http
GET /radio/api/v1/station
```

#### **Example API Call**

**Start a Stream:**
```bash
curl -X POST https://soundstudiopro.com/radio/api/v1/stream/start \
  -H "Authorization: Bearer YOUR_API_KEY:YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "stream_name": "My Live Stream",
    "stream_url": "https://stream.example.com/live"
  }'
```

**Update Now Playing:**
```bash
curl -X POST https://soundstudiopro.com/radio/api/v1/stream/now_playing \
  -H "Authorization: Bearer YOUR_API_KEY:YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "track_id": 123,
    "stream_id": 1
  }'
```

**Log a Play:**
```bash
curl -X POST https://soundstudiopro.com/radio/api/v1/plays \
  -H "Authorization: Bearer YOUR_API_KEY:YOUR_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "track_id": 123,
    "played_at": "2025-12-02 10:30:00",
    "duration_played": 180
  }'
```

---

## 🎧 For Listeners

### **Listening to Live Radio**

1. **Go to Live Player:**
   - Visit: `/radio/live.php`
   - Or: `https://soundstudiopro.com/radio/live.php`

2. **Select a Station:**
   - If multiple stations are live, choose one
   - Or visit: `/radio/live.php?station=STATION_ID`

3. **What You See:**
   - **Now Playing:** Current track and artist
   - **Listener Count:** How many people are listening
   - **Upcoming Tracks:** Queue of next songs
   - **Vote Counts:** How many votes each track has

4. **Voting for Tracks:**
   - Click "Vote" on any track in the queue
   - Tracks with more votes play sooner
   - You can only vote once per track per hour

5. **Real-Time Updates:**
   - Page automatically updates
   - New tracks appear as they're played
   - Listener count updates live

---

## 👨‍💼 For Admins

### **Accessing Admin Panel**

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

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

### **What You Can Do**

**View All Streams:**
- See all active and inactive streams
- View station information
- See listener counts
- See vote counts

**Manage Streams:**
- **Start:** Activate an offline stream
- **Stop:** Deactivate a live stream
- **View:** See the public player
- **Clear Votes:** Reset vote counts
- **Delete:** Remove a stream permanently

**View Statistics:**
- Total streams
- Active streams
- Current listeners
- Total votes
- Active stations

**Quick Links:**
- View Live Player
- Radio Homepage
- Run Migrations

---

## 📊 Understanding Play Limits

### **How Play Limits Work**

**Local Tier ($99/month):**
- 500 plays per month
- System blocks plays when limit reached
- Resets at start of billing cycle

**Regional Tier ($299/month):**
- 2,000 plays per month
- System blocks plays when limit reached
- Resets at start of billing cycle

**National Tier ($999/month):**
- Unlimited plays
- No restrictions

**Enterprise Tier:**
- Custom limits
- Usually unlimited

### **Checking Your Play Count**

**In Dashboard:**
- See "Current Month Plays" / "Monthly Play Limit"
- Example: "250 / 500 plays used"

**Via API:**
```http
GET /radio/api/v1/station
```

Response includes:
```json
{
  "current_month_plays": 250,
  "monthly_play_limit": 500,
  "plays_remaining": 250
}
```

---

## 🔐 Security Best Practices

### **For Stations:**

1. **Keep API Credentials Secure:**
   - Don't share API key/secret
   - Don't commit to version control
   - Rotate if compromised

2. **Use Strong Passwords:**
   - Minimum 8 characters
   - Mix of letters, numbers, symbols
   - Change regularly

3. **Monitor API Usage:**
   - Check play counts regularly
   - Watch for unusual activity
   - Report suspicious activity

### **For Admins:**

1. **Regular Monitoring:**
   - Check active streams
   - Monitor listener counts
   - Review vote patterns

2. **Security:**
   - Keep admin credentials secure
   - Use strong passwords
   - Monitor for abuse

---

## 🐛 Troubleshooting

### **"Database tables don't exist"**
- **Solution:** Run migrations (see Quick Start)

### **"Can't login"**
- **Check:** Email and password are correct
- **Try:** Using API secret as password (if you haven't set password)
- **Reset:** Contact admin to reset password

### **"Play limit reached"**
- **Check:** Your subscription tier
- **Upgrade:** To higher tier for more plays
- **Wait:** Until next billing cycle

### **"Stream won't start"**
- **Check:** Subscription is active
- **Check:** You're logged in
- **Check:** Database connection

### **"Vote not working"**
- **Check:** Stream is live
- **Check:** You haven't voted in last hour
- **Check:** Track exists and is enabled

### **"API authentication failed"**
- **Check:** API key and secret are correct
- **Check:** Subscription is active
- **Check:** Play limit not reached

---

## 📞 Getting Help

### **Documentation:**
- `/radio/HOW_IT_WORKS.md` - Technical details
- `/radio/BUSINESS_MODEL_INTEGRATION.md` - Business model
- `/radio/SYSTEM_AUDIT.md` - System audit
- `/radio/FIXES_APPLIED.md` - Recent fixes

### **Support:**
- Contact your account manager
- Email: support@soundstudiopro.com
- Check admin panel for system status

---

## ✅ Quick Reference

### **URLs:**

| Page | URL |
|------|-----|
| Station Registration | `/radio/register.php` |
| Station Login | `/radio/login.php` |
| Station Dashboard | `/radio/dashboard/` |
| Live Stream Management | `/radio/dashboard/live_stream.php` |
| Public Live Player | `/radio/live.php` |
| Admin Panel | `/admin.php?tab=radio-live` |
| API Base | `/radio/api/v1/` |

### **Key Functions:**

| Function | Purpose |
|----------|---------|
| `logRadioPlay()` | Log a track play |
| `authenticateRadioAPI()` | Authenticate API request |
| `getRadioStation()` | Get station info |
| `generateAPICredentials()` | Create API keys |

### **Database Tables:**

| Table | Purpose |
|-------|---------|
| `radio_stations` | Station accounts |
| `radio_streams` | Live streams |
| `radio_now_playing` | Current track |
| `radio_votes` | Listener votes |
| `radio_listeners` | Active listeners |
| `radio_stream_queue` | Upcoming tracks |
| `radio_play_logs` | Play history |

---

## 🎯 Next Steps

1. ✅ Run all migrations
2. ✅ Register your first station
3. ✅ Start a live stream
4. ✅ Test the public player
5. ✅ Integrate with your broadcast software
6. ✅ Monitor usage and analytics

---

**You're all set! Start broadcasting! 🎉**


CasperSecurity Mini