custom search_id to filter by forum_id

Temporary forum to obtain support for MODs/Styles while phpbb.com is down
Locked
doshidh
Registered User
Posts: 5
Joined: Sun Feb 01, 2009 10:11 pm

custom search_id to filter by forum_id

Post by doshidh » Fri Feb 06, 2009 3:00 am

Hello,

Could someone help me create a new search_id based on search_id=active_topics to filter by forum_id as well? It would be executed from a custom link to search.php with parameters ?fid[]={generated by page code}&search_id={my new search_id name}

I want to display active topics, but only from the referring forum. I am not quite sure how to go about the filtering in the code provided in search.php:

Code: Select all

			case 'active_topics':
				$l_search_title = $user->lang['SEARCH_ACTIVE_TOPICS'];
				$show_results = 'topics';
				$sort_key = 't';
				$sort_dir = 'd';
				$sort_days = request_var('st', 7);
				$sort_by_sql['t'] = 't.topic_last_post_time';

				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 = '';

				$last_post_time_sql = ($sort_days) ? ' AND t.topic_last_post_time > ' . (time() - ($sort_days * 24 * 3600)) : '';

				$sql = 'SELECT t.topic_last_post_time, t.topic_id
					FROM ' . TOPICS_TABLE . " t
					WHERE t.topic_moved_id = 0
						$last_post_time_sql
						" . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . '
						' . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . '
					ORDER BY t.topic_last_post_time DESC';
				$field = 'topic_id';
			break;
I am using phpBB 3.0.4 with a modified proglass theme on heyjesus.com/forum. Any help would be greatly appreciated.

Thanks,
Dev

Locked