Seite 1 von 1
in viewtopic.tpl threadautor anzeigen?
Verfasst: 03.08.2006 14:33
von didione
Hi,
ich möchte, dass über dem Thread nicht nur der Titel, sondern auch der Autor steht.
Bisher habe ich es so versucht, ging aber nicht:
Code: Alles auswählen
<b>TITEL: <a class="gen2" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a> AUTOR: {TOPIC_AUTHOR}</b> <b>{PAGINATION}</b>
der titel wird anzeigt, aber der autor bleibt leer.
wie kann man den anzeigen?
mfg niko
Verfasst: 03.08.2006 15:40
von Jan500
hi
mach das mal:
#
# [open]
#
viewtopic.php
#
# [find]
#
//
// End auth check
//
#
# [add, after]
#
// START TOPIC_AUTHOR add - Jan500
$sql = "SELECT t.topic_id, t.topic_poster, u.username, u.user_id, p.post_username
FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p
WHERE t.topic_id = $topic_id
AND t.topic_poster = u.user_id
AND p.post_id = t.topic_first_post_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain topicauthor information', '', __LINE__, __FILE__, $sql);
}
$author = $db->sql_fetchrow($result);
$topic_author = ( $author['user_id'] != ANONYMOUS ) ? '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $author['user_id']) . '">' : '';
$topic_author .= ( $author['user_id'] != ANONYMOUS ) ? $author['username'] : ( ( !empty($author['post_username']) ) ? $author['post_username'] : $lang['Guest']);
$topic_author .= ( $author['user_id'] != ANONYMOUS ) ? '</a>' : '';
$db->sql_freeresult($result);
// END TOPIC_AUTHOR add - Jan500
#
# [find]
#
'TOPIC_TITLE' => $topic_title,
#
# [add, after]
#
// START TOPIC_AUTHOR add - Jan500
'TOPIC_AUTHOR' => $topic_author,
// END TOPIC_AUTHOR add - Jan500
deine tpl kannst du so lassen wie du oben beschrieben hast, da ich die selbe Variable genutzt habe
Jan
Verfasst: 03.08.2006 16:18
von didione
cool danke, hat super geklappt
