Well here's the code I'm using (I was testing and ended up coding my own for testing purposes):
PHP Code:
cache_ordered_forums(1);
$viper_totalposts = 0;
if (is_array($vbulletin->forumcache))
{
foreach ($vbulletin->forumcache AS $forum)
{
$viper_totalposts += $forum['replycount'];
}
}
if ($viper_totalposts != 0)
{
$viper_postcount = str_replace(array(',', '.', ' '), '', $userinfo['posts']);
$viper_percent = vb_number_format(($viper_postcount / $viper_totalposts) * 100, 2);
$viper_postsperday = construct_phrase($vbphrase[x_posts_per_day], $postsperday);
$viper_searchfor = '(" . construct_phrase("$vbphrase[x_posts_per_day]", "$postsperday") . ")';
$viper_replacewith = '(" . construct_phrase("$vbphrase[x_posts_per_day]", "$postsperday") . ", $viper_percent% of total forum posts)';
$vbulletin->templatecache['MEMBERINFO'] = str_replace($viper_searchfor, $viper_replacewith, $vbulletin->templatecache['MEMBERINFO']);
}
It seems to work correctly.
Some examples (of ~370000 total posts):
http://forums.finalgear.com/member.php?u=3
http://forums.finalgear.com/member.php?u=7101
http://forums.finalgear.com/member.php?u=1125