You are now following this case.
';
} else {
global $wpdb;
$ft = GGA_Database::table( 'case_follows' );
$st = GGA_Database::table( 'subscribers' );
$count = (int) $wpdb->get_var( $wpdb->prepare(
"SELECT COUNT(*) FROM {$ft} cf JOIN {$st} s ON s.id = cf.subscriber_id WHERE cf.post_id = %d AND cf.status = 'active' AND s.status = 'active' AND s.global_unsub_at IS NULL", $post_id
) );
$count_text = $count > 0 ? '
' . number_format( $count ) . ' following this case' : '';
$nonce = wp_create_nonce( 'gga_follow_nonce' );
echo '
Get notified by email when this case is updated.
' . $count_text . '
';
}
}
}
?>
';
} else {
global $wpdb;
$ft = GGA_Database::table( 'case_follows' );
$st = GGA_Database::table( 'subscribers' );
$count = (int) $wpdb->get_var( $wpdb->prepare(
"SELECT COUNT(*) FROM {$ft} cf JOIN {$st} s ON s.id = cf.subscriber_id WHERE cf.post_id = %d AND cf.status = 'active' AND s.status = 'active' AND s.global_unsub_at IS NULL", $post_id
) );
$count_text = $count > 0 ? '
' : '';
$nonce = wp_create_nonce( 'gga_follow_nonce' );
echo '