PunBB Resource

Your ultimate PunBB resource!

Keywords:

    (Extended)

You are not logged in.


Login to move these ads to the bottom of the page

#1 2005-10-09 11:42:18

trel1023
Member
Registered: 2005-01-30
Posts: 40
Website

Email Digests 1.0.4

Code:

There are no functional changes from 1.0.3.
This has been released to work with new PunBB 1.2.8 installs.


##
##
##        Mod title:  Email_Digests
##
##      Mod version:  1.0.4
##   Works on PunBB:  1.2, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8
##     Release date:  2005-10-09
##           Author:  Terrell Russell (punbb@terrellrussell.com)
##
##      Description:  This mod will add email digest capabilities to your
##                    PunBB forums.  Options are managed for/by each user
##                    through the standard Profile pages.
##
##                    Options include:
##                    - Daily / Weekly Delivery
##                    - Display excerpt of each message
##                    - Include my messages in the digest,
##                    - Include only the messages since my last visit
##                    - Send digest, even if it will be empty
##                    - Excerpt Length
##                    - Individual forum selection
##
##                    Administrators and Moderators can manage all users'
##                    digest subscriptions.  The ban list is enforced.
##                    Time zones are honored.
##
##
##      Added files:  lang/[LANGUAGE]/mail_templates/digests_email.tpl
##                    lang/[LANGUAGE]/digests_lang.php
##                    digests_include.php
##                    digests_send_now.php
##                    digests.php
##
##   Affected files:  include/functions.php
##                    lang/[LANGUAGE]/profile.php
##
##       Affects DB:  Yes
##                    Does not affect existing tables
##                    Creates two tables to manage digest subscriptions
##
##            Notes:  Email_Digests requires the digests_send_now.php script
##                    to be run automatically by the server.  This will
##                    require access and use of the crontab.  If you have not
##                    used the crontab before, use this script with caution.
##                    A misconfigured cron file may cause havoc on server
##                    load.  This script should be set to run once daily.
##
##                    Example Cron Entry:  (would execute at 5 AM daily)
##                    0 5 * * * /path/to/php /path/to/digests_send_now.php
##
##                    Output from this script can be captured with '>>'.
##                    It will report summaries and totals.
##                    Not capturing the standard output will not affect
##                    this script's performance.
##
##                    For further notes see the included notes.txt file.
##
##
##       DISCLAIMER:  Please note that "mods" are not officially supported by
##                    PunBB. Installation of this modification is done at your
##                    own risk. Backup your forum database and any and all
##                    applicable files before proceeding.
##
##

Download here

Offline

 

#2 2005-11-17 09:55:13

agravetoncas
Member
From: #gentoo on freenode
Registered: 2005-11-17
Posts: 28
Website

Re: Email Digests 1.0.4

digest_lang.php en français : http://futurama234.free.fr/ddl/digests_lang.zip

Offline

 

#3 2005-11-17 10:36:10

trel1023
Member
Registered: 2005-01-30
Posts: 40
Website

Re: Email Digests 1.0.4

Thank you agravetoncas.  I'll include this file with any updates.

Offline

 

#4 2005-11-17 13:18:35

agravetoncas
Member
From: #gentoo on freenode
Registered: 2005-11-17
Posts: 28
Website

Re: Email Digests 1.0.4

well thank you for the mod, it's excellent !

i hope i made it to work eventhought i have not followed instructions after :
#---------[ 12. IF RUNNING FROM CRON, OPEN ]----------------------------------
because i have no sh access

is there any mod i need to make ?

Offline

 

#5 2005-11-17 15:55:39

trel1023
Member
Registered: 2005-01-30
Posts: 40
Website

Re: Email Digests 1.0.4

well, the script will not run and check to see who wants to get messages if it's not run by cron.

you can run it by hand - as the administrator - but you'll have to do that when you think of it.

automatically (once a day) is the best way.  but there's no technical reason you cannot run it manually.

Offline

 

#6 2005-11-25 11:26:20

marvincooper
New member
Registered: 2005-11-25
Posts: 4

Re: Email Digests 1.0.4

I'm trying to use this with 1.2.10.

Step number 7 and 8 from the readme.txt are as follows:

Code:

#---------[ 7. FIND (line: ~685) ]--------------------------------------------
#

    $remote_address = $_SERVER['REMOTE_ADDR'];




#
#---------[ 8. REPLACE WITH ]-------------------------------------------------
#

    $remote_address = isset($_SERVER['SHELL']) ? '127.0.0.1' : $_SERVER['REMOTE_ADDR'];

However, in 1.2.10, the code in step 7 has been changed to:

Code:

"function get_remote_address()
{
 return $_SERVER['REMOTE_ADDR'];
}

Any idea what the code in step 8 should become?

Offline

 

#7 2005-11-25 17:19:08

trel1023
Member
Registered: 2005-01-30
Posts: 40
Website

Re: Email Digests 1.0.4

since it's just returning the value...  the idea is to change that value based on whether this script is being called from the command line (cron) or not.

try this...

replace

Code:

 return $_SERVER['REMOTE_ADDR'];

with

Code:

   $remote_address = isset($_SERVER['SHELL']) ? '127.0.0.1' : $_SERVER['REMOTE_ADDR'];
   return $remote_address;

Last edited by trel1023 (2005-11-26 08:00:55)

Offline

 

#8 2005-11-26 00:49:46

marvincooper
New member
Registered: 2005-11-25
Posts: 4

Re: Email Digests 1.0.4

I replaced the code as you suggested, and at first it didn't work. Then I noticed the missing semi-colon smile

I also had to update the version array in install_mod.php to include 1.2.10.

So I have now installed the mod, but when I go to /digests.php from the link in the Profile menu, all I can see is a blank page...

Any ideas?

Offline

 

#9 2005-11-26 08:02:20

trel1023
Member
Registered: 2005-01-30
Posts: 40
Website

Re: Email Digests 1.0.4

added the semicolon - thanks.

not sure about the blank page - hadn't tried it with 1.2.10 yet.

let me do that this morning...

Offline

 

#10 2005-11-26 11:21:01

trel1023
Member
Registered: 2005-01-30
Posts: 40
Website

Re: Email Digests 1.0.4

i couldn't find anything wrong with a clean install.

i've updated the script to include the language file above and bumped the version to 1.0.5 to be compatible with PunBB 1.2.10 out of the box.

please let me know if you cannot get it working.

Offline

 

#11 2005-11-27 00:05:03

marvincooper
New member
Registered: 2005-11-25
Posts: 4

Re: Email Digests 1.0.4

Fantastic!  Thanks, all working now. The problem I had before (blank screen) was nothing to do with your mod, and everything to do with my brain....

Thanks!

Just one more thing: do you plan to update this mod when 1.3 is released?

Offline

 

#12 2005-11-27 07:30:24

trel1023
Member
Registered: 2005-01-30
Posts: 40
Website

Re: Email Digests 1.0.4

glad it works.

yeah, i will update it, but haven't looked at any of the 1.3 code yet.

but this mod is so minimal (in what it does to existing code), it should be pretty trivial.

Offline

 

#13 2005-12-26 21:50:00

cytexone
New member
Registered: 2005-12-26
Posts: 4

Re: Email Digests 1.0.4

How would I apply Digest settings to all users?

Offline

 

#14 2005-12-27 06:34:45

trel1023
Member
Registered: 2005-01-30
Posts: 40
Website

Re: Email Digests 1.0.4

there is no way to do that through the interface, as is...  you could do it manually, or via your own script.

for each user you would need to do this:
1) add a line for them into the SUBSCRIPTIONS_TABLE with the settings you decide
2) add a line to SUBSCRIBED_FORUMS_TABLE for each forum you're signing them up for

Offline

 

Board footer

Based on PunBB
© Copyright 2002–2005 Rickard Andersson

© Copyright 2004–2006 Kristoffer Jansson

User contributed files are property of their respective owners.