Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-03-2009, 09:17 PM
tipoboy's Avatar
tipoboy tipoboy is offline
 
Join Date: Dec 2005
Location: scotland
Posts: 693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 04-03-2009, 09:31 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

use the showgroups_start hook to add in the userfields that you want to grab. SEe if that works.
Reply With Quote
  #3  
Old 04-03-2009, 09:39 PM
tipoboy's Avatar
tipoboy tipoboy is offline
 
Join Date: Dec 2005
Location: scotland
Posts: 693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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?
Reply With Quote
  #4  
Old 04-03-2009, 09:42 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 04-03-2009, 09:49 PM
tipoboy's Avatar
tipoboy tipoboy is offline
 
Join Date: Dec 2005
Location: scotland
Posts: 693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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
Reply With Quote
  #6  
Old 04-03-2009, 10:40 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 04-04-2009, 09:12 AM
tipoboy's Avatar
tipoboy tipoboy is offline
 
Join Date: Dec 2005
Location: scotland
Posts: 693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
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
Reply With Quote
  #8  
Old 04-04-2009, 02:48 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by tipoboy View Post
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.
Reply With Quote
  #9  
Old 04-04-2009, 04:08 PM
tipoboy's Avatar
tipoboy tipoboy is offline
 
Join Date: Dec 2005
Location: scotland
Posts: 693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

thanks again for the help so far
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:40 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.02347 seconds
  • Memory Usage 2,275KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete