Öhm, ist auch nicht unbedingt einfach, denn die Anzahl der Beiträge ist nur ein Link auf die Suche und die Zahl kommt bereits aus den Profildaten.
Bei der Anzahl Topics muss die nicht immer kleine Topic-Tabelle abgefragt werden, was immer einen Moment dauern kann...
Die Abfrage dazu lautet jedenfalls:
Code: Alles auswählen
SELECT count( topic_id )
FROM phpbb_topics
WHERE topic_poster = X
Eingepackt in die usercp_viewprofile.php:
Code: Alles auswählen
$sql = "SELECT count(topic_id) as total_topics FROM phpbb_topics
WHERE topic_poster = " . $profiledata['user_id'];
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not count topics for this user', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$user_topics = $row['total_topics'];
$db->sql_freeresult($result);
und eben noch die Übergabe von Text und $user_topics an das Template profile_view_body.tpl...