vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to Update Custom Profile Fields (solved) (https://vborg.vbsupport.ru/showthread.php?t=183595)

shlomot 06-26-2008 01:18 PM

How to Update Custom Profile Fields (solved)
 
Hi. After completing a set of calculations in a PHP file (as a CMPS module), I'm trying to commit the results into a few custom profile fields for the current user.

I've read all posts and articles, but still without success. My last code is:
Code:

$query = "UPDATE vbulletin_prefix_userfield
          SET field75 = $intimacy_score, field73 = $intimacy_level, field76 = $intimacy_status
          WHERE userid = $vbulletin->userinfo['userid']";

Please help. Thank you.

--------------- Added [DATE]1214541980[/DATE] at [TIME]1214541980[/TIME] ---------------

I was helped by Ideal Web Technologies who reminded me to add the following statement after the query definition:

Code:

$vbulletin->db->query($query);
Thank you, Tim, so very much.

Unfortunately, I couldn't make do with vbulletin_prefix_userfield, vbulletin_prefixuserfield, or .table_prefix.
Maybe CMPS cannot read these globals.
So the final script looks like this:
Code:

$query = "UPDATE userfield
          SET field75 = $intimacy_score, field73 = $intimacy_level, field76 = $intimacy_status
          WHERE userid = $user_id";
$vbulletin->db->query($query);


Ideal Web Tech 06-27-2008 03:48 AM

No problem glad we got it fixed for you. :)

Dismounted 06-27-2008 10:03 AM

The User datamanager should be used when dealing with user data.

shlomot 06-28-2008 03:27 AM

Can you please explain.

Quote:

Originally Posted by Dismounted (Post 1560265)
The User datamanager should be used when dealing with user data.


Dismounted 06-28-2008 04:56 AM

<a href="http://www.vbulletin.com/docs/html/data_managers" target="_blank">Data Managers</a>

shlomot 06-28-2008 05:18 AM

Many thanks, but as a non-technical, doing-the-best-I-can-to-get-by type of a person, I beg you to translate the above statements to appropriate data_manager ones. I'll take it from there to be implemented all around, and so will so many other vBs who recognize the importance of using these classes.

The Data Managers manual is overwhelming at best:)

Quote:

Originally Posted by Dismounted (Post 1560921)



All times are GMT. The time now is 05:28 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.01102 seconds
  • Memory Usage 1,724KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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