Page 1 of 1

1.41 question

PostPosted: Fri Aug 11, 2006 3:27 am
Author: Dioncecht
I wasn't real sure where this topic belonged, so I stuck it here. Just as a point of curiosity, I was wondering (hoping) if the Future post bug has been fixed in 1.41? I know you have been busy with all different areas of the new release, but this is my biggest concern because I've had to disable it for everyone because every single future post shows up clear as day in users Digests if they subscribe to that particular topic. Kind of defeats the whole point of future posts.

Just wondering (and hoping)....

PostPosted: Fri Aug 11, 2006 3:54 am
Author: Unregistered
141 related question shud be posted here
http://integramod.com/forum/viewtopic.php?t=1691

PostPosted: Fri Aug 11, 2006 3:57 am
Author: Adrian Rea
I personally was not aware whether it had. Of course you could test the beta yourself and for that you could go to http://integramod.com/forum/viewtopic.php?t=1691 and test it if you can. I suspect it may not have been tested as there would need to be a system fully set up. I will ask around

The place to post the issue if you still find it will be in http://integramod.com/forum/viewforum.php?f=52

A

Re: 1.41 question

PostPosted: Sat Aug 12, 2006 3:18 am
Author: evolver
I've never seen this problem...
But that's because I haven't realy used the 'delayed topics' option yet...

I have taken a little look at the responsible code...

In mail_digests.php, this is where the data is pulled:
Code: Select all
 $sql = 'SELECT c.cat_order, f.forum_order, f.forum_name, t.topic_views, t.topic_replies, t.topic_title, u.username, p. * , pt. * ' .         ' FROM ' . CATEGORIES_TABLE . ' c, ' .             FORUMS_TABLE . ' f, ' .             TOPICS_TABLE . ' t, ' .             USERS_TABLE . ' u, ' .             POSTS_TABLE . ' p, ' .             POSTS_TEXT_TABLE .  ' pt' .         ' WHERE c.cat_id = f.cat_id            AND f.forum_id = t.forum_id            AND t.topic_id = p.topic_id            AND p.poster_id = u.user_id            AND p.post_id = pt.post_id            AND t.topic_status <> 2 ' .             $filter_users .             $post_time .             $auth_forums . '            AND t.topic_time <= '.time() .       ' ORDER BY c.cat_order, f.forum_order, p.post_time ASC';

The digest is limited for posts till today in the line:
AND t.topic_time <= '.time() .
It's the time() function that catches my eye here...
The time() function will offcourse only read servertime...

My guess is that future posts will only show up in digests when a user is at a different timezone... Right?
So, this might be another timezone problem to fix... <img>
Just a quick guess, I might be wrong...

PostPosted: Sat Aug 12, 2006 3:32 am
Author: Adrian Rea
Interesting thinking, I hope that is the cause of the issue, but I suspect that these posts are more than 24 hours in the future otherwise why would it be a problem?

Thanks for looking into it tho evolver [flash=,:1zfay1yc]http://integramod.com/forum/images/icon/icon14.gif[/flash:1zfay1yc]


A

Re: 1.41 question

PostPosted: Sat Aug 12, 2006 4:40 am
Author: evolver
Then maybe, it is a problem with the structure it gets from the time() function...
I will try to echo $post_time and time() to compare them.
They should have the same format in order to work...wouldn't you think?...

PostPosted: Sat Aug 12, 2006 10:52 am
Author: Dioncecht
Does that particular time function also look at the date?

PostPosted: Sat Aug 12, 2006 11:09 am
Author: evolver
"Dioncecht";p="13570" wrote:Does that particular time function also look at the date?


Yes, I have compared them and it looks similar, there's no format involved...

But the structure of the quiery looks a little strange with the time() function inside...

Re: 1.41 question

PostPosted: Sat Aug 12, 2006 1:15 pm
Author: evolver
OK...

I have changed and tested this, and it seems to work fine on my testsite...
Done the test with a normal message and with a delayed topic (only 2 hours in future)...
only the normal message turned up in digest... :ra: Please confirm if it works for you as well:

In mail_digests.php]FIND[/b]
Code: Select all
 $sql = 'SELECT c.cat_order, f.forum_order, f.forum_name, t.topic_views, t.topic_replies, t.topic_title, u.username, p. * , pt. * ' .         ' FROM ' . CATEGORIES_TABLE . ' c, ' .             FORUMS_TABLE . ' f, ' .             TOPICS_TABLE . ' t, ' .             USERS_TABLE . ' u, ' .             POSTS_TABLE . ' p, ' .             POSTS_TEXT_TABLE .  ' pt' .         ' WHERE c.cat_id = f.cat_id            AND f.forum_id = t.forum_id            AND t.topic_id = p.topic_id            AND p.poster_id = u.user_id            AND p.post_id = pt.post_id            AND t.topic_status &lt;&gt; 2 ' .             $filter_users .             $post_time .             $auth_forums . '            AND t.topic_time &lt;= '.time() .       ' ORDER BY c.cat_order, f.forum_order, p.post_time ASC';

REPLACE WITH
Code: Select all
    // Filter to hide future posts by delayed topics         $topics_till_now = " AND t.topic_time <= " . $current_time;    $sql = 'SELECT c.cat_order, f.forum_order, f.forum_name, t.topic_views, t.topic_replies, t.topic_title, u.username, p. * , pt. * ' .         ' FROM ' . CATEGORIES_TABLE . ' c, ' .             FORUMS_TABLE . ' f, ' .             TOPICS_TABLE . ' t, ' .             USERS_TABLE . ' u, ' .             POSTS_TABLE . ' p, ' .             POSTS_TEXT_TABLE .  ' pt' .         ' WHERE c.cat_id = f.cat_id             AND f.forum_id = t.forum_id             AND t.topic_id = p.topic_id             AND p.poster_id = u.user_id             AND p.post_id = pt.post_id             AND t.topic_status <> 2 ' .             $filter_users .             $post_time .             $auth_forums .             $topics_till_now .        ' ORDER BY c.cat_order, f.forum_order, p.post_time ASC';


The replacement is placed in a code-box here, because the quotes (" ") are still changing to &quote when placed in a PHP-box on this site.

PostPosted: Tue Aug 15, 2006 3:26 am
Author: Dioncecht
Thanks Evolver.. I am testing now, I'll let you know when my next digest hits

PostPosted: Wed Aug 16, 2006 5:15 am
Author: Dioncecht
Looks like that was the ticket! Thank you sir!