the only problem is, it comes out normal, but the login form doesn't work :/
it's looking for
root directory/member.php
rather than
root directory/forums/member.php
how do i change that?
In
Admin CP --> Templates --> Modify/Delete --> *expand your template set* --> Error Message Templates --> error_nopermission, find:
<form action="member.php" method="post">
Replace with:
<form action="{$mybb->settings['bburl']}/member.php" method="post">
thanks for the swift reply dennis!
i also had to do it for the register/lost password links below
cheers.
i may share my
ALTERNATIVE setup for all the pages
<?php $olddirectory = getcwd();
define("IN_MYBB", 1);
chdir('/www/htdocs/000xxx000/forum'); // path to MyBB
require_once ("/www/htdocs/000xxx000/forum/global.php");
chdir ($olddirectory);
?>
this is the only way it works for me.
- even if i require_once the global.php with an absolute path, mybb will still spill out an error that it cannot find this and that :ß
- the only solution to that problem is that i actually change the working directory to the forum path, everytime i call the global.php :ß
- and because my other (superior) php scripts want to work correctly, i use a temporary folder change, and after the global.php is called, i return to my "old" path...
I want to make a logout form, but I have a little problem
Part of code:
<?php
if($mybb->user['uid'])
{
// The user is logged in, Display the User Menu
echo "Welcome, ".$mybb->user['username'].".<br>
<a href='/forum/usercp.php'>Profile</a><br>
<a href='/forum/private.php'>Private</a></br>
<form action='forum/member.php?uid=$mybbuser[uid]' method='post'>
<input type='hidden' name='action' value='logout'>
<input type='hidden' name='url' value='/index.php' />
<input type='image' src='images/logout.gif' name='submit' value='Logout' /></form><br>";
}
When I press on logout image, me throws on this url:
/forum/member.php?uid=
...and i still logged on;
But when I'm using forum logout form, me throws on this:
/forum/member.php?action=logout&logoutkey=061715d36357c26d2a0de0a8b0d1c551
Mevrael Wrote:I want to make a logout form, but I have a little problem
Part of code:
<?php
if($mybb->user['uid'])
{
// The user is logged in, Display the User Menu
echo "Welcome, ".$mybb->user['username'].".<br>
<a href='/forum/usercp.php'>Profile</a><br>
<a href='/forum/private.php'>Private</a></br>
<form action='forum/member.php?uid=$mybbuser[uid]' method='post'>
<input type='hidden' name='action' value='logout'>
<input type='hidden' name='url' value='/index.php' />
<input type='image' src='images/logout.gif' name='submit' value='Logout' /></form><br>";
}
When I press on logout image, me throws on this url:
/forum/member.php?uid=
...and i still logged on;
But when I'm using forum logout form, me throws on this:
/forum/member.php?action=logout&logoutkey=061715d36357c26d2a0de0a8b0d1c551
allow me to help:
change:
forum/member.php?uid=$mybbuser[uid]
to
{$mybb->settings['bburl']}/member.php?action=logout&logoutkey={$mybb->user['logoutkey']
that'll work
Thanks, did it with this code:
<form action='forum/member.php?action=logout&logoutkey=".$mybb->user['logoutkey']."' method='post'>
But when I'm doing logout me throws to forum/index.php not sites main page
Mevrael Wrote:Thanks, did it with this code:
<form action='forum/member.php?action=logout&logoutkey=".$mybb->user['logoutkey']."' method='post'>
But when I'm doing logout me throws to forum/index.php not sites main page
i have the same problem, sadly, i'm still trying to figure that out.
probably with a bit of editing on the member.php page you could do it
I'm also planning to integrate mybb inside another php script made by me, but besides that login form, I'd also like to make it that every time someone registers on the forums, a certain action to be done in another table of the database.
I've been looking trough the member.php code, but I find it quite difficult to spot the exact portion of the code where I should insert those new sql queries.