-
AuthorPosts
-
conforturis Friend
conforturis
- Join date:
- April 2010
- Posts:
- 256
- Downloads:
- 0
- Uploads:
- 58
- Thanks:
- 59
- Thanked:
- 7 times in 1 posts
July 25, 2013 at 9:13 am #189213Hi,
How can I make List of Jobs module to show offers of a single category?HeR0 FriendHeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
July 25, 2013 at 9:48 am #500130Dear Conforturis,
I’m afraid that at this moment this module doesn’t support to filter jobs by categories.
conforturis Friendconforturis
- Join date:
- April 2010
- Posts:
- 256
- Downloads:
- 0
- Uploads:
- 58
- Thanks:
- 59
- Thanked:
- 7 times in 1 posts
July 25, 2013 at 2:12 pm #500145But we can do this changing the code. Tell me how?
It is really important.HeR0 FriendHeR0
- Join date:
- August 2011
- Posts:
- 3626
- Downloads:
- 0
- Uploads:
- 61
- Thanks:
- 33
- Thanked:
- 588 times in 549 posts
July 26, 2013 at 2:19 am #500179Pls do as follow to see one the example of customization.
– Open file mod_jalist_jobs.xml and add new params
<field name="cat_id" type="text" default="20" label="CATEGORY" description="CATEGORY_DESC" />
– Open file mod_jalist_jobs.php and add new code line
[PHP]$catid = intval($params->get( ‘cat_id’, 0 ));[/PHP]
after line[PHP]$mode = trim( $params->get( ‘mode’, ‘a.effected_date desc’ ) );[/PHP]
Change code line
[PHP]$all_items = modJAListJobsHelper::get_list_jobs($model, $limit, $mode);[/PHP]
to
[PHP]$all_items = modJAListJobsHelper::get_list_jobs($model, $limit, $mode, $catid);[/PHP]– Open file helper.php and custom condition to filter jobs by category then edit function get_list_jobs to
[PHP]function get_list_jobs( $model, $limit=20, $mode=”, $catid = 0 ){
global $jbconfig;
$mainframe = JFactory::getApplication();$limitstart = 0;
$where_more = ‘ a.status=’Approved’ ‘;
$where_more .= ‘ and(a.effected_date<=now()) and ( (DATE_ADD(a.effected_date, INTERVAL ‘. (int)$jbconfig[‘posts’]->get(‘posts_display_days’, 30). ‘ DAY) >= now() AND a.is_hotjob=0) or (DATE_ADD(a.effected_date, INTERVAL ‘. (int)$jbconfig[‘posts’]->get(‘posts_show_days_elapsed’, 30). ‘ DAY) >= now() AND a.is_hotjob=1) )’;
if($catid > 0){
$where_more .= ‘ and (a.cat_id LIKE ”.$catid.’,%’ OR a.cat_id LIKE ‘%,’.$catid.’,%’ OR a.cat_id LIKE ‘%,’.$catid.” OR a.cat_id = ‘.$catid.’) ‘;
}
if (JRequest::getVar(‘task’)!=’employer’) {
$filter_order = JRequest::getString(‘filter_order’, ”);
$filter_order_Dir = JRequest::getString(‘filter_order_Dir’, ‘DESC’);
if ($filter_order!=null) {
$mode = ”;
$mode .= $filter_order .’ ‘. $filter_order_Dir;
}
}
$all_items = $model->getItems($where_more, $limit, $limitstart, $mode);return $all_items;
}[/PHP]Hope this helps.
Regards
1 user says Thank You to HeR0 for this useful post
conforturis Friendconforturis
- Join date:
- April 2010
- Posts:
- 256
- Downloads:
- 0
- Uploads:
- 58
- Thanks:
- 59
- Thanked:
- 7 times in 1 posts
July 26, 2013 at 10:50 am #500227Works good!
Thanks -
AuthorPosts
This topic contains 5 replies, has 2 voices, and was last updated by conforturis 11 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum