MyBB Community Forums

Full Version: Sessions and the use of the mybb system??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(2012-10-21, 11:39 PM)Spudster Wrote: [ -> ]Thats what i need :.)

How do i create my own welcome your logged in page? but use the mybb sessions?

This would do what you're requesting.

<?php
if ($mybb->user['uid'] != 0) {
echo 'Welcome ', $mybb->user['username'];
} else {
echo 'Please login or register.';
}
?>
Thanks got that working Wink

How do i go about checking if the user is an admin?

(if a user is a forum admin let them display something on the main site)
are you trying to integrate with an existing site or are you starting a new site? my suggestion for a fresh site would be to build around MyBB if at all possible. Custom pages are easy to make and wrap in MyBB and if you just want a nice home page, then use my Portal outside Forum Root tutorial at the site listed in my sig. You can then make whatever template edits you want to make it your own
(2012-10-23, 01:18 PM)Spudster Wrote: [ -> ]Thanks got that working Wink

How do i go about checking if the user is an admin?

(if a user is a forum admin let them display something on the main site)

<?php
$usergroup = $mybb->user['usergroup'];
if ($usergroup == '1') {
//content for admins only
} else if ($usergroup == '5') {
//content for users in group with id 5
}
?>

The above code will check the authenticated userĀ“s usergroup and thereby display content that only are available to a specific user group rather than everyone.
Pages: 1 2