Closed (fixed)
Project:
Drupal vB
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
7 Jun 2006 at 01:45 UTC
Updated:
23 Jan 2011 at 05:00 UTC
first off i'd like to say great work with this module, keep up the good work. :)
It's a small bug, I noticed if I register on the Drupal site, and then go to the forums, the vBulletin forum statistics don't update the new registered user.
"Members"
"Active Members"
"Welcome to our newest member"
Those fields only show those who registered directly through vB and not Drupal. So if person "A" registered through vB first and person "B" registered through Drupal second, on the vB statistics it would say,
'Welcome to our newest member "A"'
even though "B" is the newer member.
Comments
Comment #1
rszrama commentedInteresting. I'll try to replicate the issue when I get the chance at work. I seem to remember creating all my users through the Drupal side w/o a hitch, but I'll try specifically through vB only and see what happens. ^_^
Comment #2
rszrama commentedHouse cleaning...
Comment #3
taylormm commentedthis problem is still present in drupal 6.x with vbulletin 3.6.8
Comment #4
taylormm commentedAfter tinkering with this issue for a little bit I have designed a solution that is not perfect but still fully functional.
I discovered that vbdrupal pulls the forum statistics (number of users, etc..) from the vbulletin database (specifically the "userstats" field in the "datastore" table).
vbdrupal does this correctly... the issue is that because users are registering via drupal - the vBulletin script to update the statistics are never run!
The solution: To have drupal run the vbulletin script on every new user account creation.
vbulletin's function to build user statistics is build_user_statistics() which is located in 'includes/functions_databuild.php'
I made a php script to bootstrap vbulletin and run this function.
However, I was not able to incorporate it into the vbDrupal code.
What I did instead was create a standalone script, vbstats.php, and then created a cron job for the script to be run every hour. This uses less server resources as well.
This code bootstraps drupal and vbulletin and runs the necessary function.
Here is the code for vbstats.php. This file should be put in the root directory of the drupal installation (where cron.php resides).
You can test that it is working properly by running php vbstats.php from the command line.
Please note that in order for this to work, the $vb_config['Misc']['forumpath'] setting must be set properly in config.php (and dont forget that the config.php goes in both your forum directory as well as your vbdrupal directory). This has to be the full system path to the forum (ie: /home/user/domain.com/forum). This option is not required by default by the forum or by vbdrupal but in order for vbdrupal to know your forum's path you must specify it!
My request: Someone please integrate this solution to fit neatly into the vbDrupal module (without being in a standalone script that has to run on cron).
Comment #5
m4manas commentedThat a good script. Why not make it a hook_cron in drupal_vb
I believe this can be added in the dev 2.x
Comment #6
rsuplido commentedYou actually don't need to do anything. What you can do is go to vB's Shceduled Task Manager, and run the "Daily Statistics Log" task more often. By default, it only runs at 12 am every day. I changed it to the following:
hour field to: *
minute fields to have it run every 10 minutes: 02, 12, 22, 32, 42, 52
Comment #7
sun#6 contains a working solution.