Hi guys.
Here I show you how to reply a news powered by CuteNews in your site with a MyBB user.
You have to go to your cutenews directory and then go to "core" dir and edit file "core.php".
At line 2132 you have this:
change it with:
Then in the page where you want to show news you have to add this before include news file:
If that doesn't work you have to change cookie path to "/"
P.S: Sorry for the bad english
Here I show you how to reply a news powered by CuteNews in your site with a MyBB user.
You have to go to your cutenews directory and then go to "core" dir and edit file "core.php".
At line 2132 you have this:
function member_get()
{
// Not authorized
if (empty($_SESSION['user']))
{
return NULL;
}
// No in cache
if ($member = mcache_get('#member'))
{
return $member;
}
mcache_set('#member', $user = db_user_by_name($_SESSION['user']));
}
change it with:
function member_get()
{
global $mybb;
if(defined("IN_MYBB")) {
$_SESSION['user'] = $mybb->user['username'];
$member = mcache_get('#member');
mcache_set('#member', $member = db_user_by_name($_SESSION['user']));
if($mybb->user['uid']) {
$member['id'] = $mybb->user['uid'];
$member['name'] = $mybb->user['username'];
$member['email'] = $mybb->user['email'];
$member['acl'] = 1;
}
return $member;
}
else {
// Not authorized
if (empty($_SESSION['user']))
{
return NULL;
}
// No in cache
if ($member = mcache_get('#member'))
{
return $member;
}
mcache_set('#member', $user = db_user_by_name($_SESSION['user']));
return $user;
}
}
Then in the page where you want to show news you have to add this before include news file:
define("IN_MYBB", 1);
include("global.php");
If that doesn't work you have to change cookie path to "/"
P.S: Sorry for the bad english