Seite 124 von 175
Verfasst: 08.10.2006 22:24
von Beagleman
Die ausgelesenen Daten aus dieser Datenbankabfrage
Code: Alles auswählen
$sql = "SELECT t.topic_title, t.topic_id
FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2
WHERE
t2.topic_id = $topic_id
AND t.forum_id = t2.forum_id
AND t.topic_last_post_id > t2.topic_last_post_id
ORDER BY t.topic_last_post_id ASC
LIMIT 1";
werden hier
der Variable $row übergeben.
Du hast aber $rows eingetragen.
Nicht jeder MOD benutzt die gleichen Variablen

Verfasst: 08.10.2006 22:47
von mgutt
Verfasst: 08.10.2006 22:57
von BananaJoe
Die Links funktionieren jetzt. Aber leider immer noch nicht korrekt.
Unter Vorheriges Thema ist jetzt als Link zu finden:
http://www.mediauser.de/poker-t194.html
Unter Nächstes Thema:
http://www.mediauser.de/poker-t62.html
Verfasst: 09.10.2006 01:41
von Sanchez17
Hola,
kann mir noch keiner bei diesem Problem zumindesnt einen Tipp geben?
http://www.phpbb.de/viewtopic.php?p=773488#773488
Verfasst: 09.10.2006 13:51
von mgutt
mgutt hat geschrieben:EDIT: Nimm doch einfach "$nextTopicText". Die Variable sollte doch mit dem Titel gefüllt sein.
wie gesagt nimm die Variable und für den anderen Beitrag die andere. die $row wird ja direkt danach wieder überschrieben. daher der fehler. die nexttopictext bleibt dagegen richtig.
gruß
Verfasst: 09.10.2006 14:40
von BananaJoe
Verfasst: 09.10.2006 14:48
von mgutt
anstatt $rows['topic_title'] nimmst du $nextTopicText beziehungsweise $prevTopicText.
Verfasst: 09.10.2006 15:16
von BananaJoe
Du meinst so:
Code: Alles auswählen
$nextTopicLink = append_sid("viewtopic.php?t=" . $row['topic_id'], "", $nextTopicText);
und mit prev das gleiche?
Das löst das Problem leider nicht.
Verfasst: 09.10.2006 15:31
von mgutt
Genau so. Sollte eigentlich klappen. Dann poste bitte nochmal den Codepart, den Du schon zuvor gepostet hattest mit der aktuellen Änderung.
Gruß
Verfasst: 09.10.2006 16:57
von BananaJoe
Hier die Codezeile:
Code: Alles auswählen
$sql = "SELECT t.topic_title, t.topic_id
FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2
WHERE
t2.topic_id = $topic_id
AND t.forum_id = t2.forum_id
AND t.topic_last_post_id > t2.topic_last_post_id
ORDER BY t.topic_last_post_id ASC
LIMIT 1";
if ( !($result = $db->sql_query($sql)) || $db->sql_numrows($result) != 1 )
{
$nextTopicText = $lang['No_newer_topics'];
$nextTopicLink = '#';
}
else
{
$row = $db->sql_fetchrow($result);
$nextTopicText = $row['topic_title'];
$nextTopicLink = append_sid("viewtopic.php?t=" . $row['topic_id'], "", $nextTopicText);
}
$db->sql_freeresult($result);
$sql = "SELECT t.topic_title, t.topic_id
FROM " . TOPICS_TABLE . " t, " . TOPICS_TABLE . " t2
WHERE
t2.topic_id = $topic_id
AND t.forum_id = t2.forum_id
AND t.topic_last_post_id < t2.topic_last_post_id
ORDER BY t.topic_last_post_id DESC
LIMIT 1";
if ( !($result = $db->sql_query($sql)) || $db->sql_numrows($result) != 1 )
{
$prevTopicText = $lang['No_older_topics'];
$prevTopicLink = '#';
}
else
{
$row = $db->sql_fetchrow($result);
$prevTopicText = $row['topic_title'];
$prevTopicLink = append_sid("viewtopic.php?t=" . $row['topic_id'], "", $prevTopicText);
}
$db->sql_freeresult($result);
Dann soll man laut MOD noch folgende Änderungen durchführen aber die sind für das Problem nicht relevant soweit ich das erkennen kann:
Code: Alles auswählen
#
#-----[ FINDE ]---------------------------------------------------
#
'L_VIEW_NEXT_TOPIC' => $lang['View_next_topic'],
'L_VIEW_PREVIOUS_TOPIC' => $lang['View_previous_topic'],
#
#-----[ DANACH EINFÜGEN ]---------------------------------------------------
#
'L_VIEW_NEXT_NAME' => $nextTopicText,
'L_VIEW_PREVIOUS_NAME' => $prevTopicText,
#
#-----[ FINDE ]---------------------------------------------------
#
'U_VIEW_OLDER_TOPIC' => $view_prev_topic_url,
'U_VIEW_NEWER_TOPIC' => $view_next_topic_url,
#
#-----[ ERSETZEN DURCH ]------------------------------------------
#
'U_VIEW_OLDER_TOPIC' => $prevTopicLink,
'U_VIEW_NEWER_TOPIC' => $nextTopicLink,