Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 25 Sep 2013, 14:55
create365 create365 is offline
 
Join Date: Aug 2013
thread/post info accessing from hook, variable range, pass variable from hook to hook

I wanted to ask on how to complete this, as I've done this in 'ugly' way.

So, in postbit hook, there is $post available. But it doesn't contain forumid and a field from new column (added by me) in thread table - however, it is in $threadinfo variable in showthread_* hooks.

Currently, I'm using postbit_complete hook and a query to get this information. But everytime post is loaded, the query is executed and this isn't really good thing.

I want to avoid this.

So my question is that: how to access $threadinfo (or forumid and a specific field of the thread, the post is in) from postbit_complete level? Or how to pass my values from other hook (showthread_complete for example, where $threadinfo is available), to postbit_complete hook, so I can use it and not query DB for those values?


Thanks for help.
Reply With Quote
  #2  
Old 25 Sep 2013, 15:32
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
You could try putting:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


at the beginning of your postbit_complete hook code.
Reply With Quote
  #3  
Old 25 Sep 2013, 16:21
create365 create365 is offline
 
Join Date: Aug 2013
Yep I know, but isn't there a better way?
Tried saving the things I need in other hook, make it global, but it didn't work.

So if I want to access options, it is normal to put global $vbulletin there, or there is another, nicer way to do that?
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 06:19.

Layout Options | Width: Wide Color: