The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to recall an additional profile field in template other than postbit?
I have an additional profile field "12" that I'm using in the post bit just fine with this code:
Code:
{vb:raw post.field12} The code above will not work in the other templates, what do I need to do to be able to call up this info? Edit: I believe the issue may be in linking the thread to the user field - linking [userid] to [postuserid]. I could be wrong. |
#2
|
|||
|
|||
Quote:
In the case of the threads displayed in forumdisplay, you could use a plugin on hook forumdisplay_query to add a JOIN of the userfield table to get field12, but you can only do it for either the thread starter or the last poster (since I believe you can only JOIN each table once). Otherwise you'd need to do separate queries which isn't difficult, but will add one query per thread displayed (or per user, if you figure out a way to cache the results). For forumhome, same issue except I believe the information comes from the forum cache (so I don't think there's a hook to do a JOIN like in the forumdisplay case). |
Благодарность от: | ||
CAG CheechDogg |
#3
|
||||
|
||||
Thanks for that.
Still a little on the novice side with vB so a couple questions on your answer. The linking of the thread starter to field12 will definitely work in my case. I just need the field12 information for threads which are in forums that actually don't allow additional posts (so the thread starter and last poster will be the same in all instances too). I do understand selecting the hook location for the plugin but have no clue what the actual plugin code would be to do a JOIN between the user-field12 and thread-postuserid. Thanks for pointing me in the right direction. |
#4
|
|||
|
|||
You'd do something like this, using hook forumdisplay_query:
Code:
$hook_query_fields .= ', userfield.field12 '; $hook_query_joins .= ' LEFT JOIN ' . TABLE_PREFIX . 'userfield AS userfield ON (userfield.userid = thread.postuserid) '; Hopefully that will do it for you. Edit: Then of course you'd probably use {vb:raw thread.field12} in the template. |
Благодарность от: | ||
bzcomputers |
#5
|
||||
|
||||
Thanks again kh99 - got it working perfectly with your help.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|