Added default icon and referrer tracking

This commit is contained in:
Deon George
2013-04-14 18:31:53 +10:00
parent 00a9d3a057
commit 7d670ef236
4 changed files with 37 additions and 1 deletions

View File

@@ -29,6 +29,18 @@ class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {
$ro->date_last_refer = time();
$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.
$response = Response::factory();