Example #1
0
function printFeedEntry($blogid, $group = 0, $feed = 0, $entry = 0, $unreadOnly = false, $starredOnly = false, $searchKeyword = null, $position = 'current')
{
    if (!($entry = getFeedEntry($blogid, $group, $feed, $entry, $unreadOnly, $starredOnly, $searchKeyword, $position))) {
        $entry = array('id' => 0, 'author' => 'Textcube', 'blog_title' => 'Textcube Reader', 'permalink' => '#', 'entry_title' => _t('포스트가 없습니다.'), 'language' => 'en-US', 'description' => '<div style="height: 369px"></div>', 'tags' => '', 'enclosure' => '', 'written' => time());
    }
    ?>
    <div id="entryHead">
        <div class="title"><a href="<?php 
    echo htmlspecialchars($entry['permalink']);
    ?>
"
                              onclick="window.open(this.href); return false;"><?php 
    echo htmlspecialchars($entry['entry_title']);
    ?>
</a>
        </div>
        <div class="writing-info"><span class="by">by </span><span
                class="name"><?php 
    echo htmlspecialchars($entry['author'] ? preg_replace('/^\\((.+)\\)$/', '$1', $entry['author']) : $entry['blog_title']);
    ?>
</span><span
                class="divider"> : </span><span
                class="date"><?php 
    echo date('Y-m-d H:i:s', $entry['written']);
    ?>
</span></div>
        <div class="open"><a id="entryPermalink" href="<?php 
    echo htmlspecialchars($entry['permalink']);
    ?>
"
                             onclick="window.open(this.href); return false;"
                             title="<?php 
    echo _t('이 포스트를 새 창으로 엽니다.');
    ?>
"><span
                    class="text"><?php 
    echo _t('새 창으로');
    ?>
</span></a></div>
    </div>

    <div id="entryBody" xml:lang="<?php 
    echo htmlspecialchars($entry['language']);
    ?>
">
        <?php 
    if ($entry['enclosure']) {
        if (preg_match('/\\.mp3$/i', $entry['enclosure'])) {
            ?>
                <p><span class="podcast-icon bullet"><span class="text"><?php 
            echo _t('팟캐스트');
            ?>
</span></span><a
                        href="<?php 
            echo htmlspecialchars($entry['enclosure']);
            ?>
"><?php 
            echo htmlspecialchars($entry['enclosure']);
            ?>
</a>
                </p>
            <?php 
        } else {
            ?>
                <p><span class="podcast-icon bullet"><span class="text"><?php 
            echo _t('팟캐스트');
            ?>
</span></span><a
                        href="<?php 
            echo htmlspecialchars($entry['enclosure']);
            ?>
"><?php 
            echo htmlspecialchars($entry['enclosure']);
            ?>
</a>
                </p>
            <?php 
        }
    }
    ?>
        <?php 
    echo $entry['description'];
    ?>
    </div>

    <script type="text/javascript">
        Reader.selectedEntry = <?php 
    echo escapeJSInAttribute($entry['id']);
    ?>
;
        Reader.setBlogTitle("<?php 
    echo escapeJSInAttribute($entry['blog_title']);
    ?>
");
        Reader.doPostProcessingOnEntry();
    </script>

    <div id="entryFoot">
        <?php 
    if ($entry['tags']) {
        ?>
            <div id="entryTag">
                <span class="title"><?php 
        echo htmlspecialchars(_t('태그'));
        ?>
</span><span
                    class="divider"> : </span><span class="tags"><?php 
        echo htmlspecialchars($entry['tags']);
        ?>
</span>
            </div>
        <?php 
    }
    ?>
        <div class="button-box">
            <a class="non-read-button button input-button" href="#void"
               onclick="Reader.markAsUnread(<?php 
    echo $entry['id'];
    ?>
)"><span
                    class="text"><?php 
    echo _t('안 읽은 글로 표시');
    ?>
</span></a>
        </div>
        <div class="shortcut-box">
            <ul>
                <li><kbd>A</kbd>, <kbd>H</kbd> - <?php 
    echo _t('이전 글');
    ?>
</li>
                <li><kbd>S</kbd>, <kbd>L</kbd> - <?php 
    echo _t('다음 글');
    ?>
</li>
                <li><kbd>D</kbd> - <?php 
    echo _t('새 창으로');
    ?>
</li>
                <li><kbd>F</kbd> - <?php 
    echo _t('안 읽은 글만보기');
    ?>
</li>
                <li><kbd>G</kbd> - <?php 
    echo _t('스크랩된 글 보기');
    ?>
</li>
                <li><kbd>W</kbd> - <?php 
    echo _t('현재글 스크랩');
    ?>
</li>
                <li><kbd>T</kbd> - <?php 
    echo _t('글 수집하기');
    ?>
</li>
                <li><kbd>J</kbd> - <?php 
    echo _t('위로 스크롤');
    ?>
</li>
                <li class="last-shortcut"><kbd>K</kbd> - <?php 
    echo _t('아래로 스크롤');
    ?>
</li>
            </ul>
        </div>
    </div>
<?php 
}
Example #2
0
if (isGET('comments')) {
    $out['title'] = $lang['comments'];
    $out['type'] = 'comments';
    $items = listEntry('comments');
    rsort($items);
    $items = array_slice($items, 0, 100);
    if ($items) {
        foreach ($items as $item) {
            $itemData = readEntry('comments', $item);
            $parentData = readEntry('posts', $itemData['post']);
            $title = clean($itemData['commenter'] . $lang['commented'] . $parentData['title']);
            $url = $out['baseURL'] . 'view.php?post=' . $itemData['post'] . '/pages/' . pageOf($item, $parentData['comments']) . '#' . $item;
            $out['content'] .= getFeedEntry($title, $url, toDate($item, 'c'), content($itemData['content']));
        }
    }
} else {
    $out['title'] = $lang['posts'];
    $out['type'] = 'posts';
    $items = listEntry('posts');
    rsort($items);
    $items = array_slice($items, 0, 100);
    if ($items) {
        foreach ($items as $item) {
            $itemData = readEntry('posts', $item);
            $title = clean($itemData['title']);
            $url = $out['baseURL'] . 'view.php?post=' . $item;
            $out['content'] .= getFeedEntry($title, $url, toDate($item, 'c'), $itemData['content'], $itemData['tags']);
        }
    }
}
require 'templates/feed.php';
Example #3
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('group' => array('int', 'min' => 0, 'default' => 0), 'feed' => array('int', 'min' => 0, 'default' => 0), 'unread' => array(array('0', '1')), 'starred' => array(array('0', '1')), 'keyword' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
$result = array('error' => '0');
ob_start();
$count = printFeedEntries($blogid, $_POST['group'], $_POST['feed'], $_POST['unread'] == '1', $_POST['starred'] == '1', $_POST['keyword'] == '' ? null : $_POST['keyword']);
$result['view'] = escapeCData(ob_get_contents());
ob_end_clean();
$entry = getFeedEntry($blogid, $_POST['group'], $_POST['feed'], 0, $_POST['unread'] == '1', $_POST['starred'] == '1', $_POST['keyword'] == '' ? null : $_POST['keyword']);
$result['firstEntryId'] = $entry['id'];
$result['entriesShown'] = $count;
$result['entriesTotal'] = getFeedEntriesTotalCount($blogid, $_POST['group'], $_POST['feed'], $_POST['unread'] == '1', $_POST['starred'] == '1', $_POST['keyword'] == '' ? null : $_POST['keyword']);
Respond::PrintResult($result);
Example #4
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('group' => array('int', 0), 'feed' => array('int', 0, 'default' => 0), 'entry' => array('int', 0, 'default' => 0), 'unread' => array(array('0', '1')), 'starred' => array(array('0', '1')), 'keyword' => array('string', 'default' => '')));
require ROOT . '/library/preprocessor.php';
$result = array('error' => '0');
$entry = getFeedEntry($blogid, $_POST['group'], $_POST['feed'], $_POST['entry'], $_POST['unread'] == '1', $_POST['starred'] == '1', $_POST['keyword'] == '' ? null : $_POST['keyword'], 'before', 'unread');
if (is_null($entry) || $entry === false) {
    Respond::PrintResult(array('error' => '0', 'id' => '0'));
}
$result['id'] = $entry['id'];
Respond::PrintResult($result);