![]() |
Plugin on fetch_musername
I have a plugin running on the fetch_musername hook that changes the username mark-up depending on a selection in their profile.
The plugin is: PHP Code:
Has anyone got any ideas how to fix this? I'd take a guess that it's because I'm using the $user variable, that isn't globally available... so perhaps I would have to change the conditional too... Would I have to declare the $post['fieldX'] and $bbuserinfo['fieldX'] in there too? EDIT: I tried this code too, and it failed to work: PHP Code:
Bump. Sorry guys, this is something I've been looking at for ages and I can't debug it :( |
$bbuserinfo is global so it should work anywhere... My guess is in the locations it's not working is because the hook isn't called.
|
I've got debug mode on and the hook is called on Forumdisplay and on visitor messages and there's still no change.
I can't use bbuserinfo in the condition because I need to use $user to grab the profile field. |
$bbuserinfo['filedX'] should pull the profile field X for that user.
|
I removed the conditional, leaving my code as:
PHP Code:
If the $bbuserinfo variable worked, it should work on the switch, yet it doesn't. :( |
Sorry, I didn't see you tried $bbuserinfo first. :( I wish there was a list of variables and where they are available someplace.
|
Yeah, the debug mode should list the variables being called on that page.
|
Bump (again).
I'm baffled by this one, can anyone else share an insight. The hook is being called on all of the pages that I require. |
Which username on a page like for example forumdisplay would not show?
|
The username of the user who filled the condition ($user['displaygroupid'] == 40).
I thought I had covered all options by using $post, $user, $bbuserinfo - apparently not! |
On the forumdisplay page there are many usernames shown. Some will use fetch_musername, and some are just displayed without any markup:
- "Welcome <username>" in the header: no markup - Threadstarter: markup - Last poster of thread: no markup - Currently active users: markup |
I realise that thread authors don't actually show with markup, but the currently active users, what's going on and other pages should change their mark-up based on this hook - and they don't.
|
The issue is most likely that field14 is not being pulled from that database in the sections not displaying markup correctly. For instance, why would the currently active users need to pull custom userfields?
You'll probably have to edit the query on index.php to get the field. |
Hmm, would I be able to run the query on the hook?
|
*looks at file*
Not the fetch_musername hook but a hook: forumhome_loggedinuser_query ; this of course will only solve the Who's Online markup. You'll have to search for the other queries and see if they have hooks available too. |
All times are GMT. The time now is 10:36 PM. |
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:
|