![]() |
Hooks
So I've made a postbit background plugin, which will give certain usergroups a background. It works in my threads, but it's not reading the plugin, or something properly from PM's. I'm guessing it's something with the hook location.
So I'm here to ask what hook location should I use? My current hook location: postbit_display_start |
I think the problem is that $this->post['usergroupid'] is not set if it's a pm (and so you can't use is_member_of(), if that's what you're doing). I don't think there's anything you can do except do a query for it yourself if you're displaying a PM. Maybe something like:
Code:
if (get_class() == 'vB_Postbit_Pm') |
Quote:
So I'm still having a feeling it's something with the hooks. |
Are you using debug mode to view the hooks called on each page and have you verified that the hook you are using is being called on the PM page you are looking at?
|
Quote:
|
Quote:
Code:
if (1==2) Lynne, that's what I think is wrong. The hook location is wrong and is not being called on the page. How can I turn debug mode on to check which hooks --------------- Added [DATE]1351013884[/DATE] at [TIME]1351013884[/TIME] --------------- Okay so I enabled debug mode. postbit_display_start, which is the hook I've been using is enabled in both pages. So I'm still a little confused, I'll try making just something that prints out something to test it. --------------- Added [DATE]1351013967[/DATE] at [TIME]1351013967[/TIME] --------------- Nope, I made it output 'Hello', it works in the threads, but still messes up my PM. Weird.. |
How about you post the exact php code and hook location so we can try it on our own.
|
Plugin hook: postbit_display_start
Code: Code:
ob_start(); Code:
<div class="userinfo"> Code:
{vb:raw postbit_background} |
You can look at the query around line 1611 or private.php and see that the usergroupid is never even grabbed, as Kevin had brought up above. You would need to modify the query to add that in.
|
Quote:
|
All times are GMT. The time now is 04:50 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|