<commit_before><?php defined('BASEPATH') OR exit('No direct script access allowed');

class Profile_model extends CI_Model{
    
    public function validate($username){
        $result = $this->db->query("SELECT * FROM useraccounts WHERE username='$username'");
        if($result->num_rows() > 0){
            $row = $result->row_array();
            $query = $this->db->query("SELECT useraccounts.username,CONCAT(extendedinfo.fname,' ',extendedinfo.lname) as name, extendedinfo.avatarpath,extendedinfo.uid,extendedinfo.coverpath,extendedinfo.covercoordinates,extendedinfo.about from extendedinfo,useraccounts where extendedinfo.uid = " . $row['srno']." and extendedinfo.uid = useraccounts.srno");
            $row_ = $query->row_array();
            return $row_;
        }
        return false;
    }
    public function get_thread_count($uid){
        $query = $this->db->query("SELECT * FROM thread where uid = " . (int)$uid . "");
        $result = $query->num_rows();
        return $result;
    }
    public function get_reply_count($uid){
        $query = $this->db->query("SELECT * FROM reply where uid = " . (int)$uid . "");
        $result = $query->num_rows();
        return $result;
    }
    
    public function get_correct_reply_count($uid) {
        $query = $this->db->query("SELECT * FROM REPLY where uid = " . (int)$uid . " AND correct = 1");
        $result = $query->num_rows();
        return $result;
    }
    
    public function get_timeline($uid){
        $response = '';
        $query = $this->db->query("SELECT * FROM activitylog WHERE uid = " . (int)$uid . " ORDER BY timestamp DESC");
        if($query->num_rows() > 0){<commit_msg>Solved errors by updateding sql query to get reply cnt<commit_after><?php defined('BASEPATH') OR exit('No direct script access allowed');

class Profile_model extends CI_Model{
    
    public function validate($username){
        $result = $this->db->query("SELECT * FROM useraccounts WHERE username='$username'");
        if($result->num_rows() > 0){
            $row = $result->row_array();
            $query = $this->db->query("SELECT useraccounts.username,CONCAT(extendedinfo.fname,' ',extendedinfo.lname) as name, extendedinfo.avatarpath,extendedinfo.uid,extendedinfo.coverpath,extendedinfo.covercoordinates,extendedinfo.about from extendedinfo,useraccounts where extendedinfo.uid = " . $row['srno']." and extendedinfo.uid = useraccounts.srno");
            $row_ = $query->row_array();
            return $row_;
        }
        return false;
    }
    public function get_thread_count($uid){
        $query = $this->db->query("SELECT * FROM thread where uid = " . (int)$uid . "");
        $result = $query->num_rows();
        return $result;
    }
    public function get_reply_count($uid){
        $query = $this->db->query("SELECT * FROM reply where uid = " . (int)$uid . "");
        $result = $query->num_rows();
        return $result;
    }
    
    public function get_correct_reply_count($uid) {
        $query = $this->db->query("SELECT * FROM reply where uid = " . (int)$uid . " AND correct = 1");
        $result = $query->num_rows();
        return $result;
    }
    
    public function get_timeline($uid){
        $response = '';
        $query = $this->db->query("SELECT * FROM activitylog WHERE uid = " . (int)$uid . " ORDER BY timestamp DESC");
        if($query->num_rows() > 0){
{'fraction_non_alphanumeric': 0.1545750666271839, 'fraction_numerical': 0.0017767249037607344, 'mean_word_length': 2.9187935034802783, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '7373838', 'n_tokens_mistral': 1001, 'n_tokens_neox': 984, 'n_words': 224}