当前位置: 首页>>代码示例>>PHP>>正文


PHP Page::getinstance方法代码示例

本文整理汇总了PHP中Page::getinstance方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::getinstance方法的具体用法?PHP Page::getinstance怎么用?PHP Page::getinstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Page的用法示例。


在下文中一共展示了Page::getinstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: do_block

 function do_block($page, $param1, $param2)
 {
     $prefix = resolvepath(trim($param1));
     if ($prefix == '') {
         $prefix = $page->getpagename();
     }
     $prefix .= '/';
     $db = DataBase::getinstance();
     $query = "SELECT pagename FROM page";
     $query .= " WHERE pagename like '{$prefix}%'";
     $query .= " ORDER BY pagename ASC";
     $result = $db->query($query);
     $list = array();
     while ($row = $db->fetch($result)) {
         $list[] = $row['pagename'];
     }
     if ($list == array()) {
         return '';
     }
     natsort($list);
     $len = strlen($prefix);
     foreach ($list as $pagename) {
         $link[] = '<li>' . makelink(Page::getinstance($pagename), substr($pagename, $len)) . '</li>';
     }
     return "<ul>\n" . join("\n", $link) . "\n</ul>\n";
 }
开发者ID:riaf,项目名称:kinowiki,代码行数:26,代码来源:ls.inc.php

示例2: do_block

 function do_block($page, $param1, $param2)
 {
     $num = (int) trim($param1) > 0 ? (int) trim($param1) : 15;
     $exp = array();
     foreach (array_map('trim', explode("\n", $param2)) as $s) {
         if ($s != '') {
             $exp[] = $s;
         }
     }
     $db = DataBase::getinstance();
     $query = "SELECT pagename,timestamp FROM page";
     if ($exp != array()) {
         $_exp = $db->escape('(?:' . join('|', $exp) . ')');
         $query .= " WHERE php('mb_ereg', '{$_exp}', pagename) = 0";
     }
     $query .= " ORDER BY timestamp DESC, pagename ASC LIMIT {$num}";
     $result = $db->query($query);
     $list = array();
     while ($row = $db->fetch($result)) {
         $list[date('Y-m-d', $row['timestamp'])][] = makelink(Page::getinstance($row['pagename']));
     }
     $smarty = $this->getSmarty();
     $smarty->assign('list', $list);
     return $smarty->fetch('recent.tpl.htm');
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:25,代码来源:recent.inc.php

示例3: do_url

 public function do_url()
 {
     if (!isset(Vars::$get['blogname']) || trim(Vars::$get['blogname']) == '') {
         throw new PluginException('パラメータが足りません。', $this);
     }
     $blogname = trim(Vars::$get['blogname']);
     $num = isset(Vars::$get['recent']) && Vars::$get['recent'] > 0 ? (int) Vars::$get['recent'] : 15;
     $db = DataBase::getinstance();
     $_exp = $db->escape('^' . mb_ereg_quote($blogname) . '/\\d{4}-\\d{2}-\\d{2}/');
     $query = "SELECT pagename,timestamp FROM page";
     $query .= " WHERE php('mb_ereg', '{$_exp}', pagename)";
     $query .= " ORDER BY timestamp DESC, pagename ASC LIMIT {$num}";
     $result = $db->query($query);
     $list = array();
     $prefixsize = mb_strlen($blogname . '/9999-99-99/');
     while ($row = $db->fetch($result)) {
         $item['timestamp'] = $row['timestamp'];
         $item['pagename'] = mb_substr($row['pagename'], $prefixsize);
         $item['url'] = getURL(Page::getinstance($row['pagename']));
         $list[] = $item;
     }
     $smarty = $this->getSmarty();
     $smarty->assign('rssurl', SCRIPTURL . '?' . htmlspecialchars($_SERVER['QUERY_STRING']));
     $smarty->assign('sitename', SITENAME);
     $smarty->assign('blogurl', getURL(Page::getinstance($blogname)));
     $smarty->assign('blogname', $blogname);
     $smarty->assign('list', $list);
     header('Content-Type: application/xml; charset=UTF-8');
     header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $item['timestamp'][0]) . ' GMT');
     $smarty->display('blogrss10.tpl.htm');
     exit;
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:32,代码来源:blogrss10.inc.php

示例4: do_url

 function do_url()
 {
     if (!keys_exists(Vars::$post, 'base', 'config')) {
         throw new PluginException('パラメータが足りません', $this);
     }
     $source = Page::getinstance(':config/plugin/tracker/' . Vars::$post['config'] . '/page')->getsource();
     foreach (Vars::$post as $key => $data) {
         if (mb_strpos($key, 'param_') === 0) {
             $name = '[' . mb_substr($key, 6) . ']';
             $_data = trim($data);
             $_data = mb_ereg_replace('\\[', '&#x5b;', $_data, 'm');
             $_data = mb_ereg_replace('\\]', '&#x5d;', $_data, 'm');
             $replace[$name] = $_data;
         }
     }
     $replace['[_date]'] = date('Y-m-d H:i:s');
     $replace['[_base]'] = Vars::$post['base'];
     foreach ($replace as $name => $data) {
         $source = mb_ereg_replace(mb_ereg_quote($name), $data, $source, 'm');
     }
     $db = DataBase::getinstance();
     self::$sqlite_pattern = '^' . mb_ereg_quote(Vars::$post['base']) . '/(\\d+)';
     $db->create_aggregate('plugin_tracker_maxnum', array('Plugin_tracker', 'sqlite_maxnum'), array('Plugin_tracker', 'sqlite_maxnum_finalize'), 1);
     $row = $db->fetch($db->query("SELECT plugin_tracker_maxnum(pagename) FROM page"));
     $num = $row[0] + 1;
     $title = isset(Vars::$post['param_title']) && trim(Vars::$post['param_title']) != '' ? '/' . trim(Vars::$post['param_title']) : '';
     $page = Page::getinstance(Vars::$post['base'] . '/' . $num . $title);
     $page->write($source);
     redirect($page);
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:30,代码来源:tracker.inc.php

示例5: do_url

 function do_url()
 {
     if (!keys_exists(Vars::$post, 'num', 'type', 'pagename')) {
         throw new PluginException('パラメータが足りません。', $this);
     }
     if (trim(Vars::$post['text']) == '') {
         redirect(Page::getinstance(Vars::$post['pagename']));
     }
     $page = Page::getinstance(Vars::$post['pagename']);
     $source = explode("\n", Page::getinstance(Vars::$post['pagename'])->getsource());
     $count = 0;
     for ($i = 0; $i < count($source); $i++) {
         if (mb_ereg('^#comment(?:\\s|\\(|{|$)', $source[$i])) {
             if ($count == Vars::$post['num']) {
                 $name = trim(Vars::$post['name']);
                 $text = mb_ereg_replace('{', '&173;', Vars::$post['text']);
                 $text = mb_ereg_replace('}', '&175;', $text);
                 $time = date('Y-m-d H:i:s', time());
                 $str = ":[[{$name}>UserPage/{$name}]] &size(80%) {{$time}}:";
                 $str .= mb_ereg("\n", $str) ? "\n#block{{$text}}" : " {$text}";
                 $n = $i + (Vars::$post['type'] == 'below' ? 1 : 0);
                 array_splice($source, $n, 0, $str);
                 $page->write(join("\n", $source));
                 setcookie('name', $name, time() + 60 * 60 * 24 * 30);
                 redirect($page);
             }
             $count++;
         }
     }
     $ret['title'] = 'error';
     $smarty = $this->getSmarty();
     $smarty->assign('text', Vars::$post['text']);
     $ret['body'] = $smarty->fetch('error.tpl.htm');
     return $ret;
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:35,代码来源:comment.inc.php

示例6: do_url

 public function do_url()
 {
     $num = isset(Vars::$get['recent']) && Vars::$get['recent'] > 0 ? (int) Vars::$get['recent'] : 15;
     $db = DataBase::getinstance();
     $query = "SELECT pagename,timestamp FROM page";
     if (isset(Vars::$get['exp']) && trim(Vars::$get['exp']) != '') {
         $_inc = $db->escape(Vars::$get['exp']);
         $query .= " WHERE php('mb_ereg', '{$_inc}', pagename)";
     } else {
         if (isset(Vars::$get['include']) && trim(Vars::$get['include']) != '') {
             $_inc = $db->escape(glob2ereg(Vars::$get['include']));
             $query .= " WHERE php('mb_ereg', '{$_inc}', pagename)";
         }
     }
     $query .= " ORDER BY timestamp DESC, pagename ASC LIMIT {$num}";
     $result = $db->query($query);
     $list = array();
     while ($row = $db->fetch($result)) {
         $item['timestamp'] = $row['timestamp'];
         $item['pagename'] = $row['pagename'];
         $item['url'] = getURL(Page::getinstance($row['pagename']));
         $list[] = $item;
     }
     $smarty = $this->getSmarty();
     $smarty->assign('rssurl', SCRIPTURL . '?' . htmlspecialchars($_SERVER['QUERY_STRING']));
     $smarty->assign('sitename', SITENAME);
     $smarty->assign('baseurl', SCRIPTURL);
     $smarty->assign('list', $list);
     header('Content-Type: application/xml; charset=UTF-8');
     header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $item['timestamp'][0]) . ' GMT');
     $smarty->display('rss10.tpl.htm');
     exit;
 }
开发者ID:riaf,项目名称:kinowiki,代码行数:33,代码来源:rss10.inc.php

示例7: do_block

 function do_block($page, $param1, $param2)
 {
     $prefix = trim($param1);
     $pattern = '^' . mb_ereg_quote($prefix) . '/(\\d{1,4})-(\\d{2})';
     if (mb_ereg($pattern, $page->getpagename(), $m)) {
         $year = $m[1];
         $month = $m[2];
     } else {
         if (isset(Vars::$get['year']) && isset(Vars::$get['month'])) {
             $year = Vars::$get['year'];
             $month = Vars::$get['month'];
         } else {
             $year = date('Y');
             $month = date('n');
         }
     }
     $smarty = $this->getSmarty();
     $day = 1;
     $last = date('t', mktime(0, 0, 0, $month, 1, $year));
     while ($day <= $last) {
         $line = array_fill(0, 7, '&nbsp;');
         $d = date('w', mktime(0, 0, 0, $month, $day, $year));
         for (; $d < 7 && $day <= $last; $d++, $day++) {
             $p = Page::getinstance(sprintf('%s/%04d-%02d-%02d', $prefix, $year, $month, $day));
             $line[$d] = $p->isexist() ? makelink($p, $day) : $day;
         }
         $table[] = $line;
     }
     $smarty->assign('table', $table);
     $smarty->assign('year', $year);
     $smarty->assign('month', $month);
     $smarty->assign('prefix', $prefix);
     $smarty->assign('page', $page->getpagename());
     return $smarty->fetch('blogcalendar.tpl.htm');
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:35,代码来源:blogcalendar.inc.php

示例8: do_url

 function do_url()
 {
     if (!keys_exists(Vars::$post, 'num', 'pagename')) {
         throw new PluginException('パラメータが足りません。', $this);
     }
     if (trim(Vars::$post['text']) == '') {
         redirect(Page::getinstance(Vars::$post['pagename']));
     }
     $page = Page::getinstance(Vars::$post['pagename']);
     $source = explode("\n", Page::getinstance(Vars::$post['pagename'])->getsource());
     $count = 0;
     for ($i = 0; $i < count($source); $i++) {
         if (mb_ereg('^#bbsres(?:\\s|\\(|{|$)', $source[$i])) {
             if ($count == Vars::$post['num']) {
                 $name = isset(Vars::$post['name']) ? trim(Vars::$post['name']) : '';
                 $smarty = $this->getSmarty();
                 $smarty->assign('name', $name);
                 $smarty->assign('text', Vars::$post['text']);
                 $smarty->assign('timestamp', time());
                 array_splice($source, $i, 0, $smarty->fetch('bbsres.tpl'));
                 $page->write(join("\n", $source));
                 setcookie('name', trim($name), time() + 60 * 60 * 24 * 30);
                 redirect($page);
             }
             $count++;
         }
     }
     $ret['title'] = 'error';
     $smarty = $this->getSmarty();
     $smarty->assign('text', Vars::$post['text']);
     $ret['body'] = $smarty->fetch('error.tpl.htm');
     return $ret;
 }
开发者ID:riaf,项目名称:kinowiki,代码行数:33,代码来源:bbsres.inc.php

示例9: includepage

 protected function includepage($pagename)
 {
     $source = mb_ereg_replace('#blognavi', '', Page::getinstance($pagename)->getsource());
     $smarty = $this->getSmarty();
     $smarty->assign('title', $pagename);
     $smarty->assign('body', convert_block($source, $pagename));
     return $smarty->fetch('include.tpl.htm');
 }
开发者ID:riaf,项目名称:kinowiki,代码行数:8,代码来源:blogviewer.inc.php

示例10: doing

 function doing()
 {
     $keywords = 'penis|buy|vimax|sonia|online|cheap|lady|a href|' . 'sex|viagra';
     if (preg_match('/.*(' . $keywords . ')/i', trim(Vars::$post['text']))) {
         redirect(Page::getinstance(Vars::$post['pagename']));
         //$this->getSmarty()->display('spam.tpl.html');
         exit;
     }
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:9,代码来源:blockspam.inc.php

示例11: update

 function update($page, $arg)
 {
     if (!$page->isexist() && $page->isexist(1)) {
         $mailflag = Mail::getinstance()->setsending(false);
         $logpage = Page::getinstance(self::LOGPAGE);
         $log = '-' . date('Y-m-d (D) H:i:s') . ' [[' . $page->getpagename() . ']]';
         $logpage->write($log . "\n" . $logpage->getsource());
         Mail::getinstance()->setsending($mailflag);
     }
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:10,代码来源:recentdeleted.inc.php

示例12: makeignorelist

 /**
  * ignoreリストを構築する。
  */
 protected function makeignorelist()
 {
     $this->ignorelist = array();
     $page = Page::getinstance(self::ignorelistpage);
     $lines = explode("\n", $page->getsource());
     foreach ($lines as $str) {
         if (mb_ereg('^-\\[\\[(.+)\\]\\]', $str, $m)) {
             $this->ignorelist[] = $m[1];
         }
     }
 }
开发者ID:riaf,项目名称:kinowiki,代码行数:14,代码来源:autolink.inc.php

示例13: do_block

 function do_block($page, $param1, $param2)
 {
     $p = Page::getinstance($param1);
     if (!$p->isexist() || $p->isnull()) {
         return '<p class="warning">ページがありません。</p>';
     }
     $smarty = $this->getSmarty();
     $smarty->assign('title', $p->getpagename());
     $smarty->assign('body', convert_Page($p));
     return $smarty->fetch('include.tpl.htm');
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:11,代码来源:include.inc.php

示例14: do_inline

 function do_inline($page, $param1, $param2)
 {
     mb_ereg('^(.*?)(?:\\s*,\\s*(.*?))?$', trim($param1), $m);
     $file = $m[1];
     $page = $m[2] == '' ? $page : Page::getinstance($m[2]);
     if (!Attach::getinstance($page)->isexist($file)) {
         return '<span class="warning">ファイルがありません</span>';
     }
     $url = SCRIPTURL . '?cmd=attach' . '&amp;param=download' . '&amp;page=' . rawurlencode($page->getpagename()) . '&amp;file=' . rawurlencode($file);
     return '<a href="' . $url . '">' . htmlspecialchars($file) . '</a>';
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:11,代码来源:download.inc.php

示例15: do_url

 function do_url()
 {
     if (isset(Vars::$get['param']) && Vars::$get['param'] == 'restruct') {
         return $this->restruct();
     } else {
         if (isset(Vars::$get['page'])) {
             return $this->showall(Page::getinstance(Vars::$get['page']));
         }
     }
     throw new CommandException('パラメータがちがいます', $this);
 }
开发者ID:kaz6120,项目名称:BitWiki,代码行数:11,代码来源:backlink.inc.php


注:本文中的Page::getinstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。