由于 7.5 SP3优化版对后台UI部分做了大量更改,导致之前的7.X插件后台布局混乱,这样以来给
插件开发带来一定的麻烦,间隔了优化版的话,之前的版本使用起来显示就会乱套,兼顾之前的版本,优化版又会乱套。如果让用户为了插件去
修改后台相关文件,对用户来说也很麻烦,尤其是对那些很多新手。
其实要
解决这个
问题很简单,只需在后台
模板中的:
- include_once PrintEot('left');
下面加上
代码:
- if($wind_version >= "7.5 SP3" && $wind_repair >= "20100303")print <<<EOT
- -->
- <style type="text/css">
- ul{list-style-type:none;}
- .nav3 li .two,.nav3 li .two:hover{background:#336699;color:#fff;}
- .btn{border-color:#E76500;color:#fff;background:#F38C00;font-weight:bold;padding:.1em 1em;*padding:0 1em;}
- .btn,.btn2{border-width:1px;cursor:pointer;font-size:9pt; line-height:150%; overflow:visible;-moz-border-radius:2px;-khtml-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;}
- .btn2{background:#f7f7f7;border-color: #e4e4e4 #cccccc #cccccc #e4e4e4;padding:.1em .5em;*padding:0 .5em;}
- .tr3{font-size:12px;line-height:1.5;}
- .tr3 td,.tr3 th{padding:4px 4px 7px 10px;border-bottom:1px solid #eee;}
- .tr3 td td,.tr3 th td{border-bottom:0px;}
- .tr3:hover{background:#ddecf5;}
- .tr3 input{ vertical-align:middle;}
- .tr3 .input:hover{border:1px solid #2897c7;}
- .tr3 td table tr td,.tr3 th table tr td{padding:.4em;padding-left:0;}
- .tr3 th{text-align:left;font-weight:normal;}
- .tr3 textarea{line-height:140%;}
- .tr2{background:#fff;color:#0b63b5;line-height:28px;padding:0 8px 0 1em;height:28px;border:1px solid #b8d3e1;border-bottom:2px solid #b8d3e1;font-weight:700;}
- .tr4 td,.tr4 th{padding:4px 4px 7px 10px;border-bottom:1px solid #eee;color:#0b63b5;}
- .tr5{line-height:22px;padding:1em;}
- h2,h3{font-size:12px;height:28px;line-height:28px;padding:0 8px;color:#067098;border-top:1px dashed #ccc;background:#eee;margin-top:10px;font-weight:bold;}
- </style>
- <!--
- EOT;
就可以完美解决了,如果插件较多,可以将这些代码直接写入一个文件,然后直接
调用就更简单了,比如:
- <?php
- !function_exists('adminmsg') && exit('Forbidden');
- if($wind_version >= "7.5 SP3" && $wind_repair >= "20100303")print <<<EOT
- -->
- <style type="text/css">
- ul{list-style-type:none;}
- .nav3 li .two,.nav3 li .two:hover{background:#336699;color:#fff;}
- .btn{border-color:#1b72af;color:#fff;background:#3366cc;font-weight:bold;}
- .btn,.btn2{border-width:1px;cursor:pointer;padding:.1em 1em;*padding:0 1em;font-size:9pt; line-height:130%; overflow:visible;-moz-border-radius:2px;-khtml-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;}
- .btn2{background:#f7f7f7;border-color: #e4e4e4 #cccccc #cccccc #e4e4e4;}
- ol{font-size:12px;list-style:decimal;margin-left:2em;line-height:20px;}
- .tr3{font-size:12px;line-height:1.5;}
- .tr3 td,.tr3 th{padding:4px 4px 7px 10px;border-bottom:1px solid #eee;}
- .tr3 td td,.tr3 th td{border-bottom:0px;}
- .tr3:hover{background:#ddecf5;}
- .tr3 input{ vertical-align:middle;}
- .tr3 .input:hover{border:1px solid #2897c7;}
- .tr3 td table tr td,.tr3 th table tr td{padding:.4em;padding-left:0;}
- .tr3 th{text-align:left;font-weight:normal;}
- .tr2{background:#fff;color:#0b63b5;line-height:28px;padding:0 8px 0 1em;height:28px;border:1px solid #b8d3e1;border-bottom:2px solid #b8d3e1;font-weight:700;}
- .tr4 td,.tr4 th{padding:4px 4px 7px 10px;border-bottom:1px solid #eee;color:#0b63b5;}
- .tr5{line-height:22px;padding:1em;}
- h2,h3{font-size:12px;height:28px;line-height:28px;padding:0 8px;color:#067098;border-top:1px dashed #ccc;background:#eee;margin-top:10px;font-weight:bold;}
- </style>
- <!--
- EOT;
- ?>
将上面代码命名为 7.5SP3+.php 放进 hack/插件目录名/require,然后在:
- include_once PrintEot('left');
下面直接加上代码:
- require_once(H_P.'require/7.5SP3+.php');
就可以正常使用在
7.0以上PW版本了,我已经将上面代码保存到了一个文件,需要的朋友可以直接
下载使用。
另外,我做的插件很多都是从PW5.3到PW7.5全面
兼容,智能适应,对后台使用了一个专门的兼容文件适应版本,这次也顺便把新的兼容文件发出来,使用了我的最新版多媒体中心、
广告终结者、下载接口已经其他带新版检测功能的插件朋友,可以直接下载下面的兼容文件,覆盖到 hack/插件目录名/require 目录即可解决后台显示混乱问题。
[ 此帖被海峰在2010-08-27 15:28重新编辑 ]