vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP - Manually inserted user account does not show on stats at bottom of home page (https://vborg.vbsupport.ru/showthread.php?t=261455)

adam parnell 04-05-2011 09:23 AM

PHP - Manually inserted user account does not show on stats at bottom of home page
 
Hello all,

I have a script to integrate my forum with another system and I can quite happily create a new user however I have noticed it doesnt appear in the stats at the bottom and the last user is shown as the last user created through the forum admin panel.

I know if I run the CRON for daily stats my user now appears.

How can I get the stats to update when I create the user in my php form?

Thanks and best regards to all

kh99 04-05-2011 12:34 PM

It looks like you could call function build_user_statistics() in includes/functions_databuild.php (assuming you didn't use the vB_DataManager_User() class to add your user, because then it would already be called for you).

Andy 04-05-2011 02:34 PM

Quote:

Originally Posted by adam parnell (Post 2181047)
How can I get the stats to update when I create the user in my php form?

Thanks and best regards to all

Looks like the table datastore holds that value in the userstats field.

adam parnell 04-05-2011 04:00 PM

Interesting,

Do you have an example of using vB_DataManager_User()

Best regards?

kh99 04-05-2011 04:11 PM

You could look at admincp/user.php, search for "Start do update". (It's the code for adding a user from the ACP). I think this line:

Code:

$userdata =& datamanager_init('User', $vbulletin, ERRTYPE_CP);

creates an instance of that class. But if you did your own db writes because you didn't want to use a lot of the vbulletin code then you probably wouldn't want to use that class.

Andy 04-05-2011 04:17 PM

Quote:

Originally Posted by adam parnell (Post 2181145)
Interesting,

Do you have an example of using vB_DataManager_User()

Best regards?

My custom scripts always act upon the database tables directly.

adam parnell 04-06-2011 02:47 PM

Thanks.

Andy,

I do most it manually but I'm not sure about updating the stats which is why is someone has a simple example I can just plop in after the insert command that would be great

Open to suggestions and ideas


All times are GMT. The time now is 06:56 PM.

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.01311 seconds
  • Memory Usage 1,721KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete