init
This commit is contained in:
224
app/us/view/article/detail.phtml
Executable file
224
app/us/view/article/detail.phtml
Executable file
@@ -0,0 +1,224 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{include file="include/head" /}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/weben/css/cooperation.css">
|
||||
<script type="text/javascript">
|
||||
var navID = "1";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!--top-->
|
||||
<!--top-->
|
||||
<header class="header-PC header-Index">
|
||||
<div id="header" class="theme-white">
|
||||
{include file="include/top" /}
|
||||
{include file="include/top-header" /}
|
||||
</div>
|
||||
</header>
|
||||
{include file="include/top-header-mobile" /}
|
||||
<!--top End-->
|
||||
|
||||
<!-- 详情页 s -->
|
||||
<div class="content">
|
||||
<input type="hidden" class="b_id">
|
||||
<div class="detail_box clearfix">
|
||||
<div class="blog_detail" style="margin-top:2.6rem">
|
||||
<div class="blog_title">
|
||||
<h2><?php echo $detail['name']; ?></h2>
|
||||
<p>Posted on <?php echo date("M j, Y",$detail['createtime']); ?></p>
|
||||
</div>
|
||||
<div class="blog_content">
|
||||
|
||||
<?php echo $detail['content']; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="share_box">
|
||||
<div class="blog_share">
|
||||
<h3>SHARE</h3>
|
||||
<ul class="share_list clearfix">
|
||||
<!-- Go to www.addthis.com/dashboard to customize your tools -->
|
||||
|
||||
<li><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=__ORICOROOT__<?php echo url_rewrite('articledetail', array('id' => $detail['id'])); ?>&t=1709023114"><img src="/frontend/weben/images/blog/share1.png"/></a></li>
|
||||
<li><a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&ro=true&title=<?php echo $detail['name']; ?>&url=__ORICOROOT__<?php echo url_rewrite('articledetail', array('id' => $detail['id'])); ?>&source=&summary=&armin=armin"><img src="/frontend/weben/images/blog/share2.png"/></a></li>
|
||||
<li><a target="_blank" href="http://www.facebook.com/sharer/sharer.php?u=__ORICOROOT__<?php echo url_rewrite('articledetail', array('id' => $detail['id'])); ?>"><img src="/frontend/weben/images/blog/share3.png"/></a></li>
|
||||
<li><a href="http://www.reddit.com/submit?url=__ORICOROOT__<?php echo url_rewrite('articledetail', array('id' => $detail['id'])); ?>&title=<?php echo $detail['name']; ?>" rel="nofollow" title="submit to reddit" target="_blank"><img src="/frontend/weben/images/blog/share4.png"/></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="repply">
|
||||
<h3>Leave a Reply</h3>
|
||||
<form>
|
||||
<span>Name</span>
|
||||
<input class="form-control itinp new_name" type="text" name="name" style="text-indent: 10px;"/>
|
||||
<span>Email</span>
|
||||
<input class="form-control itinp new_email" type="email" name="email" style="text-indent: 10px; margin-bottom:0;"/>
|
||||
<p style="color: #C6C7C9; font-size: 0.75rem; margin-bottom: 0.625rem;">Your email address will not be pulished.</p>
|
||||
<span>Comment</span>
|
||||
<textarea class="form-control itinp new_comment" rows="3" style="text-indent: 10px;width: 98%; margin-top: 0.625rem;margin-bottom: 0.625rem;border: 1px solid #DBDBDB;" name="comment"></textarea>
|
||||
<div class="comment_btn" style="color:#ffffff;">POST COMMENT</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="comment">
|
||||
<h3>Leave a Comment</h3>
|
||||
<form class="comment_form clearfix">
|
||||
<div style="margin-right: 2.5rem;">Name:<br/>
|
||||
<input class="new_name" type="text" name="name" style="text-indent: 10px;"/>
|
||||
</div>
|
||||
<div>Email:<br/>
|
||||
<input class="new_email" type="email" name="email" style="text-indent: 10px;"/>
|
||||
<p style="color: #C6C7C9; font-size: 0.75rem; margin-bottom: 0.625rem; font-weight: 400;">Your email address will not be pulished.</p>
|
||||
</div>
|
||||
<div class="comment_area">Comment:<br/>
|
||||
<textarea class="new_comment" style="text-indent: 10px;height: 8.125rem;border: 1px solid #DBDBDB !important;" name="comment"></textarea>
|
||||
</div>
|
||||
<div class="comment_btn" style="width: 21.25rem; margin-left: 2.5rem;color:#ffffff;">POST COMMENT</div>
|
||||
</form>
|
||||
</div> -->
|
||||
|
||||
<div class="xq">
|
||||
<?php
|
||||
$articles = getDifferentArticle('default', 3, ['id' => ['neq', $detail['id']]], ['createtime'=>'desc']);
|
||||
if ($articles):
|
||||
|
||||
?>
|
||||
<!-- 猜您喜欢 -->
|
||||
<div class="love">
|
||||
<div class="love1">
|
||||
<p>Recommended for you</p>
|
||||
<p><img src="/frontend/web/images/1line.png"></p>
|
||||
</div>
|
||||
<ul class="love2">
|
||||
<?php foreach ($articles as $article): ?>
|
||||
<?php
|
||||
if($article['jump_link'] == ''){
|
||||
$rlink = "__ORICOROOT__/article/detail/".$article['id'].".html";
|
||||
}
|
||||
else{
|
||||
$rlink = $article['jump_link'];
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $rlink; ?>">
|
||||
<div class="lvimg"><img src="<?php echo getImage($article['picture']); ?>"></div>
|
||||
<p class="lvtit"><?php echo msubstr($article['name'], 0, 40); ?></p>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php endforeach; ?>
|
||||
<div class="clear"></div>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
$(function(){
|
||||
//悬浮表单
|
||||
$(window).scroll(function(){
|
||||
var s_top = Number($(this).scrollTop()); // 获取滚动条,滚动刻度
|
||||
var showTop = Number($(".share_box").height());
|
||||
|
||||
var pTop = Number($(".xq").offset().top);
|
||||
|
||||
if((pTop-s_top-80) >= showTop ){
|
||||
$(".share_box").removeAttr("style"); // 删除属性,让他释放
|
||||
|
||||
}else{
|
||||
//nsole.log(s_top,showTop,pTop,$(window).scrollTop());
|
||||
|
||||
$('.share_box').css("position","absolute"); // 添加属性,让他固定
|
||||
$('.share_box').css('top',pTop-showTop-20);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// 提交表单
|
||||
$('.comment_btn').click(function(){
|
||||
var new_name = $('.new_name').val();
|
||||
var new_email = $('.new_email').val();
|
||||
var new_comment = $('.new_comment').val();
|
||||
|
||||
console.log('message');
|
||||
if (new_name == '') {
|
||||
//alert("The Name is Empty!");
|
||||
|
||||
$('.new_name').addClass('error');
|
||||
$('.new_name').next('span').removeClass('hide');
|
||||
return false;
|
||||
}else{
|
||||
$('.new_name').removeClass('error');
|
||||
$('.new_name').next('span').addClass('hide');
|
||||
}
|
||||
|
||||
|
||||
if (new_comment == '') {
|
||||
//alert("The Comment is Empty!");
|
||||
|
||||
$('.new_comment').addClass('error');
|
||||
$('.new_comment').next('span').removeClass('hide');
|
||||
return false;
|
||||
}else{
|
||||
$('.new_comment').removeClass('error');
|
||||
$('.new_comment').next('span').addClass('hide');
|
||||
}
|
||||
|
||||
if (new_email == '') {
|
||||
$('.new_email').addClass('error');
|
||||
$('.new_email').next('span').removeClass('hide');
|
||||
}
|
||||
else{
|
||||
if (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(new_email) == false) {
|
||||
$('.new_email').addClass('error');
|
||||
$('.new_email').next('span').removeClass('hide');
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
$('.new_email').removeClass('error');
|
||||
$('.new_email').next('span').addClass('hide');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
var bid = "<?php echo $detail['id'];?>";
|
||||
//点击创建申请块
|
||||
if(new_name && new_email && new_comment && bid) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/us/article/addcomment",
|
||||
data: {'name':new_name, 'email':new_email,'comment':new_comment,'article_id':bid},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
if(data.code == 200) {
|
||||
alert("留言提交成功!");
|
||||
$(".new_name").val("");
|
||||
$(".new_email").val("");
|
||||
$(".new_comment").val("");
|
||||
}
|
||||
else{
|
||||
alert(data.msg);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<!-- bottom s -->
|
||||
{include file="include/bottom" /}
|
||||
<!-- bottom e -->
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user