Example #1
0
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);
}
Example #2
0
                    $pool->setQualifier('visibility', 'equals', 3);
                    $pool->setQualifier('acceptcomment', 'equals', 1);
                    $row = $pool->getAll('*');
                    if (!empty($row)) {
                        sendCommentPing($entryId, $context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$row['slogan']}" : $entryId), is_null($user) ? $comment['name'] : $user['name'], is_null($user) ? $comment['homepage'] : $user['homepage']);
                    }
                }
                importlib('model.blog.skin');
                $skin = new Skin($context->getProperty('skin.skin'));
                if ($entryId > 0) {
                    $commentBlock = getCommentView($entry, $skin);
                    dress('article_rep_id', $entryId, $commentBlock);
                    $commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
                    $recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), null, $skin->recentCommentItem)));
                    $commentCount = getCommentCount($blogid, $entryId);
                    $commentCount = $commentCount > 0 ? $commentCount : 0;
                    list($tempTag, $commentView) = getCommentCountPart($commentCount, $skin);
                } else {
                    $commentView = '';
                    $commentBlock = getCommentView($entry, $skin);
                    dress('article_rep_id', $entryId, $commentBlock);
                    $commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
                    $commentCount = 0;
                    $recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), $skin->recentComment, $skin->recentCommentItem)));
                }
                Respond::PrintResult(array('error' => 0, 'commentView' => $commentView, 'commentCount' => $commentCount, 'commentBlock' => $commentBlock, 'recentCommentBlock' => $recentCommentBlock));
                exit;
            }
        }
    }
}
Example #3
0
                $skin = new Skin($context->getProperty('skin.skin'));
                printHtmlHeader();
                ?>
<script type="text/javascript">
	//<![CDATA[
		alert("<?php 
                echo _text('댓글이 등록되었습니다.');
                ?>
");
<?php 
                notifyComment();
                $entry = array();
                $entry['id'] = $comment['entry'];
                $entry['slogan'] = getSloganById($blogid, $entry['id']);
                $tempComments = revertTempTags(removeAllTags(getCommentView($entry, $skin)));
                $tempRecentComments = revertTempTags(getRecentCommentsView(getRecentComments($blogid), null, $skin->recentCommentItem));
                ?>
		if (opener == null) {
			loader = parent;
		} else {
			loader = opener;
		}
		try {
			var obj = loader.document.getElementById("entry<?php 
                echo $comment['entry'];
                ?>
Comment");
			obj.innerHTML = "<?php 
                echo str_innerHTML($tempComments);
                ?>
";
Example #4
0
if (preg_match("@\\[##_author_rep_##\\]@iU", $view)) {
    dress('author_rep', getAuthorListView(User::getUserNamesOfBlog($blogid), $skin->authorList), $view, false, true);
}
// Recent items
if (preg_match("@\\[##_rctps_##\\]@iU", $view)) {
    dress('rctps', getRecentEntriesView(getRecentEntries($blogid), $skin->recentEntry, $skin->recentEntryItem), $view, false, true);
} else {
    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);