vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Profile Enhancements - ZH - % Of Forum Posts (https://vborg.vbsupport.ru/showthread.php?t=133127)

Viper007Bond 12-13-2006 10:20 PM

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) * 1002);

    
$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

haris_led 12-13-2006 11:29 PM

Ziki, i noticed that if the user has more than 1000 posts, it shows 0.0%.
I changed my posts from admincp from 350->1000 and it shows 0.0.
Then changed to 999 and it is ok.
:)

Invalid ID 12-14-2006 12:27 AM

Installed but can't see it working in postbit.

da420 12-14-2006 12:54 AM

Quote:

Originally Posted by Invalid ID (Post 1138160)
Installed but can't see it working in postbit.

Doesn't show in your post bit.

Viper007Bond 12-14-2006 04:47 AM

Quote:

Originally Posted by haris_led (Post 1138125)
Ziki, i noticed that if the user has more than 1000 posts, it shows 0.0%.
I changed my posts from admincp from 350->1000 and it shows 0.0.
Then changed to 999 and it is ok.
:)

The result of thousands dividers being added in. ;)

Ziki 12-14-2006 06:59 AM

Oh.Thanks Viper now I know what I did wrong :)

Ziki 12-14-2006 06:59 AM

1.0.6 released

Now the hacks is working for sure!

haris_led 12-14-2006 09:43 AM

Oh yes, now it is working!!!!
Very nice and thanks for the hack :)

dilbert 12-15-2006 10:29 AM

Quote:

Originally Posted by Ziki (Post 1138315)
1.0.6 released

Now the hacks is working for sure!

Thank you.

Ziki 12-17-2006 05:20 PM

Buenos mochas! (Or however it is said :D)


All times are GMT. The time now is 03:55 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01059 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete