![]() |
Integrating MyBB login into website. (Problem) - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: Community Archive (https://community.mybb.com/forum-106.html) +--- Forum: Archived Forums (https://community.mybb.com/forum-143.html) +---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html) +----- Forum: MyBB 1.4 (https://community.mybb.com/forum-80.html) +------ Forum: MyBB 1.4 General Support (https://community.mybb.com/forum-81.html) +------ Thread: Integrating MyBB login into website. (Problem) (/thread-43697.html) Pages:
1
2
|
Integrating MyBB login into website. (Problem) - DChiuch - 2009-01-18 Hi. My website is http://kh13.com/ and my forum is http://kh13.com/mybb/. On the index page, I have placed the following code before any HTML.
Then, where I want the login forum to appear, I have placed this:
I included all relevant CSS and put the following in the <head> tag:
This creates a welcome block identical to the one that is included in my forum. However, when I login at http://kh13.com/ and submit, it redirects me to http://kh13.com/member.php (instead of reloading the current page) and the welcome block shows no signs that I have logged in (it still shows the guest message). What am I missing? What do I need to do to get the login form to work on non-MyBB parts of the site? Thanks. You can login using the following details to test it: Username: Test Password: password RE: Integrating MyBB login into website. (Problem) - x_Stricken_x - 2009-01-18 You need to set it so that where the login form is, it sets it to http://kh13.com/mybb/member.php?action=login (I think), and it should work.. RE: Integrating MyBB login into website. (Problem) - DChiuch - 2009-01-18 (2009-01-18, 03:17 AM)TomL Wrote: You need to set it so that where the login form is, it sets it to http://kh13.com/mybb/member.php?action=login (I think), and it should work.. As far as I can see, it does link to that location... if I look at the source of the page (after the PHP has loaded that template), then the code shows this:
So, any idea what I need to change? Thanks for the reply. I couldn't find the CSS for #quick_login anywhere. In which file is that located? RE: Integrating MyBB login into website. (Problem) - x_Stricken_x - 2009-01-18 (2009-01-18, 03:20 AM)DChiuch Wrote:Yes. But that's generated by what you set your forum's directory to(when you installed it). I don't see any way to get it to work without the action="" of the login form being set automatically..(2009-01-18, 03:17 AM)TomL Wrote: You need to set it so that where the login form is, it sets it to http://kh13.com/mybb/member.php?action=login (I think), and it should work.. RE: Integrating MyBB login into website. (Problem) - DChiuch - 2009-01-18 Oh, I think the member.php problem lies in one of the Javascript files. The code in general.js used to say "form.setAttribute("action", "member.php");", and I have changed it to "form.setAttribute("action", "http://kh13.com/mybb/member.php");". When I login now, it reloads the current page. However, it still shows the guest message. RE: Integrating MyBB login into website. (Problem) - x_Stricken_x - 2009-01-18 (2009-01-18, 03:33 AM)DChiuch Wrote: Oh, I think the member.php problem lies in one of the Javascript files. The code in general.js used to say "form.setAttribute("action", "member.php");", and I have changed it to "form.setAttribute("action", "http://kh13.com/mybb/member.php");". When I login now, it reloads the current page. However, it still shows the guest message.I think it's because it sets the cookie for http://kh13.com/mybb/, not http://kh13.com..I could be wrong though:p I'm pretty sure that's why.. RE: Integrating MyBB login into website. (Problem) - DChiuch - 2009-01-18 (2009-01-18, 03:35 AM)TomL Wrote:(2009-01-18, 03:33 AM)DChiuch Wrote: Oh, I think the member.php problem lies in one of the Javascript files. The code in general.js used to say "form.setAttribute("action", "member.php");", and I have changed it to "form.setAttribute("action", "http://kh13.com/mybb/member.php");". When I login now, it reloads the current page. However, it still shows the guest message.I think it's because it sets the cookie for http://kh13.com/mybb/, not http://kh13.com..I could be wrong though:p I'm pretty sure that's why.. Oh, thanks a lot. I changed the cookie path and now everything seems to be working. I have one more question though... at the start of the page, I used the following code:
However, on other sections of my site (such as kh13.com/something/), the chdir location would have to be "../mybb", for example. Because the <head> tags are generated by an include file, how can the chdir code always link to kh13.com/mybb? I have tried chdir('http://kh13.com/mybb'), however this did not work. Is it possible? RE: Integrating MyBB login into website. (Problem) - x_Stricken_x - 2009-01-18 (2009-01-18, 03:42 AM)DChiuch Wrote:Neither of those work? I think you can't use ../ in the chdir() function..(2009-01-18, 03:35 AM)TomL Wrote:(2009-01-18, 03:33 AM)DChiuch Wrote: Oh, I think the member.php problem lies in one of the Javascript files. The code in general.js used to say "form.setAttribute("action", "member.php");", and I have changed it to "form.setAttribute("action", "http://kh13.com/mybb/member.php");". When I login now, it reloads the current page. However, it still shows the guest message.I think it's because it sets the cookie for http://kh13.com/mybb/, not http://kh13.com..I could be wrong though:p I'm pretty sure that's why.. RE: Integrating MyBB login into website. (Problem) - DChiuch - 2009-01-18 Quote:Neither of those work? I think you can't use ../ in the chdir() function.. Well I haven't tried using "../" yet, I've only put the PHP code on the index page. Instead of adding the PHP code to every page, I was just going to put it into a file which every page includes. However, if I simply use chdir(mybb), then pages in other directories will not link to the correct location. I tried to fix this by using chdir(http://kh13.com/mybb), however that did not work. RE: Integrating MyBB login into website. (Problem) - x_Stricken_x - 2009-01-18 You can try doing, and replacing PAGE_NAME.PHP with the current page:
Not sure if it'll work, but it's worth a try.:p |