コード例 #1
0
ファイル: iphoneView.php プロジェクト: hinablue/TextCube
function printIphoneCommentView($entryId, $page = null, $mode = null)
{
    global $blogURL, $blogid, $skinSetting, $paging;
    if ($mode == 'recent') {
        // Recent comments
        list($comments, $paging) = getCommentsWithPaging($blogid, $page, 10, null, '?page=');
    } else {
        if (!is_null($page)) {
            // Guestbook
            list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $page, $skinSetting['commentsOnGuestbook']);
        } else {
            // Comments related to specific article
            $comments = getComments($entryId);
        }
    }
    if (count($comments) == 0) {
        ?>
		<p>&nbsp;<?php 
        echo $entryId == 0 ? _text('방명록이 없습니다') : _text('댓글이 없습니다');
        ?>
</p>
		<?php 
    } else {
        foreach ($comments as $commentItem) {
            ?>
		<ul id="comment_<?php 
            echo $commentItem['id'];
            ?>
" class="comment">
			<li class="group">
				<span class="left">
					<?php 
            if (!empty($commentItem['name'])) {
                ?>
<strong><?php 
                echo htmlspecialchars($commentItem['name']);
                ?>
</strong><?php 
            }
            ?>
					(<?php 
            echo Timestamp::format5($commentItem['written']);
            ?>
)
				</span>
				<span class="right">
					<a href="<?php 
            echo $blogURL;
            ?>
/comment/comment/<?php 
            echo $commentItem['id'];
            ?>
"><?php 
            echo $entryId == 0 ? _text('방명록에 댓글 달기') : _text('댓글에 댓글 달기');
            ?>
</a> :
					<a href="<?php 
            echo $blogURL;
            ?>
/comment/delete/<?php 
            echo $commentItem['id'];
            ?>
"><?php 
            echo _text('지우기');
            ?>
</a>
				</span>
			</li>
			<li class="body">
				<?php 
            echo ($commentItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . ($entryId == 0 ? _text('비밀 방명록') : _text('비밀 댓글')) . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentItem['comment'])));
            ?>
			</li>
			<?php 
            foreach (getCommentComments($commentItem['id']) as $commentSubItem) {
                ?>
			<li class="groupSub">
				<span class="left">&nbsp;Re :
					<?php 
                if (!empty($commentSubItem['name'])) {
                    ?>
<strong><?php 
                    echo htmlspecialchars($commentSubItem['name']);
                    ?>
</strong><?php 
                }
                ?>
					(<?php 
                echo Timestamp::format5($commentSubItem['written']);
                ?>
)
				</span>
				<span class="right">
					<a href="<?php 
                echo $blogURL;
                ?>
/comment/delete/<?php 
                echo $commentSubItem['id'];
                ?>
">DEL</a><br />
				</span>
			</li>
			<li class="body">
				<?php 
                echo ($commentSubItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . _t('Secret Comment') . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentSubItem['comment'])));
                ?>
			</li>
			<?php 
            }
            ?>
		</ul>
		<?php 
        }
    }
    if ($mode != 'recent') {
        printIphoneCommentFormView($entryId, $entryId == 0 ? _text('방명록 쓰기') : _text('댓글 쓰기'), 'comment');
    }
}
コード例 #2
0
ファイル: iphoneView.php プロジェクト: ragi79/Textcube
function printMobileCommentView($entryId, $page = null, $mode = null)
{
    $context = Model_Context::getInstance();
    $blogid = $context->getProperty('blog.id');
    global $paging;
    if ($mode == 'recent') {
        // Recent comments
        list($comments, $paging) = getCommentsWithPaging($blogid, $page, 10, null, '?page=');
    } else {
        if (!is_null($page)) {
            // Guestbook
            list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $page, $skinSetting['commentsOnGuestbook']);
        } else {
            // Comments related to specific article
            $comments = getComments($entryId);
        }
    }
    if (count($comments) == 0) {
        ?>
		<div class="center ui-bar ui-bar-e"><?php 
        echo $entryId == 0 ? _text('방명록이 없습니다') : _text('댓글이 없습니다');
        ?>
</div>
		<?php 
    } else {
        foreach ($comments as $commentItem) {
            ?>
		<ul data-role="listview" data-inset="true" id="comment_<?php 
            echo $commentItem['id'];
            ?>
" class="comment">
			<li class="group">
				<p class="left">
					<?php 
            if (!empty($commentItem['name'])) {
                ?>
<strong><?php 
                echo htmlspecialchars($commentItem['name']);
                ?>
</strong><?php 
            }
            ?>
				</p>
				<p class="ui-li-aside">
					<?php 
            echo Timestamp::format5($commentItem['written']);
            ?>
				</p>
				<p class="right">
					<div class="comment_button" data-role="controlgroup" data-type="horizontal">
						<a href="<?php 
            echo $context->getProperty('uri.blog');
            ?>
/comment/comment/<?php 
            echo $commentItem['id'];
            ?>
" data-role="button" data-icon="plus" data-iconpos="notext"><?php 
            echo $entryId == 0 ? _text('방명록에 댓글 달기') : _text('댓글에 댓글 달기');
            ?>
</a> 
						<a href="<?php 
            echo $context->getProperty('uri.blog');
            ?>
/comment/delete/<?php 
            echo $commentItem['id'];
            ?>
" data-role="button" data-icon="delete" data-iconpos="notext"><?php 
            echo _text('지우기');
            ?>
</a>
					</div>
				</p>
			</li>
			<li class="body">
				<?php 
            echo ($commentItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . ($entryId == 0 ? _text('비밀 방명록') : _text('비밀 댓글')) . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentItem['comment'])));
            ?>
			</li>
			<?php 
            foreach (getCommentComments($commentItem['id']) as $commentSubItem) {
                ?>
			<li class="groupSub">
				<p class="left">Re :
					<?php 
                if (!empty($commentSubItem['name'])) {
                    ?>
<strong><?php 
                    echo htmlspecialchars($commentSubItem['name']);
                    ?>
</strong><?php 
                }
                ?>
				</p>
				<p class="ui-li-aside">
					<?php 
                echo Timestamp::format5($commentSubItem['written']);
                ?>
				</p>
				<p class="right">
					<div class="comment_button" data-role="controlgroup" data-type="horizontal">
						<a href="<?php 
                echo $context->getProperty('uri.blog');
                ?>
/comment/delete/<?php 
                echo $commentSubItem['id'];
                ?>
" data-role="button" data-icon="delete" data-inline="true" data-iconpos="notext"><?php 
                echo _text('지우기');
                ?>
</a>
					</div>
				</p>
			</li>
			<li class="body">
				<?php 
                echo ($commentSubItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . _t('비밀 댓글') . ' &gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentSubItem['comment'])));
                ?>
			</li>
			<?php 
            }
            ?>
		</ul>
		<?php 
        }
    }
    if ($mode != 'recent') {
        printMobileCommentFormView($entryId, $entryId == 0 ? _text('방명록 쓰기') : _text('댓글 쓰기'), 'comment');
    }
    return array($comments, $paging);
}