It's been possible in the past.
http://www.microsoft.com/technet/securi … 4-028.mspx

Welcome to life, enjoy your stay.

Put the info in your forums' index (where the stats are):

#
#-------------[ 1. Open File ]----------------
#
~/index.php
#
#-------------[ 2. Find (line: ~156)]----
#
$stats['last_user'] = $db->fetch_assoc($result);
#
#-------------[ 3. Add After ]----------------
#

$result = $db->query('SELECT SUM(dl_total_bandwidth) FROM '.$db->prefix.'users') or error('Unable to fetch download bandwidth', __FILE__, __LINE__, $db->error());
$stats['total_downloaded'] = $db->result($result);

#
#-------------[ 4. Find (line: ~171)]----
#
</dl>
#
#-------------[ 5. Add Before ]---------------
#
<dd><?php echo 'Total Download Bandwidth: <strong>'.fsize($stats['total_downloaded']); ?></strong></dd>

Put the bandwidth usage for the user under his avatar in topics.

#
#-------------[ 1. Open File ]----------------
#
~/viewtopic.php
#
#-------------[ 2. Find (line: ~186)]----
#
$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
#
#-------------[ 3. Replace With ]--------------
#
$result = $db->query('SELECT u.dl_total_bandwidth, u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

#
#-------------[ 4. Find (line: ~321)]----
#
<dd class="postavatar"><?php echo $user_avatar ?></dd>
#
#-------------[ 5. Add After ]----------------
#
<dd class="usertitle"><strong>DLed: <?php echo pun_htmlspecialchars(fsize($cur_post['dl_total_bandwidth'])); ?></strong></dd>

Put the info in the userlist (with the ability to sort by bandwidth)

#
#-------------[ 1. Open File ]----------------
#
~/userlist.php
#
#-------------[ 2. Find (line: ~46)]----
#
$sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count)) ? 'username' : $_GET['sort_by'];
#
#-------------[ 3. Replace With ]--------------
#
$sort_by = (!isset($_GET['sort_by']) || $_GET['sort_by'] != 'username' && $_GET['sort_by'] != 'registered' && $_GET['sort_by'] != 'dl_total_bandwidth' && ($_GET['sort_by'] != 'num_posts' || !$show_post_count)) ? 'username' : $_GET['sort_by'];
#
#-------------[ 4. Find (line: ~88)]----
#
<option value="registered"<?php if ($sort_by == 'registered') echo ' selected="selected"' ?>><?php echo $lang_common['Registered'] ?></option>
#
#-------------[ 5. Add Before ]--------------
#
<option value="dl_total_bandwidth"<?php if ($sort_by == 'dl_total_bandwidth') echo ' selected="selected"' ?>>Downloaded</option>
#
#-------------[ 6. Find (line: ~151)]----
#
</tr>
#
#-------------[ 7. Add Before ]---------------
#
<th class="tcr" scope="col">Downloaded</th>
#
#-------------[ 8. Find (line: ~157)]----
#
$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());
#
#-------------[ 9. Replace With ]--------------
#
$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title, u.dl_total_bandwidth FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());

* NOTE: , u.dl_total_bandwidth is added after g.g_user_title
#
#-------------[ 10. Find (line: ~171)]----
#
</tr>
#
#-------------[ 11. Add Before ]---------------
#
<td class="tcl"><?php echo fsize($user_data['dl_total_bandwidth']); ?></td>

I don't feel like writing another 'readme' file.

http://pastebin.com/m65675a24

There's the final output.

Go for it.

View download bandwidth in userlist.

[1. FIND AT LINE ~150]
<?php endif; ?>                <th class="tcr" scope="col"><?php echo $lang_common['Registered'] ?></th>

[2. ADD AFTER]
                <th class="tcr" scope="col">Downloaded</th>

[3. FIND AT LINE ~157]
$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());

[4. REPLACE WITH]
$result = $db->query('SELECT u.id, u.username, u.title, u.num_posts, u.registered, g.g_id, g.g_user_title, u.dl_total_bandwidth FROM '.$db->prefix.'users AS u LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id WHERE u.id>1'.(!empty($where_sql) ? ' AND '.implode(' AND ', $where_sql) : '').' ORDER BY '.$sort_by.' '.$sort_dir.' LIMIT '.$start_from.', 50') or error('Unable to fetch user list', __FILE__, __LINE__, $db->error());

* NOTE: , u.dl_total_bandwidth is added after g.g_user_title

[5. FIND AT LINE ~170]
                    <td class="tcr"><?php echo format_time($user_data['registered'], true) ?></td>

[6. ADD AFTER]
                    <td class="tcl"><?php echo fsize($user_data['dl_total_bandwidth']); ?></td>

I might add a 'sort by total downloaded' option later.

Rename to *.7z. Xarchiver gave me the same error. Good thing I was already working with a Hex editor.

Heh. I just added a directory indexer to my site, but this looks better.

I'll be trying it out later.

Neat, but I mostly use PNG files. sad

I was going to write something similar to this later this month. Now, I need to do a little less work. Thanks!

That's call a CAPTCHA box. Check PunRes.

http://www.punres.org/browse.php?keywor … projects=1

12

(1 replies, posted in General discussion)

http://punbb.org/downloads.php

Look under the languages.