<?php

if(!defined('IN_MYBB'))
	die('This file cannot be accessed directly.');

$plugins->add_hook('search_do_search_process', 'searchautoredir_run');
$plugins->add_hook('search_do_search_end', 'searchautoredir_run');

function searchautoredir_info()
{
	return array(
		'name'			=> 'Search Auto-redirect',
		'description'	=> 'Very simple plugin which disables the friendly redirect pages for searching.',
		'website'		=> 'http://mybbhacks.zingaburga.com/',
		'author'		=> 'ZiNgA BuRgA',
		'authorsite'	=> 'http://zingaburga.com/',
		'version'		=> '1.0',
		'compatibility'	=> '1*',
		'guid'			=> ''
	);
}

function searchautoredir_run()
{
	global $mybb;
	$mybb->settings['redirects'] = ($mybb->version_code >= 1400 ? 0 : 'no');
}
?>