Results 1 to 2 of 2

Thread: Strange dashboard behaviour

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

    Strange dashboard behaviour

    I am allowing users to contribute to the blog and want to display the number of posts in their dashboard but am getting some peculiar results.

    Here is my code. I am putting it the sidebar-dashboard.php file and want to display the number of posts in the account statistics;
    Code:
    	<aside id="dashboard-acct-stats">
    		<div class="section-head">
    			<h3><?php _e( 'Account Statistics', APP_TD ); ?></h3>
    		</div>
    		<?php
    		$stats = va_dashboard_get_user_stats($dashboard_user);
    		?>
    		<ul class="stats">
    			<li><?php printf( __('Live Listings: %d', APP_TD ), $stats['listings_live'] ); ?></li>
    			<li><?php printf( __('Pending Listings: %d', APP_TD ), $stats['listings_pending'] ); ?></li>
    			<li><?php printf( __('Expired Listings: %d', APP_TD ), $stats['listings_expired'] ); ?></li>
    			<li><?php printf( __('Total Listings: %d', APP_TD ), $stats['listings_total'] ); ?></li>
    		</ul>
    		<ul class="stats">
    			<li><?php printf( __('Live Reviews: %d', APP_TD ), $stats['reviews_live'] ); ?></li>
    			<li><?php printf( __('Pending Reviews: %d', APP_TD ), $stats['reviews_pending'] ); ?></li>
    			<li><?php printf( __('Total Reviews: %d', APP_TD ), $stats['reviews_total'] ); ?></li>
    			<li>Blog Articles: <?php echo get_the_author_posts(); ?></li>			
    		</ul>
    The orange bit is my code and it seems to work fine but only once the user has submitted a listing or article. When new users sign up it says they have 1 post/article - which is all the posts on my site. If they create a listing it says 0 articles - which is correct. If I assign a post to them it says 1 post - which is correct. If I then unassign that post to them it goes back to 0 - which is correct. So it only doesn't work if they have never created a listing or post.

    Any thoughts?

  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!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Strange ad formatting
    By sgg123 in forum ClassiPress General Discussion
    Replies: 4
    Last Post: August 1st, 2011, 03:25 PM
  2. strange RSS Issue
    By gentleman in forum Report JobRoller Bugs
    Replies: 6
    Last Post: March 13th, 2011, 03:41 PM
  3. [SOLVED] Strange Layout behaviour
    By maxbellefleur in forum Report ClassiPress Bugs
    Replies: 4
    Last Post: February 21st, 2011, 04:54 PM
  4. Strange Featured Ad Behaviour
    By juliusnkemdiche in forum Help Using ClassiPress
    Replies: 5
    Last Post: May 10th, 2010, 02:55 PM