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 09-26-2009, 07:20 AM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Custom User Profile Field in My Template

Custom User Profile Field in My Template?

How can I add each member's custom profile fields they have entered in my template below. I need the fields to be their info in the fields and not my info.

I am trying to get this template to look like this:

User Name
Membership Category from Country
(Note the red are the fields I need to pull for each member. I used: $bbuserinfo this however makes all the information my information. How do I code this to be the specific user's custom fields and not mine?) I need the two custom fields to match the new member's fields.

(PLEASE SEE ATTACHED SCREEN SHOT)

Code:
<if condition="$latest_members_count%3 == '1'"><tr></if>
<td class="$bgclass" align="center">

    <if condition="$vboptions[c_news_letter_show_avatar]">
        <img src="$member[avatarurl]" alt="$member[username]'s $vbphrase[avatar]" />
    </if>
    
    <div class="smallfont"><a href="$vboptions[bburl]/member.php?u=$member[userid]">$member[username]</a></div>
$bbuserinfo[field10] from: $bbuserinfo[field24]
</td>
<if condition="$latest_members_count%3 == '0'"></tr></if>
Attached Images
File Type: jpg New Members Custom Profile Fields.jpg (46.7 KB, 0 views)
Reply With Quote
  #2  
Old 09-26-2009, 03:58 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What template are you adding this code to? What does the query look like that grabs this information? That will make a difference on the name of the variable to use.
Reply With Quote
  #3  
Old 09-26-2009, 05:29 PM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
What template are you adding this code to? What does the query look like that grabs this information? That will make a difference on the name of the variable to use.
The template here is not a standard vb template but it is for a custom mod by ProVB called Community Newsletter. I have sent a request to that developer as well... however I needed to ask here as well because I needed an answer in a more timely manner and that coder can often be quite busy.

I am not sure what more I could provide you to help here...
Reply With Quote
  #4  
Old 09-26-2009, 07:04 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need the variable name which is in the code where the query is. And, your query needs to have grabbed the needed fields, and since I don't know the query, I have no idea if the fields are including in the query.
Reply With Quote
  #5  
Old 09-27-2009, 03:27 AM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
I need the variable name which is in the code where the query is. And, your query needs to have grabbed the needed fields, and since I don't know the query, I have no idea if the fields are including in the query.
Ok so where would I find the query to send to you? I do not want to attached the mod here and your not receiving PMs so whats next?

Thanks!

--------------- Added [DATE]1254026413[/DATE] at [TIME]1254026413[/TIME] ---------------

Maybe this will help.

Here is the lite version of this mod. I have a paid for version...

https://vborg.vbsupport.ru/showthrea...ity+newsletter
Reply With Quote
  #6  
Old 09-27-2009, 03:47 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have PMs turned off because even though my sig asks for users to post in the forums for help instead of PMing me, they do it anyway, so it's just easier to leave them off.

All that needs to be known is the query (to see if they grab the fields from the userfield table) and then a couple lines after that where the variable name is used (while ($this == $that.... ) line) so we know the name of the variable.

Have you tried just using the variable name $member for those fields? That would be my guess for the variable name since it is already used in the template.
Reply With Quote
  #7  
Old 09-27-2009, 04:05 AM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is some portion for you... No i dea if its what you need to help:

Code:
    //  Get Members
    $members = $db->query_read("
        SELECT user.email, user.userid, user.username " . iif((!empty($vbulletin->options['c_news_letter_field'])),",userfield." . $vbulletin->options['c_news_letter_field'] . "") . "
        FROM " . TABLE_PREFIX . "user AS user
        " . iif((!empty($vbulletin->options['c_news_letter_field'])),"LEFT JOIN " . TABLE_PREFIX . "userfield AS userfield ON (userfield.userid = user.userid)") . "
        WHERE user.userid >= " . $vbulletin->GPC['startat'] . "     
        " . iif((!empty($vbulletin->options['c_news_letter_field']))," AND (userfield." . $vbulletin->options[c_news_letter_field] . " = '" . $vbulletin->options[c_news_letter_field_yes] . "' OR userfield." . $vbulletin->options[c_news_letter_field] . " = '')") . " 
        " . iif((!empty($vbulletin->GPC['usergroups'])), "AND user.usergroupid IN ('" . implode("','",$c_news_letter_filter_usergroups) . "')") . "
        ORDER BY user.userid ASC
        LIMIT " . $vbulletin->GPC['perpage']
    );
        
    while ($member = $db->fetch_array($members))
Just using: $member[field10] in the template doesn't show anything.
Reply With Quote
  #8  
Old 09-27-2009, 04:17 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, yes, $member is the variable you would use. However, it doesn't look like the userfields are grabbed in the query. So, the query will have to be modified to include the needed fields from that table. Writing queries is not my strong point, so I don't even try to do it on here.
Reply With Quote
  #9  
Old 09-27-2009, 04:23 AM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I am back to square zero and in the hands of the developer. His response time and support is unknown and always he answers what ever he decides to and in parts.

So I payed for a mod that has some bugs and as usual there is little support... HOHUM... I will give him a couple more days and then have to get third party help yet again...

Thanks so much for your time here. It will be nice when I have it all coded and working.
Reply With Quote
  #10  
Old 09-27-2009, 04:31 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It may be that someone else who is good with queries can help out here. I'm just not willing to screw up a query for someone else. It looks like it shouldn't be too hard (it just needs to be rearranged a little cuz the join only happens if another condition is met).
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 01:16 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.04636 seconds
  • Memory Usage 2,284KB
  • Queries Executed 14 (?)
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
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete