vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   vb3 User Forum Activeness Hack v1.4 (https://vborg.vbsupport.ru/showthread.php?t=60100)

n9com 01-25-2004 10:14 AM

i get this problem:

Total Posts: 999 (2.30 posts per day)
Find all posts by n9com
Find all threads started by n9com
Forum Activeness Statisticsn9com is most active in the forum The Lounge with a total of 262 posts contributing to 0.03% of their total posts.

But it works fine for another member in the US (i am in the UK) - dont know if this makes a difference:

PostsTotal Posts: 2,145 (13.07 posts per day)
Find all posts by ice
Find all threads started by ice
Forum Activeness Statisticsice is most active in the forum The Lounge with a total of 1159 posts contributing to 57.95% of their total posts.

Zelda-King 01-25-2004 12:29 PM

I've had this hack installed a while now and I've noticed that it doesn't appear for me when using Mozilla Firebird. I've tested it with Internet Explorer and Opera and it shows OK on those.

achtungbaby 01-26-2004 08:57 AM

Nice.

*install*

gmarik 01-26-2004 01:03 PM

Fatal error: Call to undefined function: log_admin_action() in /pub/home/install_ufactive.php on line 200

g-force2k2 01-28-2004 11:03 AM

Quote:

Originally Posted by gmarik
Fatal error: Call to undefined function: log_admin_action() in /pub/home/install_ufactive.php on line 200

Did you by chance upload to a different directory on accident?

Quote:

Originally Posted by Zelda-King
I've had this hack installed a while now and I've noticed that it doesn't appear for me when using Mozilla Firebird. I've tested it with Internet Explorer and Opera and it shows OK on those.

Very interesting, any ideas on what the cause could be?

Regards,
g-force2k2

g-force2k2 01-28-2004 11:06 AM

Updated the hack to v1.3

Basically all the update does is optimize the query for performance issues especially advised for larger boards so that the number of records that the database has to scan is decreased drastically.

Download the attached txt and make the changes to the member.php. It's just one file modification, but it'll with it's increased performance it's worth it.

Cheers,
g-force2k2

Natch 01-28-2004 12:04 PM

Two things:

One:

Quote:

Originally Posted by Zelda-King
I've had this hack installed a while now and I've noticed that it doesn't appear for me when using Mozilla Firebird. I've tested it with Internet Explorer and Opera and it shows OK on those.

[high]* Natch clicked install, then debugged the Firebird issue ...
[/high]

I have found out why this is:

Code:

<!-- vb3 User Forum Activeness Hack v1.0 -- Copyright g-force2k2 2004 //-->
Firebird takes these double-dashes (bold and underline above) as part of the comment - so you have commented out the the comment ... to a degree ...

Use:
Code:

<!-- vb3 User Forum Activeness Hack v1.0 : Copyright g-force2k2 2004 //-->
It will have no impact on any other browser, but it means the hack info will show up on Firebird ...

Two:

Quote:

Natcher00 is most active in the forum General Chat with a total of 390 posts contributing to 39000% of their total posts.
EDITED QUOTE: Old problem no longer a problem after Upgrade3.txt, but now I have the numposts * 100." %" problem ...

Natch 01-28-2004 12:24 PM

I think the previous poster was right: the value of $userinfo['posts'] is not coming thru properly ... this is formatted using vb_number_format earlier in the member.ph file, so the value of $userinfo['posts'] is in fact a string now - not a number.

We're almost there: $userinfo gains it's values on (unedited) line 184 ... we just need to reverse the effect of vb_number_format on the value of $userinfo['posts'] ...

Natch 01-28-2004 12:30 PM

Just a FYI: I created a debugging var
Code:

        $_allposts = intval($userinfo['posts']);
and used this value as the replacement for $userinfo['posts'] ... I also outputted it in brackets for debuggin purposes ...
Quote:

Natcher00 is most active in the forum General Chat with a total of 390 posts contributing to 39000% (1) of their total posts.
So $userinfo['posts'] is in fact taking the value "1" ...

Hmmmm .....



Ah - HAH!

I checked another user just for interest's sake :)

Quote:

-=UMF=- Axi is most active in the forum Off-Topic! :p with a total of 157 posts contributing to 32.11% (489) of their total posts.
So it only applies (IMO) when testing your own account ... (maybe Admin accounts?) ...

Quote:

Tigga is most active in the forum General Chat with a total of 12 posts contributing to 48% (25) of their total posts.
^^ My test account - therefore it's related to Admin users maybe ...

EDIT: Yup - Admin user-related ...

Quote:

WalkerB is most active in the forum General Chat with a total of 255 posts contributing to 25500% (1) of their total posts.
One of my other site Admins ...

Found the bug ... dunno how to fix it ... :ninja:

Baugh 02-04-2004 03:40 AM

I received this error when trying to install:

Database error in vBulletin 3.0.0 Release Candidate 3:

Invalid SQL: SELECT phrasetypeid FROM phrasetype WHERE fieldname='global'
mysql error: Table '......_forums.phrasetype' doesn't exist

mysql error number: 1146

Date: Wednesday 04th of February 2004 12:37:25 AM
Script: http://.......com/acpanel/install_ufactive.php?step=5
Referer: http://.......com/acpanel/install_ufactive.php?step=4
Username: Dave
IP Address: ..............


This is a clean install of vB, minus a couple of very minor template changes. Any clue what could be going wrong? I got this after it attempted to update the language phrases.

buro9 02-04-2004 05:24 AM

Quote:

Originally Posted by Baugh
I received this error when trying to install:

Database error in vBulletin 3.0.0 Release Candidate 3:

Invalid SQL: SELECT phrasetypeid FROM phrasetype WHERE fieldname='global'
mysql error: Table '......_forums.phrasetype' doesn't exist

mysql error number: 1146

Date: Wednesday 04th of February 2004 12:37:25 AM
Script: http://.......com/acpanel/install_ufactive.php?step=5
Referer: http://.......com/acpanel/install_ufactive.php?step=4
Username: Dave
IP Address: ..............


This is a clean install of vB, minus a couple of very minor template changes. Any clue what could be going wrong? I got this after it attempted to update the language phrases.

Check the SQL in the install file... I've pointed this out before I think... it's just lacking the TABLE_PREFIX.

Once you fix the install file you can carry on from the place you were.

In fact, I outlined the correct code here:

https://vborg.vbsupport.ru/showpost....2&postcount=32

It's the first part that corrects the install.

g-force2k2 02-04-2004 05:43 AM

Update to version 1.4 Below.

Upgrade 1.4 Details.
--
Fixes Install and File Modification for forums that use the 'TABLE_PREFIX'
Fixes one of the issues with browser compatablity
Fixes another error with making $userinfo[posts] an number value again.
Great thanks to "Natch" and "buro9" for helping me debug some of the issues, still working on the last issue though.

Regards,
g-force2k2

Baugh 02-04-2004 12:28 PM

I must be an idiot. Thanks man. I've been modding on YaBB for a couple of years, but this was my first attempt to install a vB hack. Wouldn't you know I'd do something stupid. ;)

Zelda-King 02-04-2004 03:35 PM

Applying Upgrade 4 gave me the following PHP error;

Quote:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/gamercr/public_html/bb/member.php on line 382
and the following SQL error;
Quote:

Invalid SQL:
SELECT COUNT(*) AS aposts,f.title AS aftitle,
t.forumid AS aforumid
FROM thread t
LEFT JOIN post p ON post.threadid = thread.threadid
LEFT JOIN forum f ON forum.forumid = thread.forumid
LEFT JOIN deletionlog AS deletionlog ON ( deletionlog.primaryid = t.threadid AND type = 'thread' )
WHERE f.forumid NOT IN ( 0 )
AND t.visible=1
AND deletionlog.primaryid IS NULL
AND p.userid = 1
GROUP BY f.forumid ORDER BY aposts DESC LIMIT 1
mysql error: Unknown table 'post' in on clause

mysql error number: 1109
on the profile page.

I'll give it the benefit of the doubt for now though as I'll be reapplying the whole hack from scratch soon when RC4 is released (friday apparantly).

g-force2k2 02-05-2004 08:39 AM

Quote:

Originally Posted by Zelda-King
Applying Upgrade 4 gave me the following PHP error;

and the following SQL error;
on the profile page.

I'll give it the benefit of the doubt for now though as I'll be reapplying the whole hack from scratch soon when RC4 is released (friday apparantly).

heh

I should learn to test my work before releasing updates, bad practice that I don't.

updated the attachment above going to test it now, and run the actual installer updates and if RC4 has some major changes I will probably update again :p

Cheers,
g-force2k2

Allan 02-05-2004 09:08 AM

idem

PHP Code:

Database error in vBulletin 3.0.0 Release Candidate 3:

Invalid SQL
            
SELECT COUNT(*) AS aposts,f.title AS aftitle,
                
t.forumid AS aforumid
            FROM thread t
            LEFT JOIN post p ON post
.threadid thread.threadid
            LEFT JOIN forum f ON forum
.forumid thread.forumid
            LEFT JOIN deletionlog 
AS deletionlog ON deletionlog.primaryid t.threadid AND type 'thread' )
            
WHERE f.forumid NOT IN )
                AND 
t.visible=1
                
AND deletionlog.primaryid IS NULL
                
AND p.userid 1
            GROUP BY f
.forumid ORDER BY aposts DESC LIMIT 1
mysql error
Table inconnue 'post' dans on clause

mysql error number
1109 

I have well do all the setting has days from 1 to 4 :(

g-force2k2 02-05-2004 09:13 AM

Socrate try re-downloading the upgrade4.txt, because it was updated and those changes are included in your sql.

Cheers,
g-force2k2

Allan 02-05-2004 09:46 AM

Quote:

Originally Posted by g-force2k2
Socrate try re-downloading the upgrade4.txt, because it was updated and those changes are included in your sql.

Cheers,
g-force2k2

veiled, that functions, thank you has you ;)

Zelda-King 02-05-2004 03:36 PM

Yes that fix is much better, thankyou. :)

Zelda-King 02-07-2004 12:45 AM

OK, new problem on RC4: Nothing shows in the table. You just see a border with no text in it. I'm going to try it all again tomorrow but I've just spent hours readding my hacks to my just-upgraded board.

EDIT: It turns out the hack is fine. I just needed to drop and redo steps 1 & 2.

Sadie Frost 02-07-2004 07:26 PM

Is this interacting with total posts on the profile for anyone else? If I comment out this hack's code in member.php, it works fine, otherwise I get like post counts of 5 for members with thousands.

g-force2k2 02-07-2004 08:19 PM

Quote:

Originally Posted by Sadie Frost
Is this interacting with total posts on the profile for anyone else? If I comment out this hack's code in member.php, it works fine, otherwise I get like post counts of 5 for members with thousands.

Not quite sure of what the problem could be but try replacing:

PHP Code:

        $userinfo['posts'] = intval $userinfo['posts'] ) ;
        
$_activeperc round ( ( ( $_activeposts $userinfo['posts'] ) * 100 ), ) . "%" 

with:

PHP Code:

        $userinfo['rposts'] = intval $userinfo['posts'] ) ;
        
$_activeperc round ( ( ( $_activeposts $userinfo['rposts'] ) * 100 ), ) . "%" 

Regards,
g-force2k2

Sadie Frost 02-08-2004 12:37 AM

Great - thanks! That fixed the problem with post count. Still having a problem with the % though. (I get like 32600% even after the upgrades.)

Just another comment - would there be a way to exclude forums? :)

g-force2k2 02-08-2004 09:17 PM

Quote:

Originally Posted by Sadie Frost
Great - thanks! That fixed the problem with post count. Still having a problem with the % though. (I get like 32600% even after the upgrades.)

Just another comment - would there be a way to exclude forums? :)

As for forum exclusions they are already built in based upon forum permissions, but not user access masks, if you wanted to add certain forums you can add to the array list, if you're not sure how I would be happy to help.

As for the high percentage that's the only bug that I am unsure of, but I will try and seek a fix, for some odd reason I never have gotten that percentage issue, but a few others addressed it and Natch tried to explain it on page four I believe.

Cheers,
g-force2k2

Natch 02-08-2004 09:55 PM

Yeah - it's only happening to my Administrators ...

Natch 02-11-2004 02:35 PM

Quote:

Originally Posted by Natch
Yeah - it's only happening to my Administrators ...

G-force2k2: PM me for a sample account access if you wanna check in my forum for an example of this bug ...

The following links show three profiles ...

This one calculates ( (most active forum posts / 2 ) *100 ) and is an ex-moderator profile.

This is my profile, and is calculating ( (most active forum posts/1) * 100 ).

A regular user profile, calculating properly ( (most active forum posts/total user posts) * 100 ).

Sadie Frost 02-14-2004 04:19 AM

Quote:

Originally Posted by g-force2k2
As for forum exclusions they are already built in based upon forum permissions, but not user access masks, if you wanted to add certain forums you can add to the array list, if you're not sure how I would be happy to help.

Thanks! I've been trying to do this but I don't really know anything lol. The problem is that we have an archive forum, so a lot of users come up with that as their most active forum lol.

Would it be something like:

Code:

WHERE t.forumid NOT IN ( " . implode ( ",", get_noaccess_forumids (  ) ) . " OR 'forumid==16' )
?

FYI - some (but not all) regular users are coming up with the weird percentages as well as admins.

g-force2k2 02-14-2004 06:51 AM

Quote:

Originally Posted by Sadie Frost
Code:

WHERE t.forumid NOT IN ( " . implode ( ",", get_noaccess_forumids (  ) ) . " OR 'forumid==16' )
?

FYI - some (but not all) regular users are coming up with the weird percentages as well as admins.

Sadie Frost

PHP Code:

WHERE t.forumid NOT IN " . implode ( ",", get_noaccess_forumids (  ) ) . " )
      AND 
t.forumid != 16 

Thanks for the links Natch I will take a look.

Cheers,
g-force2k2

Sadie Frost 02-14-2004 07:57 AM

Ah that makes more sense lol - thanks hon! :)

ChuanSE 02-28-2004 08:13 AM

Great Hack m8 :D

Zelda-King 02-28-2004 08:52 AM

Quote:

Originally Posted by Sadie Frost
Is this interacting with total posts on the profile for anyone else? If I comment out this hack's code in member.php, it works fine, otherwise I get like post counts of 5 for members with thousands.

I can confirm this. I have one guy with nearly 2000 posts and in his profile it says he has only 1.

I can also confirm the fix fixes the post count leaving just the percentage iffy.

ChuanSE 03-01-2004 05:45 AM

are those thousand posts also posted in hidden or restricted area's?

This hack works fine on my board tho...

RapCheck 03-27-2004 04:45 PM

alright I just installed this and everything went fine

though I'm having similar problems to other people

for most users, it seems those with 1000s+ posts their post count is cut off it seems to the first number for those with 1000s and the second number for those with 10000s (user with 13,000 is shown with post count of 13, user with 6,000 is shown with 6 posts) which in turn shows an insane % such as 60000% and so on. also seems users with 100s of posts everything shows up fine.

I've gone through this thread and not sure on what fixes if any work to solve these problems. Would be a great hack if this was cleared up...

RapCheck 04-04-2004 10:32 PM

up...

are the problems with this hack not going to be fixed?

Kevorkian 04-05-2004 07:22 AM

Quote:

Originally Posted by RapCheck
up...

are the problems with this hack not going to be fixed?

with a total of 1929 posts contributing to 64300% of their total posts. lol ^^ i think there are some bugs
i have this problem not only on administrator but also smod and normal user

buro9 04-05-2004 10:08 AM

Quote:

Originally Posted by Kevorkian
with a total of 1929 posts contributing to 64300% of their total posts. lol ^^ i think there are some bugs
i have this problem not only on administrator but also smod and normal user

Yes, I wish all the fixes would be rolled up into the installer too... come on hacker! Do your stuff.

Anyhow, your numbers are being formatted with commas... strip them out and it'll be fine :)

It only happens with users who have more than 1,000 posts yeah? ;)

Kevorkian 04-06-2004 06:51 PM

yeah the problem is this but i can't find the error ;___;

buro9 04-06-2004 07:21 PM

Ah well, break vbulletin.org procedures to publish someone's code when he should be supporting, sigh.

Here is the solution :)

You've got some code in member.php that is part of this hack... just below:
PHP Code:

{
  
$show['lastpost'] = true;
  
$userinfo['lastposttitle'] = '';
  
$userinfo['lastposturl'] = '#';
  
$userinfo['lastpostdate'] = $vbphrase['never'];
  
$userinfo['lastposttime'] = '';


And just above:
PHP Code:

// reputation
fetch_reputation_image($userinfo); 

Well, that code should ideally look like this:
PHP Code:

// HACK : START : USER ACTIVENESS
  
$show[useractiveness] = ;
  if (
$userinfo[posts]) {
    
$forumids implode("', '"get_noaccess_forumids());
    
$tfarray $DB_site->query_first(
     
"SELECT COUNT(*) AS aposts," TABLE_PREFIX "forum.title AS aftitle, " TABLE_PREFIX "thread.forumid AS aforumid
      FROM " 
TABLE_PREFIX "thread
      LEFT JOIN " 
TABLE_PREFIX "post ON " TABLE_PREFIX "post.threadid = " TABLE_PREFIX "thread.threadid
      LEFT JOIN " 
TABLE_PREFIX "forum ON " TABLE_PREFIX "forum.forumid = " TABLE_PREFIX "thread.forumid
      LEFT JOIN " 
TABLE_PREFIX "deletionlog ON ( " TABLE_PREFIX "deletionlog.primaryid = " TABLE_PREFIX "thread.threadid AND type = 'thread' )
      WHERE " 
TABLE_PREFIX "forum.forumid NOT IN ( '$forumids' )
        AND " 
TABLE_PREFIX "thread.visible=1
        AND " 
TABLE_PREFIX "deletionlog.primaryid IS NULL
        AND " 
TABLE_PREFIX "post.userid = $userinfo[userid]
      GROUP BY " 
TABLE_PREFIX "forum.forumid ORDER BY 1 DESC LIMIT 1");
    
$_activeposts $tfarray['aposts'];
    
$_activeurl "<a href=\"forumdisplay.php?$session[sessionurl]f=".$tfarray['aforumid']."\">".$tfarray['aftitle']."</a>";
    
$_activeperc round(((implode('',explode(',',$_activeposts)) / implode('',explode(',',$userinfo['posts'])) ) * 100), 2)."%" ;
    
$show[useractiveness] = ;
  }
// HACK : END : USER ACTIVENESS 

As that does the math properly and also explodes and implodes the number in the math to get round any formatting ;)

It's a great hack, and all of the solutions are in this thread... the author just hasn't kept track of it and rolled the bug fixes back into the installer to help everyone who has recently installed it.

Anyhow, that should solve it.

RapCheck 04-06-2004 07:44 PM

great! that fixed it. thanks

Natch 04-11-2004 08:59 AM

Thank you thank you thank you!


All times are GMT. The time now is 02:48 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.01435 seconds
  • Memory Usage 1,896KB
  • 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
  • (5)bbcode_code_printable
  • (7)bbcode_php_printable
  • (21)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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