Changeset 5970
- Timestamp:
- 05/18/08 21:53:12 (8 months ago)
- Location:
- trunk/plugins/CL_Moblog
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/CL_Moblog/index.php
r5969 r5970 5 5 { 6 6 function Moblog( $username, $password, $host, $port = 110, $ssl = 0, 7 $userid = 1, $minsize = 10240 )7 $userid = 1, $minsize = 10240, $visibility = 2 ) 8 8 { 9 9 global $pop3logs; … … 19 19 $this->minsize = $minsize; 20 20 $this->recentCount = 100; 21 $this->visibility = array( "private", "protected", "public", "syndicated" ); 22 $this->visibility = $this->visibility[$visibility]; 21 23 22 24 $this->pop3 = new Pop3(); … … 122 124 $alt = htmlentities($mail['attachments'][0]['filename'],ENT_QUOTES,'utf-8'); 123 125 $content = '<p>$TEXT</p><p>[##_1C|$FILENAME|width="$WIDTH" height="$HEIGHT" alt="'.$alt.'"|_##]</p>'; 124 $text = "<h3 id=\"$docid\">".$mail['subject']."</h3>\r\n".(isset($mail['text'])?$mail['text']:''); 126 $text = "<h3 id=\"$docid\">".(empty($mail['subject']) ? $docid : $mail['subject'])."</h3>\r\n"; 127 $text .= isset($mail['text']) ? $mail['text'] : ''; 125 128 return str_replace( '$TEXT', $text , $content ); 126 129 } … … 146 149 $mail = $this->pop3->parse( $lines ); 147 150 if( in_array( $mail['subject'], array( '제목없음' ) ) ) { 148 $mail['subject'] = $slogan;151 $mail['subject'] = ''; 149 152 } 150 153 if( !$this->isMms($mail) ) { … … 163 166 $post->content .= $this->_getDecoratedContent( $mail, $docid ); 164 167 $post->modified = time(); 168 $post->visibility = $this->visibility; 165 169 } else { 166 $post->title = $mail['subject'];170 $post->title = empty($mail['subject']) ? $slogan : $mail['subject']; 167 171 $post->userid = $this->userid; 168 172 $post->content = $this->_getDecoratedContent( $mail, $docid ); … … 172 176 $post->acceptComment = true; 173 177 $post->acceptTrackback = true; 174 $post->visibility = "public";178 $post->visibility = $this->visibility; 175 179 $post->published = time(); 176 180 $post->modified = time(); … … 213 217 { 214 218 if( isset($_GET['check']) && $_GET['check'] == 1 ) { 215 echo "<style>.emplog{color:red} </style>";219 echo "<style>.emplog{color:red}.oklog{color:blue}</style>"; 216 220 echo "<ul>"; 217 221 echo join( "", 218 222 array_map( 219 create_function( '$li', 'return preg_match( "/^\S+\s+\S+\s+\*/", $li ) ? "<li class=\"emplog\">$li</li>" : "<li>$li</li>";'), 223 create_function( '$li', 'return preg_match( "/^\S+\s+\S+\s+\*/", $li ) ? 224 (preg_match( "/\[OK\]$/", $li ) ? "<li class=\"oklog\">$li</li>" : "<li class=\"emplog\">$li</li>") 225 : "<li>$li</li>";'), 220 226 split( "\n",file_get_contents(ROOT.DS."cache".DS."moblog.txt")) 221 227 ) … … 233 239 $pop3minsize *= 1024; 234 240 $pop3fallbackuserid = getBlogSetting( 'MmsPop3Fallbackuserid', 1 ); 235 236 header( "Content-type: text/html" ); 237 echo "<ul><li>"; 238 $moblog = new Moblog( $pop3username, $pop3password, $pop3host, $pop3port, $pop3ssl, $pop3fallbackuserid, $pop3minsize ); 241 $pop3visibility = getBlogSetting( 'MmsPop3Visibility', '2' ); 242 243 header( "Content-type: text/html; charset:utf-8" ); 244 echo "<html><body><ul><li>"; 245 $moblog = new Moblog( $pop3username, $pop3password, $pop3host, $pop3port, $pop3ssl, $pop3fallbackuserid, $pop3minsize, $pop3visibility ); 239 246 $moblog->log( "--BEGIN--" ); 240 247 $moblog->check(); … … 244 251 print join("</li><li>",$pop3logs); 245 252 } 246 echo "</li></ul> ";253 echo "</li></ul></body></html>"; 247 254 return true; 248 255 } … … 259 266 setBlogSetting( 'MmsPop3Username', $_POST['pop3username'] ); 260 267 setBlogSetting( 'MmsPop3Password', $_POST['pop3password'] ); 268 setBlogSetting( 'MmsPop3Visibility', $_POST['pop3visibility'] ); 261 269 setBlogSetting( 'MmsPop3Fallbackuserid', getUserId() ); 262 270 setBlogSetting( 'MmsPop3MinSize', 0 ); … … 270 278 $pop3minsize = getBlogSetting( 'MmsPop3MinSize', 0 ); 271 279 $pop3fallheadercharset = getBlogSetting( 'MmsPop3Fallbackcharset', 'euc-kr' ); 280 $pop3visibility = getBlogSetting( 'MmsPop3Visibility', '2' ); 272 281 ?> 273 282 <hr class="hidden" /> … … 331 340 <dd> 332 341 <input type="password" style="width:14em" class="input-text" name="pop3password" value="<?php echo $pop3password;?>" /> 342 </dd> 343 </dl> 344 <dl id="editor-line" class="line"> 345 <dt><span class="label"><?php echo _t('공개여부');?></span></dt> 346 <dd> 347 <span id="status-private" class="status-private"><input type="radio" id="visibility_private" class="radio" name="pop3visibility" value="0"<?php echo ($pop3visibility == 0 ? ' checked="checked"' : '');?> /><label for="visibility_private"><?php echo _t('비공개');?></label></span> 348 <span id="status-protected" class="status-protected"><input type="radio" id="visibility_protected" class="radio" name="pop3visibility" value="1"<?php echo ($pop3visibility == 1 ? ' checked="checked"' : '');?> /><label for="visibility_protected"><?php echo _t('보호');?></label></span> 349 <span id="status-public" class="status-public"><input type="radio" id="visibility_public" class="radio" name="pop3visibility" value="2"<?php echo ($pop3visibility == 2 ? ' checked="checked"' : '');?> /><label for="visibility_public"><?php echo _t('공개');?></label></span> 350 <span id="status-syndicated" class="status-syndicated"><input type="radio" id="visibility_syndicated" class="radio" name="pop3visibility" value="3"<?php echo ($pop3visibility == 3 ? ' checked="checked"' : '');?> /><label for="visibility_syndicated"><?php echo _t('발행');?></label></span> 333 351 </dd> 334 352 </dl> -
trunk/plugins/CL_Moblog/index.xml
r5963 r5970 48 48 </param> 49 49 <param> 50 <name>pop3visibility</name><type>int</type><mandatory>0</mandatory> 51 </param> 52 <param> 50 53 <name>check</name><type>int</type><mandatory>0</mandatory> 51 54 </param>
