Thema per e-mail einem Freund schicken
Moderators: Partyman, Legions, Man of 1000, speedy64, Moderatoren
- derFAN
- MODERATOR
- Posts: 5632
- Joined: Fri 4. Jun 2004, 17:29
- Location: koblenz
- Age: 58
- Gender:
- Contact:
ich fahre schon seit jahren glücklich mit winME. ich habe auch vorhin meine firewall testweise abgeschaltet - cookies glöscht - ausgeloggt - eingeloggt und es ging nicht.....3 minuten später gings wieder. ich habe echt keinen plan, woran das liegen könnte. ich schätze, das der fehler im mod selbst liegt - etwas anderes kann ich mir nicht mehr erklären
- Cheffe
- ADMINISTRATOR
- Posts: 9120
- Joined: Mon 31. May 2004, 11:59
- Location: Wien
- Age: 55
- Gender:
- Contact:
von irgendetwas muss es noch abhängig sein, ob es funktioniert oder nicht.
Die Frage ist nur, WAS? Dann könnte ich es ja vielleicht abändern, sodass es immer funktioniert, aber vorher muss ich ja wissen, wovon es abhängig ist, ob es nun funktioniert oder nicht...
30 ist übrigens anscheinend ein anderes Thema, ich habe hier 1245 stehen, wenn ich auf den Link klicke...
Die Frage ist nur, WAS? Dann könnte ich es ja vielleicht abändern, sodass es immer funktioniert, aber vorher muss ich ja wissen, wovon es abhängig ist, ob es nun funktioniert oder nicht...
30 ist übrigens anscheinend ein anderes Thema, ich habe hier 1245 stehen, wenn ich auf den Link klicke...
- Cheffe
- ADMINISTRATOR
- Posts: 9120
- Joined: Mon 31. May 2004, 11:59
- Location: Wien
- Age: 55
- Gender:
- Contact:
@derFAN: wenn er sich da irgendwie verrechnet, und nicht die richtige topic-Zahl erscheint (0 gibt es ja nicht), kann es ja eigentlich nur daran liegen, wo er das berechnet, oder sehe ich das falsch?:
./viewtopic.php
#
#-----[ FIND ]--------------------------------------------
#
//
// If we've got a hightlight set pass it on to pagination,
// I get annoyed when I lose my highlight after the first page.
//
#
#-----[ BEFORE, ADD ]-------------------------------------
#
//
// Add the email topic to friend
//
$s_email_topic = '';
if ( $userdata['session_logged_in'] )
{
$action = ( isset($post_id) ) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id&start=$start";
$s_email_topic = '<a href="' . append_sid("email_topic.$phpEx?$action") . '">' . $lang['Email_topic'] . '</a>';
}siehst Du darin einen Fehler?
./viewtopic.php
#
#-----[ FIND ]--------------------------------------------
#
//
// If we've got a hightlight set pass it on to pagination,
// I get annoyed when I lose my highlight after the first page.
//
#
#-----[ BEFORE, ADD ]-------------------------------------
#
//
// Add the email topic to friend
//
$s_email_topic = '';
if ( $userdata['session_logged_in'] )
{
$action = ( isset($post_id) ) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id&start=$start";
$s_email_topic = '<a href="' . append_sid("email_topic.$phpEx?$action") . '">' . $lang['Email_topic'] . '</a>';
}siehst Du darin einen Fehler?
- Cheffe
- ADMINISTRATOR
- Posts: 9120
- Joined: Mon 31. May 2004, 11:59
- Location: Wien
- Age: 55
- Gender:
- Contact:
naja, da gibt es noch die email_tpoic.php :
<?php
define ('IN_PHPBB', true);
$phpbb_root_path = "./";
include ($phpbb_root_path . 'extension.inc');
include ($phpbb_root_path . 'common.'.$phpEx);
//
// Parameters
//
$friend_name = (isset ($HTTP_POST_VARS['friend_name'])) ? trim(strip_tags($HTTP_POST_VARS['friend_name'])) : '';
$friend_email = (isset ($HTTP_POST_VARS['friend_email'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['friend_email']))) : '';
$post_id = (isset ($HTTP_GET_VARS[POST_POST_URL])) ? $HTTP_GET_VARS[POST_POST_URL] : ((isset($HTTP_POST_VARS[POST_POST_URL])) ? $HTTP_POST_VARS[POST_POST_URL] : 0);
$topic_id = (isset ($HTTP_GET_VARS[POST_TOPIC_URL])) ? $HTTP_GET_VARS[POST_TOPIC_URL] : ((isset($HTTP_POST_VARS[POST_TOPIC_URL])) ? $HTTP_POST_VARS[POST_TOPIC_URL] : 0);
$start = (isset ($HTTP_GET_VARS['start'])) ? $HTTP_GET_VARS['start'] : ((isset($HTTP_POST_VARS['start'])) ? $HTTP_POST_VARS['start'] : 0);
$submit = (isset ($HTTP_POST_VARS['submit'])) ? TRUE : 0;
if (!$topic_id && !$post_id) {
message_die (GENERAL_MESSAGE, 'Topic_post_not_exist');
}
$redirect = ($post_id) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id&start=$start";
//
// Start session management
//
$userdata = session_pagestart ($user_ip, PAGE_PROFILE);
init_userprefs ($userdata);
//
// End session management
//
if (!$userdata['session_logged_in']) {
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=email_topic.$phpEx&$redirect", true));
exit;
}
$sql = "SELECT t.topic_id, t.topic_title, t.forum_id
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.topic_id = $topic_id
OR (p.post_id = $post_id
AND t.topic_id = p.topic_id)";
if (!$result = $db->sql_query ($sql)) {
message_die (GENERAL_ERROR, 'Could not obtain topic information', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow ($result);
$topic_title = $row['topic_title'];
$topic_id = $row['topic_id'];
$forum_id = $row['forum_id'];
//
// Uncomment the following lines to make a limit for the users.
// $email_limit sets the maximum number of emails.
// $email_time sets the time window for the limit (in hours).
//
/*
$email_limit = 5;
$email_time = 24;
$current_time = time ();
$sql = "SELECT COUNT(user_id) AS total
FROM " . TOPICS_EMAIL_TABLE . "
WHERE user_id = " . $userdata['user_id'] . "
AND time >= " . ($current_time - ($drink_time * 3600));
if (!$result = $db->sql_query ($sql)) {
message_die (GENERAL_ERROR, 'Could not obtain user\'s email informaton', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow ($result);
if ($row['total'] >= $drink_limit) {
message_die (GENERAL_MESSAGE, $lang['Email_max_exceeded']);
}
*/
if ($submit) {
//
// Add record to database
//
if (!$friend_name || !$friend_email) {
message_die (GENERAL_MESSAGE, $lang['No_friend_specified']);
}
$sql = "INSERT INTO " . TOPICS_EMAIL_TABLE . " VALUES (" . $userdata['user_id'] . ", '" . str_replace("\'", "''", $friend_name) . "', '" . str_replace ("\'", "''", $friend_email) . "', $topic_id, '$current_time')";
if (!$result = $db->sql_query ($sql)) {
message_die (GENERAL_ERROR, 'Could not insert topic email data', __LINE__, __FILE__, $sql);
}
$server_url = "http://" . $board_config['server_name'];
$server_url .= ($board_config['server_port'] == 80) ? '' : ':' . $board_config['server_port'];
$server_url .= $board_config['script_path'];
$email_headers = 'From: ' . $userdata['user_email'] . "\nReturn-Path: " . $userdata['user_email'] . "\n";
include ($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer ($board_config['smtp_delivery']);
$emailer->use_template ('email_topic', $userdata['user_lang']);
$emailer->email_address ($friend_email);
$emailer->set_subject ();//$lang['Email_topic']
$emailer->extra_headers ($email_headers);
$emailer->assign_vars (
array (
'SITENAME' => $board_config['sitename'],
'USERNAME' => $userdata['username'],
'FRIEND_NAME' => $friend_name,
'TOPIC' => $topic_title,
'BOARD_EMAIL' => $board_config['board_email'],
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $userdata['username']),
'U_TOPIC' => $server_url . "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"
)
);
$emailer->send();
$emailer->reset();
$redirect .= ($post_id) ? "#$post_id" : "";
$template->assign_vars (
array (
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid ("viewtopic.$phpEx?$redirect") . '">'
)
);
$msg = $lang['Email_sent'] . '<br /><br />' . sprintf ($lang['Click_return_topic'], '<a href="' . append_sid ("viewtopic.$phpEx?$redirect") . '">', '</a>') . '<br /><br />' . sprintf ($lang['Click_return_index'], '<a href="' . append_sid ("index.$phpEx") . '">', '</a>');
message_die (GENERAL_MESSAGE, $msg);
}
//
// Default page
//
$page_title = $lang['Email_topic'];
include ($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames (
array (
'body' => 'email_topic_body.tpl'
)
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);
$s_hidden_fields = '<input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '">';
$s_hidden_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '">';
$s_hidden_fields .= '<input type="hidden" name="start" value="' . $start . '">';
$template->assign_vars (
array (
'L_TITLE' => $lang['Email_topic_settings'],
'L_FRIEND_NAME' => $lang['Friend_name'],
'L_FRIEND_EMAIL' => $lang['Friend_email'],
'L_SUBJECT' => $lang['Subject'],
'L_SUBMIT' => $lang['Submit'],
'TOPIC_TITLE' => $topic_title,
'S_EMAIL_ACTION' => append_sid ("email_topic.$phpEx"),
'S_HIDDEN_FIELDS' => $s_hidden_fields
)
);
$template->pparse ('body');
include ($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
<?php
define ('IN_PHPBB', true);
$phpbb_root_path = "./";
include ($phpbb_root_path . 'extension.inc');
include ($phpbb_root_path . 'common.'.$phpEx);
//
// Parameters
//
$friend_name = (isset ($HTTP_POST_VARS['friend_name'])) ? trim(strip_tags($HTTP_POST_VARS['friend_name'])) : '';
$friend_email = (isset ($HTTP_POST_VARS['friend_email'])) ? trim(strip_tags(htmlspecialchars($HTTP_POST_VARS['friend_email']))) : '';
$post_id = (isset ($HTTP_GET_VARS[POST_POST_URL])) ? $HTTP_GET_VARS[POST_POST_URL] : ((isset($HTTP_POST_VARS[POST_POST_URL])) ? $HTTP_POST_VARS[POST_POST_URL] : 0);
$topic_id = (isset ($HTTP_GET_VARS[POST_TOPIC_URL])) ? $HTTP_GET_VARS[POST_TOPIC_URL] : ((isset($HTTP_POST_VARS[POST_TOPIC_URL])) ? $HTTP_POST_VARS[POST_TOPIC_URL] : 0);
$start = (isset ($HTTP_GET_VARS['start'])) ? $HTTP_GET_VARS['start'] : ((isset($HTTP_POST_VARS['start'])) ? $HTTP_POST_VARS['start'] : 0);
$submit = (isset ($HTTP_POST_VARS['submit'])) ? TRUE : 0;
if (!$topic_id && !$post_id) {
message_die (GENERAL_MESSAGE, 'Topic_post_not_exist');
}
$redirect = ($post_id) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id&start=$start";
//
// Start session management
//
$userdata = session_pagestart ($user_ip, PAGE_PROFILE);
init_userprefs ($userdata);
//
// End session management
//
if (!$userdata['session_logged_in']) {
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid("login.$phpEx?redirect=email_topic.$phpEx&$redirect", true));
exit;
}
$sql = "SELECT t.topic_id, t.topic_title, t.forum_id
FROM " . TOPICS_TABLE . " t, " . POSTS_TABLE . " p
WHERE t.topic_id = $topic_id
OR (p.post_id = $post_id
AND t.topic_id = p.topic_id)";
if (!$result = $db->sql_query ($sql)) {
message_die (GENERAL_ERROR, 'Could not obtain topic information', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow ($result);
$topic_title = $row['topic_title'];
$topic_id = $row['topic_id'];
$forum_id = $row['forum_id'];
//
// Uncomment the following lines to make a limit for the users.
// $email_limit sets the maximum number of emails.
// $email_time sets the time window for the limit (in hours).
//
/*
$email_limit = 5;
$email_time = 24;
$current_time = time ();
$sql = "SELECT COUNT(user_id) AS total
FROM " . TOPICS_EMAIL_TABLE . "
WHERE user_id = " . $userdata['user_id'] . "
AND time >= " . ($current_time - ($drink_time * 3600));
if (!$result = $db->sql_query ($sql)) {
message_die (GENERAL_ERROR, 'Could not obtain user\'s email informaton', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow ($result);
if ($row['total'] >= $drink_limit) {
message_die (GENERAL_MESSAGE, $lang['Email_max_exceeded']);
}
*/
if ($submit) {
//
// Add record to database
//
if (!$friend_name || !$friend_email) {
message_die (GENERAL_MESSAGE, $lang['No_friend_specified']);
}
$sql = "INSERT INTO " . TOPICS_EMAIL_TABLE . " VALUES (" . $userdata['user_id'] . ", '" . str_replace("\'", "''", $friend_name) . "', '" . str_replace ("\'", "''", $friend_email) . "', $topic_id, '$current_time')";
if (!$result = $db->sql_query ($sql)) {
message_die (GENERAL_ERROR, 'Could not insert topic email data', __LINE__, __FILE__, $sql);
}
$server_url = "http://" . $board_config['server_name'];
$server_url .= ($board_config['server_port'] == 80) ? '' : ':' . $board_config['server_port'];
$server_url .= $board_config['script_path'];
$email_headers = 'From: ' . $userdata['user_email'] . "\nReturn-Path: " . $userdata['user_email'] . "\n";
include ($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer ($board_config['smtp_delivery']);
$emailer->use_template ('email_topic', $userdata['user_lang']);
$emailer->email_address ($friend_email);
$emailer->set_subject ();//$lang['Email_topic']
$emailer->extra_headers ($email_headers);
$emailer->assign_vars (
array (
'SITENAME' => $board_config['sitename'],
'USERNAME' => $userdata['username'],
'FRIEND_NAME' => $friend_name,
'TOPIC' => $topic_title,
'BOARD_EMAIL' => $board_config['board_email'],
'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $userdata['username']),
'U_TOPIC' => $server_url . "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id"
)
);
$emailer->send();
$emailer->reset();
$redirect .= ($post_id) ? "#$post_id" : "";
$template->assign_vars (
array (
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid ("viewtopic.$phpEx?$redirect") . '">'
)
);
$msg = $lang['Email_sent'] . '<br /><br />' . sprintf ($lang['Click_return_topic'], '<a href="' . append_sid ("viewtopic.$phpEx?$redirect") . '">', '</a>') . '<br /><br />' . sprintf ($lang['Click_return_index'], '<a href="' . append_sid ("index.$phpEx") . '">', '</a>');
message_die (GENERAL_MESSAGE, $msg);
}
//
// Default page
//
$page_title = $lang['Email_topic'];
include ($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames (
array (
'body' => 'email_topic_body.tpl'
)
);
make_jumpbox('viewforum.'.$phpEx, $forum_id);
$s_hidden_fields = '<input type="hidden" name="' . POST_POST_URL . '" value="' . $post_id . '">';
$s_hidden_fields .= '<input type="hidden" name="' . POST_TOPIC_URL . '" value="' . $topic_id . '">';
$s_hidden_fields .= '<input type="hidden" name="start" value="' . $start . '">';
$template->assign_vars (
array (
'L_TITLE' => $lang['Email_topic_settings'],
'L_FRIEND_NAME' => $lang['Friend_name'],
'L_FRIEND_EMAIL' => $lang['Friend_email'],
'L_SUBJECT' => $lang['Subject'],
'L_SUBMIT' => $lang['Submit'],
'TOPIC_TITLE' => $topic_title,
'S_EMAIL_ACTION' => append_sid ("email_topic.$phpEx"),
'S_HIDDEN_FIELDS' => $s_hidden_fields
)
);
$template->pparse ('body');
include ($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
- derFAN
- MODERATOR
- Posts: 5632
- Joined: Fri 4. Jun 2004, 17:29
- Location: koblenz
- Age: 58
- Gender:
- Contact:
das ist ja das irre! die zahlen variieren anscheinend beim selben thema (und das leuchtet mir nicht ein)30 ist übrigens anscheinend ein anderes Thema, ich habe hier 1245 stehen, wenn ich auf den Link klicke...
ich konnte bisher noch keinen fehler herauslesen - gebe mir aber weiterhin mühe was zu entdecken
- derFAN
- MODERATOR
- Posts: 5632
- Joined: Fri 4. Jun 2004, 17:29
- Location: koblenz
- Age: 58
- Gender:
- Contact:
nun habe ich mal versucht anstatt der 0, eine 2 einzutragen.
folgende fehlermeldung erschien danach...
50
Could not obtain topic information
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR (p.post_id = 2 AND t.topic_id = p.topic_id)' at line 4
Line : /mnt/ls6/15/131/00000000/htdocs/phpbb2/email_topic.php
File : SELECT t.topic_id, t.topic_title, t.forum_id FROM phpbb_topics t, phpbb_posts p WHERE t.topic_id = OR (p.post_id = 2 AND t.topic_id = p.topic_id)
liegt der fehler also in zeile 4????
folgende fehlermeldung erschien danach...
50
Could not obtain topic information
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR (p.post_id = 2 AND t.topic_id = p.topic_id)' at line 4
Line : /mnt/ls6/15/131/00000000/htdocs/phpbb2/email_topic.php
File : SELECT t.topic_id, t.topic_title, t.forum_id FROM phpbb_topics t, phpbb_posts p WHERE t.topic_id = OR (p.post_id = 2 AND t.topic_id = p.topic_id)
liegt der fehler also in zeile 4????
- Cheffe
- ADMINISTRATOR
- Posts: 9120
- Joined: Mon 31. May 2004, 11:59
- Location: Wien
- Age: 55
- Gender:
- Contact:
folgendes: ich glaube, ich habe zumindest herausgefunden, wann es funktioniert, und wann nicht:
es funktioniert, wenn:
Du vom Hauptforum DIREKT zum letzten Beitrag gehst, und dann die mail schickst. Du gehst direkt zum letzten Beitrag durch einen klick rechts auf das kleine Viereck.
es funktioniert nicht, wenn:
Du zuerst in das deutsche Forum gehst, dann auf das Thema klickst, und dann weiterklickst (warum machen Leute das, ist doch viel zu kompliziert ). Dann erkennt er das nicht, warum auch immer. Man muss also einen BEITRAG angeklickt haben (das Viereck), sonst geht es nicht.
Probiert es aus und postet hier, ob das so stimmt.
@derFAN: was bedeutet das für den Code, wo liegt der Fehler? Die Zahl, die dort oben erscheint ist anscheinend die Beitragsnummer und nicht die Themennummer... kannst Du das vielleicht aus dem Code herauslesen?
Man kann also nur einen BEITAG versenden, un der Empfänger bekommt dann eineen Link zum dementsprechenden THEMA
es funktioniert, wenn:
Du vom Hauptforum DIREKT zum letzten Beitrag gehst, und dann die mail schickst. Du gehst direkt zum letzten Beitrag durch einen klick rechts auf das kleine Viereck.
es funktioniert nicht, wenn:
Du zuerst in das deutsche Forum gehst, dann auf das Thema klickst, und dann weiterklickst (warum machen Leute das, ist doch viel zu kompliziert ). Dann erkennt er das nicht, warum auch immer. Man muss also einen BEITRAG angeklickt haben (das Viereck), sonst geht es nicht.
Probiert es aus und postet hier, ob das so stimmt.
@derFAN: was bedeutet das für den Code, wo liegt der Fehler? Die Zahl, die dort oben erscheint ist anscheinend die Beitragsnummer und nicht die Themennummer... kannst Du das vielleicht aus dem Code herauslesen?
Man kann also nur einen BEITAG versenden, un der Empfänger bekommt dann eineen Link zum dementsprechenden THEMA
- derFAN
- MODERATOR
- Posts: 5632
- Joined: Fri 4. Jun 2004, 17:29
- Location: koblenz
- Age: 58
- Gender:
- Contact:
zunächst einmal funktioniert das so, wie du das beschrieben hast
es muss doch aber auch möglich sein, mich irgendwohin zu klicken und gerade dann, wenn ich ein thema spannend finde, eine betreffende mail zu verschicken.
leider konnte ich diese fehlermeldung im code noch nicht deuten, oder etwas damit in zusammenhang bringen *such*
es muss doch aber auch möglich sein, mich irgendwohin zu klicken und gerade dann, wenn ich ein thema spannend finde, eine betreffende mail zu verschicken.
leider konnte ich diese fehlermeldung im code noch nicht deuten, oder etwas damit in zusammenhang bringen *such*
- KISS74
- PLATINUM USER
- Posts: 3151
- Joined: Fri 4. Jun 2004, 20:44
- Location: /home
- Age: 54
- Gender:
- Contact:
Also wenn ich von der Forum Übersicht direkt über das kleine Viereck zum letzten Beitrag gehe und dann auf Beitrag einem Freund schicken, dann gehts bei mr auch
Das wiederum kann aber nicht sinn der sache sein, weil wenn jemand ein Thema durchliest und es ihm gefällt und will dann dieses einem Freund schicken funzt es nich
Verkorste Sache