예제 #1
0
 function update($show, $arg)
 {
     $list = FuzzyLink::getinstance()->getpagelist($this->getcurrentPage()->getpagename());
     $smarty = $this->getSmarty();
     foreach ($list as $page) {
         if (!$page->equals($this->getcurrentPage())) {
             //現在のページは除外する。
             $smarty->append('pagelist', $page->getpagename());
         }
     }
     $this->setbody($smarty->fetch('maybe.tpl.htm'));
 }
예제 #2
0
파일: BitWiki.php 프로젝트: kaz6120/BitWiki
 /**
  * Initialize objects except BitWiki class
  */
 static function init()
 {
     // set internal encodings.
     mb_internal_encoding('UTF-8');
     mb_regex_encoding('UTF-8');
     // set SCRIPTURL
     if ($_SERVER['SERVER_PORT'] == 443) {
         $protocol = 'https';
         $port = '';
     } else {
         $protocol = 'http';
         $port = $_SERVER['SERVER_PORT'] != 80 ? ":{$_SERVER['SERVER_PORT']}" : '';
     }
     define('SCRIPTDIR', $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . mb_substr($_SERVER['SCRIPT_NAME'], 0, mb_strrpos($_SERVER['SCRIPT_NAME'], '/') + 1));
     define('SCRIPTURL', $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['SCRIPT_NAME']);
     // check if table is already prepared and create when not exists.
     $isinstalled = self::installcheck();
     // insntaciate classes
     Vars::init();
     AutoLink::init();
     BackLink::init();
     FuzzyLink::init();
     Mail::init();
     // install initialize page when table is not prepared.
     if (!$isinstalled) {
         self::installpage();
     }
 }
예제 #3
0
 /**
  * KinoWikiクラスのインスタンスとは関係のないものの初期化。
  */
 static function init()
 {
     //内部エンコードの設定
     mb_internal_encoding('UTF-8');
     mb_regex_encoding('UTF-8');
     //SCRIPTURLの設定
     if ($_SERVER['SERVER_PORT'] == 443) {
         $protocol = 'https';
         $port = '';
     } else {
         $protocol = 'http';
         $port = $_SERVER['SERVER_PORT'] != 80 ? ":{$_SERVER['SERVER_PORT']}" : '';
     }
     define('SCRIPTDIR', $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . mb_substr($_SERVER['SCRIPT_NAME'], 0, mb_strrpos($_SERVER['SCRIPT_NAME'], '/') + 1));
     define('SCRIPTURL', $protocol . '://' . $_SERVER['SERVER_NAME'] . $port . $_SERVER['SCRIPT_NAME']);
     //テーブルが用意されているかチェックし、用意されていなければ用意する。
     $isinstalled = self::installcheck();
     //各クラスの初期化
     Vars::init();
     AutoLink::init();
     BackLink::init();
     FuzzyLink::init();
     Mail::init();
     //テーブルが用意されていなかった場合、初期ページを書き込む
     if (!$isinstalled) {
         self::installpage();
     }
 }
예제 #4
0
 public static function parse(&$str, $context)
 {
     $exp = FuzzyLink::getinstance()->getexpression();
     if ($exp != '' && mb_ereg("^{$exp}", $str, $m)) {
         $str = _substr($str, strlen($m[0]));
         return new T_FuzzyLink($m[0], $context);
     }
     return null;
 }