mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-25 12:31:06 -05:00
Merge branch 'master' into 0.8.6-branch
This commit is contained in:
commit
bd9a2dbc7c
@ -293,14 +293,20 @@ class Pastes extends CI_Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
// hits
|
// hits
|
||||||
|
$hits_where = array(
|
||||||
|
'paste_id' => $pid,
|
||||||
|
);
|
||||||
$hits_data = array(
|
$hits_data = array(
|
||||||
'paste_id' => $pid,
|
'paste_id' => $pid,
|
||||||
'ip_address' => $this->input->ip_address() ,
|
'ip_address' => $this->input->ip_address() ,
|
||||||
'created' => mktime() ,
|
'created' => mktime() ,
|
||||||
);
|
);
|
||||||
$insert_query = $this->db->insert_string('trending', $hits_data);
|
$update_query = $this->db->update_string('trending', $hits_data, $hits_where);
|
||||||
$insert_query = str_replace('INSERT INTO', 'INSERT IGNORE INTO', $insert_query);
|
$this->db->query($update_query);
|
||||||
$this->db->query($insert_query);
|
if ($this->db->affected_rows() == 0) {
|
||||||
|
$insert_query = $this->db->insert_string('trending', $hits_data);
|
||||||
|
$this->db->query($insert_query);
|
||||||
|
}
|
||||||
|
|
||||||
if (mktime() > (60 + $data['hits_updated']))
|
if (mktime() > (60 + $data['hits_updated']))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user