Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
VB Login on a Non-VB Page vB3 RC3 Details »»
VB Login on a Non-VB Page vB3 RC3
Version: 1.00, by mcahill mcahill is offline
Developer Last Online: Dec 2012 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 02-02-2004 Last Update: Never Installs: 74
 
No support by the author.

This is a simple modification to do, and adds a lot of value to your homepage.

Notes:

1. This script can occassionally have conflicts with other javascripts. Test before you deploy.
2. If you use and include to put the file on your page, be sure that the chdir and the require for global.php is in the head of the main document.
3. It is assumed that you are using a php page, and that you have already got connectivity with your database.


The code:

At the top of the document, before the <html> or <head> tags (edit to provide the path for your particular installation):

PHP Code:
<?php
  chdir
("forum/");
require(
'./global.php');  
chdir("../); 
?>
Wherever you want your login:

PHP Code:
 <?
 

if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
  
print("<align='center'><span class='sectionheader'>Welcome back, $username!<br>");

} else {
   


?>
<form action='/forum/login.php' method='post' onsubmit='md5hash(vb_login_password,vb_login_md5password)'>
        <script type='text/javascript' src='/forum/clientscript/vbulletin_md5.js'></script>
        
         <span class="sectionheader">Username:</span>
            <input type='text' class='button' name='vb_login_username' id='navbar_username' size='15' accesskey='u' tabindex='1' value='' onfocus='if (this.value == 'username') this.value = '';' /><br>
            
            <span class="sectionheader">Password:&nbsp;</span>
            <input type='password' class='button' name='vb_login_password' size='15' accesskey='p' tabindex='2' /><br>
            <input type='checkbox' name='cookieuser' value='1' tabindex='3' id='cb_cookieuser_navbar' accesskey='c' checked='checked' /><span class='sectionheader'>Remember Me</span><br>
        
        
        
        <input name="submit" type='submit' class='button' accesskey='s' tabindex='4' title='Log In' value='Log In' />
        <input type='hidden' name='do' value='login' />
        <input type='hidden' name='forceredirect' value='1' />            
        <input type='hidden' name='vb_login_md5password' />
        </form>
                        <?

 } 

?>
Troubleshooting:

Before requesting support, please check the following:

1. Make sure you have the path to your forum in the chdir. If you haven't done this, you will get a "can't include" error.
2. Make sure you have the chdir in the main document. If it isn't you will get a "can't modify header" error.
3. If those don't resolve the issue, try putting the login in a separate file, with no other code. If it works there, then you will know that you have a conflict with one of the scripts on the page you are trying to add the login to. I can't help you if you've got a conflict with another script.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 02-25-2004, 04:53 PM
idwf's Avatar
idwf idwf is offline
 
Join Date: Jun 2003
Location: England
Posts: 413
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

'
Warning: main(): open_basedir restriction in effect. File(/forums/global.php) is not within the allowed path(s): (/home/indeathw:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/indeathw/public_html/indextest.php on line 2

Warning: main(/forums/global.php): failed to open stream: Operation not permitted in /home/indeathw/public_html/indextest.php on line 2

Fatal error: main(): Failed opening required '/forums/global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/indeathw/public_html/indextest.php on line 2'

on RC4...any ideas????:ermm:
Reply With Quote
  #23  
Old 02-28-2004, 08:58 AM
Jensie180 Jensie180 is offline
 
Join Date: Jan 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I downloaded this hack, work great! I only need some more stuff when the member is logged in. Like the avatar image, new pms, last visited? I know there are codes for this, but can someone help me get these?

Thanks!
Reply With Quote
  #24  
Old 03-02-2004, 09:50 PM
cerebro's Avatar
cerebro cerebro is offline
 
Join Date: Dec 2001
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

please some hack to login in ASP page..but i other webserver, diferent that forum server.
Reply With Quote
  #25  
Old 03-14-2004, 08:42 AM
Chrissicom's Avatar
Chrissicom Chrissicom is offline
 
Join Date: Mar 2004
Location: Austria / Germany
Posts: 43
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm I put the code on my index.htm on IIS 6 and it is just working fine, no need to rename it to .php (the .htm file is XHTML 1.1 compliant, but I don't think this affects the php code to working or non-working).... do I need to have index.php on Apache or it won't work?!?
Reply With Quote
  #26  
Old 03-15-2004, 04:53 PM
cerebro's Avatar
cerebro cerebro is offline
 
Join Date: Dec 2001
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yeap, not need .php but you have the forum and website in the same SERVER.
I have one computer for my board, and another for my Forum...
Reply With Quote
  #27  
Old 03-20-2004, 05:19 PM
brownafroduck brownafroduck is offline
 
Join Date: Oct 2003
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This seems to work great for me so far, but I have a question...

Can someone explain what is happening in the first piece of code? Just what does it mean and what is it doing?

Thanks.
Reply With Quote
  #28  
Old 03-20-2004, 07:57 PM
Kumaro's Avatar
Kumaro Kumaro is offline
 
Join Date: Oct 2001
Location: T.O
Posts: 122
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, I finally got this hack to work with my PHPnuke 7.1. There's still 1 problem remaining. It logs in and returns to the main page, however the message does not change to "Welcome username", it always shows the login form....I made it into a phpnuke block, so it is in its' own file. The login is successful, but there is no welcome page.

PHP Code:
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
  
$content "<align=\"center\"><span class=\"sectionheader\">Welcome back, $username!<br>"
^^is that being ignored or something?
Reply With Quote
  #29  
Old 03-23-2004, 10:24 PM
misterfade misterfade is offline
 
Join Date: Jun 2003
Location: MTL
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mcahill
1. This script can occassionally have conflicts with other javascripts. Test before you deploy.
That's the exact problem I'm having with the javascript. The script works, but I always get an error when the page loads (before I login). I tried this hack without the javascript and it still works fine.

So, why is this line of javascript needed to login?
<script type='text/javascript' src='/forum/clientscript/vbulletin_md5.js'></script>

Thanks.
Reply With Quote
  #30  
Old 03-25-2004, 02:06 PM
MindTrix's Avatar
MindTrix MindTrix is offline
 
Join Date: Apr 2002
Location: United Kingdom
Posts: 1,833
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thats the line that calls the java file
Reply With Quote
  #31  
Old 03-25-2004, 02:55 PM
Snappa's Avatar
Snappa Snappa is offline
 
Join Date: Feb 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump!
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:21 PM.


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.06887 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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