예제 #1
0
파일: index.php 프로젝트: ragi79/Textcube
function FM_TTML_summary($blogid, $id, $content, $keywords = array(), $useAbsolutePath = true)
{
    global $blog;
    $view = FM_TTML_format($blogid, $id, $content, $keywords, $useAbsolutePath, true);
    if (!$blog['publishWholeOnRSS']) {
        $view = Utils_Unicode::lessen(removeAllTags(stripHTML($view)), 255);
    }
    return $view;
}
예제 #2
0
function FM_Textile_summary($blogid, $id, $content, $keywords = array(), $useAbsolutePath = true)
{
    $context = Model_Context::getInstance();
    $view = FM_Textile_format($blogid, $id, $content, $keywords, $useAbsolutePath, true);
    if (!$context->getProperty("blog.publishWholeOnRSS")) {
        $view = Utils_Unicode::lessen(removeAllTags(stripHTML($view)), 255);
    }
    return $view;
}
예제 #3
0
파일: module.php 프로젝트: ni5am/Textcube
function FM_default_summary($blogid, $id, $content, $keywords = array(), $useAbsolutePath = false)
{
    $context = Model_Context::getInstance();
    if (!$context->getProperty('blog.publishWholeOnRSS')) {
        $content = Utils_Unicode::lessen(removeAllTags(stripHTML($content)), 255);
    }
    return $content;
}
예제 #4
0
 static function changeBlog()
 {
     global $database, $blogURL, $blog, $service;
     $blogid = getBlogId();
     $blogList = User::getBlogs();
     if (count($blogList) == 0) {
         return;
     }
     $changeBlogView = str_repeat(TAB, 6) . "<select id=\"blog-list\" onchange=\"location.href='{$blogURL}/owner/network/teamblog/changeBlog/?blogid='+this.value\">" . CRLF;
     foreach ($blogList as $info) {
         $title = Utils_Unicode::lessen(Setting::getBlogSettingGlobal("title", null, $info, true), 30);
         $title = $title ? $title : _f('%1 님의 블로그', User::getBlogOwnerName($info));
         $changeBlogView .= str_repeat(TAB, 7) . '<option value="' . $info . '"';
         if ($info == $blogid) {
             $changeBlogView .= ' selected="selected"';
         }
         $changeBlogView .= '>' . $title . '</option>' . CRLF;
     }
     $changeBlogView .= str_repeat(TAB, 6) . '</select>' . CRLF;
     return $changeBlogView;
 }
예제 #5
0
function FM_default_summary($blogid, $id, $content, $keywords = array(), $useAbsolutePath = false)
{
    if (!$blog['publishWholeOnRSS']) {
        $content = Utils_Unicode::lessen(removeAllTags(stripHTML($content)), 255);
    }
    return $content;
}
예제 #6
0
파일: index.php 프로젝트: ragi79/Textcube
        // Guestbook case
        if (empty($comment['parent'])) {
            echo '<span class="explain">' . _t('방명록') . '</span>';
        } else {
            echo '<span class="explain">' . _f('%1 님의 방명록에 대한 댓글', $comment['parentName']) . '</span>';
        }
    } else {
        echo empty($comment['parent']) ? '' : '<span class="explain">' . _f('%1 님의 댓글에 대한 댓글', $comment['parentName']) . '</span>';
    }
    echo "</a>";
    ?>
												<?php 
    echo !empty($comment['title']) || !empty($comment['parent']) ? '<br />' : '';
    ?>
												<?php 
    echo htmlspecialchars(Utils_Unicode::lessen($comment['comment'], 80));
    ?>
											</td>
											<td class="ip">
<?php 
    if ($isIpFiltered) {
        ?>
												<a id="ipFilter<?php 
        echo $currentIP;
        ?>
-<?php 
        echo $i;
        ?>
" class="block-icon bullet" href="<?php 
        echo $context->getProperty('uri.blog');
        ?>
예제 #7
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;
}
예제 #8
0
 static function changeBlog()
 {
     $context = Model_Context::getInstance();
     $blogList = User::getBlogs();
     if (count($blogList) == 0) {
         return;
     }
     $changeBlogView = str_repeat(TAB, 6) . "<select id=\"blog-list\" onchange=\"location.href='" . $context->getProperty("uri.blog") . "/owner/network/teamblog/changeBlog/?blogid='+this.value\">" . CRLF;
     foreach ($blogList as $info) {
         $title = Utils_Unicode::lessen(Setting::getBlogSettingGlobal("title", null, $info, true), 30);
         $title = $title ? $title : _f('%1 님의 블로그', User::getBlogOwnerName($info));
         $changeBlogView .= str_repeat(TAB, 7) . '<option value="' . $info . '"';
         if ($info == $context->getProperty('blog.id')) {
             $changeBlogView .= ' selected="selected"';
         }
         $changeBlogView .= '>' . $title . '</option>' . CRLF;
     }
     $changeBlogView .= str_repeat(TAB, 6) . '</select>' . CRLF;
     return $changeBlogView;
 }
예제 #9
0
파일: feed.php 프로젝트: Avantians/Textcube
function getCommentFeedTotal($blogid, $rawMode = false, $mode = 'rss')
{
    $context = Model_Context::getInstance();
    $channel = initializeRSSchannel($blogid);
    $channel['title'] = $context->getProperty('blog.title') . ': ' . _text('최근 댓글 목록');
    $result = getRecentComments($blogid, Setting::getBlogSettingGlobal('commentsOnRSS', 20), false, true);
    if (!$result) {
        $result = array();
    }
    $channel['items'] = array();
    foreach ($result as $row) {
        $commentURL = $context->getProperty('uri.default') . "/" . $row['entry'] . "#comment";
        $content = htmlspecialchars($row['comment']);
        $item = array('id' => $row['id'], 'title' => RSSMessage(Utils_Unicode::lessen($row['title'], 30) . ' : ' . _textf('%1님의 댓글', $row['name'])), 'link' => $commentURL . $row['id'], 'categories' => array(), 'description' => RSSMessage($content), 'author' => RSSMessage($row['name']), 'pubDate' => $row['written'], 'comments' => $commentURL, 'guid' => $commentURL . $row['id']);
        if ($row['secret']) {
            $item['title'] = $item['author'] = $item['description'] = _text('비밀 댓글입니다');
        }
        array_push($channel['items'], $item);
    }
    if ($rawMode == true) {
        return $channel['items'];
    }
    $rss = array('channel' => $channel);
    if ($mode == 'rss') {
        return publishRSS($blogid, $rss);
    } else {
        if ($mode == 'atom') {
            return publishATOM($blogid, $rss);
        }
    }
    return false;
}
예제 #10
0
" class="<?php 
    echo $className;
    ?>
 inactive-class" onmouseover="rolloverClass(this, 'over')" onmouseout="rolloverClass(this, 'out')">
		<td class="xfn-homepage">
			<a href="<?php 
    echo $context->getProperty('uri.blog');
    ?>
/owner/network/link/edit/<?php 
    echo $link['id'];
    ?>
" title="<?php 
    echo htmlspecialchars($link['url']);
    ?>
"><?php 
    echo htmlspecialchars(Utils_Unicode::lessen($link['name'], 12));
    ?>
</a>
			<input type="hidden" name="xfn<?php 
    echo $link['id'];
    ?>
" id="xfn_id_<?php 
    echo $link['id'];
    ?>
" value="<?php 
    echo $xfn;
    ?>
"/>
		</td>

		<td class="xfn-edit">
예제 #11
0
파일: Unicode.php 프로젝트: ragi79/Textcube
 static function lessenAsEncoding($str, $length = 255, $tail = '...')
 {
     $context = Model_Context::getInstance();
     if ($context->getProperty('database.utf8') != true) {
         return Utils_Unicode::lessen($str, $length, $tail);
     } else {
         return Utils_Unicode::lessenAsByte($str, $length, $tail);
     }
 }
function utf8Lessen($str, $length, $tail = '..')
{
    return Utils_Unicode::lessen($str, $length, $tail);
}