[BETA] Search back (x minutes, days, month)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Scam Warning
dmtalon
Registered User
Posts: 37
Joined: Tue May 07, 2002 12:06 am
Location: Florence, KY
Contact:

Re: [BETA] Search back (x minutes, days, month)

Post by dmtalon »

Thanks for that info!!
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Search back (x minutes, days, month)

Post by IPB_Refugee »

Hi Balint,

thanks for your MOD!

Is it possible to show the new posts in the last x minutes/hours/days instead of the topics which contain new posts?

Kind regards
Wolfgang
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany
Contact:

Re: [BETA] Search back (x minutes, days, month)

Post by Balint »

Hi!

Yes, it is possible, let me check later at home - I'll post the solution tonight.


Viele Grüße, :D
Bálint
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany
Contact:

Re: [BETA] Search back (x minutes, days, month)

Post by Balint »

Hi Wolfgang!

You could have asked at phpbb.de but here it goes:

Open up search.php and
FIND

Code: Select all

$show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics';
REPLACE WITH

Code: Select all

$show_results = 'posts';
That's it.


Greets,
Bálint
jmjm003
Registered User
Posts: 275
Joined: Sat Dec 22, 2007 7:05 pm

Re: [BETA] Search back (x minutes, days, month)

Post by jmjm003 »

Thanks for the MOD.
Currently, I'm running phpbb 3.0.1.
Installed your MOD. I used overall_header (first page) rather than index_body for my search box.
Added a few days to the list.

The problem I seem to have is. If I do a search back for 7 days as an example. I get 3 pages of topics. Page one works fine. However, clicking on page 2 or so on results in a page that says "No suitable matches were found. " .

This is what shows in my browser as the link.

Code: Select all

http://www.removedmydomain.org/forum/search.php?&sr=topics&search_id=searchback&start=25
Any ideas on how I can fix this?

Again, Thank you.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Search back (x minutes, days, month)

Post by IPB_Refugee »

Thank you, Balint, but your solution doesn't work correctly. Today I did a search back for 7 days and this is one of the results:

Image

The 04th of may is more than three weeks in the past, not just seven days... I don't know why the MOD shows this post. (I have the same problem with other posts, too.)

On the other hand the MOD does not show posts I wrote on 28.04.2008. :shock:
Last bad news for today: I can confirm the bug jmjm003 reported.

Kind regards
Wolfgang

(If you need a German translation of this post, just let me know. ;) )
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Search back (x minutes, days, month)

Post by IPB_Refugee »

Any news about the pagination bug reported by jmjm003? :oops:

Kind regards
Wolfgang
jmjm003
Registered User
Posts: 275
Joined: Sat Dec 22, 2007 7:05 pm

Re: [BETA] Search back (x minutes, days, month)

Post by jmjm003 »

I'll have to remove this until he can get back with a solution to that problem. :cry:
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Search back (x minutes, days, month)

Post by IPB_Refugee »

Any news on the pagination bug? Maybe there's something wrong with the URLs for the pages of search results, e.g.

search.php?&sr=topics&search_id=searchback&start=16
search.php?&sr=topics&search_id=searchback&start=32

Regards
Wolfgang
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Search back (x minutes, days, month)

Post by IPB_Refugee »

Is this MOD abandoned? :(
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany
Contact:

Re: [BETA] Search back (x minutes, days, month)

Post by Balint »

Hi guys!

I swear I did not get any notifications on this (again!). I habe a pretty important test on tuesday and will take a look after that. This MOD is not abandoned, however any help for development is welcome.


Greets,
Bálint
jmjm003
Registered User
Posts: 275
Joined: Sat Dec 22, 2007 7:05 pm

Re: [BETA] Search back (x minutes, days, month)

Post by jmjm003 »

If I knew more about php I would love to help.
At this point, best I can do is test for you.

Glad to see you back again.
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany
Contact:

Re: [BETA] Search back (x minutes, days, month)

Post by Balint »

Hi guys!

The problem is finally located, but I think the fix will be supplied tomorrow, today I have to do something else first.


Greets,
Bálint
User avatar
Balint
Registered User
Posts: 952
Joined: Tue Aug 06, 2002 2:19 pm
Location: Germany
Contact:

Re: [BETA] Search back (x minutes, days, month)

Post by Balint »

EDIT:

Open search.php

Find:

Code: Select all

$u_search .= ($return_chars != 300) ? '&ch=' . $return_chars : '';
Add after:

Code: Select all

$u_search .= ($show_results_st) ? '&search_time=' . $show_results_st : '';
That should correct the "No suitable matches..."-error.


Greets,
Bálint
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [BETA] Search back (x minutes, days, month)

Post by IPB_Refugee »

Great, Balint! :) It works fine now!

Have a nice summer!
Wolfgang

EDIT: Just one small suggestion: Maybe it's better to add

Code: Select all

'S_SEARCH_ACTION'			=> append_sid("{$phpbb_root_path}search.$phpEx"),
to includes/functions.php - function page_header instead of index.php. In this case you can use the search back box e.g. in overall_header.html, too.
Locked

Return to “[3.0.x] MODs in Development”