Added default icon and referrer tracking
This commit is contained in:
parent
00a9d3a057
commit
7d670ef236
@ -29,6 +29,18 @@ class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {
|
|||||||
$ro->date_last_refer = time();
|
$ro->date_last_refer = time();
|
||||||
$ro->save();
|
$ro->save();
|
||||||
|
|
||||||
|
// Update our referrer info
|
||||||
|
$rfo = $ro->referrer->where('referrer','=',$this->request()->referrer())->find();
|
||||||
|
|
||||||
|
if (! $rfo->loaded()) {
|
||||||
|
$rfo->redir_id = $ro->id;
|
||||||
|
$rfo->referrer = $this->request()->referrer();
|
||||||
|
}
|
||||||
|
|
||||||
|
$rfo->count++;
|
||||||
|
$rfo->date_last_refer = $ro->date_last_refer;
|
||||||
|
$rfo->save();
|
||||||
|
|
||||||
// Prepare the response object.
|
// Prepare the response object.
|
||||||
$response = Response::factory();
|
$response = Response::factory();
|
||||||
|
|
||||||
|
@ -4,13 +4,17 @@
|
|||||||
* Main redirector model
|
* Main redirector model
|
||||||
*
|
*
|
||||||
* @package Redir
|
* @package Redir
|
||||||
* @subpackage Events
|
|
||||||
* @category Models
|
* @category Models
|
||||||
* @author Deon George
|
* @author Deon George
|
||||||
* @copyright (c) 2010-2013 Deon George
|
* @copyright (c) 2010-2013 Deon George
|
||||||
* @license http://dev.leenooks.net/license.html
|
* @license http://dev.leenooks.net/license.html
|
||||||
*/
|
*/
|
||||||
class Model_Redir extends ORM {
|
class Model_Redir extends ORM {
|
||||||
|
protected $_model_names_plural = FALSE;
|
||||||
protected $_table_names_plural = FALSE;
|
protected $_table_names_plural = FALSE;
|
||||||
|
|
||||||
|
protected $_has_many = array(
|
||||||
|
'referrer'=>array('far_key'=>'id'),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
20
application/classes/Model/Referrer.php
Normal file
20
application/classes/Model/Referrer.php
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?php defined('SYSPATH') or die('No direct access allowed.');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Main redirector model
|
||||||
|
*
|
||||||
|
* @package Redir
|
||||||
|
* @category Models
|
||||||
|
* @author Deon George
|
||||||
|
* @copyright (c) 2010-2013 Deon George
|
||||||
|
* @license http://dev.leenooks.net/license.html
|
||||||
|
*/
|
||||||
|
class Model_Referrer extends ORM {
|
||||||
|
protected $_model_names_plural = FALSE;
|
||||||
|
protected $_table_names_plural = FALSE;
|
||||||
|
|
||||||
|
protected $_belongs_to = array(
|
||||||
|
'redir'=>array(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
?>
|
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 814 B |
Reference in New Issue
Block a user