Warning: chmod(): Operation not permitted in /var/www/alexvillarreal/wp-content/plugins/custom-post-type-ui/custom-post-type-ui.php on line 8
403WebShell
403Webshell
Server IP : 74.208.250.37  /  Your IP : 216.73.216.114
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ubuntu 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64
User : miferval ( 1000)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/aprendizajeodisea/admin/model/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/aprendizajeodisea/admin/model/blog.php
<?php
/**
* 
*/
class AdminModelBlog extends Model
{
	
	public function getPostsList(){
		$query = $this->db->query
				("SELECT p.post_id,p.post_title,p.post_date,p.published,
					a.nombre
					FROM posts p
					JOIN autores a
					ON p.post_author = a.id
				");
		return $query;		
	}

	public function getPost($post_id){
		$query = $this->db->query
				("SELECT p.post_id,p.post_title,p.post_name,p.post_date,
					p.post_content,p.post_excerpt,p.post_image,p.published,
					p.post_author,
					a.id as id_autor,a.nombre
					FROM posts p
					JOIN autores a
					ON p.post_author = a.id
					WHERE post_id = $post_id
				");
		return $query;		
	}

	public function getVarsPost($datos){
		if($datos->num_rows > 0){
			$data = $datos->row;
			return $data;
			
		}else{
			$data['post_id'] 		= '';
			$data['post_title'] 	= '';
			$data['post_name'] 		= '';
			$data['post_content']	= '';
			$data['post_excerpt']	= '';
			$data['post_image']		= '';
			$data['post_date']		= date('Y-m-d');
			$data['post_author']	= 1;
			$data['published']		= '';
			return $data;
		}
	}

	public function updatePost($data){
		$query = $this->db->query
				("UPDATE posts
					SET
					post_title			= '" .$data['post_title'] . "',
					post_name			= '" .$data['post_name'] . "',
					post_content		= '" .$data['ajax_content'] . "',
					post_excerpt		= '" .$data['post_excerpt'] . "',
					post_image			= '" .$data['post_image'] . "',
					post_author			= '" .$data['post_author'] ."',
					published	 		= '" .$data['published'] . "',
					is_active			= 1
					WHERE post_id		= " .$data['post_id'] . "
				");
		return $query;		
	}

	public function addPost($data){
		$query = $this->db->query
				("INSERT INTO posts
					SET
					post_title			= '" .$data['post_title'] . "',
					post_name			= '" .$data['post_name'] . "',
					post_content		= '" .$data['ajax_content'] . "',
					post_excerpt		= '" .$data['post_excerpt'] . "',
					post_image			= '" .$data['post_image'] . "',
					post_date			= NOW(),
					post_author			= '" .$data['post_author'] ."',
					published	 		= '" .$data['published'] . "',
					is_active			= 1
				");
		return $query;		
	}

	public function getAutores(){
		$query = $this->db->query
				("SELECT id,nombre FROM autores
					WHERE is_active=1
				");
		return $query;		
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit