コード例 #1
0
ファイル: index.php プロジェクト: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
requireModel('blog.trash');
requireModel('blog.response.remote');
requireModel('blog.sidebar');
requireLibrary('blog.skin');
requireStrictRoute();
$blogid = getBlogId();
$entryId = trashTrackback($blogid, $suri['id']);
if ($entryId !== false) {
    $skin = new Skin($skinSetting['skin']);
    $trackbackCount = getTrackbackCount($blogid, $entryId);
    list($tempTag, $trackbackCountContent) = getTrackbackCountPart($trackbackCount, $skin);
    $recentTrackbackContent = getRecentTrackbacksView(getRecentTrackbacks($blogid), $skin->recentTrackback, $skin->recentTrackbackItem);
    $entry = array();
    $entry['id'] = $entryId;
    $entry['slogan'] = getSloganById($blogid, $entry['id']);
    $trackbackListContent = getTrackbacksView($entry, $skin, true);
}
if ($trackbackListContent === false) {
    Respond::PrintResult(array('error' => 1));
} else {
    Respond::PrintResult(array('error' => 0, 'trackbackList' => $trackbackListContent, 'trackbackCount' => $trackbackCountContent, 'recentTrackbacks' => $recentTrackbackContent));
}
コード例 #2
0
ファイル: index.php プロジェクト: webhacking/Textcube
function pretty_dress($view)
{
    global $blogid, $blog, $database, $service, $stats, $skinSetting;
    $context = Model_Context::getInstance();
    /* local static */
    global $pd_category, $pd_categoryXhtml, $pd_archive, $pd_calendar, $pd_tags, $pd_notices, $pd_recentEntry;
    global $pd_recentComment, $pd_recentTrackback, $pd_link, $pd_authorList;
    if (isset($_REQUEST['safe'])) {
        // safe mode
        return '<div class="coverpage-element-safebox">&hellip;</div>';
    }
    if (isset($_REQUEST['tag'])) {
        // safe mode
        return '<div class="coverpage-element-safebox"><p>' . nl2br(htmlspecialchars($view, ENT_QUOTES)) . '</p></div>';
    }
    $writer = User::getBlogOwnerName($blogid);
    $pageTitle = _t('페이지 제목');
    dress('page_title', htmlspecialchars($pageTitle), $view);
    dress('blogger', htmlspecialchars($writer), $view);
    dress('title', htmlspecialchars($context->getProperty('blog.title')), $view);
    dress('desc', htmlspecialchars($context->getProperty('blog.description')), $view);
    if ($context->getProperty('blog.logo') != null) {
        dress('image', $context->getProperty('service.path') . "/attach/{$blogid}/" . $context->getProperty('blog.logo'), $view);
    } else {
        dress('image', $context->getProperty('service.path') . "/resources/image/spacer.gif", $view);
    }
    dress('blog_link', $context->getProperty('uri.blog') . "/", $view);
    dress('keylog_link', $context->getProperty('uri.blog') . "/keylog", $view);
    dress('localog_link', $context->getProperty('uri.blog') . "/location", $view);
    dress('taglog_link', $context->getProperty('uri.blog') . "/tag", $view);
    dress('guestbook_link', $context->getProperty('uri.blog') . "/guestbook", $view);
    list($view, $searchView) = Skin::cutSkinTag($view, 'search');
    dress('search_name', 'search', $searchView);
    dress('search_text', isset($search) ? htmlspecialchars($search) : '', $searchView);
    dress('search_onclick_submit', 'searchBlog()', $searchView);
    dress('search', '<form id="TTSearchForm" action="' . parseURL($context->getProperty('uri.blog') . '/search/') . '" method="get" onsubmit="return searchBlog()">' . $searchView . '</form>', $view);
    dress('category', $pd_category, $view);
    dress('category_list', $pd_categoryXhtml, $view);
    dress('count_total', $stats['total'], $view);
    dress('count_today', $stats['today'], $view);
    dress('count_yesterday', $stats['yesterday'], $view);
    list($view, $archiveView) = Skin::cutSkinTag($view, 'archive_rep');
    dress('archive_rep', getArchivesView($pd_archive, $archiveView), $view);
    dress('calendar', $pd_calendar, $view);
    list($view, $randomView) = Skin::cutSkinTag($view, 'random_tags');
    dress('random_tags', getRandomTagsView($pd_tags, $randomView), $view);
    list($view, $recentNoticeItem) = Skin::cutSkinTag($view, 'rct_notice_rep');
    list($view, $noticeView) = Skin::cutSkinTag($view, 'rct_notice');
    $notices = $pd_notices;
    if (sizeof($notices) == 0) {
        $notices = array(array('title' => _t('공지 제목'), 'id' => -1));
    }
    if (sizeof($notices) > 0) {
        $itemsView = '';
        foreach ($notices as $notice) {
            $itemView = $recentNoticeItem;
            dress('notice_rep_title', htmlspecialchars(fireEvent('ViewNoticeTitle', Utils_Unicode::lessenAsEm($notice['title'], $skinSetting['recentNoticeLength']), $notice['id'])), $itemView);
            dress('notice_rep_link', "{$context->getProperty}('uri.blog')/notice/{$notice['id']}", $itemView);
            $itemsView .= $itemView;
        }
        dress('rct_notice_rep', $itemsView, $noticeView);
        dress('rct_notice', $noticeView, $view);
    }
    list($view, $authorList) = Skin::cutSkinTag($view, 'author_rep');
    dress('author_rep', getAuthorListView($pd_authorList, $authorList), $view);
    list($view, $recentEntry) = Skin::cutSkinTag($view, 'rctps_rep');
    dress('rctps_rep', getRecentEntriesView($pd_recentEntry, null, $recentEntry), $view);
    list($view, $recentComments) = Skin::cutSkinTag($view, 'rctrp_rep');
    dress('rctrp_rep', getRecentCommentsView($pd_recentComment, null, $recentComments), $view);
    list($view, $recentTrackback) = Skin::cutSkinTag($view, 'rcttb_rep');
    dress('rcttb_rep', getRecentTrackbacksView($pd_recentTrackback, null, $recentTrackback), $view);
    list($view, $s_link_rep) = Skin::cutSkinTag($view, 'link_rep');
    dress('link_rep', getLinksView($pd_link, $s_link_rep), $view);
    dress('rss_url', "{$context->getProperty}('uri.blog')/rss", $view);
    dress('owner_url', "{$context->getProperty}('uri.blog')/owner", $view);
    dress('textcube_name', TEXTCUBE_NAME, $view);
    dress('textcube_version', TEXTCUBE_VERSION, $view);
    $tagSearches = array('@<a @i', '@</a *>@i', '@ id *= *".*"@isU', '@ onkey(down|up|press) *="@i', '@ on(click|load|unload) *="@i', '@<input +@i', '@<script.*</script *>@siU', '@<form @siU', '@</form>@siU');
    $tagReplaces = array('<span ', '</span>', '', ' onnothing="', ' onnothing="', '<input disabled="disabled" ', '', '<div ', '</div>');
    $view = preg_replace($tagSearches, $tagReplaces, $view);
    return correctCoverpageImage($view);
}
コード例 #3
0
ファイル: end.php プロジェクト: webhacking/Textcube
    if (preg_match("@\\[##_rctps_rep_##\\]@iU", $view)) {
        dress('rctps_rep', getRecentEntriesView(getRecentEntries($blogid), null, $skin->recentEntryItem), $view, false, true);
    }
}
if (preg_match("@\\[##_rctrp_##\\]@iU", $view)) {
    dress('rctrp', getRecentCommentsView(getRecentComments($blogid), $skin->recentComment, $skin->recentCommentItem), $view, false, true);
} else {
    if (preg_match("@\\[##_rctrp_rep_##\\]@iU", $view)) {
        dress('rctrp_rep', getRecentCommentsView(getRecentComments($blogid), null, $skin->recentCommentItem), $view, false, true);
    }
}
if (preg_match("@\\[##_rcttb_##\\]@iU", $view)) {
    dress('rcttb', getRecentTrackbacksView(getRecentTrackbacks($blogid), $skin->recentTrackback, $skin->recentTrackbackItem), $view, false, true);
} else {
    if (preg_match("@\\[##_rcttb_rep_##\\]@iU", $view)) {
        dress('rcttb_rep', getRecentTrackbacksView(getRecentTrackbacks($blogid), null, $skin->recentTrackbackItem), $view, false, true);
    }
}
// ETC
if (preg_match("@\\[##_link_rep_##\\]@iU", $view)) {
    dress('link_rep', getLinksView(getLinks($blogid), $skin->link_rep), $view, false, true);
}
if (preg_match("@\\[##_link_list_##\\]@iU", $view)) {
    dress('link_list', getLinkListView(getLinks($blogid)), $view, false, true);
}
if (preg_match("@\\[##_paging_##\\]@iU", $view)) {
    if (isset($paging)) {
        if (isset($cache) && strpos($cache->name, 'Paging') !== false) {
            if ($cache->load()) {
                $pagingView = $cache->contents;
            } else {