示例#1
0
 function display()
 {
     if (!JobBoardListHelper::rssEnabled()) {
         jexit(JText::_('COM_JOBBOARD_FEEDS_NOACCES'));
     }
     $selcat = JRequest::getInt('selcat', 1);
     $keywd = JRequest::getString('keysrch', '');
     $feed_model =& $this->getModel('Rss');
     $seldesc = $feed_model->getCatname($selcat);
     $_view =& $this->getView('rss', 'feed');
     $_view->setModel($feed_model, true);
     $_view->assign('seldesc', $seldesc);
     $_view->assign('selcat', $selcat);
     $_view->assign('keysrch', $keywd);
     $_view->display();
 }
示例#2
0
 function display($tpl = null)
 {
     jimport('joomla.utilities.date');
     $app = JFactory::getApplication();
     $this->data =& $this->get('Data');
     $featured_count = $this->countFeatured(&$this->data);
     $locsrch = $this->escape($this->locsrch);
     if ($featured_count > 0 && $locsrch != '') {
         $this->data = $this->sortFeatured(&$this->data);
     }
     $this->config =& $this->get('Querycfg', 'Config');
     $this->jobsearch =& $this->get('Search');
     $this->jobtypes =& $this->get('JobTypes');
     $this->jobcareerlvls =& $this->get('Careerlvls');
     $this->jobedlvls =& $this->get('Edlvls');
     if ($this->config->use_location == true) {
         $this->radii =& $this->get('Distances');
         $this->dist_symbol = $this->config->distance_unit == 0 ? JText::_('COM_JOBBOARD_DIST_METRIC') : JText::_('COM_JOBBOARD_DIST_IMPERIAL');
         $this->sel_distance = $app->getUserStateFromRequest("com_jobboard.sel_distance", 'sel_distance', $this->config->default_distance, 'int');
         $geo_address = $app->getUserState('com_jobboard.geo_address');
         $this->assign('geo_address', $geo_address);
     }
     $this->featured_count = $featured_count;
     $this->filter_job_type = $app->getUserStateFromRequest("com_jobboard.filter_job_type", 'filter_job_type', array(), 'array');
     $this->filter_careerlvl = $app->getUserStateFromRequest("com_jobboard.filter_careerlvl", 'filter_careerlvl', array(), 'array');
     $this->filter_edulevel = $app->getUserStateFromRequest("com_jobboard.filter_edulevel", 'filter_edulevel', array(), 'array');
     $this->pagination =& $this->get('Pagination');
     $this->categories =& $this->get('Categories');
     $this->setstate = JobBoardHelper::renderJobBoard();
     $this->jobsearch = $this->escape($this->jobsearch);
     $this->keysrch = $this->escape($this->keysrch);
     $this->locsrch = $locsrch;
     $retries = $app->getUserState('com_jobboard.member.retry', 0, 'int');
     $this->retries = $retries;
     $this->user_entry_point = 'com_users';
     if (version_compare(JVERSION, '2.5.0', 'ge') || version_compare(JVERSION, '1.7.0', 'ge') || version_compare(JVERSION, '1.6.0', 'ge')) {
         $this->user_entry_point = 'com_users';
     } elseif (version_compare(JVERSION, '1.5.0', 'ge')) {
         $this->user_entry_point = 'com_user';
     }
     $this->_addScripts();
     $this->rss_on = JobBoardListHelper::rssEnabled();
     $document =& JFactory::getDocument();
     parent::display($tpl);
 }
示例#3
0
 ?>
         <?php 
 foreach ($this->data as $row) {
     ?>
             <?php 
     $row_style = $rt == 0 ? 'bgwhite' : 'bggrey';
     ?>
             <?php 
     $rt = $rt == 0 ? 1 : 0;
     ?>
             <!-- job coloring -->
 				<?php 
     if ($this->config->jobtype_coloring == 1) {
         ?>
 					<?php 
         $jt_color = '<span class="jobtype ' . JobBoardListHelper::getClass($row->job_type) . '">' . JText::_($row->job_type) . '</span>';
         ?>
 				<?php 
     } else {
         ?>
 					<?php 
         $jt_color = '<br />';
         ?>
 				<?php 
     }
     ?>
 			<!-- end job coloring -->
             <?php 
     if ($row->featured == 1) {
         $row_style .= ' featured';
     }
示例#4
0
 function display($tpl = null)
 {
     jimport('joomla.utilities.date');
     $app = JFactory::getApplication();
     $app->setUserState("com_jobboard.jobsearch", '');
     $app->setUserState("com_jobboard.keysrch", '');
     $app->setUserState("com_jobboard.locsrch", '');
     $app->setUserState('com_jobboard.daterange', 0);
     $app->setUserState('com_jobboard.list.country_id', 0);
     $app->setUserState('com_jobboard.list.sort', '');
     $app->setUserState('com_jobboard.list.order', '');
     $app->setUserState('com_jobboard.list.selcat', 1);
     $app->setUserState("com_jobboard.sel_distance", null);
     $app->setUserState("com_jobboard.filter_job_type", array());
     $app->setUserState("com_jobboard.filter_careerlvl", array());
     $app->setUserState("com_jobboard.filter_edulevel", array());
     $app->setUserState('com_jobboard.list.layout', 'table');
     $this->data =& $this->get('Data');
     $app->setUserState('com_jobboard.list.layout', $this->layout);
     $featured_count = $this->countFeatured(&$this->data);
     $locsrch = $this->escape($this->locsrch);
     if ($featured_count > 0) {
         $split_data = $this->sortFeatured(&$this->data);
         $this->featured_jobs = $split_data[0];
         $this->latest_jobs = $split_data[1];
         unset($split_data, $this->data);
     } else {
         $this->featured_jobs = array();
         $latest_jobs = array();
         for ($j = 0; $j < 5; $j++) {
             if (isset($this->data[$j])) {
                 $latest_jobs[] = $this->data[$j];
             }
         }
         $this->latest_jobs = $latest_jobs;
         unset($latest_jobs, $this->data);
     }
     $this->config =& $this->get('Querycfg', 'Config');
     $this->jobsearch =& $this->get('Search');
     $this->jobtypes =& $this->get('JobTypes');
     $this->jobcareerlvls =& $this->get('Careerlvls');
     $this->jobedlvls =& $this->get('Edlvls');
     $this->intro_cats =& $this->get('IntroCats', 'Jobboard');
     if ($this->config->use_location == true) {
         $this->radii =& $this->get('Distances');
         $this->dist_symbol = $this->config->distance_unit == 0 ? JText::_('COM_JOBBOARD_DIST_METRIC') : JText::_('COM_JOBBOARD_DIST_IMPERIAL');
         $this->sel_distance = $app->setUserState("com_jobboard.sel_distance", $this->config->default_distance, 'int');
         $geo_address = $app->getUserState('com_jobboard.geo_address');
         $this->assign('geo_address', $geo_address);
     }
     $this->featured_count = $featured_count;
     $this->filter_job_type = $app->getUserStateFromRequest("com_jobboard.filter_job_type", 'filter_job_type', array(), 'array');
     $this->filter_careerlvl = $app->getUserStateFromRequest("com_jobboard.filter_careerlvl", 'filter_careerlvl', array(), 'array');
     $this->filter_edulevel = $app->getUserStateFromRequest("com_jobboard.filter_edulevel", 'filter_edulevel', array(), 'array');
     $this->categories =& $this->get('Categories');
     $this->setstate = JobBoardHelper::renderJobBoard();
     $this->jobsearch = $this->escape($this->jobsearch);
     $this->keysrch = $this->escape($this->keysrch);
     $this->locsrch = $locsrch;
     $retries = $app->getUserState('com_jobboard.member.retry', 0, 'int');
     $this->retries = $retries;
     $this->user_entry_point = 'com_users';
     if (version_compare(JVERSION, '2.5.0', 'ge') || version_compare(JVERSION, '1.7.0', 'ge') || version_compare(JVERSION, '1.6.0', 'ge')) {
         $this->user_entry_point = 'com_users';
     } elseif (version_compare(JVERSION, '1.5.0', 'ge')) {
         $this->user_entry_point = 'com_user';
     }
     $this->_addScripts();
     $this->rss_on = JobBoardListHelper::rssEnabled();
     $document =& JFactory::getDocument();
     parent::display($tpl);
 }
示例#5
0
 function display($tpl = null)
 {
     if (!JobBoardListHelper::rssEnabled()) {
         jexit(JText::_('COM_JOBBOARD_FEEDS_NOACCES'));
     }
     $catid = $this->selcat;
     $keywd = $this->keysrch;
     $document =& JFactory::getDocument();
     $document->setLink(JRoute::_('index.php?option=com_jobboard&selcat=' . $catid));
     // get category name
     $db =& JFactory::getDBO();
     $query = 'SELECT ' . $db->nameQuote('type') . ' FROM ' . $db->nameQuote('#__jobboard_categories') . ' WHERE ' . $db->nameQuote('id') . ' = ' . $catid;
     $db->setQuery($query);
     $seldesc = $db->loadResult();
     // get "show location" settings:
     $query = 'SELECT ' . $db->nameQuote('use_location') . ' FROM ' . $db->nameQuote('#__jobboard_config') . ' WHERE ' . $db->nameQuote('id') . ' = 1';
     $db->setQuery($query);
     $use_location = $db->loadResult();
     // get the items to add to the feed
     $where = $catid == 1 ? '' : ' WHERE c.' . $db->nameQuote('id') . ' = ' . $catid;
     $tag_include = strlen($keywd);
     if ($tag_include > 0 && $catid == 1) {
         $tag_requested = $this->checkTagRequest($keywd);
         $where .= $tag_requested != '' ? " WHERE j." . $db->nameQuote('job_tags') . " LIKE '%{$tag_requested}%' " : '';
     }
     $limit = 10;
     $where .= ' AND (DATE_FORMAT(j.expiry_date,"%Y-%m-%d") >= CURDATE() OR DATE_FORMAT(j.expiry_date,"%Y-%m-%d") = 0000-00-00) ';
     $query = 'SELECT
                   j.`id`
                   , j.`post_date`
                   , j.`job_title`
                   , j.`job_type`
                   , j.`country`
                   , c.`type` AS category
                   , cl.`description` AS job_level
                   , j.`description`
                   , j.`city`
               FROM
                   `#__jobboard_jobs` AS j
                   INNER JOIN `#__jobboard_categories`  AS c
                       ON (j.`category` = c.`id`)
                   INNER JOIN `#__jobboard_career_levels` AS cl
                       ON (j.`career_level` = cl.`id`)
                   ' . $where . '
                   ORDER BY j.`post_date` DESC LIMIT ' . $limit;
     $db->setQuery($query);
     $rows = $db->loadObjectList();
     $site_name = $_SERVER['SERVER_NAME'];
     if ($tag_requested != '') {
         $document->setDescription(JText::_('JOBS_WITH') . ' "' . ucfirst($tag_requested) . '" ' . JText::_('KEYWD_TAG'));
         $rss_title = $site_name . ': ' . JText::_('JOBS_WITH') . ' "' . ucfirst($tag_requested) . '" ';
     } else {
         $document->setDescription(JText::_('RSS_LATEST_JOBS') . ': ' . $seldesc);
         $rss_title = $site_name . ': ' . JText::_('RSS_LATEST_JOBS') . ': ' . $seldesc;
     }
     $document->setTitle($rss_title);
     foreach ($rows as $row) {
         // create a new feed item
         $job = new JFeedItem();
         // assign values to the item
         $job_date = new JDate($row->post_date);
         $job_pubDate = new JDate();
         $job->category = $row->category;
         $job->date = $job_date->toRFC822();
         $job->description = $this->trimDescr(html_entity_decode($this->escape($row->description)), '.');
         $link = htmlentities('index.php?option=com_jobboard&view=job&id=' . $row->id);
         $job->link = JRoute::_($link);
         $job->pubDate = $job_pubDate->toRFC822();
         if ($use_location) {
             $job_location = $row->country != 266 ? ', ' . $row->city : ', ' . JText::_('WORK_FROM_ANYWHERE');
         } else {
             $job_location = '';
         }
         $job->title = JText::_('JOB_VACANCY') . ': ' . html_entity_decode($this->escape($row->job_title . $job_location . ' (' . JText::_($row->job_type) . ')'));
         // add item to the feed
         $document->addItem($job);
     }
 }