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
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 Wink

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 Toungue

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 Toungue

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&amp;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 Toungue
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 Toungue

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 Wink
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.
thankyou Wink
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