View Full Version : vb3 User Forum Activeness Hack v1.4
g-force2k2
01-11-2004, 10:00 PM
Alright I decided to port this hack over from vb2 since it was one of my favorite hacks, but this time I did a bit more tweaking to improve its preformance and accuracy. Hack comes with auto-installer / un-installer / uses bitwise permissions / fully vbphrased.
What does this hack do?
In the user profile it displays the forum that that user is most active in, the number of posts they have made and the percentage of total posts.
It does require one extra query in the member.php when viewing profiles
Also uses bitwise permissions to check to see if users have access to that forum, which I used a cache for to prevent this hack from using two queries as it did in the past.
What to do?
Queries to run: 2
File Modifications: 2
Template Modifications: 1
Just simply upload the install_ufactive.php to the admincp directory and run the installer for the rest of the steps and information.
Comments, suggestions, etc. are always welcomed. Enjoy my 3rd vb3 hack as I've had just as much fun making it, and trying to make my hacks the best possiblem, from feature wise to performance.
See attachments for screenshots below, first one shows a user that doesn't have the right permissions to view the user's most active forum so it takes from the next most active forum, but the second screenshot shows with regular permissions as the user has permission to the forum.
Please respect my work and I would appreciate if you clicked install.
Note all upgrades are included in the new install_ufactive.php only needed if you installed before February 5th 2004 else the auto-installer has been updated.
Upgrade To 1.1 - Changes
--
MEMBERINFO template ( 1 )
member.php file ( 1 )
You can view information and the attachment on this [ HERE (https://vborg.vbsupport.ru/attachment.php?attachmentid=15864) ] AND the information [ HERE (https://vborg.vbsupport.ru/showpost.php?p=462453&postcount=26) ]
Upgrade To 1.2 - Changes
--
member.php file ( 1 )
You can view information adn the attachment on this [ HERE (https://vborg.vbsupport.ru/attachment.php?attachmentid=15872) ] AND the information [ HERE (https://vborg.vbsupport.ru/showpost.php?p=462740&postcount=2) ]
Upgrade To 1.3 - Changes
--
member.php file ( 1 )
You can view the information and the attachment by viewing this [ POST (https://vborg.vbsupport.ru/showpost.php?p=469885&postcount=46) ].
Upgrade To 1.4 - Changes
--
install_ufactive.php ( 1 )
member.php ( 1 )
MEMBERINFO template ( 1 )
You can view the attachment [ HERE (https://vborg.vbsupport.ru/attachment.php?attachmentid=16494) ] and the post information [ HERE (https://vborg.vbsupport.ru/showpost.php?p=472762&postcount=52) ].
It is advised that you updated changes if you use the Firebird Browser or if you use TABLE_PREFIX on your forum. I will update the install file to include these changes shortly. Big thumbs up to Natch and buro9 for helping me sort out the issues :)
Cheers,
g-force2k2
Allan
01-12-2004, 09:02 AM
thank you, nice hack :)
???`S?LV?R???`
01-12-2004, 09:24 AM
nice job
squawell
01-12-2004, 09:37 AM
well done:D:D
* squawell clicked install
Blago
01-12-2004, 03:54 PM
Nice hack! Will try later.
dede1
01-12-2004, 04:28 PM
The computation is however somehow wrongly schau here:
Beitr?ge insgesamt: 1.793 (10,23 Beitr?ge pro Tag) Letzter Beitrag:Wi?t Ihr wer gestern online war? (http://63.246.136.220/Board/showthread.php?p=73892#post73892)
11.01.2004 22:55
Finde alle Beitr?ge von stargate2068 (http://63.246.136.220/Board/search.php?do=finduser&u=111)
Finde alle gestarteten Themen von stargate2068 (http://63.246.136.220/Board/search.php?do=process&showposts=0&starteronly=1&exactname=1&searchuser=stargate2068)
Forum Activeness Statistics
stargate2068 hat in dem Forum Radio - Moderation (http://63.246.136.220/Board/forumdisplay.php?f=152) 63 Beitr?ge geschrieben, da? sind 3513.66% aller seiner Beitr?ge.
Mijae
01-12-2004, 04:29 PM
Nice hack! Will try later.
I'll install this later, definetly!
g-force2k2
01-12-2004, 05:26 PM
The computation is however somehow wrongly schau here:
Beitr?ge insgesamt: 1.793 (10,23 Beitr?ge pro Tag) Letzter Beitrag:Wi?t Ihr wer gestern online war? (http://63.246.136.220/Board/showthread.php?p=73892#post73892)
11.01.2004 22:55
Finde alle Beitr?ge von stargate2068 (http://63.246.136.220/Board/search.php?do=finduser&u=111)
Finde alle gestarteten Themen von stargate2068 (http://63.246.136.220/Board/search.php?do=process&showposts=0&starteronly=1&exactname=1&searchuser=stargate2068)
Forum Activeness Statistics
stargate2068 hat in dem Forum Radio - Moderation (http://63.246.136.220/Board/forumdisplay.php?f=152) 63 Beitr?ge geschrieben, da? sind 3513.66% aller seiner Beitr?ge.
I don't follow exactly what you're saying, but I think I see the problem. Perhaps someone on the forum has an exagerrated post count? Don't know exactly what to think as of right now, because I can't view the profiles at your forum. Besides I am not even sure what language you're speaking, sorry.
Regards,
g-force2k2
dede1
01-12-2004, 05:36 PM
I speak German
I have a test user:
User: Pr?ferr
Pass :28x09x88
http://63.246.136.220/Board/index.php?
g-force2k2
01-12-2004, 05:46 PM
I speak German
I have a test user:
User: Pr?ferr
Pass :28x09x88
http://63.246.136.220/Board/index.php?
Does the German number system go by base 10 because the number is right just the decimal place is off by five places which is strange.
I would probably tweak it with a file mod since its the decimal places off.
open member.php
find:
$_activeperc = round ( ( ( $_activeposts / $userinfo['posts'] ) * 100 ), 2 ) . "%" ;
replace with:
$_activeperc = round ( ( ( $_activeposts / $userinfo['posts'] ) * 0.01 ), 2 ) . "%" ;
See if that helps the situation.
Regards,
g-force2k2
Cassidy
01-12-2004, 06:22 PM
THANK YOU! I loved this hack and was hoping someone would port it! I was requesting it all over the place XD
*Installs straight away*
dede1
01-12-2004, 06:25 PM
Thanks, I then times continue to look for find I that much
Cassidy
01-12-2004, 06:34 PM
Uh i've come across a problem. Over 100 of this users posts are in a different forum but it's saying there's 4 in another forum as thier most.
g-force2k2
01-12-2004, 07:35 PM
Uh i've come across a problem. Over 100 of this users posts are in a different forum but it's saying there's 4 in another forum as thier most.
Alright I'll try and figure things out soon, sorry for the problems.
You can try to see if this fixes anything.
open member.php
find:
GROUP BY forum.forumid
Above it add:
ORDER BY aposts
Don't know if that will have any effect though.
Regards,
g-force2k2
dede1
01-12-2004, 08:09 PM
Thanks the % is correct. The forum only always indicates
XX, it would have nevertheless also forum XY or XS to show
dede1
01-12-2004, 10:07 PM
0 Poster Profil :
Warning: Division by zero in /var/www/html/Board/member.php on line 379
function showSpoiler(block) { // by The Small One block.nextSibling.nextSibling.style.display ="block"; block.parentNode.removeChild(block);}
SnowBot
01-13-2004, 12:25 AM
nice job g-force2k2
keep the hard work up :)
INSTALLS
SnowBot
01-13-2004, 01:28 AM
Little problem, install went well but
Forum Activeness StatisticsAidie is most active in the forum Aliens And UFO's
with a total of 2 posts contributing to 0.22% of their total posts.
Does the hack only calculate from date of install ?
BTW Aidie is an admin with Total Posts: 909 (5.59 posts per day
thanks
g-force2k2
01-13-2004, 03:47 AM
0 Poster Profil :
Warning: Division by zero in /var/www/html/Board/member.php on line 379
function showSpoiler(block) { // by The Small One block.nextSibling.nextSibling.style.display ="block"; block.parentNode.removeChild(block);}
I will have to updated my install to prevent the division by zero, I forgot about users with no posts, but I will update as soon as possible
Thanks the % is correct. The forum only always indicates
XX, it would have nevertheless also forum XY or XS to show
I don't quite follow what you mean, could you explain it in more depth?
Snowbot did you try adding the ORDER BY to the query? I will have to investigate this because I saw that it was incorrect too, sorry for the setbacks.
Regards,
g-force2k2
dede1
01-13-2004, 03:56 AM
Mmmm it shows always the same forum in the forum statistics on all the
same where one thus always looks
User-Forum-Statistik
Dede1 hat in dem Forum C (http://63.246.136.220/Board/forumdisplay.php?f=161) 4 Beitr?ge geschrieben, da? sind 0% aller seiner Beitr?ge.
Always forum C with me
Frozen Dreams
01-13-2004, 05:56 PM
I am getting that forum problem too. Wont show the right forum. Always brings the same up even though most of my posts are in another forum.
I really like this lil addition to the member info ... but this version looks buggy :(
@dede
der teil mit "$_activeperc = round " usw musst du wieder zur?ck?ndern ... bei dir rechnet er momentan mit der kommastelle 2 zu weit vor ... also: wenn jemand 100 posts hat und diese 100 posts im forum C gemacht hat - dann w?rde er bei dir 1% zeigen ;)
hoffe, das war verst?ndlich ...
dede1
01-13-2004, 08:46 PM
Ja danke das habe ich gemacht nur er zeigt bei mir immer das gleiche Forum an egal wo ich schauen gehe immer Forum C.
Ich finde denn fehler leider nicht
niiiiiiiiice hack! ill add it to my forum soon ;)
* MGM clicks install
MGM out
webrats
01-14-2004, 12:31 PM
still waiting for fix
same problem as cassidy
Zelda-King
01-14-2004, 02:30 PM
I get the following error in certain profiles;
Warning: Division by zero in /domain/forums/member.php on line 378
Code there being;
$_activeperc = round ( ( ( $_activeposts / $userinfo['posts'] ) * 100 ), 2 ) . "%" ;
It seems to happen with anyone who has 0 posts.
g-force2k2
01-14-2004, 06:58 PM
Update For Hack Is Complete.
To prevent division by zero added some code changes to the template MEMBERINFO and the file member.php. The User Activeness info will only appear if they have posts if not it will not display.
Note this will also save the 1 query that is used to get the active information if they have no posts.
Will update installer once I fix the other issue at hand. Changes attached below.
Sorry for any inconviences.
Regards,
g-force2k2
Zelda-King
01-14-2004, 07:29 PM
Oops! Sorry for repeating a posted problem. Thanks for the quick fix! :)
gmarik
01-14-2004, 07:43 PM
Nice and usefull adition! ;)
g-force2k2
01-15-2004, 07:06 AM
Little problem, install went well but
Forum Activeness StatisticsAidie is most active in the forum Aliens And UFO's
with a total of 2 posts contributing to 0.22% of their total posts.
Does the hack only calculate from date of install ?
BTW Aidie is an admin with Total Posts: 909 (5.59 posts per day
thanks
Fix 2 Updated, You can updated From v1.1 To v1.2 With the file attached below.
It now correctly displays the current forum of which the user has posted their most posts. And snowbot it now calculates from the posts that exist, I just did not write the query correctly sorry.
It requires one small file edit to the member.php
Sorry for any inconvenieces. Also I want to help the German users, but I don't know what they're exactly discussing so if someone could translate I'd be more than happy to help.
Regards,
g-force2k2
Darkwolf
01-15-2004, 05:45 PM
Now is like too much
Total Posts: 1,473 (2.93 posts per day)
Darkwolf is most active in the forum Talking Point with a total of 566 posts contributing to 56600% of their total posts.
g-force2k2
01-15-2004, 09:52 PM
Now is like too much
Total Posts: 1,473 (2.93 posts per day)
Darkwolf is most active in the forum Talking Point with a total of 566 posts contributing to 56600% of their total posts.
I don't know why the calculation doesn't exactly work, but see the information on this [ POST (https://vborg.vbsupport.ru/showpost.php?p=461363&postcount=10) ] for a possible fix. I don't know why it's creating this error, if someone could help me in any way I would appreciate it.
Regards,
g-force2k2
buro9
01-16-2004, 02:46 PM
I don't know why the calculation doesn't exactly work, but see the information on this [ POST (https://vborg.vbsupport.ru/showpost.php?p=461363&postcount=10) ] for a possible fix. I don't know why it's creating this error, if someone could help me in any way I would appreciate it.
Regards,
g-force2k2
Well, in the install you might want to update your code to include the table prefixes:
function update_phrasegroups ( $phrasegroup, $languageid=1 )
{
global $DB_site ;
$getid = $DB_site->query_first ( "SELECT phrasetypeid FROM " . TABLE_PREFIX . "phrasetype WHERE fieldname='$phrasegroup'" ) ;
$phrasetypeid = $getid['phrasetypeid'] ;
$phrases = $DB_site->query ( "SELECT varname AS v, text AS t FROM " . TABLE_PREFIX . "phrase WHERE phrasetypeid=" . $phrasetypeid . " ORDER BY varname" ) ;
while ( $phrase = $DB_site->fetch_array ( $phrases ) ) :
$parray[$phrase['v']] = preg_replace( '/\{([0-9])+\}/siU', '%\\1$s', $phrase['t'] ) ;
endwhile ;
$DB_site->query ( "UPDATE " . TABLE_PREFIX . "language SET phrasegroup_$phrasegroup='" . addslashes ( serialize ( $parray ) ) . "' WHERE languageid=$languageid" ) ;
}
As I got an install error as I'm using table prefixes.
I also had to adjust the member.php bit to include table prefixes, and performed the same addition of an ORDER BY to set the right one at the top:
$show[useractiveness] = 0 ;
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 ( ( ( $_activeposts / $userinfo['posts'] ) * 100 ), 2 ) . "%" ;
$show[useractiveness] = 1 ;
endif ;
As regards the math for the percentile... it's fine :)
For the sum shown in the earlier post, it did correctly return 38.42%
But it looks like that user has lost a value for the $userinfo['posts'] var... because that value is a direct $_activeposts * 100 rounded sum. So either put in or remove the quotes around 'posts' to see what happens ;)
That should see you fine.
:)
Darkwolf
01-16-2004, 03:13 PM
I update to your coding and it got this
Fatal error: Call to undefined function: get_noaccess_forumids() in /home/lifex/public_html/forums/member.php on line 367
trinitym
01-16-2004, 03:48 PM
I update to your coding and it got this
Fatal error: Call to undefined function: get_noaccess_forumids() in /home/lifex/public_html/forums/member.php on line 367
I got the same error earlier because I pasted the wrong bit of code into the includes/functions_user.php - maybe something similar happened?
On another note, it seems my "regular" registered users can't see this in any of the profiles? Did I do something wrong somewhere, or is this a mod only view option?
buro9
01-16-2004, 04:08 PM
I got the same error earlier because I pasted the wrong bit of code into the includes/functions_user.php - maybe something similar happened?
Yup... the function should exist in functions_user.php and is part of this hack... i.e. you should have run the installer file provided by g-force2k2 in the first post of this thread... followed the instructions and already made the update to functions_user.php.
It sounds daft... but make sure you've uploaded it ;)
Darkwolf
01-16-2004, 05:51 PM
I have done that but it doesn't seems to be working for me.
mharmon
01-23-2004, 02:59 AM
I tried this in RC3 with no luck. Installed great -- but didn't show. Any suggestions?
poetic
01-23-2004, 09:23 PM
Mine shows.. BUT I get the division of 0 error. ?
g-force2k2
01-23-2004, 09:48 PM
I tried this in RC3 with no luck. Installed great -- but didn't show. Any suggestions?
Did you try to view a profile with more than zero posts?
Mine shows.. BUT I get the division of 0 error. ?
poetic did you redownload the 1.2 version? because it does have the fix for the division by zero.
Regards,
g-force2k2
poetic
01-23-2004, 09:55 PM
I'll 'check' the versions on this.. thanks
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
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?
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:
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.
* Natch clicked install, then debugged the Firebird issue ...
I have found out why this is:
<!-- 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:<!-- 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:
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 (https://vborg.vbsupport.ru/showpost.php?p=463372&postcount=32) 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 $_allposts = intval($userinfo['posts']); and used this value as the replacement for $userinfo['posts'] ... I also outputted it in brackets for debuggin purposes ... 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 :)
-=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?) ...
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 ...
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
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.php?p=463372&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;
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;
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
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
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 ( 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: 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
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
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:
$userinfo['posts'] = intval ( $userinfo['posts'] ) ;
$_activeperc = round ( ( ( $_activeposts / $userinfo['posts'] ) * 100 ), 2 ) . "%" ;
with:
$userinfo['rposts'] = intval ( $userinfo['posts'] ) ;
$_activeperc = round ( ( ( $_activeposts / $userinfo['rposts'] ) * 100 ), 2 ) . "%" ;
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
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
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 (http://www.mobileforces.org/forums/member.php?userid=55) calculates ( (most active forum posts / 2 ) *100 ) and is an ex-moderator profile.
This is my profile (http://www.mobileforces.org/forums/member.php?u=283), and is calculating ( (most active forum posts/1) * 100 ).
A regular user profile (http://www.mobileforces.org/forums/member.php?userid=376), calculating properly ( (most active forum posts/total user posts) * 100 ).
Sadie Frost
02-14-2004, 04:19 AM
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:
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
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
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
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
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
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:
{
$show['lastpost'] = true;
$userinfo['lastposttitle'] = '';
$userinfo['lastposturl'] = '#';
$userinfo['lastpostdate'] = $vbphrase['never'];
$userinfo['lastposttime'] = '';
}
And just above:
// reputation
fetch_reputation_image($userinfo);
Well, that code should ideally look like this:
// HACK : START : USER ACTIVENESS
$show[useractiveness] = 0 ;
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] = 1 ;
}
// 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!
well, it seems that ADMIN's and MOD's don't have the forum activeness displayed corectly. This is me on my forum :
PET is most active in the forum Generalităţi with a total of 1552 posts contributing to 25866.67% of their total posts.
buro9
04-16-2004, 05:10 AM
well, it seems that ADMIN's and MOD's don't have the forum activeness displayed corectly. This is me on my forum :
PET is most active in the forum Generalităţi with a total of 1552 posts contributing to 25866.67% of their total posts.
Incorrect diagnosis... it is that the user has 1,000+ posts that it miscalculates the percentage, not because of the usergroup of that user.
The solution is a few posts above this one:
https://vborg.vbsupport.ru/showpost.php?p=496640&postcount=78
Natch
04-18-2004, 09:28 PM
Incorrect diagnosis... it is that the user has 1,000+ posts that it miscalculates the percentage, not because of the usergroup of that user.
The solution is a few posts above this one:
https://vborg.vbsupport.ru/showpost.php?p=496640&postcount=78
Well done buro9 for the fix !!! :)
vb.org site admins ? please add a link to buro's post with the fix for all as this author's (for the moment) gone awol ...
MeTaL_oRgY
05-18-2004, 12:26 PM
In order to install "[vB 3.0.0] - vb3 User Forum Activeness Hack v1.4 " mod should i modify my boards with upgrade4 codes or should i first use number 1 then 2 until the 4? Would it work correctly on vb3.0.1
Thanks
subu1
06-18-2004, 12:30 PM
OK, new problem on RC4: Nothing shows in the table.
i have the same Problem in my vb3 Gold :rolleyes:
can you help me :squareeyed:
thx and greetz subu1
Bison
06-26-2004, 02:22 AM
Love this guys work in vB2, but I won't touch this one right now!
Roody
09-01-2004, 02:10 AM
I am trying to get the code needed to be added to the Member Info template. Can someone help me?
Phalynx
09-01-2004, 10:33 AM
nice, one, installing!
reteep
09-01-2004, 12:12 PM
I executed the installer now twice (uninstalled once) and followed every instruction carefully but the table with the hack just doesn't show up:
http://www.musiker-board.de/vb/member.php?u=3
What could be wrong?
father
09-02-2004, 07:13 PM
yes, nice hack, when it works^^
I´ve same problem like stormblast, i can`t see the hack in profile...
reteep
09-07-2004, 07:20 AM
Noone knows what to do? :/
Megareus Rex
09-09-2004, 05:23 PM
Ok, here's my problem:
Not only does it incorrectly display the % of posts in a forum
Lancet Jades is most active in the forum Role Playing Games with a total of 631 posts contributing to 10516.67% of their total posts.
But also, it messes up the post count of users! (Not the actual post count, just the post count shown in member.php)
Total Posts: 6 (22.76 posts per day)
As you can see, the posts per day is still correct, but the actual number is messed up somehow. How can I fix these problems?
EDIT: Apparently, this only happens with some of my staff. Does this mean it's a usergroup thing? Or is it messing up because we have posts in private forums?
father
09-16-2004, 07:14 PM
i think thats poor, no support it looks:/
we(my team members and me) are really fans of stats, but we dont lie, the hack doesnt work, why nobody can say us why?
Oblivion Knight
09-16-2004, 07:37 PM
Everything seems to be working fine for me..
Thanks for a great hack :)
HarryBO
10-15-2004, 10:27 PM
Hi!
I tried to install this Hack a few times, but there is one Problem! I have installed the "Users Threads in Profile" Hack, too. Now I become an error message (misc.php)
Can someone help me?
Sorry about my english (I came from Germany)
Greetz
BO
Lethal
11-02-2004, 10:54 PM
yup same here
Fatal error: Cannot redeclare get_noaccess_forumids() (previously declared in /htdocs/www/forums/includes/functions_user.php:518) in /htdocs/www/forums/includes/functions_misc.php on line 18
Natch
11-04-2004, 12:39 AM
try replacing your include() with include_once() and require() with require_once() ...
Psybadek
11-11-2004, 01:58 PM
I have a problem with it...
The new stats work fine, but total posts have really messed up.
It only shows the first number e.g. a member with 8,345 posts shows as only 8.
Whats the problem? Thanks.
PheReFuLL
11-16-2004, 06:18 PM
/* vb3 User Forum Activeness Hack -- Copyright g-force2k2 2004 */
$show[useractiveness] = 0 ;
if ( $userinfo[posts] ) :
$tfarray = $DB_site->query_first ( "
SELECT COUNT(*) AS aposts,f.title AS aftitle,
t.forumid AS aforumid
FROM " . TABLE_PREFIX . "post p
LEFT JOIN " . TABLE_PREFIX . "thread t USING ( threadid )
LEFT JOIN " . TABLE_PREFIX . "forum f ON f.forumid = t.forumid
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON ( deletionlog.primaryid = t.threadid AND type = 'thread' )
WHERE t.forumid NOT IN ( " . implode ( ",", get_noaccess_forumids ( ) ) . " )
AND t.visible=1
AND deletionlog.primaryid IS NULL
AND p.userid = $userinfo[userid]
GROUP BY f.forumid ORDER BY aposts DESC LIMIT 1" ) ;
$_activeposts = $tfarray['aposts'] ;
$_activeurl = "<a href=\"forumdisplay.php?$session[sessionurl]f=" . $tfarray['aforumid'] . "\">" . $tfarray['aftitle'] . "</a>" ;
$userinfo['posts'] = ( $userinfo['posts'] ) ;
$_activeperc = round ( ( ( $_activeposts / $userinfo['posts'] ) * 100 ), 2 ) . "%" ;
$show[useractiveness] = 1 ;
endif ;
/* vb3 User Forum Activeness Hack -- Copyright g-force2k2 2004 */
That should fix the problem.
Er... I realized that the percent is still screwed up if the post count is over 1,000. I only fixed the problem with the post count not displaying correctly when it reaches 1,001. <<;; I'll try and fix the percent thing later.
Lethal
11-26-2004, 07:47 AM
I just put
require_once('./includes/functions_misc.php');
in member.php about the code you insert into member.php for this hack and it worked since the the code you have to put in function_user.php I already have in functions_misc.php.
Curzon564
12-11-2004, 08:12 PM
I also had the % problem. It seems that this happens always if your board uses . instead of , (e.g. 1.500 posts instead of 1,500 posts).
To fix this problem do the following:
Replace the original code with this modified version of buro9's Code (https://vborg.vbsupport.ru/showpost.php?p=496640&postcount=78):
// HACK : START : USER ACTIVENESS
$show[useractiveness] = 0 ;
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] = 1 ;
}
// HACK : END : USER ACTIVENESS
The only thing replaced in this modified version are 2 . instead of , in the $_activeperc line.
As this isn't my code, credits belong to buro9 for his work.
@buro9
I hope you don't mind me modifying your code.
Zachariah
01-04-2005, 11:31 PM
@buro9 - post 78 -
Great fix. But, last post changed to never vs. were the member posted (all users)
PostsTotal Posts: 1,881 (1.43 posts per day)
Last Post:
Never
Find all posts by Zack
Find all threads started by Zack
Forum Activeness Statistics
Zack is most active in the forum General with a total of 813 posts contributing to 43.22% of their total posts.
Zachariah
01-05-2005, 01:53 PM
I killed:
// reputation
fetch_reputation_image($userinfo);
From: buro9 - post 78 -
doing this got back Last Post
:rambo:
themovieinsider
01-07-2005, 04:56 PM
works great
Impulse
01-11-2005, 01:27 PM
Hmm, I've installed this hack and run into a problem. The hack works perfectly fine on IE, I think... but I myself use firefox and don't see the changes made by the hack.
I've deleted my cookies and such, but still nothing...
help?
MajorFm.com
01-15-2005, 12:51 PM
Hack worked perfectly, i had to do the percentage fix aswell... might be a idea to change the original zip...
Thanks...!
MajorFm.com
01-15-2005, 12:58 PM
Is there a problem somewhere, i have just noticed...
http://img138.exs.cx/img138/6041/activehack4ht.jpg
According to that, i got 4.1%
But explain this...
The total posts in the forum is 6608 and the total i have posted there according to your hack is 410
6608 Divide 410 = 16.12
Shouldn't it be 16.1%
Please advise...
MajorFm.com
01-15-2005, 01:48 PM
Oh my bad, i get it, doh...
The percentage is not the contribution to the forum, its the percentage of the users total posts... am i right?
MajorFm.com
01-15-2005, 01:57 PM
Im confused again... the percentages just don't seem right!
PostsTotal Posts: 856 (8.29 posts per day)
Find all posts by Martina
Find all threads started by Martina
Forum Activeness StatisticsMartina is most active in the forum You what... with a total of 543 posts contributing to 0.01% of their total posts.
MajorFm.com
01-29-2005, 03:35 PM
I still get a unreal percentage...
ElecTriK ShocKs is most active in the forum You what... with a total of 784 posts contributing to 78400% of their total posts.
iceytdot
05-10-2005, 07:07 AM
worked fine for me after applying the 2 updates, good job g force! *clicks install*
Allan
05-13-2005, 10:54 AM
don't work with 3.0.7
MrMister
09-27-2005, 07:09 PM
Crap, no wonder.
zylstra
10-17-2005, 03:59 PM
Which versions does it work with? My board says version 3.0.3, but I installed it and didn't see the extra stats.
MThornback
10-19-2005, 02:08 PM
don't work with 3.0.7
I run 3.0.7 and with Buro's fix it works fine now :)
Alphawolf83
11-03-2005, 04:55 PM
*Clicks Install*
Thanks for this nice hack... :-)
poseidon88
03-10-2006, 01:00 PM
Does it work in 3.5.4?
iblis
05-16-2006, 02:50 AM
I got just about every error everyone here has described, but after i sat down and analyzed the code i found a few errors which i corrected.
The problem seems to be that deleted posts have not been substracted - just deleted threads!
Try this on for size, it works fine on my board // HACK : START : USER ACTIVENESS
$show[useractiveness] = 0 ;
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 AS delpost ON(delpost.primaryid = post.postid AND delpost.type = 'post')
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS delthread ON(delthread.primaryid = thread.threadid AND delthread.type = 'thread')
WHERE " . TABLE_PREFIX . "forum.forumid NOT IN ( '$forumids' )
AND " . TABLE_PREFIX . "thread.visible=1
AND delpost.primaryid IS NULL
AND delthread.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] = 1 ;
}
// HACK : END : USER ACTIVENESS
Also, for those of you who experience that the hack installs but only show a blank box in the memberinfo: Go to the admincp and edit (and save) the phrase you created on install. That should fix the problem.
Alphawolf83
05-07-2007, 05:23 PM
Anyone a link for an 3.6.5 version of this neat plugin? :)
Anyone?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.