Exemplo n.º 1
0
function KeywordUI_bindTag($target, $mother)
{
    global $blogURL, $pluginURL, $configVal;
    requireModel('blog.keyword');
    $blogid = getBlogId();
    if (isset($mother) && isset($target)) {
        $tagsWithKeywords = array();
        $keywordNames = getKeywordNames($blogid);
        foreach ($target as $tag => $tagLink) {
            if (in_array($tag, $keywordNames) == true) {
                $tagsWithKeywords[$tag] = $tagLink . "<a href=\"#\" class=\"key1\" onclick=\"openKeyword('{$blogURL}/keylog/" . URL::encode($tag) . "'); return false\"><img src=\"" . $pluginURL . "/images/flag_green.gif\" alt=\"Keyword " . $tag . "\"/></a>";
            } else {
                $tagsWithKeywords[$tag] = $tagLink;
            }
        }
        $target = $tagsWithKeywords;
    }
    return $target;
}
Exemplo n.º 2
0
function KeywordUI_bindTag($target, $mother)
{
    $context = Model_Context::getInstance();
    importlib('model.blog.keyword');
    $blogid = getBlogId();
    $blogURL = $context->getProperty("uri.blog");
    $pluginURL = $context->getProperty("plugin.uri");
    if (isset($mother) && isset($target)) {
        $tagsWithKeywords = array();
        $keywordNames = getKeywordNames($blogid);
        foreach ($target as $tag => $tagLink) {
            if (in_array($tag, $keywordNames) == true) {
                $tagsWithKeywords[$tag] = $tagLink . "<a href=\"#\" class=\"key1\" onclick=\"openKeyword('{$blogURL}/keylog/" . URL::encode($tag) . "'); return false\"><img src=\"" . $pluginURL . "/images/flag_green.gif\" alt=\"Keyword " . $tag . "\"/></a>";
            } else {
                $tagsWithKeywords[$tag] = $tagLink;
            }
        }
        $target = $tagsWithKeywords;
    }
    return $target;
}
Exemplo n.º 3
0
<?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)
define('__TEXTCUBE_KEYLOG__', true);
require ROOT . '/library/preprocessor.php';
if (strlen($suri['value'])) {
    if (!($keylog = getKeylogByTitle($blogid, $suri['value']))) {
        Respond::ErrorPage();
        exit;
    }
    $entries = array();
    $entries = getEntriesByKeyword($blogid, $keylog['title']);
    $skinSetting['keylogSkin'] = fireEvent('setKeylogSkin');
    if (!is_null($skinSetting['keylogSkin'])) {
        require ROOT . '/interface/common/blog/keylog.php';
    } else {
        Respond::ErrorPage(_t('No handling plugin'));
    }
} else {
    $keywords = getKeywordNames($blogid, true);
    $skinSetting['keylogSkin'] = fireEvent('setKeylogSkin');
    require ROOT . '/interface/common/blog/begin.php';
    require ROOT . '/interface/common/blog/keywords.php';
    require ROOT . '/interface/common/blog/end.php';
}
Exemplo n.º 4
0
function sendTrackback($blogid, $entryId, $url)
{
    global $defaultURL, $blog;
    requireModel('blog.entry');
    requireModel('blog.keyword');
    $entry = getEntry($blogid, $entryId);
    if (is_null($entry)) {
        return false;
    }
    $link = "{$defaultURL}/{$entryId}";
    $title = htmlspecialchars($entry['title']);
    $entry['content'] = getEntryContentView($blogid, $entryId, $entry['content'], $entry['contentformatter'], getKeywordNames($blogid));
    $excerpt = str_tag_on(UTF8::lessen(removeAllTags(stripHTML($entry['content'])), 255));
    $blogTitle = $blog['title'];
    $isNeedConvert = strpos($url, '/rserver.php?') !== false || strpos($url, 'blog.naver.com/tb') !== false || strpos($url, 'news.naver.com/tb/') !== false || strpos($url, 'blog.empas.com') !== false || strpos($url, 'blog.yahoo.com') !== false || strpos($url, 'www.blogin.com/tb/') !== false || strpos($url, 'cytb.cyworld.nate.com') !== false || strpos($url, 'www.cine21.com/Movies/tb.php') !== false;
    if ($isNeedConvert) {
        $title = UTF8::convert($title, 'EUC-KR');
        $excerpt = UTF8::convert($excerpt, 'EUC-KR');
        $blogTitle = UTF8::convert($blogTitle, 'EUC-KR');
        $content = "url=" . rawurlencode($link) . "&title=" . rawurlencode($title) . "&blog_name=" . rawurlencode($blogTitle) . "&excerpt=" . rawurlencode($excerpt);
        $request = new HTTPRequest('POST', $url);
        $request->contentType = 'application/x-www-form-urlencoded; charset=euc-kr';
        $isSuccess = $request->send($content);
    } else {
        $content = "url=" . rawurlencode($link) . "&title=" . rawurlencode($title) . "&blog_name=" . rawurlencode($blogTitle) . "&excerpt=" . rawurlencode($excerpt);
        $request = new HTTPRequest('POST', $url);
        $request->contentType = 'application/x-www-form-urlencoded; charset=utf-8';
        $isSuccess = $request->send($content);
    }
    if ($isSuccess && checkResponseXML($request->responseText) === 0) {
        //		$url = POD::escapeString(UTF8::lessenAsEncoding($url, 255));
        $trackbacklog = new TrackbackLog();
        $trackbacklog->entry = $entryId;
        $trackbacklog->url = POD::escapeString(UTF8::lessenAsEncoding($url, 255));
        $trackbacklog->add();
        //		POD::query("INSERT INTO {$database['prefix']}TrackbackLogs VALUES ($blogid, '', $entryId, '$url', UNIX_TIMESTAMP())");
        return true;
    }
    return false;
}
Exemplo n.º 5
0
function sendTrackback($blogid, $entryId, $url)
{
    importlib('model.blog.entry');
    importlib('model.blog.keyword');
    $context = Model_Context::getInstance();
    $entry = getEntry($blogid, $entryId);
    if (is_null($entry)) {
        return false;
    }
    $link = $context->getProperty('uri.default') . "/" . $entryId;
    $title = htmlspecialchars($entry['title']);
    $entry['content'] = getEntryContentView($blogid, $entryId, $entry['content'], $entry['contentformatter'], getKeywordNames($blogid));
    $excerpt = str_tag_on(Utils_Unicode::lessen(removeAllTags(stripHTML($entry['content'])), 255));
    $blogTitle = $context->getProperty('blog.title');
    $isNeedConvert = strpos($url, '/rserver.php?') !== false || strpos($url, 'blog.naver.com/tb') !== false || strpos($url, 'news.naver.com/tb/') !== false || strpos($url, 'blog.empas.com') !== false || strpos($url, 'blog.yahoo.com') !== false || strpos($url, 'www.blogin.com/tb/') !== false || strpos($url, 'cytb.cyworld.nate.com') !== false || strpos($url, 'www.cine21.com/Movies/tb.php') !== false;
    if ($isNeedConvert) {
        $title = Utils_Unicode::convert($title, 'EUC-KR');
        $excerpt = Utils_Unicode::convert($excerpt, 'EUC-KR');
        $blogTitle = Utils_Unicode::convert($blogTitle, 'EUC-KR');
        $content = "url=" . rawurlencode($link) . "&title=" . rawurlencode($title) . "&blog_name=" . rawurlencode($blogTitle) . "&excerpt=" . rawurlencode($excerpt);
        $request = new HTTPRequest('POST', $url);
        $request->contentType = 'application/x-www-form-urlencoded; charset=euc-kr';
        $isSuccess = $request->send($content);
    } else {
        $content = "url=" . rawurlencode($link) . "&title=" . rawurlencode($title) . "&blog_name=" . rawurlencode($blogTitle) . "&excerpt=" . rawurlencode($excerpt);
        $request = new HTTPRequest('POST', $url);
        $request->contentType = 'application/x-www-form-urlencoded; charset=utf-8';
        $isSuccess = $request->send($content);
    }
    if ($isSuccess && checkResponseXML($request->responseText) === 0) {
        $trackbacklog = new TrackbackLog();
        $trackbacklog->entry = $entryId;
        $trackbacklog->url = Utils_Unicode::lessenAsEncoding($url, 255);
        $trackbacklog->add();
        return true;
    }
    return false;
}
Exemplo n.º 6
0
 }
 $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', $context->getProperty('uri.default') . '/rss/comment/' . $entry['id'], $entryView);
 dress('article_rep_tb_rssurl', $context->getProperty('uri.default') . '/rss/trackback/' . $entry['id'], $entryView);
 dress('article_rep_response_rssurl', $context->getProperty('uri.default') . '/rss/response/' . $entry['id'], $entryView);
 dress('article_rep_rp_atomurl', $context->getProperty('uri.default') . '/atom/comment/' . $entry['id'], $entryView);
 dress('article_rep_tb_atomurl', $context->getProperty('uri.default') . '/atom/trackback/' . $entry['id'], $entryView);
 dress('article_rep_response_atomurl', $context->getProperty('uri.default') . '/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', $context->getProperty('uri.blog') . "/category/" . (empty($entry['category']) ? "" : ($blog['useSloganOnCategory'] ? URL::encode($entry['categoryLabel'], $service['useEncodedURL']) : $entry['category'])), $entryView);
 dress('article_rep_category_rssurl', $context->getProperty('uri.default') . "/rss/category/" . (empty($entry['category']) ? "" : ($blog['useSloganOnCategory'] ? URL::encode($entry['categoryLabel'], $service['useEncodedURL']) : $entry['category'])), $entryView);
 dress('article_rep_category_atomurl', $context->getProperty('uri.default') . "/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', $context->getProperty('uri.blog') . "/archive/" . Timestamp::getDate($entry['published']), $entryView);
 if ($entry['acceptcomment'] || $entry['comments'] > 0) {
     dress('article_rep_rp_link', "loadComment({$entry['id']},1,false,false); return false", $entryView);
 } else {
     dress('article_rep_rp_link', "return false", $entryView);
 }
Exemplo n.º 7
0
requireView('mobileView');
if (empty($suri['id'])) {
    list($entry, $paging) = getEntriesWithPaging($blogid, 1, 1);
    if (empty($entry)) {
        printMobileErrorPage(_text('페이지 오류'), _text('글이 하나도 없습니다.'), $blogURL);
    } else {
        header("Location: {$blogURL}/{$entry[0]['id']}");
    }
} else {
    list($entries, $paging) = getEntryWithPaging($blogid, $suri['id']);
    $entry = $entries ? $entries[0] : null;
    printMobileHtmlHeader();
    ?>
	<div id="content">
		<h2><?php 
    echo htmlspecialchars($entry['title']);
    ?>
</h2>	
		<hr />
		<?php 
    printMobileEntryContentView($blogid, $entry, getKeywordNames($blogid));
    ?>
	</div>
<?php 
    if (doesHaveOwnership() || $entry['visibility'] >= 2 || isset($_COOKIE['GUEST_PASSWORD']) && trim($_COOKIE['GUEST_PASSWORD']) == trim($entry['password'])) {
        printMobileNavigation($entry, true, true, $paging);
    } else {
        printMobileNavigation($entry, false, false, $paging);
    }
    printMobileHtmlFooter();
}