View Full Version : userid for posts/attachments
mangus580
08-23-2009, 02:15 AM
Ok, I am trying to take a watermark modification that creates a watermark on the hook of attachment_display. The mod works fine the way it is, but I would like to add the posting username to the watermark on the fly. On our previous forum, I was able to write the code so it did it upon upload. Due to technical (security) reasons it messes up the image doing it this way... so I figured doing it upon view will work.
Here is my issue. I need the way to pull the userid variable for the post... so that I can create the watermark for that user. I have tried everything I can think of, and nothing yet has worked.
What would the variable be for this???
Lynne
08-23-2009, 03:36 AM
The name of the variable depends on what hook location you are using (which you didn't state). You should find the hook in the php pages and look at the variable names called around it.
mangus580
08-23-2009, 03:00 PM
I did state the hook name: attachement_display
Lynne
08-23-2009, 03:32 PM
Ah, it sounded like you were modifying it and moving it to another hook location.
If you find the hook in the code (make sure you spell it correctly :) ), you'll see that they make reference to $attachmentinfo['userid']. Is that the userid you were looking for?
mangus580
08-23-2009, 05:37 PM
I believe so... I will try it :-)
--------------- Added 1251052965 at 1251052965 ---------------
AWESOME!! That did the trick...
THANK YOU VERY MUCH!
--------------- Added 1251062725 at 1251062725 ---------------
Couple more questions...
What file did you find this info in? (not sure where to find hooks in the code :-) )
Also, would the username be $attachmentinfo['username'] ??
--------------- Added 1251069745 at 1251069745 ---------------
Also... maybe the date the post was created (or attachment was created)
--------------- Added 1251085631 at 1251085631 ---------------
Ok.... I found there is no username listed (also found the date....)
I will start a new thread on a quick way to obtain the username from userid.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.