Canada

Topic: Completely delete deleted jobs?

First, thank you all for this great software!
I got the new version (1.6).
This is the issue:
When a job listing is deleted via admin area I can still see links pointing to deleted job in "Most applied" and "Seen recently" sections on the homepage.

These links should be gone when delete button is pressed.

redjumpsuit

Re: Completely delete deleted jobs?

hi canada, make sure that the job ad is really deleted.

about it showing on most applied, u need to add a filter for "is_active = 1" so that it will only grab active ads. i noticed this too and that's all i have to add.

for seen recently, this is session based (if i am correct), maybe you can unset the session that populates the seen recently list

will host your job board for you at minimal cost! read more: http://mim.io/acb992

Canada

Re: Completely delete deleted jobs?

Thanx!
In includes folder open file class.job.php and find function GetMostAppliedToJobs.
Under, find:
AND j.id = ja.job_id AND

replace with:
AND j.id = ja.job_id AND is_active = 1

Tested and works.

For the second part however I am not sure how to unset the session for Seen recently link. I doubt any big issues could happen from leaving it as is.

evertsemeijn

Re: Completely delete deleted jobs?

Small problem... In version 1.6 you can't find

Code:
AND j.id = ja.job_id AND 

The function looks like this instead

Code:
public function GetMostAppliedToJobs($limit = false)
    {
        global $db;
        
        $jobs = array();
        
        if ($limit > 0)
        {
            $sql_limit = 'LIMIT ' . $limit;
        }
        $i = 0;
        $sql = 'SELECT ja.job_id, COUNT(ja.id) as nr FROM job_applications ja, jobs jbs WHERE ja.job_id = jbs.id GROUP BY ja.job_id 
                       ORDER BY nr DESC ' . $sql_limit;
        $result = $db->query($sql);
        while ($row = $result->fetch_assoc())
        {
            $current_job = new Job($row['job_id']);
            $jobs[$i] = $current_job->GetInfo();
            $jobs[$i]['apps'] = $row['nr'];
            $i++;
        }
        return $jobs;
    }

So, where do we need to put this?

Code:
AND is_active = 1
Member of Jobberbase Development Team - Templates/Usability :: Looking for installation and/or custom design? :: Beautiful Wordpress themes

putypuruty

Re: Completely delete deleted jobs?

Hi.

What you want is this:

Code:
$sql = 'SELECT ja.job_id, COUNT(ja.id) as nr FROM job_applications ja, jobs jbs WHERE ja.job_id = jbs.id AND jbs.is_active = 1 GROUP BY ja.job_id ORDER BY nr DESC ' . $sql_limit;