vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Search Custom User Profile Fields (https://vborg.vbsupport.ru/showthread.php?t=29286)

grb123 10-01-2001 01:33 PM

I want to add some custom user profile fields to the advanced member search. I've had a look around and it looks like a fair amount of hacking required to do this, but I was hoping maybe someone either has already done it or has an idea how I should go about it?

Admin 10-01-2001 01:40 PM

Not really.

You will need to edit two things:
memberlist.php file
and
memberlistsearch template

For the file, you should add something like this:
Code:

    if ($customfieldname!="") {
      $condition.=" AND userfield.field5 LIKE '%".addslashes($customfieldname)."%' ";
    }

(but change the red parts to your needs)
somewhere in this block:
Code:

    if ($icq!="") {
      $condition.=" AND icq LIKE '%".addslashes($icq)."%' ";
    }
    if ($aim!="") {
      $condition.=" AND aim LIKE '%".addslashes($aim)."%' ";
    }

(lots of stuff like that there, just place it between them, doesn't matter where)

Then you will need to add an input box to the template, and make the name of it customfieldname, so it'll match the code you added earlier.

Not really hard, but takes a bit time. :)

grb123 10-01-2001 02:32 PM

As easy as that! Works perfectly, FireFly.

Once again, thank you very much!!

:)

carpman 11-26-2001 05:29 PM

Will this search any custom user profile fields that have been added in VB control panel?



Quote:

Originally posted by FireFly
Not really.

You will need to edit two things:
memberlist.php file
and
memberlistsearch template

For the file, you should add something like this:
Code:

    if ($customfieldname!="") {
      $condition.=" AND userfield.field5 LIKE '%".addslashes($customfieldname)."%' ";
    }

(but change the red parts to your needs)
somewhere in this block:
Code:

    if ($icq!="") {
      $condition.=" AND icq LIKE '%".addslashes($icq)."%' ";
    }
    if ($aim!="") {
      $condition.=" AND aim LIKE '%".addslashes($aim)."%' ";
    }

(lots of stuff like that there, just place it between them, doesn't matter where)

Then you will need to add an input box to the template, and make the name of it customfieldname, so it'll match the code you added earlier.

Not really hard, but takes a bit time. :)


Admin 11-27-2001 11:45 AM

Yes, but you must make the changes to the parts in red and add the fields to the searching template.


All times are GMT. The time now is 07:20 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.01430 seconds
  • Memory Usage 1,726KB
  • 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_code_printable
  • (1)bbcode_quote_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