コード例 #1
0
            <div class="row">

            <div class="col-md-12">
            <?php 
    if (ae_user_role($user_ID) == FREELANCER || !is_user_logged_in()) {
        fre_display_user_info($project->post_author);
    } else {
        $bid_accepted = $project->accepted;
        $bid_accepted_author = get_post_field('post_author', $bid_accepted);
        $user = get_userdata($bid_accepted_author);
        $ae_users = AE_Users::get_instance();
        $user_data = $ae_users->convert($user);
        $author_email_verified = ae_get_option('user_confirm') && get_user_meta($user_data->ID, 'register_status', true) == "unconfirm" ? false : true;
        $author_phone_verified = get_user_meta($user_data->ID, 'phone', true) != "" ? true : false;
        $rating = Fre_Review::freelancer_rating_score($user_data->ID);
        $profile_id = get_user_meta($user_data->ID, 'user_profile_id', true);
        $hourly_rate_price = get_post_meta($profile_id, 'hour_rate', true);
        $experience = get_post_meta($profile_id, 'et_experience', true);
        $country = get_user_meta($user_data->ID, 'location', true);
        $currency = ae_get_option('content_currency', array('align' => 'left', 'code' => 'USD', 'icon' => '$'));
        #get country code
        //$arrCountry = get_country_name_by_country_code($country);
        #get bid detail
        query_posts(array('post_status' => array('complete'), 'post_type' => BID, 'author' => $bid_accepted_author, 'accepted' => 1));
        $bid_posts = $wp_query->found_posts;
        ?>
                <div class="info-company-avatar">
                    <a href="<?php 
        echo get_author_posts_url($user_data->ID);
        ?>
コード例 #2
0
ファイル: author.php プロジェクト: maratdev/alllancer
        ?>
                                </a> 
                                <?php 
        /*
        <span><?php _e("Or", ET_DOMAIN); ?></span>
        <a href="#" class="<?php if ( is_user_logged_in() ) {echo 'contact-me';} else{ echo 'login-btn';} ?> fre-contact"  data-user="******" data-user="******">
            <?php _e("Contact me", ET_DOMAIN) ?>
        </a>
        */
        ?>
                            </div>
                        <?php 
    } else {
        echo '<h3 style="padding: 20px 25px;margin:0;">' . $author_name . '</h3>';
    }
    $rating = Fre_Review::freelancer_rating_score($author_id);
    ?>
 
                            <ul class="list-detail-info">
                            	<li>
                                    <i class="fa fa-dollar"></i>
                                    <span class="text"><?php 
    _e('Hourly Rate:', ET_DOMAIN);
    ?>
</span>
                                    <span class="text-right"><?php 
    echo $convert->hourly_rate_price;
    ?>
</span>
                                </li>
                                <li>
コード例 #3
0
ファイル: review.php プロジェクト: linniepinski/perssistant
 function freelancer_review_action()
 {
     global $user_ID;
     $args = $_POST;
     $project_id = $args['project_id'];
     $status = get_post_status($project_id);
     $bid_id_accepted = get_post_meta($project_id, 'accepted', true);
     $author_bid = (int) get_post_field('post_author', $bid_id_accepted);
     $freelancer_id = get_post_field('post_author', $bid_id_accepted);
     /*
      * validate data
      */
     if (!isset($args['score']) || empty($args['score'])) {
         $result = array('succes' => false, 'msg' => __('You have to rate this project.', 'review-backend'));
         wp_send_json($result);
     }
     if (!isset($args['comment_content']) || empty($args['comment_content'])) {
         $result = array('succes' => false, 'msg' => __('Please post a review for this freelancer.', 'review-backend'));
         wp_send_json($result);
     }
     /*
      * check permission
      */
     if ($user_ID !== $author_bid || !$user_ID) {
         wp_send_json(array('succes' => false, 'msg' => __('You don\'t have permission to review.', 'review-backend')));
     }
     /*
      *  check status of project
      */
     if ($status !== 'complete') {
         wp_send_json(array('succes' => false, 'msg' => __('You can\'t not review on this project.', 'review-backend')));
     }
     /**
      * check user reviewed project owner or not
      * @author Dan
      */
     $role = ae_user_role($user_ID);
     $type = 'em_review';
     if ($role == FREELANCER) {
         $type = 'fre_review';
     }
     $comment = get_comments(array('status' => 'approve', 'type' => $type, 'post_id' => $project_id));
     if (!empty($comment)) {
         wp_send_json(array('succes' => false, 'msg' => __('You have reviewed on this project.', 'review-backend')));
     }
     // end check user review project owner
     // add review
     $args['comment_post_ID'] = $project_id;
     $args['comment_approved'] = 1;
     $this->comment_type = 'fre_review';
     $review = Fre_Review::get_instance("fre_review");
     $comment = $review->insert($args);
     if (!is_wp_error($comment)) {
         /**
          * fire action after freelancer review employer base on project
          * @param int $int project id
          * @param Array $args submit args (rating score, comment)
          * @since 1.2
          * @author Dakachi
          */
         do_action('fre_freelancer_review_employer', $project_id, $args);
         //update project, bid, bid author, project author after review
         $this->update_after_fre_review($project_id, $comment);
         wp_send_json(array('success' => true, 'msg' => __("Your review has been submitted.", 'review-backend')));
     } else {
         // revert bid status
         wp_update_post(array('ID' => $bid_id_accepted, 'post_status' => 'publish'));
         wp_send_json(array('success' => false, 'msg' => $comment->get_error_message()));
     }
 }
コード例 #4
0
ファイル: profiles.php プロジェクト: maratdev/alllancer
    /**
     * convert  profile 
     * @package FreelanceEngine
     */
    function ae_convert_profile($result)
    {
        $result->et_avatar = get_avatar($result->post_author, 70);
        $result->author_link = get_author_posts_url($result->post_author);
        if ($result->et_experience) {
            if ($result->et_experience > 1) {
                $result->experience = sprintf(__("%d years", ET_DOMAIN), $result->et_experience);
            } else {
                $result->experience = sprintf(__("%d year", ET_DOMAIN), $result->et_experience);
            }
        } else {
            $result->experience = get_post_meta($result->ID, 'experience', true);
        }
        // override profile ling
        $result->permalink = $result->author_link;
        $result->author_name = get_the_author_meta('display_name', $result->post_author);
        $result->hourly_rate_price = sprintf(__("%s/h", ET_DOMAIN), fre_price_format($result->hour_rate));
        $rating = Fre_Review::freelancer_rating_score($result->post_author);
        $result->rating_score = $rating['rating_score'];
        ob_start();
        $i = 1;
        if ($result->tax_input['skill']) {
            $total_skill = count($result->tax_input['skill']);
            $string_length = 0;
            foreach ($result->tax_input['skill'] as $tax) {
                $i++;
                $string_length += strlen($tax->name);
                ?>
                <li><span class="skill-name-profile"><?php 
                echo $tax->name;
                ?>
</span></li>
        <?php 
                if ($string_length > 20) {
                    break;
                }
                if ($i >= 5) {
                    break;
                }
            }
            if ($i < $total_skill) {
                echo '<li><span class="skill-name-profile">+' . ($total_skill - $i) . '</span></li>';
            }
        }
        $skill_list = ob_get_clean();
        // skill dont need id array
        unset($result->skill);
        // generate skill list
        $result->skill_list = $skill_list;
        return $result;
    }