vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   [RELEASE v2] Homepage Login on non-vB page (https://vborg.vbsupport.ru/showthread.php?t=23524)

RobAC 07-23-2001 10:00 PM

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.

_ 07-24-2001 05:45 AM

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

RobAC 07-24-2001 05:48 AM

Sorry.....here it is. :rolleyes:

Ruth 07-24-2001 07:39 AM

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 :(

Robert Basil 07-24-2001 01:10 PM

Rob,

I just added this hack to our community and it works great! Thanks!

RobAC 07-24-2001 01:21 PM

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 :(

Ruth,

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

BradC 07-24-2001 01:47 PM

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.

Rostor 07-24-2001 04:19 PM

Hi Rob, i try your hack but nothing works sorry :( it will be for the next time

Steve Machol 07-24-2001 04:27 PM

[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 :(

Ruth 07-24-2001 04:52 PM

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:

<?

require("path-to/global.php");

if (!$bbuserinfo[userid] || $bbuserinfo[usergroupid]==3 || $bbuserinfo[usergroupid]==4) {
show_nopermission();
eval("dooutput(\"".gettemplate("error_wrongpassword")."\");");
}

if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];

echo"Welcome Back, <b>$username</b>";

} else {

?>

<table border="0" cellpadding="0" cellspacing="0" height="99">
<form action="http://path-to/forums/member3.php" method="post">
<tr>
<td nowrap height="13" colspan="2">
<p align="center"><font face="verdana,arial,helvetica" size="1" ><b>Login with username and password:</b></font></p>
</td>
</tr><tr>
<td nowrap height="25"><font size="2">User Name</font>
</td>
<td nowrap height="25"><input type="text" class="bginput" name="username" size="13">
</td>
</tr>
<tr>
<td nowrap height="27"><font size="2">Password</font></td>
<td nowrap height="27"><input type="hidden" name="s" value="$session[sessionhash]">
<input type="hidden" name="action" value="login"><input type="password" class="bginput" name="password" size="13">
<input type="submit" class="bginput" value="Login!"></td>
</tr>
</table>

<?

}

?>

i get error almost everywhere except for the login box, there is an error on show_nopermission line, and the user is not welcomed in non-vb pages. (i changed member.php to member3.php and alreasy set the redirect to the index of my main site (non-vB) )

please help :(


All times are GMT. The time now is 01:56 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
  • Page Generation 0.01021 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete