Skip to content

Commit

Permalink
Add home page CTR. #17
Browse files Browse the repository at this point in the history
  • Loading branch information
MathieuNls committed Jul 9, 2015
1 parent 56f652c commit c833f17
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
13 changes: 11 additions & 2 deletions application/controllers/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,31 @@ function result(){
private function homeMessage(){

$randBrands = rand ( 0 , 2 );
$randWatches = rand ( 0 , 3 );

$watchBrands = array('Seiko', 'Rolex', 'Omega');
$videos = array('Omega', 'Rolex', 'Zenith', 'Vacheron');

$video = vid_url('Zenith.mp4');

if(!$this->user->isLoggedIn()){

$homePage = "HOME_PAGE_" . $randWatches;

$this->event->add($this->event->{$homePage});

}

if(!$this->agent->is_mobile()){
return array('title'=>$this->measure
->getMeasuresCountByWatchBrand($watchBrands[$randBrands]) .
' ' . $watchBrands[$randBrands] . ' measured on Toolwatch.io',
'video_url'=>vid_url($videos[rand ( 0 , 3 )]) . '.mp4');
'video_url'=>vid_url($videos[$randWatches]) . '.mp4');
}else{
return array('title'=>$this->measure
->getMeasuresCountByWatchBrand($watchBrands[$randBrands]) .
' ' . $watchBrands[$randBrands] . ' measured on Toolwatch.io',
'video_url'=>img_url($videos[rand ( 0 , 3 )]) . '.png');
'video_url'=>img_url($videos[$randWatches]) . '.png');
}

}
Expand Down
12 changes: 10 additions & 2 deletions application/models/event.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ class Event extends MY_Model
public $ACCURACY_SOMETHING_WRONG = 25;
public $LOGIN_POPUP = 26;
public $SIGN_UP_POPUP = 27;
public $HOME_PAGE_0 = 28;
public $HOME_PAGE_1 = 29;
public $HOME_PAGE_2 = 30;
public $HOME_PAGE_3 = 31;
public $EVENT_STRING;

protected $nbEvent = 27;
protected $nbEvent = 31;
protected $masks;

function __construct()
Expand All @@ -47,7 +51,11 @@ function __construct()
'CTR_SIGNUP_FB' => array($this->SIGN_UP, $this->SIGN_UP_FB),
'CTR_LOGIN' => array($this->LOGIN_EMAIL, $this->LOGIN_POPUP),
'CTR_LOGIN_FB' => array($this->LOGIN_FB, $this->LOGIN_POPUP),
'MEASURE_COMPLETION' => array($this->NEW_ACCURACY, $this->NEW_MEASURE)
'MEASURE_COMPLETION' => array($this->NEW_ACCURACY, $this->NEW_MEASURE),
'CTR_HOME_0' => array($this->SIGN_UP, $this->HOME_PAGE_0),
'CTR_HOME_1' => array($this->SIGN_UP, $this->HOME_PAGE_1),
'CTR_HOME_2' => array($this->SIGN_UP, $this->HOME_PAGE_2),
'CTR_HOME_3' => array($this->SIGN_UP, $this->HOME_PAGE_3)
);

$this->EVENT_STRING = "'DATE',";
Expand Down

0 comments on commit c833f17

Please sign in to comment.