MyBB Community Forums

Full Version: How hard would it be?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hey everyone! I plan on getting a CMS that I can modify to how I want it. My question is how hard would it be to integrate it with MyBB?

I can do that login,latest threads and some stats... But what about placing a welcome box on the page, like:
Welcome back, Joe114. You last visited: Today, 03:35 AM (User CP — Log Out)
Open Buddy List
View New Posts | View Today's Posts | Private Messages (New 0, Unread 0, Total 0)


Also, should I wait till 1.4? I know some things are going to change and I wouldnt want to have a site with alot of errors when I upgrade to 1.4.

edit:

I left out something...

I would also like to make users log in through MyBB before viewing a page I have on the site, this should be possible right?
If you include the MyBB global file into your CMS, all the data you want can be accessed through that.

Checking for a user being logged in is also very simple, this post can provide you with more information.
It's quite simple. Call to mybb:
EXAMPLE:
<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);
require "./global.php";

eval("\$Example page = \"".$templates->get("Example page")."\";");
output_page($iExample Page);
?>

In the code Above where "example page" is listed. Replace the words "example page" with the name of the page you have located in the mybb template set. For example I want to call the headerinclude file the code will look like this:
<?php
define("IN_MYBB", 1);
define("NO_ONLINE", 1);
require "./global.php";

eval("\$headerinclude = \"".$templates->get("headerinclude")."\";");
output_page($headerinclude);
?>

Create the page you want in the mybb template set and do as I said above.
Kind Regards.
Thanks, will try this later Big Grin
Ok, I hope this thread isn't too old. The custom pages and all work fine, but is it sopposed to make the user log in? I want it so it forces anyone who tries to view the page to log in if they arent logged in already, thanks Smile
Anybody?
if($mybb->user['username'] == "")
{
// Ask them to log in
}
else
{
// Show them the page
}
Thanks MrDoom, it works but can I make it so it shows the default MyBB login?
Ok, I pretty much have everything figured out now except for one thing. How would I add the logout link on my main page?
// Get the users sid for their uid
$query = $db->simple_select(TABLE_PREFIX."sessions", "sid", "uid = '".$mybb->user['uid']."'");
$sid = $db->fetch_field($query, "sid");

echo("<a href=\"forumurl/member.php?action=logout&amp;uid=".$mybb->user['uid']."&amp;sid=".$sid."\">Logout</a>)");
Pages: 1 2