By default, Jamroom provides you with a pre-made login screen for your Artists to log in to, but some of you may want to create a “custom” login screen of your own design. Doing so is fairly straight forward, and involves creating your own custom “form” that then sends the correct information to the “login.php” script.
After installing Jamroom, you will find a pre-made “custom” login form in your templates directory:
jamroom/templates/login/login_custom.tpl
that looks like this:
<html>
<head>
<title>Welcome to {$SYSTEM_NAME}!</title>
</head>
<body style="font-family: Verdana; font-size: 12px; margin: 75px">
<center>
<big><b>CUSTOM LOGIN PAGE</b></big>
<br><br>
This is a sample login form for your Jamroom. If you would like to use a
"custom" login page for your Jamroom, instead of the default
login page, you can create a login template file in your jamroom/templates/login
directory that can be parsed by the Jamroom login.php script. For example,
this file is called "login_custom.tpl" and is shown using the following
syntax:<br><br>
<blockquote>
{$JAMROOM_URL}/login.php?template=login_custom.tpl
</blockquote>
<br>
Which can be used in a PHP <a href="http://www.php.net/include">include()</a>
function call. This an easy way to "embed" your login page inside
another HTML page so that it integrates into your existing site.
<br><br>
{if $LOGIN_ERROR != ""}
<!-- see if we have a login error -->
<b>Error: {$LOGIN_ERROR}</b><br><br>
{/if}
<form method="post" target="_self" name="form" action="login.php">
<!-- Don't forget the template variable here so we can be redirected for errors! -->
<input type="hidden" name="template" value="login_custom.tpl">
Username:
<input type="text" maxlength="20" length="22" name="jm_user">
<br><br>
Password:
<input type="password" maxlength="20" length="22" name="jm_pass">
<br><br>
<input type="submit" name="submit" value="login to jamroom" style="width: 200px">
</form>
</body>
</html>
What you will want to do, is modify this template (make sure and save a backup copy of the unmodified version - in case you make any mistakes you have a reference), and format and style it to fit the design you are looking for.
To test out your new template, simply call the login.php script with the “template” variable from yuor browser:
http://www.yoursite.com/jamroom/login.php?template=login_custom.tpl
And it will be displayed to you in your browser.
Once you have the form set up like you want it, you can then link to it using the same URL you have been testing it with, or you can also “embed” the form in another PHP page by using PHP‘s include() function:
<?php include("http://www.yoursite.com/jamroom/login.php?template=login_custom.tpl"); ?>