nimish79

Topic: Most Applied to Jobs on the Homepage

I wish to edit the Most Applied to Jobs section on the homepage. Basically, apply a condition that the Most Applied to Jobs should fetch results only from the jobs that were posted in the last 40 days. What has currently happened is that even jobs which are like 4-5 months old continue to appear on the homepage.

links

Re: Most Applied to Jobs on the Homepage

Hi,

To do this go in _includes/class.Job.php and search for a function called 'GetMostAppliedToJobs' (arround line 620).

In the function you'll have this code:

Code:

$sql = 'SELECT job_id, COUNT(id) as nr FROM job_applications GROUP BY job_id 
                       ORDER BY nr DESC ' . $sql_limit;

Replace it with:

Code:

$sql =  'SELECT job_id, COUNT( ja.id ) AS nr
FROM job_applications ja, jobs j
WHERE DATEDIFF( NOW( ) , j.created_on ) <40
AND j.id = ja.job_id
GROUP BY job_id
ORDER BY nr DESC  ' . $sql_limit;

Replace the '40' in order to increase/decrease the difference between now and the day since the job was posted.

Good luck!

nimish79

Re: Most Applied to Jobs on the Homepage

Thanks a ton for that.