Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-23-2009, 02:15 AM
mangus580 mangus580 is offline
 
Join Date: Aug 2008
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default userid for posts/attachments

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???
Reply With Quote
  #2  
Old 08-23-2009, 03:36 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 08-23-2009, 03:00 PM
mangus580 mangus580 is offline
 
Join Date: Aug 2008
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did state the hook name: attachement_display
Reply With Quote
  #4  
Old 08-23-2009, 03:32 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #5  
Old 08-23-2009, 05:37 PM
mangus580 mangus580 is offline
 
Join Date: Aug 2008
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe so... I will try it :-)

--------------- Added [DATE]1251052965[/DATE] at [TIME]1251052965[/TIME] ---------------

AWESOME!! That did the trick...

THANK YOU VERY MUCH!

--------------- Added [DATE]1251062725[/DATE] at [TIME]1251062725[/TIME] ---------------

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 [DATE]1251069745[/DATE] at [TIME]1251069745[/TIME] ---------------

Also... maybe the date the post was created (or attachment was created)

--------------- Added [DATE]1251085631[/DATE] at [TIME]1251085631[/TIME] ---------------

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:33 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04308 seconds
  • Memory Usage 2,195KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete