Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
All Variable Solved that are stored in $mybb
#1
Well i am a mybb plugin developer or you can say i am just starter so everytime i need to think about mybb variable but today i solved this. All Variables are front of me..
If you are new and also looking for this then this will be helpful for you, however some variables are still in array but its not necessary for now. i know we can see all variables by using "print_r" but its a headache so use my script for easy access:
Create a php file on root of your mybb (mybb installed url) and then put following code into it:
<?php
define("IN_MYBB", 1);
require_once 'global.php';
echo "<table border='1' width='100%'>";
foreach($mybb as $key => $value)
{
	echo "<tr><td><h3>";
	echo $key;
	echo "</h3>";
	foreach($value as $val => $va)
	{
		echo "<br>".$val;
		echo " : ".$va;
	}
	echo "</td></tr>";
}
echo "</table>";
?>

Hope this will be helpfor you..

[Add me reps if you like] Smile
Reply
#2
I tried this just out of interest. This has the potential to be pretty useful for beginning plugin developers. Very nice. Big Grin
Reply
#3
If you know database fields a lot of syntax becomes second nature.

Ex. $mybb->user['uid'], $mybb->usergroup[permissionname]
Reply
#4
Wouldn't it be nice if that table you are creating was added to the documents section of MyBB so that we don't have to use the script in order to get the details?
Reply
#5
(10-30-2014, 06:48 PM)HolyPhoenix Wrote: Wouldn't it be nice if that table you are creating was added to the documents section of MyBB so that we don't have to use the script in order to get the details?

All tables were printed in the old 1.6 documentation but it hasn't been updated for 1.8 yet.
Reply
#6
Note: your code can produce errors when a variable isn't an array ($mybb->request_method for example) or if it's a multi array ($mybb->bla['bla']['bla']; not sure whether the core have that). Using a recursive function would be better.
Support PMs will be ignored!
Reply
#7
(10-30-2014, 06:59 PM)Destroy666 Wrote:
(10-30-2014, 06:48 PM)HolyPhoenix Wrote: Wouldn't it be nice if that table you are creating was added to the documents section of MyBB so that we don't have to use the script in order to get the details?

All tables were printed in the old 1.6 documentation but it hasn't been updated for 1.8 yet.

where are these tables? any link? 
(for 1.6, i think that there are not big differences for 1.8)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)