The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
What is the best method of getting a username when you have the userid?
I am working on a watermark plugin, that uses the hook attachment_display. It seems I can come up with the userid that posted the attachment quite easily, but I am unable to easily turn that into a username which is what I ultimately want. Can anyone suggest anything? Thanks! |
#2
|
||||
|
||||
![]()
If this is a continuation of your attachment mod from another thread, it might have been smart to keep this question in there so users have all the information. In this particular case, you should just JOIN the user table in the attachment query to grab the username at the same time all the other info about the user is grabbed. It looks like the hook to use would be attachment_start. It's always best to take a look at the code around any hook you are using (in this case the attachment_display hook) and see what else is going on (I said that before in regards to finding the userid).
|
#3
|
|||
|
|||
![]()
I started a new tread, as I felt it was a different topic really... sorry :-(
What you describe sounds like an edit to a core file, is this true? I am really trying to avoid that if possible.... |
#4
|
|||
|
|||
![]()
Hooks are used to use custom code without having to edit source files.
Admin CP -> Plugins & Products -> Add New Plugin Product: vBulletin Hook: attachment_start Title: Whatever you like PHP Code: {Your code} Plugin is Active: Yes |
#5
|
||||
|
||||
![]() Quote:
Quote:
PHP Code:
|
#6
|
|||
|
|||
![]()
Got it, THANKS!!
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|