Jamroom Logo Jamroom 5 Core
is now Open Source!
Follow Jamroom on Twitter!

This document applies to Jamroom 2 only!
For current Jamroom 4 Documentation, visit the main Jamroom Documentation section.

Overview

By default, Jamroom comes with a “Signup” form and interface that works well for most users of Jamroom. However, if you are customizing your Jamroom and want to modify the Signup interface to match your site design, here are the steps you can take to create your own custom “template” that Jamroom will then parse for you and use in place of the standard signup form.

Creating the Custom Template

“out of the box” Jamroom comes with a sample “custom” signup form that should be very easy to modify to suit your needs. After installing the Jamroom Bonus Pack, you will find the sample template located in the signup templates directory - jamroom/templates/signup/sample_signup.tpl.

The sample_signup.tpl template file is a Smarty template - this means you can utilize all of the logic, flow control, functions and variable modifiers that are part of Smarty package in your template (which gives you many possibilities). By default, the sample template looks like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>{$system_name} Signup</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="{$JAMROOM_URL}/templates/ranking/ranking.css">
<!--[if gte IE 5.5000]>
<script type="text/javascript" language="javascript" src="{$JAMROOM_URL}/include/jamroom_pngfix.inc.js"></script>
<![endif]-->
</head>
 
<body id="body">
<center>
 
<table cellpadding="0" cellspacing="2" id="table" style="width: 50%">
<tr>
<td id="head">Signup for a new account on {$system_name}</td>
</tr>
<tr>
<td id="info">
Jamroom Sample Signup Template.<br><br>
This sample template file is located in the <b>{$JAMROOM_DIR}/templates/signup</b> directory.<br>
If you would like to create a custom signup page for your Jamroom, feel free to modify this template or create a new one. Once you have created
your template, it is easy to use it by adding the &quot;template&quot; variable to your URL:
<blockquote>signup.php?template=sample_signup.tpl</blockquote><br>
</td>
<tr>
<tr>
<td id="info">
 
{if is_numeric($USER_ID)}
{* looks like they signed up successfully - show them the success message *}
<big><b>Congratulations!</b></big><br><br>You have successfully signed for an account on {$system_name}. Please check your E-Mail<br>
for an authorization code that you can use to access the system. Thank you!
 
{else}
{* looks like a normal signup - show our form *}
 
{if !empty($SIGNUP_ERROR)}
{* looks like we encountered an error - show our error message *}
<font color="#FF0000"><b>{$SIGNUP_ERROR}</b></font><br><br>
{/if}
 
<form method="post" action="{$JAMROOM_URL}/signup.php?mode=register_user">
{* we need to make sure and include the name of this template as a field so Jamroom knows the template to "refresh" on if there is an error or success *}
<input type="hidden" name="template" value="sample_signup.tpl">
User Name:<br><input type="text" name="user_nickname" style="width: 200px"><br>
Password:<br><input type="password" name="user_password1" style="width: 200px"><br>
Repeat Password:<br><input type="password" name="user_password2" style="width: 200px"><br>
Email Address:<br><input type="text" name="user_emailadr" style="width: 200px"><br>
Email Address:<br><input type="text" name="user_emailadr2" style="width: 200px"><br>
Artist Name:<br><input type="text" name="user_bandname" style="width: 200px"><br>
Language:<br>
<select name="user_language" style="width: 200px;">
<option value="chinese.lang.php"> chinese</option>
<option value="dutch.lang.php"> nederlands</option>
<option selected="selected" value="english.lang.php"> english</option>
<option value="french.lang.php"> français</option>
<option value="german.lang.php"> deutsch</option>
<option value="hebrew.lang.php"> hebrew</option>
<option value="hungarian.lang.php"> hungarian</option>
<option value="russian.lang.php"> russian</option>
<option value="spanish.lang.php"> español</option>
<option value="vietnamese.lang.php"> vietnamese</option>
</select>
<br><br>
(insert your terms of service here)
<br><br>
<input type="submit" value="sign me up!" style="width: 200px">
</form>
{/if}
 
</td>
</tr>
</table>
</body>
</html>

Note that this same template is used for the login form, the success message that is relayed to the user after they have successfully signed up, as well as to relay any errors that the user may encounter when attempting to signup for an Artist Account. The important parts to note in this section are:

{if is_numeric($USER_ID)}
{* looks like they signed up successfully - show them the success message *}
<big><b>Congratulations!</b></big><br><br>You have successfully signed for an account on {$system_name}. Please check your E-Mail<br>
for an authorization code that you can use to access the system. Thank you!

Note that the $USER_ID variable will only be set if the user has successfully registered, so this is a good “flag” to use in the template to let us know that the signup was successful. We check to see that the $USER_ID is a numeric value (by using the php is_numeric function), and if it is we are going to show our Success message to the user.

{* make sure and have a section here where you check to the see if the
template is getting a signup error - if so, show it *}
{if !empty($SIGNUP_ERROR)}
<font color="#FF0000"><b>{$SIGNUP_ERROR}</b></font>
<br><br>
{/if}

If Jamroom detects an error in the entry data by the user (i.e. bad passwords, artist name already in use, etc.), the Smarty variable “{$SIGNUP_ERROR}” will be populated with the actual error text that would need to be displayed to the user. You can see how we are “testing” the variable first:

{if !empty($SIGNUP_ERROR)}

to see if it is not empty (by using an exclamation mark in front of a PHP function you “inverse” the test). The manual page for empty() can be visitied for more info on what empty does in PHP.

After you have customized your Signup template to suit your needs, the next step is to run it from Jamroom so it is displayed correctly.

Running your Custom Signup Template

Now that you have completed your custom template, the next step is to let Jamroom “parse” the template and create the output you (are hoping) to see. The “signup.php” script is used to parse the template. Try typing the path to the signup.php script into the URL location box of your browser - i.e.:

http://yoursite.com/jamroom/signup.php?template=sample_signup.tpl

You can see how we “pass” the name of the template we want to use into the call to the signup.php script 1). Of course, change the name of the template file to match your template, as well as use your own domain name (or IP Address).

If successful, you will see the output of the template file you requested - hopefully looking somewhat like you wanted.

Now you can use this “test” to finalize your template and get it looking exactly as you want. Once it is ready to go, its simply a matter of using it on your site.

Using your new Custom Signup Template

Now that you have tested and modified your signup form to suit your needs, there are a couple of ways you can “call” the script to link to it (or embed it) into your website:

  • The first (and easiest) method is simply to place a link on your front page that points to the signup page, just like you were using above to test:
    <a href="signup.php?template=sample_signup.tpl">Click here to Sign up!</a>

    . This makes it easy to keep your signup page seperate from the rest of your content, and other then creating the link on your page, you are done!

  • The second way of doing it is to “embed” the signup form in another page. This can be accomplished via the PHP “include” function. For example, lets say you already have a page called “index.php” which is the main page for your web site. First, find the location in the HTML part of the page that you would like the signup form to be embedded, and place code like the following:
<?php
include("http://yoursite.com/jamroom/signup.php?template=sample_signup.tpl");
?>

Now, when you refresh your index.php page you should see the signup form “embedded” into the location you placed it in the code.

1) this method of variable passing is often referred to as using “GET” variables
Solutions Products Support Community Company
Social Media Platform
Social Networking Software
Musician Website Manager
Community Builder
Jamroom 5
Jamroom 5 Modules
Jamroom Marketplace
Support Forum
Documentation
Support Center
Contact Support
Community Forum
Member Sites
Developers
About Us
Contact Us
Privacy Policy
©2003 - 2024 The Jamroom Network