vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   put profile field out in widget (https://vborg.vbsupport.ru/showthread.php?t=232095)

claudib 01-03-2010 10:50 PM

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

Lynne 01-03-2010 11:55 PM

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.

claudib 01-04-2010 09:59 AM

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

Lynne 01-04-2010 02:26 PM

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.

claudib 01-04-2010 02:59 PM

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.


All times are GMT. The time now is 08:51 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.00944 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
  • (1)bbcode_php_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