Changeset 6348

Show
Ignore:
Timestamp:
06/27/08 16:22:36 (21 months ago)
Author:
coolengineer
Message:
  • #960
  • MMS의 제목을 블로그에 추가하지 않음
  • 각 엔트리에 대한 css class 지정, moblog-entry, moblog-title, moblog-body, moblog-attachments
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.7/plugins/CL_Moblog/index.php

    r6298 r6348  
    146146                $mail['text'] = preg_replace( '@<BR>\s*<BR>\s*<BR>@smi', '<BR>', $mail['text']); 
    147147            } 
    148             $text = "<h3 id=\"$docid\">$docid</h3>\r\n"; 
    149             $text .= empty($mail['subject']) ? '' : ("<p>".$mail['subject']."</p>\r\n"); 
    150             $text .= "<p>{$mail['text']}</p>\r\n"; 
     148            $text = "<h3 class=\"moblog-title\" id=\"$docid\">$docid</h3>\r\n"; 
     149            //$text .= empty($mail['subject']) ? '' : ("<p>".$mail['subject']."</p>\r\n"); 
     150            if( !empty($mail['text']) ) { 
     151                $text .= "<div class=\"moblog-body\">{$mail['text']}</div>\r\n"; 
     152            } 
    151153            return $text; 
    152154    } 
     
    197199 
    198200        $post = new Post(); 
     201        $moblog_begin = "\n<div class=\"moblog-entry\">"; 
     202        $moblog_end = "\n</div>\n"; 
    199203 
    200204        if( $post->open( "slogan = '$slogan'" ) ) { 
    201205            $this->log( "* 기존 글을 엽니다. (SLOGAN:$slogan)" ); 
    202             $post->content .= $this->_getDecoratedContent( $mail, $docid ); 
     206            $post->content .= $moblog_begin.$this->_getDecoratedContent( $mail, $docid ); 
    203207            $post->modified = time(); 
    204208            $post->visibility = $this->visibility; 
     
    214218            $post->userid = $this->userid; 
    215219            $post->category = $this->category; 
    216             $post->content = $this->_getDecoratedContent( $mail, $docid ); 
     220            $post->content = $moblog_begin.$this->_getDecoratedContent( $mail, $docid ); 
    217221            $post->contentFormatter = getDefaultFormatter(); 
    218222            $post->contentEditor = getDefaultEditor(); 
     
    235239        if( isset( $mail['attachments'] ) && count($mail['attachments']) ) { 
    236240            requireModel( "blog.api" ); 
     241            $post->content .= "<div class=\"moblog-attachments\">\n"; 
    237242            foreach( $mail['attachments'] as $mail_att ) { 
    238243                $this->log( "* ". _t("첨부")." : {$mail_att['filename']}" ); 
     
    250255                } 
    251256                $alt = htmlentities($mail_att['filename'],ENT_QUOTES,'utf-8'); 
    252                 $content ='<p>[##_1C|$FILENAME|width="$WIDTH" height="$HEIGHT" alt="'.$alt.'"|_##]</p>'; 
     257                $content ='[##_1C|$FILENAME|width="$WIDTH" height="$HEIGHT" alt="'.$alt.'"|_##]'; 
    253258                $content = str_replace( '$FILENAME', $att['name'], $content ); 
    254259                $content = str_replace( '$WIDTH', $att['width'], $content ); 
     
    256261                $post->content .= $content; 
    257262            } 
    258             if( !$post->update() ) { 
    259                 $this->logMail( $mail, "ERROR" ); 
    260                 $this->log( _t("실패: 첨부파일을 본문에 연결하지 못하였습니다").". : " . $post->error ); 
    261                 return false; 
    262             } 
     263            $post->content .= "\n</div>"; 
     264        } 
     265        $post->content .= $moblog_end; 
     266 
     267        if( !$post->update() ) { 
     268            $this->logMail( $mail, "ERROR" ); 
     269            $this->log( _t("실패: 첨부파일을 본문에 연결하지 못하였습니다").". : " . $post->error ); 
     270            return false; 
    263271        } 
    264272        $this->logMail( $mail, "OK" );