Exemplo n.º 1
0
/**
 * Set count of visited resume for current user
 */
function jobboard_set_user_view_count($user_id, $cpt)
{
    if (!is_user_logged_in() && !jobboard_package_is_enabled('_package_resume_view')) {
        return;
    } else {
        $count_key = 'single_visit_' . $cpt . '_' . $user_id;
        $user_count_meta = get_user_meta($user_id, $count_key, true);
        if ($user_count_meta == '') {
            $count = 0;
            delete_user_meta($user_id, $count_key);
            add_user_meta($user_id, $count_key, '0');
        } else {
            $count = $user_count_meta;
            $count++;
            update_user_meta($user_id, $count_key, $count);
        }
    }
}
Exemplo n.º 2
0
/**
 * Single resume template file
 *
 * @package WordPress
 * @subpackage Job_Board
 * @since Job Board 1.0
 *
 */
/**
 * Access for registered user only
 */
if (jobboard_package_is_enabled('_package_resume_view') && !is_user_logged_in()) {
    wp_redirect(add_query_arg('ups', 'please_login', jobboard_get_permalink('login')));
    exit;
}
if (jobboard_package_is_enabled('_package_resume_view') && jobboard_is_user_view_limit(get_current_user_id(), 'resume')) {
    wp_redirect(add_query_arg('status', 'subscription_exceeded', jobboard_get_permalink('dashboard')));
    exit;
}
get_header();
while (have_posts()) {
    the_post();
    get_template_part('template-parts/modal', 'contact_resume');
    $authorid = get_the_author_meta('ID');
    /**
     * Resume view subscription count
     */
    jobboard_set_single_post_visit(get_the_id());
    jobboard_set_user_view_count(get_current_user_id(), 'resume');
    ?>
<div id="page-title-wrapper">
        /**
         * Package options.
         */
        jobboard_active_package_html(get_current_user_id(), '');
        ?>

			</div><!-- /.col-md-6 -->

			<?php 
    }
    ?>

			<div class="col-md-6">

				<?php 
    if (jobboard_package_is_enabled('_package_resume_view') && get_user_meta($user_id, 'jobboard_user_role', true) == 'job_lister') {
        ?>
				<!-- Resume View Package -->

				<?php 
        /**
         * Resume view subscription options.
         */
        jobboard_active_package_html(get_current_user_id(), array('resume_view'));
        ?>

				<!-- Resume View Package Ends -->
				<?php 
    }
    ?>
					</div><!-- /.account-status-item -->
					<?php 
}
//endforeach;
?>



				</div><!-- /.account-job-status -->
			</div><!-- /.col-md-8 -->
		</div><!-- /.row -->



		<?php 
if (jobboard_package_is_enabled('_package_resume')) {
    ?>

		<!-- Package Menu -->
		<div class="row">

			<div class="col-md-12">

				<?php 
    /**
     * Package options.
     */
    jobboard_active_package_html(get_current_user_id(), '');
    ?>

			</div><!-- /.col-md-12 -->
Exemplo n.º 5
0
    function jobboard_add_user_extra_field($user)
    {
        if (!current_user_can('install_themes', $user->ID)) {
            return;
        }
        if (!current_user_can('edit_theme_options')) {
            $disabled = 'disabled="disabled"';
        } else {
            $disabled = '';
        }
        $old_value = get_user_meta($user->ID, 'jobboard_user_role', true);
        ?>
	<h3><?php 
        _e('Job Board Extra Profile Information', 'jobboard');
        ?>
</h3>

	<table class="form-table">
		<tr>
			<th><label for="jobboard_user_role"><?php 
        _e('User Role', 'jobboard');
        ?>
</label></th>

			<td>
				<select name="jobboard_user_role" id="jobboard_user_role" <?php 
        echo $disabled;
        ?>
 >
					<option value=""<?php 
        if ($old_value == '') {
            echo 'selected="selected"';
        }
        ?>
><?php 
        _e('-- Select Role --', 'jobboard');
        ?>
</option>
					<option value="job_lister" <?php 
        if ($old_value == 'job_lister') {
            echo 'selected="selected"';
        }
        ?>
><?php 
        _e('Job Lister', 'jobboard');
        ?>
</option>
					<option value="job_seeker" <?php 
        if ($old_value == 'job_seeker') {
            echo 'selected="selected"';
        }
        ?>
><?php 
        _e('Job Seeker', 'jobboard');
        ?>
</option>
				</select>
			</td>
		</tr>


		<!-- Available Job Packages -->
		<?php 
        $job_packages = jobboard_get_packages_obj('_package_job');
        $selected_job_packages = get_user_meta($user->ID, 'jobboard_user_package_job', true);
        if ($job_packages && jobboard_option('enable_package_job') == '1') {
            ?>
	  <tr>

			<th><label for="jobboard_user_package_job"><?php 
            _e('Job Package for Job Lister', 'jobboard');
            ?>
</label></th>

			<td>
				<select name="jobboard_user_package_job" id="jobboard_user_package_job" <?php 
            echo $disabled;
            ?>
>

					<option value="" <?php 
            if ($selected_job_packages == '') {
                echo 'selected="selected"';
            }
            ?>
><?php 
            echo __('None', 'jobboard');
            ?>
</option>

					  <?php 
            foreach ($job_packages as $post) {
                setup_postdata($post);
                ?>

						<option value="<?php 
                echo $post->ID;
                ?>
" <?php 
                if ($selected_job_packages == $post->ID) {
                    echo 'selected="selected"';
                }
                ?>
><?php 
                echo $post->post_title;
                ?>
</option>

						<?php 
            }
            ?>

				</select>
			</td>
		</tr>
		<?php 
        }
        ?>
		<!-- Available Job Packages End -->




	  <!-- Available Resume Subscription -->
		<?php 
        $resume_subscription_packages = jobboard_get_packages_obj('_resume_subscription');
        $selected_resume_subscription_packages = get_user_meta($user->ID, 'jobboard_user_resume_subscription', true);
        if (jobboard_package_is_enabled('_package_resume_view')) {
            ?>
		<tr>

			<th><label for="jobboard_user_resume_subscription"><?php 
            _e('Resume Subscription for Job Lister', 'jobboard');
            ?>
</label></th>
			<td>

				<select name="jobboard_user_resume_subscription" id="jobboard_user_resume_subscription" <?php 
            echo $disabled;
            ?>
>

					<option value="" <?php 
            if ($selected_resume_subscription_packages == '') {
                echo 'selected="selected"';
            }
            ?>
><?php 
            echo __('None', 'jobboard');
            ?>
</option>

					  <?php 
            foreach ($resume_subscription_packages as $post) {
                setup_postdata($post);
                ?>

						<option value="<?php 
                echo $post->ID;
                ?>
" <?php 
                if ($selected_resume_subscription_packages == $post->ID) {
                    echo 'selected="selected"';
                }
                ?>
><?php 
                echo $post->post_title;
                ?>
</option>

						<?php 
            }
            ?>

				</select>

			</td>

		</tr>
		<?php 
        }
        ?>
		<!-- Available Resume Subscription Ends -->



		<!-- Available Resume Package -->

		<?php 
        $resume_packages = jobboard_get_packages_obj('_package_resume');
        if ($resume_packages && jobboard_option('enable_package_resume') == '1') {
            $selected_resume_packages = get_user_meta($user->ID, 'jobboard_user_package_resume', true);
            ?>


		<tr>
			<th><label for="jobboard_user_package_resume"><?php 
            _e('Resume Package for Job Seeker', 'jobboard');
            ?>
</label></th>

			<td>

				<select name="jobboard_user_package_resume" id="jobboard_user_package_resume" <?php 
            echo $disabled;
            ?>
>

					<option value="" <?php 
            if ($selected_resume_packages == '') {
                echo 'selected="selected"';
            }
            ?>
><?php 
            echo __('None', 'jobboard');
            ?>
</option>

				  <?php 
            foreach ($resume_packages as $post) {
                setup_postdata($post);
                ?>

					<option value="<?php 
                echo $post->ID;
                ?>
" <?php 
                if ($selected_resume_packages == $post->ID) {
                    echo 'selected="selected"';
                }
                ?>
><?php 
                echo $post->post_title;
                ?>
</option>

					<?php 
            }
            ?>

				</select>

			</td>
		</tr>


		<?php 
        }
        ?>

		<!-- Available Resume Package Ends -->





	</table>
	<?php 
    }