View Full Version : Extracting User Profile Field Data
futuredood
07-31-2008, 03:41 AM
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, 05: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.
<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, 07: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, 02:08 AM
Then repeat that step until to add each you want added.
RLShare
08-07-2008, 02: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.
$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
}
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.