PDA

View Full Version : Custom Profile Fields on Custom Page


deadlySniper
05-09-2012, 09:42 PM
I am looking into making my own roster page. I know how to make the vBulletin powered pages thanks to a great article I read on here. The issues I am having on trying to complete it, is trying to pull usernames and custom fields into the tables. I have in use already the show roster plugin, but I cant install two of them. So I decided to just make my own.

I have tried using
<vb:if condition="$post['fieldx']"><dt>IGN</dt> <dd>{vb:raw post.fieldx}</dd></vb:if>

In a custom vb page but nothing shows up. I did change the X to its corresponding field.

kh99
05-10-2012, 11:50 AM
You can't use $post on your custom page unless you include a query that reads data into $post.

You might want to take a look at memberlist.php, it's a little complicated but it displays a list of members along with various user fields, depending on how the options are set (each custom field has a "show in member list" setting, and in the main admincp settings there's an option for which fields to display).

deadlySniper
05-10-2012, 05:56 PM
Is there anyway for the php file associated with the template to pull in the info for members?

kh99
05-10-2012, 06:06 PM
Do you mean the php file you're writing from scratch? Then yes, you can pull in the information by doing a database query. You'd query the user table and add a "join" for the userfield (and maybe others depending on what info you want to display). The reason I mentioned looking at memberlist is because it basically does the same thing so it has a query similar to what you'd need.

deadlySniper
05-11-2012, 02:18 AM
I used this tutorial. Which you make a php file for that custom page - https://vborg.vbsupport.ru/showthread.php?t=228112