I hereby claim:
- I am tomschlick on github.
- I am tomschlick (https://keybase.io/tomschlick) on keybase.
- I have a public key whose fingerprint is 5229 1B39 A2EE 92B4 9651 A0C2 1620 7AFA 1D44 7FF8
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
function _is_ajax() | |
{ | |
return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')); | |
} |
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
class MY_Log extends CI_Log | |
{ | |
var $mongo; | |
function __construct() | |
{ | |
$this->mongo = new Mongo("localhost"); |
function insert_blog_post($data) | |
{ | |
$this->db->insert('blog_posts', $data); | |
return $this->db->insert_id(); | |
} |
function delete_blog_posts($where) | |
{ | |
$this->db->where($where); | |
$this->db->delete(‘blog_posts’); | |
return $this->db->affected_rows(); | |
} |
< ?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
class Blog_model extends Model | |
{ | |
function __construct() | |
{ | |
parent::Model(); | |
} |
function update_blog_posts($where, $data) | |
{ | |
$this->db->where($where); | |
$this->db->update(‘blog_posts’, $data); | |
return $this->db->affected_rows(); | |
} |
function get_blog_post($where) | |
{ | |
$this->db->where($where); | |
$query = $this->db->get(‘blog_posts’, 1); | |
if($query->num_rows() == 1) | |
{ | |
return $query->row_array(); | |
} | |
return FALSE; | |
} |
function ordinal($n) | |
{ | |
$ln = (int) substr($n, -1); | |
$sln = (int) substr($n, -2); | |
$r = array('st','nd','rd'); | |
$es = (($sln < 11 || $sln > 19) && $ln > 0 && $ln < 4); | |
return $n . ($es ? $r[$ln - 1] : 'th'); | |
} |
<?php | |
$data = array( | |
array( | |
'info' => array( | |
'pet' => array( | |
'type' => 'dog' | |
) | |
), | |
), |