vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Extracting User Profile Field Data (https://vborg.vbsupport.ru/showthread.php?t=186824)

futuredood 07-31-2008 02:41 AM

Extracting User Profile Field Data
 
Can anyone lend a hand on a) How to achieve this or b) Proper search terms to find instructions on this? I have different demographics at registration including Zip Code and Income Range that I need to extract for a media kit, but cannot seem to figure out how to do this. Thanks in advance!

blind-eddie 07-31-2008 04:18 AM

I think this is what your looking for.

Within your "media kit", where you wish for those fields to display, add the following code.
replacing the xxx with the field number of that field. Repeat these steps for each field you what to show.
Code:

<if condition="$user['fieldxxx']">
<li><span class="shade">$vbphrase[fieldxxx_title]</span> $user[fieldxxx]</li>
</if>


Hopefully, this is what you were referring to & I answered it correctly with coding from a mod here.

futuredood 08-06-2008 06:53 PM

Hi thanks for the reply, but that simply shows one field. I need to get all of the data from the members, so that I can put in the media kit things statistics such as:

Household income:
100-10000 20%
10001-1000000 40%

etc.

blind-eddie 08-07-2008 01:08 AM

Then repeat that step until to add each you want added.

RLShare 08-07-2008 01:53 AM

Use the database manager with an SQL statement like this to grab all of the data for all users. Change the field numbers appropriately.


PHP Code:

$usersfielddata=$vbulletin->db->query_read("
SELECT field5, field7
FROM "
.TABLE_PREFIX."userfield
WHERE field5 != '' AND field7 !='' "
);
while(
$data=$vbulletin->db->fetch_array($usersfielddata)){
//DO Something with the data





All times are GMT. The time now is 02:40 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.02176 seconds
  • Memory Usage 1,715KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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