The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Custom profile field and username on its own page.
I've asked at vb.org, but have not received a response. So, I thought I'd try here.
I want to have a page on my forum that displays only usernames and a ceratin custom profile field. I only want to display the user and profile field if that user has entered something into the field. I know that I would have to do something with this: <if condition="$post[field5]">$post[field5]</if> For example: IF profile field 5 is RPG Name, I want the users to be able to navigate to a page that shows other user's rpg names (and only their Username and RPG name. I don't want all the extra stuff that the memberlist has). I still want the memberlist to show and I have a couple of custom fields I would like to do this with. I just don't know how to get this on it's own page. Not sure if this is a template-only hack, but thought I'd try to find out. Sorry if it shouldn't be posted here. Thanks, Rick |
#2
|
|||
|
|||
You'd have to write a custom query for the database to pull all usernames and the fields and display them on the page. It's definitely NOT a template only hack. It wouldn't be that difficult to do.
You'd need a php page with the query, something like: Code:
$RPG = $DB_site->query("SELECT username, fieldX FROM users, usertextfield ORDER BY username DESC"); Code:
while($row=mysql_fetch_object($RPG)) { $who = $row->username; $rpgname = $row->fieldX; eval('$rpgbit .= "' . fetch_template('RPG_listbit') . '";'); } eval('print_output("' . fetch_template('RPGLIST') . '");'); I don't use table prefixes so the query above doesn't show that, if you have a large number of users you may also need a pagination code in there in order to not display all users on a single page. This is all off the top of my head, untested and without any warranty. This is only to give you an idea of what would be involved. |
#3
|
||||
|
||||
Thanks Scott. That helps a lot actually. I haven't tested it yet, but it definately points me in the right direction of where I need to go with it. If you can think of anything else, please let me know.
Thanks, Rick |
#4
|
|||
|
|||
Glad I could help Rick. The only additional thing I can think of is to match the username with the text field in your query. I left that out before.
More like this: Code:
$RPG = $DB_site->query("SELECT user.userid, user.username, usertextfield.userid, usertextfield.fieldX FROM users, usertextfield WHERE user.userid == usertextfield.userid ORDER BY user.username DESC"); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|