MyBB Community Forums

Full Version: profile field in showteam.php
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

I am trying to add a custom profile field on the showteam.php but I'm not very good with mysql.

I changed the templates correctly and added new space for my custome field.

<tr>
<td width="80%" class="{$bgcolor}"><a href="{$user['profilelink']}"><strong>{$user['username']}</strong></a></td>
<td width="10%" class="{$bgcolor}">{$custompf1}</td>
<td width="10%" class="{$bgcolor}">{$emailcode}</td>
<td width="10%" class="{$bgcolor}">{$pmcode}</td>

</tr>

Now I have to edit showforum.php and add something like this:

$custompf1 = $db->fetch_field($db->simple_select("userfields", I don't know if this is right and what should I add...

Can anyone help with this?

Thanks
What's the name of the custom profile field (database column name) you want to show??
I want data from fid6
Line 73, change this:

$db->simple_select("users", "uid, username, displaygroup, usergroup, ignorelist, hideemail, receivepms",

to this:

$db->simple_select("users", "uid, username, displaygroup, usergroup, ignorelist, hideemail, receivepms, fid6",

Note where I've cut it off, that's only about half of line 73. Then put {$user['fidx']} into the template, see what it does then.
Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1054 - Unknown column 'fid6' in 'field list'
Query:
SELECT uid, username, displaygroup, usergroup, ignorelist, hideemail, receivepms, fid6 FROM mybb_users WHERE displaygroup IN (4,3) OR (displaygroup='0' AND usergroup IN (4,3)) OR uid IN (0) ORDER BY username

I'm sorry I cant' provide a link because I'm working on WAMP.
Oh, yeah that isn't in the users table is it, I always forget that. Guess you will need a new query then, sorry. Gimme a minute or two, I'll edit it in.

OK, replace all of that query on line 73 with this:

$query = $db->query("
	SELECT u.uid, u.username, u.displaygroup, u.usergroup, u.ignorelist, u.hideemail, u.receivepms, uf.fid6
	FROM ".TABLE_PREFIX."users u
	LEFT JOIN ".TABLE_PREFIX."userfields uf ON(u.uid = uf.ufid)
	WHERE u.displaygroup IN ($groups_in) OR (u.displaygroup='0' AND u.usergroup IN ($groups_in)) OR u.uid IN ($users_in)
	ORDER BY u.username
");

Same code for the template, this should work.
It's perfect!

Thanx a lot for your help Matt. Wink

Good night