vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Custom User Profile Field in My Template (https://vborg.vbsupport.ru/showthread.php?t=223978)

yotsume 09-26-2009 07:20 AM

Custom User Profile Field in My Template
 
1 Attachment(s)
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>


Lynne 09-26-2009 03:58 PM

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.

yotsume 09-26-2009 05:29 PM

Quote:

Originally Posted by Lynne (Post 1890889)
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...

Lynne 09-26-2009 07:04 PM

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.

yotsume 09-27-2009 03:27 AM

Quote:

Originally Posted by Lynne (Post 1890992)
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

Lynne 09-27-2009 03:47 AM

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.

yotsume 09-27-2009 04:05 AM

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.

Lynne 09-27-2009 04:17 AM

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.

yotsume 09-27-2009 04:23 AM

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.

Lynne 09-27-2009 04:31 AM

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).


All times are GMT. The time now is 11:54 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.01143 seconds
  • Memory Usage 1,742KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete