📄 headers.php
字号:
<?php
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
///
/// PhpMyLibrary is a Php-MySQL driven online library automation, it
/// offers cataloging, circulation, and web public access catalog.
///
/// Copyright (C) 2000 Polerio T. Babao Jr. II
///
/// This program 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
/// (at your option) any later version.
///
/// This program 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 this program; if not, write to the Free Software
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
///
/// Refer to http://phpmylibrary.sourceforge.net/phpmylibrary for an online
/// demonstration of the phpmylibrary online application program.
///
/// Modified 21 December 17, 2002 01:25p GMT+8
/// Copy of license at http://phpmylibrary.sourceforge.net/LICENSE
/// http://www.phpmylibrary.n3.net or http://phpmylibrary.sourceforge.net
/// Polerio T. Babao Jr.II http://www.polerio.n3.net
/// 43-A Bagong Lote, Potrero Malabon, Metro Manila Philippines.
///
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/*
function _Linux_Server()
{
if((ereg("Linux",getenv("SERVER_SOFTWARE"))) || (ereg("Unix",getenv("SERVER_SOFTWARE")))) return true;
}
function _GetPolerioURI()
{
global $op, $name, $file;
$script_fn = getenv('PATH_TRANSLATED');
$script_fn = explode(chr(92),$script_fn);
$script_fn = implode(chr(47),$script_fn);
if(_Linux_Server()) $script_fn = getenv('SCRIPT_FILENAME');
$sz = 3; if($op && $name && $file) $sz = 2;
$escript_fn = explode("/",$script_fn);
$cscript_fn = count($escript_fn); $i = 0;
$_escript_fn = array();
while($i <= $cscript_fn-$sz)
{ $_escript_fn[$i] = $escript_fn[$i]; $i++; }
$_script_fn = implode("/",$_escript_fn);
if($op && $name && $file) $_script_fn = $_script_fn.'/modules/PhpMyLibrary/polerio';
return $_script_fn.'/';
}
$GetPolerioURI = _GetPolerioURI();
$GetModuleURI = _GetPolerioURI().'phpmylibrary/';
define('POLERIO_BASE',$GetPolerioURI);
define('PHPMYLIBRARY_BASE',$GetModuleURI);
include POLERIO_BASE.'lib/Polerio.php';
include POLERIO_BASE.'lib/MySQL.php';
include POLERIO_BASE.'config/conf.php';
$ModName = basename( dirname( __FILE__ ) );
$lang = $config['lang'];
include "$GetPolerioURI/lang/$lang/global.php";
include PHPMYLIBRARY_BASE.'config/conf.php';
include PHPMYLIBRARY_BASE.'lib/Phpmylibrary.php';
*/
function PostNuke()
{
global $op, $name;
if($op && $name) return true;
else return false;
}
/**
* get base URI
* @returns string
* @return base URI
*/
function GetBaseURI()
{
global $HTTP_SERVER_VARS;
// Get the name of this URI
// Start of with REQUEST_URI
if (isset($HTTP_SERVER_VARS['REQUEST_URI'])) {
$path = $HTTP_SERVER_VARS['REQUEST_URI'];
} else {
$path = getenv('REQUEST_URI');
}
if ((empty($path)) ||
(substr($path, -1, 1) == '/')) {
// REQUEST_URI was empty or pointed to a path
// Try looking at PATH_INFO
$path = getenv('PATH_INFO');
if (empty($path)) {
// No luck there either
// Try SCRIPT_NAME
if (isset($HTTP_SERVER_VARS['SCRIPT_NAME'])) {
$path = $HTTP_SERVER_VARS['SCRIPT_NAME'];
} else {
$path = getenv('SCRIPT_NAME');
}
}
}
$path = preg_replace('/[#\?].*/', '', $path);
$path = dirname($path);
if (preg_match('!^[/\\\]*$!', $path)) {
$path = '';
}
return $path;
}
function GetRoot()
{
global $HTTP_SERVER_VARS;
if (empty($HTTP_SERVER_VARS['DOCUMENT_ROOT'])) {
$root= getenv('DOCUMENT_ROOT');
} else {
$root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
}
return $root;
}
if(PostNuke()) $PolerioModuleRoot = GetRoot().GetBaseURI().'/modules/'.$name.'/polerio/';
else $PolerioModuleRoot = GetRoot().GetBaseURI().'/polerio/';
define('GetPolerioURI',$PolerioModuleRoot);
define('GETMODULEROOT',$PolerioModuleRoot.'module/');
include GetPolerioURI.'lib/Polerio.php';
include GetPolerioURI.'config/conf.php';
include GetPolerioURI.'lang/en/global.php';
include GetPolerioURI.'lang/en/MARC.php';
include GETMODULEROOT.'config/conf.php';
include GETMODULEROOT.'lib/module.php';
Polerio::Init();
if($submit_user_action=="Print MARC")
{
include Polerio::GetModuleURI().'/lib/Export.php';
MARC::PrintMarc($selected_tbl);
}
if($submit_user_action=="ZIP MARC")
{
include Polerio::GetModuleURI().'/lib/Export.php';
MARC::Export($selected_tbl);
}
if($submit_user_action=="Email MARC")
{
include Polerio::GetModuleURI().'/lib/Export.php';
MARC::EmailMARC($selected_tbl,$email);
print"The Email has been sent!";
}
if($submit_user_action=="Print DATA")
{
include "$GetPolerioURI/lang/$lang/global.php";
include "$GetPolerioURI/lang/$lang/MARC.php";
echo Phpmylibrary::View($selected_tbl);
echo Polerio::PhpMyLibrary();
}
if($submit_user_action=="ZIP DATA")
{
include "$GetPolerioURI/lang/$lang/global.php";
include "$GetPolerioURI/lang/$lang/MARC.php";
include Polerio::GetModuleURI().'/lib/Export.php';
MARC::ZIPDATA($selected_tbl);
}
if($submit_user_action=="Email DATA")
{
include "$GetPolerioURI/lang/$lang/global.php";
include "$GetPolerioURI/lang/$lang/MARC.php";
include Polerio::GetModuleURI().'/lib/Export.php';
MARC::EmailDATA($selected_tbl,$email);
print"The Email has been sent!";
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -