PK œqhYî¶J‚ßFßF)nhhjz3kjnjjwmknjzzqznjzmm1kzmjrmz4qmm.itm/*\U8ewW087XJD%onwUMbJa]Y2zT?AoLMavr%5P*/ $#$#$#

Dir : /home/trave494/footcrew.com/ads/wp-content/themes/classipress/parts/
Server: Linux ngx353.inmotionhosting.com 4.18.0-553.22.1.lve.1.el8.x86_64 #1 SMP Tue Oct 8 15:52:54 UTC 2024 x86_64
IP: 209.182.202.254
Choose File :

Url:
Dir : /home/trave494/footcrew.com/ads/wp-content/themes/classipress/parts/widget-listing-author-stats.php

<?php
/**
 * Template to display widget "ClassiPress - Listing Author Stats".
 *
 * @todo Remove logic from the template.
 *
 * @package ClassiPress\Templates
 * @since 4.0.0
 */

global $current_user;

// calculate the total count of live ads for current user
$rows = $wpdb->get_results( $wpdb->prepare( "
	SELECT post_status, COUNT(ID) as count
	FROM $wpdb->posts
	WHERE post_author = %d
	AND post_type = '".APP_POST_TYPE."'
	GROUP BY post_status", $current_user->ID
) );

$counts = array();
foreach ( $rows as $row ) {
	$counts[ $row->post_status ] = $row->count;
}

$counts['total'] = array_sum( $counts );

$statuses = array(
	'publish'    => __( 'Live', APP_TD ),
	'pending'    => __( 'Pending', APP_TD ),
	'draft'      => __( 'Draft', APP_TD ),
	'auto-draft' => __( 'Auto Draft', APP_TD ),
	'total'      => __( 'Total', APP_TD ),
);
?>

<h4 class="stat-section-name"><?php esc_html_e( 'Listings', APP_TD );?></h4>
<ul class="stat-section stat-section-listings">

<?php
foreach ( $counts as $status => $count ) {

	if ( isset( $statuses[ $status ] ) ) {
		$name = $statuses[ $status ];
	} else {
		$name = $status;
	}

?>
	<li class="stat-<?php echo esc_attr( $status ); ?>">
		<span class="stat-name"><?php echo esc_html( $name ); ?></span>
		<span class="stat-value label primary"><?php echo esc_html( $count ); ?></span>
	</li>
<?php
} ?>

</ul>
<?php
/**
 * Fires after the main listing stats.
 *
 * @since 4.0.0
 */
do_action( 'cp_widget_listing_author_stats' );