![]() |
Custom Variable in Postbit
I want to make a plugin, place a variable in it, and call it in "postbit_legacy". I can't figure out the plugin hook I use. I tried "postbit_display_start" but it didn't work. It actually broke my forum.
Any direction will be appreciated. |
Still trying to figure this out. -_-;
|
More information would be nice ;) For example.... what is the code you are trying to use? What do you mean it broke your forum? What exactly are you trying to do/accomplish?
|
I made a table for a game on my forum. In that table is a score for each user. I want to display that score on the postbit. I can't figure it out.
|
So post the code you have written and let us see where you went wrong.
|
Plugin: postbit_display_start
Code:
$gameuserid = $post['userid']; Template: postbit_legacy Code:
Score: $player_score Gives this error: Fatal error: Call to a member function query() on a non-object in /forums/includes/class_postbit.php(265) : eval()'d code on line 86 |
I've always used postbit_display_complete for adding stuff to the postbit.
You may need to use $this->post instead of $post. Also, aren't you only getting one result? If so, use query_first. https://www.vbulletin.com/docs/html/...ards_sql_query |
Well, I guess what has me confused.. is that if I were to pull out everything in my plugin and change the entire thing to one line of code:
Code:
$variable = $post['userid']; How do I use the information I pull from the table if I do that? Right now, I would have something like: Code:
$player[field] |
Quote:
Code:
global $vbulletin; at the beginning of your code. |
All times are GMT. The time now is 10:04 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:
|