Privmsg-Addon User Note 1.3

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.
Antworten
jörg gierth
Mitglied
Beiträge: 473
Registriert: 03.12.2002 20:13
Wohnort: Buseck
Kontaktdaten:

Privmsg-Addon User Note 1.3

Beitrag von jörg gierth »

Hier ei kleine Anleitung zum Einbau der User Notes
in die Privaten-Nachrichten:

Code: Alles auswählen

#
#-----[ OPEN ]------------------------------------------
#
privmsg.php

#
#-----[ FIND ]------------------------------------------
#

// ----------
// Start main

#
#-----[ BEFORE, ADD ]------------------------------------------
#
// User Notes MOD
if ( !in_array($HTTP_POST_VARS['add_note_id'], array(-1,0)) && $board_config['disable_notes'] == FALSE && $board_config['import_notes'] != -1 && ($board_config['import_notes'] == 0 || ($board_config['import_notes'] == 2 && $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN) || ($board_config['import_notes'] == 1 && $userdata['user_level'] == ADMIN)) )
{
	$sql = "SELECT note, bbcode_uid
		FROM " . NOTES_TABLE . "
		WHERE user_id = '" . $userdata['user_id'] . "'
		AND id = '" . $HTTP_POST_VARS['add_note_id'] . "';";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Couldn't obtain note information.", "", __LINE__, __FILE__, $sql);
	}
	$row = $db->sql_fetchrow($result);

	if ( $row['bbcode_uid'] != '' )
	{
		$row['note'] = preg_replace('/\:(([a-z0-9]:)?)' . $row['bbcode_uid'] . '/s', '', $row['note']);
	}

	$HTTP_POST_VARS['message'] = ( mysql_num_rows($result) == "1" ) ? $HTTP_POST_VARS['message'] . "\n" . $row['note'] : $HTTP_POST_VARS['message'];
}


#
#-----[ FIND ]------------------------------------------
#

	$privmsg_subject = str_replace('"', '"', $privmsg_subject);

$template->assign_vars(array(

#
#-----[ Replace with]------------------------------------------
#

   $privmsg_subject = str_replace('"', '"', $privmsg_subject); 

// User Notes MOD
if ( $board_config['disable_notes'] == FALSE && $board_config['import_notes'] != -1 && ($board_config['import_notes'] == 0 || ($board_config['import_notes'] == 2 && $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN) || ($board_config['import_notes'] == 1 && $userdata['user_level'] == ADMIN)) )
{
	$sql = "SELECT id, title
		FROM " . NOTES_TABLE . "
		WHERE user_id = '" . $userdata['user_id'] . "'
		ORDER BY id " . $userdata['user_notes_sort'] . ";";
	if ( !($result = $db->sql_query($sql)) )
	{
		message_die(GENERAL_ERROR, "Couldn't obtain notes list.", "", __LINE__, __FILE__, $sql);
	}
	$notes_import = "\n\t\t\t  <select name=\"add_note_id\">\n\t\t\t    <option value=\"-1\" selected=\"selected\">" . $lang['Select_note'] . "</option>";
	while ( $row = $db->sql_fetchrow($result) )
	{
		$notes_import_options .=  "\n\t\t\t    <option value=\"" . $row['id'] . "\">" . $row['title'] . "</option>";
	}
	if ( $notes_import_options != '' )
	{
		$notes_import .= "\n\t\t\t    <option value=\"-1\">&nbsp;</option>";
		$notes_import .= "\n\t\t\t    <option value=\"-1\">----------------</option>";
		$notes_import .= $notes_import_options;
	}
	$notes_import .= "\n\t\t\t  </select>";
	$template->assign_block_vars('switch_notes_import', array());
}

//
// Output the data to the template
//
$template->assign_vars(array(
	'L_NOTES_IMPORT' => $lang['Import_note'],
	'L_NOTES_GO' => $lang['Import_note_go'],
	'S_NOTES_IMPORT' => $notes_import,

so das war es schon.

Gruß Jörg
Antworten

Zurück zu „phpBB 2.0: Mod Support“