Add files via upload
This commit is contained in:
		
							
								
								
									
										10
									
								
								z_top/conf.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								z_top/conf.json
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "返回顶部",
 | 
			
		||||
    "brief": "从DZ移植来的 「萌化返回顶部 2.2」,<br>原插件http://addon.discuz.com/?@cat_backtop.plugin <br>暂时只有基础功能 待改进.. ",
 | 
			
		||||
    "version": "1.0",
 | 
			
		||||
    "bbs_version": "4.0",
 | 
			
		||||
    "installed": 0,
 | 
			
		||||
    "enable": 0,
 | 
			
		||||
    "hooks_rank": [],
 | 
			
		||||
    "dependencies": []
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										5
									
								
								z_top/hook/footer_js_after.htm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								z_top/hook/footer_js_after.htm
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
<!--  返回顶部插件 依赖jQuery 页面宽度低于800不加载 -->
 | 
			
		||||
<?php $setting = setting_get('z_top_setting');?>
 | 
			
		||||
<link rel="stylesheet" href="plugin/z_top/list/<?php echo $setting['body_start']; ?>/style.css?v1.0" media="screen and (min-width: 800px) ">
 | 
			
		||||
<script src="plugin/z_top/js/top.js?v1.0"></script>
 | 
			
		||||
<div id="backTop"><a href="javascript:;"></a></div>
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								z_top/icon.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								z_top/icon.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 11 KiB  | 
							
								
								
									
										17
									
								
								z_top/install.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								z_top/install.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	使用setting加速缓存存储设置项,似乎安装时要先创建一个setting?
 | 
			
		||||
	默认值设置为2吧..
 | 
			
		||||
	lalala...
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
!defined('DEBUG') AND exit('Forbidden');
 | 
			
		||||
 | 
			
		||||
$setting = setting_get('z_top_setting');
 | 
			
		||||
if(empty($setting)) {
 | 
			
		||||
	$setting = array('body_start'=>'2');
 | 
			
		||||
	setting_set('z_top_setting', $setting);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
?>
 | 
			
		||||
							
								
								
									
										16
									
								
								z_top/js/top.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								z_top/js/top.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,16 @@
 | 
			
		||||
				jQuery(document).ready(function(){
 | 
			
		||||
				    jQuery("#backTop").hide();
 | 
			
		||||
				    jQuery(function () {
 | 
			
		||||
				            jQuery(window).scroll(function(){
 | 
			
		||||
				            if (jQuery(window).scrollTop()>1000){
 | 
			
		||||
				                jQuery("#backTop").fadeIn(1000);
 | 
			
		||||
				                }else{
 | 
			
		||||
				                jQuery("#backTop").fadeOut(1000);
 | 
			
		||||
				                }
 | 
			
		||||
				            });
 | 
			
		||||
				            jQuery("#backTop").click(function(){
 | 
			
		||||
				                jQuery("body,html").animate({scrollTop:0},1000);
 | 
			
		||||
				                return false;
 | 
			
		||||
				                });
 | 
			
		||||
				        });
 | 
			
		||||
				});
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								z_top/list/1/img.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								z_top/list/1/img.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 14 KiB  | 
							
								
								
									
										4
									
								
								z_top/list/1/style.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								z_top/list/1/style.css
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
#backTop { opacity: 0.9;filter: alpha(opacity=90);position: fixed; _position:absolute; z-index:9999; bottom:0; right:0; display:none; height: 303px;width: 166px;background: url("img.png"); cursor:pointer}
 | 
			
		||||
#backTop a { display:block; overflow:hidden}
 | 
			
		||||
#backTop:hover {opacity: 1;filter: alpha(opacity=100)}
 | 
			
		||||
#scrolltop {display:none!important}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								z_top/list/2/img.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								z_top/list/2/img.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 14 KiB  | 
							
								
								
									
										4
									
								
								z_top/list/2/style.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								z_top/list/2/style.css
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
#backTop { opacity: 0.9;filter: alpha(opacity=90);position: fixed; _position:absolute; z-index:9999; bottom:0; right:0; display:none; height: 278px;width: 130px;background: url("img.png"); cursor:pointer}
 | 
			
		||||
#backTop a { display:block; overflow:hidden}
 | 
			
		||||
#backTop:hover {opacity: 1;filter: alpha(opacity=100)}
 | 
			
		||||
#scrolltop {display:none!important}
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								z_top/list/3/img.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								z_top/list/3/img.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 15 KiB  | 
							
								
								
									
										4
									
								
								z_top/list/3/style.css
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								z_top/list/3/style.css
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
#backTop { opacity: 0.9;filter: alpha(opacity=90);position: fixed; _position:absolute; z-index:9999; bottom:0; right:0; display:none; height: 258px;width: 172px;background: url("img.png"); cursor:pointer}
 | 
			
		||||
#backTop a { display:block; overflow:hidden}
 | 
			
		||||
#backTop:hover {opacity: 1;filter: alpha(opacity=100)}
 | 
			
		||||
#scrolltop {display:none!important}
 | 
			
		||||
							
								
								
									
										99
									
								
								z_top/setting.htm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								z_top/setting.htm
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,99 @@
 | 
			
		||||
<?php include _include(ADMIN_PATH.'view/htm/header.inc.htm');?>
 | 
			
		||||
 | 
			
		||||
<style>
 | 
			
		||||
/*
 | 
			
		||||
input[type="radio"] {
 | 
			
		||||
  margin: 3px 3px 0px 5px;
 | 
			
		||||
  display: none;
 | 
			
		||||
}
 | 
			
		||||
*/
 | 
			
		||||
label {
 | 
			
		||||
  padding-left: 20px;
 | 
			
		||||
  cursor: pointer;
 | 
			
		||||
  background: url(bg.gif) no-repeat left top;
 | 
			
		||||
}
 | 
			
		||||
label.checked {
 | 
			
		||||
  background-position: left bottom;
 | 
			
		||||
  background: #0ff ;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#form .row img { max-height:200px; margin:20px;}
 | 
			
		||||
#form .row .img { -webkit-filter: grayscale(100%); /* Chrome, Safari, Opera */ filter: grayscale(100%);}
 | 
			
		||||
#form .row span {   position: relative; left: 0px; top: -1rem; }
 | 
			
		||||
#form .row span {   background-color: #818a91;     display: inline-block;
 | 
			
		||||
    padding: .25em .4em;
 | 
			
		||||
    font-size: 75%;
 | 
			
		||||
    line-height: 1;
 | 
			
		||||
    color: #fff;
 | 
			
		||||
    white-space: nowrap;
 | 
			
		||||
    vertical-align: baseline;
 | 
			
		||||
    border-radius: .25rem;
 | 
			
		||||
    font-weight: 700;
 | 
			
		||||
    }
 | 
			
		||||
#form .row span input { position: relative; left: 0px; top: 0.15rem; }
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
<div class="row">
 | 
			
		||||
	<div class="col-lg-10 offset-lg-1">
 | 
			
		||||
		<div class="card">
 | 
			
		||||
			<div class="card-block">
 | 
			
		||||
				<form action="<?php echo url("plugin-setting-z_top");?>" method="post" id="form">
 | 
			
		||||
					<h4 class="card-title">萌化返回顶部插件</h4>
 | 
			
		||||
					<div class="form-group row">
 | 
			
		||||
					  <?php 
 | 
			
		||||
					  $dir = "../plugin/z_top/list/";
 | 
			
		||||
            $file = scandir($dir);
 | 
			
		||||
            //这个数组好tm微妙啊...
 | 
			
		||||
            for ($x=2; $x<count($file); $x++) {
 | 
			
		||||
            if ($x-1 == $setting['body_start'] ) {$checked = 'checked="checked"'; $nok = ''; $txt='  已激活';}else {$checked = ''; $nok='class="img"';$txt='';}
 | 
			
		||||
            echo '<label class="c-input c-radio">';
 | 
			
		||||
            echo '<img src="'.$dir.$file[$x].'/img.png" '.$nok.'><br>';
 | 
			
		||||
            echo '<span>'.$file[$x].$txt.' ';
 | 
			
		||||
            echo '<input type="radio" name="body_start" value="'.$file[$x].'" '.$checked.' /></span></label>';
 | 
			
		||||
            } 
 | 
			
		||||
 | 
			
		||||
					  ?>
 | 
			
		||||
         
 | 
			
		||||
						<div class="col-sm-10">
 | 
			
		||||
 | 
			
		||||
						</div>
 | 
			
		||||
					</div>
 | 
			
		||||
 | 
			
		||||
					<div class="form-group row">
 | 
			
		||||
						<label class="col-sm-2 form-control-label"></label>
 | 
			
		||||
						<div class="col-sm-10">
 | 
			
		||||
							<button type="submit" class="btn btn-primary btn-block" id="submit" data-loading-text="<?php echo lang('submiting');?>..."><?php echo lang('confirm');?></button>
 | 
			
		||||
							<a role="button" class="btn btn-secondary btn-block m-t-1" href="javascript:history.back();"><?php echo lang('back');?></a>
 | 
			
		||||
						</div>
 | 
			
		||||
					</div>
 | 
			
		||||
				</form>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<?php include _include(ADMIN_PATH.'view/htm/footer.inc.htm');?>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
 | 
			
		||||
var jform = $("#form");
 | 
			
		||||
var jsubmit = $("#submit");
 | 
			
		||||
var referer = '<?php echo http_referer();?>';
 | 
			
		||||
jform.on('submit', function(){
 | 
			
		||||
	jform.reset();
 | 
			
		||||
	jsubmit.button('loading');
 | 
			
		||||
	var postdata = jform.serialize();
 | 
			
		||||
	$.xpost(jform.attr('action'), postdata, function(code, message) {
 | 
			
		||||
		if(code == 0) {
 | 
			
		||||
			$.alert(message);
 | 
			
		||||
			jsubmit.text(message).delay(2000).button('reset').location(referer);
 | 
			
		||||
			return;
 | 
			
		||||
		} else {
 | 
			
		||||
			$.alert(message);
 | 
			
		||||
			jsubmit.button('reset');
 | 
			
		||||
		}
 | 
			
		||||
	});
 | 
			
		||||
	return false;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
							
								
								
									
										28
									
								
								z_top/setting.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								z_top/setting.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
	这里是选择角色时的处理文件..
 | 
			
		||||
	虽然只是记录一个数值还是分开写吧..
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
!defined('DEBUG') AND exit('Access Denied.');
 | 
			
		||||
 | 
			
		||||
$setting = setting_get('z_top_setting');
 | 
			
		||||
 | 
			
		||||
if($method == 'GET') {
 | 
			
		||||
	
 | 
			
		||||
	$input = array();
 | 
			
		||||
	$input['body_start'] = form_textarea('body_start', $setting['body_start'], '100%', '100px');
 | 
			
		||||
	
 | 
			
		||||
	include _include(APP_PATH.'plugin/z_top/setting.htm');
 | 
			
		||||
	
 | 
			
		||||
} else {
 | 
			
		||||
 | 
			
		||||
	$setting['body_start'] = param('body_start', '', FALSE);
 | 
			
		||||
	
 | 
			
		||||
	setting_set('z_top_setting', $setting);
 | 
			
		||||
	
 | 
			
		||||
	message(0, '修改成功');
 | 
			
		||||
}
 | 
			
		||||
	
 | 
			
		||||
?>
 | 
			
		||||
							
								
								
									
										8
									
								
								z_top/unstall.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								z_top/unstall.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
<?php
 | 
			
		||||
/*
 | 
			
		||||
	清除安装插件时创建的setting记录
 | 
			
		||||
	⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄.
 | 
			
		||||
*/
 | 
			
		||||
!defined('DEBUG') AND exit('Forbidden');
 | 
			
		||||
 setting_delete('z_top_setting');
 | 
			
		||||
?>
 | 
			
		||||
		Reference in New Issue
	
	Block a user