コード例 #1
0
ファイル: iphoneView.php プロジェクト: ragi79/Textcube
function printMobileEntryListView($entries, $listid, $title, $paging, $count = 0, $header = true)
{
    $context = Model_Context::getInstance();
    $itemsView = '<ul data-role="listview" class="posts" id="' . $listid . '" title="' . $title . '" selected="false" data-inset="true">' . CRLF;
    if ($header) {
        $itemsView .= '<li class="group ui-bar ui-bar-e">' . CRLF;
        $itemsView .= '	<h3>' . $title . '</h3>' . CRLF;
        $itemsView .= '	<span class="ui-li-count">' . $count . '</span>' . CRLF;
        $itemsView .= '	<span class="ui-li-aside">' . _text('페이지') . ' ' . $paging['page'] . ' / ' . $paging['pages'] . '</span>' . CRLF;
        $itemsView .= '</li>' . CRLF;
    }
    foreach ($entries as $item) {
        $author = User::getName($item['userid']);
        if ($imageName = printMobileAttachmentExtract($item['content'])) {
            $imageSrc = printMobileImageResizer($context->getProperty('blog.id'), $imageName, 80);
        } else {
            $imageSrc = $context->getProperty('service.path') . '/resources/style/iphone/images/noPostThumb.png';
        }
        $itemsView .= '<li data-role="list-divider" role="heading" class="ui-li ui-li-divider ui-bar-b ui-btn-up-c" style="font-size:8pt;font-weight:normal">';
        $itemsView .= '	' . Timestamp::format5($item['published']) . '</li>' . CRLF;
        $itemsView .= '<li class="post_item">' . CRLF;
        $itemsView .= '	<a href="' . $context->getProperty('uri.blog') . '/entry/' . $item['id'] . '" class="link">' . CRLF;
        $itemsView .= '	<img src="' . $imageSrc . '"  />' . CRLF;
        $itemsView .= '	<h3>' . fireEvent('ViewListTitle', htmlspecialchars($item['title'])) . '</h3>' . CRLF;
        $itemsView .= '	<p class="ui-li-count"> ' . _textf('댓글 %1개', $item['comments'] > 0 ? $item['comments'] : 0) . '</p>' . CRLF;
        if (!empty($item['content'])) {
            $itemsView .= '	<p>' . htmlspecialchars(Utils_Unicode::lessenAsEm(removeAllTags(stripHTML($item['content'])), 150)) . '</p>' . CRLF;
        }
        $itemsView .= '	</a>' . CRLF;
        $itemsView .= '</li>' . CRLF;
    }
    $itemsView .= '</ul>' . CRLF;
    return $itemsView;
}
コード例 #2
0
ファイル: index.php プロジェクト: ragi79/Textcube
requireView('iphoneView');
if (empty($suri['id'])) {
    printMobileHTMLHeader();
    ?>
	
	<div data-role="page">
<?php 
    printMobileHTMLMenu('', 'list');
    ?>
	<ul data-role="listview" id="home" title="<?php 
    echo htmlspecialchars(Utils_Unicode::lessenAsEm($context->getProperty('blog.title'), 30));
    ?>
" selected="true">
	<?php 
    $blogAuthor = User::getBlogOwnerName($blogid);
    $blogLogo = !is_null($context->getProperty('blog.logo')) && $context->getProperty('blog.logo') != "" ? printMobileImageResizer($blogid, $context->getProperty('blog.logo'), 80) : $context->getProperty('service.path') . "/resources/style/iphone/images/textcube_logo.png";
    $itemsView = '<li class="blog_info">' . CRLF;
    $itemsView .= '	<div class="logo"><img src="' . $blogLogo . '" /></div>' . CRLF;
    $itemsView .= '	<div class="blog_container">' . CRLF;
    $itemsView .= '		<span class="title">' . htmlspecialchars($context->getProperty('blog.title')) . '</span>' . CRLF;
    $itemsView .= '		<span class="author">by ' . $blogAuthor . '</span>' . CRLF;
    $itemsView .= '		<span class="description">' . htmlspecialchars($context->getProperty('blog.description')) . '</span>' . CRLF;
    $itemsView .= '	</div>' . CRLF;
    $itemsView .= '</li>' . CRLF;
    print $itemsView;
    // Recent posts
    if ($listWithPaging = getEntriesWithPaging($blogid, 1, 3)) {
        $list = $listWithPaging[0];
        $paging = $listWithPaging[1];
        $list = array('title' => '', 'items' => $listWithPaging[0], 'count' => $listWithPaging[1]['total']);
        print '<li data-role="list-divider" class="group">' . _text('최근 글') . '</li>' . CRLF;
コード例 #3
0
ファイル: index.php プロジェクト: ragi79/Textcube
	<ul data-role="listview" class="search" id="search_<?php 
    echo $suri['page'];
    ?>
" title="<?php 
    echo _text('검색 결과');
    ?>
" selected="false" data-inset="true">
	<?php 
    $itemsView = '<li class="group ui-bar ui-bar-e">' . CRLF;
    $itemsView .= '	<span class="left">' . htmlspecialchars($search) . ' ' . _text('검색 결과') . '(' . $list['count'] . ')</span>' . CRLF;
    $itemsView .= '	<span class="right ui-li-aside">' . _text('페이지') . '<span class="now_page">' . $paging['page'] . '</span> / ' . $paging['pages'] . '</span>' . CRLF;
    $itemsView .= '</li>' . CRLF;
    foreach ($list['items'] as $item) {
        $author = User::getName($item['userid']);
        if ($imageName = printMobileAttachmentExtract(printMobileEntryContent($blogid, $item['userid'], $item['id']))) {
            $imageSrc = printMobileImageResizer($blogid, $imageName, 80);
        } else {
            $imageSrc = $service['path'] . '/resources/style/iphone/image/noPostThumb.png';
        }
        $itemsView .= '<li class="post_item">' . CRLF;
        $itemsView .= '	<a href="' . $context->getProperty('uri.blog') . '/entry/' . $item['id'] . '" class="link">' . CRLF;
        $itemsView .= '	<img src="' . $imageSrc . '"  />' . CRLF;
        $itemsView .= '	<h3>' . fireEvent('ViewListTitle', htmlspecialchars($item['title'])) . '</h3>' . CRLF;
        $itemsView .= '	<p>' . Timestamp::format5($item['published']) . '</span><span class="ui-li-count"> ' . _textf('댓글 %1개', $item['comments'] > 0 ? $item['comments'] : 0) . '</p>' . CRLF;
        $itemsView .= '	</a>' . CRLF;
        $itemsView .= '</li>' . CRLF;
    }
    $itemsView .= '</ul>' . CRLF;
    print $itemsView;
    print printMobileListNavigation($paging, 'search/' . $search);
    ?>