<commit_before><?php

// Displays a module inlined in page
// Parameters: module name
// Example:
// {MODULE(module=>logged_users,align=>left | right)}
// {/MODULE}

function wikiplugin_module($data,$params) {
  global $tikilib, $cache_time, $smarty;
	$out = '';
  extract($params);
  if(!isset($module)) {$module='last_modif_pages';}
  if(!isset($align)) {$align='left';}
  //If you want line numbering use something like this:
  //$lines = explode("\n",$code);
  //print_r($lines);
	$cachefile = 'modules/cache/mod-'.$module.'.tpl.cache';
	$phpfile = 'modules/mod-'.$module.'.php';
	$template= 'modules/mod-'.$module.'.tpl';
	$nocache= 'templates/modules/mod-'.$module.'.tpl.nocache';
	if((!file_exists($cachefile)) || (file_exists($nocache)) || ( (time() - filemtime($cachefile))>$cache_time )){
		if(file_exists($phpfile)) {
			include_once($phpfile);
		}
		$template_file = 'templates/'.$template;
		if(file_exists($template_file)) {
			$out = $smarty->fetch($template);
		} else {
			if($tikilib->is_user_module($module)) {
				$info = $tikilib->get_user_module($module);
				$smarty->assign_by_ref('user_title',$info["title"]);
				$smarty->assign_by_ref('user_data',$info["data"]);
				$out = $smarty->fetch('modules/user_module.tpl');
			}
		}
		$fp = fopen($cachefile,"w+");
		fwrite($fp,$data,strlen($data));
		fclose($fp);
	} else {
		$fp = fopen($cachefile,"r");<commit_msg>fixed case when max rows is undefined<commit_after><?php

// Displays a module inlined in page
// Parameters: module name
// Example:
// {MODULE(module=>logged_users,align=>left | right)}
// {/MODULE}

function wikiplugin_module($data,$params) {
  global $tikilib, $cache_time, $smarty;
	$out = '';
  extract($params);
  if(!isset($module)) {$module='last_modif_pages';}
  if(!isset($align)) {$align='left';}
  if(!isset($max)) {$max='10';}
  //If you want line numbering use something like this:
  //$lines = explode("\n",$code);
  //print_r($lines);
	$cachefile = 'modules/cache/mod-'.$module.'.tpl.cache';
	$phpfile = 'modules/mod-'.$module.'.php';
	$template= 'modules/mod-'.$module.'.tpl';
	$nocache= 'templates/modules/mod-'.$module.'.tpl.nocache';
	if((!file_exists($cachefile)) || (file_exists($nocache)) || ( (time() - filemtime($cachefile))>$cache_time )){
		if(file_exists($phpfile)) {
			$module_rows = $max;
			include_once($phpfile);
		}
		$template_file = 'templates/'.$template;
		if(file_exists($template_file)) {
			$out = $smarty->fetch($template);
		} else {
			if($tikilib->is_user_module($module)) {
				$info = $tikilib->get_user_module($module);
				$smarty->assign_by_ref('user_title',$info["title"]);
				$smarty->assign_by_ref('user_data',$info["data"]);
				$out = $smarty->fetch('modules/user_module.tpl');
			}
		}
		$fp = fopen($cachefile,"w+");
		fwrite($fp,$data,strlen($data));
		fclose($fp);
	} else {
		$fp = fopen($cachefile,"r");
{'fraction_non_alphanumeric': 0.22669936930623685, 'fraction_numerical': 0.000700770847932726, 'mean_word_length': 5.035940803382664, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '4929111', 'n_tokens_mistral': 1104, 'n_tokens_neox': 1066, 'n_words': 153}