/** * @author lunt * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPL 2 * @version $Id: monobook_popular.inc.php 196 2007-07-01 07:07:11Z lunt $ */ function plugin_monobook_popular_convert() { if (!exist_plugin_convert('popular')) { return; } $args = func_get_args(); return str_replace('<div>', '<div class="menubox">', call_user_func_array('plugin_popular_convert', $args)); }
/** * @author lunt * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPL 2 * @version $Id: monobook_recent.inc.php 196 2007-07-01 07:07:11Z lunt $ */ function plugin_monobook_recent_convert() { if (!exist_plugin_convert('recent')) { return; } $args = func_get_args(); return str_replace('<div>', '<div class="monobook_recent">', call_user_func_array('plugin_recent_convert', $args)); }
/** * @author lunt * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPL 2 * @version $Id: monobook_search.inc.php 214 2007-07-24 11:16:00Z lunt $ */ function plugin_monobook_search_convert() { if (!exist_plugin_convert('search')) { return; } $str = explode("\n", plugin_search_convert()); $str = preg_grep('/value="OR"|\\<label for\\="|encode_hint/', $str, PREG_GREP_INVERT); $str = str_replace(array('type="radio"', 'type="text"', 'type="submit"'), array('type="hidden"', 'class="searchInput" type="text"', 'class="searchButton" type="submit"'), $str); return "<div class=\"monobook_search\">\n" . implode("\n", $str) . "\n</div>"; }
/** * @author sonots * * based on * * @author lunt * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GPL 2 * @version $Id: monobook_popular.inc.php 196 2007-07-01 07:07:11Z lunt $ */ function plugin_whiteflow_popular_convert() { if (!exist_plugin_convert('popular')) { return; } $args = func_get_args(); $ret = call_user_func_array('plugin_popular_convert', $args); $ret = str_replace('<div>', '<div class="popular_list">', $ret); $ret = preg_replace('/<ul[^>]*>/', '<ol>', $ret); $ret = str_replace('</ul>', '</ol>', $ret); return $ret; }
function plugin_gcounter_convert() { if (!exist_plugin_convert('counter')) { return '<p>gcounter(): counter plugin does not exist.</p>'; } if (plugin_gcounter_init_gcounter() === FALSE) { return '<p>gcounter(): failed to create gcounter log file.</p>'; } global $vars; $tmp = $vars['page']; $vars['page'] = PLUGIN_GCOUNTER_PAGE; $args = func_get_args(); $body = do_plugin_convert('counter', csv_implode(',', $args)); $vars['page'] = $tmp; return $body; }
function plugin_rename_get_files($pages) { global $log; $files = array(); $dirs = array(BACKUP_DIR, DIFF_DIR, DATA_DIR); if (exist_plugin_convert('attach')) { $dirs[] = UPLOAD_DIR; } if (exist_plugin_convert('counter')) { $dirs[] = COUNTER_DIR; } foreach (array('update', 'download', 'browse') as $log_subdir) { if ($log[$log_subdir]['use']) { $dirs[] = LOG_DIR . $log_subdir . '/'; } } // and more ... $matches = array(); foreach ($dirs as $path) { $dir = opendir($path); if (!$dir) { continue; } // TODO: !== FALSE or die()? while (($file = readdir($dir)) !== FALSE) { if ($file == '.' || $file == '..') { continue; } foreach ($pages as $from => $to) { // TODO: preg_quote()? $pattern = '/^' . str_replace('/', '\\/', $from) . '([._].+)$/'; if (preg_match($pattern, $file, $matches)) { $newfile = $to . $matches[1]; $files[$from][$path . $file] = $path . $newfile; } } } } return $files; }
?> . HTML convert time: <?php echo $taketime; ?> sec.</p> <address> Copyright© 2009 <a href="http://www.kazuwaya.jp">kazuwaya.jp</a> </address> --> <!-- /footer --></div> <p id="goToTop"><a href="#platform"><img src="common/images/img-gototop.gif" width="40" height="24" alt="TOP" /></a></p> <!-- /platform --></div> <div id="platformF"> <div id="floatNewPage"> <?php if (exist_plugin_convert('newpage')) { echo do_plugin_convert('newpage'); } ?> <!-- <?php if (exist_plugin_convert('newpage_subdir')) { echo do_plugin_convert('newpage_subdir'); } ?> --> <!-- /floatNewPage --></div> <!-- /platformF --></div> <script type="text/javascript" src="common/js/import.js"></script> </body> </html>
function plugin_rename_get_files($pages) { $files = array(); $dirs = array(BACKUP_DIR, DIFF_DIR, DATA_DIR); if (exist_plugin_convert('attach')) { $dirs[] = UPLOAD_DIR; } if (exist_plugin_convert('counter')) { $dirs[] = COUNTER_DIR; } if (exist_plugin('qblog')) { $dirs[] = CACHEQBLOG_DIR; } // and more ... $matches = array(); foreach ($dirs as $path) { $dir = opendir($path); if (!$dir) { continue; } while ($file = readdir($dir)) { if ($file == '.' || $file == '..') { continue; } foreach ($pages as $from => $to) { $pattern = '/^' . str_replace('/', '\\/', $from) . '([._].+)$/'; if (!preg_match($pattern, $file, $matches)) { continue; } $newfile = $to . $matches[1]; $files[$from][$path . $file] = $path . $newfile; } } } return $files; }
function protect_body($plugin) { global $auth_api, $protect; $body = ''; if ($plugin === 'login') { $plugin = ''; } $wiki = WikiFactory::Wiki($protect); if ($wiki->isReadable() && empty($plugin)) { $body .= $wiki->render(); } else { $plugin = empty($plugin) ? 'login' : $plugin; if (exist_plugin_convert($plugin)) { $body .= do_plugin_convert($plugin); } } if (empty($body)) { if (PLUGIN_PROTECT_MUST_PAGE) { die('The attestation setting is not done.'); } die; } return $body; }
function &Factory_Div(&$root, $text) { $matches = array(); // Seems block plugin? if (PKWKEXP_DISABLE_MULTILINE_PLUGIN_HACK) { // Usual code if (preg_match('/^\\#([^\\(]+)(?:\\((.*)\\))?/', $text, $matches) && exist_plugin_convert($matches[1])) { $ret =& new Div($matches); return $ret; //return new Div($matches); } } else { // Hack code if (preg_match('/^#([^\\(\\{]+)(?:\\(([^\\r]*)\\))?(\\{*)/', $text, $matches) && exist_plugin_convert($matches[1])) { $len = strlen($matches[3]); $body = array(); if ($len == 0) { $ret =& new Div($matches); // Seems legacy block plugin return $ret; //return new Div($matches); // Seems legacy block plugin } else { if (preg_match('/\\{{' . $len . '}\\s*\\r(.*)\\r\\}{' . $len . '}/', $text, $body)) { $matches[2] .= "\r" . $body[1] . "\r"; $ret =& new Div($matches); return $ret; //return new Div($matches); // Seems multiline-enabled block plugin } } } } $ret =& new Paragraph($text); return $ret; //return new Paragraph($text); }
</div><!-- END id:summary --> <?php if ($wikinote->is_effect()) { echo '</div>'; } ?> <!-- END id:wrap_body --> </div><!-- END id:content --> </div><!-- END id:wrap_content --> </div><!-- END id:main --> <!-- Menubar ========================================================== --> <?php if (exist_plugin_convert('menu') && do_plugin_convert('menu') != '') { ?> <div id="wrap_menubar"><!-- BEGIN id:wrap_menubar --> <div id="menubar"> <?php echo do_plugin_convert('menu'); ?> </div><!-- END id:menubar --> </div><!-- END id:wrap_menubar --> <?php } ?> <!-- Footer ========================================================== --> <div id="wrap_footer"><!-- BEGIN id:wrap_footer --> <div id="footer"><!-- BEGIN id:footer -->
<link rel="stylesheet" type="text/css" media="screen" href="<?php echo SKIN_URI; ?> andreas01/andreas01.css" /> <link rel="stylesheet" type="text/css" media="print" href="<?php echo SKIN_URI; ?> andreas01/andreas01.print.css" /> <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $_LINK['rss']; ?> " /> <script type="text/javascript"> <!-- <?php if (exist_plugin_convert('js_init')) { echo do_plugin_convert('js_init'); } ?> // --> </script> <script type="text/javascript" src="<?php echo SKIN_URI . 'lang/' . $language; ?> .js"></script> <script type="text/javascript" src="<?php echo SKIN_URI; ?> default.js"></script> <script type="text/javascript" src="<?php echo SKIN_URI;
$site_navigator2 = str_replace($ptn, $ptn . ' class="focus"', convert_html($vars['msg'])); if (trim($site_navigator2) !== '') { $site_navigator2 = '<div class="preview_highlight">' . $site_navigator2 . '</div>'; } } else { $site_navigator2 = str_replace($ptn, $ptn . ' class="focus"', do_plugin_convert('nav2')); } $qt->setv('site_navigator2_is_empty', trim($site_navigator2) === ''); if (!$qt->getv('SiteNavigator2InsertMark')) { $site_navigator2 = "\n<!-- SITENAVIGATOR2 CONTENTS START -->\n" . $site_navigator2 . "\n<!-- SITENAVIGATOR2 CONTENTS END -->\n"; $qt->setv('SiteNavigator2InsertMark', true); } $qt->setv('site_navigator2', $site_navigator2); unset($vars['page_alt']); } if (exist_plugin_convert('header')) { $ptn = '"' . $script . '?' . rawurlencode($vars['page']) . '"'; $vars['page_alt'] = 'SiteHeader'; //swfuの制御のため //プレビューならクラスを付ける if ($vars['preview'] && $vars['page'] == 'SiteHeader') { $site_header = convert_html($vars['msg']); if (trim($site_header) !== '') { $site_header = '<div class="preview_highlight">' . $site_header . '</div>'; } } else { $site_header = do_plugin_convert('header'); } $qt->setv('site_header_is_empty', trim($site_header) === ''); if (!$qt->getv('SiteHeaderInsertMark')) { $site_header = "\n<!-- SITEHEADER CONTENTS START -->\n" . $site_header . "\n<!-- SITEHEADER CONTENTS END -->\n";
} else { $_menu = $menu; } echo $_menu; ?> </div> </div> <!-- END #content > #menu --> </div> <!-- END #content --> <!-- START #footer --> <?php if (exist_plugin_convert('footarea') && do_plugin_convert('footarea') != '') { echo '<div id="footer">' . "\n"; echo do_plugin_convert('footarea'); echo '</div>' . "\n"; } else { // or In this skin ?> <div id="footer"> <ul id="signature"> <li class="inquiry"><a href="<?php echo get_script_uri(); ?> ?">サイトについて</a></li> <li class="inquiry"><a href="<?php echo get_script_uri(); ?>
case 'pink-border': case 'rectangle': case 'russet': case 'smoking_black': case 'zef': $sidebar = 'another'; // Show as an another page below break; } // 'none': Show no sidebar } // Check menu (sidebar) is ready and $menubar is there if ($sidebar == 'none') { $menu = FALSE; } else { $menu = arg_check('read') && is_page($GLOBALS['menubar']) && exist_plugin_convert('menu'); if ($menu) { $menu_body = preg_replace('#<h2 ([^>]*)>(.*?)</h2>#', '<h3 $1><span class="sanchor"></span> $2</h3>', do_plugin_convert('menu')); } } // ------------------------------------------------------------ // Code continuing ... $lang =& $_LANG['skin']; $link =& $_LINK; $image =& $_IMAGE['skin']; $rw = !PKWK_READONLY; // Decide charset for CSS $css_charset = 'iso-8859-1'; switch (UI_LANG) { case 'ja': $css_charset = 'Shift_JIS';
} } } } $body = convert_html($source); if ($trackback) { $body .= tb_get_rdf($base); } // Add TrackBack-Ping URI if ($referer) { ref_save($base); } log_write('check', $vars['page']); log_write('browse', $vars['page']); } // global $always_menu_displayed; if (arg_check('read')) { $always_menu_displayed = 1; } $body_menu = $body_side = ''; if ($always_menu_displayed) { if (exist_plugin_convert('menu')) { $body_menu = do_plugin_convert('menu'); } if (exist_plugin_convert('side')) { $body_side = do_plugin_convert('side'); } } // Output catbody($title, $page, $body); exit;
function validate_options() { global $vars; if ($this->options['tag'][1] != '') { if (!exist_plugin($this->conf['plugin_tag'])) { $this->error .= "The option, tag, requires #{$this->conf['plugin_tag']} plugin, but it does not exist. "; return; } $this->options['hierarchy'][1] = false; // best is to turn off the default only so that 'hierarchy' can be configured by option. } else { if ($this->options['prefix'][1] == '') { $this->options['prefix'][1] = $vars['page'] != '' ? $vars['page'] . '/' : ''; } } if ($this->options['prefix'][1] == '/') { $this->options['prefix'][1] = ''; } elseif ($this->options['prefix'][1] != '') { $this->options['prefix'][1] = $this->get_fullname($this->options['prefix'][1], $vars['page']); } $this->options['prefix'][4] = $this->options['prefix'][1]; if ($this->options['sort'][1] == 'date') { $this->options['hierarchy'][1] = false; } // alpha func if ($this->options['popular'][1] != false) { $this->options['sort'][1] = 'popular'; $this->options['hierarchy'][1] = false; // Future Work: info_popular. hmmm } // Another Idea // sort=popular>today,popular>total,popular>yesterday,popular>recent // if (strpos($this->options['sort'][1], 'popular>') !== false) { // list($this->optiions['sort'][1], $this->options['popular'][1]) = explode('>', $this->options['sort'][1]); // $this->options['hierarchy'][1] = false; // } if ($this->options['contents'][1] != '') { if (!exist_plugin_convert($this->conf['plugin_contents'])) { $this->error .= "The option, contents, requires {$this->conf['plugin_contents']} plugin, but it does not exist. "; return; } } if ($this->options['include'][1] != '') { if (!exist_plugin_convert($this->conf['plugin_include'])) { $this->error .= "The option, include, requires {$this->conf['plugin_include']} plugin, but it does not exist. "; return; } $this->options['hierarchy'][1] = false; // hierarchy + include => XHTML invalid $this->options['date'][1] = false; // include does not use definitely $this->options['new'][1] = false; // include does not use definitely $this->options['contents'][1] = ''; // include does not use definitely } if ($this->options['linkstr'][1] === 'title' || $this->options['linkstr'][1] === 'headline') { if (!exist_plugin_convert($this->conf['plugin_contents'])) { $this->error .= "The option, linkstr, requires {$this->conf['plugin_contents']} plugin, but it does not exist. "; return; } } // to support lower versions // basename -> linkstr if ($this->options['basename'][1] === true) { $this->options['linkstr'][1] = 'basename'; } // new,date -> info foreach ($this->options['info'][2] as $key) { if ($this->options[$key][1]) { array_push($this->options['info'][1], $key); } } $this->options['info'][1] = array_unique($this->options['info'][1]); // to save time (to avoid in_array everytime) foreach ($this->options['info'][1] as $key) { $this->options[$key][1] = true; } if ($this->options['new'][1] && !exist_plugin_inline($this->conf['plugin_new'])) { $this->error .= "The option, new, requires {$this->conf['plugin_new']} plugin, but it does not exist. "; return; } }
<?php } else { if ($pkwk_dtd >= PKWK_DTD_HTML_4_01_FRAMESET) { ?> <a href="http://validator.w3.org/check/referer"><img src="image/valid-html40.png" width="88" height="31" alt="Valid HTML 4.0" title="Valid HTML 4.0" /></a> <?php } } } ?> </div></td> </tr> </table> </div> <?php } if ($bodytable_width > 0) { ?> </td> </tr> </table> <?php } if (exist_plugin_convert('tz')) { echo do_plugin_convert('tz'); } echo $foot_tag; ?> </body> </html>
function plugin_print_action() { global $defaultpage, $page_title, $newtitle; global $use_local_time, $language; global $head_tags, $foot_tags, $pkwk_dtd; global $vars; global $fixed_heading_edited, $autoglossary, $_symbol_paraedit, $_symbol_paraguiedit; global $_symbol_noexists; global $foot_explain, $note_hr; if (empty($vars['page']) || !is_page($vars['page'])) { return ''; } $page = $vars['page']; check_readable($page, false); $head = isset($vars['nohead']) ? 0 : 1; $foot = isset($vars['nofoot']) ? 0 : 1; $noa = isset($vars['noa']) ? 1 : 0; $fixed_heading_edited = $autoglossary = 0; $_symbol_paraedit = $_symbol_paraguiedit = ' '; $body = convert_html(get_source($page)); // Yetlist $noexists_pattern = '#<span class="noexists">([^<]*)<a[^>]+>' . preg_quote($_symbol_noexists, '#') . '</a></span>#'; $body = preg_replace($noexists_pattern, '$1', $body); // List of footnotes ksort($foot_explain, SORT_NUMERIC); $notes = !empty($foot_explain) ? $note_hr . join("\n", $foot_explain) : ''; if ($noa) { $body = strip_a($body); $notes = strip_a($notes); } // Tags will be inserted into <head></head> $head_tag = !empty($head_tags) ? join("\n", $head_tags) . "\n" : ''; $foot_tag = !empty($foot_tags) ? join("\n", $foot_tags) . "\n" : ''; $css_charset = 'utf-8'; switch (UI_LANG) { case 'ja_JP': $css_charset = 'Shift_JIS'; break; } // Output header pkwk_common_headers(); header('Cache-Control: no-cache'); header('Pragma: no-cache'); header('Content-Type: text/html; charset=' . CONTENT_CHARSET); header('ETag: ' . md5(MUTIME)); // Output HTML DTD, <html>, and receive content-type $meta_content_type = isset($pkwk_dtd) ? pkwk_output_dtd($pkwk_dtd) : pkwk_output_dtd(); $CONTENT_CHARSET = CONTENT_CHARSET; $SKIN_URI = SKIN_URI; $IMAGE_URI = IMAGE_URI; // Plus! not use $meta_content_type. because meta-content-type is most browser not used. umm... echo <<<EOD <head> <meta http-equiv="content-type" content="application/xhtml+xml; charset={$CONTENT_CHARSET}" /> <meta http-equiv="content-style-type" content="text/css" /> <meta http-equiv="content-script-type" content="text/javascript" /> <meta name="robots" content="NOINDEX,NOFOLLOW" /> EOD; // $newtitle - TITLE: (convert_html) if ($newtitle != '') { $h1 = $newtitle . ' - ' . $page_title; } elseif ($page == $defaultpage) { $h1 = $page_title; } else { $h1 = $page . ' - ' . $page_title; } echo ' <title>' . $h1 . '</title>' . "\n"; echo <<<EOD <link rel="stylesheet" href="{$SKIN_URI}default.css" type="text/css" media="screen" charset="{$css_charset}" /> <link rel="stylesheet" href="{$SKIN_URI}print.css" type="text/css" media="print" charset="{$css_charset}" /> <script type="text/javascript"> <!-- EOD; if (exist_plugin_convert('js_init')) { echo do_plugin_convert('js_init'); } echo <<<EOD // --> </script> <script type="text/javascript" src="{$SKIN_URI}lang/{$language}.js"></script> <script type="text/javascript" src="{$SKIN_URI}default.js"></script> EOD; if (!$use_local_time) { echo <<<EOD <script type="text/javascript" src="{$SKIN_URI}tzCalculation_LocalTimeZone.js"></script> EOD; } echo $head_tag; echo <<<EOD </head> <body> EOD; /* if ($head) { echo <<<EOD <div id="header"> <h1 class="title">$h1</h1> </div> EOD; } */ if ($head) { // Last modification date (string) of the page $lastmodified = get_date('D, d M Y H:i:s T', get_filetime($page)) . ' ' . get_pg_passage($page, FALSE); // <span style="font-size: large;line-height: 1;margin: 0px;padding: 0px;">$h1</span> $PRINT_HEAD_BGCOLOR = PRINT_HEAD_BGCOLOR; $PRINT_HEAD_BORDER = PRINT_HEAD_BORDER; echo <<<EOD <div style="background-color: {$PRINT_HEAD_BGCOLOR};border: 1px {$PRINT_HEAD_BORDER} solid;padding: 6px 8px;margin: 6px 1%;"> \t<h1 class="title">{$h1}</h1> \t<p style="font-size:10px;text-align:right;">Last-Modified: {$lastmodified}</p> </div> EOD; } echo <<<EOD <div id="contents"> <table class="contents" width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="ctable" valign="top"> <div id="body"> EOD; echo $body; echo <<<EOD </div> </td> </tr> </table> </div> EOD; if ($notes) { echo <<<EOD <div id="note"> {$notes} </div> EOD; } if ($foot) { echo print_foot_area(); } if (exist_plugin_convert('tz')) { echo do_plugin_convert('tz'); } echo $foot_tag; echo <<<EOD </body> </html> EOD; die; }
/* enter送信防止 */ $(function(){ $("input[type=text]").keydown(function(ev) { if ((ev.which && ev.which === 13) || (ev.keyCode && ev.keyCode === 13)) { return false; } else { return true; } }); }); </script> <?php if (arg_check('read') && exist_plugin_convert('menu')) { ?> <script src="skin/snsCount.js?150804" id="snsCount" data-url=<?php if ($vars["page"] == "FrontPage") { ?> "http://pad.rtwiki.net/"<?php } else { ?> "<?php echo $script . '?'; echo rawurlencode($_page); ?> "<?php } ?> ></script>
function test_exist_convert() { $this->assertTrue(exist_plugin_convert('xxx')); }