function plugin_rewritemap_url($page) { global $defaultpage; $script = get_script_uri(); $baseurl = substr($script, 0, strrpos($script, '/')) . '/'; if ($page == $defaultpage) { return $baseurl; } $alias = plugin_rewritemap_get_alias($page); if (empty($alias)) { if (exist_plugin('statichtml')) { $alias = PluginStatichtml::encode($page); } else { $alias = str_replace('%2F', '/', rawurlencode($page)); } } return $baseurl . $alias . PLUGIN_REWRITEMAP_POSTFIX; }
$navi = do_plugin_convert('navibar', $navibar_arg); if (exist_plugin('statichtml') && $is_read) { // PukiWiki Static! $statichtml = new PluginStatichtml(); $htmllink = '<a rel="nofollow" href="' . $statichtml->get_dump_url($vars['page']) . '">HTML</a>'; $publishlink = '<a rel="nofollow" href="' . get_script_uri() . '?cmd=statichtml&page=' . $vars['page'] . '">Publish</a>'; $navi = str_replace('</div>', ' [ ' . $htmllink . ' | ' . $publishlink . ' ] ' . '</div>', $navi); } } break; case 'toolbar': if (exist_plugin_convert('toolbar')) { $navi = do_plugin_convert('toolbar', $toolbar_arg); if (exist_plugin('statichtml') && $is_read) { // PukiWiki Static! $statichtml = new PluginStatichtml(); $htmllink = '<a rel="nofollow" href="' . $statichtml->get_dump_url($vars['page']) . '"><img width="20" height="20" title="HTML" alt="HTML" src="' . IMAGE_URI . 'reload.png" /></a>'; $publishlink = '<a rel="nofollow" href="' . get_script_uri() . '?cmd=statichtml&page=' . $vars['page'] . '"><img width="20" height="20" title="Publish" alt="Publish" src="' . IMAGE_URI . 'copy.png" /></a>'; $navi = str_replace('</div>', $htmllink . $publishlink . '</div>', $navi); } } break; } } // Title if ($is_read) { if ($newtitle) { $display_title = $newtitle . ' - ' . $page_title; $heading_title = make_pagelink($vars['page'], $newtitle); } elseif ($vars['page'] == $defaultpage) { $display_title = $page_title;
/** * Experiment: Write After Plugin Main Function * * @param string &$page * @param string &$postdata * @param boolean &$notimestamp * @return void or exit; */ function write_after() { parent::write_after(); if ($this->CONF['REDIRECT_AFTER_DUMP']) { if (is_page($page)) { header('Location: ' . $this->get_dump_url($page)); } else { // autocreate if (!is_page($this->CONF['404_PAGE'])) { page_write($this->CONF['404_PAGE'], 'Page was Deleted'); } $this->dump_page($this->CONF['404_PAGE'], null, FALSE); header('Location: ' . $this->get_dump_url($this->CONF['404_PAGE'])); } exit; } }