Changeset 5966
- Timestamp:
- 05/17/08 22:57:47 (6 months ago)
- Files:
-
- 1 modified
-
trunk/plugins/CL_Moblog/index.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/CL_Moblog/index.php
r5964 r5966 64 64 { 65 65 if( !$this->pop3->connect( $this->host, $this->port, $this->ssl ) ) { 66 $this->log( "* Connection failure: ".$this->host.":".$this->port.($this->ssl?"(SSL)":"(no SSL)") );67 return false; 68 } 69 $this->log( "* Connection success: ".$this->host.":".$this->port.($this->ssl?"(SSL)":"(no SSL)") );66 $this->log( "* "._t("접속 실패")." : ".$this->host.":".$this->port.($this->ssl?"(SSL)":"(no SSL)") ); 67 return false; 68 } 69 $this->log( "* "._t("접속 성공")." : ".$this->host.":".$this->port.($this->ssl?"(SSL)":"(no SSL)") ); 70 70 if( !$this->pop3->authorize( $this->username, $this->password ) ) { 71 $this->log( "* Authentication failure");72 return false; 73 } 74 $this->log( "* Authentication success");71 $this->log( "* "._t("인증 실패") ); 72 return false; 73 } 74 $this->log( "* "._t("인증 성공") ); 75 75 76 76 $this->pop3->run(); … … 93 93 $ret = !!strstr( $this->stored_uidl, "[$uid]" ); 94 94 if( $ret ) { 95 $this->log( "Msg $number: Filterred by uid: $uid" );95 $this->log( "Msg $number: "._t("이미 확인한 메일")." : $uid" ); 96 96 } 97 97 return $ret; … … 103 103 return true; 104 104 } 105 $this->log( "Msg $number: Filterred by size: $size" );105 $this->log( "Msg $number: "._t("메일크기가 작음")." : $size" ); 106 106 return $size < $this->minsize; 107 107 } … … 119 119 } 120 120 121 function _getDecoratedContent( & $mail ) {121 function _getDecoratedContent( & $mail, $docid ) { 122 122 $alt = htmlentities($mail['attachments'][0]['filename'],ENT_QUOTES,'utf-8'); 123 123 $content = '<p>$TEXT</p><p>[##_1C|$FILENAME|width="$WIDTH" height="$HEIGHT" alt="'.$alt.'"|_##]</p>'; 124 $text = "<h3 >".$mail['subject']."</h3>\r\n".(isset($mail['text'])?$mail['text']:'');124 $text = "<h3 id=\"$docid\">".$mail['subject']."</h3>\r\n".(isset($mail['text'])?$mail['text']:''); 125 125 return str_replace( '$TEXT', $text , $content ); 126 126 } … … 128 128 function statCallback( $total, $totalsize ) 129 129 { 130 $this->log( "* Total $total messages");130 $this->log( "* ".sprintf( _t("총 %d개의 메시지"),$total) ); 131 131 $lastStat = getBlogSetting( 'MmsPop3stat', '' ); 132 132 $stat = "$total $totalsize"; 133 133 if( $stat == $lastStat ) { 134 $this->log( "* No new message arrived");134 $this->log( "* "._t("새로운 메시지가 없습니다") ); 135 135 return false; 136 136 } … … 142 142 { 143 143 $slogan = date( "Y-m-d" ); 144 $docid = date( "H:i:s" ); 144 145 $this->appendUid( $uid ); 145 146 $mail = $this->pop3->parse( $lines ); 146 147 if( in_array( $mail['subject'], array( '제목없음' ) ) ) { 147 $mail['subject'] = date( "Y-m-d H:i:s" );148 $mail['subject'] = $docid; 148 149 } 149 150 if( !$this->isMms($mail) ) { 150 $this->log( "* Subject: " . $mail['subject'] . " [SKIP]" );151 $this->log( "* "._t("메일").": " . $mail['subject'] . " [SKIP]" ); 151 152 return false; 152 153 } 153 154 if( empty($mail['attachments']) ) { 154 $this->log( "* Subject: " . $mail['subject'] . " [SKIP]" );155 $this->log( "* "._t("메일").": " . $mail['subject'] . " [SKIP]" ); 155 156 return false; 156 157 } … … 160 161 161 162 if( $post->open( "slogan = '$slogan'" ) ) { 162 $post->content .= $this->_getDecoratedContent( $mail );163 $post->content .= $this->_getDecoratedContent( $mail, $docid ); 163 164 $post->modified = time(); 164 165 } else { … … 176 177 $post->slogan = $slogan; 177 178 if( !$post->add() ) { 178 $this->log( "* Subject: " . $mail['subject'] . " [ERROR]" );179 $this->log( "Failed: there is a problem in adding post: " . $post->error );179 $this->log( "* "._t("메일").": " . $mail['subject'] . " [ERROR]" ); 180 $this->log( _t("실패: 글을 추가하지 못하였습니다")." : " . $post->error ); 180 181 return false; 181 182 } 182 183 } 183 184 184 $this->log( "Attachment: {$mail['attachments'][0]['filename']}" );185 $this->log( _t("첨부")." : {$mail['attachments'][0]['filename']}" ); 185 186 requireModel( "blog.api" ); 186 187 $att = api_addAttachment( getBlogId(), $post->id, … … 192 193 ); 193 194 if( !$att ) { 194 $this->log( "* Subject: " . $mail['subject'] . " [ERROR]" );195 $this->log( "Failed: there is a problem in attaching file");195 $this->log( "* "._t("메일").": " . $mail['subject'] . " [ERROR]" ); 196 $this->log( _t("실패: 첨부파일을 추가하지 못하였습니다")." : " . $post->error ); 196 197 return false; 197 198 } … … 200 201 $post->content = str_replace( '$HEIGHT', $att['height'], $post->content ); 201 202 if( !$post->update() ) { 202 $this->log( "* Subject: " . $mail['subject'] . " [ERROR]" );203 $this->log( "Failed: there is a problem in adding post.");204 return false; 205 } 206 $this->log( "* Subject: " . $mail['subject'] . " [OK]" );203 $this->log( "* "._t("메일").": " . $mail['subject'] . " [ERROR]" ); 204 $this->log( _t("실패: 글을 추가하지 못하였습니다").". : " . $post->error ); 205 return false; 206 } 207 $this->log( "* "._t("메일").": " . $mail['subject'] . " [OK]" ); 207 208 return true; 208 209 }
