Here are links to the phpBB Digest Modification that I wrote, along with previous versions.
If you want to encourage me to maintain this Digests mod, please consider sending me a small donation.
Brief Description of the phpBB Digests
Sends customized email digests of forum messages to subscribers of a phpBB Version 2.x forums. Daily or weekly digests can be sent. This modification is "lightweight" in that it does not heavily modify phpBB.
Detailed Description of phpBB Digests
Out of the box, the popular phpBB forum software does not provide the ability to send regular emails to users with postings on the phpBB site. phpBB expects that users will visit the phpBB site regularly if they want to keep up with what is going on at the site.
phpBB Digests are just emails sent to users periodically with summary of postings made on a phpBB forum. Weekly or daily digests are available. Digests makes some phpBB forum users' lives easier. They don't have to
explicitly visit the site to see what conversations are going on
around there. They just read their digest and if there is some topic that
seems of interest, they click on it in their email program and start
participating! They can unsubscribe at any time. Digests can be sent daily or weekly. By default, weekly digests are sent on Sundays. The users determines the hour they want to receive the
digest. Whatever time they choose, they will always get the latest news
so they can pick a time that suits their lifestyle.
What time period is covered by the digest?Either 24 hours or 7 days, depending on whether you selected a daily or weekly digest. Messages older than this will not be sent. In addition if you want you can elect not to see messages since you last logged in, if you visited recently. You can even filter out your own messages.
If a user does not want summaries of every message, they can be selective. They can pick the forum or forums that interests them. By default they will get messages for all forums that they are allowed to access.
Digests can be sent as emails containing HTML or plain text. Unless the user's email program can't handle HTML (very unusual these days) we suggest HTML. Frankly, text digests look pretty plain and are harder to use. That's the nature of plain text. By default the user gets the entire post as text, but they can also select to see excerpts
of each message. They can select the first 50, 100, 150, 300 or 600 characters, or the full
text of the message. An excerpt reduces
bandwidth and is usually all that is needed. Why? Because each message
has a convenient link that will take you to the topic or message of
interest.
The phpBB Digests software can be challenging to install. It requires a "cron" or similar operating system utility that can wake up once an hour and call a program called mail_digests.php. This program sends a digest to anyone who subscribed to get a digest at that particular hour. I may be willing to install it for a fee. (The standard price is $30, in most cases.) If interested see my phpBB Services page.
phpBB 3.x Version
An Alpha version lacking many features is now available for testing.
phpBB 2.x Future Development
This is likely to be the last version for phpBB 2.x given that phpBB 3.x is coming out, unless a bug fix release is needed. I will continue to report critical bugs and will release new versions as needed to fix critical bugs.
Bug Log
As bugs are reported I will post them to the Digests Bug Log. You can also ask questions in my support forum. (Some forums link to the appropriate forum on phpbb.com.)
Version Archive and Notes
If you are interested in purchasing my services to install the Digest modification or want to learn more about this modification on your site, click here.
This is a first "rough cut" of Digests for phpBB 3 which is missing lots of features that will be in the final version. It should not be used on a live board. Please provide feedback in the phpbb.com topic.
One button press allows you to create digest subscriptions for all unsubscribed users (except administrators)
Selectively make groups of unsubscribed users receive digests
Add a single user to receive digests
Digest Configuration
Global Settings
Enable/disable ability to automatically send digests to new users
Use interface to set the automatic subscription type to daily or weekly
Use interface to set the day of the week to send weekly digests
Use interface to set custom stylesheet path
Use interface to set digest date format
Use interface to modify the reported encoding for HTML and text digests
Set the number of digest subscribers you want to see per page in the ACP
Use interface to set whether key parameter should be used with mail_digests.php, and to specify the key parameter
Use interface to set the summary date format for the digest
Use interface to set the absolute path for mail_digests.php to use, if the relative path does not work
Default Digest Settings
Use the interface to set the defaults that will be presented to new users in digests.php when they want to subscribe to a digest
Set the default time of day to receive digests to a random hour, to even your server processing load
Version Check. If you are not running the latest release of the mod, you will be given a message
Modify Subscribers
Sophisticated user interface allows ad-hoc groups on a page to be selected for global updates or deletes
Change individual digest subscription settings (except for forums subscribed)
Delete individual digest subscriptions
New and unread private messages received since a user's last board visit can show in the digest. User can control in their digest settings whether they want to see private messages in the digest.
New /install/digest_upgrade_db.php script makes intelligent changes to database if you are upgrading based on your previous version
Ability to automatically enroll new users to receive digests
Minor New Functionality
Screens have standard phpBB look and feel
After screens are submitted, response screens have standard phpBB look and feel (message_die() is used rather than individual post templates)
digests.php
Next to the forum name the forum will show any usage restrictions that apply, such as registered users only, user group members only, moderators only and administrators only
lang_faq.php
New entries in the Digest FAQ covers automatic subscriptions, private messages in digest
mail_digests.php
Shows ancillary text in the digest in the user's language, not in the board default language.
Digest header shows both the total number of posts in the digest and the total number of private messages in the digest
Digest footer shows the type of digest being sent: Enhanced HTML, Plain HTML or Text
Bugs Fixed
SQL with columns or functions set with AS 'column name' syntax now uses AS 'column_name' syntax. This appears to be more portable across DBMSes.
Fixed obscure bug where if the same forum name is used in different categories, only one of the forum names appeared in digest
Fixed bug reported by user that did not properly close the HTML table if the text length for each post is less than the post text length
Fixed bug that applies the postbody class to plain HTML digests
Replaced Windows carriage return line feeds in the digests (\r\n) to Unix newlines (\n)
File Changes
includes/digest_constants.php removed. The few remaining constants needed are now in includes/digest_functions.php. Most constants were rolled into the phpbb_mod_digest_settings table.
install.txt becomes digests.mod. Detailed digest installation instructions will no longer be in this file, but on a web page for easier access.
batch_scheduling.txt removed. Equivalent information will be placed on the digest installation web page
templates/subSilver/digests.tpl becomes templates/subSilver/digests_body.tpl, which is the standard phpBB convention
templates/subSilver/digests_posts.tpl removed.
Several new files need to be edited. See digests.mod
Upgrade implications
install/digest_upgrade_db.php eases changes needed to the database. Run this before removing the old installation.
In general you need to remove the old installation before upgrading. A few files have not changed from 1.0.16, but many have. In addition the Digest FAQ has been updated.
Files to edit that are unchanged from 1.0.16 are:
templates/subSilver/overall_header.php
includes/page_header.php
Files to copy that are unchanged from 1.0.16 are:
includes/digest_emailer.php
To uninstall, find the install.txt in the previous version of the digest and work in reverse.
Thank Yous
My sincere thanks and gratefulness to Sylvain Bourdon, who created did an excellent job of beta testing this release. He found many bugs I would have never discovered. In addition, Sylvain provided an updated French translation for this release.
IMPORTANT: if your original installation was 1.0.12 or earlier, and your database is MySQL, please add 'PHTM' as an enumerated type in the format column of the phpbb_mod_subscriptions table, ex: enum('HTML', 'TEXT', 'PHTM')
Much credit for this version goes to Sylvain Bourdon, who went through the code thoroughly and suggested numerous improvements
User can select whether they want plain HTML or enhanced HTML in digests.php. Enhanced HTML is the default and includes clickable links, images, BBCode support and smilies in the digest. Note: this means this feature is no longer controlled in digest_constants.php, so that constant has been removed from the file. By default if a user has selected HTML digests they will get the enhanced version.
Improved logic in unCheckAllForums so that if all individual forums are subscribed the All Subscribed Forums checkbox is checked automatically.
Better French translation provided courtesy of Sylvain Bourdon.
digests.php includes redirection for unregistered users and links that include the current session.
Text digests have been improved to be consistent with HTML digests where possible.
A link to the digests support page is now included on the digest subscription page (at the bottom of the page)
Fixed bug in mail_digests.php which was not properly limiting text length of messages in fancy HTML digests.
Fixed bug in mail_digests.php that was not showing smilies in the HTML enhanced version.
Redid logic in mail_digests.php to output XHTML. Certain tags were not in the "right" places according to the W3C validator. These problems are now fixed. A </span> tag was added and a redundant </tr> tag was removed. However, your email client may make the HTML incorrect by adding and subtracting HTML in the email message.
digests.php modified to show an explicit message whether you have a subscription or not. It was ambiguous.
Improved posting logic for Anonymous/Guest users (courtesy of Sylvain Bourdon).
batch_scheduling.txt improved to talk about curl and wget. curl is now my recommended default way to program cron jobs
since it is widely supported by web hosts and is relatively simple to set up.
Total post count appears near the top of the digest. (If upgrading, please install new .tpl files under
/lang/lang_english/email.)
If an Administrator is receiving digests, all forums are shown by digests.php. There is no need to have
appropriate usergroup permissions.
If a Moderator is receiving digests, all forums with moderator read permissions are shown by digests.php.
There is no need to have appropriate usergroup permissions for moderator only forums.
Fixed a bug in mail_digests.php that did not calculate the $offset variable correctly for the timezone logic
Post times are now displayed in the digests in user's local time, based on timezone in their phpBB profile
New feature: to keep unauthorized people from running the mail_digests.php program and possibly causing
duplicate digests to be sent for the same hour, a "key" parameter can now be specified. It will only work if
DIGEST_REQUIRE_SEND_KEY is set to true in digest_constants.php. You can set the value of the key in
digest_constants.php by changing the value of DIGEST_SEND_KEY. Example with key enabled:
http://www.myforum.com/phpBB2/mail_digests.php?key=qwertyuiop
If you are upgrading and enable this feature, make sure you reprogram your cron or similar utility to pass
the correct argument and value.
New feature: test mode. If a parameter test=1 (the number) is present in the mail_digests.php URL, no digests
are sent. However, you will still see summary information, providing DIGEST_SHOW_SUMMARY is set to true.
Example usage:
http://www.myforum.com/phpBB2/mail_digests.php?test=1
This feature can be useful while troubleshooting so your subscribed users won't be pestered with additional
digests.
New feature: simulation mode. If a parameter simulate=1 (the number) is present in the mail_digests.php URL,
then all digests for the current hour that would be sent to subscribers are instead redirected to the email
address in the variable $lang['digest_from_email_address'] in lang_digests.php. (This is usually the board
email address.) If used with test mode, the test mode will override. This feature may help debug certain
problems. Example usage:
http://www.myforum.com/phpBB2/mail_digests.php?simulate=1
New feature: phpBB look and feel to posts in HTML digests. You should now see embedded URLs, images, and
anything in BBcode. Note that text digests will continue to show plain text. If you prefer a simpler version
of the posts (minus BBcode) set the new constant DIGEST_FANCY_HTML_STYLE to false.
Removed all $db->sql_freeresult statements, since they caused runtime errors for a small number of users
and are unnecessary anyhow.
Email MIME charset encoding now works with the DIGEST_HTML_ENCODING and DIGEST_TEXT_ENCODING constants.
lang_faq.php and new entries in lang_digests.php French translations by Rosalind A. Hamill.
Default text length for posts in digests changed from 150 to 32,000 (full message).
1.0.14 (archive unavailable)
11/6/06
Trimmed certain fields in digests.php that were a problem for SQL Server users
Discussed site monitoring services in batch_scheduling.txt
Fixed bug that might have showed duplicate forums in digest.php
Fixed bug: now declaring all arrays all arrays in mail_digests.php; fixed runtime error for one user
Fixed serious bugs that was showing forums that should not show; fixed in digests.php and mail_digests.php
French language translation provided courtesy of kilikil.
digest_tables.php will create appropriate tables for Postgres and MS SQL. In the past it would only create
tables in MySQL. Column names that were ENUM have been changed to CHAR for portability. If upgrading from
an earlier version, no changes are needed to your MySQL tables.
digest_tables.php is now in an install folder, per request from the Mod team.
copyright statements point to me rather than phpBB. Apparently this is allowed despite the GPL license.
digests.tpl was modified to remove IE specific code. This is no longer a problem since IE 5+ supports DOM 2.
2 copies of digest_constants was accidentally included in 1.0.12.
Fixed bug in digest_tables.php. user_id should use mediumint data type for phpbb_mod_subscriptions table.
This problem will manifest itself if the greatest_user_id in your database exceeds 32,767.
Fixed bug in mail_digests.php. In some cases it may not work correctly when installed on a virgin board
because init_userprefs was not called. Also added missing $board_timezone statement.
Character encoding for HTML and text digests can be set in digest_constants.php. No longer limited to
iso-8859-1 and us-ascii. This allows better support for internationalization.
SQL should now be database independent. MySQL specific functions moved out of SQL and implemented with
equivalent PHP code.
If the user is not logged in, the digest link no longer appears. This should solve many problems with
headers already being sent.
Summary message at the end of mail_digests.php can be turned on and off with the DIGEST_SHOW_SUMMARY constant
If the summaries are desired to be shown in mail_digests.php, the summary can be either in HTML or plain
text. Switch with the constant DIGEST_SHOW_SUMMARY_TYPE.
If a user is delete through the administrator control panel and the user has digest subscriptions, his
subscriptions are removed.
Formats for dates shown in digests can now be changed by changing constants such as DIGEST_DATE_FORMAT
Fixed bug in Version 1.0.9d & 1.0.9e that did not show labels for text sizes 50, 100, 150, 300 and 600
Version of digest software is shown in both digest pages and in the digests themselves. This will help
in future portability and debugging.
Replaced most variables used across modules with constants, including the big one, $siteURL which is now
the constant DIGEST_SITE_URL.
All constants start with the DIGEST_ literal for consistency.
Created a language file called lang_digests.php, removing language information from digest_constants.php
This will allow language modularization and could allow multiple language support for digests on the same
board. Also, this has been tested with phpBB 2.0.20.
digest_emailer.php updated to include relevant changes found in emailer.php since 2.0.6.
2006-05-16 - Version 1.0.9e
Updated this file to comply with latest phpBB mod standards, per request from phpBB mod team.
1.0.9b (this was the first official release on phpBB site)
4/4/2004
SQL commands are upper cased at the request of the mod team. Affects digests.php and mail_digests.php.
Please note that the programs are functionally identical so if it works in 1.0.8 you really don't need
to upgrade to 1.0.9.
Installation instructions below modified to use IN LINE AFTER, ADD per request from mod team.
Updated comments in each program to say it is designed to work with phpBB 2.0.8 (works for me). However
it should work fine in versions 2.0.6 and 2.0.7 too since they were used otherwise unmodified in these
environments.
batch_scheduling.txt instructions changed to correct $phpbb_root_path for the URL-less approach
digest_constants.php corrects problem many are experiencing with $siteURL, to add a / after the site
name if it is not there. This should reduce many installation problems.
digest_tables.php modified to fix a tab problem in source code
digests.php. Fixed some serious problems noted by the MOD team. POST variables are now wrapped with
function to eliminate potential SQL injection hacks. In addition incorporated their suggestions for
using variables to set $user_timezone, changed all occurrences of $userdata['session_user_id'] to
$userdata['$user_id'], and fixed some tab problems in the source code
digests.tpl now has <span> tags to fix the "big print" problem many were complaining about
mail_digests.php has time zone logic in it that was missing from the last release and fixed some tab
problems in the source code
suggested_faq_text.txt file removed from archive since it is now included in these installation
instructions below
digests.tpl modified to apply styles (work done by zocalo, thanks!) so interface presents
better. I also added a cell spacing of five pixels to make it easier to read.
digest_constants.php changed to add digest explanation variable so it will be XHMTL
compatible with modified digests.tpl. Removed digest_not_logged_in message.
digests.php redirects users not logged in to login in page. Thanks to zocalo again for this
suggestion. There was a redundant call to use the template digests.tpl. The first call was
removed.
Slight changes in wording to suggested_faq_text.txt.
These instructions to make changes to page_header.php have been changed. Now includes a
line of code referencing digest_constants.php and uses a label variable I neglected to
include in the last version
digests.tpl form action template variable name changed to {S_POST_ACTION}
These instructions changed to use a template variable for the digests URL in overall_header.tpl
and to indicate how page_header.php needs to be modified to pass the digests.php URL to
overall_header.tpl
Cleaned up a few minor coding problems at variance with the coding standards
Modified digest_constants.php to have two disclaimer messages, one for HTML formatted email and
one for text formatted email. This will keep the URLs from appearing in the disclaimer by
default for text digests. Also fixed bug that was not displaying page title by adding the
language variable.
Modified mail_digests.php to show toggle the disclaimer message depending on whether the digest
is html or text.
Modified mail_digests_html.tpl so digest options and disclaimer show inside <p> tags, so styles
are applied.
Added suggested_faq_text.txt file. Copy and paste into your lang_faq.php file if you want to
provide answers to basic questions about the digest. Location in the FAQ is up to you depending
on how important you think it is.
Time zone logic improved to use actual server time zone instead of board time zone, since
board time zone may be set to a time different than the server time zone. This logic affects
digests.php. Also added helpful information to mail_digests.php that shows who received digests
for a given hour and how many digests were sent. This will only be seen if run manually such
as by URL, but if run from command line or batch output can be captured to a file in Unix or
Linux systems by piping.
Now handles time zones correctly. User asks for digests to arrive based on their local time
(assumed to be the time zone set in their profile). If this is different from the server
time zone, the server takes this into account. Note that the subscriptions table will
store the time zone based on server time. So 7 PM PST (hour 19) is stored as 22 if the
server is hosted in EST. Changed: digests.php and two lines of code in digest_constants.php.
Note: if user changes their time zone in their profile, the hour to send the digest does NOT
change. To correct this would involve a hack to profile.php, that I considered unwise.
Minor changes to mail_digests.php to improve presentation of message text. BBcode is
removed and in the HTML version any \n is converted to a <br /> tag. No other changes.
Cleaned up bug in mail_digests.php that incorrectly reported last access time if user
wants to filter out messages since they last touched the board.
Added code provided by M Longland that allows users to set the maximum size of each message
to be included in the digest. WAS the value set in digest_constants.php. Now the user can
select 50, 100, 150, 300, 600 or Maximum (32,000) characters.
Enhanced message in digests.php so if someone is not logged in and wants a digest they are
reminded they have to register with the board first before they can enroll to receive
a digest.
batch_scheduling.txt provides good guidance for running scheduled tasks on a Windows 2000/XP
server.
digest_tables.php adds a new column, text_length int(11) NOT NULL default '0' to the
subscriptions table. If using a previous version you will need to manually add this
column to the subscriptions table. In addition you should update all rows in your
subscriptions table so that existing users have a text_length value of 150, so as not
to confuse them. Assuming the table is named phpbb_mod_subscriptions this SQL should work:
update phpbb_mod_subscriptions set text_length=150
Here is a link to an archival version of the Digest software produced by developers associated with the now defunct domain dormlife.us. It is reputedly buggy. I do not troubleshoot or support their version of the software, but you are welcome to try it on your site and work through any bugs you might find.