The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Custom Login Page
I personally hate seeing that ugly login box at the top of the screen in the navbar template. I came up with this quick and easy fix, have a separate page for it. If you'd like a custom login page, and simply have to link to it in your navbar, then follow the quick steps below. Step 1) Create a new .php file called clogin.php (it must be named this, do not change the name), and upload it to your forum root directory. Step 2) Put the below code in your new clogin.php file: Code:
<?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'clogin'); // change this depending on your filename // ################### 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( 'clogin', ); // pre-cache templates used by specific actions $actiontemplates = array( ); // ######################### REQUIRE BACK-END ############################ require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = array(); $navbits[$parent] = 'Login'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); eval('print_output("' . fetch_template('clogin') . '");'); ?> Step 4) Insert the following code into your "clogin" (without the quotation marks): Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle]</title> $headinclude </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat">Login</td> </tr> <tr> <td class="alt1"> <if condition="$show['member']"> <meta HTTP-EQUIV="REFRESH" content="0; url=index.php"> </if> Welcome to SITENAME, Guest.<br /><br /> You appear to either not have an account, or not be logged in. If you have an account, please login using this page right below this text. If you do not have an account already, please visit the <i>register</i> page by clicking <a href="register.php">here</a>.<br /><br /> By being a member of SITENAME, you will have rights to create threads, and posts, release and download software, and do so much more. Please login below.<br /><br /> <!-- login form --> <form action="login.php?do=login" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, $show[nopasswordempty])"> <script type="text/javascript" src="clientscript/vbulletin_md5.js?v=$vboptions[simpleversion]"></script> <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0"> <tr> <td class="smallfont" style="white-space: nowrap;"><label for="navbar_username">$vbphrase[username]</label></td> <td><input type="text" class="bginput" style="font-size: 11px" name="vb_login_username" id="navbar_username" size="10" accesskey="u" tabindex="101" value="$vbphrase[username]" onfocus="if (this.value == '$vbphrase[username]') this.value = '';" /></td> <td class="smallfont" nowrap="nowrap"><label for="cb_cookieuser_navbar"><input type="checkbox" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />$vbphrase[remember_me]</label></td> </tr> <tr> <td class="smallfont"><label for="navbar_password">$vbphrase[password]</label></td> <td><input type="password" class="bginput" style="font-size: 11px" name="vb_login_password" id="navbar_password" size="10" tabindex="102" /></td> <td><input type="submit" class="button" value="$vbphrase[log_in]" tabindex="104" 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="securitytoken" value="$bbuserinfo[securitytoken]" /> <input type="hidden" name="do" value="login" /> <input type="hidden" name="vb_login_md5password" /> <input type="hidden" name="vb_login_md5password_utf" /> </form> <!-- / login form --> </td> </tr> </table> $footer </body> </html> You must change all of the "SITENAME" text in your new template to your actual site name. Please post here if you need assistance, please. Credits to Gary King! (https://vborg.vbsupport.ru/showthread.php?t=62164) |
#2
|
|||
|
|||
installed but not works
|
#3
|
|||
|
|||
It works but Trasion left out a step. I think what his intent was to add a Login link to the navbar linked to your page: yoursite.com/forums/clogin.php
Nice work Trasion! --------------- Added [DATE]1254951467[/DATE] at [TIME]1254951467[/TIME] --------------- It looks like this works when added to the navbar: $template_hook[navbar_buttons_right] <td class="vbmenu_control"> <a href="clogin.php?">Log In</a></td> --------------- Added [DATE]1254952892[/DATE] at [TIME]1254952892[/TIME] --------------- Then you need to delete the old login form from the navbar template. |
#4
|
|||
|
|||
Yes, you must add that too. Sorry.
After you go to that page, it should work! |
#5
|
|||
|
|||
It should and it does. After testing I have added it to my board. This allows for a larger site logo without pushing things around for users with small screens.:up:
|
#6
|
|||
|
|||
You might want to add a condition to remove the Log In button if the user is logged in and replace it with Log Out.
|
#7
|
|||
|
|||
Meh. My users know which one to click.
|
#8
|
|||
|
|||
Code:
<td class="vbmenu_control"> <if condition="$show['guest']"> <a href="clogin.php">Login</a> <else /> <a href="login.php?$session[sessionurl]do=logout&logouthash=$bbuserinfo[logouthash]">$vbphrase[log_out]</a> </if> </td> |
#9
|
||||
|
||||
I do that
but if i want to stay in the some page "clogin.php" without to go after login (or if I'm conected) to index.php just a pape for login and say HELLO |
#10
|
|||
|
|||
Thanks a lot! I've spent an hour hunting for a mod so I can put a login link on my blog, but this works perfectly.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|