Location: PHPKode > scripts > Multi Search Module > multi-search-module/index.php
<?PHP
/**
 * index - holds switches for the search module
 *
 * This is the hub of the search module. All operational
 * decisions are made here.
 *
 * @module search
 * @package phpWebSite
 * @author Edward Ritter <hide@address.com>
 * @version $Id: index.php,v 1.8 2002/09/06 06:09:26 esritter Exp $
*/

/**
 * These variables are used during installation of the module.
 * You can also reference them throughout your module should you 
 * need them. Please set these.
 */
$modname = 'search';				// set this to the short name for your module (its subdirectory)
$module_long_name = 'MultiSearch';	// Name of module as known by users
$module_icon = "$modname.gif";		// small icon file for the module on global admin menu
$admin_only = 0;					// set to 1 if this is for admins only
$user_only = 0;						// set to 1 if this is for users only
$misc_info = "Search v1.1 by ES Ritter (hide@address.com)";	// usually version, author info
$block_display_position = 1;		// see README for the codes. 16 sets it to show
									// on left, topcenter and right. 1 is just left.

// Include necessary core files
if (!isset ($mainfile)) include ('mainfile.php');
include_once ('config.php');
include_once ('open_session.php');

/* Include class file. Module specific functions are included in it. */
include_once ("./mod/$modname/$modname.inc.php");

// Display header
include_once ('header.php');

// Admin only operations
if ($admintest == $security_hash) {
	switch($op) {
		case "install":
			include_once ("./mod/$modname/".$modname."_install.inc.php");
			if (!$box_content) {
				$box_content = "<p>\"$modname\" was successfully installed.</p>
					<p><a href=\"admin.php\">Return to Site Administration</a></p>";
			}
			$box_title = "$module_long_name Install";
			thememainbox($box_title, $box_content);
			break;

		case "uninstall" :
			include_once ("./mod/$modname/".$modname."_uninstall.inc.php");
			if (!$box_content) {
				$box_content = "<p>\"$modname\" was successfully uninstalled.</p>
					<p><a href=\"admin.php\">Return to Site Administration</a></p>";
			}
			$box_title = "$module_long_name Uninstall";
			thememainbox($box_title, $box_content);
			break;
		
		/* Calls the admin include, which has another switch ($adminop) for
		   admin only operations. */ 
		case $modname . "_admin" :
			include_once ("./mod/$modname/".$modname."_admin.inc.php");
			break;
		/* DO NOT INCLUDE A DEFAULT CASE! Otherwise, it will not continue
		   to the user's operations switch below. */

	}
} else {
    $box_title = "Unauthorized Access";
    $box_content = "<p class=\"onebiggerred\">You need to be logged in as 
    	an admin to perform this operation.</p>";
    thememainbox($box_title, $box_content);
}

switch ($op) {
	case "show_result":
		$search = new search_box;
		$search->show_result($query, $engine);
		break;
	default:
		if (!$op)
		break;

}

// Display footer
include_once ('footer.php');

?>
Return current item: Multi Search Module