[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!
Suggested Hosts
professor mauricio
Registered User
Posts: 30
Joined: Tue Jul 12, 2011 4:54 pm

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

Post by professor mauricio » Wed Jul 13, 2011 1:52 am

you were fast ('n furious) lol

I'll try soon and feedback later

thx

professor mauricio
Registered User
Posts: 30
Joined: Tue Jul 12, 2011 4:54 pm

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

Post by professor mauricio » Wed Jul 13, 2011 2:31 am

It crashes...

changging that line the results are all wrong!

i can't image why, but sql sort gave another kind of posts but the last.

I believe that the mod should sort from p.posts and not from t.topics to work.

helps!?

professor mauricio
Registered User
Posts: 30
Joined: Tue Jul 12, 2011 4:54 pm

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

Post by professor mauricio » Wed Jul 13, 2011 3:38 am

Now it works for me changing a litle

on search.php (where's mod inclusion)

Code: Select all

// Search Back
			case 'searchback':
				$l_search_title = $user->lang['SEARCH_NEW'];
				// force sorting
				$show_results = 'posts';
				$sort_key = 't';
				$sort_dir = 'd';
				$sort_by_sql['p'] = 'p.post_time';
				$sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC');
				gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
				$s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = '';

				$sql = 'SELECT p.post_id
					FROM ' . POSTS_TABLE . ' p
					WHERE p.post_time > ' . (time() - ($show_results_st * 60)) . '
						AND p.post_approved = 1
// coment-delete or sql crashes here for anonymous						' . str_replace(array('p.', 'post_'), array('p.', 'topic_'), $m_approve_fid_sql) . '
						' . ((sizeof($ex_fid_ary)) ? 'AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . "
					$sql_sort";
				$field = 'post_id';
			break;
We have, just like a topic, all posts sort by time (post_id)

BUT

just if the user is logged in.

or sql crashes

(by commenting one line It works!)

take a look:
http://www.forumdepizzarias.com.br/sear ... _time=5000 (a lot of time)
http://www.forumdepizzarias.com.br/sear ... ch_time=60 (1 hour)

User avatar
master412160
Registered User
Posts: 314
Joined: Sat May 22, 2010 5:45 pm
Location: Belgium, Flanders
Name: Max Pen
Contact:

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

Post by master412160 » Sat Dec 24, 2011 3:04 pm

how does this mod work? What happens when you select from the drop down menu 15 minutes for example?

Also does this work on 3.0.9?

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 » Sat Dec 24, 2011 9:54 pm

Hi,

this MOD works on version 3.0.9. After selecting the timeframe in the dropdown, the user is presented with a search result page with topics which were created or ansered in the given timeframe. It works just like the normal search where you can limit the search results too, just with shorter timeframes and (obviously) without given search phrases.


Regards,
Bálint

Ivo_BG
Registered User
Posts: 14
Joined: Tue Jan 24, 2012 11:19 pm

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

Post by Ivo_BG » Fri Feb 03, 2012 3:50 pm

Hi.
Is this MOD working on version 3.0.10 ? I am not able to get any search result.
Just an empty search screen with "No suitable matches were found".

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 » Fri Feb 03, 2012 5:37 pm

Hi,

My own board is a 3.0.10 and the MOD is working fine. Could you post a link to your board?

Regards,
Bálint

Ivo_BG
Registered User
Posts: 14
Joined: Tue Jan 24, 2012 11:19 pm

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

Post by Ivo_BG » Fri Feb 03, 2012 7:39 pm

Balint sorry for disturbing you. :oops: Problem solved.

The automod by some strange reason did not add the

Code: Select all

$show_results_st = request_var('search_time', 30);
line in search.php file.

Thanks for your fast reaction !
The mod is great and users appreciate your effort alot.

Locked

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