![]() |
Ok....this is my first hack. It's small and should be very straight forward.
The source of this hack is a thread that started in the main Code Hacks forum by a user looking for a hack that would allow their members to log in from the main home page of their site. Once logged in, it would display a Welcome message when the logged in member returned to the home page. The original source was provided by Demolition, but members were having problems with getting the hack to run. Warning/Disclaimer: I am not a well seasoned PHP programmer. I get by as best I can, but usually learn from example and tinkering. I have changed the PHP coding around slightly, and added much more HTML in order to format the input fields etc. This hack was tested using Internet Explorer 5.5 and Netscat 4.7. I have verified that it works in both OS's several times. I am also running the latest version of PHP on my server, so I'm not sure how to help those of you that are running PHP3, but I'll do the best I can. I won't make any promises though. I plan on continuing to work on this as well as add a few more features to it as time permits. Download the attached file and edit it using a text editor of your choice. Add the pathway to your forums directory where noted. Save the file as a PHP file to your main forums directory. If your site's home page is an HTML document you will have to call the PHP file using a server side include. If you're not sure how to do this, you should search the forums here as this topic has already been covered several times. |
<form action="http://www.corvetteactioncenter.com/forums/member.php" method="post" />
You should really change that ;) But nice hack for us html/php impaired :p I'm just lazy. |
Sorry.....here it is. :rolleyes:
|
RobAC, thanks
but i wasn't looking exactly for this, i was looking for a code to welcome the user in non-vB pages, when s/he logs in using login box in non vb pages, and this one doesnt work like this :( |
Rob,
I just added this hack to our community and it works great! Thanks! |
Quote:
Can you explain further? So you want it to say "Welcome back.....member on each non forum page? You don't want the login fields? -Rob |
By Definition Rob, I think what is wanted is lets say on the index.html or index page, it welcomes them to the site.
kind of like using a very basic phpportals :) that is what I get out of it. |
Hi Rob, i try your hack but nothing works sorry :( it will be for the next time
|
[QUOTE]Originally posted by Ruth
RobAC, thanks but i wasn't looking exactly for this, i was looking for a code to welcome the user in non-vB pages, when s/he logs in using login box in non vb pages, and this one doesnt work like this :( |
smachol, thanks, but i tried that it doesn't work...
RobAC, this is what i am trying to do... i need to do the following in non-vB pages: (1) if the user already logged use their cookies and display a welcome $username + logout link (2) if the user is not logged use the login form before displaying the page content. (3) prevent access to users awaiting confirmation (3) and users awaiting moderation (4) PHP Code:
please help :( |
[QUOTE]Originally posted by Ruth
smachol, thanks, but i tried that it doesn't work... |
Ruth,
Can you be more specific when you say it doesn't work? Are you getting warning messages back? What version of PHP are you running? Is the pathway to the global.php file correct? |
Quote:
Is the main index page of your site an HTML document on PHP? So in other words, when someone clicks the link to go to your site....if they are a member, you want them to automatically be logged in....if they're cookies are set properly and have direct access to the site. If they aren't logged in, you want to be brought to a page that has nothing on it, other than the log in fields? It sounds like this is a little beyond my capability and I'm not sure I can help. |
Quote:
when i use that code without show_nopermission code, it only shows the login box in my index.php (non vB), when i try to login using the box, and it redirects me to the same page (index.php) it doesnt show the welcome screen, it shows the login box again (like if i'm not using cookies or not looged in) Test 2 when i change number 0 to 1 in Quote:
but when i logout and come back it doesnt show the login box at all. Test 3 when i add this to the code PHP Code:
Quote:
Quote:
Quote:
thanks for your help :) |
Ruth,
For what it's worth I believe I also had a problem using this unless the script was in the same directory as the global.php file. Sorry, I don't know what to recommend. |
smachol, is there a way by putting the script in the same path as global.php and just call it by one line like this code
PHP Code:
in every protected page. i'm not experienced in this. thanks |
Ruth,
I'm just beginning to learn PHP myself. All I know is that the code I posted above works on my site when global.php and the script using it ('last.php') are in the same directory. I haven't yet tested any other variations. |
How about putting in there the direct link to the global.php
PHP Code:
then you can put the script anywhere. update: I use this for mine... my vb folder is "main" and I have an "about" folder in the same root as the main folder and I use this in all my pages to get the global.php PHP Code:
|
Anyone know how I can solve this error message when I require the global.php file on a non-vb page?
Warning: Failed opening './admin/config.php3' for inclusion (include_path='') in ./bulletinboard/global.php3 on line 66 Thanks. |
BradC thanks i'll try that...
Quote:
|
Thanks ... I'll give that a shot!
|
Works fine for me, is there anyway for the login to bring you back to the page you used to login, or go to a specific page rather than the Forums? What I'm planning on doing, is having this in a pop-up, so you can sign in through the pop-up, and all it says after you sign in is something like, "Thanks for signing in, user." Is that possible, or will it always have to go to the BBS?
|
I too have the login working fine on non-vb pages, but it takes you to the forum homepage. Does anyone know if it's possible to control what page gets loaded after login?
|
I'll see what I can do about being able to specify a different page to go to after logging in.
|
Thanks, that'd rule.
|
how about
PHP Code:
|
huh?
|
ok could sumone post a WORKING script! All complete with deatiled instructions... Thank you!
|
Will this work on .SHTML page?
it would be nice if I can directly call it via SSI e.g <!-- include virtual="/something/something.php --> Just like my site http://www.certifyexpress.com which it currently using UBB but I've just purchase VB license and will migrate to VB once I got the core hack on VB. |
certify,
yes it should. |
This hack looks very cool. The only thing is that I can only get it to work correctly by calling the script direcly. When use php include on the index page, it gives me an error saying that headers have already been sent out.
Is there a way around it? |
Cool I'll use this hack. :)
|
Can I have the login url instead of the login fields?
e.g. You are not login, Login or Register |
Has anyone got this hack to work correctly without geting any errors?
I've tried everything and always get errors when using php includes. Please, I need help. |
Yes, worked without any problem. See at
http://www.schatzjagd.org on the right side, with the who's online script Harry |
Hi All,
it works but sometimes give me an error on header :eek: Warning: Cannot add header information - headers already sent by (output started at C:\Inetpub\wwwroot\XXXXX\home.php:11) in C:\inetpub\wwwroot\XXXXX\forum\admin\functions.php on line 1459 Someone can help me plz ? :) |
Quote:
This would be a very nice thing to have - just a login or the welcome back message on the home page, but I think Rob may have lost interest, as it looks like he may be using vbportal. |
[QUOTE]Originally posted by samtha25
That's what I get at smachol page, not being a registered user. :) |
Quote:
I haven't lost interest, but I've been really busy the last couple of weeks and spent the last 4-5 days dealing with a loss in my family. I'm just getting back to work now, but will be taking off in a couple days for a much needed vacation. I won't be able to take a look at this hack until after I get back. |
I'm trying to convert my files to PHP but there is something wrong with the this code. Try to register an account, then login and go the the 2 links below, you will notice that from the index.shtml you the system managed to detect that you are login but from index.php you are still not login?? :confused:
This file call the header from header.shtml http://www.certifyexpress.com/microsoft/index.shtml Quote:
This file call the header from header.php http://www.certifyexpress.com/micros...kpro/index.php Quote:
PHP Code:
|
All times are GMT. The time now is 05:43 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|