MyBB Community Forums

Full Version: Integrating MyBB into your website. (Login Form)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
darkid Wrote:How do i integrate "last posts" thing to my website? i tried the one at the other guide but this is not work.
this may interest you
blubox Wrote:It works! Yay! I am so happy! THank you so much zaher1988!

The only problem is that I get this error:
Fatal error: Cannot redeclare class session in /home/emerald/public_html/forums/inc/class_session.php on line 13

When I include() the file into my homepage.

I tried to just add the info to my homepage instead of including it, but then I get other errors saying the file cant connect to a database that my homepage uses..

Seems like it is already connected with MyBB.. try to proceed using MyBB functions without any new include.
Well, it works when I add the code to the homepage and not include anything. But i have another script on my homepage that uses a db but it says that the file that the database connection is at doesnt exist.

By the way, Happy Birthday zaher1988!
I need to see the file. Attach it.

Thx btwWink
Is there any way I can e-mail it to you?
I will PM you with my email
I got it to work. I just have one simple question.
For the user to log out would this be the link:?

forum3s/member.php?action=logout&uid=$mybb->user['uid']
Where do I put the first code?
Umm, I have done this once before a long time ago. And I took a break for some time. However, Im unable to get it to work. I have it run at the start of my index file but I get this error.
Quote:Direct initialization of this file is not allowed.

Please make sure IN_MYBB is defined.

Why?
I've also got a problem.

I have this code in my index.php file

<?php

ob_start();

include_once("header.php");

$level = "/forum";// Name of MyBB dir
$redirect = "../index.php";//Keep the ../ change thisfile to the name of this file
define('IN_MYBB', 1);
chdir($level);
require_once("global.php");//don't change. 

include_once("footer.php");

ob_end_flush();

?>

And I get these errors

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/sites/shova.co.uk/public_html/index.php on line 16

Warning: main(global.php) [function.main]: failed to open stream: No such file or directory in /home/sites/shova.co.uk/public_html/index.php on line 17

Fatal error: main() [function.require]: Failed opening required 'global.php' (include_path='.:/usr/share/pear') in /home/sites/shova.co.uk/public_html/index.php on line 17

Does anyone know what the problem is and how to solve?

Thanks.
My bad, fixed it! Smile

$level = "forum";
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48