Meldesystem, Problem mit ID

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
michi-w.
Mitglied
Beiträge: 412
Registriert: 21.06.2003 23:45

Beitrag von michi-w. »

Das Ergebnis ist nun:
Hallo!

Eine neue Meldung wurde an die Moderatoren und Administratoren von "Bürger-Forum" gesendet. Du kannst diese Meldung lesen, wenn du auf den folgenden Link klickst:

http://www.buerger-forum.de/report.php?c=1

Meldung vom Benutzer:
Noch ein Test

http://www.buerger-forum.de/viewtopic.php?p#

--
Vielen Dank,
das Team vom Bürger-Forum
Der Beitrags-Link stimmt nicht.
Könnte es daran liegen?
http://www.phpbb.de/viewtopic.php?t=44090&highlight=
Benutzeravatar
S2B
Ehemaliges Teammitglied
Beiträge: 3258
Registriert: 10.08.2004 22:48
Wohnort: Aachen
Kontaktdaten:

Beitrag von S2B »

Nein, es liegt schon wieder an meinem Code. :roll:

In der Zeile müssen alle $report_title durch $report_info ersetzt werden... :wink:

Ich habe den ersten Post kontrolliert...
Gruß, S2B
Keinen Support per ICQ/PM!
Hier kann man meine PHP-Skripte und meine MODs für phpBB runterladen.
michi-w.
Mitglied
Beiträge: 412
Registriert: 21.06.2003 23:45

Beitrag von michi-w. »

Vorweg, ich glaube in deiner reportpost_ext_de.txt gibt es einen kleinen Fehler.

Code: Alles auswählen

#
#-----[ FIND ]--------xxxx----------------------------------
#
		message_die(GENERAL_MESSAGE, $lang['Report_Finished_Msg'] . $links['list'] . $links['index'], 'Information');
Der Abschnitt lautet in der Original report.php

Code: Alles auswählen

message_die(GENERAL_MESSAGE, $lang['Report_Finished_Msg'] . $links['list'] . $links['index']);
Nun zu meinem kleinen Problem,
die Email sieht weiterhin so aus:
Hallo!

Eine neue Meldung wurde an die Moderatoren und Administratoren von "Bürger-Forum" gesendet. Du kannst diese Meldung lesen, wenn du auf den folgenden Link klickst:

http://www.buerger-forum.de/report.php?c=1

Meldung vom Benutzer:
Ich muss immer noch testen

http://www.buerger-forum.de/viewtopic.php?p#

--
Vielen Dank,
das Team vom Bürger-Forum
Ich habe noch einmal ein Update der original report.php gemacht und die Veränderung aus diesen Beitrag
http://www.phpbb.de/viewtopic.php?p=607976#607976

Hier ist meine report.php
Was kann noch falsch sein?

Code: Alles auswählen

<?php

// standard hack prevent
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);

// standard session management
$userdata = session_pagestart($user_ip, PAGE_REPORT);
init_userprefs($userdata);

$mode = (isset($_POST['mode'])) ? $_POST['mode'] : $_GET['mode'];
$id = (isset($_GET['id'])) ? $_GET['id'] : $_POST['id'];
$user_params = array('report','reportpost');

function report_notify($cat_id, $report_info, $report_text)
{
	global $board_config, $phpEx, $db, $phpbb_root_path;

	if ($board_config['report_notify'] == 2)
	{
		$sql_add = "user_level = " . ADMIN;
	}
	else if ($board_config['report_notify'] == 1)
	{
		$sql_add = "user_level = " . ADMIN . " OR user_level = " . MOD;
	}
	else
	{
		return;
	}

	$sql = "SELECT user_id, user_email, user_lang
		FROM " . USERS_TABLE . "
		WHERE $sql_add";
	if (!($result = $db->sql_query($sql)))
	{
	message_die(GENERAL_ERROR, 'Could not obtain list of moderators/admins', '', __LINE__, __FILE__, $sql);
	}

	$bcc_list_ary = array();

	if ($row = $db->sql_fetchrow($result))
	{
		// Sixty second limit
		@set_time_limit(60);

		do
		{
			if ($row['user_email'] != '')
			{
				$bcc_list_ary[$row['user_lang']][] = $row['user_email'];
			}
		}
		while ($row = $db->sql_fetchrow($result));

		//
		// Let's do some checking to make sure that mass mail functions
		// are working in win32 versions of php.
		//
		if (preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$board_config['smtp_delivery'])
		{
			$ini_val = (@phpversion() >= '4.0.0') ? 'ini_get' : 'get_cfg_var';

			// We are running on windows, force delivery to use our smtp functions
			// since php's are broken by default
			$board_config['smtp_delivery'] = 1;
			$board_config['smtp_host'] = @$ini_val('SMTP');
		}

		if (sizeof($bcc_list_ary))
		{
			include($phpbb_root_path . 'includes/emailer.'.$phpEx);
			$emailer = new emailer($board_config['smtp_delivery']);

			$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
			$script_name2 = ($script_name != '') ? $script_name . '/viewtopic.'.$phpEx : 'viewtopic.'.$phpEx;
			$script_name = ($script_name != '') ? $script_name . '/report.'.$phpEx : 'report.'.$phpEx;
			$server_name = trim($board_config['server_name']);
			$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
			$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) . '/' : '/';

			$emailer->from($board_config['board_email']);
			$emailer->replyto($board_config['board_email']);

			@reset($bcc_list_ary);
			while (list($user_lang, $bcc_list) = each($bcc_list_ary))
			{
				$emailer->use_template('report_notify', $user_lang);

				for ($i = 0; $i < count($bcc_list); $i++)
				{
					$emailer->bcc($bcc_list[$i]);
				}

				// The Topic_reply_notification lang string below will be used
				// if for some reason the mail template subject cannot be read
				// ... note it will not necessarily be in the posters own language!
				$emailer->set_subject('');

				// This is a nasty kludge to remove the username var ... till (if?)
				// translators update their templates
				$emailer->msg = preg_replace('#[ ]?{USERNAME}#', '', $emailer->msg);
				$text = ($cat_id != REPORT_POST_ID) ? $report_info . "\n" . $report_text : $report_text . "\n\n" . $server_protocol . $server_name . $server_port . $script_name2 . '?' . POST_POST_URL . "$report_info#$report_info";

				$emailer->assign_vars(array(
					'EMAIL_SIG' => (!empty($board_config['board_email_sig'])) ? str_replace('<br />', "\n", "-- \n" . $board_config['board_email_sig']) : '',
					'SITENAME' => $board_config['sitename'],
					'REPORT_TEXT' => $text,

					'U_REPORT_PAGE' => $server_protocol . $server_name . $server_port . $script_name . '?' . POST_CAT_URL . "=$cat_id")
				);

				$emailer->send();
				$emailer->reset();
			}
		}
	}
	$db->sql_freeresult($result);
}

if ( $userdata['user_id'] == ANONYMOUS )
{
	$redirect = ($mode != '') ? '&mode=' . $mode : '';
	$redirect .= ($id != '') ? '&id=' . $id : '';
	redirect("login.$phpEx?redirect=report.$phpEx" . $redirect);
}

include($phpbb_root_path.'language/lang_'.$userdata['user_lang'].'/lang_report.'.$phpEx);
$links['index'] = sprintf($lang['Report_Index'],'<a href="' . append_sid("index.$phpEx") . '">','</a>');

$links['list'] = (isset($_GET[POST_CAT_URL])) ? '?' . POST_CAT_URL . '=' . $_GET[POST_CAT_URL] : '';
$return_link = append_sid("report.$phpEx" . $links['list']);
$links['list'] = sprintf($lang['Report_List'],'<a href="' . append_sid("report.$phpEx" . $links['list']) . '">','</a>');
$links['post'] = append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$id#$id");
$links['post'] = ($id != '') ? sprintf($lang['Report_Post'],'<a href="' . $links['post'] . '">','</a>') : '';

if (($board_config['report_list'] != 0 || !($userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD)) && !in_array($mode,$user_params))
{
	message_die(GENERAL_MESSAGE,$lang['Report_Auth_Msg'] . $links['index'],'Information');
	exit;
}

if ($mode == 'report' && isset($_POST['submit']) && $_POST[POST_CAT_URL] != '-' && $_POST['text'] != '')
{
	$sql = "INSERT INTO " . REPORT_TABLE . " (cat_id, report_status, report_date, report_user_id, report_info, text)
		VALUES(" . $_POST[POST_CAT_URL] . ",0," . time() . "," . $userdata['user_id'] . ",
		'" . trim($_POST['info']) . "','" . trim($_POST['text']) . "')";
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not insert report', '', __LINE__, __FILE__, $sql);
	}
	else
	{
		report_notify($_POST[POST_CAT_URL], $_POST['info'], $_POST['text']);
		message_die(GENERAL_MESSAGE, $lang['Report_Send_Msg'] . $links['index']);
	}
}
else if ($mode == 'report')
{
	$cat = (isset($_POST[POST_CAT_URL])) ? $_POST[POST_CAT_URL] : $_GET[POST_CAT_URL];

	// Error-Messages
	$error_msg = '';
	if (isset($_POST['submit']))
	{
		if ($_POST[POST_CAT_URL] == '-')
		{
			$error_msg .= $lang['Report_No_Cat_Selected'];
		}
		if ($_POST['text'] == '')
		{
			$error_msg .= ($error_msg == '') ? '' : '<br /><img src="images/spacer.gif" height="5" width="1" alt="" /><br />';
			$error_msg .= $lang['Report_No_Text'];
		}
		if ($error_msg != '')
		{
			$template->assign_block_vars('switch_error_msg',array());
		}
	}

	// Header and Template
	$page_title = $lang['Report_Write_Report'];
	include($phpbb_root_path . 'includes/page_header.'.$phpEx);

	$template->set_filenames(array(
		'body' => 'report_body.tpl')
	);

	// Build Cat Select
	$sql = "SELECT * FROM " . REPORT_CAT_TABLE . " WHERE cat_type = " . REPORT_NORMAL;
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not query cats', '', __LINE__, __FILE__, $sql);
	}
	if ($db->sql_numrows($result) == 0)
	{
		message_die(GENERAL_MESSAGE, $lang['Report_No_Cat_Exists'] . $links['index']);
	}
	$cat_select = '<select name="' . POST_CAT_URL . '">';
	$cat_select .= ($cat == '' || $cat == '-') ? '<option value="-">&nbsp;</option>' : '';
	$cat_explain = '';
	while ($row = $db->sql_fetchrow($result))
	{
		if ($cat == $row['cat_id'])
		{
			$selected = ' selected="selected"';
			$cat_explain = nl2br(make_clickable(htmlspecialchars($row['cat_explain'])));
			$template->assign_block_vars('switch_cat_explain',array());
		}
		else
		{
			$selected = '';
		}
		$cat_select .= '<option value="' . $row['cat_id'] . '"' . $selected . '>' . htmlspecialchars($row['cat_name']) . '</option>';
	}
	$cat_select .= '</select> &nbsp;<input type="submit" class="mainoption" name="submit_cat" value="' . $lang['Go'] . '" />';
	$db->sql_freeresult($result);

	// Build Inputs
	$info = (isset($_POST['info'])) ? stripslashes($_POST['info']) : '';
	$info = '<input type="text" name="info" size="50" maxlength="100" value="' . $info . '" />';

	$text = (isset($_POST['text'])) ? stripslashes($_POST['text']) : '';
	$text = '<textarea name="text" maxlength="255" rows="5" cols="35" style="width: 100%"  wrap="virtual" class="post">' . $text . '</textarea>';

	$template->assign_vars(array(
		'L_WRITE_REPORT' => $lang['Report_Write_Report'],
		'L_CAT_SELECT' => ($cat == '' || $cat == '-') ? $lang['Report_Cat_Select_New'] : $lang['Report_Cat_Select'],
		'L_CAT_EXPLAIN' => $lang['Report_Cat_Explain'],
		'L_INFO' => $lang['Report_Info'],
		'L_DATE' => $lang['Report_Date'],
		'L_TEXT' => $lang['Report_Text'],
		'L_SUBMIT' => $lang['Submit'],

		'S_CAT_SELECT' => $cat_select,
		'S_INFO' => $info,
		'S_CAT_EXPLAIN' => $cat_explain,
		'S_DATE' => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']),
		'S_TEXT' => $text,
		'S_ACTION' => append_sid("report.$phpEx?mode=report"),
		'ERROR_MSG' => $error_msg)
	);

	$template->pparse('body');
	include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
// BEGIN report_post extension
if ($mode == 'reportpost' && isset($_POST['submit']) && intval($id))
{
	// Post has already been reported?
	$sql = "SELECT COUNT(report_id) AS count FROM " . REPORT_TABLE . "
		WHERE cat_id = " . REPORT_POST_ID . " AND report_status = 0
		AND report_info = $id";
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not get report', '', __LINE__, __FILE__, $sql);
	}
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	if ($row['count'] != 0)
	{
		message_die(GENERAL_MESSAGE, $lang['Report_Post_Already'] . $links['post'] . $links['index']);
	}

	$sql = "INSERT INTO " . REPORT_TABLE . " (cat_id, report_status, report_date, report_user_id, report_info, text)
		VALUES(" . REPORT_POST_ID . ",0," . time() . "," . $userdata['user_id'] . ",
		'" . $id . "','" . trim($_POST['text']) . "')";
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not insert report', '', __LINE__, __FILE__, $sql);
	}
	else
	{
		report_notify(REPORT_POST_ID, $_POST['info'], $_POST['text']);
		message_die(GENERAL_MESSAGE, $lang['Report_Send_Msg'] . $links['post'] . $links['index']);
	}
}
else if ($mode == 'reportpost' && intval($id))
{
	// Header and Template
	$page_title = $lang['Report_Write_Report'];
	include($phpbb_root_path . 'includes/page_header.'.$phpEx);

	$template->set_filenames(array(
		'body' => 'report_body.tpl')
	);

	// Post has already been reported?
	$sql = "SELECT COUNT(report_id) AS count FROM " . REPORT_TABLE . "
		WHERE cat_id = " . REPORT_POST_ID . " AND report_status = 0
		AND report_info = $id";
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not get report', '', __LINE__, __FILE__, $sql);
	}
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);
	if ($row['count'] != 0)
	{
		message_die(GENERAL_MESSAGE, $lang['Report_Post_Already'] . $links['post'] . $links['index']);
	}

	// Get cat_name and cat_explain
	$sql = "SELECT cat_name, cat_explain FROM " . REPORT_CAT_TABLE . "
		WHERE cat_id = " . REPORT_POST_ID;
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not get report cat', '', __LINE__, __FILE__, $sql);
	}
	if ($db->sql_numrows($result) == 0)
	{
		message_die(GENERAL_MESSAGE, $lang['Report_Auth_Msg'] . $links['post'] . $links['index']);
	}
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);

	$cat_select = $row['cat_name'];
	$cat_explain = $row['cat_explain'];
	$template->assign_block_vars('switch_cat_explain',array());

	// Get Topic Name
	$sql = "SELECT t.topic_title FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
		WHERE p.topic_id = t.topic_id AND p.post_id = $id";
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not get topic title', '', __LINE__, __FILE__, $sql);
	}
	if ($db->sql_numrows($result) == 0)
	{
		message_die(GENERAL_MESSAGE, $lang['Report_Auth_Msg']. $links['post'] . $links['index']);
	}
	$row = $db->sql_fetchrow($result);
	$db->sql_freeresult($result);
	$info = append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $id . "#" . $id);
	$info = '<a href="' . $info . '" class="genmed" target="_blank">' . $row['topic_title'] . '</a><input type="hidden" name="id" value="' . $id . '" />';
	// Build Textarea
	$text = '<textarea name="text" maxlength="255" rows="5" cols="35" style="width: 100%" class="post"></textarea>';

	$template->assign_vars(array(
		'L_WRITE_REPORT' => $lang['Report_Write_Post_Report'],
		'L_CAT_SELECT' => $lang['Report_Category'],
		'L_CAT_EXPLAIN' => $lang['Report_Cat_Explain'],
		'L_INFO' => $lang['Report_Info'],
		'L_DATE' => $lang['Report_Date'],
		'L_TEXT' => $lang['Report_Text'],
		'L_SUBMIT' => $lang['Submit'],

		'S_CAT_SELECT' => $cat_select,
		'S_INFO' => $info,
		'S_CAT_EXPLAIN' => $cat_explain,
		'S_DATE' => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']),
		'S_TEXT' => $text,
		'S_ACTION' => append_sid("report.$phpEx?mode=reportpost"),
		'ERROR_MSG' => '')
	);

	$template->pparse('body');
	include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
// END report_post extension
else if ($mode == 'finished' && intval($id))
{
	$sql = "UPDATE " . REPORT_TABLE . " SET report_status = 0 WHERE report_id = $id";
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not finish report', '', __LINE__, __FILE__, $sql);
	}
	else
	{
		message_die(GENERAL_MESSAGE, $lang['Report_Not_Finished_Msg'] . $links['list'] . $links['index']);
	}
}
else if (($mode == 'notfinished' || $mode == 'post_notfinished') && intval($id))
{
	// BEGIN report_post extension
	if ($mode == 'post_notfinished')
	{
		$msg_add = $links['post'];
		$where_sql = "WHERE cat_id = " . REPORT_POST_ID . " AND report_info = $id";
	}
	else
	{
		$where_sql = "WHERE report_id = $id";
		$msg_add = '';
	}
	// END report_post extension
	$sql = "UPDATE " . REPORT_TABLE . " SET report_status = 1 $where_sql";
	if(!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not "unfinish" report', '', __LINE__, __FILE__, $sql);
	}
	else
	{
		message_die(GENERAL_MESSAGE, $lang['Report_Finished_Msg'] . $msg_add . $links['list'] . $links['index'], 'Information');
	}
}
else if (($mode == 'delete' || $mode == 'deleteall') && intval($id))
{
	$del_all = ($mode == 'deleteall');

	if (isset($_POST['confirm']))
	{
		$where_sql = ($del_all) ? "cat_id = $id" : "report_id = $id";
		$msg = ($del_all) ? $lang['Reports_Deleted_Msg'] : $lang['Report_Deleted_Msg'];
		$sql  = "DELETE FROM " . REPORT_TABLE . " WHERE $where_sql";
		if(!($result = $db->sql_query($sql)))
		{
			message_die(GENERAL_ERROR, 'Could not delete report', '', __LINE__, __FILE__, $sql);
		}
		else
		{
			message_die(GENERAL_MESSAGE, $msg . $links['list'] . $links['index']);
		}
	}
	else if (isset($_POST['cancel']))
	{
		redirect($return_link);
	}
	else
	{
    $opened_cat = (isset($_GET[POST_CAT_URL])) ? '&' . POST_CAT_URL . '=' . $_GET[POST_CAT_URL] : '';
		$msg_text = ($del_all) ? $lang['Reports_Deleted_Confirm'] : $lang['Report_Deleted_Confirm'];

		$template->set_filenames(array(
			'body' => 'confirm_body.tpl')
		);

		$template->assign_vars(array(
		  "S_CONFIRM_ACTION" => append_sid("report.php?mode=$mode&id=$id" . $opened_cat),
		  "MESSAGE_TITLE" => $lang['Confirm'],
		  "MESSAGE_TEXT" => $msg_text,
		  "S_HIDDEN_FIELDS" => '',
		  "L_YES" => $lang['Yes'],
		  "L_NO" => $lang['No'])
		);

		include($phpbb_root_path . 'includes/page_header.'.$phpEx);
		$template->pparse('body');
		include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
	}
}
else if ($mode == '')
{
	$page_title = $lang['Report_List_Title'];
	include($phpbb_root_path . 'includes/page_header.'.$phpEx);

	$template->set_filenames(array(
		'body' => 'report_list_body.tpl')
	);

	$sql_where = (isset($_GET[POST_CAT_URL])) ? ' WHERE c.cat_id = ' . $_GET[POST_CAT_URL] : '';

	$sql = "SELECT c.*, r.*, c.cat_id AS cat_id FROM " . REPORT_CAT_TABLE . " c
		LEFT JOIN " . REPORT_TABLE . " r ON c.cat_id = r.cat_id$sql_where
		ORDER BY c.cat_id ASC, r.report_id ASC";
	if (!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not get report list', '', __LINE__, __FILE__, $sql);
	}
	$rows = $db->sql_fetchrowset($result);
	$db->sql_freeresult($result);

	if (count($rows) == 0)
	{
		message_die(GENERAL_MESSAGE,$lang['Report_No_Cat_Exists']);
	}

	// Code by alcaeus [BEGIN], edited by S2B
	$report_data = array();
	for ($i = 0; $i < count($rows); $i++)
	{
		$cat_id = $rows[$i]['cat_id'];
		if (isset($rows[$i]['report_id']))
		{
			// Username and Userlink
			$sql = "SELECT username FROM " . USERS_TABLE . " WHERE user_id = " . $rows[$i]['report_user_id'];
			if(!($result = $db->sql_query($sql)))
			{
				message_die(GENERAL_ERROR, 'Could not get username', '', __LINE__, __FILE__, $sql);
			}
			$user = $db->sql_fetchrow($result);
			$db->sql_freeresult($result);
			$user['userlink'] = $phpbb_root_path . "profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $rows[$i]['report_user_id'];
			$user['userlink'] = '<a href="' . append_sid($user['userlink']) . '">' . $user['username'] . '</a>';

			$opened_cat = (isset($_GET[POST_CAT_URL])) ? '&' . POST_CAT_URL . '=' . $_GET[POST_CAT_URL] : '';
			// Status output
			if ($rows[$i]['report_status'] == 0)
			{
				$report_status = "report.$phpEx?mode=notfinished&id=" . $rows[$i]['report_id'] . $opened_cat;
				$report_status = '<a href="' . append_sid($report_status) . '" class="notfinished">' . $lang['Report_Status_0'] . '</a>';
			}
			else
			{
				$report_status = "report.$phpEx?mode=finished&id=" . $rows[$i]['report_id'] . $opened_cat;
				$report_status = '<a href="' . append_sid($report_status) . '" class="finished">' . $lang['Report_Status_1'] . '</a>';
			}

			// Delete links
			$report_delete = append_sid("report.$phpEx?mode=delete&id=" . $rows[$i]['report_id'] . $opened_cat);
			$report_delete = '<a href="' . $report_delete . '">' . $lang['Report_Delete'] . '</a>';

			$cat_delete_all = append_sid("report.$phpEx?mode=deleteall&id=" . $rows[$i]['cat_id'] . $opened_cat);
			$cat_delete_all = '<a href="' . $cat_delete_all . '" class="nav">' . $lang['Report_Delete_All'] . '</a>';

			$report = array(
				'report_id' => $rows[$i]['report_id'],
				'report_status' => $report_status,
				'report_date' => $rows[$i]['report_date'],
				'report_user_id' => $rows[$i]['report_user_id'],
				'report_user' => $user['username'],
				'report_userlink' => $user['userlink'],
				'report_delete_link' => $report_delete,
				'report_info' => ($rows[$i]['report_info'] != '') ? make_clickable(htmlspecialchars($rows[$i]['report_info'])) : '-',
				'report_text' => ($rows[$i]['text'] != '') ? nl2br(make_clickable(htmlspecialchars($rows[$i]['text']))) : '-'
			);

			$report_data[$cat_id]['reports'][] = $report;
		}

		$report_data[$cat_id]['cat_id'] = $cat_id;
		$report_data[$cat_id]['cat_name'] = $rows[$i]['cat_name'];
		$report_data[$cat_id]['cat_link'] = append_sid("report.$phpEx?" . POST_CAT_URL . "=" . $cat_id);
		$report_data[$cat_id]['cat_explain'] = nl2br(make_clickable(htmlspecialchars($rows[$i]['cat_explain'])));
		$report_data[$cat_id]['cat_delete_all'] = $cat_delete_all;
	}

	foreach ($report_data as $this_cat)
	{
		$template->assign_block_vars('catrow', array(
			'ID' => $this_cat['cat_id'],
			'NAME' => $this_cat['cat_name'],
			'LINK' => $this_cat['cat_link'],
			'DELETE_ALL' => $this_cat['cat_delete_all'],
			'EXPLAIN' => $this_cat['cat_explain'])
		);

		if (count($this_cat['reports']) == 0)
		{
			$template->assign_block_vars('catrow.switch_no_result', array());
		}
		else
		{
			foreach ($this_cat['reports'] as $this_report)
			{
				// BEGIN report_post extension
				if ($this_cat['cat_id'] == REPORT_POST_ID && intval($this_report['report_info']))
				{
					$post_id = $this_report['report_info'];
					// Get Topic Name
					$sql = "SELECT t.topic_title FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
						WHERE p.topic_id = t.topic_id AND p.post_id = $post_id";
					if(!($result = $db->sql_query($sql)))
					{
						message_die(GENERAL_ERROR, 'Could not get topic title', '', __LINE__, __FILE__, $sql);
					}
					$count = $db->sql_numrows($result);
					$row = $db->sql_fetchrow($result);
					$db->sql_freeresult($result);
					$link = append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id . "#" . $post_id);
					$this_report['report_info'] = ($count != 0) ? '<a href="' . $link . '" class="genmed">' . $row['topic_title'] . '</a>' : $this_report['report_info'];
				}
				// END report_post extension
				$template->assign_block_vars('catrow.reportrow', array(
					'ID' => $this_report['report_id'],
					'STATUS' => $this_report['report_status'],
					'DATE' => create_date($board_config['default_dateformat'], $this_report['report_date'], $board_config['board_timezone']),
					'USER' => $this_report['report_userlink'],
					'INFO' => $this_report['report_info'],
					'TEXT' => $this_report['report_text'],
					'DELETE' => $this_report['report_delete_link'])
				);
			}
		}
	}
	// Code by alcaeus [END]

	$template->assign_vars(array(
		'L_STATUS' => $lang['Report_Status'],
		'L_INFO' => $lang['Report_Info'],
		'L_DATE' => $lang['Report_Date'],
		'L_USERNAME' => $lang['Report_Username'],
		'L_DELETE' => $lang['Report_Delete'],
		'L_SHOW_ALL' => $lang['Report_Show_All'],
		'L_NO_RESULT' => $lang['Report_No_Results'],
		'SPACER_IMG' => $phpbb_root_path . 'images/spacer.gif',

		'U_SHOW_ALL' => append_sid("report.$phpEx"),
		'T_NOT_FINISHED' => $board_config['color_0'],
		'T_FINISHED' => $board_config['color_1'])
	);

	if (isset($_GET[POST_CAT_URL]))
	{
		$template->assign_block_vars('switch_view_cat',array());
	}

	$template->assign_block_vars('switch_link',array());

	$template->pparse('body');
	include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
else
{
	redirect("report.$phpEx");
}

?>
michi-w.
Mitglied
Beiträge: 412
Registriert: 21.06.2003 23:45

Beitrag von michi-w. »

Keine Idee?
Benutzeravatar
S2B
Ehemaliges Teammitglied
Beiträge: 3258
Registriert: 10.08.2004 22:48
Wohnort: Aachen
Kontaktdaten:

Beitrag von S2B »

Zuerst mal: KB:datei. Du kannst doch nicht einfach eine ganze Datei hier ins Board posten!? :roll:

Zu dem Fehler: Ist korrigiert, es ändert sich aber nichts an der Versionsnummer, da es nur ein Fehler im FIND-Teil ist.

Zu deinem Problem: Ich hoffe, das ist jetzt der letzte Fehler (man merkt, dass der Code ungetestet war :roll: ):
Dieser Code

Code: Alles auswählen

      report_notify(REPORT_POST_ID, $_POST['info'], $_POST['text']);
muss so heißen:

Code: Alles auswählen

      report_notify(REPORT_POST_ID, $id, $_POST['text']);
Gruß, S2B
Keinen Support per ICQ/PM!
Hier kann man meine PHP-Skripte und meine MODs für phpBB runterladen.
michi-w.
Mitglied
Beiträge: 412
Registriert: 21.06.2003 23:45

Beitrag von michi-w. »

Sorry, wußte ich nicht.

(So am Rande, mein zweites Projekt ist http://www.web-upload.de
dort können u.a. auch txt Dateien hochgeladen werden. :wink:)

Nun zum Thema, wir kommen der Sache näher, es muss nur noch ein = zum Link in der Email, dann müsste es klappen.
Das heißt, bei php?p= fehlt das = Zeichen.

Seltsamerweise ist der Link in der Email auch nicht komplett aktiv, er ist so:
http://www.buerger-forum.de/viewtopic.php?p124#124

Gruß
michi-w.
michi-w.
Mitglied
Beiträge: 412
Registriert: 21.06.2003 23:45

Beitrag von michi-w. »

Ich hab`s :D

Code: Alles auswählen

#
#-----[ FIND ]------------------------------------------
#
$text = ($cat_id != REPORT_POST_ID) ? $report_info . "\n" . $report_text : $report_text . "\n\n" . $server_protocol . $server_name . $server_port . $script_name2 . '?' . POST_POST_URL . "$report_info#$report_info";

#
#-----[ IN-LINE FIND ]----------------------------------
#
POST_POST_URL .

#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
 "=" .
Vielen Dank für deine Hilfe, frohe Festtage und einen guten Rutsch!
michi-w.
Benutzeravatar
S2B
Ehemaliges Teammitglied
Beiträge: 3258
Registriert: 10.08.2004 22:48
Wohnort: Aachen
Kontaktdaten:

Beitrag von S2B »

OK, ich poste ab jetzt nie wieder einen ungetesteten Code. :oops: :lol:
Gruß, S2B
Keinen Support per ICQ/PM!
Hier kann man meine PHP-Skripte und meine MODs für phpBB runterladen.
michi-w.
Mitglied
Beiträge: 412
Registriert: 21.06.2003 23:45

Beitrag von michi-w. »

S2B hat geschrieben:OK, ich poste ab jetzt nie wieder einen ungetesteten Code. :oops: :lol:
Warum das denn nicht?

Hat doch super geklappt, das es nicht sofort ging war mir von Anfang an klar.
Ich bin sehr zufrieden!!! :D

Hätte da noch einen Wunsch, vielleicht kannst du den mit auf deine Liste setzen? :oops:
http://www.phpbb.de/viewtopic.php?p=610391#610391

Gruß
michi-w.
Antworten

Zurück zu „phpBB 2.0: Mod Support“