vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   help - trying to show profile fields on showgroups (https://vborg.vbsupport.ru/showthread.php?t=210249)

tipoboy 04-03-2009 09:17 PM

help - trying to show profile fields on showgroups
 
hello i'm trying tom customize my showgroups page and call some additional profile fields, but i can only seem to show profile field 2 and no others, in the showgroups php file i found this code:

PHP Code:

// 2 is the default location field and the one we always use in the template
$show['locationfield'] = $db->query_first("
 SELECT profilefieldid
 FROM " 
TABLE_PREFIX "profilefield
 WHERE profilefieldid = 2
"
); 

this is what i think might be causeing the problem, i used this code to call the profile fields in the showgroups template with no success:

Code:

      <if condition="$user['field18']">
      <div> Tell Us More:<br />
          $user[field18]
        </div>
      </if>

could anyone help me put these profile fields in the showgroups page

any help would be appreciated

Lynne 04-03-2009 09:31 PM

use the showgroups_start hook to add in the userfields that you want to grab. SEe if that works.

tipoboy 04-03-2009 09:39 PM

Quote:

Originally Posted by Lynne (Post 1783341)
use the showgroups_start hook to add in the userfields that you want to grab. SEe if that works.

thanks for the reply lynne could you possibly explain how i would do that?

Lynne 04-03-2009 09:42 PM

Actually, I just looked and even though the hook is right above the query, it doesn't allow you to add any variables into the query. So, I think you'll have to add them manually - ie. add ",userfield.field18" into the select statement.

tipoboy 04-03-2009 09:49 PM

Quote:

Originally Posted by Lynne (Post 1783350)
Actually, I just looked and even though the hook is right above the query, it doesn't allow you to add any variables into the query. So, I think you'll have to add them manually - ie. add ",userfield.field18" into the select statement.

thanks again for the reply, buit now i'm lost i'm not great with customizing like that, is there an article you could point me in the direction of or give me a quick walk through of how to do it,

i'd very much appreciate if you could

thanks again

Lynne 04-03-2009 10:40 PM

I don't know of an article about adding to queries. You can see what a select statement is like by looking at the mysql documentation. But, just look at the query in that page around line 99 (or 168 if it's for the moderators). You'll see all this stuff like "select this, that, theother" and you just need to add the other field to it before the FROM part. You'll really just want to play with it a bit. I think what I'm suggesting will work, but since I've never tried to add the fields to my usergroups list, I really don't know.

tipoboy 04-04-2009 09:12 AM

Quote:

Originally Posted by Lynne (Post 1783372)
I don't know of an article about adding to queries. You can see what a select statement is like by looking at the mysql documentation. But, just look at the query in that page around line 99 (or 168 if it's for the moderators). You'll see all this stuff like "select this, that, theother" and you just need to add the other field to it before the FROM part. You'll really just want to play with it a bit. I think what I'm suggesting will work, but since I've never tried to add the fields to my usergroups list, I really don't know.

an update, i remember doing the same thing in vb 3.6.8 and not having a problem, so i used the old showgroups php file and it worked, does anyone know, why it would work in 3.6.8 but not 3.8.2??

any help is again appreciated

Lynne 04-04-2009 02:48 PM

Quote:

Originally Posted by tipoboy (Post 1783577)
an update, i remember doing the same thing in vb 3.6.8 and not having a problem, so i used the old showgroups php file and it worked, does anyone know, why it would work in 3.6.8 but not 3.8.2??

any help is again appreciated

You'd have to compare the queries to see why it is no longer working. I seem to recall looking at some of the queries and it used to be they would select user.* and now they are only selecting the specific user.whatever fields they need. This is better for memory and probably better practice.

tipoboy 04-04-2009 04:08 PM

i have no idea about php(even though i wouldn't like learning but from what i can determine this is the difference,

showgroups.php 3.8.2:
PHP Code:

// 2 is the default location field and the one we always use in the template
$show['locationfield'] = $db->query_first("
 SELECT profilefieldid
 FROM " 
TABLE_PREFIX "profilefield
 WHERE profilefieldid = 2
"
);
$show['contactinfo'] = (bool)$vbulletin->userinfo['userid'];
function 
process_showgroups_userinfo($user)
{
 global 
$vbulletin$permissions$stylevar$show;
 
$user array_merge($userconvert_bits_to_array($user['options'], $vbulletin->bf_misc_useroptions));
 
$user array_merge($userconvert_bits_to_array($user['adminoptions'], $vbulletin->bf_misc_adminoptions));
 
cache_permissions($userfalse);
 
fetch_online_status($usertrue);
 if ((!
$user['invisible'] OR $permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']))
 {
  
$user['lastonline'] = vbdate($vbulletin->options['dateformat'], $user['lastactivity'], 1);
 }
 else
 {
  
$user['lastonline'] = '&nbsp;';
 }
 
fetch_musername($user);
 return 
$user;


3.6.8 showgroups.php:
PHP Code:

$show['locationfield'] = false;
function 
process_showgroups_userinfo($user)
{
 global 
$vbulletin$permissions$stylevar$show;
 
$post =& $user;
 
$datecut TIMENOW $vbulletin->options['cookietimeout'];
 require_once(
DIR '/includes/functions_bigthree.php');
 
fetch_online_status($usertrue);
 if ((!
$user['invisible'] OR $permissions['genericpermissions'] & $vbulletin->bf_ugp_genericpermissions['canseehidden']))
 {
  
$user['lastonline'] = vbdate($vbulletin->options['dateformat'], $user['lastactivity'], 1);
 }
 else
 {
  
$user['lastonline'] = '&nbsp;';
 }
 
fetch_musername($user);
 return 
$user;


could someone who knows about php tell me what the differnece is,

it wold maybe help me understand things a bit better :D

thanks again for the help so far


All times are GMT. The time now is 03:15 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.01098 seconds
  • Memory Usage 1,760KB
  • 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
  • (3)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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