<?php
// PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: file.php,v 1.13.2.2 2005/03/20 10:31:29 teanan Exp $
+// $Id: file.php,v 1.13.2.3 2005/03/21 17:57:41 teanan Exp $
//
// File related functions
global $notify, $notify_diff_only, $notify_to, $notify_subject, $notify_header;
global $smtp_server, $smtp_auth;
global $whatsdeleted, $maxshow_deleted;
- global $autoalias_min_len, $autoalias;
+ global $autoalias, $aliaspage;
if (PKWK_READONLY) return; // Do nothing
mb_send_mail($notify_to, $subject, $str, $notify_header);
}
// for AutoAlias
- if ($autoalias_min_len>0 && $page==$autoalias) {
+ if ($autoalias>0 && $page==$aliaspage) {
// AutoAliasName is updated
$pages = array_keys(get_autoaliases());
if(count($pages)>0) {
autolink_pattern_write(CACHE_DIR . 'autoalias.dat',
- get_autolink_pattern($pages, $autoalias_min_len));
+ get_autolink_pattern($pages, $autoalias));
} else {
@unlink(CACHE_DIR . 'autoalias.dat');
}
<?php
// PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: func.php,v 1.33.2.2 2005/03/20 10:31:29 teanan Exp $
+// $Id: func.php,v 1.33.2.3 2005/03/21 17:57:41 teanan Exp $
//
// General functions
// get pagelist for AutoAlias
function get_autoaliases()
{
- global $autoalias, $autoalias_max_words;
+ global $aliaspage, $autoalias_max_words;
- $aliaspages = array();
+ $pages = array();
$pattern = <<<EOD
\[\[ # open bracket
((?:(?!\]\]).)+)> # (1) alias name
\]\] # close bracket
EOD;
- $postdata = join('', get_source($autoalias));
+ $postdata = join('', get_source($aliaspage));
$matches = array();
if(preg_match_all("/$pattern/x", $postdata, $matches, PREG_SET_ORDER)) {
foreach($matches as $match) {
- $aliaspages[$match[1]] = trim($match[0]);
+ $pages[$match[1]] = trim($match[0]);
}
}
// fail safe
- $aliaspages = array_slice($aliaspages, 0, $autoalias_max_words);
+ $pages = array_slice($pages, 0, $autoalias_max_words);
- return $aliaspages;
+ return $pages;
}
// pukiwiki.php¥¹¥¯¥ê¥×¥È¤Îabsolute-uri¤òÀ¸À®
<?php
// PukiWiki - Yet another WikiWikiWeb clone.
-// $Id: make_link.php,v 1.17.2.2 2005/03/20 10:31:29 teanan Exp $
+// $Id: make_link.php,v 1.17.2.3 2005/03/21 17:57:41 teanan Exp $
//
// Hyperlink-related functions
function Link_autoalias($start)
{
- global $autoalias, $autoalias_min_len;
+ global $autoalias, $aliaspage;
parent::Link($start);
- if (!$autoalias_min_len || !file_exists(CACHE_DIR.'autoalias.dat') || $this->page==$autoalias)
+ if (!$autoalias || !file_exists(CACHE_DIR.'autoalias.dat') || $this->page==$aliaspage)
{
return;
}
@list($auto,$auto_a,$forceignorepages) = file(CACHE_DIR.'autoalias.dat');
$this->auto = $auto;
$this->auto_a = $auto_a;
- $this->forceignorepages = explode("\t",trim($forceignorepages));
+ $this->forceignorepages = explode("\t", trim($forceignorepages));
}
function get_pattern()
{
}
function set($arr,$page)
{
- global $WikiName;
-
list($name) = $this->splice($arr);
// Ignore pages listed
- if (in_array($name,$this->forceignorepages)) {
+ if (in_array($name, $this->forceignorepages)) {
return FALSE;
}
return parent::setParam($page,$name,'','pagename',$name);
<?php
// PukiWiki - Yet another WikiWikiWeb clone
-// $Id: pukiwiki.ini.php,v 1.114.2.2 2005/03/20 10:31:19 teanan Exp $
+// $Id: pukiwiki.ini.php,v 1.114.2.3 2005/03/21 17:57:41 teanan Exp $
//
// PukiWiki main setting file
$whatsnew = 'RecentChanges'; // Modified page list
$whatsdeleted = 'RecentDeleted'; // Removeed page list
$interwiki = 'InterWikiName'; // Set InterWiki definition here
-$autoalias = 'AutoAliasName'; // Set AutoAlias definition here
+$aliaspage = 'AutoAliasName'; // Set AutoAlias definition here
$menubar = 'MenuBar'; // Menu
/////////////////////////////////////////////////
// AutoAlias feature
// AutoAlias minimum bytes (0 = Disable)
-$autoalias_min_len = 8;
+$autoalias = 8;
// Maximum number of words which AutoAlias replace
$autoalias_max_words = 50;