/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: convert_html.php,v 1.36 2003/05/12 10:28:48 arino Exp $
+// $Id: convert_html.php,v 1.37 2003/05/14 10:13:29 arino Exp $
//
function convert_html($lines)
{
$this->setParent($parent);
}
else {
- $this->text = trim((substr($text,0,1) == "\n") ? $text : inline2($text));
+ $this->text = trim((substr($text,0,1) == "\n") ? $text : make_link($text));
}
}
function &add(&$obj)
}
parent::ListContainer('dl','dd',$level,$out[1]);
if ($out[0] != '') {
- array_unshift($this->elements,new Inline("\n<dt>".inline2($out[0])."</dt>\n"));
+ array_unshift($this->elements,new Inline("\n<dt>".make_link($out[0])."</dt>\n"));
}
}
}
$colspan[$i]++;
}
$colspan[$i] = ($colspan[$i] > 1) ? " colspan=\"{$colspan[$i]}\"" : '';
- $str .= "<td class=\"style_td\"{$align[$i]}{$colspan[$i]}>".inline2($value[$i]).'</td>';
+ $str .= "<td class=\"style_td\"{$align[$i]}{$colspan[$i]}>".make_link($value[$i]).'</td>';
}
}
$this->elements[] = $str;
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: html.php,v 1.73 2003/05/12 10:29:48 arino Exp $
+// $Id: html.php,v 1.74 2003/05/14 10:13:29 arino Exp $
//
// ËÜʸ¤ò½ÐÎÏ
return $line;
}
-// ¥¤¥ó¥é¥¤¥óÍ×ÁǤΥѡ¼¥¹ (¥ê¥ó¥¯¡¢¸«½Ð¤·°ìÍ÷)
+// ¥¤¥ó¥é¥¤¥óÍ×ÁǤΥѡ¼¥¹ (¥ê¥ó¥¯¡¢¸«½Ð¤·°ìÍ÷) (obsolete)
function inline2($str)
{
- return make_line_rules(make_link($str));
+ return make_link($str);
}
// ÊÔ½¸¥Õ¥©¡¼¥à¤Îɽ¼¨
{
global $NotePattern;
- return strip_htmltag(inline2(preg_replace($NotePattern,'',$str)));
+ // ¸«½Ð¤·¤Î¸ÇÍIDÉô¤òºï½ü
+ $str = preg_replace('/^(\*{1,3}.*)\[#[A-Za-z][\w-]+\](.*)$/m','$1$2',$str);
+
+ return strip_htmltag(make_link(preg_replace($NotePattern,'',$str)));
}
?>
/////////////////////////////////////////////////
// PukiWiki - Yet another WikiWikiWeb clone.
//
-// $Id: make_link.php,v 1.37 2003/05/13 07:56:12 arino Exp $
+// $Id: make_link.php,v 1.38 2003/05/14 10:13:30 arino Exp $
//
// ¥ê¥ó¥¯¤òÉղ乤ë
'autolink', // AutoLink
'bracketname', // BracketName
'wikiname', // WikiName
+// 'rules', // ¥æ¡¼¥¶ÄêµÁ¥ë¡¼¥ë
);
}
if ($excludes !== NULL)
}
$this->converters = array();
$patterns = array();
- $start = 3; // $this->pattern¤Î¥µ¥Ö¥Ñ¥¿¡¼¥ó2¸Ä¤ò´Þ¤à
+ $start = 1;
foreach ($converters as $name)
{
$start += $converter->get_count();
$start++;
}
- $this->pattern = '(.*?)('.join('|',$patterns).')'; // $start += 2
+ $this->pattern = join('|',$patterns);
}
function convert($string,$page)
{
$this->page = $page;
- $this->result = '';
+ $this->result = array();
$string = preg_replace_callback("/{$this->pattern}/x",array(&$this,'replace'),$string);
- return $this->result.htmlspecialchars($string);
+ $arr = explode("\x08",make_line_rules(htmlspecialchars($string)));
+ $retval = '';
+ while (count($arr))
+ {
+ $retval .= array_shift($arr).array_shift($this->result);
+ }
+ return $retval;
}
function replace($arr)
{
$obj = $this->get_converter($arr);
- $this->result .= ($obj !== NULL and $obj->set($arr,$this->page) !== FALSE) ?
- htmlspecialchars($arr[1]).$obj->toString() : htmlspecialchars($arr[0]);
+ $this->result[] = ($obj !== NULL and $obj->set($arr,$this->page) !== FALSE) ?
+ $obj->toString() : make_line_rules(htmlspecialchars($arr[0]));
- return ''; //½èÍýºÑ¤ß¤ÎÉôʬ¤òʸ»úÎ󤫤éºï½ü¤¹¤ë
+ return "\x08"; //½èÍýºÑ¤ß¤ÎÉôʬ¤Ë¥Þ¡¼¥¯¤òÆþ¤ì¤ë
}
function get_objects($string,$page)
{
$arr = $this->splice($arr);
$id = ++$note_id;
- $note = make_line_rules(make_link($arr[1]));
+ $note = make_link($arr[1]);
$foot_explain[$id] = <<<EOD
<a id="notefoot_$id" href="#notetext_$id" class="note_super">*$id</a>
);
}
}
+// ¥æ¡¼¥¶ÄêµÁ¥ë¡¼¥ë
+/*
+class Link_rules extends Link
+{
+ var $replaces;
+ var $count;
+
+ function Link_rules($start)
+ {
+ parent::Link($start);
+ }
+ function get_pattern()
+ {
+ global $line_rules;
+
+ $rules = array();
+ $this->replaces = array();
+ $this->count = 0;
+
+ foreach ($line_rules as $pattern=>$replace)
+ {
+ $rules[] = "($pattern)";
+ $this->replaces[++$this->count] = $replace;
+ if (preg_match_all('/\$\d/',$replace,$matches,PREG_SET_ORDER))
+ {
+ $this->count += count($matches);
+ }
+ }
+ $this->replaces[++$this->count] = ''; // sentinel
+ return join("|",$rules);
+ }
+ function get_count()
+ {
+ return $this->count;
+ }
+ function set($arr,$page)
+ {
+ $arr = $this->splice($arr);
+
+ $name = $arr[0];
+ reset($this->replaces);
+ while (list($start,$replace) = each($this->replaces))
+ {
+ if ($replace == '')
+ {
+ $name = htmlspecialchars($name);
+ break;
+ }
+ if (!array_key_exists($start,$arr) or $arr[$start] == '')
+ {
+ continue;
+ }
+ list($end,$dummy) = each($this->replaces);
+ $count = $end - $start;
+ $_arr = array_splice($arr,$start,$count);
+ $name = $replace;
+ for ($n = 1; $n < $count; $n++)
+ {
+ $name = str_replace('$'.$n,make_link($_arr[$n]),$name);
+ }
+ break;
+ }
+ return parent::setParam($page,$name,'rule','');
+ }
+ function toString()
+ {
+ return $this->name;
+ }
+}
+*/
// ¥Ú¡¼¥¸Ì¾¤Î¥ê¥ó¥¯¤òºîÀ®
function make_pagelink($page,$alias='',$anchor='',$refer='')
{
* Êѹ¹ÍúÎò:
* 2002.06.17: ºî¤ê»Ï¤á
*
- * $Id: bugtrack.inc.php,v 1.12 2003/03/28 15:34:29 panda Exp $
+ * $Id: bugtrack.inc.php,v 1.13 2003/05/14 10:13:31 arino Exp $
*/
function plugin_bugtrack_init()
}
}
- global $_bugtrack_plugin_summary;
if (preg_match("/\*([^\n]+)/",$body,$matches)) {
- $summary = htmlspecialchars($matches[1]);
+ $summary = make_heading($matches[1]);
}
return array($page, $no, $summary, $name, $priority, $state, $category);
foreach ($data as $line) {
list($page, $no, $summary, $name, $priority, $state, $category) = $line;
- $page_link = make_link("[[$page]]");
+ $page_link = make_pagelink($page);
$state_no = array_search($state,$_bugtrack_plugin_state_sort);
if ($state_no === NULL or $state_no === FALSE) {
$state_no = count($_bugtrack_plugin_state_list);
<?php
-// $Id: calendar2.inc.php,v 1.17 2003/03/03 07:30:42 panda Exp $
+// $Id: calendar2.inc.php,v 1.18 2003/05/14 10:13:30 arino Exp $
// *°ú¿ô¤Ëoff¤È½ñ¤¯¤³¤È¤Çº£Æü¤ÎÆüµ¤òɽ¼¨¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
function plugin_calendar2_convert()
{
$get['page'] = $post['page'] = $vars['page'] = $_page;
}
else {
- $str = sprintf($_calendar2_plugin_empty,make_link(sprintf('[[%s%4d-%02d-%02d]]',$prefix, $today['year'], $today['mon'], $today['mday'])));
+ $str = sprintf($_calendar2_plugin_empty,make_pagelink(sprintf('%s%4d-%02d-%02d',$prefix, $today['year'], $today['mon'], $today['mday'])));
}
$ret .= " </td>\n <td valign=\"top\">$str</td>\n </tr>\n</table>\n";
}
<?php
-// $Id: comment.inc.php,v 1.16 2003/04/13 06:28:52 arino Exp $
+// $Id: comment.inc.php,v 1.17 2003/05/14 10:13:30 arino Exp $
/////////////////////////////////////////////////
// ¥³¥á¥ó¥È¤Î̾Á°¥Æ¥¥¹¥È¥¨¥ê¥¢¤Î¥«¥é¥à¿ô
$body = '';
if (md5(@join('',get_source($post['refer']))) != $post['digest']) {
$title = $_title_comment_collided;
- $body = $_msg_comment_collided . make_link($post['refer']);
+ $body = $_msg_comment_collided . make_pagelink($post['refer']);
}
page_write($post['refer'],$postdata);
<?php
-// $Id: vote.inc.php,v 1.12 2003/04/13 06:28:52 arino Exp $
+/////////////////////////////////////////////////
+// PukiWiki - Yet another WikiWikiWeb clone.
+//
+// $Id: vote.inc.php,v 1.13 2003/05/14 10:13:31 arino Exp $
+//
function plugin_vote_init()
{
if (LANG == 'ja')
+ {
$messages = array(
'_vote_plugin_choice' => 'ÁªÂò»è',
'_vote_plugin_votes' => 'Åêɼ',
);
+ }
else
+ {
$messages = array(
'_vote_plugin_choice' => 'Selection',
'_vote_plugin_votes' => 'Vote',
);
+ }
set_plugin_messages($messages);
}
$vote_no = 0;
$title = $body = $postdata = '';
- foreach($postdata_old as $line) {
- if (!preg_match("/^#vote\((.*)\)\s*$/",$line,$arg)) {
+ foreach($postdata_old as $line)
+ {
+ if (!preg_match("/^#vote\((.*)\)\s*$/",$line,$arg))
+ {
$postdata .= $line;
continue;
}
- if ($vote_no++ != $post['vote_no']) {
+ if ($vote_no++ != $post['vote_no'])
+ {
$postdata .= $line;
continue;
}
$args = explode(',',$arg[1]);
- foreach($args as $arg) {
+ foreach($args as $arg)
+ {
$cnt = 0;
- if (preg_match("/^(.+)\[(\d+)\]$/",$arg,$match)) {
+ if (preg_match("/^(.+)\[(\d+)\]$/",$arg,$match))
+ {
$arg = $match[1];
$cnt = $match[2];
}
$e_arg = encode($arg);
- if (!empty($post["vote_$e_arg"]) and $post["vote_$e_arg"] == $_vote_plugin_votes) {
+ if (!empty($post["vote_$e_arg"]) and $post["vote_$e_arg"] == $_vote_plugin_votes)
+ {
$cnt++;
}
$postdata .= $vote_str;
}
- if (md5(@join('',get_source($post['refer']))) != $post['digest']) {
+ if (md5(@join('',get_source($post['refer']))) != $post['digest'])
+ {
$title = $_title_collided;
$s_refer = htmlspecialchars($post['refer']);
}
$vote_no = $numbers[$vars['page']]++;
- if (!func_num_args()) {
+ if (!func_num_args())
+ {
return '';
}
EOD;
$tdcnt = 0;
- foreach($args as $arg) {
+ foreach($args as $arg)
+ {
$cnt = 0;
- if (preg_match("/^(.+)\[(\d+)\]$/",$arg,$match)) {
+ if (preg_match("/^(.+)\[(\d+)\]$/",$arg,$match))
+ {
$arg = $match[1];
$cnt = $match[2];
}