Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-13-2001, 05:01 PM
Lotus Ims's Avatar
Lotus Ims Lotus Ims is offline
 
Join Date: Dec 2001
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need help with a PHP script. I would like users to be able to login to the forums from a non-vB page. If someone could make a script for me or show me how to do this, it would be much appreciated. I know HTML, so i can do the layout myself. I have tried one of the hacks posted here, but it didn't work. I have include what I would like it to look like below.

If user is not logged in:

------------------------------------------------------------------------------

Welcome Guest! Click Here to register or login below.

Username: |--------|
Password: |--------|

------------------------------------------------------------------------------

And if a user is logged in:

------------------------------------------------------------------------------

Wecome back Username. Click here to go to the forums or click here to logout.

You have # of Private Messages new messages. Click here to read them!

-----------------------------------------------------------------------------

Thanks
Reply With Quote
  #2  
Old 12-13-2001, 05:04 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Check the released hacks forum. Search for login. It's there already.

Amy
Reply With Quote
  #3  
Old 12-13-2001, 05:05 PM
Lotus Ims's Avatar
Lotus Ims Lotus Ims is offline
 
Join Date: Dec 2001
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I already tried that, and it didn't work.
Reply With Quote
  #4  
Old 12-13-2001, 05:07 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What didn't work? The script or the search?

Amy
Reply With Quote
  #5  
Old 12-13-2001, 09:05 PM
Lotus Ims's Avatar
Lotus Ims Lotus Ims is offline
 
Join Date: Dec 2001
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

the script
Reply With Quote
  #6  
Old 12-15-2001, 12:45 AM
Goldfinger's Avatar
Goldfinger Goldfinger is offline
 
Join Date: Oct 2001
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

url to hack please.. i tried searching for it but couldnt find it =\
Reply With Quote
  #7  
Old 12-16-2001, 07:43 AM
Hiroshimator Hiroshimator is offline
 
Join Date: Nov 2001
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
<?PHP
chdir("/path/to/board");
require("./global.php");
?>
<html>
<head>
<title>My homepage :D</title>
</head>
<body><table width=100%">
<tr>
<td><img src="board/images/vBulletin_logo.gif"></td>
<td valign=bottom align=right>

<?PHP
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
  
print("Welcome back, <b>$username!</b>");
} 
else {
?>

you're not logged in
<p>
<form action="http://path/to/board/member.php" method="post" />
<input type="hidden" name="s" value="<?PHP print("$session[sessionhash]"); ?>" />
<input type="hidden" name="action" value="login" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td align="left"><font class="verdana, arial, helvetica" size="1"><b>Username:</b></font></td>
    <td align="left"><input type="text" name="username" size="7" /></td>
  </tr>
  <tr>
    <td align="left"><font class="verdana, arial, helvetica" size="1"><b>Password:</b></font></td>
    <td align="left"><input type="password" name="password" size="7" /></td>
  </tr>
  <tr>
    <td align="center" colspan="2"><input type="submit" value="Login!" /></td>
  </tr>
</table>
</form>
</p>
<?PHP } ?>
</td></tr>
<tr><td colspan=2><?PHP print("<a href='./board/member.php?s=$session[sessionhash]&action=logout'>Log Out</a>"); ?></td></tr>
</table>
</body></html>

this should work, don't forget to fill in your own path to your board directory in the chdir() routine.
Reply With Quote
  #8  
Old 12-16-2001, 11:13 PM
Lotus Ims's Avatar
Lotus Ims Lotus Ims is offline
 
Join Date: Dec 2001
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried the above script. HOwever, I want to use it with cookies, and on a non vB page. The login works fine, but when i got back to the page where I want the login, it doesn't have my username. It still acts like I am not logged in.
Reply With Quote
  #9  
Old 12-16-2001, 11:15 PM
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Location: PA
Posts: 4,438
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lotus Ims

If you have included the script with the url instead of the path to the file, that's probably why it doesn't work.

Amy
Reply With Quote
  #10  
Old 12-19-2001, 01:00 PM
Hiroshimator Hiroshimator is offline
 
Join Date: Nov 2001
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

don't forget to set your cookie domain .mydomain.com (notice the first dot) in your board options
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:46 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04371 seconds
  • Memory Usage 2,254KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete