@@ -27,7 +27,7 @@ |
||
27 | 27 | |
28 | 28 | class CFPHPVinculos { |
29 | 29 | |
30 | - function get_dominio(){ |
|
30 | + function get_dominio() { |
|
31 | 31 | |
32 | 32 | $dominio = "http://www.my-site-domain.com/"; |
33 | 33 | return $dominio; |
@@ -19,46 +19,46 @@ discard block |
||
19 | 19 | $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda(); |
20 | 20 | } |
21 | 21 | |
22 | - public function index(){ |
|
22 | + public function index() { |
|
23 | 23 | $datas = $this->cargaModelo('blog'); |
24 | 24 | |
25 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
26 | - $this->_vista->categorias= $datas->llamarDatosCategoria(); |
|
27 | - $this->_vista->tags= $datas->llamarDatosTags(); |
|
25 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
26 | + $this->_vista->categorias = $datas->llamarDatosCategoria(); |
|
27 | + $this->_vista->tags = $datas->llamarDatosTags(); |
|
28 | 28 | $this->_vista->titulo = 'Blog Calima Framework'; |
29 | 29 | $this->_vista->imprimirVista('index', 'blog'); |
30 | 30 | |
31 | 31 | } |
32 | - public function crearpost(){ |
|
32 | + public function crearpost() { |
|
33 | 33 | $datas = $this->cargaModelo('blog'); |
34 | 34 | |
35 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
35 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
36 | 36 | $this->_vista->titulo = 'Blog Calima Framework crear post'; |
37 | 37 | $this->_vista->imprimirVista('crearpost', 'blog'); |
38 | 38 | |
39 | 39 | } |
40 | 40 | |
41 | - public function wikipost(){ |
|
41 | + public function wikipost() { |
|
42 | 42 | $datas = $this->cargaModelo('blog'); |
43 | 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']); |
|
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 | 50 | $this->_vista->titulo = 'Blog 1 Calima Framework'; |
51 | 51 | $this->_vista->imprimirVista('wikipost', 'blog'); |
52 | 52 | |
53 | 53 | |
54 | 54 | $this->_vista->titulo = 'Registro CalimaFramework'; |
55 | - if(isset($_GET['titulo'])){ |
|
55 | + if (isset($_GET['titulo'])) { |
|
56 | 56 | $this->_vista->salida_campo = $_GET['titulo']; |
57 | 57 | } |
58 | 58 | |
59 | 59 | $this->_vista->imprimirVista('wikipost', 'blog'); |
60 | 60 | //$datas = $this->cargaModelo('blog'); |
61 | - if (isset($_POST['enviar'])&& isset($_POST['option1']) ) { |
|
61 | + if (isset($_POST['enviar']) && isset($_POST['option1'])) { |
|
62 | 62 | |
63 | 63 | $datas->insertarDatos( |
64 | 64 | $this->_ayuda->filtrarEntero($_POST['id']), |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | $this->_ayuda->filtrarTexto($_POST['comentario']) |
68 | 68 | ); |
69 | 69 | echo $this->_ayuda->filtrarEntero('id'); |
70 | - $_POST['option1']=false; |
|
70 | + $_POST['option1'] = false; |
|
71 | 71 | |
72 | 72 | } |
73 | 73 | |
74 | 74 | } |
75 | 75 | |
76 | - public function insertarComentario(){ |
|
76 | + public function insertarComentario() { |
|
77 | 77 | |
78 | 78 | /*$this->_vista->titulo = 'Registro CalimaFramework'; |
79 | 79 | if(isset($_GET['titulo'])){ |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | |
11 | 11 | // cargamos la clase ayudantes para usar sus metodos de ayuda |
12 | 12 | |
13 | - $this->_ayuda= new Sistema\Ayudantes\CFPHPAyuda(); |
|
13 | + $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda(); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | public function index() |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | $this->_vista->imprimirVista('index', 'inicio'); |
20 | 20 | |
21 | 21 | if (isset($_POST['email'])) { |
22 | - $this->_vista->validar=1; |
|
23 | - $para="[email protected]"; |
|
22 | + $this->_vista->validar = 1; |
|
23 | + $para = "[email protected]"; |
|
24 | 24 | $this->_ayuda->enviarCorreo( |
25 | 25 | $_POST['email'], |
26 | 26 | $this->_ayuda->filtrarTexto($_POST['asunto']), |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | |
40 | 40 | if (isset($_POST['email'])) { |
41 | - $para="[email protected]"; |
|
41 | + $para = "[email protected]"; |
|
42 | 42 | $this->_ayuda->enviarCorreo( |
43 | 43 | $_POST['email'], |
44 | 44 | $this->_ayuda->filtrarTexto($_POST['asunto']), |
@@ -6,16 +6,16 @@ |
||
6 | 6 | * and open the template in the editor. |
7 | 7 | */ |
8 | 8 | |
9 | -class errorControlador extends \Sistema\Nucleo\CFControlador{ |
|
9 | +class errorControlador extends \Sistema\Nucleo\CFControlador { |
|
10 | 10 | |
11 | 11 | public function __construct() { |
12 | 12 | parent::__construct(); |
13 | 13 | } |
14 | 14 | |
15 | - public function index(){ |
|
15 | + public function index() { |
|
16 | 16 | |
17 | - $this->_vista->titulo="Error detectado"; |
|
18 | - $this->_vista->imprimirVista('index','error'); |
|
17 | + $this->_vista->titulo = "Error detectado"; |
|
18 | + $this->_vista->imprimirVista('index', 'error'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -13,67 +13,67 @@ |
||
13 | 13 | parent::__construct(); |
14 | 14 | } |
15 | 15 | |
16 | - public function insertarDatos($id_blog, $nombre, $email, $comentario){ |
|
16 | + public function insertarDatos($id_blog, $nombre, $email, $comentario) { |
|
17 | 17 | |
18 | - $post=$this->_bd->consulta('INSERT INTO comentarios (id_blog, nombre, email, comentario) VALUES (:id_blog, :nombre, :email, :comentario)'); |
|
19 | - $post=$this->_bd->enlace(':id_blog', $id_blog); |
|
20 | - $post=$this->_bd->enlace(':nombre',$nombre); |
|
21 | - $post=$this->_bd->enlace(':email', $email); |
|
22 | - $post=$this->_bd->enlace(':comentario', $comentario); |
|
23 | - $post=$this->_bd->ejecucion(); |
|
24 | - return $post=$this->_bd->resultset(); |
|
18 | + $post = $this->_bd->consulta('INSERT INTO comentarios (id_blog, nombre, email, comentario) VALUES (:id_blog, :nombre, :email, :comentario)'); |
|
19 | + $post = $this->_bd->enlace(':id_blog', $id_blog); |
|
20 | + $post = $this->_bd->enlace(':nombre', $nombre); |
|
21 | + $post = $this->_bd->enlace(':email', $email); |
|
22 | + $post = $this->_bd->enlace(':comentario', $comentario); |
|
23 | + $post = $this->_bd->ejecucion(); |
|
24 | + return $post = $this->_bd->resultset(); |
|
25 | 25 | |
26 | 26 | } |
27 | 27 | |
28 | - public function llamarDatosCategoria(){ |
|
28 | + public function llamarDatosCategoria() { |
|
29 | 29 | //echo DB_HOST; |
30 | - $cate=$this->_bd->consulta('select * from categoria '); |
|
31 | - return $cate=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
30 | + $cate = $this->_bd->consulta('select * from categoria '); |
|
31 | + return $cate = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
32 | 32 | |
33 | 33 | |
34 | 34 | } |
35 | 35 | |
36 | - public function llamarDatosTags(){ |
|
36 | + public function llamarDatosTags() { |
|
37 | 37 | //echo DB_HOST; |
38 | - $post=$this->_bd->consulta('select * from tags '); |
|
39 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
38 | + $post = $this->_bd->consulta('select * from tags '); |
|
39 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
40 | 40 | |
41 | 41 | |
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | - public function llamarDatosBlog(){ |
|
45 | + public function llamarDatosBlog() { |
|
46 | 46 | //echo DB_HOST; |
47 | - $post=$this->_bd->consulta('select * from blog '); |
|
48 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
47 | + $post = $this->_bd->consulta('select * from blog '); |
|
48 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
49 | 49 | |
50 | 50 | |
51 | 51 | } |
52 | 52 | |
53 | - public function llamarDatosBlogId($id){ |
|
53 | + public function llamarDatosBlogId($id) { |
|
54 | 54 | //echo DB_HOST; |
55 | - $idvideo=$id; |
|
56 | - $datosQuery="select idvideo from blog where id = :idvideo"; |
|
57 | - $gsent=$this->_bd->consulta('SELECT idvideo FROM blog WHERE id = :idvideo'); |
|
58 | - $gsent=$this->_bd->enlace(':idvideo', $idvideo); |
|
55 | + $idvideo = $id; |
|
56 | + $datosQuery = "select idvideo from blog where id = :idvideo"; |
|
57 | + $gsent = $this->_bd->consulta('SELECT idvideo FROM blog WHERE id = :idvideo'); |
|
58 | + $gsent = $this->_bd->enlace(':idvideo', $idvideo); |
|
59 | 59 | //$gsent=$this->_bd->ejecucion(); |
60 | - $row = $gsent=$this->_bd->single(); |
|
60 | + $row = $gsent = $this->_bd->single(); |
|
61 | 61 | return $row; |
62 | 62 | |
63 | 63 | } |
64 | 64 | |
65 | - public function llamarComentarios(){ |
|
65 | + public function llamarComentarios() { |
|
66 | 66 | //echo DB_HOST; |
67 | - $post=$this->_bd->consulta('select * from comentarios '); |
|
68 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
67 | + $post = $this->_bd->consulta('select * from comentarios '); |
|
68 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
69 | 69 | |
70 | 70 | |
71 | 71 | } |
72 | 72 | |
73 | - public function contarComentarios($id){ |
|
73 | + public function contarComentarios($id) { |
|
74 | 74 | //echo DB_HOST; |
75 | - $post=$this->_bd->consulta('SELECT COUNT(*) FROM comentarios'); |
|
76 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
75 | + $post = $this->_bd->consulta('SELECT COUNT(*) FROM comentarios'); |
|
76 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
77 | 77 | |
78 | 78 | |
79 | 79 | } |
@@ -2,47 +2,47 @@ |
||
2 | 2 | class usuarioModelo extends Sistema\Nucleo\CFModelo |
3 | 3 | { |
4 | 4 | |
5 | - function ValidarUsuario($email,$password){ // Consulta Mysql para buscar en la tabla Usuario aquellos usuarios que coincidan con el mail y password ingresados en pantalla de login |
|
6 | - $query = $this->db->where('Usuario',$email); // La consulta se efectúa mediante Active Record. Una manera alternativa, y en lenguaje más sencillo, de generar las consultas Sql. |
|
7 | - $query = $this->db->where('Password',$password); |
|
5 | + function ValidarUsuario($email, $password) { // Consulta Mysql para buscar en la tabla Usuario aquellos usuarios que coincidan con el mail y password ingresados en pantalla de login |
|
6 | + $query = $this->db->where('Usuario', $email); // La consulta se efectúa mediante Active Record. Una manera alternativa, y en lenguaje más sencillo, de generar las consultas Sql. |
|
7 | + $query = $this->db->where('Password', $password); |
|
8 | 8 | $query = $this->db->get('Usuarios'); |
9 | - return $query->row(); // Devolvemos al controlador la fila que coincide con la búsqueda. (FALSE en caso que no existir coincidencias) |
|
9 | + return $query->row(); // Devolvemos al controlador la fila que coincide con la búsqueda. (FALSE en caso que no existir coincidencias) |
|
10 | 10 | } |
11 | 11 | |
12 | - public function insertarUsuario($id_usuario, $nombre, $email, $clave){ |
|
12 | + public function insertarUsuario($id_usuario, $nombre, $email, $clave) { |
|
13 | 13 | |
14 | - $post=$this->_bd->consulta('INSERT INTO comentarios (id_usuario, nombre, email, clave) VALUES (:id_usuario, :nombre, :email, :clave)'); |
|
15 | - $post=$this->_bd->enlace(':id_usuario', $id_usuariio); |
|
16 | - $post=$this->_bd->enlace(':nombre',$nombre); |
|
17 | - $post=$this->_bd->enlace(':email', $email); |
|
18 | - $post=$this->_bd->enlace(':clave', $clave); |
|
19 | - $post=$this->_bd->ejecucion(); |
|
20 | - return $post=$this->_bd->resultset(); |
|
14 | + $post = $this->_bd->consulta('INSERT INTO comentarios (id_usuario, nombre, email, clave) VALUES (:id_usuario, :nombre, :email, :clave)'); |
|
15 | + $post = $this->_bd->enlace(':id_usuario', $id_usuariio); |
|
16 | + $post = $this->_bd->enlace(':nombre', $nombre); |
|
17 | + $post = $this->_bd->enlace(':email', $email); |
|
18 | + $post = $this->_bd->enlace(':clave', $clave); |
|
19 | + $post = $this->_bd->ejecucion(); |
|
20 | + return $post = $this->_bd->resultset(); |
|
21 | 21 | |
22 | 22 | } |
23 | 23 | |
24 | - public function seleccionUsuario($email, $clave){ |
|
24 | + public function seleccionUsuario($email, $clave) { |
|
25 | 25 | //echo DB_HOST; |
26 | 26 | |
27 | 27 | //$datosQuery="select usuario, email, nivel from usuarios where usuario = :usuario"; |
28 | - $gsent=$this->_bd->consulta('select nombre, email, nivel from usuarios where email = :email and clave = :clave'); |
|
29 | - $gsent=$this->_bd->enlace(':email', $email); |
|
30 | - $gsent=$this->_bd->enlace(':clave', $clave); |
|
28 | + $gsent = $this->_bd->consulta('select nombre, email, nivel from usuarios where email = :email and clave = :clave'); |
|
29 | + $gsent = $this->_bd->enlace(':email', $email); |
|
30 | + $gsent = $this->_bd->enlace(':clave', $clave); |
|
31 | 31 | //$gsent=$this->_bd->ejecucion(); |
32 | - $row = $gsent=$this->_bd->single(); |
|
32 | + $row = $gsent = $this->_bd->single(); |
|
33 | 33 | return $row; |
34 | 34 | |
35 | 35 | } |
36 | 36 | |
37 | - public function insertarRegistro($nombre, $email, $nivel, $clave){ |
|
37 | + public function insertarRegistro($nombre, $email, $nivel, $clave) { |
|
38 | 38 | |
39 | - $post=$this->_bd->consulta('INSERT INTO usuarios (nombre, email, nivel, clave) VALUES (:nombre, :email, :nivel, :clave)'); |
|
39 | + $post = $this->_bd->consulta('INSERT INTO usuarios (nombre, email, nivel, clave) VALUES (:nombre, :email, :nivel, :clave)'); |
|
40 | 40 | |
41 | - $post=$this->_bd->enlace(':nombre',$nombre); |
|
42 | - $post=$this->_bd->enlace(':email', $email); |
|
43 | - $post=$this->_bd->enlace(':nivel', $nivel); |
|
44 | - $post=$this->_bd->enlace(':clave', $clave); |
|
45 | - $post=$this->_bd->ejecucion(); |
|
41 | + $post = $this->_bd->enlace(':nombre', $nombre); |
|
42 | + $post = $this->_bd->enlace(':email', $email); |
|
43 | + $post = $this->_bd->enlace(':nivel', $nivel); |
|
44 | + $post = $this->_bd->enlace(':clave', $clave); |
|
45 | + $post = $this->_bd->ejecucion(); |
|
46 | 46 | //return $post=$this->_bd->contarFilas(); |
47 | 47 | |
48 | 48 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | </script> |
21 | 21 | <!-- End Google Analytics --> |
22 | 22 | |
23 | - <title><?php if(isset($this->titulo)) echo $this->titulo; ?></title> |
|
23 | + <title><?php if (isset($this->titulo)) echo $this->titulo; ?></title> |
|
24 | 24 | |
25 | 25 | |
26 | 26 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <!-- Site footer --> |
2 | 2 | |
3 | 3 | |
4 | - <div class="footer fixedCf"> <?php echo CF_AP_CREDITOS; ?> --- Theme Inspinia </div> |
|
4 | + <div class="footer fixedCf"> <?php echo CF_AP_CREDITOS; ?> --- Theme Inspinia </div> |
|
5 | 5 | |
6 | 6 | |
7 | 7 |
@@ -113,7 +113,7 @@ |
||
113 | 113 | |
114 | 114 | $that = $this; |
115 | 115 | |
116 | - return function ($type, $buffer) use ($output, $process, $callback, $formatter, $that) { |
|
116 | + return function($type, $buffer) use ($output, $process, $callback, $formatter, $that) { |
|
117 | 117 | $output->write($formatter->progress(spl_object_hash($process), $that->escapeString($buffer), Process::ERR === $type)); |
118 | 118 | |
119 | 119 | if (null !== $callback) { |