The CHC Forum comes with a script that sends new messages to users who have opted to receive new posts via email. The mailer is not part of the extension itself because in some cases it may be sending hundreds or thousands of emails (depending on how many users you have in your forum) when a new message is posted, and users should have to sit their waiting while it runs. Therefore, your best bet is to have the mailer run on a regular basis via a cron job. If you have the CGI version of PHP installed (it's compiled as a standalone app rather than as an apache module), then you can execute it via cron as though you were executing it from the command line. If PHP is installed as an apache module, which is probably more likely, then you can execute it using the text based browser Lynx. In this case, the entry in crontab might look like this:
*/5 * * * * lynx -dump http://www.yourdomain.com/path/to/mailer.php
This would cause the mailer.php script to be executed every 5 minute. For more information on setting up PHP scripts as cron jobs, take a look at http://www.phpfreaks.com/tutorials/28.0.php
When the mailer is executed, it looks through the post table for all posts where sent_flag is set to 0, which is the default for all new posts. It then grabs the post information, and puts the message in its own queue. Once it's queued all the messages that need to be sent, it takes each message, one at a time, gets a list of recipients, and sends the emails using a pear bulk mailer, which is bundled in the extension.
In versions prior to 0.5.*, the mailer "from" address was set in the mailer.php file, which is at path_to_ext/chcforum/mailer/mailer.php. As of version 0.5.*, this setting has been abstracted from the mailer script and placed in the forum plugin flexform. This is also true for the message template. So, be sure to set the from address in the "mailer" section of the flexform. You'll also need to set the message template using the markers listed above (in the "Set Forum Configuration" section of the documentation). A sample template might look like this:
Posted by: {author_name}Conference: {conference}Thread: {thread}{text}This message was sent by the chc forum because you have opted to receive new posts via email.{link}You may also need to change the path to localconf variable, at line 11, depending on where you installed the extension. If you installed the extension locally (in the typo3conf directory), you shouldn't need to change this setting.
Changing the look and feel of the forum isn't too difficult. The styles are located in the ext_typoscript_setup.txt file. If you want to modify them, just copy them into your template and change them according to your needs. Thanks to Ben van t'Ende, the colors for the forum have been taken out of the setup file and put into the ext_typoscript_constants.txt file. This means that you can quickly modify the forum color scheme via the typo3 backend. Simply click on the template module and select the template for your site. Choose the constant editor from the dropdown menu and select “CHC_FORUM” from the category drop-down menu. Almost all of the colors for the forum can be set here, allowing you to quickly fit the forum into your own site's design.
If you want to change the colors of the rounded buttons that appear on individual posts, you will need to modify the two files in chc_forum/pi1/img/. There are two files in this folder, btn_bkgrnd.gif and btn_bkgrnd_hov.gif, which are used for the button rollover effect. The text for these buttons is created dynamically by the forum, so changing the color of the buttons should be as easy as modifying the files in a graphic editor.
All of the HTML for the forum is located in chcforum/pi1/templates/. These files are HTML templates that get parsed with the tpower class (slightly modified version of TemplatePower - http://templatepower.codocad.com). The markers are contained in '{ }' brackets, and it should be easy enough to modify these templates.
The best way to begin skinning the forum is to copy the contents of chcforum/pi1/templates to another location (somewhere in fileadmin is probably a good bet). Using the backend forum module, add the path to the new folder containing these templates to the forum configuration (see above, step 1 of forum administration). Once you've set the path to your template files, the forum will use these rather than the default ones. Now that you've moved the new template files out of the forum directory, you don't have to worry about your files getting written over each time you upgrade the forum. Modifying the templates should be rather self explanatory - you need to leave the block markers as they are (eg. <!-- START BLOCK : blockName --> CONTENT <!-- START BLOCK : blockName -->), and you should make sure that you don't leave out any of the markers for dynamic content (the sections that are surrounded with { and } ).
If you don't want to modify the templates, you should be able to change the look and feel dramatically by modifying the style sheet. I did my best to keep the templates sparse and rely on the style sheet for most, if not all, formatting.
If you come up with a great template or a fantastic set of styles, send me a copy and I'll see if I can include it in future releases. It would be nice to bundle some default skins with the forum.
The following table shows the purpose of each template file as well as the available markers in each template. Many template contain sub blocks that repeat in the template, which are signified by <!-- START BLOCK : name --> and <!-- END BLOCK : name -->. In the available markers column of the following table, the block name is signified by italic text. The "root" block is the master block in the template (not explicitly noted in the file). All content markers are surrounded by { and } -- for example: {header_title}.
Template File | Purpose: | Available Markers: |
|---|---|---|
cat_view.tpl | Used for the default forum view that lists all the categories and their conferences. | root: header_title, header_thread, header_post, header_last cat_list: cat_row: cat_title conf_row: conf_name, conf_desc, conf_new, conf_thread_count, conf_post_count, conf_last_post_data |
conf_view.tpl | Used to display the conference view (a listing of threads) | root: header_image, header_title, header_replies, header_author, header_last, cat_title thread: thread_image, thread_subject, new_posts, hide, thread_replies, thread_author, thread_last |
footer.js | Contains javascript for the footer (no longer used) | |
footer.tpl | The footer box that appears in the category view. | root: total_posts, total_users, edit_profile |
global.js | Contains any global javascript used throughout the entire forum (not currently used) | |
header.tpl | Contains a header for the forum. By default, this is just the box with the gradient background image and the forum title. | root: img_path, content |
message_box.tpl | This template contains a bunch of sub blocks, each of which represents a different type of "message" box used by the forum. Odds are you can change the look and feel of these boxes using CSS, although you could also change it here. | All of the following blocks can contain only one marker: text. error, error_no_border, link, page_links_top, page_links_btm, message, nav_path, profile_hdr, profile_hdr_big |
post_form.js | This file contains all the javascript needed for the post form. For the most part, the code here handles the buttons on the post form and client-side validation for new posts. | root: b_help, i_help, u_help, q_help, c_help, p_help, w_help, a_help |
post_form.tpl | Contains the HTML for the post form. | root: action, hash_view, hash_fe_user_uid, page, hash_post_uid, hash_thread_uid, hash_conf_uid, hash_cat_uid, where, stage, label_where, label_name, username, name, label_email, email, label_subject, subject, label_instruct, img_path, form_help, close_tags, text, label_attachment, attach_inpt, submit, preview_btn, cancel emoticons: emoticons |
search_form.tpl | Contains the search form. | root: action, simple_search_hdr, simple_search_hdr, search_kw, exact_match, search_uname, exact_match, adv_search_hdr, search_cats, where_options, post_age, age_options, post_fields, post_fields_all, post_fields_titles, display_results, display_posts, display_threads, submit_search_hdr, submit_search_hdr, submit_inpt |
single_post.tpl | Contains the html for a single post. This template is also used for post previews. | root: anchor, message, img_tag, author_lbl, author_name, date_lbl, date, time, subject_lbl, subject, aim_link, yahoo_link, msn_link, customim_link, cwt_buddylist_link, cwt_user_pm_message_new, parsed_post_body, reply_link, quote_link, admin_ip, admin_edit_link, admin_delete_link, admin_unhide_link attachment: attachment rate: stars, score, action, rate_label, rate_select, rate_submit_value |
sub_tool_bar.tpl | Contains the tool bar below the main one. This tool bar is displayed in conference and thread views. | close_thread: alt, img, link watch: watch_alt, watch_img, watch_link |
tool_bar.tpl | The tool bar appears at the top of every forum page. It is the box that contains the links to the user profile, search, new messages, etc. | root: search_alt, search_img, search_link is_user: mark_read_alt, mark_read_img, mark_read, new_alt, new_img, new_posts is_profile: profile_alt, profile_img, profile_link buddylist: buddylist_alt, buddylist_img, buddylist_link user_pm: user_pm_alt, user_pm_img, user_pm_link ulist: users_alt, users_img, users_link |
user_list.tpl | This is the template for the chc_forum user list. You're probably better off using cwt_community integration instead of the built in user list, because cwt_community has more features than the default list does. | root: action, hdr_user_list, hdr_name, hdr_posts, hdr_joined, hdr_email, hdr_search, lbl_search, submit user: name, joined, posts, email |
XHTML Comptability
The chc_forum strives to be XHTML strict compatible. If you find a spot where the code is not XHTML compatible, please email the forum developers so we can fix this.
9 out of 10 problems have to do with not setting the general records storage page or starting point value correctly. You must set this value for the forum to work correctly -- set it by editing the "page header" of the page that contains the forum plugin -- set the "general records storage page" value to the page on which you want to store forum records.
If the forum isn't working properly, try disabling caching for the page in which it resides. To do this, edit the header of the page and check the “no cache” option (right below the page title field).
If the mailer isn't working, it might be because you've installed it globally rather than locally - that's fine, but you may need to change the path to localconf by editing the mailer.php file (there's a comment near the beginning of the file that explains what you need to change). Make sure you set up the template correctly in the forum flexform.
Attachments not working? Having problems with the forum? Make sure that you've configured the forum correctly using the plugin flexform.
Need to change the order of the text in some of the labels? Check out the typoscript setup for the forum.