OSDN Git Service

Changed name.($autoalias=>$aliaspage, $autoalias_min_len=>$autoalias)
authorteanan <teanan>
Mon, 21 Mar 2005 17:57:41 +0000 (02:57 +0900)
committerteanan <teanan>
Mon, 21 Mar 2005 17:57:41 +0000 (02:57 +0900)
lib/file.php
lib/func.php
lib/make_link.php
pukiwiki.ini.php

index 58921fc..e64b968 100644 (file)
@@ -1,6 +1,6 @@
 <?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
 
@@ -90,7 +90,7 @@ function file_write($dir, $page, $str, $notimestamp = FALSE)
        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
 
@@ -154,12 +154,12 @@ function file_write($dir, $page, $str, $notimestamp = FALSE)
                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');
                }
index 511cafd..3827b1f 100644 (file)
@@ -1,6 +1,6 @@
 <?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
 
@@ -526,9 +526,9 @@ function get_autolink_pattern_sub(& $pages, $start, $end, $pos)
 // 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
@@ -536,17 +536,17 @@ function get_autoaliases()
 \]\]                # 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¤òÀ¸À®
index 31862ab..c24c317 100644 (file)
@@ -1,6 +1,6 @@
 <?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
 
@@ -694,18 +694,18 @@ class Link_autoalias extends Link
 
        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()
        {
@@ -717,11 +717,9 @@ class Link_autoalias extends Link
        }
        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);
index 4ab3b75..a55a9af 100644 (file)
@@ -1,6 +1,6 @@
 <?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
 
@@ -105,7 +105,7 @@ $defaultpage  = 'FrontPage';     // Top / Default page
 $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
 
 /////////////////////////////////////////////////
@@ -152,7 +152,7 @@ $autolink = 8;
 // AutoAlias feature
 
 // AutoAlias minimum bytes (0 = Disable)
-$autoalias_min_len = 8;
+$autoalias = 8;
 
 // Maximum number of words which AutoAlias replace
 $autoalias_max_words = 50;