Changeset 6025

Show
Ignore:
Timestamp:
05/24/08 23:57:30 (8 months ago)
Author:
coolengineer
Message:
  • #960
  • 카테고리 설정 기능 추가
Location:
trunk/plugins/CL_Moblog
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/CL_Moblog/index.php

    r5994 r6025  
    55{ 
    66    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 ) 
    88    { 
    99        global $pop3logs; 
     
    2121        $this->visibility = array( "private", "protected", "public", "syndicated" ); 
    2222        $this->visibility = $this->visibility[$visibility]; 
     23        $this->category = $category; 
    2324 
    2425        $this->pop3 = new Pop3(); 
     
    123124    function _getDecoratedContent( & $mail, $docid ) { 
    124125            $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>" : '') : ''; 
    128130            return str_replace( '$TEXT', $text , $content ); 
    129131    } 
     
    164166 
    165167        if( $post->open( "slogan = '$slogan'" ) ) { 
     168            $this->log( "* 기존 글을 엽니다" ); 
    166169            $post->content .= $this->_getDecoratedContent( $mail, $docid ); 
    167170            $post->modified = time(); 
    168171            $post->visibility = $this->visibility; 
    169172        } else { 
     173            $this->log( "* 새 글을 작성합니다" ); 
    170174            $post->title = empty($mail['subject']) ? $slogan : $mail['subject']; 
    171175            $post->userid = $this->userid; 
     176            $post->category = $this->category; 
    172177            $post->content = $this->_getDecoratedContent( $mail, $docid ); 
    173178            $post->contentFormatter = getDefaultFormatter(); 
     
    186191            } 
    187192        } 
     193        /* 슬로건을 지워야만 문제가 발생하지 않습니다. */ 
     194        //unset($post->slogan); 
    188195 
    189196        $this->log( _t("첨부")." : {$mail['attachments'][0]['filename']}" ); 
     
    237244    $pop3password = getBlogSetting( 'MmsPop3Password', '' ); 
    238245    $pop3minsize = getBlogSetting( 'MmsPop3MinSize', 0 ); 
     246    $pop3category = getBlogSetting( 'MmsPop3Category', 0 ); 
    239247    $pop3minsize *= 1024; 
    240248    $pop3fallbackuserid = getBlogSetting( 'MmsPop3Fallbackuserid', 1 ); 
     
    243251    header( "Content-type: text/html; charset:utf-8" ); 
    244252    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 ); 
    246254    $moblog->log( "--BEGIN--" ); 
    247255    $moblog->check(); 
     
    267275        setBlogSetting( 'MmsPop3Password', $_POST['pop3password'] ); 
    268276        setBlogSetting( 'MmsPop3Visibility', $_POST['pop3visibility'] ); 
     277        setBlogSetting( 'MmsPop3Category', $_POST['pop3category'] ); 
    269278        setBlogSetting( 'MmsPop3Fallbackuserid', getUserId() ); 
    270279        setBlogSetting( 'MmsPop3MinSize', 0 ); 
     
    277286    $pop3password = getBlogSetting( 'MmsPop3Password', '' ); 
    278287    $pop3minsize = getBlogSetting( 'MmsPop3MinSize', 0 ); 
     288    $pop3category = getBlogSetting( 'MmsPop3Category', 0 ); 
    279289    $pop3fallheadercharset = getBlogSetting( 'MmsPop3Fallbackcharset', 'euc-kr' ); 
    280290    $pop3visibility = getBlogSetting( 'MmsPop3Visibility', '2' ); 
     
    380390                                            </dd> 
    381391                                        </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':''?> >&nbsp;― <?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> 
    382412                                    <div class="button-box"> 
    383413                                        <input type="submit" class="save-button input-button wide-button" value="<?php echo _t('저장하기');?>"  /> 
  • trunk/plugins/CL_Moblog/index.xml

    r5970 r6025  
    66  <version>1.0</version> 
    77  <description xml:lang="en">This plugin enables Mobile blogging</description> 
    8   <description xml:lang="ko">모바일 블로깅을 가능하게 합니다</description> 
     8  <description xml:lang="ko">이동전화로 이메일을 보내면 첨부된 사진을 글로 등록합니다. 관리자화면/설정/모바일 메뉴를 확인하세요</description> 
    99  <license>GPL 2.0</license> 
    1010  <author xml:lang="en" link="http://www.needlworks.org/">Hojin Choi</author> 
     
    5151              </param> 
    5252              <param> 
     53                  <name>pop3category</name><type>int</type><mandatory>0</mandatory> 
     54              </param> 
     55              <param> 
    5356                  <name>check</name><type>int</type><mandatory>0</mandatory> 
    5457              </param>