vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   User Profile Field - get the option list from DB (https://vborg.vbsupport.ru/showthread.php?t=155939)

pthoff 08-22-2007 12:20 PM

User Profile Field - get the option list from DB
 
Hi

I have created a 'User Profile Field' as a Single-Selection Menu.
Is it possible to get the option list from a query/table and not as an static list in the 'User Profile Field Manager'?

I am using ver. 3.6.8.

XFSIllusion 06-29-2009 02:31 AM

I'd like to know how to do this as well, anybody know the answer? I'm using 3.8.3.

Kaemon 02-08-2010 07:45 AM

I'm interested in this as well. I'm somewhat savy in PHP but I'm not sure which file or template I would need to add the select statement to to populate the dropdown on the registration page.

For reference, I saw the code below posted elsewhere.

Code:

  //  Get Members
    $members = $db->query_read("
        SELECT user.email, user.userid, user.username " . iif((!empty($vbulletin->options['c_news_letter_field'])),",userfield." . $vbulletin->options['c_news_letter_field'] . "") . "
        FROM " . TABLE_PREFIX . "user AS user
        " . iif((!empty($vbulletin->options['c_news_letter_field'])),"LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON (userfield.userid = user.userid)") . "
        WHERE user.userid >= " . $vbulletin->GPC['startat'] . "   
        " . iif((!empty($vbulletin->options['c_news_letter_field']))," AND (userfield." . $vbulletin->options[c_news_letter_field] . " = '" . $vbulletin->options[c_news_letter_field_yes] . "' OR userfield." . $vbulletin->options[c_news_letter_field] . " = '')") . "
        " . iif((!empty($vbulletin->GPC['usergroups'])), "AND user.usergroupid IN ('" . implode("','",$c_news_letter_filter_usergroups) . "')") . "
        ORDER BY user.userid ASC
        LIMIT " . $vbulletin->GPC['perpage']
    );
       
    while ($member = $db->fetch_array($members))

I've also seen this posted somewhere for VB4 and not sure if PHP code needs to be added like this for vb3.X :
Code:

<div class="desc">[php]<br />
$myvar = 'Hello World!';<br />
for ($<i></i>i = 0; \$i &lt; 10; \$i++)<br />
{<br />
&nbsp;&nbsp;&nbsp;&nbsp;echo $myvar . &quot;\n&quot;;<br />
}<br />
[ /php]</div>

From the above, it looks like the PHP code is rendered with HTML and THEN rendered by the web server. ????


All times are GMT. The time now is 11:17 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.01105 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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