execute($sql); } public static function searchVideos($query, $limit = 20) { global $class_database; $query = $class_database->escape($query); $sql = "SELECT vf.*, au.usr_user as username FROM db_videofiles vf LEFT JOIN db_accountuser au ON vf.usr_id = au.usr_id WHERE (vf.file_title LIKE '%$query%' OR vf.file_description LIKE '%$query%') AND vf.privacy = 'public' AND vf.approved = 1 ORDER BY vf.upload_date DESC LIMIT $limit"; return $class_database->execute($sql); } public static function getVideosByCategory($category_id, $limit = 20) { global $class_database; $sql = "SELECT vf.*, au.usr_user as username FROM db_videofiles vf LEFT JOIN db_accountuser au ON vf.usr_id = au.usr_id WHERE vf.file_category = ? AND vf.privacy = 'public' AND vf.approved = 1 ORDER BY vf.upload_date DESC LIMIT $limit"; return $class_database->execute($sql, [$category_id]); } public static function renderVideoGrid($videos) { if (empty($videos)) { return '