Please or Register to create posts and topics.

Add elements to the statistics area

The asgarosforum_statistics_custom_element hook allows you to add custom elements to your statistics area.

You want to add a new element which shows you the number of forums? Simply add the following code to your themes functions.php file:

function my_custom_statistics_element() {
  global $asgarosforum;
  $data = $asgarosforum->db->get_var("SELECT COUNT(id) FROM {$asgarosforum->tables->forums}");
  AsgarosForumStatistics::renderStatisticsElement('Forums', $data, 'dashicons-editor-justify');
}
add_action('asgarosforum_statistics_custom_element', 'my_custom_statistics_element');

 

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

going to try this soon, Any way to add a whos on line to it?

Quote from hillbillybonez on December 30, 2016, 2:44 am

going to try this soon, Any way to add a whos on line to it?

Install the plugin – WP-UserOnline

  1. option
add_action('asgarosforum_statistics_custom_element', 'my_function_footer', 10, 1);
function my_function_footer() {

echo 'your code';	
}

Examples here https://wordpress.org/plugins/wp-useronline/faq/

2. option

Install the plugin – amr shortcode any widget and WP-UserOnline

add_action('asgarosforum_statistics_custom_element', 'my_function_footer', 10, 1);
function my_function_footer() {

echo '<div class="af-topic-icons">'.do_shortcode('[do_widget id=useronline-4]').'</div>';	
}

[do_widget id=useronline-4] – replace

 

sweet thanks very much

How can I remove the number of Users and replace it with the number of the current user’s Unread Messages?

Also, how can I remove the Newest Member?

Hello @gogrw

Counting the unread-messages requires to iterate over all existing topics/posts and filter them based on access-settings like permissions and usergroups which requires a lot of custom-code. Because this is performance-heavy logic, I don’t suggest you to add this to your homepage.

Regarding the newest member I will add an option for it to the next update to hide it.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!