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 as follows:
- Add and alter content:
- Edit the main page (index.php).
- Add new pages, linked to from the main page.
These might describe your project's research, its leadership team, etc.
Typically these are .php files of the form
<?php require_once("../inc/util.inc"); page_head("Title"); ... content page_tail(); ?>
- Customize page headers and footers (see below).
- Set config options (see below).
- Give the web site a graphical identity (fonts, color scheme). Do this using CSS stylesheets.
Try to do a good job; your web site has a large impact on your project's ability to recruit and retain participants.
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.
- The name of your project
- Base URL for web pages (usually same as master_url defined in config.xml).
- (optional) URL prefix for forms with passwords. If your web server supports HTTPS, set this accordingly.
- Name of stylesheet file (such as white.css)
- Name of an optional project supplied stylesheet.
- Path (relative to html/user) of icon file shown in web browser tabs.
- relative path to user-uploaded profile images (default: ../user_profile/images/)
- url path to above defined path, is appended to URL_BASE (default: user_profile/images/)
- relative path to user profiles (default: ../user_profile/)
- url path to user profiles, is appended to URL_BASE (default: user_profile/)
- name of a text file that contains language names that are shown in a selection box to the user at his profile. File is expected in html/user. (default: languages.txt)
- Name of copyright holder
- Users are directed here if they have complaints about message-board moderation.
- Messages about user-of-the-day running low are sent here.
- Send email if # of UOTD candidates falls below this (default 7)
- Moderation-related emails (such as user complaints) are sent here.
- Regular expression used for controlling account creation.
- 'from' address for emails
- 'from' name for emails
- If defined, show country flags in forums. Steps:
- Download flag images from http://www.famfamfam.com/lab/icons/flags/famfamfam_flag_icons.zip
- Put the .png's in html/user/flags/
- Put define("COUNTRY_FLAGS", 1); in your html/project/project.inc
- Set this to true to merge Message boards and Q&A section
- Set this to true if your web site includes custom PHP script that use the old (and now deprecated) mysql_* MySQL interface.
The following constants, if defined as true, turn off web features involving user-supplied content. This eliminates having to deal with spammers.
- Turn off team-related features.
- Turn off profile-related features.
- Turn off forums. Project admins can still post and edit news items; there's a link to this in the project admin page.
- Don't show badges.
- Signature image filename
- Name of project director
- Project logo image filename (if any)
- Institution logo image filename (if any)
- An array of strings. An account's email address may not end with any of these strings.
- Prints page header
- Prints page footer
- 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.
- return a string describing instructions for a particular forum (e.g. how to post in Questions and problems).
- return a string describing message board policies.
- Displays customized project rules and policies. If return value is true, standard rules and policies are appended. If function is not defined, default rules and policies are displayed.
- Return project-specific text to be shown after user name.
- Prints project-specific text on private user page
- Prints project-specific text on user page
- Prints project-specific text on workunit page
- Prints project-specific info on server status page (server_status.php).
- show_profile_heading1(), show_profile_heading2()
- Text on user profile page
- show_profile_question1(), show_profile_question2()
- Text on user profile page
To use PHPMailer (the preferred way to send emails to participants), you must download PHPMailer and put it in PROJECT/html/inc/phpmailer (i.e. the files class.smtp.php and class.phpmailer.php should be in that directory). Then modify the following function:
- return a PHPMailer object with authentication information (see ServerIntro#PHPMailer),
used when the above is set to true.
If you do not define make_php_mailer() then e-mail to participants can still be sent, but it will use PHP's simpler mail() function.