Files
orico-official-website-old/app/vn/view/article/detail.phtml
2024-10-29 14:04:59 +08:00

205 lines
11 KiB
PHTML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head-seo" /}
{include file="include/head" /}
<script type="text/javascript">
var navID = "1";
</script>
</head>
<body>
<!--top-->
<header class="header-PC header-Product">
<div id="header" class="theme-black">
{include file="include/top" /}
{include file="include/top-header" /}
</div>
</header>
{include file="include/top-header-mobile" /}
<!--top End-->
<!-- 新闻详情页 s -->
<div class="xq">
<div class="w1200">
<div class="xqtitle banner-other">
<p class="xqtext"><?php echo $detail['name']; ?></p>
<p class="xqname"><?php echo $detail['writer']; ?> Published <?php echo getHMStime($detail['createtime'], time()); ?><!--/ Key Words: <?php echo $detail['tags']; ?>--></p>
</div>
<!-- <div class="fxs">
<span>Share: </span>
<a href="#"><img src="__PUBLIC__/web/images/f1.png"></a>
<a href="#"><img src="__PUBLIC__/web/images/f2.png"></a>
<a href="#"><img src="__PUBLIC__/web/images/f3.png"></a>
<a href="#"><img src="__PUBLIC__/web/images/f4.png"></a>
<a href="#"><img src="__PUBLIC__/web/images/f5.png"></a>
</div>-->
<div class="xqcon">
<?php echo $detail['description']; ?>
</div>
<!-- <div class="xqimg">
<img src="__PUBLIC__/web/uploadfiles/image/xq1.jpg">
</div>-->
<div class="xqcon img-responsive">
<?php echo $detail['content']; ?>
</div>
<?php
$articles = getDifferentArticle('default', 3, ['cid' => $detail['cid'], 'id' => ['neq', $detail['id']]]);
if ($articles):
?>
<!-- 猜您喜欢 -->
<div class="love">
<div class="love1">
<p>Recommendations</p>
<p><img src="__PUBLIC__/web/images/1line.png"></p>
</div>
<ul class="love2">
<?php foreach ($articles as $article): ?>
<li>
<a href="__ORICOROOT__<?php echo url_rewrite('articledetail', array('id' => $article['id'])); ?>">
<div class="lvimg"><img src="<?php echo getImage($article['picture']); ?>"></div>
<p class="lvtit"><?php echo msubstr($article['name'], 0, 1000); ?></p>
</a>
</li>
<?php endforeach; ?>
<div class="clear"></div>
</ul>
</div>
<?php endif; ?>
<!-- 发表评论 -->
<div class="fb">
<div class="love1 img-responsive">
<p>Comments from <span id="ccount"><?php echo $total; ?></span> people</p>
<p><img src="__PUBLIC__/web/images/1line.png"></p>
</div>
<?php if (!empty($list)): ?>
<ul class="fbul" id="listul">
<?php foreach ($list as $k => $comment): ?>
<li>
<div class="fbimg">
<div><img src="__PUBLIC__/web/uploadfiles/image/ns<?php echo $comment['tx']; ?>.jpg"></div>
<div class="peo3"><?php echo $comment['cname']; ?></div>
<div class="peo4"><?php echo $comment['createtime']; ?></div>
</div>
<div class="fbcon" id="c<?php echo $comment['id']; ?>">
<?php
$content = '';
if ($comment['pid']) {
$child = db('Pinglun')->where(['stat' => 0, 'id' => $comment['pid']])->find();
if ($child) {
$content = '<div><div class="ccontent"><label class="clabel"><span class="ctimestamp">' . $child['createtime'] . '</span>&nbsp;<span class="cname">' . $child['cname'] . '</span>发表</label><br />' . $content . $child['content'] . '</div></div>';
}
echo '<div class="cli">' . $content . '</div>', $comment['content'];
} else {
echo $comment['content'];
}
?>
</div>
<div class="fbnum">
<p class="no1">NO.<?php echo $k + 1; ?></p>
<p class="no2"><a href="javascript:void(0);" onclick="answer('<?php echo $comment['id']; ?>')">Reply</a></p>
</div>
<div class="clear"></div>
</li>
<?php endforeach; ?>
</ul>
<a href="__ORICOROOT__<?php echo url('/pinglun/lists', ['type' => strtolower(empty($type) ? 'Article' : $type), 'cid' => $detail['id']]); ?>" class="quanbu"> View all comments (<?php echo $total; ?>)</a>
<?php endif; ?>
</div>
<!-- 回复 -->
<div class="huifu">
<div class="love1 img-responsive">
<p>Reply </p>
<p><img src="__PUBLIC__/web/images/1line.png"></p>
</div>
<div class="login">Please Please comment after <a href="__ORICOROOT__<?php echo url('/login'); ?>" target="_blank">logging in</a>, <a href="__ORICOROOT__<?php echo url('/register'); ?>" target="_blank">register right away </a>if you dont have accounts.<!--<a href="#">QQ</a>account is also OK.</div>-->
<textarea id="ccont"></textarea>
<a href="javascript:void(0);" class="replay" onclick="submit_pl(0);">Post</a>
</div>
</div>
</div>
<!-- 新闻详情页 e -->
<script>
var type = 'Article';
var cid = '<?php echo $detail['id']; ?>';
//点击回复创建回复块
function answer(id) {
if ($('#c' + id).find('.answer_block' + id).html()) {
$('.answer_block' + id).remove()
} else {
var cname = '.answer_block' + id;
var fhHtml = '<div class="answer_block' + id + '"> \n\
<textarea class="hf_input" placeholder="Input reply content"></textarea> \
<div class="csunbmit"><button class="submitBtn" onclick=submit_pl("' + cname + '")>Confirm Reply</button></div>\n\
</div>';
$('#c' + id).append(fhHtml);
$(cname).find('.hf_input').css('width', '99%')
$(cname).find('.hf_input').css('height', '90px')
$(cname).find('.hf_input').css('resize', 'none')
$(cname).find('.hf_input').css('background', '#f6f9fb')
$(cname).find('.hf_input').css('border', '1px solid #ccc')
$(cname).children('.hf_input').focus().val("Reply: ");
}
}
function submit_pl(cname) {
var pid;
var content;
var data = {};
if (cname == 0) {
pid = 0;
content = $('#ccont').val()
if (!content.replace(/^ +| +$/g, '')) {
return false;
}
$('#ccont').val('');
}
else {
pid = cname.split('block')[1];
content = $(cname).children('.hf_input').val();
if (!content.replace('Reply: ', '').replace(/^ +| +$/g, '')) {
return false;
}
$(cname).children('.hf_input').val('');
$(cname).remove();
}
data.pid = pid;
data.content = content;
data.typeid = type;
data.cid = cid;
var options = {
url: "__ORICOROOT__<?php echo url('/pinglun/add'); ?>",
type: "post",
dataType: "json",
data: data,
success: function(data) {
if (data.code) {
alert(data.msg);
} else {
alert(data.msg);
}
},
error: function(xhr, ajaxOptions, thrownError) {
//alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
}
};
$.ajax(options);
return false;
}
</script>
<style>
.csunbmit{height: 35px;margin-top: 10px;margin-bottom: 5px;}
.submitBtn{width: 75px;height: 30px;line-height: 26px;background-color: #339b53;text-align: center;display: block;
color: #FFFFFF;font-size: 12px;border-radius: 6px;float: left;}
.cli{border-bottom: 1px dashed #ccc;text-align: left;font-size: 12px;/*margin-left: -40px;margin-top:10px;*/ }
.ctimestamp{color: red;}
.ccontent{width: 98%;padding: 10px; background: #f6f9fb;border:1px solid #ccc;margin-bottom: 10px}
/*回复*/
</style>
<!-- bottom s -->
{include file="include/bottom" /}
<!-- bottom e -->
</body>
</html>