Page 1 of 1

View/search post since x mod

Posted: Sun Aug 17, 2008 1:00 am
by Bard
There used to be a mod for vers2 that allowed you to view (search) posts within the last x amount of time.
I had mine set to view last week, last 48 hours, last 24 hours.

Is there a mod like this for vers3

Re: View/search post since x mod

Posted: Sun Aug 17, 2008 8:46 pm
by Bard
bump

Re: View/search post since x mod

Posted: Fri Aug 22, 2008 12:37 pm
by Bard
bump

Re: View/search post since x mod

Posted: Sat Aug 23, 2008 9:16 pm
by Bard
Bumpity bump

Re: View/search post since x mod

Posted: Sun Aug 24, 2008 11:14 pm
by Bard
El bumpo grandota

Re: View/search post since x mod

Posted: Wed Aug 27, 2008 12:53 am
by Bard
la petite bosse

Re: View/search post since x mod

Posted: Wed Aug 27, 2008 12:17 pm
by Bard
Let me simplify this request.

How do I view the posts for the last 24 hours?

Re: View/search post since x mod

Posted: Thu Aug 28, 2008 8:05 pm
by Bard
Urti prego questo che sto cercando la risposta

Re: View/search post since x mod

Posted: Sun Aug 31, 2008 3:54 am
by Bard
bump

Re: View/search post since x mod

Posted: Mon Sep 01, 2008 6:34 pm
by Bard
Imagine, you stop by and check your posts because you are looking for a particular reply. You leave the site to only realize a little later that while you checked for replys to your post you forgot to check for new messages. So you come back only to find that there have been no new posts over the last three minutes since your last visit. When you really wanted to read the posts since you logged on last night.

Boom...This mod saves the day. You can now read the posts that were made over the last xx amount of time.....

Re: View/search post since x mod

Posted: Wed Sep 03, 2008 9:14 pm
by Bard
Wow, I am the only one in the entire phpbb community that would use this feature! Thats something by itself!

Re: View/search post since x mod

Posted: Sun Sep 07, 2008 9:11 pm
by Bard
ok.....

Is there an easy way to add to search.php the ability to show all posts for the last 24 hours?

Re: View/search post since x mod

Posted: Tue Sep 09, 2008 7:56 am
by jagjag
1. edit search.php and hack the newposts facility

2. find: case 'newposts'

3. below it you'll find 2 SQL statements (one for topics, one for posts)
...
WHERE p.post_time > ' . $user->data['user_lastvisit'] . "
...
WHERE t.topic_last_post_time > ' . $user->data['user_lastvisit'] . '

4. user_lastvisit is the last time you logged in

5. somewhere up above, define a different time point:
$nday=request_var('nday',0);
$since =$nday ? (time() - $nday*86400) : $user_data['user_lastvisit'];

6. and change the 2 statements to use $since
...
WHERE p.post_time > ' . $since . "
...
WHERE t.topic_last_post_time > ' . $since . '

7. your next problem is to fix up the URLS for the pagination links for the paged search results, e.g. [1] [2] [3] ...

8. find this:
$u_search .= ($search_fields != 'all') ? '&sf=' . $search_fields : '';
$u_search .= ($return_chars != 300) ? '&ch=' . $return_chars : '';

and add this after it:
$nday=request_var('nday','');
if($nday) $u_search.='&nday='.$nday;

There may be some other issues (e.g. "topics' vs 'posts'), but that's a starting point.

Try it using search.php?search_id=newposts&nday=5