Hallo Forum!
Gibt es eine Möglichkeit eine Mail (oder PM) an einen Moderator oder Administrator zu schicken, wenn sich ein bestimmter User einloggt?
Mirko
"Einlogwarnung"
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.
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.
Code: Alles auswählen
$sql2 = "SELECT session_user_id, session_start, user_id
FROM ". SESSIONS_TABLE .", ". USERS_TABLE ."
WHERE session_user_id = user_id";
if( !($result = $db->sql_query($sql2)) )
{
message_die(GENERAL_ERROR, 'Could not get session_user_id.', '', __LINE__, __FILE__, $sql2);
}
if( $row2 = $db->sql_fetchrow($result2) );
{
if( $row2['user_id'] == '3' && $row2['session_start'] == time() )
{
mail('deine@adresse.de','hi','hi. this is a test','From: '. $board_config['board_email'].'');
}
}
(Eventueller Haken bei der Sache, du bekommst öfters Mails... Mir fällt jetzt momentan nix ein, wie man den Login des Users sonst herausfinden kann. )
mhhh, vielen Dank für die Hilfe. Leider funktioniert es nicht.
Ich bekomme gar keine Mail. Die Seite läd normal. Hab auch schon geguckt, ob was bounced und verschiedene eMail Adresse probiert. Und hab auch schon meine eigene User ID (2, nehme ich an) eingetragen.
Ist vielleicht hier nen Fehler?
mail('deine@adresse.de','hi','hi. this is a test','From: '. $board_config['board_email'].'');
denn, Du hast nen From: aber kein Subject: oder To:?
Mirko
Ich bekomme gar keine Mail. Die Seite läd normal. Hab auch schon geguckt, ob was bounced und verschiedene eMail Adresse probiert. Und hab auch schon meine eigene User ID (2, nehme ich an) eingetragen.
Ist vielleicht hier nen Fehler?
mail('deine@adresse.de','hi','hi. this is a test','From: '. $board_config['board_email'].'');
denn, Du hast nen From: aber kein Subject: oder To:?
Mirko
..is nur ´n simples mail()-Script, vielleicht zu simple.
(Ich hatte jetzt ka Bock das ganze emailer Zeugs zu posten.) Ersetze mal die mail() Zeile mit folgendem (trage bei $id_sender und $id_resv deine ID ein)..

Code: Alles auswählen
$id_sender = '2';
$id_resv = '2';
$msg_time = time();
$pm_subject = 'titel';
$pm_text = 'text';
$bbcode_uid = '';
$sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $pm_subject) . "', " . $id_sender . ", " . $id_resv . ", $msg_time, '7f000001', 1, 1, 1, 0)";
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info);
}
$privmsg_sent_id = $db->sql_nextid();
$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)
VALUES ($privmsg_sent_id, '". $bbcode_uid ."', '" . str_replace("\'", "''", addslashes($pm_text)) . "')";
if ( !$db->sql_query($sql, END_TRANSACTION) )
{
message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);
}
$sql = "UPDATE " . USERS_TABLE . " SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . "
WHERE user_id = " . $id_resv;
if ( !$status = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
}
mist, will nicht. bekomme nichts, auch keinen fehler, obwohl ich reloads gemacht habe und user 119 sich eingeloggt hat.
ich hab:
und das vor:
ich hab:
Code: Alles auswählen
//
// Remove me!
//
$sql2 = "SELECT session_user_id, session_start, user_id
FROM ". SESSIONS_TABLE .", ". USERS_TABLE ."
WHERE session_user_id = user_id";
if( !($result = $db->sql_query($sql2)) )
{
message_die(GENERAL_ERROR, 'Could not get session_user_id.', '', __LINE__, __FILE__, $sql2);
}
if( $row2 = $db->sql_fetchrow($result2) );
{
if( $row2['user_id'] == '119' && $row2['session_start'] == time() )
{
$id_sender = '2';
$id_resv = '2';
$msg_time = time();
$pm_subject = 'Player is on!';
$pm_text = 'The Player is on!';
$bbcode_uid = '';
$sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig)
VALUES (" . PRIVMSGS_NEW_MAIL . ", '" . str_replace("\'", "''", $pm_subject) . "', " . $id_sender . ", " . $id_resv . ", $msg_time, '7f000001', 1, 1, 1, 0)";
if ( !($result = $db->sql_query($sql, BEGIN_TRANSACTION)) )
{
message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info);
}
$privmsg_sent_id = $db->sql_nextid();
$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text)
VALUES ($privmsg_sent_id, '". $bbcode_uid ."', '" . str_replace("\'", "''", addslashes($pm_text)) . "')";
if ( !$db->sql_query($sql, END_TRANSACTION) )
{
message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info);
}
$sql = "UPDATE " . USERS_TABLE . " SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . "
WHERE user_id = " . $id_resv;
if ( !$status = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update private message new/read status for user', '', __LINE__, __FILE__, $sql);
}
}
}
Code: Alles auswählen
//
// Generate the page
//
$template->pparse('body');
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);