<?php defined('KX_ROOT') || exit('Permission denied');?><!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
    <title><?php include \Kuxin\View::parseTpl($tkd['title']);?></title>
    <meta name="keywords" content="<?php include \Kuxin\View::parseTpl($tkd['keywords']);?>">
    <meta name="description" content="<?php include \Kuxin\View::parseTpl($tkd['description']);?>">
	<link rel="stylesheet" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/css/global.css"/>
	<link rel="stylesheet" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/css/style.css"/>
	<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/js/jquery-3.3.1.js"></script>
    <link rel="shortcut icon" type="image/ico" href="/favicon.ico" />
    <meta name="author" content="www.ptcms.com">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width" />
    <meta name="applicable-device" content="pc">
    <meta http-equiv="mobile-agent" content="format=html5; url=<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "mobileurl");?><?php echo $_SERVER['REQUEST_URI'];?>">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta http-equiv="Cache-Control" content="no-transform" />
    <link rel="canonical" href="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "pcurl");?><?php echo $_SERVER['REQUEST_URI'];?>" />
</head>
<body>
	<!-- 头部 -->
    <div class="header">
    <div>
        <a href="/">
            <div class="logo"><span>原创专区</span></div>
        </a>
    </div>
</div>

	<!-- 内容 -->
	<div class="pt-content mt10">
		<!-- 一楼 -->
		<div class="pt-floor1">
			<div class="pt-list">
				<!-- 人气榜单 -->
                <div class="fr pt-toplist">
                    <div class="border-b size18 color8 pb10 pt-toplist-title">人气榜单</div>
                    <div class="pt-toplist-item">
                        <?php $list=\Kuxin\Block::show('rank.out', []);?>
                        <?php if(is_array($list)): foreach($list as $key =>$loop):?>
                        <a title="<?php echo $loop['name'];?>" href="<?php echo \Kuxin\Helper\Url::build("novel.rank.list",['key'=>$loop['key']],"");?>"><span class="mr10">·</span><?php echo $loop['name'];?></a>
                        <?php endforeach; endif;?>
                    </div>
                </div>
                <!-- 站内榜单 -->
                <div class="fr pt-sortlist">
                    <div class="border-b size18 color8 pb10 pt-sortlist-title">站内榜单</div>
                    <?php $list=\Kuxin\Block::show('rank.list', []);?>
                    <?php if(is_array($list)): foreach($list as $key =>$loop):?>
                    <div class="pt-sortlist-item fl" style="width:50%">
                        <a title="<?php echo $loop['name'];?>" class="color8 fl" href="<?php echo \Kuxin\Helper\Url::build("novel.rank.list",['key'=>$loop['key']],"");?>"><?php echo $loop['name'];?></a>
                    </div>
                    <?php endforeach; endif;?>
                </div>
			</div>
            <?php $paginate=\Kuxin\Block::show('pagination', ['page'=>$page,'limit'=>$pagesize,'count'=>$author['num'],'maxpage'=>50,'section'=>3]);?>
            <div class="relative pt-rank">
				<div class="pt-rank-head">
					<span class="size18 color2 mr10"><?php echo $author['name'];?> 作品大全</span>
				</div>
                <?php $list=\Kuxin\Block::show('novel.list', ['author'=>$author['id'],'num'=>$paginate['limit'],'page'=>$paginate['current']]);?>
                <?php if(is_array($list) && (array()!=$list)): $i=array(); $i['loop']=array_slice($list,0,null,true); $i['total']=count($list); $i['count']=count($i['loop']); $i['cols']=1; $i['add']=$i['count']%1?1-$i['count']%1:0; $i['order']=0; $i['row']=1;$i['col']=0;foreach(array_pad($i['loop'],$i['add'],array()) as $i['index']=>$i['list']): $loop=$i['list']; $i['order']++; $i['col']++; if($i['col']==1): $i['col']=0; $i['row']++; endif; $i['first']=$i['order']==1; $i['last']=$i['order']==$i['count']; $i['extra']=$i['order']>$i['count'];?>
                <div class="pt-rank-detail">
                    <a href="<?php echo \Kuxin\Helper\Url::build("novel.novel.index",['novelid'=>$loop['novel']['id'],'pinyin'=>$loop['novel']['pinyin']],"");?>">
                        <img src="<?php echo $loop['novel']['cover'];?>">
                    </a>
                    <div class="fl pt-rank-detail-middle">
                        <div class="fl w100 title">
							<span class="fl mr60">
								<?php if($page==1):?><span class="<?php echo $i['index']<3?'bg-red':'bg-ccc';?> pt-sexselect-square"><?php echo $i['order'];?></span><?php endif;?>
								<a href="<?php echo \Kuxin\Helper\Url::build("novel.novel.index",['novelid'=>$loop['novel']['id'],'pinyin'=>$loop['novel']['pinyin']],"");?>" class="size18 color2"><?php echo $loop['novel']['name'];?></a>
							</span>
                            <span class="fl color7">
								<span class="mr30">作者：<a href="<?php echo \Kuxin\Helper\Url::build("author.space.index",['authorid'=>$loop['author']['id'],'pinyin'=>$loop['author']['pinyin'],'name'=>$loop['author']['name']],"");?>"><?php echo $loop['author']['name'];?></a> </span>
								<span>分类：
                                    <a href="<?php echo \Kuxin\Helper\Url::build("novel.category.list",['id'=>$loop['category']['id'],'key'=>$loop['category']['key']],"");?>"><?php echo $loop['category']['name'];?></a>
                                </span>
							</span>
                            <span class="fr color5"><?php echo $loop['data']['allvisit'];?> 人在读</span>
                        </div>
                        <div class="compulsory-row fl w100 color5 desc">
                            <?php echo showIntroLine($loop['novel']['intro']);?>
                        </div>
                        <div class="fl lh100">
                            <?php if($loop['last']['id']):?>
                            <span>
                                最新更新：
                                <a href="<?php echo \Kuxin\Helper\Url::build("novel.chapter.read",['novelid'=>$loop['novel']['id'],'pinyin'=>$loop['novel']['pinyin'],'chapterid'=>$loop['last']['id']],"");?>">
                                    <span class="color2 mr20"><?php echo $loop['last']['name'];?></span>
                                </a>
                            </span>
                            <span class="color0 size12"><?php echo $loop['last']['last_update'];?></span>
                            <?php else:?>
                            <span>最新更新：<span class="color0 mr20"><?php echo $loop['last']['name'];?></span></span>
                            <?php endif;?>
                        </div>
                    </div>
                    <div class="fr mr30">
                        <a href="<?php echo \Kuxin\Helper\Url::build("novel.novel.index",['novelid'=>$loop['novel']['id'],'pinyin'=>$loop['novel']['pinyin']],"");?>" class="mb20 color2 border-red pt-btn read">立即阅读</a>
                        <?php if($islogin):?>
                        <?php $ismark=\Kuxin\Block::show('mark.check', ['userid'=>$userinfo['id'],'novelid'=>$loop['novel']['id']]);?>
                        <a href="javascript:void(0);" class="border-c9 color4 pt-btn btn-mark" data-novel-id="<?php echo $loop['novel']['id'];?>"><?php echo \Kuxin\View::default($ismark,'加入收藏','取消收藏');?></a>
                        <?php else:?>
                        <a href="javascript:void(0);" class="border-c9 color4 pt-btn btn-mark" data-novel-id="<?php echo $loop['novel']['id'];?>">加入收藏</a>
                        <?php endif;?>
                    </div>
                </div>
                <?php endforeach; endif;?>
				<!-- 分页 -->
                <?php if($paginate['total']>1):?>
                <div class="pt-pages">
                    <div class="pt30 color5">
                        <?php if($paginate['prev']):?>
                        <a href="<?php echo \Kuxin\Helper\Url::build("author.space.index",['authorid'=>$_GET['authorid'],'pinyin'=>$_GET['pinyin'],'name'=>$_GET['name'],'page'=>$paginate['prev']],"");?>"><span><</span></a>
                        <?php else:?>
                        <span class="disable"><</span>
                        <?php endif;?>
                        <?php if(is_array($paginate['items'])): foreach($paginate['items'] as $key =>$loop):?>
                        <a href="<?php echo \Kuxin\Helper\Url::build("author.space.index",['authorid'=>$_GET['authorid'],'pinyin'=>$_GET['pinyin'],'name'=>$_GET['name'],'page'=>$loop['num']],"");?>">
                            <span class="<?php echo \Kuxin\View::default($loop['status'],'','pt-pages-select');?>"><?php echo $loop['num'];?></span>
                        </a>
                        <?php endforeach; endif;?>
                        <?php if($paginate['next']):?>
                        <a href="<?php echo \Kuxin\Helper\Url::build("author.space.index",['authorid'=>$_GET['authorid'],'pinyin'=>$_GET['pinyin'],'name'=>$_GET['name'],'page'=>$paginate['next']],"");?>"><span>></span></a>
                        <?php else:?>
                        <span class="disable">></span>
                        <?php endif;?>
                    </div>
                </div>
                <?php endif;?>
			</div>
		</div>
		<!-- 友情链接 -->
	</div>

	<!-- 底部版权-->
    <div class="footer text-center">
    <?php $list=\Kuxin\Block::show('page.list', []);?>
    <span class="aboutlink">
        <?php if(is_array($list)): foreach($list as $key =>$loop):?>
        <a href="<?php echo \Kuxin\Helper\Url::build("page.detail",['pageid'=>$loop['id'],'key'=>$loop['key']],"");?>" title="<?php echo $loop['name'];?>"> <?php echo $loop['name'];?> </a>
        <?php endforeach; endif;?>
    </span>
    <span class="inline-block ml40">Copyright © 2009 - 2019 <a href="<?php echo $pt['config']['siteurl'];?>" target="_blank"><?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></a>. All Rights Reserved . 版权所有<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "sitename");?></span>
</div>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/jquery-3.3.1.js"></script>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/layer/layer.js"></script>
<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/author/js/common.js"></script>
    <script>
        // 收藏
        var loading = null;
        $('.btn-mark').on('click', function () {
            var that = this, api, num = 0;
            if ($(that).text() == '加入收藏') {
                api = '<?php echo \Kuxin\Helper\Url::build("user.mark.add",[],"");?>';
            } else {
                api = '<?php echo \Kuxin\Helper\Url::build("user.mark.del",[],"");?>';
            }
            $.ajax(api, {
                type: 'post',
                dataType: 'json',
                data: {
                    'novelid': $(that).data('novel-id'),
                },
                beforeSend: function () {
                    if (loading == null) {
                        loading = layer.load(1, {shade: [0.1, '#000']});
                    }
                },
                complete: function () {
                    if (loading != null) {
                        layer.close(loading);
                        loading = null;
                    }
                },
                success: function (res) {
                    if (res.code) {
                        layer.alert(res.msg, {icon: 2,}, function (index) {
                            if (res.data.redirect) {
                                window.location.href = res.data.redirect;
                            } else {
                                layer.close(index);
                            }
                        });
                    } else {
                        layer.msg('操作成功!');
                        if ($(that).text() == '加入收藏') {
                            $(that).text('取消收藏')
                        } else {
                            $(that).text('加入收藏')
                        }
                    }
                },
                error: function () {
                    layer.alert('收藏失败，请刷新页面后重试！', {icon: 2,});
                }
            });
        });
    </script>
	<!-- js-->
	<script src="<?php echo \Kuxin\Helper\Arr::getValue($_kxcms_config, "resurl");?>/template/kxwebno1/js/rankdetail.js"></script>
</body>
</html>