PDA

View Full Version : Need Daily Digest Modification


Chimpie
05-18-2012, 12:06 PM
Hey everyone,

I would like to modify the daily digest. In addition to the list of what threads are new and what threads have been updated, I need the post content to be listed as well. So it should look like:

The following threads are new:
********
Thread title
Link
Started by
Post content

Posted by
Post content

Posted by
Post content

********
(next new thread)
Thread title
Link
Started by
Post content

Posted by
Post content

Posted by
Post content


The following threads are updated:
********

Thread title
Link
Started by
Post content

Posted by
Post content

Posted by
Post content

Repeated

Can this be done?

kh99
05-18-2012, 12:24 PM
I think it can be done. If you look at includes/functions_digest.php, the first section gets subscribed threads and includes all new posts from those threads. Then the next section gets subscribed forums and provides links to new or updated threads. So I suppose what you could do is take the results of searching for new and updated threads and do the same thing that's done for subscribed threads (it'll obviously take some moving around of code).

Chimpie
05-18-2012, 12:35 PM
Yeah I was looking at that, but I was thinking that I needed to add code so the post content was added.

kh99
05-18-2012, 12:49 PM
That's true - for each new or updated thread found in a subscribed forum, you would need to do a query for new posts. But I think it should be almost the same query that's done for updated posts in each subscribed thread. I was thinking maybe if you could take the part from the beginning that processes each subscribed thread and make it a separate function, then maybe you could use it in the section that processes new and updated threads.

BTW, I responded because I remember seeing you post this as a follow-up question in that other thread and I meant to answer there but I forgot. But I guess when people post here they're really looking for someone to do the coding, so my answer really isn't very good. If I get a chance to look at it later maybe I can be of more help.

ETA: actually I won't be able to do this, so if anyone else can help please go ahead.

Chimpie
05-18-2012, 12:55 PM
Thanks. Yeah, I tried coding it myself and couldn't get it right so I posted here. :/

kh99
05-18-2012, 01:21 PM
I thought of another approach that might work - make a different way for users to subscribe to a forum - by subscribing to all existing and new threads. Then I think the existing digest code would work. Adding a subscription for each existing thread should be pretty easy, and then you'd only need to catch when a new thread was created and add subscriptions to it for each user in question.

Chimpie
05-18-2012, 01:44 PM
I thought of that as well, but the forum owner doesn't want the members to receive lots of emails. The forum only has four suggestions so, since they are all subscribed to those four sections, the most they'll receive is four emails.

Simon Lloyd
05-18-2012, 03:36 PM
Look at the code for a subscribed thread, that gives you the post content you should be able to gleam it from there