Пример #1
0
function ProjectTheme_my_account_outstanding_projects_area_function()
{
    global $current_user, $wpdb, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content">
        
        
        	<div class="my_box3 border_bottom_0">
            	
            
            	<div class="box_title"><?php 
    _e("Outstanding Projects", 'ProjectTheme');
    ?>
</div>
                <div class="box_content">    
				
                
                <?php 
    global $current_user;
    get_currentuserinfo();
    $uid = $current_user->ID;
    global $wp_query;
    $query_vars = $wp_query->query_vars;
    $post_per_page = 10;
    $outstanding = array('key' => 'outstanding', 'value' => "1", 'compare' => '=');
    $winner = array('key' => 'winner', 'value' => $uid, 'compare' => '=');
    $args = array('post_type' => 'project', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => $query_vars['paged'], 'meta_query' => array($outstanding, $winner));
    query_posts($args);
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            projectTheme_get_post_outstanding_project();
        }
        if (function_exists('wp_pagenavi')) {
            wp_pagenavi();
        }
    } else {
        _e("There are no outstanding projects yet.", 'ProjectTheme');
    }
    wp_reset_query();
    ?>
                
                
               
           </div>
           </div>    
        
        
  		</div>      
<?php 
    ProjectTheme_get_users_links();
}
Пример #2
0
function ProjectTheme_my_account_area_main_function()
{
    global $current_user, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content" class="account-main-area">
        
        <?php 
    if (isset($_GET['prj_not_approved'])) {
        $psts = get_post($_GET['prj_not_approved']);
        ?>
        
        <div class="saved_thing">
        <?php 
        echo sprintf(__('Your payment was received for the item: <b>%s</b> but your project needs to be approved. 
		You will be notified when your project will be approved and live on our website', 'ProjectTheme'), $psts->post_title);
        ?>
        </div>
        
        	<?php 
    }
    if (ProjectTheme_is_user_business($uid)) {
        ?>
                       
            	<div class="box_title"><?php 
        _e("My Latest Posted Projects", "ProjectTheme");
        ?>
</div>
                 
            	
                 <?php 
        global $wp_query;
        $query_vars = $wp_query->query_vars;
        $post_per_page = 5;
        $closed = array('key' => 'closed', 'value' => "0", 'compare' => '=');
        $paid = array('key' => 'paid', 'value' => "1", 'compare' => '=');
        $args = array('post_type' => 'project', 'author' => $uid, 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => 1, 'meta_query' => array($paid, $closed), 'post_status' => array('draft', 'publish'));
        query_posts($args);
        //	query_posts( "meta_key=closed&meta_value=0&post_status=publish,draft&post_type=project&order=DESC&orderby=date&author=".$uid.
        //	"&posts_per_page=".$post_per_page."&paged=".$query_vars['paged'] );
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_acc();
            }
            //if(function_exists('wp_pagenavi')):
            //wp_pagenavi(); endif;
        } else {
            echo '<div class="my_box3"> <div class="box_content"> ';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>

          
           
           
           
          
            
            	<div class="box_title"><?php 
        _e("My Unpublished &amp; Unpaid Projects", 'ProjectTheme');
        ?>
</div>
                
			
			
				<?php 
        query_posts("post_status=draft&meta_key=paid&meta_value=0&post_type=project&order=DESC&orderby=id&author=" . $uid . "&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_acc(array('unpaid'));
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>
			
 
			<div class="clear10"></div>
			
			
			
        
            
            	<div class="box_title"><?php 
        _e("My Latest Closed Projects", 'ProjectTheme');
        ?>
</div>
                    
			
			
				<?php 
        query_posts("meta_key=closed&meta_value=1&post_type=project&order=DESC&orderby=id&author=" . $uid . "&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_acc();
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>
 
		
        <?php 
    }
    ?>
        
        <?php 
    if (ProjectTheme_is_user_provider($uid)) {
        ?>
	
           
           
 
        
            
            	<div class="box_title"><?php 
        _e("Outstanding Projects", 'ProjectTheme');
        ?>
</div>
                 
			
			
				<?php 
        global $wp_query;
        $query_vars = $wp_query->query_vars;
        $post_per_page = 3;
        $outstanding = array('key' => 'outstanding', 'value' => "1", 'compare' => '=');
        $winner = array('key' => 'winner', 'value' => $uid, 'compare' => '=');
        $args = array('post_type' => 'project', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => 1, 'meta_query' => array($outstanding, $winner));
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_outstanding_project();
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>

	 
 
        
            
            	<div class="box_title"><?php 
        _e("My Latest Posted Proposals", 'ProjectTheme');
        ?>
</div>
                 
			
			
				<?php 
        query_posts("meta_key=bid&meta_value=" . $uid . "&post_type=project&order=DESC&orderby=id&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_my_proposal();
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>

			 
            
     
        
            
            	<div class="box_title"><?php 
        _e("My Latest Won Projects", 'ProjectTheme');
        ?>
</div>
            
			
			
				<?php 
        query_posts("meta_key=winner&meta_value=" . $uid . "&post_type=project&order=DESC&orderby=id&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
        } else {
            echo '<div class="my_box3"><div class="box_content">';
            _e("There are no projects yet.", 'ProjectTheme');
            echo '</div></div>';
        }
        wp_reset_query();
        ?>
 
            
        
        <?php 
    }
    ?>
   
                
        </div> <!-- end dif content -->
        
        <?php 
    ProjectTheme_get_users_links();
    ?>
        
    
	
<?php 
}
Пример #3
0
function ProjectTheme_my_account_outstanding_projects_area_function()
{
    global $current_user, $wpdb, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
<div id="content" class="account-main-area">
        
       
                
                <?php 
    global $current_user, $wpdb;
    get_currentuserinfo();
    $uid = $current_user->ID;
    global $wp_query;
    $query_vars = $wp_query->query_vars;
    $post_per_page = 10;
    //                $querystr = "
    //					SELECT distinct wposts.ID
    //					FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta2, $wpdb->postmeta wpostmeta3
    //                    LEFT JOIN {$wpdb->prefix}project_bids AS b ON wposts.ID = b.pid
    //					WHERE
    //                    b.uid = '$uid' AND b.outstanding = '1'
    //                    AND wposts.ID = wpostmeta2.post_id AND
    //					wpostmeta2.meta_key='winner' AND wpostmeta2.meta_value='$uid' AND
    //					wposts.ID = wpostmeta3.post_id AND
    //					wpostmeta3.meta_key='outstanding' AND wpostmeta3.meta_value='1'
    //					AND wposts.post_type = 'project' AND wposts.post_status = 'publish' ";
    $querystr = "\n\t\t\t\t\tSELECT p.ID\n                    FROM {$wpdb->posts} AS p\n                    LEFT JOIN {$wpdb->prefix}project_bids AS b ON p.ID = b.pid\n                    LEFT JOIN {$wpdb->prefix}postmeta AS wpostmeta2 ON p.ID = wpostmeta2.post_id\n                    LEFT JOIN {$wpdb->prefix}postmeta AS wpostmeta3 ON p.ID = wpostmeta3.post_id\n                    WHERE \n                    b.uid = '916' AND b.outstanding = '1'\n                    AND wpostmeta2.meta_key='winner' AND wpostmeta2.meta_value='916'\n                    AND wpostmeta3.meta_key='outstanding' AND wpostmeta3.meta_value='1' \n                    AND p.post_type = 'project' AND p.post_status = 'publish' ";
    $pageposts = $wpdb->get_col($querystr);
    if (empty($pageposts)) {
        echo '<div class="my_box3 border_bottom_0"> <div class="box_content">   ';
        _e("There are no outstanding projects yet.", 'ProjectTheme');
        echo '</div>  </div> ';
    } else {
        //				$outstanding = array(
        //						'key' => 'outstanding',
        //						'value' => "1",
        //						'compare' => '='
        //					);
        //
        //				$winner = array(
        //						'key' => 'winner',
        //						'value' => $uid,
        //						'compare' => '='
        //					);
        //				$args = array('post_type' => 'project', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page,
        //				'paged' => $query_vars['paged'], 'meta_query' => array($outstanding, $winner));
        $args = array('post_type' => 'project', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => $query_vars['paged'], 'post__in' => $pageposts);
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_outstanding_project();
            }
            if (function_exists('wp_pagenavi')) {
                wp_pagenavi();
            }
        } else {
            echo '<div class="my_box3 border_bottom_0"> <div class="box_content">   ';
            _e("There are no outstanding projects yet.", 'ProjectTheme');
            echo '</div>  </div> ';
        }
    }
    wp_reset_query();
    ?>
                
    
        
        
  		</div>      
  		
<?php 
    ProjectTheme_get_users_links();
}
Пример #4
0
function ProjectTheme_my_account_area_main_function()
{
    global $current_user, $wp_query;
    get_currentuserinfo();
    $uid = $current_user->ID;
    ?>
    	<div id="content">
        	<?php 
    if (ProjectTheme_is_user_business($uid)) {
        ?>
            <div class="my_box3">            
            	<div class="box_title"><?php 
        _e("Your Latest Posted Projects", "ProjectTheme");
        ?>
</div>
                <div class="box_content "> 
            	
                 <?php 
        $query_vars = $wp_query->query_vars;
        $post_per_page = 3;
        global $wp_query;
        $query_vars = $wp_query->query_vars;
        $post_per_page = 5;
        $closed = array('key' => 'closed', 'value' => "0", 'compare' => '=');
        $paid = array('key' => 'paid', 'value' => "1", 'compare' => '=');
        $args = array('post_type' => 'project', 'author' => $uid, 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => 1, 'meta_query' => array($paid, $closed), 'post_status' => array('draft', 'publish'));
        query_posts($args);
        //	query_posts( "meta_key=closed&meta_value=0&post_status=publish,draft&post_type=project&order=DESC&orderby=date&author=".$uid.
        //	"&posts_per_page=".$post_per_page."&paged=".$query_vars['paged'] );
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
            //if(function_exists('wp_pagenavi')):
            //wp_pagenavi(); endif;
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

              </div>
           </div>
           
           
           <div class="my_box3">
          
            
            	<div class="box_title"><?php 
        _e("My Unpublished &amp; Unpaid Projects", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        query_posts("post_status=draft&meta_key=paid&meta_value=0&post_type=project&order=DESC&orderby=id&author=" . $uid . "&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post(array('unpaid'));
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>
			
			</div>
			</div>
	
			
			
			<div class="clear10"></div>
			
			
			<div class="my_box3">
        
            
            	<div class="box_title"><?php 
        _e("My Latest Closed Projects", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        query_posts("meta_key=closed&meta_value=1&post_type=project&order=DESC&orderby=id&author=" . $uid . "&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

			</div>
			</div>
		
        <?php 
    }
    ?>
        
        <?php 
    if (ProjectTheme_is_user_provider($uid)) {
        ?>
	
           
           
        <div class="my_box3">
        
            
            	<div class="box_title"><?php 
        _e("Outstanding Projects", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        global $wp_query;
        $query_vars = $wp_query->query_vars;
        $post_per_page = 3;
        $outstanding = array('key' => 'outstanding', 'value' => "1", 'compare' => '=');
        $winner = array('key' => 'winner', 'value' => $uid, 'compare' => '=');
        $args = array('post_type' => 'project', 'order' => 'DESC', 'orderby' => 'date', 'posts_per_page' => $post_per_page, 'paged' => 1, 'meta_query' => array($outstanding, $winner));
        query_posts($args);
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post_outstanding_project();
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

			</div>
			</div>   
           
           
           
           
           
        <div class="my_box3">
        
            
            	<div class="box_title"><?php 
        _e("My Latest Bids", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        query_posts("meta_key=bid&meta_value=" . $uid . "&post_type=project&order=DESC&orderby=id&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

			</div>
			</div>
            
            
            
            <div class="my_box3">
        
            
            	<div class="box_title"><?php 
        _e("My Latest Won Projects", 'ProjectTheme');
        ?>
</div>
                <div class="box_content">    
			
			
				<?php 
        query_posts("meta_key=winner&meta_value=" . $uid . "&post_type=project&order=DESC&orderby=id&posts_per_page=3");
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                projectTheme_get_post();
            }
        } else {
            _e("There are no projects yet.", 'ProjectTheme');
        }
        wp_reset_query();
        ?>

			</div>
			</div>
            
        
        <?php 
    }
    ?>
   
                
        </div> <!-- end dif content -->
        
        <?php 
    ProjectTheme_get_users_links();
    ?>
        
    
	
<?php 
}