Email Digests

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
48
59%
Very Good
17
21%
Good
9
11%
Fair
2
2%
Poor
6
7%
 
Total votes: 82

User avatar
MarkDHamill
Registered User
Posts: 3958
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Post by MarkDHamill » Sat Apr 10, 2004 12:14 am

aalishan wrote: Hi
I am getting this error when I click on 'make Digest Changes' on digests.php

Could not insert or update phpbb_mod_subscriptions table

DEBUG MODE

SQL Error : 1062 Duplicate entry '5' for key 1

INSERT INTO phpbb_mod_subscriptions (user_id, digest_type, format, show_text, show_mine, new_only, send_on_no_messages, send_hour, text_length) VALUES (5, 'DAY', 'TEXT', 'YES', 'YES', 'FALSE', 'NO', '17', 100)

Line : 428
File : /path/digests.php


I'm guess you entered this manually? The problem is the value '5' is already in the phpbb_mod_subscriptions table. Digests.php should be smart enough to check if a subscription exists and if so apply a SQL update.

Dunno what it could be in your case. Are you using some database other than MySQL? I've never seen this error before.

If you entered values into the table manually, you can remove them with a database editor like phpMySQLAdmin.

..Any advice
Thanks
Aalishan

User avatar
MarkDHamill
Registered User
Posts: 3958
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Post by MarkDHamill » Sat Apr 10, 2004 12:14 am

aalishan wrote: Hi
I am getting this error when I click on 'make Digest Changes' on digests.php

Could not insert or update phpbb_mod_subscriptions table

DEBUG MODE

SQL Error : 1062 Duplicate entry '5' for key 1

INSERT INTO phpbb_mod_subscriptions (user_id, digest_type, format, show_text, show_mine, new_only, send_on_no_messages, send_hour, text_length) VALUES (5, 'DAY', 'TEXT', 'YES', 'YES', 'FALSE', 'NO', '17', 100)

Line : 428
File : /path/digests.php


..Any advice
Thanks
Aalishan


I'm guess you entered this manually? The problem is the value '5' is already in the phpbb_mod_subscriptions table. Digests.php should be smart enough to check if a subscription exists and if so apply a SQL update.

Dunno what it could be in your case. Are you using some database other than MySQL? I've never seen this error before.

If you entered values into the table manually, you can remove them with a database editor like phpMySQLAdmin.

zocalo
Registered User
Posts: 74
Joined: Thu Nov 13, 2003 9:51 pm
Location: Northern Californa
Contact:

Post by zocalo » Sat Apr 10, 2004 8:53 pm

MarkDHamill wrote: Okay, Zocalo if you feel up to being the new Email Digest author you have my permission to go for it. You have certainly contributed some valuable additions to this mod in the past so I think you know the code pretty well. I don't know if you've done other mods or not. It doesn't pay well but having your name in lights, so to speak, has some gratification. ...


Whoops, I didn't even read that paragraph until now :-P. I'm going to blame it on small font, and late hours 8).

I would enjoy taking over the project and giving you a break Mark, I only think its fair warning though to mention that I am still a college student, and sometimes I have to strugle to find time for such things.

To answer your other question Mark, I have not done any offical MODs, I have however done some fairly extensive private modding (look in my signature for links ;-))

And have no fear, your name will appear as it always had in your mod, I'll just tack mine on under it :-).

So if the users here have no problems with only relativly small changes and support until the end of May I'd be willing to take on the MOD.
ZOCALO
aliases: INDEMNITY83
FORUMMARK | VENTURE CREW | DORMLIFE

dmolavi
Registered User
Posts: 29
Joined: Fri Feb 20, 2004 7:45 pm
Location: Washington Township, NJ, USA
Contact:

Post by dmolavi » Sat Apr 10, 2004 9:39 pm

zocalo wrote:
masterdavid wrote:... I am thinking of including the stylesheet with the mail itself. If somebody can look at that part, the better since I am busy with some other things. ...


I never could get the stylesheet stuff to work right they way it is, and I wanted a slightly diffren't layout to the email so I modified the mail_digests.php code so it builds emails that look like this:

It would need some polishing, but the bulk of the work is done.

[EDIT: Oops, I think I accidentally removed the image from my server, here's a new link to the picture]


re stylesheets: i noticed the code picked the stylesheet name from the DB, which may not necessarily be the pathname to it. i just hardcoded mine in (setting default to false). works like a charm now :) awesome MOD.

zocalo
Registered User
Posts: 74
Joined: Thu Nov 13, 2003 9:51 pm
Location: Northern Californa
Contact:

Post by zocalo » Sat Apr 10, 2004 9:43 pm

@Mark

If I do end up taking over the project, I dont want to use this username (i personally never liked it, it was a local resturant name that I created as a temp thing and then I got active :-P)

I have another account, under the username Indemnity_83 for which I would be using as that is the name I use everywhere else.

Thanks
ZOCALO
aliases: INDEMNITY83
FORUMMARK | VENTURE CREW | DORMLIFE

zocalo
Registered User
Posts: 74
Joined: Thu Nov 13, 2003 9:51 pm
Location: Northern Californa
Contact:

Post by zocalo » Sat Apr 10, 2004 9:45 pm

dmolavi wrote:
zocalo wrote:
masterdavid wrote:... I am thinking of including the stylesheet with the mail itself. If somebody can look at that part, the better since I am busy with some other things. ...


I never could get the stylesheet stuff to work right they way it is, and I wanted a slightly diffren't layout to the email so I modified the mail_digests.php code so it builds emails that look like this:

It would need some polishing, but the bulk of the work is done.

[EDIT: Oops, I think I accidentally removed the image from my server, here's a new link to the picture]


Thats what I eneded up doing in my example also, For now its hardcoded into the email template, but I'm hoping if there is an ACP developed, then a path to the stylesheet can be put there.

re stylesheets: i noticed the code picked the stylesheet name from the DB, which may not necessarily be the pathname to it. i just hardcoded mine in (setting default to false). works like a charm now :) awesome MOD.
ZOCALO
aliases: INDEMNITY83
FORUMMARK | VENTURE CREW | DORMLIFE

User avatar
snkhan
Registered User
Posts: 110
Joined: Sun Aug 03, 2003 6:34 pm
Location: United Kingdom
Contact:

Post by snkhan » Sat Apr 10, 2004 11:13 pm

Hi there,

Thanks for the great script!
You mention that you hardcoded the styles into your script, can you elaborate on how you have done that?

I've got 9 forum styles at the moment (it seems it is now that I'll be punished for having so many!), and having to rewrite the templates would be a pain. I wouldn't mind making one stylesheet and making the MOD use this (regardless of what style the user is using). This way, I can control the look of the email and make sure that all members recieve a copy that looks pleasantly nice :)

Any ideas on how this could be achieved?

Thanks,


saj
snkhan.co.uk

Indemnity_83
Registered User
Posts: 152
Joined: Sat Apr 10, 2004 9:40 pm
Location: California, United States
Contact:

Post by Indemnity_83 » Sat Apr 10, 2004 11:21 pm

I would start out by going into the digest_constants.php file and on lines 40-42 you'll find 3 variables

Code: Select all

$digest_use_default_stylesheet
$digest_use_custom_stylesheet
$digest_custom_stylesheet_path
Its likely easiest to just set the digests to use the subSilver theme (assuming you still have it) so your settings should look like this:

Code: Select all

$digest_use_default_stylesheet = false;
$digest_use_custom_stylesheet = true;
$digest_custom_stylesheet_path = 'templates/subSilver/subSilver.css';
If that doesn't do it, I'd suggest waiting a week or so and hopefully I'll have a better solution that wont require any work on your part :-) (except upgrading).
INDEMNITY
a legal exemption from liability for damages.
BLOG | DORMLIFE

User avatar
MarkDHamill
Registered User
Posts: 3958
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Post by MarkDHamill » Sun Apr 11, 2004 2:03 am

Zocalo, use any name you want. Please keep my name on any existing programs that you modify. If you create any new programs by all means don't extend credit to me for those. If you think it is appropriate and if at some point you work comprises a majority of the code, put in a statement like "Original version by MarkDHamill (mhamill@computer.org), http://www.potomactavern.org"

At this point I am officially ending my work on this codebase. It's your baliwack unless you decide to opt out, then I may choose to do code fixes and the like but I would probably turn it over to some other author if they had an interest.

But I will keep an eye on it, help troubleshoot and as new versions come out with great new features I intend to download them and install them.

I'm sure my code could use some streamlining and some fresh eyes would do it good, I think. Please consider the list of mods to the mod that I suggested earlier in this topic. I'm not the first one to come up with these ... I've heard these repeatedly.

I am really glad this idea took off and it is being so actively used. If I have a talent it's in finding good ideas. If I can find the energy for the enhanced RSS newsfeed mod I expect it will be similarly well received. Someone with more speed may beat me to it though.

Indemnity_83
Registered User
Posts: 152
Joined: Sat Apr 10, 2004 9:40 pm
Location: California, United States
Contact:

Post by Indemnity_83 » Sun Apr 11, 2004 2:39 am

Alright, I put together a quick development roadmap, but in case I forget to update this post if/when I make changes you can be sure to find the most up to date development info here:

http://www.dormlife.us/viewtopic.php?t=7

Roadmap:
  • Version 1.1.0
    • Update HTML digests to fix missing template errors (Image)
    • Update confirmation messages to match phpBB forms.
  • Version 1.2.0
    • Add an Admin Control Panel
    • Digest monitor, showing history of digests sent out, number bounced back, perhaps some artificial intelligence to remove digests for those that repeatedly bounce back.
    • Build in referential integrity so, for example, when a user is removed their subscription goes away.
  • Version 1.3.0
    • Have digest emails display emoticons, quotes, and other BBCode features (executed similarly to the return results on a search)
    • Add Digest signup option to the registration page (Admin toggleable)
  • Version 1.4.0
    • Implement a psudocron structure so forums without shell access can still use the mod.
  • Version 2.0.0
    • Make it work in phpBB 2.2
Last edited by Indemnity_83 on Sun Apr 11, 2004 6:24 am, edited 2 times in total.
INDEMNITY
a legal exemption from liability for damages.
BLOG | DORMLIFE

User avatar
MarkDHamill
Registered User
Posts: 3958
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Post by MarkDHamill » Sun Apr 11, 2004 2:51 am

Sounds great and better than I would have done under the circumstances. (My motto: Plan? We don't need no steenking plan!)

One other suggestion: allow the user when they register with the message board to elect to receive a digest automatically. (I'd recommend keeping it simple and default to a daily/weekly HTML digest for messages for all forums for which they have access.)

Another approach might be to have a regular registration, give the normal confirmation message, then redirect to the digests page.

But I'd recommend making it a toggle. Some admins might not want to push this feature but let people discover it. This could be done with a switch in digest_constants.php.

Good luck Indemnity_83/zocalo!

User avatar
MarkDHamill
Registered User
Posts: 3958
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Post by MarkDHamill » Sun Apr 11, 2004 3:08 am

Another idea is to improve the email encoding interface. I hardcoded some values, in particular I assume the ASCII character set is being used to send email for text, and for HTML I basically am saying using Roman characters. Somewhere in phpBB is likely something that indicates the type of encoding to use.

The offending lines in mail_digests.php appear to be these:

Code: Select all

		if ($html) 
		{
			$emailer->extra_headers('MIME-Version: 1.0');
			$emailer->extra_headers('Content-type: text/html; charset=iso-8859-1');
		}
		else
		{
			$emailer->extra_headers('Content-Type: text/plain; charset=us-ascii');
		}
This may prove tricker than it looks. There is an RFC somewhere indicating what should go into MIME heading and the like, and I doubt the encoding variable used by phpBB necessarily follows the RFC recommendation. But email clients will expect RFC syntax.

Indemnity_83
Registered User
Posts: 152
Joined: Sat Apr 10, 2004 9:40 pm
Location: California, United States
Contact:

Post by Indemnity_83 » Sun Apr 11, 2004 6:37 am

Alright, I updated the Roadmap. I added an item to 1.3.0, and removed one from 1.1.0 (didn't realize it had snuck its way in there since the last version I had).

I've done a first pass at changing the email layout, however my method makes for a fairly static layout (I pretty much hard coded in the subSilver style). So I need to make some minor changes to get it at least a little more dynamic.

I'm not sure how to go about making this version public, I'm not sure if its ok to make a post here since this is supposed to be a thread for the MOD checked 1.0.9b version. I'm not sure its worth the MOD teams time to have me re-submit the MOD with only this very minor change.
INDEMNITY
a legal exemption from liability for damages.
BLOG | DORMLIFE

User avatar
tekguru
Registered User
Posts: 139
Joined: Thu Jul 03, 2003 1:33 pm

Post by tekguru » Sun Apr 11, 2004 7:26 am

MarkDHamill wrote: Very pretty. But if phpBB is released under the GPL then my mod is also GPL (it's in the header of every file) then it strikes me that this author also has to GPL their mods, at least if asked by someone.

If written generically it looks like this would be a valuable mod to the mod.

I am glad to see it is being widely used and so creatively.


I think it has been written generically as the guy who works on the PHP is one hell of a PHP coder, does it for a living I believe. If questions are asked though no answer is ever received. Then aain I know they are using PHPBB and no reference to PHPBB (at least last time I checked) is made on their pages.

weeguy
Registered User
Posts: 6
Joined: Sun Apr 11, 2004 9:06 am

Post by weeguy » Sun Apr 11, 2004 9:19 am

QUICK AND EASY SOLUTION TO THOSE WHO DON'T HAVE CRON ENABLED!!

I'm sure there are many out there like me who really wsh to have a email digest working but the only barrier to overcome is the CRON nonsense. To save yourself all the trouble of setting up cron, simply follow what I've done.

1) We all know by now that the trigger for sending out the digests is mail_digests.php, so as long as we can access this script at fixed interval, the digest will work.

2) One of the ways to do the above would be to set up cron or pseudocron or anything along that line. Heck, you could even reload that script manually every hour if you wanted to. But why not get others to do it for you?

3) Sign up for any web-based uptime/site monitoring service and make them poll http://yourdomain.com/phpbb/mail_digests.php EVERY HOUR (the fixed setting for this mod) to check for uptime. Upon trigger, your webhost will send out the digests. VOILA!

4) Okok, I know there are security concerns over this but well, it works so those who aren't that particular, go ahead and do so.

5) For a list of free/paid uptime monitors, try http://www.vivante.com/search.php?input ... oterm=&p=2

6) This method has been tested and proven to work by myself, and in fact, it doubles up as a site monitor for you. Cool Stuff!

7) Hope you guys enjoy the email digest mod! Cheers!

Post Reply

Return to “[2.0.x] MOD Database Releases”