bestempire

Topic: How to always moderate posts, not just the 1st one

Hello,

Is there any way for us to enable Jobberbase to ALWAYS moderate the new job post, not just the first post of an employer?

Thanks

putypuruty

Re: How to always moderate posts, not just the 1st one

Hi!

Yes, what you want can be done pretty easily - I'll post here the hack today, if I have time.

putypuruty

Re: How to always moderate posts, not just the 1st one

To achieve what you wish, open page_publish.php and replace the following lines

Code:

if ($postRequiresModeration)
{
    if ($isNewPost)
        $postMan->MailPublishPendingToUser($job->mPosterEmail);
    
    $html_title = $translations['jobs']['add_success'] . ' / ' . SITE_NAME;
}
else
{
    if (!$job->mIsActive)
        $job->Activate();
    
    if ($isNewPost)
        $postMan->MailPublishToUser($jobInfo);
    
    $html_title = $translations['jobs']['publish_success'] . ' / ' . SITE_NAME;
}

with

Code:

$postMan->MailPublishPendingToUser($job->mPosterEmail);
        
$html_title = $translations['jobs']['add_success'] . ' / ' . SITE_NAME;

$postRequiresModeration = true;

I gave it a try and it works.

bestempire

Re: How to always moderate posts, not just the 1st one

Wow, thanks alot putypuruty

I also tried and it worked. Only the email to admin doesnot contain the activate link

Best,

putypuruty

Re: How to always moderate posts, not just the 1st one

Aha, I didn't have a look at the admin mail. But the fix is pretty simple: just add the following line

Code:
$jobInfo['postRequiresModeration'] = $postRequiresModeration;

after

Code:
$postRequiresModeration = true;

It should work nicely now.

bestempire

Re: How to always moderate posts, not just the 1st one

Thanks putypuruty

I tried it but not worked however I managed the following way and it worked

in class.EmailTranslator.php in the     public function GetPublishToAdminMsg($data) I added this line

$msg = str_replace('{JOB_ACTIVATE_URL}', $data['activate_url'], $msg);

and in Email_en.xml at line 35 I added
                {BR} {JOB_ACTIVATE_URL}

putypuruty

Re: How to always moderate posts, not just the 1st one

Ok, my bad, sorry for this. I saw the code again and I realized that the simplest way would have been to replace

Code:
$postRequiresModeration = !$job->IsApprovedPosterEmail() && ENABLE_NEW_POST_MODERATION;

with

Code:
$postRequiresModeration = true;

and then the last line from my first solution is not needed + no need to modify class.EmailTranslator.php and Email_en.xml

davidarthurs

Re: How to always moderate posts, not just the 1st one

I notice when you moderate all posts that when a new job is submitted you get:

Congratulations, your job ad was published
View the new job ad.

but the view the new ad link produces an error at top of page ( at least on hire me template)

Warning: Cannot modify header information... header.tpl.php on line 4

should the 'View the new job ad' bit be removed for the system? where would it be found?

putypuruty

Re: How to always moderate posts, not just the 1st one

Please try this: in _templates/hireme/header.tpl replace the first 3 lines with the following line

Code:
{if $CURRENT_PAGE == 'page-unavailable' || $CURRENT_PAGE == 'job-unavailable'}{php}header("HTTP/1.0 404 Not Found");{/php}{/if}

Note that only the whitespace chars were removed.

Hope it helps.

davidarthurs

Re: How to always moderate posts, not just the 1st one

thanks - that removes the error.

where would I remove the 'View the new job ad' link that shows up on the congratulations page ?( as it is to be moderated the returned page is blank). I tried searching for the text but it returned nothing.