1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

[pfps.com.br]Profile Tab Manager

Discussion in 'Add-on Releases [Archive]' started by Fuhrmann, Oct 22, 2011.

Thread Status:
Not open for further replies.
  1. Fuhrmann

    Fuhrmann Well-Known Member

    Profile Tab Manager 1.0.1

    This add-on will let you create how much tabs you want and show them in the user's profile page.

    XenForo 1.0.4
    XenForo 1.1 Beta 2
    XenForo 1.1

    This is the default create/edit form for tabs:

    Sem título.png

    To create a new tab:

    Go to Applications->Profile Tab Manager->Create New Tab.

    When creating a new tab, you dont need to worry about the template. If you dont get anything in mind, just leave blank. The default template is loaded.

    Sem título2.png

    So, after created a new tab, go to any profile page (which has the permissions that you've set):

    Sem título3.png

    After this, you can customize the template of your tab:

    Sem título4.png

    And the result:

    Sem título5.png

    Ok, but what if we want to send some custom params to our template?

    Ok, this is how i do it:

    Create a new file inside the folder library/ProfileTabManager/Callbacks/ called Test.php. We will make a method to use as callback for our custom field.

    Put this inside:

    class ProfileTabManager_Callbacks_Test extends XenForo_Application
        public static function 
    //Lets get some information about the user who is visiting
    $visitor XenForo_Visitor::getInstance()->toArray();
    //Return the content to our custom field template
    return array('visitor' => $visitor);
    In the menu Applications->Profile Tab Manager->Display All Tabs, click in our tab "My Custom Tab" to edit.

    Fill the information with the class and method callbacks.

    Sem título6.png

    Edit the template to and change to this:

    <li id='__tab__' class='profileContent'>
    Hello {$visitor.username}! You are following {$visitor.followingusers!
    noscript><a href='{xen:link members/__tab__, $user}'>{xen:phrase view}</a></noscript>
    Save it. Go to the profile page and see the result.

    Sem título7.png

    For sure, this is just a example. You can make more than this.

    This is my fourth add-on, so, give a chance. More uptades coming soon, if this works for all.

    Attached Files:

    Sal, 0xym0r0n, Markos and 17 others like this.
  2. Floris

    Floris Guest

    Awesome :)
    Digital Doctor and Fuhrmann like this.
  3. erich37

    erich37 Well-Known Member

    cool stuff !

    - is it possible to position the Tab named "My Custom Tab" at the very left of all tabs? (so before the Tab named "Profile Posts")

    Many thanks!
    Fuhrmann likes this.
  4. Andrej

    Andrej Well-Known Member

    Have you skipped the first post?
    Fuhrmann likes this.
  5. Fuhrmann

    Fuhrmann Well-Known Member

    Not in this version! Maybe the next update!:ROFLMAO:

    And for the first question, as Andrej quoted:

    erich37 likes this.
  6. erich37

    erich37 Well-Known Member

    you guys are faster in "correct-reading" my posts than I am with editing my posts :p
    feels like KGB is following me :D
    EQnoble and Fuhrmann like this.
  7. Andrej

    Andrej Well-Known Member

    It indeed is...
  8. M@rc

    M@rc Well-Known Member

    - don't really have any idea on what to use it for one of my forums, but I'm sure others will, :coffee:
  9. erich37

    erich37 Well-Known Member

    So saying I create a new Tab.

    Is it then possible to put 30 custom Profile-fields into this Tab?
    I mean via the custom-profile-fields function which is in XF 1.1 ?
  10. Fuhrmann

    Fuhrmann Well-Known Member

    Yes. Any ammout of userfields or something that you want. If there is a limitation about numbers of custom profile fields, its about XenForo not in this add-on.
    erich37 likes this.
  11. Brendon Meynell

    Brendon Meynell Active Member

    Wow awesome job. Keep up the good work. Reading through the description I got many ideas in my head of what this could be used for :)
    Fuhrmann likes this.
  12. Morgain

    Morgain Well-Known Member

    Fuhrmann I would like all the tabs to move over to the right a bit perhaps 50px

    I looked in Style Properties and profile.css but I'm sure you know where I can control it.
  13. Fuhrmann

    Fuhrmann Well-Known Member

    You can add into your EXTRA.css this:

    .profilePage .tabs.mainTabs {
    padding: 0 93px !important;
    And see the result. This is what you want? If yes, change the value 93px to match the position that you want.
    Morgain likes this.
  14. Morgain

    Morgain Well-Known Member

    Fuhrmann thank you for the moving tabs help AND the lovely add-on.

    I would like to move the Interact stuff under "Information" into my new Profile Tab.

    Start a Conversation
    I looked in the templates under Profile, and also searched on "Information" and "Interact" but didn't find anything.
    Where do I find that code to delete it under "Information" and put it in the new tab?
    Also in your Profile Tab admin form, in the content box I put "Interact stuff goes here."
    The result is that this text now appears whichever Profile Tab I open.
    This just might be useful for so0mething specialised of course - it appears UNDER whatever is there already if anyone wanted such a thing.
    But what I want is to put some information explaining what the content of this tab is, at the top above the Interact content.
    Over to you and your skill.
  15. high1976

    high1976 Active Member

    <li id='__tab__' class='profileContent'>  </li>
    needs to be around it so it just show up in this particular tab and not in all

    @erich37: adding custom fields is really easy, just use something like:
            <li id='__tab__' class='profileContent'>           
    <div class="section">
                            <h3 class="textHeading">Hardware Specs</h3>
                            <div class="primaryContent">
                                       <div class="pairsColumns aboutPairs">
                                                <dl><xen:if is="{$user.customFields.windows_version}"><dt><b>{xen:helper userFieldTitle, windows_version}: </b></dt> <dd>{$user.customFields.windows_version}</dd></xen:if>
                                                <xen:if is="{$user.customFields.1_tv_card}"><dt><b>{xen:helper userFieldTitle, 1_tv_card}: </b></dt> <dd>{$user.customFields.1_tv_card}</dd></xen:if>
                                                <xen:if is="{$user.customFields.1_tv_card_type}"><dt><b>{xen:helper userFieldTitle, 1_tv_card_type}: </b></dt> <dd>{$user.customFields.1_tv_card_type}</dd></xen:if>
                                                <xen:if is="{$user.customFields.1_tv_card_driver}"><dt><b>{xen:helper userFieldTitle, 1_tv_card_driver}: </b></dt> <dd>{$user.customFields.1_tv_card_driver}</dd></xen:if>
                                                <xen:if is="{$user.customFields.memory}"><dt><b>RAM:</b></dt> <dd> {$user.customFields.memory}</dd></xen:if></dl>
    Morgain and Fuhrmann like this.
  16. Morgain

    Morgain Well-Known Member

    high thank you.

    Now I'm trying to put the code for the Interact section in my new Tab.
    It's normally under the Information tab.

    My selected excerpt from member_view gets a big Internal Server Error!
    I counted all the ifs and divs to see they matched in pairs.

    Template name: profile_interact

    <li id='__tab__' class='profile_interact'> 
    Different ways to connect:<br /><br />
    <xen:if is="{$user.about}">
    <div class="baseHtml ugc">{xen:raw $user.aboutHtml}</div>
    <div class="section">
                <h3 class="textHeading">{xen:phrase interact}</h3>
    <div class="primaryContent">
    <div class="pairsColumns contactInfo">
                <dt>{xen:phrase content}:</dt>
    <xen:hook name="member_view_search_content_types">
                <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
                <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
    <xen:if is="{$canStartConversation}">
                <dl><dt>{xen:phrase conversation}:</dt> <dd><a href="{xen:link 'conversations/add', '', 'to={$user.username}'}">{xen:phrase start_conversation}</a></dd></dl>
    <xen:if is="{$identities}">
    <xen:foreach loop="$identities" value="$identity">
                <dl><dt>{$identity.title}:</dt> <dd>{xen:string censor, $identity.value}</dd></dl>
    <xen:hook name="member_view_tabs_content" params="{xen:array 'user={$user}'}" />
  17. high1976

    high1976 Active Member

    @Fuhrmann: cause i ran into this: "tab_usergroups_id" & "tab_usergroups_exclude_id" may be extended from varchar(50) to something bigger so it even works with several usergroups ;)
    Fuhrmann likes this.
  18. Fuhrmann

    Fuhrmann Well-Known Member

    That's true! Thank you high1976!
  19. high1976

    high1976 Active Member

    urgs...upgrade to beta5 deleted all ptm_*_content and ptm_*_link templates...
  20. Fuhrmann

    Fuhrmann Well-Known Member

    Oh, ********...I try to figure out what I have done wrong.
Thread Status:
Not open for further replies.

Share This Page