X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Server%2Fapplication%2Fcontrollers%2Fpages.php;h=3ff1bd984a9d55bbbc7a897aa8d125878a5ac1dc;hp=00e6507edc1b31fdb2e2aaa577891d4cf74e844d;hb=c9fc4fe3bc02ba4c440e4cb95097a1b8d1b37243;hpb=90b8ea7c1822225291dbe4042f918d8b4a5a039c diff --git a/Server/application/controllers/pages.php b/Server/application/controllers/pages.php index 00e6507..3ff1bd9 100644 --- a/Server/application/controllers/pages.php +++ b/Server/application/controllers/pages.php @@ -1,4 +1,11 @@ + * + */ class Pages_Controller extends Template_Controller { public $template = 'pages/base'; //defaults to template but you can set your own view file @@ -9,11 +16,152 @@ class Pages_Controller extends Template_Controller { { parent::__construct(); //necessary } + + + /** + * Generate lightbox markup + * + * @param array $images + */ + private function lightbox($images){ + $output = ''; + foreach ($images as $i){ + $output .= ''.$i['alt'].''; + } + return $output; + } public function index() { - $this->template->title = 'Maemo application for car enthusiasts'; + + $this->template->title = 'Maemo5 application for car enthusiasts and speed freaks'; $this->template->header = 'Home'; - $this->template->content = 'HOMEZ'; + + $this->template->content = ' +
+ +
+
+
+ +SpeedFreak is a free application for your mobile that allows you to measure your car\'s performance such as acceleration and top speed. In order to make it even +more interesting you can compete against others on our leaderboards to see who\'s car packs the most punch! +

+ +SpeedFreak is developed by group of enthusiastic programmers with passion for speed and OpenSource. If you want to get involved by contributing code, ideas, bug reports, translation and more just click on +community link! +'; + $this->template->sidebar_title = 'SpeedFreak for Nokia N900'; + $this->template->sidebar_content =' +
+

Download SpeedFreak for Nokia N900.

+

Download now

+'; + + + + } + + public function leaderboards($category='') + { + //@todo: Fix this hack. OMG what a horrible hack. That's what I get for coding at 4am =) + $categories = array('acceleration-0-20' => 'Acceleration from 0 to 20 km/h', 'acceleration-0-40' => 'Acceleration from 0 to 40 km/h', 'acceleration-0-100'=> 'Acceleration from 0 to 100 km/h'); + + if (!array_key_exists($category,$categories)) + $category='acceleration-0-100'; + + $this->template->title = $categories[$category]; + + $results = new Result_Model(); + if ($rows=$results->get_results($category,10)){ + $output = ''; + foreach ($rows as $r){ + $output .= ' + + '.$r->username.' + '.$r->value.' seconds + '.$r->result_date.' +'; + } + $output =' + + + + + + +'.$output.' +
NickRecord (seconds)Date
+ +'; + } + else + $output="No results :("; + + + + $this->template->header = $categories[$category]; + $this->template->content = $output; + $this->template->sidebar_title = 'Categories'; + $this->template->sidebar_content =' + +'; + + + + } + + public function screenshots() + { + $this->template->title = 'Screenshots'; + $this->template->header = 'Screenshots'; + $this->template->head = ' + + + + + '; + + $screenshots=array(); + $screenshots[0]['img']=1; + $screenshots[0]['alt']='Main window'; + $screenshots[0]['title']='OpenSource Maemo 5 application for car enthusiasts'; + + $screenshots[1]['img']=2; + $screenshots[1]['alt']='Acceleration screen'; + $screenshots[1]['title']='See how fast your car accelerates and compete for the first position on our leaderboards'; + + $screenshots[2]['img']=3; + $screenshots[2]['alt']='Categories window'; + $screenshots[2]['title']='You can compete in defferent categories'; + + $screenshots[3]['img']=4; + $screenshots[3]['alt']='Route window'; + $screenshots[3]['title']='Save your roadtrip route'; + + $screenshots[4]['img']=5; + $screenshots[4]['alt']='Registration window'; + $screenshots[4]['title']="Participating in our community is as easy as registering for an account"; + + $screenshots[5]['img']=6; + $screenshots[5]['alt']='Credits window'; + $screenshots[5]['title']='SpeedFreak is developed by a group of dedicated contributors. Join us and help make it even better!'; + + $lightbox = $this->lightbox($screenshots); + + $this->template->content = ' +'.$lightbox.' +'; + $this->template->sidebar_title = 'SpeedFreak for Nokia N900'; + $this->template->sidebar_content =' +
+

Download SpeedFreak for Nokia N900.

+

Download now

+'; + } } \ No newline at end of file