Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    I’ve managed to figure it out. Here are the steps I followed for info.

    File: simple-job-board > public > js > simple-job-board-public.js
    1. Comment out this section (thanks abilderback1978)

    /* Empty File Upload Validation */
                //if (0 === document.getElementById("applicant_resume").files.length) {
    				//document.getElementById('file-error-message').innerHTML = application_form.jquery_alerts['empty_attachment'];
                    //return false;
    				//}

    2. Replace this code (thanks abilderback1978):

    if ($.inArray(file_ext, selected_file_exts) > -1) {
                    jobpost_submit_button.attr('disabled', false);
                }
                else {
                    /* Translation Ready String Through Script Locaization */
                    alert(application_form.jquery_alerts['invalid_extension']);
                    applicant_resume.val('');
                    return false;
                }

    with this code:

    if (0 === document.getElementById("applicant_resume").files.length){
                    jobpost_submit_button.attr('disabled', false);
                }
                else if ($.inArray(file_ext, selected_file_exts) > -1) {
    	            jobpost_submit_button.attr('disabled', false);
                }
                else {
                    alert('This is not an allowed file type.');
                    applicant_resume.val('');
                    return false;
                }

    File: simple-job-board > includes > class-simple-job-board-ajax.php
    1. Replace this code:

    if (!empty($newupload)) {
                $resume_name = $pid . '_' . $filename;
                $resume_url  = $url . '/' . $resume_name;
                $resume_path = $path . '/' . $resume_name;
                rename($uploadpath, $resume_path);
                add_post_meta($pid, 'resume', $resume_url);
                add_post_meta($pid, 'resume_path', $resume_path);
            }
    
            foreach ($_POST as $key => $val):
    
                if (substr($key, 0, 7) == 'jobapp_'):
                    add_post_meta($pid, $key, $val);
                endif;
            endforeach;

    with this:

    if (!empty($newupload)) {
                $resume_name = $pid . '_' . $filename;
                $resume_url = $url . '/' . $resume_name;
                $resume_path = $path . '/' . $resume_name;
                rename($uploadpath, $resume_path);
            }
    
            foreach ($_POST as $key => $val):
    
                if (substr($key, 0, 7) == 'jobapp_'):
                    add_post_meta($pid, $key, $val);
                endif;
                if (!empty($newupload)) {
                    add_post_meta($pid, 'resume', $resume_url);
                    add_post_meta($pid, 'resume_path', $resume_path);
                }
    
            endforeach;

    Thanks for the help!

    Hi all,

    PressTigers, fantastic plugin! Thank you 🙂

    I have recently updated to V2.2.2 and I would also like to make the ‘attach resume’ feature optional. My PHP skills aren’t the strongest, where (which file) do I put the code (below) posted by abilderback1978?

    if (0 === document.getElementById("applicant_resume").files.length){
    	            jobpost_submit_button.attr('disabled', false);
    }
    else if ($.inArray(file_ext, selected_file_exts) > -1) {
                    jobpost_submit_button.attr('disabled', false);
    }
    else {
                    /* Translation Ready String Through Script Locaization */
                    alert(application_form.jquery_alerts['invalid_extension']);
                    applicant_resume.val('');
                    return false;
    }

    Would highly appreciate the add-on. Do you have an idea when it might be released?

Viewing 2 replies - 1 through 2 (of 2 total)