Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-07-2011, 12:38 PM
Last7Studios Last7Studios is offline
 
Join Date: Feb 2011
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Adding Custom Userfield Data to Any page

I am trying to modify the main forum page in a way that will allow me to display information from a custom field in the users profile on the main forum of the site.

This is from a random Modification that I have installed on the homepage, I need to be able to pull the bolded, underlined information to any page and I am not sure how to do this. I have gotten it working in the postbit template, but I can't seem to get it working on the homepage of the site seeing that the profile "fields" aren't present or being called anywhere on the page.

Any assistance would be greatly appreciated.


Code:
<vb:if condition="$show['mgc_cb_evo_username_column']">
    <span class="{vb:raw fontclass}">
        <vb:if condition="!$anonymous">
            <vb:if condition="$show['mgc_cb_evo_pm_tabs']">
                 {vb:raw username_prefix}<a style="text-decoration: none" href="#" onclick="return mgc_cb_evo_open_pm_tab({vb:raw user.userid},'{vb:raw user.raw_username_secured}');">{vb:raw user.username}</a>&nbsp;
            <vb:else />
                {vb:raw username.field5} <a style="text-decoration: none" href="{vb:raw vboptions.bburl}/member.php?{vb:raw session.sessionurl}u={vb:raw user.userid}">{vb:raw user.username}</a>&nbsp;
            </vb:if>
        <vb:else />
            {vb:raw username_prefix}{vb:raw user.username}&nbsp;
        </vb:if>
    </span>
</vb:if>
Reply With Quote
  #2  
Old 04-07-2011, 03:58 PM
Oracle simsim Oracle simsim is offline
 
Join Date: Dec 2009
Location: Iraq
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you should add a plugin in the proper place to query the values of those fields and register them in forumhome template so you can use them in it
Reply With Quote
  #3  
Old 04-07-2011, 04:09 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you are wanting filed5 from the user viewing the page, then you need to use the variable bbuserinfo, not just userinfo.

user is also not a valid variable, and perhaps you want bbuserinfo there also. You will need to look at that modification and see exactly what variables it is you want to display and change the variable names to be appropriate for that page.
Reply With Quote
  #4  
Old 04-07-2011, 07:29 PM
Last7Studios Last7Studios is offline
 
Join Date: Feb 2011
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How would I go about adding the variable, to the forumhome Template? I think that is the best place to start..
Reply With Quote
  #5  
Old 04-08-2011, 02:42 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought you were saying that you added the code in the first post - that has the variables in it - {vb:raw bbuserinfo.field5}
Reply With Quote
  #6  
Old 04-08-2011, 02:53 AM
Last7Studios Last7Studios is offline
 
Join Date: Feb 2011
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did add that to the code, but it is not functioning.

It works in the postbit but it does not work on the homepage of the forum.

This is difficult to explain.

The forum homepage has no idea what {vb:raw bbuserinfo.field5} is or does, but postbit does, I need to know how to modify the forum home so that it knows where to locate the information that is stored in the database that corresponds to {vb:raw bbuserinfo.field5}
Reply With Quote
  #7  
Old 04-08-2011, 03:47 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just added {vb:raw bbuserinfo.field5} to my FORUMHOME template and it shows up fine. That variable should be available there and in most any template.

Your code in the first post is most likely not showing because you don't have
$show['mgc_cb_evo_username_column'] or $anonymous or $show['mgc_cb_evo_pm_tabs'] defined. You will need to write a plugin to define those values if you plan to use them. That is something we cannot help you with out here, you would need to ask for help in the modification thread and hope someone can help.
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 04:09 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.03933 seconds
  • Memory Usage 2,215KB
  • 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
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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