|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* To change this license header, choose License Headers in Project Properties. |
|
5
|
|
|
* To change this template file, choose Tools | Templates |
|
6
|
|
|
* and open the template in the editor. |
|
7
|
|
|
*/ |
|
8
|
|
|
|
|
9
|
|
|
class blogControlador extends \Sistema\Nucleo\CFControlador |
|
10
|
|
|
{ |
|
11
|
|
|
|
|
12
|
|
|
private $_ayuda; |
|
13
|
|
|
|
|
14
|
|
|
|
|
15
|
|
|
public function __construct() { |
|
16
|
|
|
parent::__construct(); |
|
17
|
|
|
|
|
18
|
|
|
|
|
19
|
|
|
$this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda(); |
|
20
|
|
|
} |
|
21
|
|
|
|
|
22
|
|
|
public function index(){ |
|
23
|
|
|
$datas = $this->cargaModelo('blog'); |
|
24
|
|
|
|
|
25
|
|
|
$this->_vista->postear= $datas->llamarDatosBlog(); |
|
|
|
|
|
|
26
|
|
|
$this->_vista->categorias= $datas->llamarDatosCategoria(); |
|
|
|
|
|
|
27
|
|
|
$this->_vista->tags= $datas->llamarDatosTags(); |
|
|
|
|
|
|
28
|
|
|
$this->_vista->titulo = 'Blog Calima Framework'; |
|
|
|
|
|
|
29
|
|
|
$this->_vista->imprimirVista('index', 'blog'); |
|
|
|
|
|
|
30
|
|
|
|
|
31
|
|
|
} |
|
32
|
|
|
public function crearpost(){ |
|
33
|
|
|
$datas = $this->cargaModelo('blog'); |
|
34
|
|
|
|
|
35
|
|
|
$this->_vista->postear= $datas->llamarDatosBlog(); |
|
|
|
|
|
|
36
|
|
|
$this->_vista->titulo = 'Blog Calima Framework crear post'; |
|
|
|
|
|
|
37
|
|
|
$this->_vista->imprimirVista('crearpost', 'blog'); |
|
|
|
|
|
|
38
|
|
|
|
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public function wikipost(){ |
|
|
|
|
|
|
42
|
|
|
$datas = $this->cargaModelo('blog'); |
|
43
|
|
|
|
|
44
|
|
|
$this->_vista->postear= $datas->llamarDatosBlog(); |
|
|
|
|
|
|
45
|
|
|
$this->_vista->tags= $datas->llamarDatosTags(); |
|
|
|
|
|
|
46
|
|
|
$this->_vista->comentarios= $datas->llamarComentarios(); |
|
|
|
|
|
|
47
|
|
|
$this->_vista->categorias= $datas->llamarDatosCategoria(); |
|
|
|
|
|
|
48
|
|
|
$this->_vista->contar= $datas->contarComentarios($_GET['id']); |
|
|
|
|
|
|
49
|
|
|
$this->_vista->video= $datas->llamarDatosBlogId($_GET['id']); |
|
|
|
|
|
|
50
|
|
|
$this->_vista->titulo = 'Blog 1 Calima Framework'; |
|
|
|
|
|
|
51
|
|
|
$this->_vista->imprimirVista('wikipost', 'blog'); |
|
|
|
|
|
|
52
|
|
|
|
|
53
|
|
|
|
|
54
|
|
|
$this->_vista->titulo = 'Registro CalimaFramework'; |
|
55
|
|
|
if(isset($_GET['titulo'])){ |
|
56
|
|
|
$this->_vista->salida_campo = $_GET['titulo']; |
|
|
|
|
|
|
57
|
|
|
} |
|
58
|
|
|
|
|
59
|
|
|
$this->_vista->imprimirVista('wikipost', 'blog'); |
|
|
|
|
|
|
60
|
|
|
//$datas = $this->cargaModelo('blog'); |
|
61
|
|
|
if (isset($_POST['enviar'])&& isset($_POST['option1']) ) { |
|
62
|
|
|
|
|
63
|
|
|
$datas->insertarDatos( |
|
64
|
|
|
$this->_ayuda->filtrarEntero($_POST['id']), |
|
65
|
|
|
$this->_ayuda->filtrarTexto($_POST['nombre']), |
|
|
|
|
|
|
66
|
|
|
$this->_ayuda->filtrarTexto($_POST['email']), |
|
|
|
|
|
|
67
|
|
|
$this->_ayuda->filtrarTexto($_POST['comentario']) |
|
|
|
|
|
|
68
|
|
|
); |
|
69
|
|
|
echo $this->_ayuda->filtrarEntero('id'); |
|
70
|
|
|
$_POST['option1']=false; |
|
71
|
|
|
|
|
72
|
|
|
} |
|
73
|
|
|
|
|
74
|
|
|
} |
|
75
|
|
|
|
|
76
|
|
|
public function insertarComentario(){ |
|
77
|
|
|
|
|
78
|
|
|
/*$this->_vista->titulo = 'Registro CalimaFramework'; |
|
79
|
|
|
if(isset($_GET['titulo'])){ |
|
80
|
|
|
$this->_vista->salida_campo = $_GET['titulo']; |
|
81
|
|
|
} |
|
82
|
|
|
|
|
83
|
|
|
$this->_vista->imprimirVista('wikipost', 'blog'); |
|
84
|
|
|
$datas = $this->cargaModelo('blog'); |
|
85
|
|
|
if (isset($_POST['titulos'])) { |
|
86
|
|
|
$id_unico=$this->_ayud->filtrarEntero($_POST['id']).$this->_ayud->aleatorio(); |
|
87
|
|
|
$datas->insertarDatos( |
|
88
|
|
|
$id_unico, |
|
89
|
|
|
$this->_ayud->filtrarTexto($_POST['nombre']), |
|
90
|
|
|
$this->_ayud->filtrarTexto($_POST['email']), |
|
91
|
|
|
$this->_ayud->filtrarTexto($_POST['comentario']) |
|
92
|
|
|
); |
|
93
|
|
|
echo $this->_ayud->filtrarEntero('id'); |
|
94
|
|
|
}*/ |
|
95
|
|
|
|
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
|
|
99
|
|
|
|
|
100
|
|
|
|
|
101
|
|
|
|
|
102
|
|
|
|
|
103
|
|
|
} |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.