Файловый менеджер - Редактировать - /home/gqdcvggs/.trash/index.php.1
Назад
<?php require_once 'config.php'; $modelsQuery = $pdo->query(" SELECT u.id, u.username, u.avatar_url, COUNT(DISTINCT c.id) as video_count, SUM(CASE WHEN i.type = 'view' THEN 1 ELSE 0 END) as total_views, SUM(CASE WHEN i.type = 'like' THEN 1 ELSE 0 END) as total_likes FROM users u LEFT JOIN content c ON u.id = c.author_id LEFT JOIN interactions i ON c.id = i.content_id GROUP BY u.id ORDER BY total_views DESC LIMIT 10 "); $models = $modelsQuery->fetchAll(PDO::FETCH_ASSOC); $search = isset($_GET['search']) ? trim($_GET['search']) : ''; $whereClause = ''; $params = []; if($search) { $whereClause = "WHERE c.name LIKE ? OR c.description LIKE ? OR c.tags LIKE ? OR u.username LIKE ?"; $searchTerm = "%$search%"; $params = [$searchTerm, $searchTerm, $searchTerm, $searchTerm]; } $videoQuery = $pdo->prepare(" SELECT c.*, u.username as author_name, u.avatar_url as author_avatar, COUNT(DISTINCT CASE WHEN i.type = 'view' THEN i.id END) as view_count, COUNT(DISTINCT CASE WHEN i.type = 'like' THEN i.id END) as like_count, COUNT(DISTINCT CASE WHEN i.type = 'dislike' THEN i.id END) as dislike_count, COUNT(DISTINCT CASE WHEN i.type = 'comment' THEN i.id END) as comment_count, MAX(CASE WHEN i.user_id = ? AND i.type IN ('like', 'dislike') THEN i.type ELSE NULL END) as user_interaction FROM content c LEFT JOIN users u ON c.author_id = u.id LEFT JOIN interactions i ON c.id = i.content_id $whereClause GROUP BY c.id ORDER BY c.created_at DESC "); array_unshift($params, $_SESSION['user_id'] ?? null); $videoQuery->execute($params); $videos = $videoQuery->fetchAll(PDO::FETCH_ASSOC); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>ForMore</title> <script src="https://cdn.tailwindcss.com"></script> <link href="https://fonts.googleapis.com/css2?family=Titillium+Web:wght@200;300;400;600;700;900&display=swap" rel="stylesheet"> <style> body { font-family: 'Titillium Web', sans-serif; } .formore { font-weight: 900; background: linear-gradient(to right, #3b82f6, #1d4ed8); -webkit-background-clip: text; -webkit-text-fill-color: transparent; } .video-card { opacity: 0; transform: translateY(20px); animation: fadeInUp 0.6s ease forwards; } @keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } } .menu { transition: transform 0.3s ease-in-out; } .menu.active { transform: translateX(0); } @media (max-width: 768px) { .menu { transform: translateX(100%); } } .hamburger span { transition: all 0.3s ease-in-out; } .hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); } .hamburger.active span:nth-child(2) { opacity: 0; } .hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); } .models-section { transition: all 0.3s ease-in-out; } .models-section.expanded { max-height: 1000px; } .models-section.collapsed { max-height: 0; overflow: hidden; } </style> </head> <body class="bg-black bg-gradient-to-br from-black to-blue-900 min-h-screen text-white"> <header class="fixed top-0 left-0 right-0 bg-black/50 backdrop-blur-sm z-40"> <div class="max-w-7xl mx-auto px-4 py-4"> <nav class="flex justify-between items-center"> <a href="index.php" class="text-4xl formore z-50">ForMore</a> <button class="hamburger lg:hidden flex flex-col gap-1.5 z-50" onclick="toggleMenu()"> <span class="block w-8 h-0.5 bg-white"></span> <span class="block w-8 h-0.5 bg-white"></span> <span class="block w-8 h-0.5 bg-white"></span> </button> <div class="menu fixed lg:relative top-0 right-0 h-screen lg:h-auto w-3/4 lg:w-auto bg-black/90 lg:bg-transparent backdrop-blur-sm lg:backdrop-blur-none flex flex-col lg:flex-row items-center justify-center lg:justify-end gap-8 lg:gap-6 lg:translate-x-0"> <?php if(isset($_SESSION['user_id'])): ?> <a href="profile.php" class="text-gray-300 hover:text-white transition-colors"> <?= htmlspecialchars($_SESSION['username']) ?> </a> <a href="upload.php" class="bg-blue-600 hover:bg-blue-700 px-6 py-2 rounded-xl transition-all">Upload</a> <a href="logout.php" class="text-red-400 hover:text-red-300">Logout</a> <?php else: ?> <a href="login.php" class="text-blue-400 hover:text-blue-300">Login</a> <a href="signup.php" class="bg-blue-600 hover:bg-blue-700 px-6 py-2 rounded-xl transition-all">Sign Up</a> <?php endif; ?> </div> </nav> </div> </header> <section class="mt-8 h-80 bg-gradient-to-b from-black to-transparent flex flex-col items-center justify-center gap-6 px-4 -mb-20"> <h2 class="text-4xl font-bold text-white">Content <span class="text-red-200">+18</span> you'll love</h2> <p class="text-lg text-gray-200 text-center max-w-lg">ForMore is a pornographic content platform designed to bring real porn content to life, mainly for young people!</p> <form method="GET" class="w-full max-w-6xl mx-auto px-4"> <div class="relative"> <input type="text" name="search" placeholder="Search videos, models, or tags..." class="w-full bg-gray-800/50 backdrop-blur-sm border-0 rounded-xl py-3 px-4 pl-11 pr-20 text-white focus:ring-2 focus:ring-blue-500"> <svg class="w-5 h-5 absolute left-4 top-1/2 -translate-y-1/2 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/> </svg> <button type="submit" class="absolute right-2 top-1/2 -translate-y-1/2 bg-blue-600 hover:bg-blue-700 px-4 py-1.5 rounded-lg transition-colors text-sm text-white"> Search </button> </div> </form> </section> <main class="max-w-7xl mx-auto px-4 pt-24 pb-8"> <div class="mb-8 space-y-6"> <div class="bg-gray-800/50 backdrop-blur-sm rounded-2xl overflow-hidden"> <button onclick="toggleModels()" class="w-full p-4 border-b border-gray-700 flex justify-between items-center"> <h2 class="text-xl font-bold">Featured Models</h2> <svg id="modelsArrow" class="w-5 h-5 transform transition-transform duration-300" fill="none" viewBox="0 0 24 24" stroke="currentColor"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"/> </svg> </button> <div id="modelsList" class="models-section collapsed"> <div class="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-4 p-4"> <?php foreach($models as $model): ?> <a href="profile.php?id=<?= $model['id'] ?>" class="bg-gray-900/50 rounded-xl p-4 hover:bg-gray-700/50 transition-colors text-center"> <div class="relative w-20 h-20 mx-auto mb-2"> <?php if($model['avatar_url']): ?> <img src="<?= htmlspecialchars($model['avatar_url']) ?>" class="w-full h-full rounded-full object-cover"> <?php else: ?> <div class="w-full h-full rounded-full bg-gray-700 flex items-center justify-center text-2xl font-bold"> <?= strtoupper(substr($model['username'], 0, 1)) ?> </div> <?php endif; ?> <div class="absolute -bottom-2 -right-2 bg-blue-600 rounded-full text-xs px-2 py-1"> <?= $model['video_count'] ?> </div> </div> <h3 class="font-semibold truncate"><?= htmlspecialchars($model['username']) ?></h3> <p class="text-sm text-gray-400"><?= number_format($model['total_views']) ?> views</p> </a> <?php endforeach; ?> </div> </div> </div> </div> <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6" id="videosGrid"> <?php foreach($videos as $index => $video): ?> <div class="video-card bg-gray-800/50 backdrop-blur-sm rounded-2xl overflow-hidden hover:scale-105 transition-all duration-300" style="animation-delay: <?= $index * 0.1 ?>s"> <div class="relative aspect-video cursor-pointer" onclick="openModal(<?= $video['id'] ?>)"> <img src="<?= htmlspecialchars($video['picture_cover']) ?>" class="w-full h-full object-cover"> <div class="absolute bottom-2 right-2 bg-black/70 backdrop-blur-sm px-3 py-1 rounded-lg text-sm"> <?= htmlspecialchars($video['time']) ?> </div> </div> <div class="p-4"> <h2 class="text-lg font-bold line-clamp-1"><?= htmlspecialchars($video['name']) ?></h2> <p class="text-gray-400 text-sm mt-2 line-clamp-2"><?= htmlspecialchars($video['description']) ?></p> <div class="flex justify-between items-center mt-4"> <a href="profile.php?id=<?= $video['author_id'] ?>" class="flex items-center gap-2"> <?php if($video['author_avatar']): ?> <img src="<?= htmlspecialchars($video['author_avatar']) ?>" class="w-8 h-8 rounded-full object-cover"> <?php else: ?> <div class="w-8 h-8 rounded-full bg-gray-700 flex items-center justify-center font-bold"> <?= strtoupper(substr($video['author_name'], 0, 1)) ?> </div> <?php endif; ?> <span class="text-sm text-gray-300 hover:text-blue-400 transition-colors"> <?= htmlspecialchars($video['author_name']) ?> </span> </a> <span class="text-sm text-gray-400"><?= number_format($video['view_count']) ?> views</span> </div> <?php if(isset($_SESSION['user_id'])): ?> <div class="flex gap-2 mt-4"> <button onclick="handleInteraction(event, <?= $video['id'] ?>, 'like')" class="flex-1 px-3 py-1 rounded-lg <?= $video['user_interaction'] === 'like' ? 'bg-blue-600' : 'bg-gray-700 hover:bg-gray-600' ?> transition-colors"> <?= number_format($video['like_count']) ?> 👍 </button> <button onclick="handleInteraction(event, <?= $video['id'] ?>, 'dislike')" class="flex-1 px-3 py-1 rounded-lg <?= $video['user_interaction'] === 'dislike' ? 'bg-red-600' : 'bg-gray-700 hover:bg-gray-600' ?> transition-colors"> <?= number_format($video['dislike_count']) ?> 👎 </button> </div> <?php endif; ?> </div> </div> <?php endforeach; ?> </div> </main> <!-- Modal --> <div id="videoModal" class="hidden fixed inset-0 bg-black/95 backdrop-blur-sm z-50 overflow-y-auto"> <div class="min-h-screen flex items-center justify-center p-4"> <div class="bg-gray-800/50 backdrop-blur-sm rounded-2xl w-full max-w-5xl"> <div id="modalContent" class="p-6"> <div class="flex justify-between items-center mb-4"> <h3 class="text-2xl font-bold" id="videoTitle"></h3> <button onclick="closeModal()" class="text-gray-400 hover:text-white transition-colors"> <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path> </svg> </button> </div> <div class="relative bg-gray-900 rounded-xl overflow-hidden aspect-video mb-6"> <div id="videoContainer" class="w-full h-full"> <div class="flex items-center justify-center h-full"> <svg class="animate-spin h-12 w-12 text-blue-500" viewBox="0 0 24 24"> <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle> <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path> </svg> </div> </div> </div> <div id="videoInfo" class="space-y-6"> <div class="flex items-center justify-between"> <div class="flex items-center gap-4"> <a href="#" id="authorProfileLink" class="flex items-center gap-3"> <div id="authorAvatar" class="w-12 h-12 rounded-full bg-gray-700 flex items-center justify-center text-xl font-bold"></div> <div> <span id="authorName" class="font-semibold text-lg"></span> <div id="authorStats" class="text-sm text-gray-400"></div> </div> </a> </div> <?php if(isset($_SESSION['user_id'])): ?> <div class="flex gap-3"> <button id="likeButton" class="px-6 py-2 rounded-xl transition-colors flex items-center gap-2"> <span id="likeCount">0</span> 👍 </button> <button id="dislikeButton" class="px-6 py-2 rounded-xl transition-colors flex items-center gap-2"> <span id="dislikeCount">0</span> 👎 </button> </div> <?php endif; ?> </div> <div class="bg-gray-900/50 backdrop-blur-sm rounded-xl p-4"> <div id="videoStats" class="flex gap-4 text-sm text-gray-400 mb-4"></div> <div id="videoDescription" class="text-gray-300 whitespace-pre-wrap"></div> <div id="videoTags" class="flex flex-wrap gap-2 mt-4"></div> </div> <?php if(isset($_SESSION['user_id'])): ?> <div class="border-t border-gray-700 pt-6"> <form onsubmit="handleComment(event)" class="space-y-4"> <textarea id="commentText" rows="3" class="w-full bg-gray-900/50 backdrop-blur-sm border-0 rounded-xl p-4 text-white focus:ring-2 focus:ring-blue-500" placeholder="Add a comment..."></textarea> <button type="submit" class="px-6 py-2 bg-blue-600 hover:bg-blue-700 rounded-xl transition-colors"> Comment </button> </form> </div> <?php endif; ?> <div id="comments" class="space-y-4 border-t border-gray-700 pt-6"> <h4 class="text-xl font-bold">Comments</h4> <div id="commentsList" class="space-y-4"></div> </div> </div> </div> </div> </div> </div> <script> let currentVideoId = null; function toggleMenu() { document.querySelector('.menu').classList.toggle('active'); document.querySelector('.hamburger').classList.toggle('active'); } function toggleModels() { const modelsList = document.getElementById('modelsList'); const arrow = document.getElementById('modelsArrow'); modelsList.classList.toggle('collapsed'); modelsList.classList.toggle('expanded'); arrow.style.transform = modelsList.classList.contains('expanded') ? 'rotate(180deg)' : ''; } let searchTimeout; function searchContent(value) { clearTimeout(searchTimeout); searchTimeout = setTimeout(() => { const url = new URL(window.location); if(value) { url.searchParams.set('search', value); } else { url.searchParams.delete('search'); } window.location = url; }, 500); } function handleInteraction(event, videoId, type) { event.stopPropagation(); fetch('get_video.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: `action=${type}&video_id=${videoId}` }).then(() => window.location.reload()); } function openModal(videoId) { currentVideoId = videoId; document.getElementById('videoModal').classList.remove('hidden'); document.body.style.overflow = 'hidden'; fetch('get_video.php?id=' + videoId) .then(response => response.json()) .then(data => { document.getElementById('videoTitle').textContent = data.name; document.getElementById('authorName').textContent = data.author_name; document.getElementById('authorProfileLink').href = 'profile.php?id=' + data.author_id; if(data.author_avatar) { document.getElementById('authorAvatar').innerHTML = `<img src="${data.author_avatar}" class="w-full h-full rounded-full object-cover">`; } else { document.getElementById('authorAvatar').innerHTML = data.author_name.charAt(0).toUpperCase(); } document.getElementById('videoStats').innerHTML = ` <span>${data.view_count} views</span> <span>${data.like_count} likes</span> <span>${data.dislike_count} dislikes</span> `; document.getElementById('videoContainer').innerHTML = ` <video src="${data.url_video}" controls class="w-full h-full" autoplay> Your browser does not support the video tag. </video> `; document.getElementById('videoDescription').textContent = data.description; document.getElementById('videoTags').innerHTML = data.tags.split(',') .map(tag => `<span class="bg-blue-900/50 backdrop-blur-sm px-3 py-1 rounded-full text-sm">${tag.trim()}</span>`) .join(''); if(document.getElementById('likeButton')) { document.getElementById('likeButton').className = `px-6 py-2 rounded-xl transition-colors flex items-center gap-2 ${data.user_interaction === 'like' ? 'bg-blue-600' : 'bg-gray-700 hover:bg-gray-600'}`; document.getElementById('dislikeButton').className = `px-6 py-2 rounded-xl transition-colors flex items-center gap-2 ${data.user_interaction === 'dislike' ? 'bg-red-600' : 'bg-gray-700 hover:bg-gray-600'}`; } loadComments(videoId); }); } function closeModal() { document.getElementById('videoModal').classList.add('hidden'); document.body.style.overflow = 'auto'; currentVideoId = null; } function loadComments(videoId) { fetch('get_comments.php?video_id=' + videoId) .then(response => response.json()) .then(comments => { document.getElementById('commentsList').innerHTML = comments .map(comment => ` <div class="bg-gray-900/50 backdrop-blur-sm rounded-xl p-4"> <div class="flex justify-between mb-2"> <a href="profile.php?id=${comment.user_id}" class="text-blue-400 hover:text-blue-300 font-semibold"> ${comment.username} </a> <span class="text-gray-400 text-sm">${comment.created_at}</span> </div> <p class="text-gray-300">${comment.comment_text}</p> </div> `).join(''); }); } function handleComment(event) { event.preventDefault(); if (!currentVideoId) return; const comment = document.getElementById('commentText').value; if (!comment.trim()) return; fetch('get_video.php', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: `comment=${encodeURIComponent(comment)}&video_id=${currentVideoId}` }).then(() => { document.getElementById('commentText').value = ''; loadComments(currentVideoId); }); } document.addEventListener('keydown', e => { if (e.key === 'Escape') closeModal(); }); document.addEventListener('click', e => { const menu = document.querySelector('.menu'); const hamburger = document.querySelector('.hamburger'); if (window.innerWidth < 1024 && !menu.contains(e.target) && !hamburger.contains(e.target)) { menu.classList.remove('active'); hamburger.classList.remove('active'); } }); </script> </body> </html>
| ver. 1.6 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка