<commit_before><?php

/**
 *
 * For this app we return a callable function, which passes the current $App object
 */
return function(Core\App\Object $App, Twig_Environment $View) {

	// Check if user is logged in, if not don't load the event below
	$auth = new Core\Auth\User();
	if (!$auth->isLoggedIn()) {
		return false;
	}

	/**
	 * Attach an event to the loading of all blocks
	 */
	new Core\Event('lib_module_get_blocks', function(Phpfox_Module $object) use($View) {

		$db = new Core\Db();
		// $cache = new Core\Cache();

		$cond = [];
		$featured = $db->select('*')->from(':user_featured')->all();
		if ($featured) {
			$users = '';
			foreach ($featured as $user) {
				$users[] = (int) $user['user_id'];
			}

			$cond = ['user_id' => ['in' => implode(',', $users)]];
		}

		$users = new Api\User();
		$users->limit(setting('pfu_total_to_feature', 6));
		$users->where($cond);
		$users->order('RAND()');

		$object->block('core.index-member', 1, $View->render('@PHPfox_FeaturedUsers/block.html', [
			'users' => $users->get()
		]));
	});
};<commit_msg>Fixing limit issue with setting<commit_after><?php

/**
 *
 * For this app we return a callable function, which passes the current $App object
 */
return function(Core\App\Object $App, Twig_Environment $View) {

	// Check if user is logged in, if not don't load the event below
	$auth = new Core\Auth\User();
	if (!$auth->isLoggedIn()) {
		return false;
	}

	/**
	 * Attach an event to the loading of all blocks
	 */
	new Core\Event('lib_module_get_blocks', function(Phpfox_Module $object) use($View) {

		$db = new Core\Db();
		// $cache = new Core\Cache();

		$limit = (int) setting('pfu_total_to_feature', 6);
		$cond = [];
		$featured = $db->select('*')->from(':user_featured')->limit($limit)->order('ordering DESC')->all();
		if ($featured) {
			$users = '';
			foreach ($featured as $user) {
				$users[] = (int) $user['user_id'];
			}

			$cond = ['user_id' => ['in' => implode(',', $users)]];
		}

		$users = new Api\User();
		// $users->limit(setting('pfu_total_to_feature', 6));
		$users->where($cond);
		// $users->order('RAND()');

		$object->block('core.index-member', 1, $View->render('@PHPfox_FeaturedUsers/block.html', [
			'users' => $users->get()
		]));
	});
};
{'fraction_non_alphanumeric': 0.2127564674397859, 'fraction_numerical': 0.0022301516503122213, 'mean_word_length': 3.8444924406047516, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 31, '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': '4682201', 'n_tokens_mistral': 868, 'n_tokens_neox': 794, 'n_words': 189}