vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   User Forum Activeness Hack v1.0 (https://vborg.vbsupport.ru/showthread.php?t=43116)

g-force2k2 09-03-2002 04:59 PM

Actually Neo all you did was do an order by... the actually query itself already selected both the posts in that forum that they replied in most as well as the forumid... so i fail to see what your code change did? regards...

g-force2k2

Webmasta XT 09-03-2002 06:21 PM

awesome hack..

Neo 09-03-2002 07:56 PM

Quote:

Originally posted by g-force2k2
Actually Neo all you did was do an order by... the actually query itself already selected both the posts in that forum that they replied in most as well as the forumid... so i fail to see what your code change did? regards...

g-force2k2

well try the queries in in your MySQL of choise and you will see what I mean... I can give you a example...

using it without the ORDER BY I get for user number 81


PHP Code:

ppforum  |  forumid
------------------------
   
9              2 

adding the ORDER BY I get for user number 81

PHP Code:

ppforum  |  forumid
------------------------
   
756              7 

now what do you think would be more correct?

g-force2k2 09-03-2002 08:14 PM

yes thank you neo for visual i see what you mean now :) regards and thanks a bunch... file updated :)

g-force2k2

Boofo 09-03-2002 08:48 PM

I also changed this line:

PHP Code:

$f_posts floor(($t_post[ppforum] / $userinfo[posts]) * 100); 

To this:

PHP Code:

$f_posts round(($t_post[ppforum] / $userinfo[posts]) * 100,2); 

for a more accurate count.

I am still having problems with the code for the Admins and Mods being the only ones able to see it.

g-force2k2 09-03-2002 09:00 PM

Boofo try this then... open member.php

find:

PHP Code:

    eval("\$forumactive = \"".gettemplate('getinfo_forumactive')."\";"); 

replace with:

PHP Code:

    if($bbuserinfo[usergroupid] == OR $bbuserinfo[usergroupid] == OR $bbuserinfo[usergroupid] == 7) {
      eval(
"\$forumactive = \"".gettemplate('getinfo_forumactive')."\";");
      } else {
        
$forumactive "";
      } 

that should do the trick :) regards...

g-force2k2

Boofo 09-03-2002 09:07 PM

It worked, thanks. Just to verify, this is what the code should look like for me now, right?

PHP Code:

// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++
  // thanks to neo for the query fix :)
  
$t_post $DB_site->query_first("
    SELECT COUNT(postid) AS ppforum, thread.forumid AS forumid
    FROM post
    LEFT JOIN thread ON thread.threadid = post.threadid
    WHERE userid = '
$userinfo[userid]'
    GROUP BY(forumid)
    ORDER BY ppforum 
    DESC LIMIT 1"
);

    if(empty(
$t_post[ppforum])) {
      
$forumactive "";
    } else {
      
$f_name $DB_site->query_first("
        SELECT title
        FROM forum
        WHERE forumid = '
$t_post[forumid]'");
    
$f_posts round(($t_post[ppforum] / $userinfo[posts]) * 100,2);
    
$p_type iif($t_post[ppforum] == 1,'Post','Posts');

    if(
$bbuserinfo[usergroupid] == OR $bbuserinfo[usergroupid] == OR $bbuserinfo[usergroupid] == 7) {
      eval(
"\$forumactive = \"".gettemplate('getinfo_forumactive')."\";");
      } else {
        
$forumactive "";
      }
    }
// +++++++ User Most Active Forum Hack [ g-force2k2 ] +++++++ 

And what did you think of the change for the percentage?

g-force2k2 09-03-2002 09:09 PM

yes... and the percentage is nice too :) regards...

question is does it work correctly though how you wanted it to?

g-force2k2

Boofo 09-03-2002 09:13 PM

Yes, now the private forum shows up like it is supposed to and the percentage will be more noticeable on boards with more messages.

Boofo 09-03-2002 09:15 PM

I do have one more question, though, is there a way to exclude certain forums (like with forumid)?


All times are GMT. The time now is 01:42 AM.

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.01210 seconds
  • Memory Usage 1,760KB
  • 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
  • (7)bbcode_php_printable
  • (1)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