<commit_before># Inline-Module Example

## HStats
### Display HumHub Statistics

This example shows how you can create a class and utilize it to create inline-modules. This example outputs basic HumHub Statistics.

```php
/* *
 * Inline Module Example HStats 
 * @author <NAME>
 *
 * You can extend Yii/HumHub classes or create your own.
 * Here we are creating our own class called HStats for statistics.
 * */
class HStats
{
    
    /**
     * Return a count or list or members by type or total
     * 
     * @return int | obj
     */
    public function memberStats($act = 'total', $list = false, $limit = 10)
    {
		switch($act) {
			case 'online':
				$criteria = new CDbCriteria;
				$criteria->group = 'user_id';
				$criteria->condition = 'user_id IS NOT null';
				$count = UserHttpSession::model()->count($criteria);
				if ($list && $count > 0) {
					$onlineUsers = UserHttpSession::model()->findAll($criteria);
					return array($count, $onlineUsers);<commit_msg>Update example.md<commit_after># Inline-Module Example

## HStats
### Display HumHub Statistics

This example shows how you can create a class and utilize it to create inline-modules. This example outputs basic HumHub Statistics.

<img src="http://i.imgur.com/hKwjATO.png" ?>

```php
/* *
 * Inline Module Example HStats 
 * @author <NAME>
 *
 * You can extend Yii/HumHub classes or create your own.
 * Here we are creating our own class called HStats for statistics.
 * */
class HStats
{
    
    /**
     * Return a count or list or members by type or total
     * 
     * @return int | obj
     */
    public function memberStats($act = 'total', $list = false, $limit = 10)
    {
		switch($act) {
			case 'online':
				$criteria = new CDbCriteria;
				$criteria->group = 'user_id';
				$criteria->condition = 'user_id IS NOT null';
				$count = UserHttpSession::model()->count($criteria);
				if ($list && $count > 0) {
					$onlineUsers = UserHttpSession::model()->findAll($criteria);
					return array($count, $onlineUsers);
{'fraction_non_alphanumeric': 0.1254980079681275, 'fraction_numerical': 0.00298804780876494, 'mean_word_length': 3.2294736842105265, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1823007', 'n_tokens_mistral': 664, 'n_tokens_neox': 597, 'n_words': 208}