Announcement

Collapse
No announcement yet.

Autoredirect?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Autoredirect?

    Hi,

    Is there a way to stop vbulletin from automatically redirecting you to the last page you were viewing everytime you log in, and instead take you to the homepage?

    thanks in advance.

  • #2
    You can define a redirection URL by adding this hidden field to the login form:

    Code:
    <input type="hidden" name="url" value="REDIRECTION URL HERE" />
    The login forms are in these templates:

    Admin CP -> Styles & Templates -> Style Manager -> « » -> Navigation / Breadcrumb Templates -> navbar

    Add the red code:

    Code:
    		<!-- login form -->
    		<form action="login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
    		<script type="text/javascript" src="clientscript/vbulletin_md5.js"></script>
    		<table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
    		<tr>
    			<td class="smallfont">$vbphrase[username]</td>
    			<td><input type="text" class="button" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="1" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td>
    			<td class="smallfont" colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="3" id="cb_cookieuser_navbar" accesskey="c" checked="checked" />$vbphrase[remember_me]</label></td>
    		</tr>
    		<tr>
    			<td class="smallfont">$vbphrase[password]</td>
    			<td><input type="password" class="button" name="vb_login_password" size="10" accesskey="p" tabindex="2" /></td>
    			<td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="4" title="$vbphrase[enter_username_to_login_or_register]" accesskey="s" /></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" />
    		<input type="hidden" name="vb_login_md5password_utf" />
    		[color=red]<input type="hidden" name="url" value="REDIRECTION URL HERE" />[/color]
    		</form>
    		<!-- / login form -->
    Admin CP -> Styles & Templates -> Style Manager -> « » -> STANDARD_ERROR

    The field is already there. Just replace $scriptpath with your URL:

    Code:
    			<script type="text/javascript" src="clientscript/vbulletin_md5.js"></script>
    			<form action="login.php" method="post" onsubmit="md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)">
    			<input type="hidden" name="do" value="login" />
    			<input type="hidden" name="forceredirect" value="1" />
    			<input type="hidden" name="url" value="[color=red]$scriptpath[/color]" />
    			<input type="hidden" name="vb_login_md5password" />
    			<input type="hidden" name="vb_login_md5password_utf" />
    			$postvars
    	
    			<input type="hidden" name="s" value="$session[sessionhash]" />
    And make a similar change to the STANDARD_ERROR_LITE template.

    That should work.

    Comment

    widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
    Working...
    X