$author_id = get_query_var('author');
$post_object = $ae_post_factory->get(BID);
?>
<ul class="list-history-author list-history-profile">
	<?php 
//query_posts( array(  'post_status' => 'publish', 'post_type' => BID, 'author' => $author_id, 'accepted' => 1  ));
$postdata = array();
while (have_posts()) {
    the_post();
    $convert = $post_object->convert($post, 'thumbnail');
    $postdata[] = $convert;
    get_template_part('mobile/template/bid-history', 'item');
}
?>
</ul>
<?php 
/**
 * render post data for js
*/
echo '<script type="data/json" class="postdata" >' . json_encode($postdata) . '</script>';
?>
<!-- pagination -->
<?php 
$wp_query->query = array_merge($wp_query->query, array('is_author' => true));
echo '<div class="paginations-wrapper">';
ae_pagination($wp_query, get_query_var('paged'), 'load');
echo '</div>';
wp_reset_query();
?>

 /**
  * fetch data
  */
 function fetch_post()
 {
     global $ae_post_factory;
     $post = $ae_post_factory->get($this->post_type);
     $page = $_REQUEST['page'];
     extract($_REQUEST);
     $thumb = isset($_REQUEST['thumbnail']) ? $_REQUEST['thumbnail'] : 'thumbnail';
     $query_args = array('paged' => $page, 'thumbnail' => $thumb, 'post_status' => 'publish', 'post_type' => $this->post_type);
     // check args showposts
     if (isset($query['showposts']) && $query['showposts']) {
         $query_args['showposts'] = $query['showposts'];
     }
     if (isset($query['posts_per_page']) && $query['posts_per_page']) {
         $query_args['posts_per_page'] = $query['posts_per_page'];
     }
     $query_args = $this->filter_query_args($query_args);
     /**
      * filter fetch post query args 
      * @param Array $query_args
      * @param object $this
      * @since 1.2
      * @author Dakachi
      */
     $query_args = apply_filters('ae_fetch_' . $this->post_type . '_args', $query_args, $this);
     if (isset($query['category_name']) && $query['category_name']) {
         $query_args['category_name'] = $query['category_name'];
     }
     //check query post parent
     if (isset($query['post_parent']) && $query['post_parent'] != '') {
         $query_args['post_parent'] = $query['post_parent'];
     }
     //check query author
     if (isset($query['author']) && $query['author'] != '') {
         $query_args['author'] = $query['author'];
     }
     if (isset($query['s']) && $query['s']) {
         $query_args['s'] = $query['s'];
     }
     /**
      * fetch data
      */
     $data = $post->fetch($query_args);
     ob_start();
     ae_pagination($data['query'], $page, $_REQUEST['paginate']);
     $paginate = ob_get_clean();
     /**
      * send data to client
      */
     if (!empty($data)) {
         wp_send_json(array('data' => $data['posts'], 'paginate' => $paginate, 'msg' => __("Successs", 'aecore-class-ae-post-backend'), 'success' => true, 'max_num_pages' => $data['max_num_pages'], 'total' => $data['query']->found_posts));
     } else {
         wp_send_json(array('success' => false, 'data' => array()));
     }
 }
Beispiel #3
0
?>
">

            <?php 
if ($q_bid->have_posts()) {
    global $wp_query, $ae_post_factory, $post;
    $post_object = $ae_post_factory->get(BID);
    while ($q_bid->have_posts()) {
        $q_bid->the_post();
        $convert = $post_object->convert($post);
        $biddata[] = $convert;
        get_template_part('template/bid', 'item');
    }
    echo '<div class="paginations-wrapper">';
    $q_bid->query = array_merge($q_bid->query, array('is_single' => 1));
    ae_pagination($q_bid, get_query_var('paged'), 'load');
    echo '</div>';
} else {
    get_template_part('template/bid', 'not-item');
}
?>

        </div>

    </div>

    <input type="hidden" id="project_id" name="<?php 
echo $project->ID;
?>
" value="<?php 
echo $project->ID;
Beispiel #4
0
/**
 * Template list all freelancer current bid
 # This template is load page-profile.php
 * @since 1.0
*/
global $wp_query, $ae_post_factory;
$post_object = $ae_post_factory->get(BID);
?>
<!-- <ul class="bid-list-container"> -->
    <?php 
$postdata = array();
if (have_posts()) {
    while (have_posts()) {
        the_post();
        $convert = $post_object->convert($post);
        $postdata[] = $convert;
        get_template_part('mobile/template/user', 'bid-item');
    }
} else {
    echo '<li><span class="no-results">' . __('No current bids.', ET_DOMAIN) . '</span></li>';
}
?>
<!-- </ul> -->
<?php 
echo '<div class="paginations-wrapper">';
ae_pagination($wp_query, get_query_var('paged'));
echo '</div>';
/**
 * render post data for js
*/
echo '<script type="data/json" class="postdata" >' . json_encode($postdata) . '</script>';
Beispiel #5
0
    protected function content($atts, $content = null)
    {
        $custom_css = $el_class = $title = $icon = $output = $s_content = $m_link = '';
        extract(shortcode_atts(array('el_class' => '', 'showposts' => 200, 'orderby' => 'date', 'paginate' => 'page'), $atts));
        /* ================  Render Shortcodes ================ */
        ob_start();
        $query_args = array('post_type' => PROFILE, 'post_status' => 'publish', 'posts_per_page' => $showposts);
        $key = '';
        if ($orderby == 'rating') {
            $key = 'rating_score';
        }
        if ($orderby == 'hourly_rate') {
            $key = 'hour_rate';
            $query_args['order'] = 'ASC';
        }
        if ($orderby != '') {
            $query_args['meta_key'] = $key;
            $query_args['orderby'] = 'meta_value_num date';
            $query_args['meta_query'] = array('relation' => 'OR', array('key' => $key, 'compare' => 'BETWEEN', 'value' => array(0, 5)), array('key' => $key, 'value' => 1, 'compare' => 'NOT EXISTS'));
        }
        ?>

        <!-- COUNTER -->

        <div class="section-wrapper section-project-home">

            <div class="list-profile-wrapper">

                

                <div class="tab-content-profile">

                    <!-- Tab panes -->

                    <div class="tab-content vc-block-profiles">

                        <!-- Tab panes -->

                        

                        <?php 
        query_posts($query_args);
        ?>



                        <div class="tab-pane fade in active tab-profile-home">

                            <div class="row">

                                <?php 
        /**
         * Template list profiles
         */
        global $wp_query, $ae_post_factory, $post;
        $post_object = $ae_post_factory->get(PROFILE);
        ?>

                                <div class="list-profile profile-list-container">

                                     <!-- block control  -->

                                    <?php 
        if (have_posts()) {
            $postdata = array();
            while (have_posts()) {
                the_post();
                $convert = $post_object->convert($post);
                echo $current_user = $convert->post_author;
                exit;
                $user = get_userdata($current_user);
                $capabilities = $user->{$wpdb->prefix . 'capabilities'};
                $postdata[] = $convert;
                get_template_part('template/profile', 'item');
            }
            /**
             * render post data for js
             */
            echo '<script type="data/json" class="postdata" >' . json_encode($postdata) . '</script>';
        }
        ?>

                                </div>

                                <div class="clearfix"></div>

                                <!--// blog list  -->

                                <!-- pagination -->

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

                                    <?php 
        if ($paginate == 'page' || $paginate == 'load_more') {
            echo '<div class="paginations-wrapper">';
            ae_pagination($wp_query, get_query_var('paged'), $paginate);
            echo '</div>';
        }
        ?>

                                </div>

                            </div>

                        </div>

                        <?php 
        wp_reset_query();
        ?>
 

                    </div>

                </div>

            </div>

        </div>

        <?php 
        $output = ob_get_clean();
        /* ================  Render Shortcodes ================ */
        return $output;
    }
Beispiel #6
0
 $bid_data = array();
 remove_filter('posts_orderby', 'fre_order_by_bid_status');
 if ($q_bid->have_posts()) {
     echo '<div class="info-bidding-wrapper project-' . $project->post_status . '">';
     echo '<ul class="list-history-bidders list-bidding">';
     while ($q_bid->have_posts()) {
         $q_bid->the_post();
         get_template_part('mobile/template/bid', 'item');
         $bid_data[] = $post;
     }
     echo '</ul>';
     // paging list bid on this project
     if ($q_bid->max_num_pages > 1) {
         echo '<div class="paginations-wrapper">';
         $q_bid->query = array_merge($q_bid->query, array('is_single' => 1));
         ae_pagination($q_bid, get_query_var('paged'), $type = 'load_more');
         echo '</div>';
     }
     echo '</div>';
     // end paging
 } else {
     get_template_part('mobile/template/bid', 'not-item');
 }
 wp_reset_query();
 ?>
             <?php 
 if (!empty($bid_data)) {
     echo '<script type="data/json" class="biddata" >' . json_encode($bid_data) . '</script>';
 }
 ?>
             <!-- End list bid !-->
Beispiel #7
0
    protected function content($atts, $content = null)
    {
        $custom_css = $el_class = $title = $icon = $output = $s_content = $m_link = '';
        extract(shortcode_atts(array('el_class' => '', 'showposts' => 10, 'project_type' => '', 'paginate' => 'page', 'query' => 'featured'), $atts));
        /* ================  Render Shortcodes ================ */
        ob_start();
        $query_args = array('post_type' => PROJECT, 'post_status' => 'publish', 'posts_per_page' => $showposts);
        if ($project_type) {
            $query_args['project_type'] = $project_type;
        }
        if ($query == 'featured') {
            $query_args['meta_key'] = 'et_featured';
            $query_args['meta_value'] = 1;
        }
        ?>
        <!-- COUNTER -->
        <section class="section-wrapper  section-project-home tab-project-home">
            <div class="list-project-wrapper">
                <div class="row">
                    <div class="col-md-12">
                        <div class="tab-content-project">
                            <div class="row title-tab-project">
                                <div class="col-md-5 col-sm-5 col-xs-7">
                                    <span><?php 
        _e("PROJECT TITLE", ET_DOMAIN);
        ?>
</span>
                                </div>
                                <div class="col-md-2 col-sm-3 hidden-xs">
                                    <span><?php 
        _e("BY", ET_DOMAIN);
        ?>
</span>
                                </div>
                                <div class="col-md-2 col-sm-2 hidden-sm hidden-xs">
                                    <span><?php 
        _e("POSTED DATE", ET_DOMAIN);
        ?>
</span>
                                </div>
                                <div class="col-md-1 col-sm-2 hidden-xs">
                                    <span><?php 
        _e("BUDGET", ET_DOMAIN);
        ?>
</span>
                                </div>
                            </div>
                            <!-- Tab panes -->                        
                            <?php 
        query_posts($query_args);
        ?>

                            <div class="tab-pane fade in active tab-project-home">
                                <?php 
        /**
         * Template list all project
         */
        global $wp_query, $ae_post_factory, $post;
        $post_object = $ae_post_factory->get('project');
        ?>
                                <ul class="list-project project-list-container">
                                <?php 
        $postdata = array();
        while (have_posts()) {
            the_post();
            $convert = $post_object->convert($post);
            $postdata[] = $convert;
            get_template_part('template/project', 'item');
        }
        ?>

                                </ul>

                            </div>

                        </div>
                    </div>
                    <div class="col-md-12">
                        <?php 
        if ($paginate == 'page' || $paginate == 'load_more') {
            echo '<div class="paginations-wrapper">';
            ae_pagination($wp_query, get_query_var('paged'), $paginate);
            echo '</div>';
            /**
             * render post data for js
             */
            echo '<script type="data/json" class="postdata" >' . json_encode($postdata) . '</script>';
        }
        ?>
                    </div>

                </div>
            </div>
        </section>
        <?php 
        $output = ob_get_clean();
        /* ================  Render Shortcodes ================ */
        return $output;
    }
/**
 * get user notification by
 * @param snippet
 * @since snippet.
 * @author Dakachi
 */
function fre_user_notification($user_id = 0, $page = 1)
{
    if (!$user_id) {
        global $user_ID;
        $user_id = $user_ID;
    }
    global $post, $wp_query, $ae_post_factory;
    $notify_object = $ae_post_factory->get('notify');
    $notifications = query_posts(array('post_type' => 'notify', 'post_status' => 'publish', 'author' => $user_id, 'showposts' => 10, 'paged' => $page));
    $postdata = array();
    if (have_posts()) {
        echo '<ul class="notification-list">';
        while (have_posts()) {
            the_post();
            $notify = $post;
            $project = get_post($post->post_parent);
            if (!$project || is_wp_error($project)) {
                continue;
            }
            $notify = $notify_object->convert($post);
            $postdata[] = $notify;
            echo '<li class="notify-item">';
            echo $notify->content;
            echo '</li>';
        }
        echo '</ul>';
    } else {
        echo '<ul class="notification-list">';
        echo '<li>';
        _e('You have no notifications', 'notification-backend');
        echo '</li>';
        echo '</ul>';
    }
    echo '<script type="data/json" class="postdata" >' . json_encode($postdata) . '</script>';
    // pagination
    echo '<div class="paginations-wrapper">';
    ae_pagination($wp_query, get_query_var('paged'), 'load');
    echo '</div>';
    wp_reset_query();
}
Beispiel #9
0
    protected function content($atts, $content = null)
    {
        $custom_css = $el_class = $title = $icon = $output = $s_content = $m_link = '';
        extract(shortcode_atts(array('el_class' => '', 'showposts' => 10, 'orderby' => 'date', 'paginate' => 'page'), $atts));
        /* ================  Render Shortcodes ================ */
        $select_available_users = array('role' => 'freelancer', 'number' => 100, 'meta_query' => array('relation' => 'AND', array('key' => 'user_available', 'value' => 'on', 'compare' => '='), array('key' => 'interview_status', 'value' => array('confirmed'), 'compare' => 'OR')), 'fields' => 'ID');
        $result = new WP_User_Query($select_available_users);
        ob_start();
        $query_args = array('post_type' => PROFILE, 'post_status' => array('draft', 'publish'), 'posts_per_page' => 10, 'author__in' => $result->get_results());
        $key = '';
        if ($orderby == 'rating') {
            $key = 'rating_score';
        }
        if ($orderby == 'hourly_rate') {
            $key = 'hour_rate';
            $query_args['order'] = 'ASC';
        }
        if ($orderby != '') {
            $query_args['meta_key'] = $key;
            $query_args['orderby'] = 'meta_value_num date';
            $query_args['meta_query'] = array('relation' => 'OR', array('key' => $key, 'compare' => 'BETWEEN', 'value' => array(0, 5)), array('key' => $key, 'value' => 1, 'compare' => 'NOT EXISTS'));
        }
        ?>

        <!-- COUNTER -->

        <div class="section-wrapper section-project-home">

            <div class="list-profile-wrapper">

                

                <div class="tab-content-profile">

                    <!-- Tab panes -->

                    <div class="tab-content vc-block-profiles">

                        <!-- Tab panes -->
                        

                        <?php 
        query_posts($query_args);
        ?>


                        <div class="tab-pane fade in active tab-profile-home">

                            <div class="row">

                                <?php 
        /**
         * Template list profiles
         */
        global $wp_query, $ae_post_factory, $post;
        $post_object = $ae_post_factory->get(PROFILE);
        ?>

                                <div class="list-profile profile-list-container">

                                     <!-- block control  -->

                                    <?php 
        if (have_posts()) {
            $postdata = array();
            while (have_posts()) {
                the_post();
                $convert = $post_object->convert($post);
                $current_user = $convert->post_author;
                $user = get_userdata($current_user);
                $capabilities = $user->roles[0];
                //SELECT * FROM wp_posts INNER JOIN wp_usermeta ON wp_posts.post_author=wp_usermeta.user_id WHERE post_type = 'fre_profile' AND meta_key = 'unconfirm'
                //                                            if ($capabilities == 'freelancer' && get_user_meta($current_user,'interview_status',true) != 'unconfirm' ) {
                $postdata[] = $convert;
                get_template_part('template/profile', 'item');
                //                                            }
            }
            /**
             * render post data for js
             */
            echo '<script type="data/json" class="postdata" >' . json_encode($postdata) . '</script>';
        }
        ?>

                                </div>

                                <div class="clearfix"></div>

                                <!--// blog list  -->

                                <!-- pagination -->

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

                                    <?php 
        if ($paginate == 'page' || $paginate == 'load_more') {
            echo '<div class="paginations-wrapper">';
            ae_pagination($wp_query, get_query_var('paged'), $paginate);
            echo '</div>';
        }
        ?>

                                </div>

                            </div>

                        </div>

                        <?php 
        wp_reset_query();
        ?>
 

                    </div>

                </div>

            </div>

        </div>

        <?php 
        $output = ob_get_clean();
        /* ================  Render Shortcodes ================ */
        return $output;
    }