Results 1 to 8 of 8

Thread: How is Vantage getting user ID/Usernames for the dashboard pages.

  1. #1
    Expired Customer gonesmith's Avatar
    Join Date
    Jun 2012
    Posts
    764
    Thanks
    50
    Thanked 202 Times in 137 Posts

    How is Vantage getting user ID/Usernames for the dashboard pages.

    On my site I am allowing users to submit articles and want to display their post stats together with their other stats in their dashboard pages.

    Here is the code I am using;
    Code:
    <li>Total Articles: <?php echo get_the_author_posts(); ?>
    	<?php $articles = get_the_author_posts(); ?>
    	<?php if ($articles > 0): ?>
    		<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">See all</a>
    	<?php endif; ?></li>
    The problem I am having is that until someone actually has a post or listing of their own, the above code puts in the stats for the last person to post something. Also, regardless of whether they have posted anything or not, if you view someones (or they view their own) favourites list or reviews page it shows the same problem. See pics below;
    Screen Shot 2013-03-21 at 9.36.56 AM.jpg
    Screen Shot 2013-03-21 at 9.37.21 AM.jpg

    So what I want to know is does Vantage use some special tags or function to get the user id or username that I could using in my mod to make this work properly?

    I have checked the template files and found this in dashboard.php;
    Code:
    function va_count_user_posts( $user_id , $status ) {
    	global $wpdb;
    
    	return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = %d AND post_type = %s AND post_status = %s", $user_id, VA_LISTING_PTYPE, $status ) );
    }
    Is it something to do with this? Could I alter that slightly to make my mod work?

  2. #2
    Expired Customer gonesmith's Avatar
    Join Date
    Jun 2012
    Posts
    764
    Thanks
    50
    Thanked 202 Times in 137 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    dimitris's Avatar
    Join Date
    Oct 2011
    Location
    Earth
    Posts
    20,617
    Thanks
    222
    Thanked 1,873 Times in 1,770 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    tcarter's Avatar
    Join Date
    Jun 2011
    Location
    United States
    Posts
    424
    Thanks
    15
    Thanked 91 Times in 77 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  5. The Following User Says Thank You to tcarter For This Useful Post:

    gonesmith (March 21st, 2013)

  6. #5
    Expired Customer gonesmith's Avatar
    Join Date
    Jun 2012
    Posts
    764
    Thanks
    50
    Thanked 202 Times in 137 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  7. #6
    tcarter's Avatar
    Join Date
    Jun 2011
    Location
    United States
    Posts
    424
    Thanks
    15
    Thanked 91 Times in 77 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  8. #7
    Expired Customer gonesmith's Avatar
    Join Date
    Jun 2012
    Posts
    764
    Thanks
    50
    Thanked 202 Times in 137 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  9. #8
    tcarter's Avatar
    Join Date
    Jun 2011
    Location
    United States
    Posts
    424
    Thanks
    15
    Thanked 91 Times in 77 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  10. The Following User Says Thank You to tcarter For This Useful Post:

    gonesmith (March 31st, 2013)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. my dashboard appears twice in user dashboard
    By satish4mnv in forum FXtender Pro
    Replies: 2
    Last Post: February 6th, 2013, 02:48 AM
  2. Replies: 3
    Last Post: October 10th, 2012, 08:25 PM
  3. Registering NEw user - > Usernames with: Ö - Ä - Ü not allowed
    By optagon66 in forum Report JobRoller Bugs
    Replies: 10
    Last Post: September 1st, 2012, 02:37 PM
  4. ClassiPress v3.1.4 user dashboard without menu links of user options
    By donatelloii in forum Report ClassiPress Bugs
    Replies: 4
    Last Post: March 19th, 2012, 05:59 AM
  5. usernames - no pages found
    By jamiecanada157 in forum Report ClassiPress Bugs
    Replies: 1
    Last Post: August 3rd, 2011, 09:54 AM