Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Activity Modification Details »»
Activity Modification
Version: 2.80, by WetWired WetWired is offline
Developer Last Online: Sep 2014 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 08-07-2005 Last Update: 02-04-2007 Installs: 472
DB Changes Uses Plugins Template Edits
Translations  
No support by the author.

For vB3.7, see The vB3.7 version

This is the plugin/vB3.5/vB3.6 version of this hack

This mod was developed on vB3.6.4, and tested for compatibility with vB3.5.4

Description
This hack adds an activity metric for users to your forum; this metric takes into account a variable number of weeks. Also provided is a Junior/Normal/Senior member system based on this metric, and a longevity metric (user registered time as a percent of the amount of time the first user has been registered).

Visiting each day and posting the configured amount of times per day for the configured number of weeks will yeild 100% activity. Posts are checked individually for each day, so days cannot be skipped then spammed up afterwards. The weight of visiting for the day relative to posting is configurable. Weeks are weighted so the most recent has a bigger impact on the activity percent than the most distant.

When a user logs in with activity above the configured threshold, they are promoted from Junior Member to Member. When they log in with the configured amount of time as Member, they are promoted to Senior Member. You can configure the mod to also add secondary usergroups when these promotions happen.

Complexity
This modification requires 1 XML import, modification to 3 templates, and the addition of some CSS, depending on what options you choose

Technical
This hack adds 1 query to showthread for each user who posts in that page (or only 1 for the logged in user by configuration). In addition, the first time a member's post or profile is accessed during a day (GMT), 3 queries are performed to find that user's activity. By configuration, 1 query may be added to each page load to find the logged in user's "activity today". By configuration, 1 query may be added to each member profile view to find that member's "activity today".

Upgradability
This modification will import your settings and data from the 3.0/hack version

Frequently Asked Questions
  • I installed this mod using the Download/Upload Plugin page and there was an error/it doesn't seem to work
    To install this mod, you need to use the Add/Import Product link on the Manage Products page
  • I just installed and everyone's activity seems low
    1. Part of the activity calculation is what days users visited on. This information isn't collected before the mod is installed, so no user can have 100% activity untill you've been running the mod for the full period of time you have it set to monitor
    2. Please realize that there is no "roll over" for activity; if you have it set to look at 4 posts per day, your users must post 4 posts on each individual day to obtain 100%.
  • I founded this forum, but I don't have 100% longevity
    Somehow a user's join date has been set before yours. When you install, the mod looks for the earliest join date to use to find longevity, but you can change the baseline date. To change the "Start of board" time, go to Maintenance>Activity Maintenance>Set Start of Board, enter your user number in the text field, then click Set Start of Board
  • I'm using the images template version, but the images don't show up
    Be sure to upload one of the activity directories from activityimages.zip to the misc directory for each of your styles. To find a style's misc directory, goto the Style Manager, then from the dropdown next to the style, choose Stylevars. The setting Miscellaneous Images Folder contains the path to that style's misc directory, where you need to upload the activity directory
  • Can I use activity for promotions?
    The project to build a full-blown promotion hack for use with this mod has been cancelled, after losing all of my work, however a much simpler system that adds secondary groups based on two thresholds has been added to the main hack.
  • Can you make X number get split up into digits?
    I understand where you're coming from with this one, but I just can't figure out a way to work this that would be simple to use.
  • The tooltips don't wrap and get cut off with FireFox
    The same thing happens to other vB tooltips (the thumbnail ones, for example). If you know a way to add line breaks to FF tooltips without scripting, please let me know.
Change log

Note: To upgrade, with the old version still installed, go to the Add/Import Product link on the Manage Products page, select the XML file for the new version, choose Yes for overwrite, then click Import.

2.80 release update
  • Added AdminCP option to disable display of activity ranks (ranktext)
  • Modified template changes to support the above change (for most people, your templates should work as is)
  • Modified template changes for image horizontal postbit to always locate activity information in the upper right of the postbit, so it doesn't move arround from post to post (if you're happy with how it is now, no need to update)
2.80 rc3 update
  • You can now control the number of entries on the Top Activity board from the adminCP
  • Top Activity templates are properly cached
  • Changes for XHTML 1.0 validation (requires template reedits if you want XHTML validation)
2.80 rc1 update
  • Added improved built-in Top Activity page
  • Added option for activity breakdown in activity bar tooltip
  • Added option to promote users when their activity is calculated instead of just when they visit to help admins that are having trouble with the promotion system
  • Fixed issue with maintenance section with other languages. It should display correctly now for all languages.
  • Added admin help in 3.6.x
  • Added 3.6.x version and link in product list
  • No template changes since 2.70 (there are new templates, however)
2.71 update
  • Corrected a bug where users on forums with "Weeks reflected" set to 1 could not reach 100% activity
2.70 update
  • Full info available to MEMBERINFO template
  • Full info available for the logged-in user (see template customization in install file)
  • Fixed % issue with different vB versions
  • "Midnight" for activity hack is configurable. Note that it may be desirable to set this to a time other than true midnight for your users.
  • Options to control calculation of activity today in MEMBERINFO and for logged-in user
  • Simple promotion system adds secondary usergroups when members are promoted in the ranktext system
  • Reworking of internals
  • Default templates should not try to display activity information when it is unavailable (a generic fix that covers vbA gallery)
2.51 update
  • Updated phrases for vb3.5.1
  • Updated options activity refresh for vb3.5.1
  • Fixed problem with activity-based ranks
2.50 Release update
  • Added fix for reversed posts field in images version templates when user is using a right-to-left language. (Manually update the postbit and postbit_legacy templates)
Beta 6 update
  • Added extra checks for excessive activity
  • User activity is now automatically refreshed when settings changes make it neccessary
  • Fixed guest bug
Beta 5 update
  • Removed the query added to PM views in beta 4
  • Removed the post digits setting; it causes trouble since the majority of users seem to be using the image version, and the load impact is slight anyway.
Beta 4 update
  • Fixed the problem where activity panel displayed incorrect information in PMs
  • Moved start of board into settings, removed 1 query from showthread, view PM, view user note
Beta 3 update
  • Fixed a critical issue with activity caching. Everyone should update
  • Fixed an issue with a query not working when using table prefixes
  • Added template modification instructions
  • Added image template mod version screenshot
Beta 2 update
  • There was an issue with % signs in the phrases, this has been corrected.
  • Screen shots added.
Changes from the hack version
  • Thresholds for promotions are configurable
  • Ranktext system is configured from the options page instead of by a file
  • You can now prune the visit log from the adminCP (Under Maintenance>Activity Maintenance)
Support

Please click the install link if you install this hack
I will support this hack in this thread on about a weekly basis.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #82  
Old 10-25-2005, 04:41 PM
WetWired's Avatar
WetWired WetWired is offline
 
Join Date: Jun 2002
Location: Texas
Posts: 669
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cdoyle
I'm not sure if I just missed it or maybe it's needed. But where the hack adds 'owner' under administrator, or it adds 'junior' under 'junior'. Is there anyway to have it not do that? just leave that part the default? Other then that I think this is a great hack!
You can remove the activity hack rankings by removing $WWU002_ranktext from your postbit templates.

Quote:
Is there any way I can move this below my reputation bar (under the instant message images)?
You can put it where you like. Just put the
Code:
  <table class="WWU002postbit" cellspacing="2" cellpadding="0">
    <tr>
      <td><img src="$stylevar[imgdir_misc]/activity/textactivity.gif" /></td>
      <td><img src="$stylevar[imgdir_misc]/activity/textlongevity.gif" /></td>
    </tr>
    <tr>
      <td title="$WWU002_activityinfo"><img src="$stylevar[imgdir_misc]/activity/activity$WWU002_activitylevel.gif" class="i" /></td>
      <td title="$WWU002_longevityinfo"><img src="$stylevar[imgdir_misc]/activity/long$WWU002_longevitylevel.gif" class="i" /></td>
    </tr>
    <tr>
      <td><img src="$stylevar[imgdir_misc]/activity/texttoday.gif" /></td>
      <td><img src="$stylevar[imgdir_misc]/activity/textposts.gif" /></td>
    </tr>
    <tr>
      <td title="$WWU002_todayinfo"><img src="$stylevar[imgdir_misc]/activity/today{$WWU002_todaylevel}_$WWU002_maxtodaylevel.gif" class="i" /></td>
      <td dir="ltr"><img src="$stylevar[imgdir_misc]/activity/posts$WWU002_postsd[1].gif" class="il" /><img src="$stylevar[imgdir_misc]/activity/posts$WWU002_postsd[2].gif" class="im" /><img src="$stylevar[imgdir_misc]/activity/posts$WWU002_postsd[3].gif" class="im" /><img src="$stylevar[imgdir_misc]/activity/posts$WWU002_postsd[4].gif" class="im" /><img src="$stylevar[imgdir_misc]/activity/posts$WWU002_postsd[5].gif" class="im" /><img src="$stylevar[imgdir_misc]/activity/posts$WWU002_postsd[6].gif" class="im" /><img src="$stylevar[imgdir_misc]/activity/posts$WWU002_postsd[7].gif" class="im" /><img src="$stylevar[imgdir_misc]/activity/posts$WWU002_postsd[8].gif" class="im" /><img src="$stylevar[imgdir_misc]/activity/posts$WWU002_postsd[9].gif" class="ir" /></td>
    </tr>
  </table>
part whereever you want it in the template.
Quote:
Also, what font did you use? I'd like to localize the text in the images.
The text is hand-drawn.


Regarding vBAdvanced, I don't use it, so I'll need your help in determining the source of the problem. First of all, enable debug mode on your forum, go to the page with the problem, and in the new drop down at the bottom of the page, tell me if you see any 'WWU002: Postbit for user X' messages and if the X is non-zero.
Reply With Quote
  #83  
Old 10-28-2005, 11:20 AM
Flow Fusion Flow Fusion is offline
 
Join Date: Jul 2003
Location: Georgia
Posts: 512
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
in template MEMBERINFO



find
-----
                    
$vbphrase[join_date]: <strong>$userinfo[datejoined]</strong>
-----
below itinsert
-----
                    <
div>$vbphrase[WWU002_activity]: <strong>$WWU002_activitypercent%</strong></div
This isn't in my MEMBERINFO template. Other than that it's a great hack.
Reply With Quote
  #84  
Old 10-29-2005, 01:47 PM
TJFweb TJFweb is offline
 
Join Date: Dec 2001
Posts: 191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wetwired:

This is a really great plugin.

I was just thinking - it would be really cool if I could get all of my user statistics into the same graphical format as shown in the postbit_legacy layout for the Activity Mod.

If it's not too much trouble, would you be able to tell me how to get other numerical values to show up in the graphical format as the Activity Mod does for the post count?

Being able to grab a numerical value from the user table and change it to graphical format like this does for post count would actually make a cool standalone addon too.

Thanks!!
Reply With Quote
  #85  
Old 10-30-2005, 04:00 PM
007's Avatar
007 007 is offline
 
Join Date: Jan 2003
Location: United States
Posts: 872
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What exactly does the Activity meter calculate? It looks like it goes up to 100%, but how does it work?
Reply With Quote
  #86  
Old 10-31-2005, 01:51 PM
WetWired's Avatar
WetWired WetWired is offline
 
Join Date: Jun 2002
Location: Texas
Posts: 669
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
If it's not too much trouble, would you be able to tell me how to get other numerical values to show up in the graphical format as the Activity Mod does for the post count?
This is the code that the plugin uses to separate the post count into digits:
Code:
    //Separate out postcount
    $WWU002postcount=$WWU002user['posts'];
    if($WWU002postcount<1){
      $WWU002_postsd=array(1=>'s',2=>'s',3=>'s',4=>'s',5=>'s',6=>'s',7=>'s',8=>'s',9=>'0');
    }else{//($WWU002postcount<1)
      for($i=9;$i>0;$i--){
        $WWU002digit=$WWU002postcount%10;
        $WWU002postcount=floor($WWU002postcount/10);
        if(($WWU002digit==0)&&($WWU002postcount==0)){
          $WWU002_postsd[$i]='s';
        }else{//(($WWU002digit==0)&&($WWU002postcount==0))
          $WWU002_postsd[$i]=$WWU002digit;
        }//endif(($WWU002digit==0)&&($WWU002postcount==0))
      }//endfor($i=9;$i>0;$i++)
    }//endif($WWU002postcount<1)
First, it stores the value to process in a working variable so the original value is not corrupted, then it has a special case to display 0 for any value under 1 (because postcount shouldn't go negative, and the code doesn't have provisions for displaying negative numbers). After that, it works from least significant digit to most significant, by dividing the value by 10 and using the remainder as the digit for that place. If we've passed all the siginificant digits (because our working value is zero), then zero digits are converted to space padding.

You should be able to use the same code to separate out the digits for any value, just change the second line to assign $WWU002postcount to the new value to break down, and replace occurrances of $WWU002_postsd with a different variable to hold the digits.

Quote:
Originally Posted by 007
What exactly does the Activity meter calculate? It looks like it goes up to 100%, but how does it work?
From the opening post:
Visiting each day and posting the configured amount of times per day for the configured number of weeks will yeild 100% activity. Posts are checked individually for each day, so days cannot be skipped then spammed up afterwards. The weight of visiting for the day relative to posting is configurable. Weeks are weighted so the most recent has a bigger impact on the activity percent than the most distant.

For an in-depth explaination (this file is included with the mod):
https://vborg.vbsupport.ru/attachmen...chmentid=33478
Reply With Quote
  #87  
Old 11-01-2005, 04:55 AM
TJFweb TJFweb is offline
 
Join Date: Dec 2001
Posts: 191
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by WetWired
This is the code that the plugin uses to separate the post count into digits:
Code:
    //Separate out postcount
    $WWU002postcount=$WWU002user['posts'];
    if($WWU002postcount<1){
      $WWU002_postsd=array(1=>'s',2=>'s',3=>'s',4=>'s',5=>'s',6=>'s',7=>'s',8=>'s',9=>'0');
    }else{//($WWU002postcount<1)
      for($i=9;$i>0;$i--){
        $WWU002digit=$WWU002postcount%10;
        $WWU002postcount=floor($WWU002postcount/10);
        if(($WWU002digit==0)&&($WWU002postcount==0)){
          $WWU002_postsd[$i]='s';
        }else{//(($WWU002digit==0)&&($WWU002postcount==0))
          $WWU002_postsd[$i]=$WWU002digit;
        }//endif(($WWU002digit==0)&&($WWU002postcount==0))
      }//endfor($i=9;$i>0;$i++)
    }//endif($WWU002postcount<1)
First, it stores the value to process in a working variable so the original value is not corrupted, then it has a special case to display 0 for any value under 1 (because postcount shouldn't go negative, and the code doesn't have provisions for displaying negative numbers). After that, it works from least significant digit to most significant, by dividing the value by 10 and using the remainder as the digit for that place. If we've passed all the siginificant digits (because our working value is zero), then zero digits are converted to space padding.

You should be able to use the same code to separate out the digits for any value, just change the second line to assign $WWU002postcount to the new value to break down, and replace occurrances of $WWU002_postsd with a different variable to hold the digits.



From the opening post:
Visiting each day and posting the configured amount of times per day for the configured number of weeks will yeild 100% activity. Posts are checked individually for each day, so days cannot be skipped then spammed up afterwards. The weight of visiting for the day relative to posting is configurable. Weeks are weighted so the most recent has a bigger impact on the activity percent than the most distant.

For an in-depth explaination (this file is included with the mod):
https://vborg.vbsupport.ru/attachmen...chmentid=33478
Awesome... Thanks a lot for the code ;-)

Now all I need to do is try to get it to work with another variable I have. Unfortunately I don't know why a hook can't use a specific variable when it can be called when placed in the postbit. This isn't to do with the Activity Mod (at most it's an adaptation of a feature of the Activity Mod) so I made a post here instead: https://vborg.vbsupport.ru/showthread.php?t=99795
Reply With Quote
  #88  
Old 11-02-2005, 11:57 AM
Lor20 Lor20 is offline
 
Join Date: Jun 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

First of all - great hack - looks really nice with the images and its pretty usefull. Secondly i have a problem - the titles dont seem to update. I installed the hack over 24 hours ago so theoretically ppl with the needed activity should have been updated today and moved in the higher category.
Code:
if($vbulletin->userinfo['userid']){
..... everything till here seems to work fine, the visitlog table looks fine and so do the fields in the user table other than the "rank"
      $WWU002userid=$vbulletin->userinfo['userid'];
      $WWU002activityPoints=eval($WWU002activityUpdate);
      //memberlevel 1 to memberlevel 2
      if(($vbulletin->userinfo['wwu002memberlevel']<2)&&($WWU002activityPoints>=($WWU002maxPoints*($vbulletin->options['WWU002level2THold']/100)))){
        devdebug('WWU002: promoted user '.$vbulletin->userinfo['userid'].' to level 2');
        $vbulletin->userinfo['wwu002memberlevel']=2;
        $db->query_write('UPDATE '.TABLE_PREFIX.'user SET wwu002memberlevel="2",wwu002fullmemberdate="'.$WWU002startOfDay.'" WHERE userid="'.$vbulletin->userinfo['userid'].'"');
        $vbulletin->userinfo['wwu002fullmemberdate']=$WWU002startOfDay;
      }//endif(($vbulletin->userinfo['wwu002memberlevel']<2)&&($WWU002activityPoints>=($WWU002maxPoints*($vbulletin->options['WWU002level2THold']/100))))
Any Ideas on the matter would be apreciated . I could just make a cronjob and run that every hour to update them but I figure thre is something wrong if it doesnt work for me.
If i see it correctly members who once got promoted keep their rank for the rest of the time? Is it possible to make that limited so you get dropped down a level again once ur activity drops below the point of where it had to be to get promoted?-again - I could do that with a cronjob but I'm just wondering if it's something other people would like to see.)

Thanks again,
Lor20
Reply With Quote
  #89  
Old 11-02-2005, 04:23 PM
hawksisdead hawksisdead is offline
 
Join Date: Apr 2005
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I was just wondering what I would need to edit to move the 4 bars around in the postbit. I want them lined up underneath Rep Power, but instead they are over to the left. What template edits do I need to make to get them lined up?
Reply With Quote
  #90  
Old 11-02-2005, 09:20 PM
WetWired's Avatar
WetWired WetWired is offline
 
Join Date: Jun 2002
Location: Texas
Posts: 669
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lor20
First of all - great hack - looks really nice with the images and its pretty usefull. Secondly i have a problem - the titles dont seem to update. I installed the hack over 24 hours ago so theoretically ppl with the needed activity should have been updated today and moved in the higher category.
Any Ideas on the matter would be apreciated . I could just make a cronjob and run that every hour to update them but I figure thre is something wrong if it doesnt work for me.
If i see it correctly members who once got promoted keep their rank for the rest of the time? Is it possible to make that limited so you get dropped down a level again once ur activity drops below the point of where it had to be to get promoted?-again - I could do that with a cronjob but I'm just wondering if it's something other people would like to see.)

Thanks again,
Lor20
The titles are only updated when the user visits; this minimizes overhead.

Quote:
I was just wondering what I would need to edit to move the 4 bars around in the postbit. I want them lined up underneath Rep Power, but instead they are over to the left. What template edits do I need to make to get them lined up?
https://vborg.vbsupport.ru/showpost.php?p=804589
Reply With Quote
  #91  
Old 11-03-2005, 06:37 AM
Lor20 Lor20 is offline
 
Join Date: Jun 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know it is supposed to update when the user visits, it is not doing that for me though. I have users who have an activity of over 60% and are still on level 1 (while the barriers are set at 25% and 65%). ALL my users are on level one even though about 100 or so of them were online in the last day and had enough activity to be "promoted".
Lor20
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05402 seconds
  • Memory Usage 2,351KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (1)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete