Changeset 6379
- Timestamp:
- 07/05/08 03:28:28 (6 months ago)
- Files:
-
- 1 modified
-
branches/1.7/plugins/CL_Moblog/index.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.7/plugins/CL_Moblog/index.php
r6348 r6379 174 174 } 175 175 176 /** 177 * Extract tags from {tag1,tag2,tag3,...} format string in the mms message. 178 * $mail will be changed to be removed tags. 179 */ 180 function extractTags( & $mail ) 181 { 182 $p = '/{([^}]*)}/'; 183 $tags = array(); 184 if( preg_match( $p, $mail['text'], $m ) ) { 185 $tags = split( ',', $m[1] ); 186 $mail['text'] = preg_replace( $p, '', $mail['text'] ); 187 } 188 return $tags; 189 } 190 176 191 function retrieveCallback( $lines, $uid ) 177 192 { … … 203 218 204 219 if( $post->open( "slogan = '$slogan'" ) ) { 220 $post->loadTags(); 205 221 $this->log( "* 기존 글을 엽니다. (SLOGAN:$slogan)" ); 222 if( empty($post->tags) ) { 223 $post->tags = array(); 224 } 225 $tags = $this->extractTags( $mail ); /* mail content will be changed */ 226 $post->tags = array_merge( $post->tags, $tags ); 206 227 $post->content .= $moblog_begin.$this->_getDecoratedContent( $mail, $docid ); 207 228 $post->modified = time(); … … 218 239 $post->userid = $this->userid; 219 240 $post->category = $this->category; 241 $post->tags = $this->extractTags( $mail ); /* Go with csv string, Tag class supports both string and array */ 220 242 $post->content = $moblog_begin.$this->_getDecoratedContent( $mail, $docid ); 221 243 $post->contentFormatter = getDefaultFormatter();
