Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • mpolakovic Friend
    #194855

    I am trying to set up an xml job feed through the “export job data” menu. I have all the data elements working fine except for “company”. Is there some trick to getting the company name to display in the feed? I tried selecting “Company name” as the source for this field, but it always returns blank.

    Thanks!

    mpolakovic Friend
    #522923

    Sorry, didn’t mean to post this in the “solved” section. Can someone move it out please?
    Thanks!

    HeR0 Friend
    #523093

    It returns blank as that field is not in the Job Table. It is a field in the Employer Table. Actually, it requires PHP knowledge to get this done as you need to customise export function (eg. binding the database, setting up the xml template, mapping the company field with xml…). I am afraid I could not provide detailed guide on this.

    brentwilliams2 Friend
    #528264

    Hi mpolakovic,
    Here is what you need to do:

    Open up administrator/…/com_jajobboard/asset/XMLExportHelper.php

    Search for:

    $sql = "SELECT a.*, b.*, a.id as jobid from #__ja_jobs a LEFT JOIN #__users b ON a.user_id = b.id WHERE 1=1 $strCategory $strDes $strLocation $strTitle $strType

    Replace with this:

    $sql = "SELECT a.*, b.*, c.user_id_value, a.id as jobid from #__ja_jobs a
    LEFT JOIN #__users b ON a.user_id = b.id
    INNER JOIN #__ja_jobs_value c ON a.id = c.id
    WHERE 1=1 $strCategory $strDes $strLocation $strTitle $strType
    ORDER BY a.id DESC $limit ";

    That will pull the company name associated with the job post. Next, search for:

    $value = str_replace('%EXPIRE_DATE%', date('Y-m-d'), $value);

    Below that line, you can add your own custom variables. So for company name, add this:

    $value = str_replace('%JOB_COMPANY%', $data['user_id_value'], $value);

    Here are some more variables that might help:

    $value = str_replace('%JOB_ID%', $data['jobid'], $value);
    $value = str_replace('%JOB_TITLE%', $data['title'], $value);
    $value = str_replace('%JOB_CITY%', $data['city'], $value);

    $jobdetail = $data['job_detail'];
    $jobdetail = str_replace("Â","",$jobdetail);
    $jobdetail = strip_tags($jobdetail, '<p><li><ul><div>');
    $jobdetail = preg_replace("/<(*)[^>]*?(/?)>/i",'<$1$2>', $jobdetail);

    $value = str_replace('%JOB_DESC%', $jobdetail, $value);
    $location_id_alias = getLocation($data['location_id']);
    $value = str_replace('%JOB_STATE%', trim($location_id_alias), $value);
    $category_alias = getCategories($data['cat_id']);
    $value = str_replace('%JOB_CAT%', $category_alias, $value);

    All of these can be used when you click XML Schemes > Configure XML Structure. Please note that the new options will not show up in the drop down menu – you have to manually type them in.

Viewing 4 posts - 1 through 4 (of 4 total)

This topic contains 4 replies, has 3 voices, and was last updated by  brentwilliams2 10 years, 1 month ago.

We moved to new unified forum. Please post all new support queries in our New Forum