Changeset 6025
- Timestamp:
- 05/24/08 23:57:30 (8 months ago)
- Location:
- trunk/plugins/CL_Moblog
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/CL_Moblog/index.php
r5994 r6025 5 5 { 6 6 function Moblog( $username, $password, $host, $port = 110, $ssl = 0, 7 $userid = 1, $minsize = 10240, $visibility = 2 )7 $userid = 1, $minsize = 10240, $visibility = 2, $category = 0 ) 8 8 { 9 9 global $pop3logs; … … 21 21 $this->visibility = array( "private", "protected", "public", "syndicated" ); 22 22 $this->visibility = $this->visibility[$visibility]; 23 $this->category = $category; 23 24 24 25 $this->pop3 = new Pop3(); … … 123 124 function _getDecoratedContent( & $mail, $docid ) { 124 125 $alt = htmlentities($mail['attachments'][0]['filename'],ENT_QUOTES,'utf-8'); 125 $content = '<p>$TEXT</p><p>[##_1C|$FILENAME|width="$WIDTH" height="$HEIGHT" alt="'.$alt.'"|_##]</p>'; 126 $text = "<h3 id=\"$docid\">".(empty($mail['subject']) ? $docid : $mail['subject'])."</h3>\r\n"; 127 $text .= isset($mail['text']) ? $mail['text'] : ''; 126 $content = '$TEXT<p>[##_1C|$FILENAME|width="$WIDTH" height="$HEIGHT" alt="'.$alt.'"|_##]</p>'; 127 $text = "<h3 id=\"$docid\">$docid</h3>\r\n"; 128 $text .= empty($mail['subject']) ? '' : ("<p>".$mail['subject']."</p>\r\n"); 129 $text .= isset($mail['text']) ? (!stristr($mail['text'],'table')? "<p>{$mail['text']}</p>" : '') : ''; 128 130 return str_replace( '$TEXT', $text , $content ); 129 131 } … … 164 166 165 167 if( $post->open( "slogan = '$slogan'" ) ) { 168 $this->log( "* 기존 글을 엽니다" ); 166 169 $post->content .= $this->_getDecoratedContent( $mail, $docid ); 167 170 $post->modified = time(); 168 171 $post->visibility = $this->visibility; 169 172 } else { 173 $this->log( "* 새 글을 작성합니다" ); 170 174 $post->title = empty($mail['subject']) ? $slogan : $mail['subject']; 171 175 $post->userid = $this->userid; 176 $post->category = $this->category; 172 177 $post->content = $this->_getDecoratedContent( $mail, $docid ); 173 178 $post->contentFormatter = getDefaultFormatter(); … … 186 191 } 187 192 } 193 /* 슬로건을 지워야만 문제가 발생하지 않습니다. */ 194 //unset($post->slogan); 188 195 189 196 $this->log( _t("첨부")." : {$mail['attachments'][0]['filename']}" ); … … 237 244 $pop3password = getBlogSetting( 'MmsPop3Password', '' ); 238 245 $pop3minsize = getBlogSetting( 'MmsPop3MinSize', 0 ); 246 $pop3category = getBlogSetting( 'MmsPop3Category', 0 ); 239 247 $pop3minsize *= 1024; 240 248 $pop3fallbackuserid = getBlogSetting( 'MmsPop3Fallbackuserid', 1 ); … … 243 251 header( "Content-type: text/html; charset:utf-8" ); 244 252 echo "<html><body><ul><li>"; 245 $moblog = new Moblog( $pop3username, $pop3password, $pop3host, $pop3port, $pop3ssl, $pop3fallbackuserid, $pop3minsize, $pop3visibility );253 $moblog = new Moblog( $pop3username, $pop3password, $pop3host, $pop3port, $pop3ssl, $pop3fallbackuserid, $pop3minsize, $pop3visibility, $pop3category ); 246 254 $moblog->log( "--BEGIN--" ); 247 255 $moblog->check(); … … 267 275 setBlogSetting( 'MmsPop3Password', $_POST['pop3password'] ); 268 276 setBlogSetting( 'MmsPop3Visibility', $_POST['pop3visibility'] ); 277 setBlogSetting( 'MmsPop3Category', $_POST['pop3category'] ); 269 278 setBlogSetting( 'MmsPop3Fallbackuserid', getUserId() ); 270 279 setBlogSetting( 'MmsPop3MinSize', 0 ); … … 277 286 $pop3password = getBlogSetting( 'MmsPop3Password', '' ); 278 287 $pop3minsize = getBlogSetting( 'MmsPop3MinSize', 0 ); 288 $pop3category = getBlogSetting( 'MmsPop3Category', 0 ); 279 289 $pop3fallheadercharset = getBlogSetting( 'MmsPop3Fallbackcharset', 'euc-kr' ); 280 290 $pop3visibility = getBlogSetting( 'MmsPop3Visibility', '2' ); … … 380 390 </dd> 381 391 </dl> 392 <dl id="editor-line" class="line"> 393 <dt><span class="label"><?php echo _t('분류');?></span></dt> 394 <dd> 395 <select id="category" name="pop3category"> 396 <optgroup class="category" label="<?php echo _t('분류');?>"> 397 <?php foreach (getCategories(getBlogId()) as $category): ?> 398 <?php if ($category['id'] != 0): ?> 399 <option value="<?php echo $category['id'];?>" <?php echo $category['id'] == $pop3category ? 'selected':''?> > 400 <?php echo ($category['visibility'] > 1 ? '' : _t('(비공개)')).htmlspecialchars($category['name']);?></option> 401 <?php endif ?> 402 <?php foreach ($category['children'] as $child): ?> 403 <?php if ($category['id'] != 0): ?> 404 <option value="<?php echo $child['id'];?>" <?php echo $child['id'] == $pop3category ? 'selected':''?> > ― <?php echo ($category['visibility'] > 1 && $child['visibility'] > 1 ? '' : _t('(비공개)')).htmlspecialchars($child['name']);?></option> 405 <?php endif ?> 406 <?php endforeach ?> 407 <?php endforeach ?> 408 </optgroup> 409 </select> 410 </dd> 411 </dl> 382 412 <div class="button-box"> 383 413 <input type="submit" class="save-button input-button wide-button" value="<?php echo _t('저장하기');?>" /> -
trunk/plugins/CL_Moblog/index.xml
r5970 r6025 6 6 <version>1.0</version> 7 7 <description xml:lang="en">This plugin enables Mobile blogging</description> 8 <description xml:lang="ko"> 모바일 블로깅을 가능하게 합니다</description>8 <description xml:lang="ko">이동전화로 이메일을 보내면 첨부된 사진을 글로 등록합니다. 관리자화면/설정/모바일 메뉴를 확인하세요</description> 9 9 <license>GPL 2.0</license> 10 10 <author xml:lang="en" link="http://www.needlworks.org/">Hojin Choi</author> … … 51 51 </param> 52 52 <param> 53 <name>pop3category</name><type>int</type><mandatory>0</mandatory> 54 </param> 55 <param> 53 56 <name>check</name><type>int</type><mandatory>0</mandatory> 54 57 </param>
