wiki:WebConfig

Version 9 (modified by davea, 16 years ago) (diff)

--

Web site customization

Customizing the default web site

When you create a BOINC project using make_project, a web site is created for you. This consists of a front page (html/user/index.php), which links to pages where users can log in, edit preferences, create profiles, and so on.

Before your project goes public, you'll want to change this web site by adding content and giving the web site a graphical identity specific to your project. Make sure you do a good job; your web site has a large impact on your project's ability to recruit and retain participants.

Some of this customization can be done by editing the main page (index.php) and the stylesheet (white.css) files. Other aspects are changed using a configuration file, described below.

An alternative version of the Account page, with many graphical icons, is available here: http://boinc.berkeley.edu/BOINC_WebIcons_and_php_code.zip

Web configuration file

The file html/project/project.inc serves as a configuration file for your web site. It exists in a separate directory (html/project) so that you can put all project-specific web files there (create symbolic links from html/inc and html/user). You should put this directory under version control (SVN or CVS).

The file project.inc is generated by make_project with default values. Edit this file to customize the constants and functions it contains.

Constants:

PROJECT
The name of your project
MASTER_URL
Your project's master URL (warning: if you change this, volunteers will have to detach/reattach your project)
URL_BASE
Base URL for web pages (usually same as master URL)
STYLESHEET
Name of stylesheet file (such as white.css)
COPYRIGHT_HOLDER
Name of copyright holder
SYS_ADMIN_EMAIL
Users are directed here if they have complaints about message-board moderation. Also, messages about user-of-the-day running low are sent here.
FORUM_MODERATION_EMAIL_USER_ID
Moderation-related emails (such as user complaints) are sent here.
INVITE_CODES
Regular expression used for controlling account creation.
EMAIL_FROM
'from' address for emails
EMAIL_FROM_NAME
'from' name for emails

Certificate-related constants:

CERT_SIGNATURE
Signature image filename
CERT_DIRECTOR_NAME
Name of project director
CERT_PROJECT_LOGO
Project logo image filename (if any)
CERT_INSTITUTION_LOGO
Institition logo image filename (if any)

Functions:

project_banner()
Prints page header
project_footer()
Prints page footer
show_profile_heading1(), show_profile_heading2()
Text on user profile page
show_profile_question1(), show_profile_question2()
Text on user profile page
project_workunit($wu)
Prints project-specific text on workunit page
project_user_summary()
Prints project-specific text on user page
project_user_page_private()
Prints project-specific text on private user page
donations_intro()
Displays customized donation information. Useful to describe what the project uses donations for, and project specific guides for donations. If function is not defined, standard donation information is displayed.html/user/donations.php.
project_rules_policies()
Displays customized project rules and policies. If return value is true, standard rules and policies are appended in the end. If function is not defined, default rules and policies are displayed. Return true to append default rules and policies. Should use PHP echo() to output text. Used inhtml/user/info.php.

To use PHPMailer (the preferred way to send emails to participants):

USE_PHPMAILER
Set to true if you use PHPMailer. In this case you must download PHPMailer and put it (i.e. the directory 'phpmailer') in your html/inc directory.
PHPMAILER_HOST
The Host argument to PHPMailer; typically a semicolon-separated list of SMTP servers.
PHPMAIL_MAILER
The Mailer argument to PHPMailer; typically 'sendmail', 'mail', or 'smtp'.

If you do not set USE_PHPMAILER then e-mail to participants can still be sent, but it will use PHP's simpler mail() function.