Location: PHPKode > projects > PLiMa > plima-0.5.2/inc/init.inc.php
<?
/***
  *   pLiMa - php List Manager
  *   Copyright (C) 2003  Jinn Koriech (hide@address.com)
  *
  *		This file is part of pLiMa.
  *
  *   pLiMa is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
  *   the Free Software Foundation; either version 2 of the License, or
  *   any later version.
  *
  *   pLiMa is distributed in the hope that it will be useful,
  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *   GNU General Public License for more details.
  *
  *   You should have received a copy of the GNU General Public License
  *   along with pLiMa; if not, visit http://www.gnu.org or write to the
  *   Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  *	  Boston, MA  02111-1307  USA
  *
  */
  // Define the constant representing the pLiMa installation
  define("WEB_ROOT", "/plima");			// no trialing slash, set this to the folder relative to your site

  /*
  header("Expires: " . gmdate("D, d M Y H:i:s", (time()-300)) . " GMT");		//  Expired 5 minutes ago
  header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");		//  always modified
  header("Cache-control: no-store, no-cache, must-revalidate");		// HTTP1.1
  header("Cache-control: post-check=0, pre-check=0", false);	// HTTP1.1
  header("Pragma: no-cache");
  */


  /***************************************************************************
    NO NEED TO CHANGE ANYTHING BELOW HERE UNLESS YOU KNOW WHAT YOU'RE DOING ;)
   ***************************************************************************/
  $DOC_ROOT = $_SERVER['DOCUMENT_ROOT'] == '' ? "../.." : $_SERVER['DOCUMENT_ROOT'];
  define("APP_ROOT", $DOC_ROOT . WEB_ROOT);

  // Start the session
  if ($SKIP_SESSION != 'your_password' ) {
    session_cache_limiter('private');	// Make sure the forms come back with the data that was entered
    session_start();
  }
  if ( $unset == '1' ) {
    session_unset();
  }

  // Get the configuration variables
  require(APP_ROOT."/inc/config.inc.php");
  require(APP_ROOT."/inc/helper.func.php");

  // Get the database layer and establish a connection
  require(APP_ROOT."/inc/db-share.inc.php");
  db_connect();

  // Check if there are any mailing lists.  If not send to the new-list1.php script.
  $tables = mysql_list_tables(DB_NAME) or die(mysql_error());
  $list_count = 0;
  while ( $row = mysql_fetch_row($tables) ) {
    if ( strstr($row[0], TABLE_PREFIX) )
      $list_count++;
  }

  if ( $list_count == 0 && !strstr($PHP_SELF, "new-list") ) {
    header("Location: ".WEB_ROOT."/new-list1.phtml");
    exit;
  }

  // Carry out any neccessary work before any output is generated

  // Set the selected list as default
  if ( isset($_GET['select_list']) ) {
    $_SESSION['MALI'] = $_GET['select_list'];
    $_SESSION['mali'] = strtoupper(str_replace(TABLE_PREFIX, "", $_GET['select_list']));
  }
?>
Return current item: PLiMa