Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-28-2004, 11:09 PM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Login form redirection

Hi,

I dislike the little login form on the forum home page. yes it can be handy, but for my site it's just overkill. So, I've done a little modifying and created an html login page which has the same functionality but allows me to you a log in link on other pages. it works just perfectly however, there's one slight problem ? page redirection. After the user clicks "login" they are taken tot he redirection page and told to hang on while they are logged in. Thenthey are redirected back to the log in form. What I would like to do is redirect them to the home page after log in. Can anyone assist me in changing the redirection? Thanks.

Here's the form code as it stands.

HTML Code:
<form action="login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password)">
		<script type="text/javascript" src="clientscript/vbulletin_md5.js"></script>
		<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
		<tr><td><br /><br /><br /></td></tr>
		<tr>
			<td align="center" class="smallfont" valign="middle">Username</td></tr>
			<tr><td valign="middle" align="center"><input type="text" class="button" name="vb_login_username" id="navbar_username" size="15" accesskey="u" tabindex="1" value="" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
		</tr>
		<tr><td><br /></td></tr>
		<tr>
			<td class="smallfont" valign="middle" align="center">Password</td></tr>
			<tr><td valign="middle" align="center"><input type="password" class="button" name="vb_login_password" size="15" accesskey="p" tabindex="2" /></td>
			</tr>
			<tr><td><br /></td></tr>
	<tr>
	<td class="smallfont" <label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />Remember Me</label></td></tr><tr>

<td align="center"><input type="submit" class="button" value="  Log In  " tabindex="4" title="Enter username to login" accesskey="s" /></td>


		</tr>
		<tr><td><br /><br /><br /></td></tr>
		</table>
		<input type="hidden" name="s" value="$session[sessionhash]" />
		<input type="hidden" name="do" value="login" />
		<input type="hidden" name="forceredirect" value="1" />			
		<input type="hidden" name="vb_login_md5password" />
		</form>
		<!-- / login form -->
			
		</td>
Reply With Quote
  #2  
Old 07-01-2004, 07:11 AM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nvermind I got it working... and now run without that little log in form for guests
Reply With Quote
  #3  
Old 07-05-2004, 12:54 AM
Berethorn Berethorn is offline
 
Join Date: Jun 2004
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's just what I need now for my page!

I'm curious - how did you fix it?
Reply With Quote
  #4  
Old 07-05-2004, 02:41 AM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I added a conditional to the template that displays a different message if the user is logged in. Therefore, when a user gets redirected to the same page it simply tells them they have logged in successfully.

I thought about realeasing this as a hack. But it's pretty much the tip created by Gary W. here https://vborg.vbsupport.ru/showthrea...=Powered+pages with my own special template modification.

I'm including the internal parts of the template here, minus header and footer content. Remember to check all link paths to be certain they are correct for your forums. I've not coded this for general release.

HTML Code:
General page start and header content here (use the general or blank shell templates if needed and just paste the information below between the header and footer.)

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="30%" align="center">
<tr>
			
			
			<td class="alt2" width="100%" align="center">

<!-- Show to Logged in users -->
			<if condition="$bbuserinfo['userid']">
			<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
			<td align="center" class="smallfont" valign="middle"><b>Hi $bbuserinfo[username]!</b><br />
You have been logged in successfully. </td></tr>
			</table>
			
<!-- /Show to Logged in users -->
			
			<else />
			
<!-- login form -->

		<form action="/login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password)">
		<script type="text/javascript" src="/clientscript/vbulletin_md5.js"></script>
		<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
		<tr><td><br /></td><td></tr>
		<tr>
			<td align="center" class="smallfont" valign="middle">Username</td></tr>
			<tr><td valign="middle" align="center"><input type="text" class="button" name="vb_login_username" id="navbar_username" size="15" accesskey="u" tabindex="1" value="" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
		</tr>
		<tr><td><br /></td></tr>
		<tr>
			<td class="smallfont" valign="middle" align="center">Password</td></tr>
			<tr><td valign="middle" align="center"><input type="password" class="button" name="vb_login_password" size="15" accesskey="p" tabindex="2" /></td>
			</tr>
			<tr><td><br /></td></tr>
	<tr>
	<td class="smallfont" <label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />Remember Me</label></td></tr><tr>

<td align="center"><input type="submit" class="button" value="  Log In  " tabindex="4" title="Enter username to login]" accesskey="s" /></td>


		</tr>
		<tr><td><br /></td></tr>
		</table>
		<input type="hidden" name="s" value="$session[sessionhash]" />
		<input type="hidden" name="do" value="login" />
		<input type="hidden" name="forceredirect" value="0" />			
		<input type="hidden" name="vb_login_md5password" />
		</form>

<!-- / login form -->
			
		</td>
</tr>
</table><br /><br />
</if>
</td></tr></table>
<br /><br />

General footer and closing content here
Reply With Quote
  #5  
Old 07-05-2004, 03:10 AM
Berethorn Berethorn is offline
 
Join Date: Jun 2004
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's exactly what I did just now with mine! I tried to add a history.back link for logged in users, but that link keeps sending me back to the logged in page.

HTML Code:
	<if condition="$bbuserinfo['userid']">
<br />

<center>
You are logged in.<br /><a href="#" onclick="history.back(1)" return="false">Click here to go the last page you visited</a>
</center>
<br />
 </if>
Reply With Quote
  #6  
Old 01-07-2005, 07:09 PM
knary knary is offline
 
Join Date: Dec 2004
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I added a hidden field to an external login form that sets a variable to the URL of the original referring page. I then added that URL to the list of acceptable global variables. And, finally, tweaked the standard redirect page to use that url IF that variable is set. This way, a user can login anywhere in the site and not get pushed back to the login page, but the actual page where they clicked "login". Make sense?
Reply With Quote
  #7  
Old 01-11-2005, 04:48 AM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

knary can you post an example of the code? I'd love to do what you're describing rather than just a conditional for page content.
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 10:48 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.06605 seconds
  • Memory Usage 2,249KB
  • 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
  • (3)bbcode_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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