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

Reply
 
Thread Tools Display Modes
  #1  
Old 09-22-2008, 09:37 PM
sector77 sector77 is offline
 
Join Date: Jan 2008
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Welcome "Username" Screen after Login

Hello everyone! I've been using vb for quite a while but am only now attempting to integrate the log in screen on an outside .php home page. In other words, I want people to have the ability to log in to my site (www.trancesessions.com) and be able to see every page (including the forum) as a member.

I was able to set up the username/pw log in screen on the home page (www.trancesessions.com). But I have two problems. One, once the member logs in successfully, it takes that member directly to the forum (which is ok and I know how to change where it routes them to).

What I would like to do is make it so that once the person logs in, they are taken back to the same page but instead of seeing the username/pw boxes, they'll see a welcome 'username' area that is similar to the welcome message you get when you log in directly to the forum.

Does anyone have any idea how to do this or what code I can use to achieve this? I'm sorry if I did a bad job of explaining it and will elaborate to the best of my ability if you have any questions.

Thank you for any help!!!

PS. This is currently the code I have on the home page for the log in screen:

Code:
<!-- login form -->
		<form action="forums/login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
		  <div align="left">

		    <script type="text/javascript" src="forums/clientscript/vbulletin_md5.js"></script>
		  <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
		  Username:
		  <br>
		  <input type="text" class="button" name="vb_login_username" id="navbar_username" size="20" accesskey="u" tabindex="1" onFocus="if (this.value == 'Username') this.value = '';" />		  
		  <br />
		  Password:
		  </font>
		  <br> 
		  <input type="password" class="button" name="vb_login_password" size="20" accesskey="p" tabindex="2" />

		  <input type="submit" class="button" value="Login" tabindex="4" title="" accesskey="s"/>
		  </div>
		  <div align="left">
		  <input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />
		  <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
		  Remember Me
		  </font>
		  </label>
		  </div>

		  <br>
		  <div align="left">
		  <font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
		  Not a member?
		  <a href="http://www.trancesessions.com/forums/register.php">Register Here</a>
		  </font>
		  </div>
		  <input type="hidden" name="s" value="" />
		  <input type="hidden" name="do" value="login" />

		  <input type="hidden" name="forceredirect" value="1" />			
		  <input type="hidden" name="vb_login_md5password" />
		  <input type="hidden" name="vb_login_md5password_utf" />
		  <input type="hidden" name="url" value="http://www.trancesessions.com/forums" />
		    </div>
		</form>
		<!-- / login form -->
Reply With Quote
  #2  
Old 09-23-2008, 05:52 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to include vBulletin's global.php - then you can use its variables to check if someone is logged in, etc.
Reply With Quote
  #3  
Old 09-23-2008, 08:06 PM
sector77 sector77 is offline
 
Join Date: Jan 2008
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dismounted View Post
You need to include vBulletin's global.php - then you can use its variables to check if someone is logged in, etc.
o man...i'm such a noob lol... when you say include global.php i know where to locate that file but how would i include it? i guess i just dont know what steps to do that would be....

any suggestions?

ty for your earlier reply
Reply With Quote
  #4  
Old 09-24-2008, 01:55 AM
Jacob B Jacob B is offline
 
Join Date: Aug 2008
Location: Australia
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to put this code in your PHP file after you've set the PHP environment.

PHP Code:
// ########################## REQUIRE BACK-END ############################ 
require_once('./global.php'); 
Reply With Quote
  #5  
Old 09-24-2008, 02:07 AM
sector77 sector77 is offline
 
Join Date: Jan 2008
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

aww man....now i'm getting really confused lol haha...i'm looking at the code on my index.php page (non-vb page) and it's really throwing me off....


ok....

does anyone know what code i would need to put exactly on the home page? and then again what code would i need to put in the global.php file?

i'm so confused....do i even need to do all that?

thanks

--------------- Added [DATE]1222225967[/DATE] at [TIME]1222225967[/TIME] ---------------

Quote:
Originally Posted by Jacob B View Post
You need to put this code in your PHP file after you've set the PHP environment.

PHP Code:
// ########################## REQUIRE BACK-END ############################ 
require_once('./global.php'); 
i think i'm not understanding exactly where to put that code you gave me....and then on top of that....what i would need to do to 'set the PHP environment'

does the code you gave me need to be inserted on the (non vb page) i have or does it need to be inserted in the vbulletin 'global.php' file?


thank you jacob for putting up with this noob! lol
Reply With Quote
  #6  
Old 09-24-2008, 05:03 AM
Jacob B Jacob B is offline
 
Join Date: Aug 2008
Location: Australia
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
does anyone know what code i would need to put exactly on the home page? and then again what code would i need to put in the global.php file?
Nothing should be inserted into your global.php file unless told to do so by a member of staff at www.vbulletin.com as part of a support issue.

Quote:
i think i'm not understanding exactly where to put that code you gave me....and then on top of that....what i would need to do to 'set the PHP environment'
When you're creating a vBulletin-powered page, it requires a PHP file to get it up and running if you want to include user accounts, etc. There are many articles available to do this, including this one here. I firmly suggest reading over that particular article to get a feel for using vBulletin PHP.

Here is how a standard vBulletin-powered page should look (this one is called test.php, taken from the article posted above):

PHP Code:
<?php 

// ######################## SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 

// ##################### DEFINE IMPORTANT CONSTANTS ####################### 
// change the line below to the actual filename without ".php" extention. 
// the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation. 

define('THIS_SCRIPT''test');  

// #################### PRE-CACHE TEMPLATES AND DATA ###################### 
// get special phrase groups 
$phrasegroups = array(); 

// get special data templates from the datastore 
$specialtemplates = array(); 

// pre-cache templates used by all actions 
$globaltemplates = array( 
        
// change the lines below to the list of actual templates used in the script 
        
'test_mytesttemplate1'
        
'test_mytesttemplate22'
); 

// pre-cache templates used by specific actions 
$actiontemplates = array(); 

// ########################## REQUIRE BACK-END ############################ 
require_once('./global.php'); 

// #################### HARD CODE JAVASCRIPT PATHS ######################## 
$headinclude str_replace('clientscript'$vbulletin->options['bburl'] . '/clientscript'$headinclude); 

// ######################################################################## 
// ######################### START MAIN SCRIPT ############################ 
// ######################################################################## 

$navbits = array();  
// change the line below to contain whatever you want to show in the navbar (title of your custom page) 
$navbits[$parent] = 'Test Page'

$navbits construct_navbits($navbits); 
eval(
'$navbar = "' fetch_template('navbar') . '";'); 

// change the line below to contain the name of the actual main output template used in your script 
eval('print_output("' fetch_template('test_mytesttemplate1') . '");'); 

?>
Do you see how he's inserted his global.php file? That's what you need to do. Then you can use variables such as: $username, $bbuserinfo[userid], etc.
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 04:56 PM.


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.08516 seconds
  • Memory Usage 2,240KB
  • Queries Executed 13 (?)
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
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete