From: Calin Burloiu Date: Thu, 25 Aug 2011 15:13:34 +0000 (+0300) Subject: layout improved; About page completed X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?p=living-lab-site.git;a=commitdiff_plain;h=211dc651c32bb8998b3eb2fdd3a3b85fc31921ec layout improved; About page completed --- diff --git a/application/config/routes.php b/application/config/routes.php index 8b85ff6..5a01524 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -46,6 +46,7 @@ $route['watch/([\d]+)/(.+)'] = "video/watch/$1/$2"; // Article pages $route['about'] = 'article/about'; $route['help'] = 'article/help'; +$route['install-plugins'] = 'article/install-plugins'; diff --git a/application/controllers/article.php b/application/controllers/article.php index dda09f7..4ff9ba6 100644 --- a/application/controllers/article.php +++ b/application/controllers/article.php @@ -43,11 +43,11 @@ class Article extends Article_Controller { $this->load->view('html_begin', $this->html_head_params); $this->load->view('header', array('selected_menu' => $method)); - $this->load->view('echo', - array('output' => $this->_load($method, $params), - 'clear' => TRUE) - ); - + $main_params['content'] = $this->_load($method, $params); + // TODO side + $main_params['side'] = '

Side Box

TODO: Put side box content here

'; + $this->load->view('main', $main_params); + $this->load->view('footer'); $this->load->view('html_end'); } diff --git a/application/controllers/catalog.php b/application/controllers/catalog.php index 23a2f17..f3df836 100644 --- a/application/controllers/catalog.php +++ b/application/controllers/catalog.php @@ -57,7 +57,10 @@ class Catalog extends CI_Controller { $this->load->view('html_begin', $this->html_head_params); $this->load->view('header', array('selected_menu' => 'home')); - $this->load->view('catalog/index_view', $data); + $main_params['content'] = $this->load->view('catalog/index_view', $data, TRUE); + // TODO: side + $main_params['side'] = '

Side Box

TODO: Put side box content here

'; + $this->load->view('main', $main_params); $this->load->view('footer'); $this->load->view('html_end'); @@ -65,7 +68,25 @@ class Catalog extends CI_Controller { public function test($page = 0) { + $params = array( 'title' => 'Test - '. $this->config->item('site_name'), + 'css' => array( + 'jquery-ui.css' + ), + //'js' => array(), + //'metas' => array('description'=>'','keywords'=>'') + ); + $this->load->library('html_head_params', $params); + // ** + // ** LOADING VIEWS + // ** + $this->load->view('html_begin', $this->html_head_params); + $this->load->view('header', array('selected_menu' => 'home')); + + $this->load->view('echo', array('output'=>'Test Page', 'clear'=>TRUE)); + + $this->load->view('footer'); + $this->load->view('html_end'); } public function category($category_id, $offset = 0) @@ -101,7 +122,10 @@ class Catalog extends CI_Controller { $vs_data, TRUE); $params = array( 'title' => $this->config->item('site_name'), - 'css' => array('catalog.css'), + 'css' => array( + 'catalog.css', + 'jquery-ui.css' + ), //'js' => array(), //'metas' => array('description'=>'','keywords'=>'') ); @@ -113,7 +137,10 @@ class Catalog extends CI_Controller { $this->load->view('html_begin', $this->html_head_params); $this->load->view('header'); - $this->load->view('catalog/category_view', $data); + $main_params['content'] = $this->load->view('catalog/category_view', $data, TRUE); + // TODO: side + $main_params['side'] = '

Side Box

TODO: Put side box content here

'; + $this->load->view('main', $main_params); $this->load->view('footer'); $this->load->view('html_end'); diff --git a/application/helpers/video_helper.php b/application/helpers/video_helper.php new file mode 100644 index 0000000..64efee5 --- /dev/null +++ b/application/helpers/video_helper.php @@ -0,0 +1,104 @@ + $b_Mp ? 1 : -1; +} + +/** + * Return the index of the $haystack element which has the closest resolution + * to $needle resolution string. + * @param array $haystack + * @param string $needle + * @param function $access_function filters input parameters by doing something + * like $a = $access_function($a). Leave it NULL for no filtering. + */ +function get_closest_res($haystack, $needle, $access_function = NULL) +{ + $d_min = INF; + $i_min = FALSE; + + foreach($haystack as $i => $elem) + { + if ($access_function !== NULL) + $elem = $access_function($elem); + + $d = abs(res_to_width($elem) * res_to_height($elem) + - res_to_width($needle) * res_to_height($needle)); + if ($d < $d_min) + { + $d_min = $d; + $i_min = $i; + } + } + + return $i_min; +} + +/* End of file video_helper.php */ +/* Location: ./application/helpers/video_helper.php */ \ No newline at end of file diff --git a/application/language/english/ui_lang.php b/application/language/english/ui_lang.php index 00be54a..adbbb0c 100644 --- a/application/language/english/ui_lang.php +++ b/application/language/english/ui_lang.php @@ -2,6 +2,7 @@ // Navigation Menu $lang['ui_nav_menu_home'] = 'Home'; +$lang['ui_nav_menu_install_plugins'] = 'Install Plugins'; $lang['ui_nav_menu_about'] = 'About'; $lang['ui_nav_menu_log_in'] = 'Log In'; $lang['ui_nav_menu_register'] = 'Register'; diff --git a/application/language/romanian/ui_lang.php b/application/language/romanian/ui_lang.php index df457a9..7417d32 100644 --- a/application/language/romanian/ui_lang.php +++ b/application/language/romanian/ui_lang.php @@ -2,6 +2,7 @@ // Navigation Menu $lang['ui_nav_menu_home'] = 'Acasă'; +$lang['ui_nav_menu_install_plugins'] = 'Instalare Plugin-uri'; $lang['ui_nav_menu_about'] = 'Despre'; $lang['ui_nav_menu_log_in'] = 'Autentificare'; $lang['ui_nav_menu_register'] = 'Înregistrare'; diff --git a/application/models/videos_model.php b/application/models/videos_model.php index 922efd4..ec7bb39 100644 --- a/application/models/videos_model.php +++ b/application/models/videos_model.php @@ -7,7 +7,7 @@ * @author Călin-Andrei Burloiu */ class Videos_model extends CI_Model { - private $db = NULL; + public $db = NULL; public function __construct() { @@ -119,6 +119,8 @@ class Videos_model extends CI_Model { */ public function get_video($id, $name = NULL) { + $this->load->helper('video'); + $query = $this->db->query('SELECT * FROM `videos` WHERE id = ?', $id); @@ -143,6 +145,12 @@ class Videos_model extends CI_Model { asort($video['tags']); $video['tags'] = array_reverse($video['tags'], TRUE); + // Sort assets by their megapixels number. + function access_function($a) { return $a['res']; } + function assets_cmp($a, $b) + { return megapixels_cmp($a, $b, "access_function"); } + usort($video['assets'], "assets_cmp"); + // Torrents $video['url'] = array(); foreach ($video['assets'] as & $asset) diff --git a/application/views/article/english/about.php b/application/views/article/english/about.php index 204d9c4..af88507 100644 --- a/application/views/article/english/about.php +++ b/application/views/article/english/about.php @@ -1 +1,71 @@ -About us! \ No newline at end of file +

P2P-Next

+

P2P-Next is an integrated FP7 EU project involving more than 20 partners, including University Politehnica of Bucharest (UPB).

+

P2P-Next aims to build the next generation Peer-to-Peer (P2P) content delivery platform.

+

This site provides information on UPB's contribution to the P2P-Next project activities. We are currently part of WP4 (Work Package 4 - IPvNext Networking Fabric) and WP8 (Work Package 8 - Living Lab Trials).

+ +

NextShare Video Plugins

+
+
NextSharePC
+
a media-player browser plugin which uses VLC libraries for video rendering and incorporates P2P technology for VideoOnDemand (VoD) and LiveStreaming content delivery. The plugin is currently working with Internet Explorer and Firefox on Windows.
+
+
+
SwarmPlayer
+
a browser plugin which uses the new HTML5 rendering and incorporates P2P technology for VideoOnDemand (VoD) and LiveStreaming content delivery
+
+ + + + + + + + + + + + + + + + + + + + +
Video RenderingOperating SystemsWeb Browsers
+ NextSharePC + + win VLC + +

win Windows

+

win Mac OS X

+
+

win Mozilla Firefox 3.5 or greater

+

win Internet Explorer 7.0 or greater

+
+ SwarmPlayer + + win HTML5 + +

win Windows

+

win Linux

+

win Mac OS X

+
+

win Mozilla Firefox 3.5 or greater

+

win Internet Explorer 7.0 or greater

+
+ +

Video Assets

+

To take a look at the NextShare plugins in action, all you have to do is install them and then watch any video asset from this site.

+

Through the use of P2P technology, you will be able to stream movies from various categories:

+ +

All available movies are currently seeded by 5 peers with high bandwidth (1Gbit) kindly provided by the NCIT-Cluster. Anyone that watches a movie will take part in the swarm and ensure greater availability to provided content.

+ + \ No newline at end of file diff --git a/application/views/article/english/install-plugins.php b/application/views/article/english/install-plugins.php new file mode 100644 index 0000000..1ef7494 --- /dev/null +++ b/application/views/article/english/install-plugins.php @@ -0,0 +1,11 @@ +

Install Plugins

+

install plugins instructions

+

install plugins instructions

+

install plugins instructions

+

install plugins instructions

+

install plugins instructions

+

install plugins instructions

+

install plugins instructions

+

install plugins instructions

+

install plugins instructions

+

install plugins instructions

\ No newline at end of file diff --git a/application/views/article/romanian/install-plugins.php b/application/views/article/romanian/install-plugins.php new file mode 100644 index 0000000..3fec15f --- /dev/null +++ b/application/views/article/romanian/install-plugins.php @@ -0,0 +1 @@ +Instalare Plugin-uri \ No newline at end of file diff --git a/application/views/catalog/category_view.php b/application/views/catalog/category_view.php index dccd2ed..c4c2ba3 100644 --- a/application/views/catalog/category_view.php +++ b/application/views/catalog/category_view.php @@ -1,7 +1 @@ -
-
- - - -
-
+ \ No newline at end of file diff --git a/application/views/catalog/index_view.php b/application/views/catalog/index_view.php index ac9a001..03ab7e5 100644 --- a/application/views/catalog/index_view.php +++ b/application/views/catalog/index_view.php @@ -1,9 +1,3 @@ -
-
- - -
-
+endforeach ?> \ No newline at end of file diff --git a/application/views/echo.php b/application/views/echo.php index 3c94e8c..ad4a9fd 100644 --- a/application/views/echo.php +++ b/application/views/echo.php @@ -1,4 +1,4 @@ - +