vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Adding Custom Userfield Data to Any page (https://vborg.vbsupport.ru/showthread.php?t=261594)

Last7Studios 04-07-2011 12:38 PM

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>


Oracle simsim 04-07-2011 03:58 PM

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

Lynne 04-07-2011 04:09 PM

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.

Last7Studios 04-07-2011 07:29 PM

How would I go about adding the variable, to the forumhome Template? I think that is the best place to start..

Lynne 04-08-2011 02:42 AM

I thought you were saying that you added the code in the first post - that has the variables in it - {vb:raw bbuserinfo.field5}

Last7Studios 04-08-2011 02:53 AM

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}

Lynne 04-08-2011 03:47 PM

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.


All times are GMT. The time now is 09:10 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.01123 seconds
  • Memory Usage 1,723KB
  • 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_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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