<commit_before><?php  
	class Article extends CI_Model
	{
		function getArticleList($num=20, $start=0)
		{
			$this->db->select('title, DATE_FORMAT(tbl_cyberits_t_article.created,\'%d %b %y\') AS created ,username ,view ,LEFT(content, \'100\') AS content ,AVG(rating) as rating_per_article');
            $this->db->from('tbl_cyberits_t_article');
            $this->db->join('tbl_cyberits_m_user', 'tbl_cyberits_m_user.user_ID = tbl_cyberits_t_article.author_ID');
            $this->db->join('tbl_cyberits_t_comment','tbl_cyberits_t_comment.article_ID = tbl_cyberits_t_article.article_ID','left');
            $this->db->order_by('tbl_cyberits_t_article.created','desc');
            $this->db->group_by('tbl_cyberits_t_article.article_ID');
            $this->db->limit($num,$start);
			$query=$this->db->get();
			return $query->result_array();
		}
	}
?><commit_msg>re add article model functions<commit_after><?php  
	class Article extends CI_Model
	{
		function get_article_list($num=20, $start=0)
		{
			$this->db->select('title, DATE_FORMAT(tbl_cyberits_t_article.created,\'%d %b %y\') AS created ,username ,view ,LEFT(content, \'100\') AS content ,AVG(rating) as rating_per_article')->from('tbl_cyberits_t_article')->join('tbl_cyberits_m_user', 'tbl_cyberits_m_user.user_ID = tbl_cyberits_t_article.author_ID')->join('tbl_cyberits_t_comment','tbl_cyberits_t_comment.article_ID = tbl_cyberits_t_article.article_ID' )->order_by('tbl_cyberits_t_article.created','desc')->group_by('tbl_cyberits_t_article.article_ID')->limit($num,$start);
			$query=$this->db->get();
			return $query->result_array();
		}

		function get_article_detail($article_ID)
		{
			$this->db->select('title, DATE_FORMAT(tbl_cyberits_t_article.created,\'%d %b %y\') AS created ,username ,view ,content ,AVG(rating) as rating_per_article, img_link, user_img')->from('tbl_cyberits_t_article')->join('tbl_cyberits_m_user', 'tbl_cyberits_m_user.user_ID = tbl_cyberits_t_article.author_ID')->join('tbl_cyberits_t_comment','tbl_cyberits_t_comment.article_ID = tbl_cyberits_t_article.article_ID' )->order_by('tbl_cyberits_t_article.created','desc')->group_by('tbl_cyberits_t_article.article_ID');
			$query=$this->db->get();
			return $query->result_array();
		}

		function get_article_comments($num=20, $start=0, $article_ID)
		{
			$this->db->select('DATE_FORMAT(tbl_cyberits_t_comment.created,\'%d %b %y\') AS created, name, rating, comment')->from('tbl_cyberits_t_comment')->where('article_ID', $article_ID)->order_by('tbl_cyberits_t_comment.created')->limit($num,$start);
			$query=$this->db->get();
			return $query->result_array();
		}

		function insert_comment()
		{
			$this->db->insert('tbl_article_t_comment',$data);
			return $this->db->insert_id();
		}
	}
?>
{'fraction_non_alphanumeric': 0.1727405247813411, 'fraction_numerical': 0.005466472303206997, 'mean_word_length': 6.281167108753316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 56, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '945614', 'n_tokens_mistral': 1079, 'n_tokens_neox': 1013, 'n_words': 113}