The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Using profile field in forum display
Here's what I'm wanting to do and I realize this might require core modifications possibly.
Currently running: VB 3.5 Stable I have usernames that are generic numbers (ie: R55555). That number corresponds to an employee name. I'm currently storing the users Real Name in a profile field (ie: field5). This obviously works fine in the post bit, but I also want to display the real name in the Last Post information. So on all the forum views, the Last Post By is not the username but actually the profile field. My problem is, figuring out where to do this. Is it a code mod or is there another method that can be used in the new system? Thanks |
#2
|
||||
|
||||
Try
forumdata_presave and threaddata_presave PHP Code:
|
#3
|
|||
|
|||
Thanks Andreas, and sorry for posting that in the wrong section..
I'm assuming this goes in as a plugin, I've added it to as such to both the presave's and enabled the plugin sytem and each plugin is active. Question: How do you now reference this in the template or is it a global thing? It didn't change anything that's why I ask. |
#4
|
||||
|
||||
Well, it only effects new last posts.
Did you make one? |
#5
|
|||
|
|||
Well DUH!! ok yeah, that worked great.
So next question.. anyway to force that to the existing posts? It's got to be stored somewhere I'm guess, I could write something if I knew where that was. Any ideas? or make it update when a post is edited? |
#6
|
||||
|
||||
*** Untested ***
(As well as above code was) Assuming that your database is consistent, you are not using table prefixes and you are running at least mysql 4.0.4 [sql]update forum, user, userfield set forum.lastposter = userfield.field5 where userfield.userid=user.userid and user.username=forum.lastposter[/sql] [sql]update thread, user, userfield set thread.lastposter = userfield.field5 where userfield.userid=user.userid and user.username=thread.lastposter[/sql] |
#7
|
|||
|
|||
Thank you that worked perfectly.
Just a note to anyone that uses this though. If you rebuild the forum and thread information this will obviously get replaced with the standard id's but assuming nothing majors changed, you'd just need a script to run the 2 queries above afterwards. |
#8
|
|||
|
|||
Hm how would you get this to work for first poster? or am i out of my mind
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|