When developing
custom templates for your web site. You have the ability to include the
template variable ##CUSTOMPHP##
within the HTML template. The builder program will place the contents
of the custom include file, template_include.inc in place of
this variable. Unlike the other custom includes, this filename must be
exact and is the only one that can be used for the template. However,
remember, with PHP we can use logic to determine what page is being viewed
and other information about the current session to deliver any type of
information that we desire.
Custom navigation
elements is an obvious use of this include file. In this example, we will
use a not so obvious idea for the use of this include. Let’s say
we are designing a membership based site using the secure authentication
system. We simply want to display a welcome message on the template to
our site visitor once logged in or we wish to display their current member
information. Though this is a very simplistic example, it will give you
a start that allows you to build very dramatic includes for this use.
What variables
are available to us within the session once an authorized user has logged
in? (These variables are available in all scripts once a user logs in)
Variable
Name
|
Value
|
Description |
$OWNER_NAME
|
Soholaunch.com,
Inc.
|
Owner
name as specified in the authorized user setup |
$OWNER_EMAIL |
sales@Soholaunch.com
|
Owner
email address as specified in the authenticated user setup |
$GROUPS
|
Members;Users;
|
Security
code (groups) that this user has access to (semicolon delimited) |
$MD5CODE |
as28775023Iuia234
|
Internal
system code that identifies this user uniquely through the system.
Through manage account functions, users can change name and email
addresses. |
Let’s write
our simple script:
<?PHP
if (isset($GROUPS))
{
echo "Welcome $OWNER_NAME.";
} else {
echo "Please login in. ";
echo "<a href=\"pgm-secure_login.php?".SID."\">Click
Here</a>.";
}
?>
|
|