X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=application%2Fcontrollers%2Fcatalog.php;h=3ed020f44580a1f7cd5c9105c4d06f4f3595d47a;hb=ac366a43f0cda63c2506321104b6760c153ac993;hp=0c0538839527188a47141666057a90a6dd5b4467;hpb=954fc0210d9151cb86ca4dad6a955f59ba135915;p=living-lab-site.git diff --git a/application/controllers/catalog.php b/application/controllers/catalog.php index 0c05388..3ed020f 100644 --- a/application/controllers/catalog.php +++ b/application/controllers/catalog.php @@ -85,24 +85,25 @@ class Catalog extends CI_Controller { $this->load->view('html_end'); } - public function category($category_id, $offset = 0) + public function category($category_name, $offset = 0) { // ** // ** LOADING MODEL // ** + // Video Category + $categories = $this->config->item('categories'); + $category_id = array_search($category_name, $categories); + $vs_data['category_name'] = $category_name; + $vs_data['category_id'] = $category_id; + $vs_data['category_title'] = $category_name ? + $this->lang->line("ui_categ_$category_name") : $category_name; + // Retrieve videos summary. $this->load->model('videos_model'); $vs_data['videos'] = $this->videos_model->get_videos_summary( - $category_id, intval($offset), + $vs_data['category_id'], intval($offset), $this->config->item('videos_per_page')); - // Video Category - $categories = $this->config->item('categories'); - $category_name = $categories[$category_id]; - $vs_data['category_title'] = $category_name ? - $this->lang->line("ui_categ_$category_name") : $category_name; - $vs_data['category_id'] = $category_id; - // Pagination $this->load->library('pagination'); $pg_config['base_url'] = site_url("catalog/category/$category_id/");