The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Add profile fields in the stats section (Forumhome)
Hello,
In the forumhome, we have by default a row like that : "Welcome to our new member, [NAME]" I added new custom profile fields and I would like add these after to be more accurate. "Welcome to our new member, [NAME], [Field1] - [Field2] [Field3] - [Field4]" How can I do that modification ? Thank you in advance. Have a nice day, |
#2
|
|||
|
|||
The username and id of the newest user is already available, but the other fields aren't, so you'd have to look them up. You could use a plugin on hook forumhome_complete to look up the fields for the user with id $newuserinfo['userid'], and either add them to the $newuserinfo array or preRegister a new variable to the FORUMHOME template. Then of course you'd need to edit the FORUMHOME template to display the fields.
|
#3
|
|||
|
|||
Ok I understand what you mean but i'm novice in PHP.
Could you help me please ? |
#4
|
|||
|
|||
OK, try this: create a new plugin using hook forumhome_complete and this code:
Code:
if (is_array($newuserinfo)) { $newuserinfo = array_merge($newuserinfo, fetch_userinfo($newuserinfo['newuserid'])); } Then edit the FORUMHOME template and find welcome_to_our_newest_member_x (which is the existing phrase), and add {vb:var newuserinfo.fieldX} (once for each field) where you want to add the new fields. |
#5
|
|||
|
|||
Thank you for your help.
I've done everything but I have the following error in forumhome and the welcome raw in the footer disappears : Code:
Warning: array_merge() [function.array-merge]: Argument #2 is not an array in [path]/forum.php(787) : eval()'d code on line 3 |
#6
|
|||
|
|||
Oh, sorry, I guess it should be
Code:
if (is_array($newuserinfo) AND $newuserinfo['userid'] > 0) { $newuserinfo = array_merge($newuserinfo, fetch_userinfo($newuserinfo['userid'])); } and sorry it took so long to get back to you. |
#7
|
|||
|
|||
Thank you for all your help.
Your new plugin code hasn't error but I can't see my fields. You'll see in the attached files the result. In FORUMHOME, I have put this code : Code:
<p>{vb:rawphrase welcome_to_our_newest_member_x, {vb:link member, {vb:raw newuserinfo}}, {vb:raw newuserinfo.username} {vb:var newuserinfo.field12} {vb:var newuserinfo.field14} {vb:var newuserinfo.field11} {vb:var newuserinfo.field15}}</p> |
#8
|
|||
|
|||
I think the problem is that you have the new fields inside the phrase tag, as phrase parameters. You could actually do that if you wanted, but you'd have to edit the phrase and add {3}, {4}, {5} where you want the new fields to show up.
But the easiest thing to do would just be to move them outside the phrase curly tag like: Code:
<p>{vb:rawphrase welcome_to_our_newest_member_x, {vb:link member, {vb:raw newuserinfo}}, {vb:raw newuserinfo.username}} {vb:var newuserinfo.field12} {vb:var newuserinfo.field14} {vb:var newuserinfo.field11} {vb:var newuserinfo.field15}</p> |
#9
|
|||
|
|||
It works like a charm !
Thank you so much for all your help. Have a nice day. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|