interface/common/blog/list.php 파일 수정

 
foreach ($list['items'] as $item) {    
    //== ACEPRO ================================================================
    $visible = _t('visible etc');
    if (isset($item['visibility'])) {
        if($item['visibility']==0){
            $visible = _t('visible private'   );
        }else
        if($item['visibility']==1){
            $visible = _t('visible protected' );
        }else
        if($item['visibility']==2){
            $visible = _t('visible public'    );
        }else
        if($item['visibility']==3){
            $visible = _t('visible syndicated');
        }
    }
    //== ACEPRO ================================================================

    $author        = User::getName($item['userid']);
    $itemsView .= str_replace(
        array(
            '[##_list_rep_regdate_##]',
            '[##_list_rep_name_##]',
            '[##_list_rep_author_##]',
            '[##_list_rep_link_##]',
            '[##_list_rep_title_##]',
            '[##_list_rep_rp_cnt_##]',
            '[##_list_rep_visible_##]'
        ),
        array(
            fireEvent('ViewListDate', Timestamp::formatDate($item['published']), $item['published']),
            fireEvent('ViewListName', htmlspecialchars($author)),
            fireEvent('ViewListName', htmlspecialchars($author)),
            ((!empty($skinSetting['showListWithTotalEntries'])) ? "#entry_".$item['id'] :
            "$blogURL/" . ($blog['useSloganOnPost'] ? 'entry/' . URL::encode($item['slogan'],$service['useEncodedURL']) : $item['id'])).(isset($list['category']) ? '?category='.$list['category'] : ''),
            fireEvent('ViewListTitle', htmlspecialchars($item['title'])),
            ($item['comments'] > 0) ? "({$item['comments']})" : '',
            $visible
        ),
        $skin->listItem
    );
}

library/model/blog.entry.php 수정

SQL에 문에 e.visibility 항목 추가

function getEntryListWithPagingByCategory($blogid, $category, $page, $count) {
    global $database, $suri, $folderURL, $blog;
    if ($category === null)
        return array();
    if (!doesHaveOwnership() && getCategoryVisibility($blogid, $category) < 2 && $category != 0)
        return array();
    if ($category > 0) {
        $categories = POD::queryColumn("SELECT id FROM {$database['prefix']}Categories WHERE blogid = $blogid AND parent = $category");
        array_push($categories, $category);
        if(!doesHaveOwnership()) 
            $categories = array_diff($categories, getCategoryVisibilityList($blogid, 'private'));
        $cond = 'AND e.category IN (' . implode(', ', $categories) . ')';
        $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0';
    } else {
        $cond = 'AND e.category >= 0';
        $visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0'.getPrivateCategoryExclusionQuery($blogid);
    }
    $visibility .= (doesHaveOwnership() && !Acl::check('group.editors')) ? ' AND (e.userid = '.getUserId().' OR e.visibility > 0)' : '';

    $sql = "SELECT e.blogid,e.userid,e.id,e.title,e.comments,e.slogan,e.published,e.visibility
            FROM {$database['prefix']}Entries e 
            WHERE e.blogid = $blogid AND e.draft = 0 $visibility $cond 
            ORDER BY e.published DESC";
    return Paging::fetch($sql, $page, $count, "$folderURL/".((!getBlogSetting('useSloganOnCategory',true) && isset($suri['id'])) ? $suri['id'] : $suri['value']));
}

interface/common/blog/entries.php 수정

            if (doesHaveOwnership() && ($entry['userid'] == getUserId() || Acl::check('group.editors')===true)) {
                $managementView = $skin->management;
                $useEncodedURL = false;
                if( isset($service['useEncodedURL'])) {
                    $useEncodedURL = $service['useEncodedURL'];
                }
                dress('s_ad_m_link', "$blogURL/owner/entry/edit/{$entry['id']}?returnURL=" . ($useEncodedURL ? $permalink : str_replace('%2F', '/', rawurlencode($permalink))), $managementView);
                dress('s_ad_m_onclick', "editEntry({$entry['id']},'".($useEncodedURL ? $permalink : str_replace('%2F', '/', rawurlencode($permalink)))."'); return false;", $managementView);
                dress('s_ad_s1_label', getEntryVisibilityName($entry['visibility']), $managementView);
                if ($entry['visibility'] < 2) {
                    dress('s_ad_s2_label', _text('공개로 변경합니다'), $managementView);
                    dress('s_ad_s2_onclick', "changeVisibility({$entry['id']}, 2); return false;", $managementView);
                } else {
                    dress('s_ad_s2_label', _text('비공개로 변경합니다'), $managementView);
                    dress('s_ad_s2_onclick', "changeVisibility({$entry['id']}, 0); return false;", $managementView);
                }
                dress('s_ad_t_onclick', "sendTrackback({$entry['id']}); return false;", $managementView);
                dress('s_ad_d_onclick', "deleteEntry({$entry['id']}); return false;", $managementView);
                
                //== ACEPRO ===============================================
                if($entry['visibility']==0){
                    dress('s_ad_m_visible', "visible private"    , $managementView);
                }else
                if($entry['visibility']==1){
                    dress('s_ad_m_visible', "visible protected"    , $managementView);
                }else
                if($entry['visibility']==2){
                    dress('s_ad_m_visible', "visible public"    , $managementView);
                }else
                if($entry['visibility']==3){
                    dress('s_ad_m_visible', "visible syndicated", $managementView);
                }
                //== ACEPRO ===============================================
                dress('ad_div', $managementView, $entryView);
            }
            $author = User::getName($entry['userid']);
            dress('article_rep_author', fireEvent('ViewPostAuthor', $author, $entry['id']), $entryView);
            dress('article_rep_author_link', $blogURL."/author/".rawurlencode($author), $entryView);
            dress('article_rep_id', $entry['id'], $entryView);
            dress('article_rep_link', $permalink, $entryView);
            dress('article_rep_rp_rssurl', $defaultURL.'/rss/comment/'.$entry['id'], $entryView);
            dress('article_rep_tb_rssurl', $defaultURL.'/rss/trackback/'.$entry['id'], $entryView);
            dress('article_rep_response_rssurl', $defaultURL.'/rss/response/'.$entry['id'], $entryView);
            dress('article_rep_rp_atomurl', $defaultURL.'/atom/comment/'.$entry['id'], $entryView);
            dress('article_rep_tb_atomurl', $defaultURL.'/atom/trackback/'.$entry['id'], $entryView);
            dress('article_rep_response_atomurl', $defaultURL.'/atom/response/'.$entry['id'], $entryView);
            dress('article_rep_category_body_id',getCategoryBodyIdById($blogid,$entry['category']) ? getCategoryBodyIdById($blogid,$entry['category']) : 'tt-body-category',$entryView);
            dress('article_rep_title', htmlspecialchars(fireEvent('ViewPostTitle', $entry['title'], $entry['id'])), $entryView);
            // 사용자가 작성한 본문은 interface/common/blog/end.php의 removeAllTags() 다음에 처리하기 위한 조치.
            $contentContainer["article_{$entry['id']}"] = getEntryContentView($blogid, $entry['id'], $entry['content'], $entry['contentformatter'], getKeywordNames($blogid));
            dress('article_rep_desc', setTempTag("article_{$entry['id']}"), $entryView);
            dress('article_rep_category', htmlspecialchars(empty($entry['category']) ? _text('분류없음') : $entry['categoryLabel'], $entry['id']), $entryView);
            dress('article_rep_category_link', "$blogURL/category/".(empty($entry['category']) ? "" : ($blog['useSloganOnCategory'] ? URL::encode($entry['categoryLabel'],$service['useEncodedURL']) : $entry['category'])),$entryView);
            dress('article_rep_category_rssurl', "$defaultURL/rss/category/".(empty($entry['category']) ? "" : ($blog['useSloganOnCategory'] ? URL::encode($entry['categoryLabel'],$service['useEncodedURL']) : $entry['category'])),$entryView);
            dress('article_rep_category_atomurl', "$defaultURL/atom/category/".(empty($entry['category']) ? "" : ($blog['useSloganOnCategory'] ? URL::encode($entry['categoryLabel'],$service['useEncodedURL']) : $entry['category'])),$entryView);
            dress('article_rep_microformat_published', Timestamp::getISO8601($entry['published']), $entryView);
            dress('article_rep_microformat_updated', Timestamp::getISO8601($entry['modified']), $entryView);
            dress('article_rep_date', fireEvent('ViewPostDate', Timestamp::format5($entry['published']), $entry['published']), $entryView);
            dress('article_rep_date_modified', fireEvent('ViewPostDate', Timestamp::format5($entry['modified']), $entry['modified']), $entryView);
            dress('entry_archive_link', "$blogURL/archive/" . Timestamp::getDate($entry['published']), $entryView);
            //== ACEPRO ===============================================
            dress('article_rep_category_id', empty($entry['category']) ? "" : $entry['category'],$entryView);
            //== ACEPRO ===============================================

skin.html 파일 수정

<s_list> <!-- 글검색(Content) -->
    <div id="searchList">
        <h1>'[##_list_conform_##]'에 관한 글 [##_list_count_##]개</h1>
        <ul>
            <s_list_rep>
                <li>
                    <span class="date [##_list_rep_visible_##]">[##_list_rep_regdate_##]</span>
                    <a href="[##_list_rep_link_##]">[##_list_rep_title_##]</a>
                    <span class="cnt">[##_list_rep_rp_cnt_##]</span>
                </li>
            </s_list_rep>
        </ul>
    </div>
</s_list> 

style.css 파일 수정

아이콘 이미지 파일은 skin/admin/whitedream/image에 있는 아이콘 파일을 이용.

#searchList .date.visible{
    display: inline-block;
    width  : 65px;
    padding-left       : 22px;
    background-repeat  : no-repeat;
}
#searchList .date.public{
    background-image : url("/resources/image/icon/icon_public.gif");
}
#searchList .date.private{
    background-image : url("/resources/image/icon/icon_private.gif");
    background-position: left bottom;
}
#searchList .date.protected{
    background-image : url("/resources/image/icon/icon_protected.gif");
}
#searchList .date.syndicated{
    background-image : url("/resources/image/icon/icon_syndicated.gif");
}

적용결과

사용자 삽입 이미지

2014/01/06 23:47 2014/01/06 23:47
글 걸기 주소 : 이 글에는 트랙백을 보낼 수 없습니다

Textcube 1.9.0에 TinyMCE 4.0.11 적용하기

  1. TinyMCE Downlod : 
    ▷ http://www.tinymce.com/download/download.php
  2. 언어팩 다운로드
    ▷ http://www.tinymce.com/i18n/index.php
  3. 다운받은 파일을 압축 해제후 plugins/ED_tinyMCE/tiny_mce 디렉토리에 업로드 
    (기존파일은 백업후 삭제함)

  4. plugins/ED_tinyMCE/index.php 수정

<?php
function tinyMCE_handleconfig($configVal) {
    $config = Setting::fetchConfigVal($configVal);
    if (isset($config['editormode']) && $config['editormode'] != 'simple' && $config['editormode'] != 'advanced') return false;
    return true;
}

function tinyMCE_editorinit($editor) {
    global $configVal, $entry, $pluginURL;
    $context = Model_Context::getInstance();
    $blogid = getBlogId();
    $config = Setting::fetchConfigVal($configVal);
    if(empty($config['editormode'])) $config['editormode'] = 'simple';
    if(empty($config['width'])) $config['width'] = 'full';
    ob_start();
    ?>
        var editor = new tinymce.Editor('editWindow', {
            language : "ko_KR",
            plugins: [
                "advlist autolink lists link image charmap print preview anchor",
                "searchreplace visualblocks code fullscreen",
                "insertdatetime media table contextmenu paste"
            ],
            toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
            visualblocks_default_state : true           
        }, tinymce.EditorManager);

        editor.initialize = function() {
            this.render();
        };

        editor.addObject = function(data) {
            this.plugins.TTMLsupport.addObject(data);
        };
        editor.finalize = function() {
            this.syncTextarea();
            this.destroy();
        };
        editor.syncTextarea = function(){
            this.save();
        };
        editor.syncEditorWindow = function() {                
            this.load();
        };
        
        editor.on('change', function(e) {
            editorChanged();
        });

        return editor;
    <?php
    $result = ob_get_contents();
    ob_end_clean();
    return $result;
}

function tinyMCE_adminheader($target, $mother) {
    global $suri, $pluginURL;
 $context = Model_Context::getInstance();
    if ($context->getProperty('editor.key') == 'tinyMCE') {
        if ($suri['directive'] == '/owner/entry/post' || $suri['directive'] == '/owner/entry/edit') {
            $target .= "\t<script type=\"text/javascript\" src=\"$pluginURL/tiny_mce/tinymce.js\"></script>\n";
            $target .= "\t<link rel=\"stylesheet\" type=\"text/css\" media=\"screen\" href=\"$pluginURL/override.css\" />\n";
        }
    }
    return $target;
}
?>

2013/12/03 20:10 2013/12/03 20:10
태그 : ,
글 걸기 주소 : 이 글에는 트랙백을 보낼 수 없습니다