Location: PHPKode > scripts > Quotes Module > quotes-module/index.php
<?php
/**
 * index - holds switches for quote module
 *
 * This is the hub of the quote module. All operational
 * decisions are made here.
 *
 * @module quote
 * @package phpWebSite
 * @author Edward Ritter <hide@address.com>
 * @version $Id: index.php,v 1.7 2002/09/03 19:32:17 esritter Exp $
*/

// Just set these variables - no need to change any other code in this file

$modname = 'quotes';  			// set this to the short name for your module (its subdirectory)
$module_long_name = 'Quotes';	// 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 = "Quotes v2.0 by E.S. Ritter <hide@address.com>";		// misc info goes here
$block_display_position = 16;	// see README for the codes. 16 sets it to show
								// on left, topcenter and right. 1 is just left.

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

include_once ('header.php');

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

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

		case "uninstall" :
			include_once ("./mod/$modname/".$modname."_uninstall.inc.php");
			if(!$box_content) {
				$box_content = "<p>Uninstall of $modname was successful.</p>
					<p><a href=\"admin.php\">Return to Site Administration</a></p>";
			}
			$box_title = "$modname Uninstall";
			thememainbox($box_title, $box_content);	
			break;
	
		case "$modname" . "_admin" :
			include_once ("./mod/$modname/".$modname."_admin.inc.php");
			break;
		/* DO NOT INCLUDE A DEFAULT CASE!! If you do
		   it will not continue on to the user switch. */
	}
	
} else {
	/* Displayed when trying to use the above switches without being logged
	   in as an admin. */
	$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) {
	default:
		if (!$op)
		break;
}

include ('footer.php');

?>
Return current item: Quotes Module