in viewtopic.tpl threadautor anzeigen?

Alles zu Styles, Templates, Icons und Smilies für phpBB 2.0, sowie allgemeine Designfragen zur Integration von phpBB in bestehende Websites.
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.
Antworten
didione
Mitglied
Beiträge: 8
Registriert: 02.08.2006 00:43

in viewtopic.tpl threadautor anzeigen?

Beitrag 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

&nbsp;<b>TITEL: <a class="gen2" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a>&nbsp;&nbsp;AUTOR: {TOPIC_AUTHOR}</b>&nbsp;&nbsp;&nbsp;&nbsp;<b>{PAGINATION}</b> 
der titel wird anzeigt, aber der autor bleibt leer.
wie kann man den anzeigen?

mfg niko
Benutzeravatar
Jan500
Ehemaliges Teammitglied
Beiträge: 4199
Registriert: 01.03.2003 21:32
Wohnort: Hamburg
Kontaktdaten:

Beitrag 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
"Life begins at 40 Knots...!" :D
kein (kostenlosen) Support per pn, mail, icq usw. | Kostenlosen Support gibt es hier im Forum!
didione
Mitglied
Beiträge: 8
Registriert: 02.08.2006 00:43

Beitrag von didione »

cool danke, hat super geklappt :)
Antworten

Zurück zu „phpBB 2.0: Styles, Templates und Grafiken“