I obviously can't test with your data, but this should work, assuming you have a
user_id
column in the database table. Open
viewtopic.php
and locate the following code:
Code: Select all
// Posts are stored in the $rowset array while $attach_list, $user_cache
// and the global bbcode_bitfield are built
while ($row = $db->sql_fetchrow($result))
{
// Set max_post_time
if ($row['post_time'] > $max_post_time)
{
$max_post_time = $row['post_time'];
}
$poster_id = (int) $row['poster_id'];
Change it to:
Code: Select all
$uploader = array();
// Posts are stored in the $rowset array while $attach_list, $user_cache
// and the global bbcode_bitfield are built
while ($row = $db->sql_fetchrow($result))
{
// Set max_post_time
if ($row['post_time'] > $max_post_time)
{
$max_post_time = $row['post_time'];
}
$poster_id = (int) $row['poster_id'];
$uploader[] = $poster_id;
Now locate the following code:
Code: Select all
// Output the posts
$first_unread = $post_unread = false;
Change it to:
Code: Select all
$sql = 'SELECT DISTINCT user_id, COUNT(uploader) AS totaluploads FROM phpbb_filebase WHERE ' . $db->sql_in_set('user_id', $uploader) . ' GROUP BY user_id';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result)) {
$uploader_id = (int) $row['user_id'];
$uploader[$uploader_id] = (int) $row['totaluploads'];
}
$db->sql_freeresult($result);
// Output the posts
$first_unread = $post_unread = false;
And finally, locate this code:
Change it to:
Code: Select all
$postrow = array(
'TOTAL_UPLOADS' => $uploader[$poster_id],
The
viewtopic_body.html
template should now have the upload count for each poster in
{postrow.TOTAL_UPLOADS}
.
I'd suggest saving a backup copy of
viewtopic.php
before making these changes...just in case.
