Ahoi mgutt,
Du hast mich wieder einmal gerettet - besten Dank!
mgutt hat geschrieben:deine meldung deutet eher daraufhin, dass in deiner viewtopic.php etwas nicht stimmt. ich denke mal im part wo die view newest abgefragt werden und dann weitergeleitet wird auf einen post link.
Also auf die Idee, in der viewtopic.php den Fehler zu suchen, wäre ich nicht von selbst gekommen...
Dieser Codeabschnitt in der view
topic.php war der Übeltäter:
Code: Alles auswählen
//
// Find topic id if user requested a newer
// or older topic
//
if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{
if ( $HTTP_GET_VARS['view'] == 'newest' )
{ // read the first unread post in this topic
$sql = "SELECT p.post_id, t.topic_last_post_id
FROM (" . TOPICS_TABLE . " t
LEFT JOIN " . POSTS_TABLE . " p ON p.topic_id = t.topic_id AND p.post_time > $topic_last_read)
WHERE t.topic_id = $topic_id
AND t.topic_moved_id = 0
AND p.post_draft = 0
ORDER BY p.post_time";
// start mod save posts as drafts (and end mod too): added an AND constraint in the foregoing sql definition that post_draft be zero (i.e. that the post not just be a draft)
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not obtain newer/older topic information', '', __LINE__, __FILE__, $sql);
}
if ( !($row = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit');
}
$post_id = empty($row['post_id']) ? $row['topic_last_post_id'] : $row['post_id'];
// ORIGINAL redirect(append_sid("./viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
redirect(append_sid("./viewtopic.$phpEx?" . POST_POST_URL . '=$post_id') .'#$post_id', true);
}
Ich muss das wohl gemacht haben, als wir damals das Sudoku-Problem hatten und sich tief in meinen Kopf eingegraben hat: Keine Sprungmarken in der append_sid! Auf jeden Fall klappt es mit dem Originalcode, also wenn man das # in der append_sid belässt, bestens:
Code: Alles auswählen
$post_id = empty($row['post_id']) ? $row['topic_last_post_id'] : $row['post_id'];
redirect(append_sid("./viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
Vielen Dank noch einmal - natürlich auch Dir, @bazillus, für die Hilfsbereitschaft!
LG, IPB_Flüchtling