RedJumpsuit

jobberBase custom development and support

 

Code School

Require Approval for Every Job Post

on /_includes/class.Job.php, comment a line in this function:

public function Publish()
{
   global $db;
   if ($this->CheckPosterEmail())
     {
      // $sql = 'UPDATE jobs SET is_temp = 0, is_active = 1 WHERE id = ' . $this->mId;
     }
   else
      {
      $sql = 'UPDATE jobs SET is_temp = 0, is_active = 0 WHERE id = ' . $this->mId;
      }
    $db->query($sql);
}

and replace it with:

$sql = 'UPDATE jobs SET is_temp = 0, is_active = 0 WHERE id = ' . $this->mId;

This would force all job postings to require admin approval instead of checking whether the poster’s email has been approved before.

10 Comments

Code School

  1. hey buddy I want to remove activation by admin feature and tried your trick you given in jobberbase forum but somehow it doesn’t work…could you pls give a brief way to implement the trick.

  2. this post is the reverse process, this will require approval on every post. if you want to remove approval at all times, change all the $sql lines with this:

    $sql = ‘UPDATE jobs SET is_temp = 0, is_active = 1 WHERE id = ‘ . $this->mId;

  3. hi, it will email u so u only need to disable the email that is sending but the post has already been approved. this works just fine with me.

  4. Hello RedJumpSuit,

    I tried that, but it doesnt work on the site. on the above “public function Publish()”, I put in “1” two times. I still recieve a eMail where I have to manually verify the new eMail Adress. Are there more spots where I have to replace “0” to “1”? to delete the admins verification process?

    Thanks for your help.

    Warmest Regards,
    Marc-Oliver Gern

  5. make sure to check the function on /_includes/class.Job.php called “public function CheckPosterEmail()” and update the return value both to 1

  6. Hi, firstly – this makes a fantastic addition to Jobberbase. I always need to see any advert before it gets posted so this does just the job. I’ve got a slight problem though – I’m using the Jobberbased theme and for some reason this is now not working as it should.

    The good thing is that ads are not instantly posted but if a user has posted an ad previously with their email address then it says that the job has been successfully added and sends them the confirmation email when in actual fact it hasn’t.

    Any ideas?

  7. Arh, what I actually did to stop the confirmation email getting sent was to add Zero to this section:

    if (!empty($row[‘poster_email’]))
    {
    return 0;
    }
    else
    {
    return 0;
    }

  8. Hi RJ,

    Could you please explain, or give guidelines to make this an aditional option on the admin section, so we don’t have to hack the theme like this, maybe just have one more radio button option to let this work this way.

    Thanks in advance

  9. if you have some PHP programming skills, you should be able to add an additional setting in jobberBase admin to accommodate this using the example code here.

  10. For jobberbase v 1.9 Find in class.job.php the following block

    // Check if the poster of this post has posted before with this e-mail address
    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 query($sql);

    $row = $result->fetch_assoc();
    if (!empty($row[‘poster_email’]))
    {
    return 1;
    }
    else
    {
    return 0;
    }
    }

    replace it with

    // Check if the poster of this post has posted before with this e-mail address
    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 query($sql);

    $row = $result->fetch_assoc();
    if (!empty($row[‘poster_email’]))
    {
    return 0;
    }
    else
    {
    return 0;
    }
    }

    thank you

Leave a Response