<commit_before><?php

// Includes an article field
// Usage:
// {ARTICLE(Id=>articleId, Field=>FieldName)}{ARTICLE}
// FieldName can be any field in the tiki_articles table, but title,heading, or body are probably the most useful.
function wikiplugin_article_help() {
	return tra("Include an article").":<br />~np~{ARTICLE(Field=>[,Id=>])}{ARTICLE}<br />Id is optional. if not given, last article is used. default field is
	heading.~/np~";
}
function wikiplugin_article($data, $params) {
	global $tikilib,$user,$userlib;
	include_once('lib/stats/statslib.php');

	extract ($params,EXTR_SKIP);

	if (!isset($Id)) {
		global $artlib;
		if (!is_object($artlib)) {
			include "lib/articles/artlib.php";
		}
		$last = $artlib->list_articles(0,1);
		$Id = $last['data'][0]["articleId"];
	}
	if (!isset($Field)) {
		$Field = 'heading';
	} 

	if ($tiki_p_admin_cms == 'y' || $tikilib->user_has_perm_on_object($user, $articleId, 'article', 'tiki_p_edit_article') || ($article_data["author"] != $user && $article_data["creator_edit"] != 'y')) {
	      $add="&nbsp;<a href='tiki-edit_article.php?articleId=$Id'><img src='/pics/icons/page_edit.png' style='border:0px;'></a>";
	} else {
	      $add="";
	}

	$article_data = $tikilib->get_article($Id);
	return $article_data[$Field].$add;
}

?><commit_msg>Add shortcut for direct editing - correct little cut/paste mistake<commit_after><?php

// Includes an article field
// Usage:
// {ARTICLE(Id=>articleId, Field=>FieldName)}{ARTICLE}
// FieldName can be any field in the tiki_articles table, but title,heading, or body are probably the most useful.
function wikiplugin_article_help() {
	return tra("Include an article").":<br />~np~{ARTICLE(Field=>[,Id=>])}{ARTICLE}<br />Id is optional. if not given, last article is used. default field is
	heading.~/np~";
}
function wikiplugin_article($data, $params) {
	global $tikilib,$user,$userlib;
	include_once('lib/stats/statslib.php');

	extract ($params,EXTR_SKIP);

	if (!isset($Id)) {
		global $artlib;
		if (!is_object($artlib)) {
			include "lib/articles/artlib.php";
		}
		$last = $artlib->list_articles(0,1);
		$Id = $last['data'][0]["articleId"];
	}
	if (!isset($Field)) {
		$Field = 'heading';
	} 

	if ($tiki_p_admin_cms == 'y' || $tikilib->user_has_perm_on_object($user, $articleId, 'article', 'tiki_p_edit_article') || ($article_data["author"] == $user && $article_data["creator_edit"] == 'y')) {
	      $add="&nbsp;<a href='tiki-edit_article.php?articleId=$Id'><img src='/pics/icons/page_edit.png' style='border:0px;'></a>";
	} else {
	      $add="";
	}

	$article_data = $tikilib->get_article($Id);
	return $article_data[$Field].$add;
}

?>
{'fraction_non_alphanumeric': 0.20022753128555176, 'fraction_numerical': 0.0030337504740235114, 'mean_word_length': 5.311004784688995, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 29, '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': '2880616', 'n_tokens_mistral': 1006, 'n_tokens_neox': 967, 'n_words': 192}