示例#1
0
文件: new.inc.php 项目: riaf/kinowiki
 function do_url()
 {
     if (isset(Vars::$get['page'])) {
         $dir = getdirname(Vars::$get['page']);
         $default = $dir == '' ? '' : $dir . '/';
     } else {
         $default = '';
     }
     $ret['title'] = 'ページ新規作成';
     $smarty = $this->getSmarty();
     $smarty->assign('default', $default);
     $ret['body'] = $smarty->fetch('new.tpl.htm');
     return $ret;
 }
示例#2
0
 /**
  * 書き込みフォームを用意する。
  * 
  * @param	string	$pagename	ページ名(エンコード無し)
  * @param	string	$source	ページ内容。
  * @param	bool	$notimestamp	タイムスタンプ更新なしのオプション
  * @param	string	$seed	同時更新回避の識別子
  */
 protected function getpostform($pagename, $source = null, $notimestamp = false, $seed = null)
 {
     if ($pagename == '') {
         throw new CommandException('ページ名に空文字列は使えません。', $this);
     }
     if ($source == null) {
         $page = Page::getinstance($pagename);
         $source = $page->getsource();
         $seed = md5($source);
         if ($source == '') {
             $source = Page::getinstance(getdirname($pagename) . '/:template')->getsource();
         }
     } else {
         if ($seed == null) {
             $seed = md5($source);
         }
     }
     $smarty = $this->getSmarty();
     $smarty->assign('pagename', $pagename);
     $smarty->assign('source', $source);
     $smarty->assign('seed', $seed);
     $smarty->assign('notimestamp', $notimestamp);
     return $smarty->fetch('postform.tpl.htm');
 }
示例#3
0
<?php

/**
 * Copyright (c) 2003-2103  phpwind.net. All rights reserved.
 *
 * @filename: install.php
 * @author: Noizy Sky_hold cn0zz Fengyu Xiaolang Zhudong
 */
set_time_limit(0);
error_reporting(E_ERROR | E_PARSE);
function_exists('set_magic_quotes_runtime') && set_magic_quotes_runtime(0);
function_exists('date_default_timezone_set') && date_default_timezone_set('Etc/GMT+0');
define('PW_UPLOAD', 1);
define('R_P', getdirname(__FILE__));
define('D_P', R_P);
define('P_W', 'global');
require_once R_P . 'require/security.php';
require R_P . 'require/common.php';
pwInitGlobals();
!$_SERVER['PHP_SELF'] && ($_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME']);
$selfrpos = strrpos($_SERVER['PHP_SELF'], '/');
$basename = substr($_SERVER['PHP_SELF'], $selfrpos + 1);
$bbsurl = 'http://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, $selfrpos);
$crlf = GetCrlf();
$onlineip = pwGetIp();
$timestamp = time();
require_once R_P . 'lang/install_lang.php';
/**
 * 安装信息配置
 */
$_WIND = 'install';
示例#4
0
文件: core.php 项目: hupantingxue/www
    public function getSites()
    {
        set_time_limit(0);
        static $sites = false;
        if ($sites) {
            return $sites;
        }
        $file = T_PATH . 'cache/sites.php';
        $sites = cache_read($file);
        if (!$sites) {
            $host = get_lines_by_php(T_PATH . 'seodj/host.php');
            $sitetitle = get_lines_by_php(T_PATH . 'seodj/keys.php');
            if (!$host) {
                header('HTTP/1.1 503 Service Temporarily Unavailable');
                header('Status: 503 Service Temporarily Unavailable');
                header('Retry-After: 3600');
                echo '
				<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
				<html>
					<head>
						<title>简单客站群系统</title>
					</head>
					<body>
						<div style="text-align:center;"><h2><font color="red">seodj目录下的 host.php 的行数为空,请检查!</font></h2></div>
					<!-- 简单客站群系统 QQ:1795873837 -->
					</body>
				</html>';
                exit;
            } else {
                if (!$sitetitle || count($host) > count($sitetitle)) {
                    header('HTTP/1.1 503 Service Temporarily Unavailable');
                    header('Status: 503 Service Temporarily Unavailable');
                    header('Retry-After: 3600');
                    echo '
				<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
				<html>
				    <head>
					    <title>简单客站群系统</title>
				    </head>
					<body>
						<div style="text-align:center;"><h2><font color="red">seodj目录下 host.php 的行数大于 keys.php 的行数,请检查!</font></h2></div>
					<!-- 简单客站群系统 QQ:1795873837 -->
					</body>
				</html>';
                    exit;
                }
            }
            @mkdir(T_PATH . 'cache/');
            @mkdir(T_PATH . 'cache/web/');
            $sites = array();
            foreach ($host as $_) {
                @mkdir(T_PATH . 'cache/' . getdirname($_) . '/');
                // $sites[$_] = array_shift($sitetitle);
                $sss = array_shift($sitetitle);
                $ssaa = explode('|', $sss);
                $tttt = '';
                foreach ($ssaa as $i => $v) {
                    if ($v) {
                        if ($tttt) {
                            $tttt .= '_' . $v;
                        } else {
                            $tttt .= $v;
                        }
                    }
                }
                $sites[$_] = $tttt;
            }
            cache_write($file, $sites);
        }
        $_SERVER['sites'] = $sites;
        return $sites;
    }
示例#5
0
<?php

/*********************/
/*                   */
/*  Version : 5.1.0  */
/*  Author  : RM     */
/*  Comment : 071223 */
/*                   */
/*********************/
function getdirname($_obfuscate_pp9pYwÿÿ = null)
{
    if (!empty($_obfuscate_pp9pYwÿÿ)) {
        if (strpos($_obfuscate_pp9pYwÿÿ, "\\") !== false) {
            return substr($_obfuscate_pp9pYwÿÿ, 0, strrpos($_obfuscate_pp9pYwÿÿ, "\\")) . "/";
        }
        if (strpos($_obfuscate_pp9pYwÿÿ, "/") !== false) {
            return substr($_obfuscate_pp9pYwÿÿ, 0, strrpos($_obfuscate_pp9pYwÿÿ, "/")) . "/";
        }
    }
    return "./";
}
define("PATH", getdirname(__FILE__));
define("ROOT", "/");
require PATH . "include/db_config.php";
require PATH . "include/db_mysql.class.php";
require PATH . "cache/site_config.php";
require PATH . "cache/nav.php";
require "include/global.func.php";
date_default_timezone_set("PRC");
$db = new db_mysql();
$db->connect($dbhost, $dbuser, $dbpw, $dbname, $dbpconnect, $dbcharset);
示例#6
0
文件: global.php 项目: holin/sstour
{
	die("ÄúûȨÏÞä¯ÀÀ±¾Ò³<BR>Èç¹ûÄúÐèÒª²é¿´±¾Ò³<a href='http://www.oi77.com'>ÇëÓë¹ÜÀíÔ±ÁªÏµ</a>");
}
*/
//error_reporting(E_ERROR | E_WARNING | E_PARSE);
error_reporting($config['error']);
//@ini_set('register_globals',1);
set_magic_quotes_runtime(0);
set_time_limit(0);
$mtime = explode(' ', microtime());
$m_time = $mtime[1] + $mtime[0];
$nowtime = $_SERVER['REQUEST_TIME'] ? $_SERVER['REQUEST_TIME'] : time();
//$nowtime = time();
$mb_convert_encoding = function_exists('mb_convert_encoding');
$iconv = function_exists('iconv');
define('R_P', __FILE__ ? getdirname(__FILE__) . '/' : './');
define('ICONV', $iconv);
define('M_B', $mb_convert_encoding);
if ($config['self'] == '1') {
    $cooktime = $_COOKIE['lasttime'] ? $_COOKIE['lasttime'] : $_SESSION['lasttime'];
    $time = $nowtime - $cooktime;
    Cookie("lasttime", $nowtime);
    if ($_SERVER['HTTP_X_FORWARDED_FOR'] != '' && $time < 3) {
        Showmsg("Refresh");
    } elseif ($time < 15 && $_COOKIE['self'] > 5) {
        Showmsg("Refresh");
    } elseif ($time < 15 && $_COOKIE['self'] < 5) {
        $self = $_COOKIE['self'] + 1;
        Cookie("self", $self);
    } else {
        Cookie("self", '0');
    } else {
        $fromtype = '';
    }
    if ($end == '.jp2' || $end == '.tif') {
        // get basename
        $base = basename($dfil, $end);
        $seqdir = getseqdir($base);
        $dirname = getdirname($base);
        print "Now working with {$dirname}...\n";
        // find seq
        $s = explode('/', $seqdir);
        $seq = $s[1];
        $newdir = './' . $seqdir;
        $new = './' . $seqdir . "/" . 'OBJ' . $end;
        // what is xbase xml of this image
        $thisxml = getdirname($base) . ".xml";
        // get booktitle specific to this image
        $booktitle = gettitle($thisxml, $meta);
        // encode entities
        $booktitle = htmlentities($booktitle, ENT_QUOTES, 'UTF-8');
        // make mods.xml
        $pagexml = <<<EOL
<?xml version="1.0" encoding="UTF-8"?>
<mods:mods xmlns:mods="http://www.loc.gov/mods/v3" xmlns="http://www.loc.gov/mods/v3">
  <mods:titleInfo>
    <mods:title>{$booktitle} : page {$seq}</mods:title>
  </mods:titleInfo>
</mods:mods>
EOL;
        // switch contexts to fix syntax highlighting
        $mfile = $seqdir . "/" . "MODS.xml";
示例#8
0
 public static function parse(&$str, $context)
 {
     $list[] = $context->pagename;
     $list[] = getdirname($context->pagename);
     $list[] = '';
     foreach ($list as $dir) {
         $exp = AutoLink::getinstance()->getexpression($dir);
         if ($exp != '' && mb_ereg("^{$exp}", $str, $m)) {
             $str = _substr($str, strlen($m[0]));
             return new T_AutoLink($m[0], $context, $dir . '/' . $m[0]);
         }
     }
     return null;
 }
示例#9
0
is_link(KOHANA) and chdir(dirname(realpath(__FILE__)));
// If kohana folders are relative paths, make them absolute.
$kohana_application = file_exists($kohana_application) ? $kohana_application : DOCROOT . $kohana_application;
$kohana_modules = file_exists($kohana_modules) ? $kohana_modules : DOCROOT . $kohana_modules;
$kohana_system = file_exists($kohana_system) ? $kohana_system : DOCROOT . $kohana_system;
$kohana_attachment = file_exists($kohana_attachment) ? $kohana_attachment : DOCROOT . $kohana_attachment;
$kohana_cache = file_exists($kohana_cache) ? $kohana_cache : DOCROOT . $kohana_cache;
// Define application and system paths
define('APPPATH', str_replace('\\', '/', realpath($kohana_application)) . '/');
define('MODPATH', str_replace('\\', '/', realpath($kohana_modules)) . '/');
define('SYSPATH', str_replace('\\', '/', realpath($kohana_system)) . '/');
define('ATTPATH', str_replace('\\', '/', realpath($kohana_attachment)) . '/');
define('CACHEPATH', str_replace('\\', '/', realpath($kohana_cache)) . '/');
//自定义模板目录
define('APPTPL', str_replace('\\', '/', DOCROOT) . 'tpl_shop/');
define('WEBROOT', __FILE__ ? getdirname(__FILE__) . '/' : './');
/**
*取得相对路径
*
*系统根目录相对路径
*/
function getdirname($path)
{
    if (strpos($path, '\\') !== false) {
        return substr($path, 0, strrpos($path, '\\'));
    } elseif (strpos($path, '/') !== false) {
        return substr($path, 0, strrpos($path, '/'));
    } else {
        return '/';
    }
}
示例#10
0
 function _getCharsetFilePath()
 {
     return getdirname(__FILE__) . '/encode/';
 }