2015-03-21, 07:35 PM
2015-03-21, 08:01 PM
In your PHP file put this at the beginning:
After that, use $mybb->user['username'] and $mybb->user['postnum'].
define("IN_MYBB", 1);
require_once "global.php"; // Change this if the page is not in the same directory as forum.
After that, use $mybb->user['username'] and $mybb->user['postnum'].
2015-03-21, 08:04 PM
Okay thanks a lot! However, I am not familiar with the OOP version of PHP. WOuld $mybb->user['username'] equate to $mybb = user['username']?
Anyone know?
Anyone know?
2015-03-21, 10:51 PM
(2015-03-21, 08:04 PM)MystByte Wrote: [ -> ]WOuld $mybb->user['username'] equate to $mybb = user['username']?
No. user is an array that's part of the $mybb object and you shouldn't change it (why would you do that anyways?).
2015-03-21, 10:55 PM
(2015-03-21, 10:51 PM)Destroy666 Wrote: [ -> ](2015-03-21, 08:04 PM)MystByte Wrote: [ -> ]WOuld $mybb->user['username'] equate to $mybb = user['username']?
No. user is an array that's part of the $mybb object and you shouldn't change it (why would you do that anyways?).
So how would I write what dragonexpert wrote?
The way he wrote the code is weird... COuld someone translate that to regular PHP?
2015-03-22, 04:47 AM
Signed in use'rs data, username and post count
You can see all variables available as follows
<?php
define("IN_MYBB", 1);
require_once "global.php";
echo $mybb->user['username'];
echo $mybb->user['postnum'];
You can see all variables available as follows
<?php
define("IN_MYBB", 1);
require_once "global.php";
echo '<pre />';
print_r($mybb->user);
2015-03-22, 01:31 PM
Ahh whatever. Thanks
For some reason, this doesn't echo the user's username:
Never mind I fixed it. I had to move my program into the forum directory.
For some reason, this doesn't echo the user's username:
if(isset($mybb->user['username'])){
echo 'Welcome to the Trade Federation, ' . $mybb->user['username'];
}
Never mind I fixed it. I had to move my program into the forum directory.