Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 01-03-2010, 10:50 PM
claudib claudib is offline
 
Join Date: Jan 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default put profile field out in widget

Hi,

How can I put a profile field out in a widget?

I am putting out username etc, but I also want to put out field6 which is a custom field?

Thanks

Claudia
Reply With Quote
  #2  
Old 01-03-2010, 11:55 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What type of widget? Post the code you are currently using and let us know what template it is currently using and if it is a default template.
Reply With Quote
  #3  
Old 01-04-2010, 09:59 AM
claudib claudib is offline
 
Join Date: Jan 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

This is my widget code so far:

PHP Code:
$dateformat "m/d"//Other formats "m/d/Y", "d/m", "d/m/Y"
  
ob_start();
  require_once(
'./includes/functions_user.php');
  require_once(
'./includes/functions_bigthree.php');
  
// Get New Members
  
$newusers_get vB::$db->query_read("
    SELECT * FROM "
.TABLE_PREFIX."user
    WHERE usergroupid=9
   ORDER BY joindate DESC
   LIMIT 5"
);
  
$output_bits '';
  while(
$newuser vB::$db->fetch_array($newusers_get))
  {
        
$joindate date($dateformat$newuser[joindate]);

    
$avatarurl fetch_avatar_url($newuser[userid]);
           if (!
$avatarurl) {
               
$useravatar 'images/misc/avatar.gif';
           } else  {
              
$useravatar $avatarurl[0];
           }

        
$output_bits .= '<img border="0" src="'.$useravatar.'"><br />
<a href="member.php?u='
.$newuser[userid].'">'.$newuser[username].'</a> in {vb:raw post.field6}                       <div style="float: right;">'.$joindate.'</div><br />';
  }
  
$output $output_bits;
  
ob_end_clean(); 
The part - {vb:raw post.field6} - does not work. I've been trying various things to get it to work to no avail.

Thanks
Reply With Quote
  #4  
Old 01-04-2010, 02:26 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Two things.... your query is not getting the profile field - it is in the userfield table. You will have to JOIN with that table in your query in order to get it. Secondly, post is certainly not going to work because that is not the name of your array. Your array name is newuser, so it would be $newuser[field6] once you correct your query.
Reply With Quote
  #5  
Old 01-04-2010, 02:59 PM
claudib claudib is offline
 
Join Date: Jan 2010
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Lynne. I understand the second part. I don't know how to JOIN in my query, but you have given me something to try to investigate further so I can learn how to do it.
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:11 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.03796 seconds
  • Memory Usage 2,199KB
  • Queries Executed 11 (?)
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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_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