// ============================================
// SISTEMA DE LIKES Y REACCIONES
// ============================================
/**
* Obtener conteo de likes para un contenido
*/
function get_likes_count($content_type, $content_id) {
global $db;
$stmt = $db->prepare("SELECT COUNT(*) as count FROM likes WHERE content_type = ? AND content_id = ?");
$stmt->execute([$content_type, $content_id]);
$result = $stmt->fetch();
return $result['count'] ?? 0;
}
/**
* Verificar si el usuario actual ha dado like
*/
function user_has_liked($content_type, $content_id, $user_id) {
global $db;
$stmt = $db->prepare("SELECT id FROM likes WHERE content_type = ? AND content_id = ? AND user_id = ?");
$stmt->execute([$content_type, $content_id, $user_id]);
return $stmt->fetch() !== false;
}
/**
* Toggle like (agregar o quitar)
*/
function toggle_like($content_type, $content_id, $user_id) {
global $db;
try {
$db->beginTransaction();
// Verificar si ya existe
$stmt = $db->prepare("SELECT id FROM likes WHERE content_type = ? AND content_id = ? AND user_id = ?");
$stmt->execute([$content_type, $content_id, $user_id]);
$existing = $stmt->fetch();
if ($existing) {
// Eliminar like
$stmt = $db->prepare("DELETE FROM likes WHERE content_type = ? AND content_id = ? AND user_id = ?");
$stmt->execute([$content_type, $content_id, $user_id]);
$action = 'removed';
} else {
// Agregar like
$stmt = $db->prepare("INSERT INTO likes (content_type, content_id, user_id) VALUES (?, ?, ?)");
$stmt->execute([$content_type, $content_id, $user_id]);
$action = 'added';
}
// Actualizar contador en la tabla principal
$table_map = [
'blog_post' => 'blog_posts',
'investigation' => 'investigations',
'esoterism' => 'esoterism_content'
];
if (isset($table_map[$content_type])) {
$table = $table_map[$content_type];
$count = get_likes_count($content_type, $content_id);
$stmt = $db->prepare("UPDATE {$table} SET likes_count = ? WHERE id = ?");
$stmt->execute([$count, $content_id]);
}
$db->commit();
return ['success' => true, 'action' => $action, 'count' => get_likes_count($content_type, $content_id)];
} catch (Exception $e) {
$db->rollBack();
return ['success' => false, 'error' => $e->getMessage()];
}
}
// ============================================
// SISTEMA DE COMENTARIOS
// ============================================
/**
* Obtener comentarios de un contenido
*/
function get_comments($content_type, $content_id, $parent_id = null) {
global $db;
$sql = "SELECT c.*, u.username, u.first_name, u.last_name, u.profile_image
FROM comments c
INNER JOIN users u ON c.user_id = u.id
WHERE c.content_type = ? AND c.content_id = ? AND c.is_approved = 1";
if ($parent_id === null) {
$sql .= " AND c.parent_id IS NULL";
$params = [$content_type, $content_id];
} else {
$sql .= " AND c.parent_id = ?";
$params = [$content_type, $content_id, $parent_id];
}
$sql .= " ORDER BY c.created_at DESC";
$stmt = $db->prepare($sql);
$stmt->execute($params);
return $stmt->fetchAll();
}
/**
* Contar comentarios de un contenido
*/
function get_comments_count($content_type, $content_id) {
global $db;
$stmt = $db->prepare("SELECT COUNT(*) as count FROM comments WHERE content_type = ? AND content_id = ? AND is_approved = 1");
$stmt->execute([$content_type, $content_id]);
$result = $stmt->fetch();
return $result['count'] ?? 0;
}
/**
* Agregar comentario
*/
function add_comment($content_type, $content_id, $user_id, $comment, $parent_id = null) {
global $db;
try {
$db->beginTransaction();
// Insertar comentario
$stmt = $db->prepare("
INSERT INTO comments (content_type, content_id, user_id, comment, parent_id)
VALUES (?, ?, ?, ?, ?)
");
$stmt->execute([$content_type, $content_id, $user_id, $comment, $parent_id]);
// Actualizar contador
$table_map = [
'blog_post' => 'blog_posts',
'investigation' => 'investigations',
'esoterism' => 'esoterism_content'
];
if (isset($table_map[$content_type])) {
$table = $table_map[$content_type];
$count = get_comments_count($content_type, $content_id);
$stmt = $db->prepare("UPDATE {$table} SET comments_count = ? WHERE id = ?");
$stmt->execute([$count, $content_id]);
}
$db->commit();
return ['success' => true, 'message' => 'Comentario agregado exitosamente'];
} catch (Exception $e) {
$db->rollBack();
return ['success' => false, 'error' => $e->getMessage()];
}
}
/**
* Renderizar HTML de comentarios
*/
function render_comments($comments, $content_type, $content_id, $depth = 0) {
$html = '';
foreach ($comments as $comment) {
$author_name = !empty($comment['first_name'])
? $comment['first_name'] . ' ' . $comment['last_name']
: $comment['username'];
$avatar_letter = strtoupper(substr($author_name, 0, 1));
$time_ago = time_ago($comment['created_at']);
$html .= '
';
}
return $html;
}
/**
* Calcular tiempo transcurrido
*/
function time_ago($datetime) {
$timestamp = strtotime($datetime);
$diff = time() - $timestamp;
if ($diff < 60) {
return 'Hace un momento';
} elseif ($diff < 3600) {
$minutes = floor($diff / 60);
return "Hace {$minutes} minuto" . ($minutes > 1 ? 's' : '');
} elseif ($diff < 86400) {
$hours = floor($diff / 3600);
return "Hace {$hours} hora" . ($hours > 1 ? 's' : '');
} elseif ($diff < 604800) {
$days = floor($diff / 86400);
return "Hace {$days} día" . ($days > 1 ? 's' : '');
} else {
return date('d/m/Y', $timestamp);
}
}
// ============================================
// GALERÍA DE IMÁGENES
// ============================================
/**
* Obtener imágenes de galería de una investigación
*/
function get_investigation_gallery($investigation_id) {
global $db;
$stmt = $db->prepare("
SELECT ig.*, u.username
FROM investigation_gallery ig
LEFT JOIN users u ON ig.uploaded_by = u.id
WHERE ig.investigation_id = ?
ORDER BY ig.display_order ASC, ig.created_at ASC
");
$stmt->execute([$investigation_id]);
return $stmt->fetchAll();
}
/**
* Agregar imagen a galería
*/
function add_gallery_image($investigation_id, $image_path, $caption, $user_id, $display_order = 0) {
global $db;
try {
$stmt = $db->prepare("
INSERT INTO investigation_gallery (investigation_id, image_path, caption, uploaded_by, display_order)
VALUES (?, ?, ?, ?, ?)
");
$stmt->execute([$investigation_id, $image_path, $caption, $user_id, $display_order]);
return ['success' => true, 'message' => 'Imagen agregada a la galería'];
} catch (Exception $e) {
return ['success' => false, 'error' => $e->getMessage()];
}
}
Fenómeno Poltergeist en Providencia - FakeGhost
$status_colors = ['in_progress' => '#f39c12', 'completed' => '#27ae60'];
$status_labels = ['in_progress' => 'En Progreso', 'completed' => 'Completada'];
?>
← Volver a investigaciones
Warning : Undefined variable $status_labels in /var/www/test.fakeghost.cl/public_html/pages/investigacion-detalle.php on line 50
Warning : Trying to access array offset on value of type null in /var/www/test.fakeghost.cl/public_html/pages/investigacion-detalle.php on line 50
Fenómeno Poltergeist en Providencia
📍 Ubicación: Edificio en Providencia, Santiago
📅 Fecha: 01/02/2026
👁️ Vistas: 4
Resumen
Caso activo de actividad poltergeist en un departamento de Providencia con objetos moviéndose sin explicación.
Detalles de la Investigación
Una familia en Providencia contactó nuestro equipo desesperada después de semanas de actividad paranormal cada vez más intensa. Los fenómenos incluyen objetos que se mueven solos, electrodomésticos que se encienden sin intervención humana y golpes en las paredes.
Lo más perturbador es que la actividad parece centrarse alrededor de la hija adolescente de la familia. Este patrón es consistente con casos clásicos de poltergeist documentados en la literatura parapsicológica.
Durante nuestra primera visita, presenciamos directamente cómo un vaso se deslizó por la mesa sin que nadie lo tocara. Las cámaras de seguridad del edificio también han capturado puertas abriéndose y cerrándose en el pasillo durante la noche.
Actualmente estamos trabajando con la familia para entender el origen de estos fenómenos. La investigación continúa.