<commit_before><?php

/**
 * @name      Dialogo Forum
 * @copyright Dialogo Forum contributors
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause
 *
 * This software is a derived product, based on:
 *
 * Simple Machines Forum (SMF)
 * copyright:	2011 Simple Machines (http://www.simplemachines.org)
 * license:  	BSD, See included LICENSE.TXT for terms and conditions.
 *
 * @version 1.0 Alpha
 *
 * The functions in this file deal with sending topics to a friend or moderator,
 * and email to a user.
 *
 */

if (!defined('DIALOGO'))
	die('Hacking attempt...');

/**
 * This function initializes or sets up the necessary, for the other actions
 */
function pre_emailuser()
{
	global $context;

	// Don't index anything here.
	$context['robot_no_index'] = true;

	// Load the template.
	loadTemplate('SendTopic');
}

/**
 * Default action handler (when no ;sa is specified)
 */
function action_index()
{
	// default action: action_sendtopic()
	action_sendtopic();
}

/**
 * Send a topic to a friend.
 * Uses the SendTopic template, with the main sub template.
 * Requires the send_topic permission.
 * Redirects back to the first page of the topic when done.
 * Is accessed via ?action=emailuser;sa=sendtopic.
 */
function action_sendtopic()
{
	global $topic, $txt, $context, $scripturl, $sourcedir, $smcFunc, $modSettings;

	// Check permissions...
	isAllowedTo('send_topic');

	// We need at least a topic... go away if you don't have one.
	if (empty($topic))
		fatal_lang_error('not_a_topic', false);

	// Get the topic's subject.
	$request = $smcFunc['db_query']('', '
		SELECT m.subject, t.approved
		FROM {db_prefix}topics AS t
			INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
		WHERE t.id_topic = {int:current_topic}<commit_msg>Fix action_emailuser().<commit_after><?php

/**
 * @name      Dialogo Forum
 * @copyright Dialogo Forum contributors
 * @license   BSD http://opensource.org/licenses/BSD-3-Clause
 *
 * This software is a derived product, based on:
 *
 * Simple Machines Forum (SMF)
 * copyright:	2011 Simple Machines (http://www.simplemachines.org)
 * license:  	BSD, See included LICENSE.TXT for terms and conditions.
 *
 * @version 1.0 Alpha
 *
 * The functions in this file deal with sending topics to a friend or moderator,
 * and email to a user.
 *
 */

if (!defined('DIALOGO'))
	die('Hacking attempt...');

/**
 * This function initializes or sets up the necessary, for the other actions
 */
function pre_emailuser()
{
	global $context;

	// Don't index anything here.
	$context['robot_no_index'] = true;

	// Load the template.
	loadTemplate('SendTopic');
}

/**
 * Default action handler (when no ;sa is specified)
 */
function action_emailuser()
{
	// default action: action_sendtopic()
	action_sendtopic();
}

/**
 * Send a topic to a friend.
 * Uses the SendTopic template, with the main sub template.
 * Requires the send_topic permission.
 * Redirects back to the first page of the topic when done.
 * Is accessed via ?action=emailuser;sa=sendtopic.
 */
function action_sendtopic()
{
	global $topic, $txt, $context, $scripturl, $sourcedir, $smcFunc, $modSettings;

	// Check permissions...
	isAllowedTo('send_topic');

	// We need at least a topic... go away if you don't have one.
	if (empty($topic))
		fatal_lang_error('not_a_topic', false);

	// Get the topic's subject.
	$request = $smcFunc['db_query']('', '
		SELECT m.subject, t.approved
		FROM {db_prefix}topics AS t
			INNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)
		WHERE t.id_topic = {int:current_topic}
{'fraction_non_alphanumeric': 0.12598647125140924, 'fraction_numerical': 0.003945885005636978, 'mean_word_length': 3.8417462482946796, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5963610', 'n_tokens_mistral': 1179, 'n_tokens_neox': 1131, 'n_words': 382}