function plugin_gcounter_inline() { if (!exist_plugin_inline('counter')) { return '<span>gcounter(): counter plugin does not exist.</span>'; } if (plugin_gcounter_init_gcounter() === FALSE) { return '<span>gcounter(): failed to create gcounter log file.</span>'; } global $vars; $tmp = $vars['page']; $vars['page'] = PLUGIN_GCOUNTER_PAGE; $args = func_get_args(); $body = array_pop($args); $body = do_plugin_inline('counter', csv_implode(',', $args), $body); $vars['page'] = $tmp; return $body; }
function toString() { $body = $this->body == '' ? '' : make_link($this->body); $str = FALSE; // Try to call the plugin if (exist_plugin_inline($this->name)) { $str = do_plugin_inline($this->name, $this->param, $body); } if ($str !== FALSE) { return $str; // Succeed } else { // No such plugin, or Failed $body = ($body == '' ? '' : '{' . $body . '}') . ';'; return make_line_rules(htmlspecialchars('&' . $this->plain) . $body); } }
function plugin_login_inline() { if (PKWK_READONLY != ROLE_AUTH) { return ''; } $auth_key = auth::get_user_info(); // Offline if (empty($auth_key['key'])) { return plugin_login_auth_guide(); } // Online return exist_plugin($auth_key['api']) ? do_plugin_inline($auth_key['api']) : ''; }
function plugin_commentx_convert() { global $vars, $digest; //, $_btn_comment, $_btn_name, $_msg_comment; static $numbers = array(); static $all_numbers = 0; $_btn_name = _("Name: "); $_btn_comment = _("Post Comment"); $_msg_comment = _("Comment: "); $auth_guide = ''; if (PKWK_READONLY == ROLE_AUTH) { // Plus! if (exist_plugin('login')) { $auth_guide = do_plugin_inline('login'); } } if (is_callable(array('auth', 'check_role'))) { // Plus! if (auth::check_role('readonly')) { return $auth_guide; } } else { if (PKWK_READONLY) { return ''; } } if (!isset($numbers[$vars['page']])) { $numbers[$vars['page']] = 0; } $comment_no = $numbers[$vars['page']]++; $comment_all_no = $all_numbers++; $options = func_num_args() ? func_get_args() : array(); $noname = in_array('noname', $options); $nodate = in_array('nodate', $options) ? '1' : '0'; $above = in_array('above', $options) ? '1' : (in_array('below', $options) ? '0' : PLUGIN_COMMENTX_DIRECTION_DEFAULT); $textarea = in_array('textarea', $options) ? TRUE : (in_array('textfield', $options) ? FALSE : PLUGIN_COMMENTX_TEXTAREA); list($user, $link, $disabled) = plugin_commentx_get_nick(); if ($noname) { $nametags = '<label for="_p_comment_comment_' . $comment_all_no . '">' . $_msg_comment . '</label>'; } else { if ($textarea) { $nametags = '<label for="_p_comment_name_' . $comment_all_no . '">' . $_btn_name . '</label>' . '<input type="text" name="name" id="_p_comment_name_' . $comment_all_no . '" size="' . PLUGIN_COMMENTX_SIZE_TEXTAREA_NAME . '" value="' . $user . '"' . $disabled . ' /><br />' . "\n"; } else { $nametags = '<label for="_p_comment_name_' . $comment_all_no . '">' . $_btn_name . '</label>' . '<input type="text" name="name" id="_p_comment_name_' . $comment_all_no . '" size="' . PLUGIN_COMMENTX_SIZE_NAME . '" value="' . $user . '"' . $disabled . ' />' . "\n"; } } if ($textarea) { $comment_box = '<textarea name="msg" id="_p_comment_comment_{' . $comment_all_no . '}" rows="' . PLUGIN_COMMENTX_SIZE_TEXTAREA_ROWS . '" style="width:' . PLUGIN_COMMENTX_SIZE_TEXTAREA_COLS . ';" /></textarea>'; } else { $comment_box = '<input type="text" name="msg" id="_p_comment_comment_{' . $comment_all_no . '}" style="width:' . PLUGIN_COMMENTX_SIZE_MSG . ';" />'; } if (function_exists('edit_form_assistant')) { // Plus! $helptags = edit_form_assistant(); } $refpage = ''; $script = get_script_uri(); $s_page = htmlspecialchars($vars['page']); $r_page = htmlspecialchars(rawurlencode($vars['page'])); $ticket = md5(MUTIME); if (function_exists('pkwk_session_start') && pkwk_session_start() != 0) { $keyword = $ticket; $_SESSION[$keyword] = md5(get_ticket() . $digest); } $string = <<<EOD <br /> {$auth_guide} <form action="{$script}?{$r_page}" method="post"> <div class="commentform" onmouseup="pukiwiki_pos()" onkeyup="pukiwiki_pos()"> <input type="hidden" name="refpage" value="{$refpage}" /> <input type="hidden" name="plugin" value="commentx" /> <input type="hidden" name="refer" value="{$s_page}" /> <input type="hidden" name="comment_no" value="{$comment_no}" /> <input type="hidden" name="nodate" value="{$nodate}" /> <input type="hidden" name="above" value="{$above}" /> <input type="hidden" name="digest" value="{$digest}" /> <input type="hidden" name="ticket" value="{$ticket}" /> {$nametags} {$comment_box} <input type="submit" name="comment" value="{$_btn_comment}" /> {$helptags} </div> </form> EOD; return $string; }
<?php if ($wikinote->is_effect()) { echo '<div id="wrap_body">'; } ?> <!-- BEGIN id:wrap_body --> <div id="body"><!-- BEGIN id:body --> <h1 class="title"><?php echo $heading_title; ?> </h1> <div id="subtitle"> <?php if ($is_read && exist_plugin_inline('topicpath')) { echo '<div class="topicpath">' . do_plugin_inline('topicpath') . '</div>'; } ?> </div> <?php echo $body; ?> </div><!-- END id:body --> <div id="summary"><!-- BEGIN id:summary --> <?php if ($notes != '') { ?> <!-- BEGIN id:note --> <div id="note"> <?php
unset($_vars[$key]); } } else { $_vars =& $vars; } pkwk_spamfilter($method . ' to #' . $_plugin, $_page, $_vars, $_method, $exitmode); } } // If page output, enable session. // NOTE: if action plugin(command) use session, call pkwk_session_start() // in plugin action-API function. pkwk_session_start(); // auth remoteip if (isset($auth_api['remoteip']['use']) && $auth_api['remoteip']['use']) { if (exist_plugin_inline('remoteip')) { do_plugin_inline('remoteip'); } } $is_protect = auth::is_protect(); // Plugin execution if ($plugin != '') { if ($is_protect) { $plugin_arg = ''; if (auth::is_protect_plugin_action($plugin)) { if (exist_plugin_action($plugin)) { do_plugin_action($plugin); } // Location で飛ばないプラグインの場合 $plugin_arg = $plugin; } if (exist_plugin_convert('protect')) {
function export_d($page, $table_num, $file) { $download = T_('download'); $back = T_('back'); $ref = exist_plugin_inline('ref') ? do_plugin_inline('ref', $page . '/' . $file) : T_('ref plugin is not found'); $body = <<<EOD <h3>{$page} table number {$table_num}</h3> <fieldset> <legend>{$download}</legend> {$ref} <form enctype="multipart/form-data" action="{$this->script_uri}" method="post"> \t<input type="hidden" name="cmd" value="table_edit2" /> \t<input type="hidden" name="refer" value="{$page}" /> \t<input type="hidden" name="table_num" value="{$table_num}" /> \t<input type="hidden" name="file_name" value="{$file}" /> \t<button type="submit" class="btn btn-primary" name="csv_back"><span class="fa fa-download"></span>{$down}</button> </form> </fieldset> EOD; return array('msg' => T_('export'), 'body' => $body); }
function info_new_metapages() { if (!$this->options['new'][1]) { return; } foreach ($this->metapages as $i => $metapage) { $date = $this->metapages[$i]['date']; // burdonsome, but to use configuration of new plugin $new = do_plugin_inline($this->conf['plugin_new'], 'nodate', $date); $this->metapages[$i]['info_new'] = $new; } }
function plugin_comment_convert() { global $vars, $digest, $_comment_messages; //, $_btn_comment, $_btn_name, $_msg_comment; static $numbers = array(); static $all_numbers = 0; static $comment_cols = PLUGIN_COMMENT_SIZE_MSG; if (!isset($vars['page'])) { return ''; } $ret = array(); if (PKWK_READONLY === Auth::ROLE_AUTH) { exist_plugin('login'); $ret[] = do_plugin_inline('login'); $ret[] = '<br />'; } if (Auth::check_role('readonly')) { return $auth_guide; } if (!isset($numbers[$vars['page']])) { $numbers[$vars['page']] = 0; } $options = func_num_args() ? func_get_args() : array(); list($user, $link, $disabled) = plugin_comment_get_nick(); // $refpage = ''; $ret[] = '<form action="' . get_script_uri() . '" method="post" class="plugin-comment-form row">'; $ret[] = '<input type="hidden" name="cmd" value="comment" />'; $ret[] = '<input type="hidden" name="refer" value="' . Utility::htmlsc($vars['page']) . '" />'; // $ret[] = '<input type="hidden" name="refpage" value="' . $refpage . '" />'; $ret[] = '<input type="hidden" name="comment_no" value="' . $numbers[$vars['page']]++ . '" />'; $ret[] = '<input type="hidden" name="nodate" value="' . (in_array('nodate', $options) ? '1' : '0') . '" />'; $ret[] = '<input type="hidden" name="above" value="' . (in_array('above', $options) ? '1' : (in_array('below', $options) ? '0' : PLUGIN_COMMENT_DIRECTION_DEFAULT)) . '" />'; $comment_all_no = $all_numbers++; if (!in_array('noname', $options)) { $ret[] = '<div class="col-md-3">'; $ret[] = '<input type="text" class="form-control" name="name" id="p_comment_name_' . $comment_all_no . '" size="' . PLUGIN_COMMENT_SIZE_NAME . '" value="' . $user . '"' . $disabled . ' placeholder="' . $_comment_messages['label_name'] . '" />'; $ret[] = '</div>'; $ret[] = '<div class="col-md-9">'; } else { $ret[] = '<div class="col-md-12">'; } $ret[] = '<div class="input-group">'; $ret[] = '<textarea name="msg" class="form-control" id="p_comment_comment_' . $comment_all_no . '" rows="1" placeholder="' . $_comment_messages['label_comment'] . '"></textarea>'; $ret[] = '<span class="input-group-btn">'; $ret[] = '<button type="submit" class="btn btn-primary" /><span class="fa fa-comment-o"></span>' . $_comment_messages['label_post'] . '</button>'; $ret[] = '</span>'; $ret[] = '</div>'; $ret[] = '</div>'; $ret[] = '</form>'; $string = join("\n", $ret); return IS_MOBILE ? '<div data-role="collapsible" data-collapsed="true" data-theme="b" data-content-theme="d"><h4>' . $_comment_messages['label_comment'] . '</h4>' . $string . '</div>' : $string; }
} // paraedit.inc.php if ($enable_paraedit === TRUE && exist_plugin('paraedit')) { $body = _plugin_paraedit_mkeditlink($body); } // relink.inc.php if ($enable_relink === TRUE && exist_plugin('relink')) { $body = plugin_relink($body); $menu = plugin_relink($menu); $side = plugin_relink($side); $navigation_tab = plugin_relink($navigation_tab); } // Footer $lastmodified = empty($lastmodified) ? '' : '<li id="lastmod">Last-modified: ' . $lastmodified . '</li>'; $siteadmin = !empty($modifierlink) && !empty($modifier) ? '<li>Site admin: <a href="' . $modifierlink . '">' . $modifier . '</a></li>' : ''; $footer_counter = $enable_footer_counter && exist_plugin('counter') && do_plugin_inline('counter') ? '<li>This page has been accessed ' . number_format(do_plugin_inline('counter')) . ' times.</li>' : ''; // ------------------------------------------------------------ // Output // HTTP headers pkwk_common_headers(); header('Cache-control: no-cache'); header('Pragma: no-cache'); header('Content-Type: text/html; charset=' . CONTENT_CHARSET); // HTML DTD if (isset($pkwk_dtd)) { $meta_content_type = pkwk_output_dtd($pkwk_dtd); } else { $meta_content_type = pkwk_output_dtd(); } ?>
function plugin_pcomment_convert() { global $vars, $script; // global $_pcmt_messages; $_pcmt_messages = array('btn_name' => _('Name: '), 'btn_comment' => _('Post Comment'), 'msg_comment' => _('Comment: '), 'msg_recent' => _('Show recent %d comments.'), 'msg_all' => _('Go to the comment page.'), 'msg_none' => _('No comment.'), 'err_pagename' => _('[[%s]] : not a valid page name.')); $params = array('noname' => FALSE, 'nodate' => FALSE, 'below' => FALSE, 'above' => FALSE, 'reply' => FALSE, '_args' => array()); foreach (func_get_args() as $arg) { check_plugin_option($arg, $params); } $vars_page = isset($vars['page']) ? $vars['page'] : ''; $page = isset($params['_args'][0]) && $params['_args'][0] != '' ? $params['_args'][0] : sprintf(PLUGIN_PCOMMENT_PAGE, strip_bracket($vars_page)); $count = isset($params['_args'][1]) ? intval($params['_args'][1]) : 0; if ($count == 0) { $count = PLUGIN_PCOMMENT_NUM_COMMENTS; } $_page = get_fullname(strip_bracket($page), $vars_page); if (!is_pagename($_page)) { return sprintf($_pcmt_messages['err_pagename'], htmlspecialchars($_page)); } $dir = PLUGIN_PCOMMENT_DIRECTION_DEFAULT; if ($params['below']) { $dir = 0; } elseif ($params['above']) { $dir = 1; } list($comments, $digest) = plugin_pcomment_get_comments($_page, $count, $dir, $params['reply']); $auth_guide = ''; if (PKWK_READONLY == ROLE_AUTH) { exist_plugin('login'); $auth_guide = do_plugin_inline('login'); } // if (PKWK_READONLY) { if (auth::check_role('readonly')) { $form_start = $form = $form_end = ''; } else { // Show a form if ($params['noname']) { $title = $_pcmt_messages['msg_comment']; $name = ''; } else { $title = $_pcmt_messages['btn_name']; // $name = '<input type="text" name="name" size="' . PLUGIN_PCOMMENT_SIZE_NAME . '" />'; list($nick, $link, $disabled) = plugin_pcomment_get_nick(); $name = '<input type="text" name="name" value="' . $nick . '" ' . $disabled . ' size="' . PLUGIN_PCOMMENT_SIZE_NAME . '" />'; } $radio = $params['reply'] ? '<input type="radio" name="reply" value="0" tabindex="0" checked="checked" />' : ''; $comment = '<input type="text" name="msg" size="' . PLUGIN_PCOMMENT_SIZE_MSG . '" />'; $s_page = htmlspecialchars($page); $s_refer = htmlspecialchars($vars_page); $s_nodate = htmlspecialchars($params['nodate']); $helptags = edit_form_assistant(); $form_start = '<form action="' . $script . '" method="post">' . "\n"; $form = <<<EOD <div class="pcommentform" onmouseup="pukiwiki_pos()" onkeyup="pukiwiki_pos()"> <input type="hidden" name="digest" value="{$digest}" /> <input type="hidden" name="plugin" value="pcomment" /> <input type="hidden" name="refer" value="{$s_refer}" /> <input type="hidden" name="page" value="{$s_page}" /> <input type="hidden" name="nodate" value="{$s_nodate}" /> <input type="hidden" name="dir" value="{$dir}" /> <input type="hidden" name="count" value="{$count}" /> {$radio} {$title} {$name} {$comment} <input type="submit" value="{$_pcmt_messages['btn_comment']}" /> {$helptags} </div> EOD; $form_end = '</form>' . "\n"; } if (!is_page($_page)) { $link = make_pagelink($_page); $recent = $_pcmt_messages['msg_none']; } else { $msg = $_pcmt_messages['msg_all'] != '' ? $_pcmt_messages['msg_all'] : $_page; $link = make_pagelink($_page, $msg); $recent = !empty($count) ? sprintf($_pcmt_messages['msg_recent'], $count) : ''; } if ($dir) { return '<div>' . $auth_guide . '<p>' . $recent . ' ' . $link . '</p>' . "\n" . $form_start . $comments . "\n" . $form . $form_end . '</div>' . "\n"; } else { return '<div>' . $form_start . $form . $comments . "\n" . $form_end . '<p>' . $recent . ' ' . $link . '</p>' . "\n" . $auth_guide . '</div>' . "\n"; } }
function plugin_pcomment_convert() { global $vars; // global $_pcmt_messages; $_pcmt_messages = array('msg_name' => T_('Name: '), 'btn_comment' => T_('Post Comment'), 'msg_comment' => T_('Comment: '), 'msg_recent' => T_('Show recent %d comments.'), 'msg_all' => T_('Go to the comment page.'), 'msg_none' => T_('No comment.'), 'err_pagename' => T_('[[%s]] : not a valid page name.')); $params = array('noname' => FALSE, 'nodate' => FALSE, 'below' => FALSE, 'above' => FALSE, 'reply' => FALSE, '_args' => array()); $params = PluginRenderer::getPluginOption(func_get_args(), $params); // var_dump($params); $vars_page = isset($vars['page']) ? $vars['page'] : ''; $page = isset($params['_args'][1]) && !empty($params['_args'][1]) ? $params['_args'][0] : Utility::stripBracket(sprintf(PLUGIN_PCOMMENT_PAGE, $vars_page)); $count = isset($params['_args'][0]) ? intval($params['_args'][0]) : 0; if ($count == 0) { $count = PLUGIN_PCOMMENT_NUM_COMMENTS; } $_page = get_fullname(strip_bracket($page), $vars_page); $wiki = Factory::Wiki($_page); if (!$wiki->isValied()) { return sprintf($_pcmt_messages['err_pagename'], Utility::htmlsc($_page)); } $dir = PLUGIN_COMMENT_DIRECTION_DEFAULT; if ($params['below']) { $dir = 0; } elseif ($params['above']) { $dir = 1; } list($comments, $digest) = plugin_pcomment_get_comments($_page, $count, $dir, $params['reply']); $form = array(); // if (PKWK_READONLY) { if (!Auth::check_role('readonly') && isset($vars['page'])) { // Show a form $form[] = '<input type="hidden" name="cmd" value="pcomment" />'; $form[] = '<input type="hidden" name="digest" value="' . $digest . '" />'; $form[] = '<input type="hidden" name="refer" value="' . Utility::htmlsc($vars_page) . '" />'; $form[] = '<input type="hidden" name="page" value="' . Utility::htmlsc($page) . '" />'; $form[] = '<input type="hidden" name="nodate" value="' . Utility::htmlsc($params['nodate']) . '" />'; $form[] = '<input type="hidden" name="dir" value="' . $dir . '" />'; $form[] = '<input type="hidden" name="count" value="' . $count . '" />'; $form[] = '<div class="row">'; if ($params['noname'] === false) { $form[] = '<div class="col-md-3">'; list($nick, $link, $disabled) = plugin_pcomment_get_nick(); if ($params['reply']) { $form[] = '<div class="input-group">'; $form[] = '<span class="input-group-addon">'; $form[] = '<input type="radio" name="reply" value="0" tabindex="0" checked="checked" />'; $form[] = '</span>'; } $form[] = '<input type="text" name="name" value="' . $nick . '" ' . $disabled . ' class="form-control" size="' . PLUGIN_COMMENT_SIZE_NAME . '" placeholder="' . $_pcmt_messages['msg_name'] . '" />'; if ($params['reply']) { $form[] = '</div>'; } $form[] = '</div>'; $form[] = '<div class="col-md-9">'; $form[] = '<div class="input-group">'; } else { $form[] = '<div class="col-md-12">'; $form[] = '<div class="input-group">'; if ($params['reply']) { $form[] = '<span class="input-group-addon">'; $form[] = '<input type="radio" name="reply" value="0" tabindex="0" checked="checked" />'; $form[] = '</span>'; } } $form[] = '<textarea name="msg" cols="' . PLUGIN_COMMENT_SIZE_MSG . '" rows="1" class="form-control" placeholder="' . $_pcmt_messages['msg_comment'] . '"></textarea>'; $form[] = '<span class="input-group-btn">'; $form[] = '<button type="submit" class="btn btn-info">' . $_pcmt_messages['btn_comment'] . '</button>'; $form[] = '</span>'; $form[] = '</div>'; $form[] = '</div>'; $form[] = '</div>'; } if (PKWK_READONLY == Auth::ROLE_AUTH) { exist_plugin('login'); $form[] = do_plugin_inline('login'); } if (!$wiki->has()) { $link = make_pagelink($_page); $recent = $_pcmt_messages['msg_none']; } else { $msg = !empty($_pcmt_messages['msg_all']) ? $_pcmt_messages['msg_all'] : $_page; $link = make_pagelink($_page, $msg); $recent = !empty($count) ? sprintf($_pcmt_messages['msg_recent'], $count) : ''; } $string = !Auth::check_role('readonly') ? '<form action="' . get_script_uri() . '" method="post" class="plugin-pcomment-form form-inline" data-collision-check="false">' : ''; $string .= $dir ? '<p>' . $recent . ' ' . $link . '</p>' . "\n" . $comments . "\n" . join("\n", $form) : join("\n", $form) . "\n" . '<p>' . $recent . ' ' . $link . '</p>' . "\n" . $comments . "\n"; $string .= !Auth::check_role('readonly') ? '</form>' : ''; return IS_MOBILE ? '<div data-role="collapsible" data-theme="b" data-content-theme="d"><h4>' . $_pcmt_messages['msg_comment'] . '</h4>' . $string . '</div>' : '<div class="pcomment">' . $string . '</div>'; }
/** * Get New! of a page * * @access public * @static * @param int $timestamp * @return string */ function newdate($timestamp) { // ToDo: Implementing by myself to get more flexibility $date = PluginSonotsMetapage::date($timestamp); return do_plugin_inline('new', 'nodate', $date); }
function weblog_viewer_show_headings($page, &$params, $prefix = "", $child_count = "") { global $script, $auto_template_name; global $_weblog_list_anchor, $_weblog_msgs; static $_auto_template_name = ""; if (!$_auto_template_name) { $_auto_template_name = preg_quote($auto_template_name, '/'); } // テンプレートページは表示しない場合 if (preg_match("/\\/" . $_auto_template_name . "(_m)?\$/", $page)) { return; } $ret = ''; $rules = '/\\(\\(((?:(?!\\)\\)).)*)\\)\\)/'; $is_done = (isset($params[$page]) and $params[$page] > 0); //ページが表示済みのときTrue if (!$is_done) { $params[$page] = ++$_weblog_list_anchor; } $name = strip_bracket($page); $title = $name . ' ' . get_pg_passage($page, FALSE); if ($params['weblog']) { if (!ereg("(.*/)?([0-9]{4})-([0-9]{2})-([0-9]{2})-([0-9]{6}).*\$", $name, $m)) { return; } if (!checkdate($m[3], $m[4], $m[2])) { return; } } if ($use_static_url = 1) { $pgid = get_pgid_by_name($page); $href = XOOPS_WIKI_URL . "/{$pgid}.html"; } else { $href = $script . '?' . rawurlencode($name); } //ページ名が「数字と-」だけの場合は、*(**)行を取得してみる $_name = ""; if (preg_match("/^(.*\\/)?[0-9\\-]+\$/", $name)) { $_name = get_heading($page); } //基準ページ名は省く nao-pon if ($name != $prefix) { $name = str_replace($prefix, "", $name); $_is_base = false; } else { $_is_base = true; } //階層でマージン設定 $name = str_replace("/", "\t", $name); //マルチバイトを考慮してTABに変換 $c_count = count_chars($name); if ($_is_base) { $c_margin = 0; //基準ページ } else { $c_margin = $c_count[9] * 15; //TABのコード=9 } //[/(\tに変換済)]以前をカット $name = preg_replace("/.*\t/", "", $name); $ret .= '<li style="margin-left:' . $c_margin . 'px;">'; if ($params['weblog']) { $_page = preg_replace("/(.*\\/)?([0-9\\-]+)\$/", "\\2", $page); $t_year = substr($_page, 0, 4); $t_month = substr($_page, 5, 2); $t_day = substr($_page, 8, 2); $t_hour = substr($_page, 11, 2); $t_min = substr($_page, 13, 2); $t_sec = substr($_page, 15, 2); $timestamp = mktime($t_hour, $t_min, $t_sec, $t_month, $t_day, $t_year); // $info = get_pg_info_db($page); // $timestamp = $info['buildtime']; $make_date[1] = date("Y", $timestamp); $make_date[2] = date("m", $timestamp); $make_date[3] = date("d", $timestamp); $make_date[4] = date("H:i", $timestamp); if ($params['weblog'] === "time") { $page_attr = $make_date[4]; } else { $page_attr = $make_date[2] . "/" . $make_date[3] . " " . $make_date[4]; } $ret .= $page_attr . " - "; } if ($_name) { $name = $_name; } if ($params['relatedcount']) { $name .= " (" . links_get_related_count($page) . ")"; } if ($child_count != "") { $name .= " ({$child_count})"; } //Newマーク付加 if (!$params['nonew'] && exist_plugin_inline("new")) { $new_mark = do_plugin_inline("new", "{$page}/,nolink", ""); } $ret .= '<a id="list_' . $params[$page] . '" href="' . $href . '" title="' . $title . '">' . $name . '</a>' . $new_mark; $anchor = WEBLOG_LIST_ANCHOR_ORIGIN; $_ret = ''; if ($_ret != '') { $ret .= "<ul>{$_ret}</ul>\n"; } $ret .= '</li>' . "\n"; return $ret; }
function plugin_comment_convert() { global $vars, $digest, $script; //, $_btn_comment, $_btn_name, $_msg_comment; static $numbers = array(); static $all_numbers = 0; static $comment_cols = PLUGIN_COMMENT_SIZE_MSG; $_btn_name = _("Name: "); $_btn_comment = _("Post Comment"); $_msg_comment = _("Comment: "); $auth_guide = ''; if (PKWK_READONLY == ROLE_AUTH) { exist_plugin('login'); $auth_guide = do_plugin_inline('login'); } // if (PKWK_READONLY) return ''; // Show nothing if (auth::check_role('readonly')) { return $auth_guide; } if (!isset($numbers[$vars['page']])) { $numbers[$vars['page']] = 0; } $comment_no = $numbers[$vars['page']]++; $comment_all_no = $all_numbers++; $options = func_num_args() ? func_get_args() : array(); list($user, $link, $disabled) = plugin_comment_get_nick(); if (in_array('noname', $options)) { $nametags = '<label for="_p_comment_comment_' . $comment_all_no . '">' . $_msg_comment . '</label>'; } else { $nametags = '<label for="_p_comment_name_' . $comment_all_no . '">' . $_btn_name . '</label>' . '<input type="text" name="name" id="_p_comment_name_' . $comment_all_no . '" size="' . PLUGIN_COMMENT_SIZE_NAME . '" value="' . htmlspecialchars($user) . '"' . $disabled . ' />' . "\n"; } $helptags = edit_form_assistant(); $nodate = in_array('nodate', $options) ? '1' : '0'; $above = in_array('above', $options) ? '1' : (in_array('below', $options) ? '0' : PLUGIN_COMMENT_DIRECTION_DEFAULT); $refpage = ''; $s_page = htmlspecialchars($vars['page']); $ticket = md5(MUTIME); if (function_exists('pkwk_session_start') && pkwk_session_start() != 0) { $keyword = $ticket; $_SESSION[$keyword] = md5(get_ticket() . $digest); } $string = <<<EOD <br /> {$auth_guide} <form action="{$script}" method="post"> <div class="commentform" onmouseup="pukiwiki_pos()" onkeyup="pukiwiki_pos()"> <input type="hidden" name="refpage" value="{$refpage}" /> <input type="hidden" name="plugin" value="comment" /> <input type="hidden" name="refer" value="{$s_page}" /> <input type="hidden" name="comment_no" value="{$comment_no}" /> <input type="hidden" name="nodate" value="{$nodate}" /> <input type="hidden" name="above" value="{$above}" /> <input type="hidden" name="digest" value="{$digest}" /> <input type="hidden" name="ticket" value="{$ticket}" /> {$nametags} <input type="text" name="msg" id="_p_comment_comment_{$comment_all_no}" size="{$comment_cols}" /> <input type="submit" name="comment" value="{$_btn_comment}" /> {$helptags} </div> </form> EOD; return $string; }
function toString() { $body = ($this->body == '') ? '' : make_link($this->body); // プラグイン呼び出し if (exist_plugin_inline($this->name)) { $str = do_plugin_inline($this->name,$this->param,$body); if ($str !== FALSE) //成功 { return $str; } } // プラグインが存在しないか、変換に失敗 return make_line_rules(htmlspecialchars('&'.$this->plain).($body == '' ? ';' : "\{$body};")); }