phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Today's Posts link


 
Search this topic... | Search MOD Requests... | Search Box
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Author Message
doulos
Board Member



Joined: 29 Oct 2017

Posts: 3



PostPosted: Sun Oct 29, 2017 4:38 am 
Post subject: Today's Posts link

I am looking to add a link to search for "today's" post similar to vbulletin's "https://forums-somewhere-else.net/search.php?do=getdaily" but have not found a solution. I found something a phpbb3 mod for this but it doesn't work for phpbb2 (at I couldn't get it to work).

Thanks.
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 414
Location: Québec


flag
PostPosted: Sun Oct 29, 2017 10:36 am 
Post subject: Re: Today's Posts link

This board actually has something similar in the search box though it seems to be going back several days (2 according to the help page, but I see posts from 4 days back). Maybe drathbun could share the code, but if you're familiar enough with PHP you could probably do it yourself by adapting the "since last visit" option around line 184 of search.php:
Code:
         if ( $search_id == 'newposts' )
         {
            if ( $userdata['session_logged_in'] )
            {
               $sql = "SELECT post_id
                  FROM " . POSTS_TABLE . "
                  WHERE post_time >= " . $userdata['user_lastvisit'];
            }
            else
            {
               redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=newposts", true));
            }

            $show_results = 'topics';
            $sort_by = 0;
            $sort_dir = 'DESC';
         }

Replacing the WHERE with something like:
Code:
WHERE post_time >= ($current_time - (60 * 60 * 24));


I don't have time to try it out and find everything you would need to replicate or where to add links to the actual feature, but hopefully this can get you started icon_smile.gif
Back to top
doulos
Board Member



Joined: 29 Oct 2017

Posts: 3



PostPosted: Sun Oct 29, 2017 8:17 pm 
Post subject: Re: Today's Posts link

Thanks I will give a go.
Back to top
doulos
Board Member



Joined: 29 Oct 2017

Posts: 3



PostPosted: Mon Oct 30, 2017 7:14 am 
Post subject: Re: Today's Posts link

Sadly, it did not work.
Back to top
Display posts from previous:   
Register or Login to Post    Index » MOD Requests  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0173 seconds using 16 queries. (SQL 0.0023 Parse 0.0005 Other 0.0145)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo