Usage and Customization
This document details how to use/include the relevant Enthusiast 2.x files into your website, as well as to customize various aspects of the includes.
How to include the scripts in your site
- To get the last updated date:
- Desired output:
Last updated: January 25, 2006
Code:
Last updated: <?php include 'backend/get_last_updated.php'; ?>
- To get the member count:
- Desired output:
Approved members: 104
Code:
Approved members: <?php include 'backend/get_member_count.php'; ?>
- To get pending members:
- Desired output:
Pending members: 5
Code:
Pending members: <?php include 'backend/get_pending_count.php'; ?>
- To get newest members:
- Desired output:
Newest members: Mary, Jane, and John
Code:
Newest members: <?php include 'backend/get_newest_members.php'; ?>
- Join form
- Desired output: the whole join form (customizable using CSS)
Code:
<?php include 'backend/add_member.php'; ?>
- Fans list
- Desired output: the whole members list (semi-customizable using CSS)
Code:
<?php include 'backend/show_category.php'; include 'backend/show_fans.php'; ?>
- Update information form
- Desired output: the whole update form (customizable using CSS)
Code:
<?php include 'backend/update_member.php'; ?>
- Lost password form
- Desired output: the whole lost password form (customizable using CSS)
Code:
<?php include 'backend/reset_password.php'; ?>
- Affiliates list
- Desired output: the affiliates list (customizable using CSS)
Code:
<?php include 'backend/show_affiliates.php'; ?>
- Affiliates list with custom spacers
- Desired output: the affiliates list, with a custom spacer (<br /> in for example, or commas, etc); customizable using CSS
Code:
<?php $spacer = ', ' // set this variable to the spacer you want include 'backend/show_affiliates.php'; ?>
How to customize your additional fields for the join form
You can setup how your additional fields are shown on your join form by creating a file called addform.inc.php
on your fanlisting root and writing your additional fields there (see included file in the downloaded archive for an illustration on how to go about it; feel free to modify/delete it if you wish or you don’t need additional fields).
Important notes:
- Make sure your input tag names (the
name
attribute ofinput
/textarea
/select
tags) are named as your database column is named, which can be seen atbackend/config.inc.php
(these are the values of the$additional_field_names[]
variable). - If you want to customize one field, you have to customize all of them. For example, you want to make only one of the additional input fields into a
select
tag (a drop-down field); you not only have to include that in your form, but you will have to create input tags for all fields (they may be ordinaryinput
tags). - Especially if your web server does not hide PHP errors when parsing PHP, or if you’re just as nitpicky as I am, when using radio fields (i.e., <input type=”radio” …), you have to automatically select at least one (i.e., <input type=”radio” checked=”checked”… ).
- These additional forms only allow up to 255 characters, spaces included. So be sure to limit characters if you’re using a textarea.
How to customize your members’ list display
You can edit how members’ information are displayed on your listing by creating a file called list.inc.php
on your fanlisting root and writing your template there (see included file in the downloaded archive for an illustration on how to go about it; feel free to modify/delete it if you wish — and modifying it (or altogether deleteing it) is actually highly recommended as by default it only serves to illustrate the different variables you can use).
Also, if you wish to use tables or list tags such as ul
(unordered lists), ol
(ordered lists), or dl
(definition lists), you can add a listheader.inc.php
and listfooter.inc.php
file where you can add your opening table/list tag (<table>
, <ul>
, <ol>
, <dl>
) and your closing table/list
tag (</table>
, </ul>
, </ol>
, </dl>
).
Some tips:
-
$$fan_email_plain$$
is useful if you wish to not show the full email address on your members list, as$$fan_email$$
will do. The only advantage of$$fan_email$$
is because it’s JavaScript-protected, people can still click on the email link and not need to edit the mangled email address. However, if this goes against your tastes, you can opt to use$$fan_email_plain$$
instead of$$fan_email$$
, such as:Email: <a href="mailto:$$fan_email_plain$$">@</a>
Output (what can be seen on browser by visitor):
Email: @Output (what can be seen on status bar, also the actual link):
mailto:user {at} domain.tldAs opposed to:
$$fan_email$$
Output (what can be seen on browser by visitor):
user@domain.tldOutput (what can be seen on status bar, also the actual link):
mailto:user@domain.tld -
$$fan_url_plain$$
is useful in the same way$$fan_email_plain$$
is; if you want to customize how links are shown. This is especially useful if you have a number of people joining with long URLs and your content space for the members’ list is small. The only advantage of$$fan_url$$
is that it naturally incorporates your$link_target
setting, though this is by no means a major advantage.