grubix

Topic: New public job post - ALWAYS require admin confirmation

Need admin to confirm every job listing before it is published? Very simple (JB 1.9).

load up class.Job.php.

Find:

Code:
    public function IsApprovedPosterEmail()
    {
        global $db;
        $sql = 'SELECT poster_email FROM '.DB_PREFIX.'jobs 
                          WHERE poster_email = "' . strtolower($this->mPosterEmail) . '" AND id <> ' . $this->mId . ' AND is_temp = 0
                                 AND (is_active = 1 OR (is_active = 0 AND created_on < DATE_SUB(NOW(), INTERVAL 30 DAY)))';

        $result = $db->query($sql);
                
        $row = $result->fetch_assoc();
        if (!empty($row['poster_email']))
        {
            return 1;
        }
        else
        {
            return 0;
        }
    }

and put /* before it and */ after it. This will "comment out" the PHP code and stop the function activating. It will look like this:

Code:
    /*public function IsApprovedPosterEmail()
    {
        global $db;
        $sql = 'SELECT poster_email FROM '.DB_PREFIX.'jobs 
                          WHERE poster_email = "' . strtolower($this->mPosterEmail) . '" AND id <> ' . $this->mId . ' AND is_temp = 0
                                 AND (is_active = 1 OR (is_active = 0 AND created_on < DATE_SUB(NOW(), INTERVAL 30 DAY)))';

        $result = $db->query($sql);
                
        $row = $result->fetch_assoc();
        if (!empty($row['poster_email']))
        {
            return 1;
        }
        else
        {
            return 0;
        }
    }*/

Then just add the following lines underneath:

Code:
    // always need confirmation
    public function IsApprovedPosterEmail(){
        return 0;
    }

and this tricks Jobberbase into always thinking the e-mail address is not approved to post jobs instantly.

gason

Re: New public job post - ALWAYS require admin confirmation

Thank you!
This works great and helped a lot smile

Anneharp22x

Re: New public job post - ALWAYS require admin confirmation

Thanks for the info. It proved to be useful... Ohh I like this forum..