vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Need a profilefield in a SQL query in memberlist.php (https://vborg.vbsupport.ru/showthread.php?t=225574)

ganima 10-19-2009 06:43 PM

Need a profilefield in a SQL query in memberlist.php
 
Hi, there is a little query that drives me nuts ;) I can't get it working.

In /memberlist.php I want the letter links (# A-Z) to look in a custom field not in username.
At line 337 I changed the code to ?
PHP Code:

if ($ltr != '')
    {
        if (
$ltr == '#')
        {
            if (
$sortfield == 'nachname')
            {
                
$condition .= "field7 NOT REGEXP(\"^[a-zA-Z]\")";
            }
            else
            {
                
$condition .= "username NOT REGEXP(\"^[a-zA-Z]\")";
            }
        }
        else
        {
            
$ltr chr(intval(ord($ltr)));

            if (
$sortfield == 'nachname'
            {
                
$proffid $profilefield[profilefieldid][7];
                
$condition .= $proffid.' LIKE("' $db->escape_string_like($ltr) . '%")';
            }
            else
            {    
                
$condition .= 'username LIKE("' $db->escape_string_like($ltr) . '%")';
            }
        }
    } 

? but the profilefieldid is always empty. I even can not change it to
PHP Code:

$condition .= 'field7 LIKE("' $db->escape_string_like($ltr) . '%")'

That makes a SQL error and says there is no field named field7.

What's wrong with that? How do I have to change my code to get the profilefield #7 to look at?

Hope for help. And thanks!

Lynne 10-19-2009 06:58 PM

This line:
PHP Code:

                $proffid $profilefield[profilefieldid][7]; 

Where is $profilefield defined? Are you sure that variable is correct cuz it looks a bit odd to me ($profilefield[profilefieldid][7]? I would have thought $profilefield[fieldid7], but I don't know your queries).

ganima 10-20-2009 06:04 AM

I am pretty unsure that the variable is correct. I really don't know where or how to look at.

This line
PHP Code:

$condition .= 'field7 LIKE("' $db->escape_string_like($ltr) . '%")'

should look in the profilefield id 7 (that is where I store users lastname).

But the query (whereever it is build) doesn't search in there. Hope for someone who is more comfortable with the code in vB.


All times are GMT. The time now is 02:09 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.01574 seconds
  • Memory Usage 1,728KB
  • 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
  • (4)bbcode_php_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