-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreply.php
More file actions
46 lines (38 loc) · 1.1 KB
/
Copy pathreply.php
File metadata and controls
46 lines (38 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
session_start();
require_once 'config.php';
require_once 'functions.php';
require_once 'includes/ReplyController.php';
require_once 'includes/ReplyView.php';
// Inicializar controlador
$controller = new ReplyController();
// Verificar si el usuario está baneado
$ban_info = is_user_banned();
if ($ban_info) {
header('Location: ban.php');
exit;
}
// Validar y obtener el ID del post
$post_id = $controller->validatePostId();
if (!$post_id) {
$controller->redirectToHome();
}
// Obtener y validar el post principal
$post = $controller->validateMainPost($post_id);
if (!$post) {
$controller->redirectToHome();
}
// Verificar si el post está bloqueado
if ($controller->isPostLocked($post)) {
$controller->redirectToHome();
}
// Procesar solicitudes POST
$result = $controller->handleRequest($post_id);
$error = $result['error'];
$success_message = $result['success_message'];
// Cargar datos para la vista
$view_data = $controller->loadReplyPageData($post_id);
// Inicializar vista y renderizar
$view = new ReplyView();
$view->renderReplyPage($post, $view_data, $error, $success_message);
?>