OSDN Git Service

Added spaces only
authorhenoheno <henoheno>
Sat, 24 Jul 2004 04:55:16 +0000 (13:55 +0900)
committerhenoheno <henoheno>
Sat, 24 Jul 2004 04:55:16 +0000 (13:55 +0900)
plugin/article.inc.php

index 248c1b5..da8f1f3 100644 (file)
@@ -19,7 +19,7 @@
  -Åê¹ÆÆâÍƤΥ᡼¥ë¼«Æ°ÇÛ¿®Àè
  ¤òÀßÄê¤Î¾å¡¢¤´»ÈÍѤ¯¤À¤µ¤¤¡£
 
- $Id: article.inc.php,v 1.16 2003/07/10 03:21:12 arino Exp $
+ $Id: article.inc.php,v 1.17 2004/07/24 04:55:16 henoheno Exp $
  
  */
 
@@ -27,41 +27,41 @@ global $_mailto;
 
 /////////////////////////////////////////////////
 // ¥Æ¥­¥¹¥È¥¨¥ê¥¢¤Î¥«¥é¥à¿ô
-define('article_COLS',70);
+define('article_COLS', 70);
 /////////////////////////////////////////////////
 // ¥Æ¥­¥¹¥È¥¨¥ê¥¢¤Î¹Ô¿ô
-define('article_ROWS',5);
+define('article_ROWS', 5);
 /////////////////////////////////////////////////
 // Ì¾Á°¥Æ¥­¥¹¥È¥¨¥ê¥¢¤Î¥«¥é¥à¿ô
-define('NAME_COLS',24);
+define('NAME_COLS', 24);
 /////////////////////////////////////////////////
 // Âê̾¥Æ¥­¥¹¥È¥¨¥ê¥¢¤Î¥«¥é¥à¿ô
-define('SUBJECT_COLS',60);
+define('SUBJECT_COLS', 60);
 /////////////////////////////////////////////////
 // Ì¾Á°¤ÎÁÞÆþ¥Õ¥©¡¼¥Þ¥Ã¥È
-define('NAME_FORMAT','[[$name]]');
+define('NAME_FORMAT', '[[$name]]');
 /////////////////////////////////////////////////
 // Âê̾¤ÎÁÞÆþ¥Õ¥©¡¼¥Þ¥Ã¥È
-define('SUBJECT_FORMAT','**$subject');
+define('SUBJECT_FORMAT', '**$subject');
 /////////////////////////////////////////////////
 // ÁÞÆþ¤¹¤ë°ÌÃÖ 1:Íó¤ÎÁ° 0:Íó¤Î¸å
-define('ARTICLE_INS',0);
+define('ARTICLE_INS', 0);
 /////////////////////////////////////////////////
 // ½ñ¤­¹þ¤ß¤Î²¼¤Ë°ì¹Ô¥³¥á¥ó¥È¤òÆþ¤ì¤ë 1:Æþ¤ì¤ë 0:Æþ¤ì¤Ê¤¤
-define('ARTICLE_COMMENT',1);
+define('ARTICLE_COMMENT', 1);
 /////////////////////////////////////////////////
 // ²þ¹Ô¤ò¼«Æ°ÅªÊÑ´¹ 1:¤¹¤ë 0:¤·¤Ê¤¤
-define('ARTICLE_AUTO_BR',1);
+define('ARTICLE_AUTO_BR', 1);
 
 /////////////////////////////////////////////////
 // Åê¹ÆÆâÍƤΥ᡼¥ë¼«Æ°ÇÛ¿® 1:¤¹¤ë 0:¤·¤Ê¤¤
-define('MAIL_AUTO_SEND',0);
+define('MAIL_AUTO_SEND', 0);
 /////////////////////////////////////////////////
 // Åê¹ÆÆâÍƤΥ᡼¥ëÁ÷¿®»þ¤ÎÁ÷¿®¼Ô¥á¡¼¥ë¥¢¥É¥ì¥¹
-define('MAIL_FROM','');
+define('MAIL_FROM', '');
 /////////////////////////////////////////////////
 // Åê¹ÆÆâÍƤΥ᡼¥ëÁ÷¿®»þ¤ÎÂê̾
-define('MAIL_SUBJECT_PREFIX','[someone\'sPukiWiki]');
+define('MAIL_SUBJECT_PREFIX', '[someone\'sPukiWiki]');
 /////////////////////////////////////////////////
 // Åê¹ÆÆâÍƤΥ᡼¥ë¼«Æ°ÇÛ¿®Àè
 $_mailto = array (
@@ -70,25 +70,25 @@ $_mailto = array (
 
 function plugin_article_action()
 {
-       global $script,$post,$vars,$cols,$rows,$now;
-       global $_title_collided,$_msg_collided,$_title_updated;
-       global $_mailto,$_no_subject,$_no_name;
+       global $script, $post, $vars, $cols, $rows, $now;
+       global $_title_collided, $_msg_collided, $_title_updated;
+       global $_mailto, $_no_subject, $_no_name;
        
        if ($post['msg'] == '') {
                return array('msg'=>'','body'=>'');
        }
        
        $name = ($post['name'] == '') ? $_no_name : $post['name'];
-       $name = ($name == '') ? '' : str_replace('$name',$name,NAME_FORMAT);
+       $name = ($name == '') ? '' : str_replace('$name', $name, NAME_FORMAT);
        $subject = ($post['subject'] == '') ? $_no_subject : $post['subject'];
-       $subject = ($subject == '') ? '' : str_replace('$subject',$subject,SUBJECT_FORMAT);
+       $subject = ($subject == '') ? '' : str_replace('$subject', $subject, SUBJECT_FORMAT);
        $article  = "$subject\n>$name ($now)~\n~\n";
        
        $msg = rtrim($post['msg']);
        if (ARTICLE_AUTO_BR) {
                //²þ¹Ô¤Î¼è¤ê°·¤¤¤Ï¤±¤Ã¤³¤¦Ìñ²ð¡£ÆäËURL¤¬Íí¤ó¤À¤È¤­¤Ï¡Ä
                //¥³¥á¥ó¥È¹Ô¡¢À°·ÁºÑ¤ß¹Ô¤Ë¤Ï~¤ò¤Ä¤±¤Ê¤¤¤è¤¦¤Ë arino
-               $msg = join("\n",preg_replace('/^(?!\/\/)(?!\s)(.*)$/','$1~',explode("\n",$msg)));
+               $msg = join("\n", preg_replace('/^(?!\/\/)(?!\s)(.*)$/', '$1~', explode("\n", $msg)));
        }
        $article .= "$msg\n\n//";
        
@@ -101,10 +101,10 @@ function plugin_article_action()
        $article_no = 0;
        
        foreach($postdata_old as $line) {
-               if (!ARTICLE_INS) {
+               if (! ARTICLE_INS) {
                        $postdata .= $line;
                }
-               if (preg_match('/^#article/',$line)) {
+               if (preg_match('/^#article/', $line)) {
                        if ($article_no == $post['article_no'] && $post['msg'] != '') {
                                $postdata .= "$article\n";
                        }
@@ -118,7 +118,7 @@ function plugin_article_action()
        $postdata_input = "$article\n";
        $body = '';
        
-       if (md5(@join('',get_source($post['refer']))) != $post['digest']) {
+       if (md5(@join('', get_source($post['refer']))) != $post['digest']) {
                $title = $_title_collided;
                
                $body = "$_msg_collided\n";
@@ -137,25 +137,25 @@ function plugin_article_action()
 EOD;
        }
        else {
-               page_write($post['refer'],trim($postdata));
+               page_write($post['refer'], trim($postdata));
                
                // Åê¹ÆÆâÍƤΥ᡼¥ë¼«Æ°Á÷¿®
                if (MAIL_AUTO_SEND) {
-                       $mailaddress = implode(',' ,$_mailto);
-                       $mailsubject = MAIL_SUBJECT_PREFIX.' '.str_replace('**','',$subject);
+                       $mailaddress = implode(','$_mailto);
+                       $mailsubject = MAIL_SUBJECT_PREFIX . ' ' . str_replace('**', '', $subject);
                        if ($post['name']) {
-                               $mailsubject .= '/'.$post['name'];
+                               $mailsubject .= '/' . $post['name'];
                        }
                        $mailsubject = mb_encode_mimeheader($mailsubject);
                        
                        $mailbody = $post['msg'];
                        $mailbody .= "\n\n---\n";
-                       $mailbody .= $_msg_article_mail_sender.$post['name']." ($now)\n";
-                       $mailbody .= $_msg_article_mail_page.$post['refer']."\n";
-                       $mailbody .= "¡¡ URL: ".$script.'?'.rawurlencode($post['refer'])."\n";
+                       $mailbody .= $_msg_article_mail_sender . $post['name'] . " ($now)\n";
+                       $mailbody .= $_msg_article_mail_page . $post['refer'] . "\n";
+                       $mailbody .= '¡¡ URL: ' . $script . '?' . rawurlencode($post['refer']) . "\n";
                        $mailbody = mb_convert_encoding( $mailbody, "JIS" );
                        
-                       $mailaddheader = "From: ".MAIL_FROM;
+                       $mailaddheader = "From: " . MAIL_FROM;
                        
                        mail($mailaddress, $mailsubject, $mailbody, $mailaddheader);
                }
@@ -170,13 +170,14 @@ EOD;
        
        return $retvars;
 }
+
 function plugin_article_convert()
 {
-       global $script,$vars,$digest;
-       global $_btn_article,$_btn_name,$_btn_subject;
+       global $script, $vars, $digest;
+       global $_btn_article, $_btn_name, $_btn_subject;
        static $numbers = array();
        
-       if (!array_key_exists($vars['page'],$numbers))
+       if (! array_key_exists($vars['page'], $numbers))
        {
                $numbers[$vars['page']] = 0;
        }