Creating a add-on to insert tabs in profile page (using hooks)

Creating a add-on to insert tabs in profile page (using hooks)

Fuhrmann

Well-known member
Fuhrmann submitted a new resource:

Creating a add-on to insert tabs in profile page (using hooks) (version 1.0) - This tutorial will teach you how to insert new tabs in the profile page using the templates hooks.

This tutorial will teach you how to insert new tabs in the profile page using the templates hooks. You can see a more detailed explanation here: http://xenforo.com/community/threads/how-to-use-template-hooks.13167/

Step 1 - First of all

You have to make sure that your XenForo is in debug mode. To do this, open your config.php (yourForum/library/config.php) and put this line into:

Code:
$config['debug'] = true;

Save it. Close. Go to your AdminCP...

Read more about this resource...
 
Fuhrmann updated Creating a add-on to insert tabs in profile page (using hooks) with a new update entry:

Creating a add-on to insert tabs in profile page (using hooks) - Part2

Learn more about conditionals in here: http://xenforo.com/community/threads/frequently-asked-questions.5183/#post-182355

You have to read the first part to understand the second.

Some codes of this tutorial I have taken of this addon on. (BTW, its a great addon, i always use)
http://xenforo.com/community/threads/product-xenfans-com-extra-debug.19504/

--------

Ok, so what's up now?

Since we finished our first tutorial we now have a simple tab heading and his...

Read the rest of this update entry...
 
Fuhrmann updated Creating a add-on to insert tabs in profile page (using hooks) with a new update entry:

Creating a add-on to insert tabs in profile page (using hooks) - Part 3

In this part we'll be making something more complex. We will be using more PHP code and go throug the XenForo's code.

So before we start, i really recomend you guys to use some IDE for programming in PHP. There is a tutorial made by Kier and you can see it HERE

So, your PHP EDITOR (or something) is ready? Let's go then.

Step 1 - Defining our mission

Remember...

Read the rest of this update entry...
 
Fuhrmann updated Creating a add-on to insert tabs in profile page (using hooks) with a new update entry:

Creating a add-on to insert tabs in profile page (using hooks) - Part 4

Hey guys! DaveL just give me some tips about the next part:

Also, I dont know if you planned to create any more tutorials, but another interesting one based on the profile tab with the permissions you went through would be a "member notes" kind of add on.
Usergroups with permissions (admins/mods) can only see the tab on users profiles. Each tab has a text input box similar to that of the "profile posts" tab. Admins/Mods could then post a note which would only show to other Admins/Mods...

Read the rest of this update entry...
 
Fuhrmann updated Creating a add-on to insert tabs in profile page (using hooks) with a new update entry:

Creating a add-on to insert tabs in profile page (using hooks) - Part 5

Step 11 - Creating the Model

As explained in the PART 3 of this tutorial:

Fuhrmann said:
Model: In this layer are defined rules of access and manipulation of data, which often stored in databases or files, but nothing indicates that serve accommodation only for persistent data. Can be used for data in volatile memory, eg RAM, although such use does not happen very often. All rules related to treatment, obtaining and validating data must be implemented in this...

Read the rest of this update entry...
 
Thanks for this tutorial.

Is the addon itself available as an installable ZIP? Apologies if I've missed something obvious.

-- hugh
 
Yup, I realize it's just an example, but it would be very helpful to have the actual complete code available as an installable addon, as it'd make it much easier to grok some of the finer points if I could actually step through the code in xdebug, etc. and not have to rely on me having copied and pasted all the separate chunks into the right place from all 5 of the tutorials.

But thanks for the pointer to the Profile Tab Manager, it may give me the understanding I need.

Basically, I'm needing to create my own little addon, for displaying some user specific data in an extra tab. The data is links to customer's sites, with backend logins, so support staff can easily login to their sites to provide hands on support. The table is on a separate database connection.

So this tutorial gives me about 80% of what I need.

-- hugh
 
OK, looks like I can do pretty much what I need with the Profile Tab Manager, so that'll do as a quick and dirty solution for my needs. But I'd still like to create my own "from scratch" addon to do it, just for giggles. And getting my XF dev chops going. Just migrated from vB, and have a few mods I need to re-implement on XF for my main site.

-- hugh
 
OK, looks like I can do pretty much what I need with the Profile Tab Manager, so that'll do as a quick and dirty solution for my needs. But I'd still like to create my own "from scratch" addon to do it, just for giggles. And getting my XF dev chops going. Just migrated from vB, and have a few mods I need to re-implement on XF for my main site.

-- hugh
Just wondering, what mods do you need to reimplement on xf?
 
Once this is done on a local machine, what are the steps to package this up for distribution on the XF resource manager? Does an install routine need to be written?
 
Do you add any tables to the database or modify any pre-existing tables? If not, you really only need to export the add-on file, create a .zip file of that + add-on files and upload it.
 
Just me or does Part 3 not work on this?

  • The following error occurred:
    The controller XenForo_ControllerPublic_Member does not define an action called Userslike.
 
I think this tutorial is deprecated, since this can now be done much easier with just 2 template modifications.
 
Nonetheless you should no longer use hooks for anything. Because they are deprecated in XenForo.
 
  • Like
Reactions: Xon
Top Bottom