示例#1
0
文件: index.php 项目: ragi79/Textcube
function getTeamProfile($userid)
{
    global $database, $serviceURL, $configVal;
    requireComponent('Textcube.Function.misc');
    $data = Setting::fetchConfigVal($configVal);
    getTeamBlogInitConfigVal($data);
    $row = POD::queryRow("SELECT style, image, profile FROM {$database['prefix']}TeamUserSettings WHERE blogid =" . getBlogId() . " AND userid=" . $userid);
    $imageStyle = $imageTag = $html = '';
    if (!empty($row['image'])) {
        $imageSrc = "{$serviceURL}/attach/" . getBlogId() . "/team/" . $row['image'];
        $imageTag = "<img src=\"" . $imageSrc . "\" alt=\"author image\" align=\"top\" />";
        $imageStyle = "style=\"width:" . ($data['imageSize'] + 6) . "px; margin-right:10px;\"";
    }
    if (!empty($row['image']) || !empty($row['profile'])) {
        $profile = nl2br(addLinkSense(htmlspecialchars($row['profile']), ' onclick="return openLinkInNewWindow(this)"'));
        $html = "<div class=\"teamProfile\">";
        $html .= $data['postHeader'];
        $html .= "<div class=\"teamMain\">";
        $html .= "<div class=\"teamImage\" {$imageStyle}>" . $imageTag . "</div>";
        $html .= "<div class=\"teamDesc\">" . $profile . "</div>";
        $html .= "</div>";
        $html .= $data['postFooter'];
        $html .= "</div>";
    }
    return $html;
}
示例#2
0
function getTeamProfile($userid)
{
    $context = Model_Context::getInstance();
    $data = $context->getProperty('plugin.config');
    getTeamBlogInitConfigVal($data);
    $pool = DBModel::getInstance();
    $pool->init("TeamUserSettings");
    $pool->setQualifier("blogid", "eq", getBlogId());
    $pool->setQualifier("userid", "eq", $userid);
    $row = $pool->getRow("style, image, profile");
    $imageStyle = $imageTag = $html = '';
    if (!empty($row['image'])) {
        $imageSrc = $context->getProperty("uri.service") . "/attach/" . getBlogId() . "/team/" . $row['image'];
        $imageTag = "<img src=\"" . $imageSrc . "\" alt=\"author image\" align=\"top\" />";
        $imageStyle = "style=\"width:" . ($data['imageSize'] + 6) . "px; margin-right:10px;\"";
    }
    if (!empty($row['image']) || !empty($row['profile'])) {
        $profile = nl2br(addLinkSense(htmlspecialchars($row['profile']), ' onclick="return openLinkInNewWindow(this)"'));
        $html = "<div class=\"teamProfile\">";
        $html .= $data['postHeader'];
        $html .= "<div class=\"teamMain\">";
        $html .= "<div class=\"teamImage\" {$imageStyle}>" . $imageTag . "</div>";
        $html .= "<div class=\"teamDesc\">" . $profile . "</div>";
        $html .= "</div>";
        $html .= $data['postFooter'];
        $html .= "</div>";
    }
    return $html;
}
示例#3
0
文件: index.php 项目: ragi79/Textcube
function writeValue($value, $label, $className)
{
    ?>
										<dl class="<?php 
    echo $className;
    ?>
-line">
											<dt class="name"><?php 
    echo $label;
    ?>
</dt>
											<dd class="explain"><?php 
    echo nl2br(addLinkSense($value, ' onclick="window.open(this.href); return false;"'));
    ?>
</dd>
										</dl>
<?php 
}
示例#4
0
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');
    }
}
示例#5
0
function getCommentView($entry, $skin, $inputBlock = true, $page = 1, $count = null, $listBlock = true)
{
    global $contentContainer;
    static $dressCommentBlock = false;
    $context = Model_Context::getInstance();
    if (is_null($count)) {
        if ($context->getProperty('skin.commentsOnEntry')) {
            $count = $context->getProperty('skin.commentsOnEntry');
        } else {
            $count = 15;
        }
    }
    if (!isset($entry)) {
        $entry['id'] = 0;
    }
    $blogid = getBlogId();
    importlib("model.common.setting");
    importlib("model.blog.entry");
    importlib("model.blog.comment");
    importlib('blogskin');
    $authorized = doesHaveOwnership();
    $useAjaxBlock = $context->getProperty('blog.useAjaxComment', true);
    $useMicroformat = $context->getProperty('blog.useMicroformat', 3);
    $fn = '';
    $fn_nickname = '';
    if ($useMicroformat > 1) {
        $fn = 'class="fn url nickname" ';
        $fn_nickname = 'class="fn nickname" ';
    }
    if ($entry['id'] > 0) {
        $prefix1 = 'rp';
        $isComment = true;
    } else {
        $prefix1 = 'guest';
        $isComment = false;
    }
    $commentView = $isComment ? $skin->comment : $skin->guest;
    $commentItemsView = '';
    if ($listBlock === true) {
        if ($isComment == false) {
            global $comments;
            if (!isset($comments)) {
                list($comments, $paging) = getCommentsWithPagingForGuestbook($blogid, $context->getProperty('suri.page'), $context->getProperty('skin.commentsOnGuestbook'));
            }
            foreach ($comments as $key => $value) {
                if ($value['secret'] == 1) {
                    if (!$authorized) {
                        if (!doesHaveOpenIDPriv($value)) {
                            $comments[$key]['name'] = _text('비밀방문자');
                            $comments[$key]['homepage'] = '';
                            $comments[$key]['comment'] = _text('관리자만 볼 수 있는 방명록입니다.');
                        } else {
                            $comments[$key]['name'] = _text('비밀방문자') . ' ' . $comments[$key]['name'];
                        }
                    }
                }
            }
        } else {
            if ($useAjaxBlock) {
                list($comments, $paging) = getCommentsWithPagingByEntryId($blogid, $entry['id'], $page, $count, 'loadComment', '(' . $entry['id'] . ',', ',true,true);return false;', null, $context->getProperty('skin.sortCommentsBy', 'ASC'));
            } else {
                $comments = getComments($entry['id'], $context->getProperty('skin.sortCommentsBy', 'ASC'));
            }
        }
        if (empty($skin->dressCommentBlock)) {
            if ($dressCommentBlock) {
                if ($isComment) {
                    $skin->commentGuest = $dressCommentBlock;
                } else {
                    $skin->guestGuest = $dressCommentBlock;
                }
            } else {
                if ($isComment) {
                    $dressCommentBlock = $skin->commentGuest = addOpenIDPannel($skin->commentGuest, 'rp');
                } else {
                    $dressCommentBlock = $skin->guestGuest = addOpenIDPannel($skin->guestGuest, 'guest');
                }
            }
            $skin->dressCommentBlock = true;
        }
        /// Dressing comments
        foreach ($comments as $commentItem) {
            $commentItemView = $isComment ? $skin->commentItem : $skin->guestItem;
            $commentSubItemsView = '';
            $subComments = getCommentComments($commentItem['id'], $commentItem);
            foreach ($subComments as $commentSubItem) {
                $commentSubItemView = $isComment ? $skin->commentSubItem : $skin->guestSubItem;
                $commentSubItem['name'] = htmlspecialchars($commentSubItem['name']);
                $commentSubItem['comment'] = htmlspecialchars($commentSubItem['comment']);
                $rp_class = $prefix1 . '_general';
                if ($blogid == $commentSubItem['replier']) {
                    $rp_class = $prefix1 . '_admin';
                } else {
                    if ($commentSubItem['secret'] == 1) {
                        $rp_class = $prefix1 . '_secret';
                        if ($authorized) {
                            $commentSubItem['comment'] = '<span class="hiddenCommentTag_content">' . _text('[비밀댓글]') . '</span> ' . $commentSubItem['comment'];
                        } else {
                            $rp_class .= ' hiddenComment';
                            $commentSubItem['name'] = '<span class="hiddenCommentTag_name">' . _text('비밀방문자') . '</span>' . (doesHaveOpenIDPriv($commentSubItem) ? ' ' . $commentSubItem['name'] : '');
                        }
                    }
                }
                dress($prefix1 . '_rep_class', $rp_class, $commentSubItemView);
                if (dress($prefix1 . '_rep_id', ($entry['id'] == 0 ? 'guestbook' : 'comment') . $commentSubItem['id'], $commentSubItemView) == false) {
                    $commentSubItemView = "<a id=\"comment{$commentSubItem['id']}\"></a>" . $commentSubItemView;
                }
                if (empty($commentSubItem['homepage']) || $commentSubItem['secret'] == 1 && !doesHaveOwnership()) {
                    dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', "<span {$fn_nickname}>" . $commentSubItem['name'] . "</span>", $commentSubItem), $commentSubItemView);
                } else {
                    dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', '<a ' . $fn . 'rel="external nofollow" href="' . htmlspecialchars(addProtocolSense($commentSubItem['homepage'])) . '" onclick="return openLinkInNewWindow(this)">' . $commentSubItem['name'] . '</a>', $commentSubItem), $commentSubItemView);
                }
                $contentContainer["{$prefix1}_{$commentSubItem['id']}"] = fireEvent($isComment ? 'ViewCommentContent' : 'ViewGuestCommentContent', nl2br(addLinkSense($commentSubItem['comment'], ' onclick="return openLinkInNewWindow(this)"')), $commentSubItem);
                dress($prefix1 . '_rep_desc', setTempTag("{$prefix1}_{$commentSubItem['id']}"), $commentSubItemView);
                dress($prefix1 . '_rep_date', fireEvent($isComment ? 'ViewCommentDate' : 'ViewGuestCommentDate', Timestamp::format5($commentSubItem['written']), $commentSubItem['written']), $commentSubItemView);
                dress($prefix1 . '_rep_link', $context->getProperty('uri.blog') . "/" . ($entry['id'] == 0 ? "guestbook/{$commentItem['id']}#guestbook{$commentSubItem['id']}" : ($context->getProperty('blog.useSloganOnPost') ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL')) : $entry['id']) . "#comment{$commentSubItem['id']}"), $commentSubItemView);
                dress($prefix1 . '_rep_onclick_delete', "deleteComment({$commentSubItem['id']}); return false;", $commentSubItemView);
                $commentSubItemsView .= $commentSubItemView;
            }
            $commentSubContainer = $isComment ? $skin->commentSubContainer : $skin->guestSubContainer;
            dress($isComment ? 'rp2_rep' : 'guest_reply_rep', $commentSubItemsView, $commentSubContainer);
            if (count($subComments) > 0) {
                dress($isComment ? 'rp2_container' : 'guest_reply_container', $commentSubContainer, $commentItemView);
            }
            $commentItem['name'] = htmlspecialchars($commentItem['name']);
            $commentItem['comment'] = htmlspecialchars($commentItem['comment']);
            $rp_class = $prefix1 . '_general';
            if ($blogid == $commentItem['replier']) {
                $rp_class = $prefix1 . '_admin';
            } else {
                if ($commentItem['secret'] == 1) {
                    $rp_class = $prefix1 . '_secret';
                    if ($authorized) {
                        $commentItem['comment'] = '<span class="hiddenCommentTag_content">' . _text('[비밀댓글]') . '</span> ' . $commentItem['comment'];
                    } else {
                        $rp_class .= ' hiddenComment';
                        $commentItem['name'] = '<span class="hiddenCommentTag_name">' . _text('비밀방문자') . '</span>' . (doesHaveOpenIDPriv($commentItem) ? ' ' . $commentItem['name'] : '');
                    }
                }
            }
            dress($prefix1 . '_rep_class', $rp_class, $commentItemView);
            if (dress($prefix1 . '_rep_id', ($entry['id'] == 0 ? 'guestbook' : 'comment') . $commentItem['id'], $commentItemView) == false) {
                $commentItemView = "<a id=\"comment{$commentItem['id']}\"></a>" . $commentItemView;
            }
            if (empty($commentItem['homepage']) || $commentItem['secret'] == 1 && !doesHaveOwnership()) {
                dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', "<span {$fn_nickname}>" . $commentItem['name'] . "</span>", $commentItem), $commentItemView);
            } else {
                dress($prefix1 . '_rep_name', fireEvent($isComment ? 'ViewCommenter' : 'ViewGuestCommenter', '<a ' . $fn . 'rel="external nofollow" href="' . htmlspecialchars(addProtocolSense($commentItem['homepage'])) . '" onclick="return openLinkInNewWindow(this)">' . $commentItem['name'] . '</a>', $commentItem), $commentItemView);
            }
            $contentContainer["{$prefix1}_{$commentItem['id']}"] = fireEvent($isComment ? 'ViewCommentContent' : 'ViewGuestCommentContent', nl2br(addLinkSense($commentItem['comment'], ' onclick="return openLinkInNewWindow(this)"')), $commentItem);
            dress($prefix1 . '_rep_desc', setTempTag("{$prefix1}_{$commentItem['id']}"), $commentItemView);
            dress($prefix1 . '_rep_date', fireEvent($isComment ? 'ViewCommentDate' : 'ViewGuestCommentDate', Timestamp::format5($commentItem['written']), $commentItem['written']), $commentItemView);
            if (!$context->getProperty('blog.acceptComments', true) || $prefix1 == 'guest' && $authorized != true && $context->getProperty('blog.allowWriteDblCommentOnGuestbook') == 0) {
                $doubleCommentPermissionScript = 'alert(\'' . _text('댓글을 사용할 수 없습니다.') . '\'); return false;';
            } else {
                $doubleCommentPermissionScript = '';
            }
            dress($prefix1 . '_rep_onclick_reply', $doubleCommentPermissionScript . "commentComment({$commentItem['id']}); return false", $commentItemView);
            dress($prefix1 . '_rep_onclick_delete', "deleteComment({$commentItem['id']});return false", $commentItemView);
            dress($prefix1 . '_rep_link', $context->getProperty('uri.blog') . "/" . ($entry['id'] == 0 ? "guestbook/{$commentItem['id']}#guestbook{$commentItem['id']}" : ($context->getProperty('blog.useSloganOnPost') ? "entry/" . URL::encode($entry['slogan'], $context->getProperty('service.useEncodedURL')) : $entry['id']) . "?commentId=" . $commentItem['id'] . "#comment{$commentItem['id']}"), $commentItemView);
            $commentItemsView .= $commentItemView;
        }
        /// Merging comments with its paging links.
        $commentContainer = $isComment ? $skin->commentContainer : $skin->guestContainer;
        dress($isComment ? 'rp_rep' : 'guest_rep', $commentItemsView, $commentContainer);
        if (count($comments) > 0) {
            if ($isComment && $useAjaxBlock) {
                $pagingView = Paging::getPagingView($paging, $skin->paging, $skin->pagingItem, false, 'onclick');
            } else {
                $pagingView = '';
            }
            dress($prefix1 . '_container', "<div id=\"entry" . $entry['id'] . "CommentList\">" . $commentContainer . $pagingView . "</div>", $commentView);
        }
    } else {
        dress($prefix1 . '_container', '', $commentView);
    }
    /// Comment write block
    if ($inputBlock == true) {
        if (!empty($entry['acceptcomment'])) {
            $acceptcomment = $entry['acceptcomment'];
        } else {
            $pool = DBModel::getInstance();
            $pool->reset('Entries');
            $pool->setQualifier('blogid', 'equals', $blogid);
            $pool->setQualifier('id', 'equals', $entry['id']);
            $pool->setQualifier('draft', 'equals', 0);
            $acceptcomment = $pool->getCell('acceptcomment');
        }
        $useForm = false;
        $openid_identity = Acl::getIdentity('openid');
        if ($isComment) {
            if (!($skin->commentForm == '')) {
                $commentRrevView = $commentView;
                /// Comment Lists.
                $commentView = $skin->commentForm;
                /// Comment write block.
                $useForm = true;
            }
        } else {
            if (!($skin->guestForm == '')) {
                $commentRrevView = $commentView;
                $commentView = $skin->guestForm;
                $useForm = true;
            }
        }
        $default_guestname = '';
        $default_homepage = '';
        if (doesHaveOwnership() || $isComment && $acceptcomment == 1 && Setting::getBlogSettingGlobal('acceptComments', 1) || $isComment == false || $useForm == false) {
            $commentMemberView = $isComment ? $skin->commentMember : $skin->guestMember;
            if (!doesHaveMembership()) {
                $commentGuestView = $isComment ? $skin->commentGuest : $skin->guestGuest;
                dress($prefix1 . '_input_name', 'name', $commentGuestView);
                dress($prefix1 . '_input_password', 'password', $commentGuestView);
                dress($prefix1 . '_input_homepage', 'homepage', $commentGuestView);
                if (!empty($_POST["name_{$entry['id']}"])) {
                    $guestName = htmlspecialchars($_POST["name_{$entry['id']}"]);
                } else {
                    if (!empty($_SESSION['openid']['nickname'])) {
                        $guestName = htmlspecialchars($_SESSION['openid']['nickname']);
                    } else {
                        if (!empty($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestName'])) {
                            $guestName = htmlspecialchars($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestName']);
                        } else {
                            $guestName = '';
                        }
                    }
                }
                dress('guest_name', $guestName, $commentGuestView);
                if (!empty($_POST["homepage_{$entry['id']}"]) && $_POST["homepage_{$entry['id']}"] != 'http://') {
                    if (strpos($_POST["homepage_{$entry['id']}"], 'http://') === 0) {
                        $guestHomepage = htmlspecialchars($_POST["homepage_{$entry['id']}"]);
                    } else {
                        $guestHomepage = 'http://' . htmlspecialchars($_POST["homepage_{$entry['id']}"]);
                    }
                } else {
                    if (!empty($_SESSION['openid']['homepage'])) {
                        $guestHomepage = htmlspecialchars($_SESSION['openid']['homepage']);
                    } else {
                        if (!empty($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestHomepage'])) {
                            $guestHomepage = htmlspecialchars($_COOKIE[$context->getProperty('service.cookie_prefix') . 'guestHomepage']);
                        } else {
                            $guestHomepage = 'http://';
                        }
                    }
                }
                dress('guest_homepage', $guestHomepage, $commentGuestView);
                dress($prefix1 . ($isComment ? '_guest' : '_form'), $commentGuestView, $commentMemberView);
            }
            dress($prefix1 . '_input_is_secret', 'secret', $commentMemberView);
            dress($prefix1 . '_member', $commentMemberView, $commentView);
            dress($prefix1 . '_input_comment', 'comment', $commentView);
            dress($prefix1 . '_onclick_submit', "addComment(this, {$entry['id']}); return false;", $commentView);
            dress($prefix1 . '_textarea_body', 'comment', $commentView);
            dress($prefix1 . '_textarea_body_value', '', $commentView);
        } else {
            if ($useForm == true) {
                $commentView = '';
            }
        }
        if ($useForm == true) {
            dress($prefix1 . '_input_form', "<form id=\"entry" . $entry['id'] . "WriteComment\" method=\"post\" action=\"" . $context->getProperty('uri.blog') . "/comment/add/{$entry['id']}\" onsubmit=\"return false\" style=\"margin: 0\">" . $commentView . '</form>', $commentRrevView);
            $commentView = $commentRrevView;
        } else {
            $commentView = "<form id=\"entry" . $entry['id'] . "WriteComment\" method=\"post\" action=\"" . $context->getProperty('uri.blog') . "/comment/add/{$entry['id']}\" onsubmit=\"return false\" style=\"margin: 0\">" . $commentView . '</form>';
        }
    } else {
        dress($prefix1 . '_input_form', "", $commentView);
    }
    /// Adding feed links.
    dress('article_rep_rp_atomurl', $context->getProperty('uri.default') . '/atom/comment/' . $entry['id'], $commentView);
    dress('article_rep_rp_rssurl', $context->getProperty('uri.default') . '/rss/comment/' . $entry['id'], $commentView);
    return $commentView;
}
示例#6
0
function printMobileCommentView($entryId)
{
    global $blogURL;
    $comments = getComments($entryId);
    if (count($comments) == 0) {
        ?>
		<div class="comment">
			<?php 
        echo _text('댓글이 없습니다');
        ?>
		</div>
		<hr />
		<?php 
    } else {
        foreach ($comments as $commentItem) {
            ?>
		<div class="comment">
			<div class="name">
				<?php 
            if (!empty($commentItem['name'])) {
                ?>
<strong><?php 
                echo htmlspecialchars($commentItem['name']);
                ?>
</strong><?php 
            }
            ?>
				<a href="<?php 
            echo $blogURL;
            ?>
/comment/comment/<?php 
            echo $commentItem['id'];
            ?>
">RE</a>
				<a href="<?php 
            echo $blogURL;
            ?>
/comment/delete/<?php 
            echo $commentItem['id'];
            ?>
">DEL</a><br />
				(<?php 
            echo Timestamp::format5($commentItem['written']);
            ?>
)
			</div>
			<div class="body"><?php 
            echo ($commentItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . _t('비밀 댓글') . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentItem['comment'])));
            ?>
</div>
			<?php 
            foreach (getCommentComments($commentItem['id']) as $commentSubItem) {
                ?>
			<blockquote>
				<div class="name">
					<?php 
                if (!empty($commentSubItem['name'])) {
                    ?>
<strong><?php 
                    echo htmlspecialchars($commentSubItem['name']);
                    ?>
</strong><?php 
                }
                ?>
					<a href="<?php 
                echo $blogURL;
                ?>
/comment/delete/<?php 
                echo $commentSubItem['id'];
                ?>
">DEL</a><br />
					(<?php 
                echo Timestamp::format5($commentSubItem['written']);
                ?>
)
				</div>
				<div class="body"><?php 
                echo ($commentSubItem['secret'] && doesHaveOwnership() ? '<div class="hiddenComment" style="font-weight: bold; color: #e11">' . _t('비밀 댓글') . ' &gt;&gt;</div>' : '') . nl2br(addLinkSense(htmlspecialchars($commentSubItem['comment'])));
                ?>
</div>
			</blockquote>
			<?php 
            }
            ?>
		</div>
		<hr />
		<?php 
        }
    }
    printMobileCommentFormView($entryId);
}
示例#7
0
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);
}