- Title: Member
- Status: Offline
- Registered: 2008-11-12
- Posts: 11
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.
- Title: Administrator
- Status: Offline
- Registered: 2008-08-20
- Posts: 234
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!
- Title: Member
- Status: Offline
- Registered: 2008-11-12
- Posts: 11
Re: Most Applied to Jobs on the Homepage
Posts [ 3 ]
Guest posting is disabled. You must login or register to post a reply.