更新搜索功能,优化悬浮小图标位置
parent
38d60c3511
commit
fe5ba292dc
|
@ -104,4 +104,5 @@
|
|||
1. 2018年5月1日 22:59:35 经网友反馈安装完成后数据库未导入数据的问题,现已更新初始数据库文件。
|
||||
2. 2018年5月2日 15:56:05 更新数据库文件,更新ajax评论提交,更新小细节
|
||||
3. 2018年5月3日 22:04:35 修复一个bug
|
||||
4. 2018年5月5日 13:16:16 完善程序安装,修复安装错误,修复安装锁错误,修复评论提交失败,更新三个小工具
|
||||
4. 2018年5月5日 13:16:16 完善程序安装,修复安装错误,修复安装锁错误,修复评论提交失败,更新三个小工具
|
||||
5. 2018年5月6日 14:16:12 更新搜索功能,优化悬浮小图标位置
|
File diff suppressed because one or more lines are too long
|
@ -143,7 +143,9 @@ if($id){
|
|||
}
|
||||
#f_list{position:fixed;right:30px;bottom:60px;transition:bottom ease .3s;z-index:9;font-size:18px;text-align:center;line-height:36px}
|
||||
#f_list a.btn{width:36px;height:36px;display:block;text-decoration:none;color:#999;border-radius:5px}
|
||||
|
||||
@media screen and (max-width: 720px) {
|
||||
#f_list {right:0px;}
|
||||
}
|
||||
.centent{min-height:500px;}
|
||||
</style>
|
||||
</head>
|
||||
|
|
151
index.php
151
index.php
|
@ -18,48 +18,84 @@ if(getParam('url')){
|
|||
if(getParam('sort')){
|
||||
echo '<style>#choose-tool{display:none;}</style>';
|
||||
$tools_list=$sp->findall(array("tools_type= '".deepEscape(getParam('sort'))."'and state=0"),constant("Desc"),"*");//查询分类
|
||||
}elseif(getParam('query')){
|
||||
echo '<style>.search-fr{display:none;}</style>';
|
||||
$tools_list=$sp->findall(array("title like '%".deepEscape(getParam('query'))."%'"),constant("Desc"),"*");//查询标题
|
||||
}else{
|
||||
$tools_list=$sp->findall(array('state'=>'0'),constant("Desc"),"*");
|
||||
}
|
||||
}
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/bootstrap-select.min.css">
|
||||
<script src="/js/bootstrap-select.min.js"></script>
|
||||
|
||||
<?php if(constant('templates')=='1'){?>
|
||||
<div class="search-fr">
|
||||
<style>
|
||||
.search-fr{float:right;margin-right:145px;}
|
||||
@media screen and (max-width: 720px) {
|
||||
.search-fr {float:none;margin-right:0px;text-align:center;}
|
||||
}
|
||||
|
||||
if(constant('templates')=='1'){
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="css/temp_one.css">
|
||||
<div class="container centent" style="padding-bottom:20px;">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="row">
|
||||
<?php if(!$tools_list){echo '目前没有工具!';}?>
|
||||
<?php foreach ($tools_list as $age) {
|
||||
$toolsurl = constant("Tools_url").'?url='.$age['tools_url'];
|
||||
?>
|
||||
</style>
|
||||
<form class="form-horizontal" role="form">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1">
|
||||
<select id="basic" class="selectpicker" data-live-search="true">
|
||||
<option data-subtext="搜索">搜索</option>
|
||||
<?php foreach ($tools_list as $age) {?>
|
||||
<option data-subtext="<?php echo $age['title'];?> <?php echo $age['tools_url'];?>"><?php echo $age['title'];?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('.selectpicker').on('changed.bs.select',function(e){
|
||||
$(window).attr('location','?query='+$('#basic').val());
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="css/temp_one.css">
|
||||
<div class="container centent" style="padding-bottom:20px;">
|
||||
<div class="row row-xs">
|
||||
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
||||
<div class="row">
|
||||
<?php if(!$tools_list){
|
||||
echo '<div class="row row-centered">
|
||||
<div class="form-group" id="input-wrap">
|
||||
<h1 class="text-center" style="font-size: 80px;">没有工具</h1>
|
||||
<h3 class="text-center"><script>text()</script></h3>
|
||||
</div>
|
||||
</div>';}?>
|
||||
<?php foreach ($tools_list as $age) {
|
||||
$toolsurl = constant("Tools_url").'?url='.$age['tools_url'];
|
||||
?>
|
||||
|
||||
<div class="col-xs-12 col-sm-3 boxs">
|
||||
<div class="item-inner">
|
||||
<div class="item-hd">
|
||||
<a target="_blank" href="<?php echo $toolsurl;?>" class="item-icon"><img src="<?php echo $age['tools_img'];?>" width="48" height="48" alt="coderunner"></a>
|
||||
<h3><a target="_blank" href="<?php echo $toolsurl;?>"><?php echo $age['title'];?></a></h3>
|
||||
<span class="item-category">[<a target="_blank" rel="nofollow" href="../?sort=<?php echo $age['tools_type'];?>"><?php echo $age['tools_type'];?></a>]</span>
|
||||
<a title="喜欢" class="likeable" href="javascript:ajax_love(<?php echo $age['id'];?>)" data-slug="coderunner" data-url="//<?php echo constant("Tools_url");?>" id="tools_love_<?php echo $age['id'];?>" <?php if ($_COOKIE["love_id_".$age['id']]) {echo 'style="color:red;"';}?>><i class="fa fa-heart"></i><var><?php echo $age['tools_love'];?></var></a>
|
||||
<a title="访问次数" class="see" data-slug="coderunner" data-url="<?php echo constant("Tools_url");?>" id="tools_<?php echo $age['id'];?>"><i class="fa fa-eye"></i><var><?php echo $age['tools_number'];?></var></a>
|
||||
</div>
|
||||
<div class="item-bd">
|
||||
<div class="item-desc" title="<?php echo $age['explains'];?>"><?php echo $age['explains'];?></div>
|
||||
</div>
|
||||
<div class="item-ft">
|
||||
<a target="_blank" class="item-link" href="<?php echo $toolsurl;?>"><?php echo $age['tools_url'];?></a>
|
||||
<a target="_blank" class="item-btn" href="<?php echo $toolsurl;?>">进入</a>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-3 boxs">
|
||||
<div class="item-inner">
|
||||
<div class="item-hd">
|
||||
<a target="_blank" href="<?php echo $toolsurl;?>" class="item-icon"><img src="<?php echo $age['tools_img'];?>" width="48" height="48" alt="coderunner"></a>
|
||||
<h3><a target="_blank" href="<?php echo $toolsurl;?>"><?php echo $age['title'];?></a></h3>
|
||||
<span class="item-category">[<a target="_blank" rel="nofollow" href="../?sort=<?php echo $age['tools_type'];?>"><?php echo $age['tools_type'];?></a>]</span>
|
||||
<a title="喜欢" class="likeable" href="javascript:ajax_love(<?php echo $age['id'];?>)" data-slug="coderunner" data-url="//<?php echo constant("Tools_url");?>" id="tools_love_<?php echo $age['id'];?>" <?php if ($_COOKIE["love_id_".$age['id']]) {echo 'style="color:red;"';}?>><i class="fa fa-heart"></i><var><?php echo $age['tools_love'];?></var></a>
|
||||
<a title="访问次数" class="see" data-slug="coderunner" data-url="<?php echo constant("Tools_url");?>" id="tools_<?php echo $age['id'];?>"><i class="fa fa-eye"></i><var><?php echo $age['tools_number'];?></var></a>
|
||||
</div>
|
||||
<div class="item-bd">
|
||||
<div class="item-desc" title="<?php echo $age['explains'];?>"><?php echo $age['explains'];?></div>
|
||||
</div>
|
||||
<div class="item-ft">
|
||||
<a target="_blank" class="item-link" href="<?php echo $toolsurl;?>"><?php echo $age['tools_url'];?></a>
|
||||
<a target="_blank" class="item-btn" href="<?php echo $toolsurl;?>">进入</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php }else{
|
||||
</div>
|
||||
<?php }else{
|
||||
/*拼音库用于首页分类卡片
|
||||
*作用不大,可用可不用
|
||||
*但是需要手动修改分类目录的class
|
||||
|
@ -67,6 +103,11 @@ if(constant('templates')=='1'){
|
|||
include 'function.py.php';
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/templates.css">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="container centent">
|
||||
<ol class="breadcrumb" id="choose-tool">
|
||||
<li class="active" data-class=".tool-item">
|
||||
|
@ -75,13 +116,44 @@ include 'function.py.php';
|
|||
<li data-class=".<?php if($age['tools_type']){echo pinyin($age['tools_type'], 'first');}else{echo 'qt';}?>">
|
||||
<span><?php echo $age['tools_type'];?></span></li>
|
||||
<?php }?>
|
||||
</ol>
|
||||
<div class="row">
|
||||
<?php if(!$tools_list){echo '目前没有工具!';}?>
|
||||
<div class="search-fr">
|
||||
<style>
|
||||
/*.search-fr{ position:fixed;right: 143px;z-index: 999;}
|
||||
.dropdown-menu{max-height:216px}
|
||||
@media screen and (max-width: 720px) {
|
||||
.search-fr {display:none;}
|
||||
}*/
|
||||
.search-fr{float:right;}
|
||||
@media screen and (max-width: 720px) {
|
||||
.search-fr {float:none;text-align:center;}
|
||||
}
|
||||
</style>
|
||||
<form class="form-horizontal" role="form">
|
||||
<div class="form-group">
|
||||
<div class="col-lg-1">
|
||||
<select id="basic" class="selectpicker" data-live-search="true">
|
||||
<option data-subtext="搜索">搜索</option>
|
||||
<?php foreach ($tools_list as $age) {?>
|
||||
<option data-subtext="<?php echo $age['title'];?> <?php echo $age['tools_url'];?>"><?php echo pinyin($age['title'], 'first');?></option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</ol>
|
||||
<div class="row">
|
||||
<?php if(!$tools_list){
|
||||
echo '<div class="row row-centered">
|
||||
<div class="form-group" id="input-wrap">
|
||||
<h1 class="text-center" style="font-size: 80px;">没有工具</h1>
|
||||
<h3 class="text-center"><script>text()</script></h3>
|
||||
</div>
|
||||
</div>';}?>
|
||||
<?php foreach ($tools_list as $age) {
|
||||
$toolsurl = constant("Tools_url").'?url='.$age['tools_url'];
|
||||
?>
|
||||
<div class="col-sm-6 col-md-4 col-lg-3 tool-item <?php if($age['tools_type']){echo pinyin($age['tools_type'], 'first');}else{echo 'qt';}?>">
|
||||
<div class="col-sm-6 col-md-4 col-lg-3 tool-item <?php if($age['tools_type']){echo pinyin($age['tools_type'], 'first');}else{echo 'qt';}?> <?php echo pinyin($age['title'], 'first');?>">
|
||||
<a href="<?php echo $toolsurl;?>">
|
||||
<div class="maple-tool-item image-shadow">
|
||||
<span class="maple-tool-icon maple-tool-item-color<?php echo rand(1,6);?>"><?php echo mb_substr($age['title'],0,1,'utf-8');?></span>
|
||||
|
@ -100,6 +172,19 @@ include 'function.py.php';
|
|||
<?php }?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$('.selectpicker').on('changed.bs.select',function(e){
|
||||
|
||||
$('.dropdown-toggle').data("class",'.'+$('#basic').val());
|
||||
$('.dropdown-toggle').removeClass("active");
|
||||
if ($('.dropdown-toggle').attr('class') == 'active') return false;
|
||||
$('.dropdown-toggle').addClass("active");
|
||||
if($('.dropdown-toggle').data("class")=='.搜索'){
|
||||
$(".tool-item").show();
|
||||
}else{if ($('.dropdown-toggle').data("class") !== ".tool-item") $(".tool-item").hide();}
|
||||
$($('.dropdown-toggle').data("class")).fadeIn(0);
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#choose-tool li').click(function() {
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue