1
0
Code Issues Pull Requests Projects Releases Wiki Activity GitHub Gitee

插件代码上传

This commit is contained in:
2022-01-26 02:20:35 +08:00
commit 86848dbde0
58 changed files with 2231 additions and 0 deletions

103
public/copyright.php Normal file
View File

@@ -0,0 +1,103 @@
<?php
// error_reporting(E_ALL &~ E_NOTICE);
/* 除了notice以外的错误 */
// ini_set('display_errors', 'Off');
/* 隐藏所有错误 */
// $file = $_GET['path'];
$file = $blogpath.$copyrightfilepath.'plugin.xml';
//将XML中的数据,读取到数组对象中
$xml_object = simplexml_load_file($file);
$xml_json = json_encode($xml_object);
//对象转成json
$xml_arr = json_decode($xml_json,true);
//json再转成数组
// 输出$xml_arr
// echo "<pre>";
// var_dump($xml_arr);
// function getattr1($attribute) {
// global $xml_arr;
// try {
// echo $xml_arr[$attribute];
// } catch(Exception $e) {
// echo "";
// }
// }
?>
<br />
<script type="text/javascript">
$(document).ready(function(){
$(".btn1").click(function(){
$(".copyrightdiv").slideToggle(150);/* $(".copyrightdiv").toggle(); */
$('html,body').animate({ scrollTop: $(".copyrightdiv").offset().top - 90 }, 200)
});
});
</script>
<button class="btn1">查看/隐藏当前子插件版权信息</button>
<div class="copyrightdiv" style="display: none;">
<h1>插件版权信息如下:</h1>
<table data-sort="sortDisabled" style="width: 100%;">
<tbody>
<tr class="firstRow">
<td style="width: 100px;">插件信息</td>
<td>
<img src="<?php echo $bloghost.$copyrightfilepath; ?>/logo.png" width="64" height="64">
</td>
</tr>
<tr>
<td>插件名称</td>
<td><?php if( !is_array($xml_arr["name"]) ) {echo $xml_arr["name"];} ?></td>
</tr>
<tr>
<td>应用id</td>
<td><?php if( !is_array($xml_arr["id"]) ) {echo $xml_arr["id"];} ?></td>
</tr>
<tr>
<td>发布页面</td>
<td><?php if( !is_array($xml_arr["url"]) ) {echo $xml_arr["url"];} ?></td>
</tr>
<tr>
<td>版本号</td>
<td><?php if( !is_array($xml_arr["version"]) ) {echo $xml_arr["version"];} ?></td>
</tr>
<tr>
<td>创建日期</td>
<td><?php if( !is_array($xml_arr["pubdate"]) ) {echo $xml_arr["pubdate"];} ?></td>
</tr>
<tr>
<td>更新日期</td>
<td><?php if( !is_array($xml_arr["modified"]) ) {echo $xml_arr["modified"];} ?></td>
</tr>
<tr>
<td>插件价格</td>
<td><?php if( !is_array($xml_arr["price"]) ) {echo $xml_arr["price"];} ?></td>
</tr>
<tr>
<td>插件简介</td>
<td><?php if( !is_array($xml_arr["note"]) ) {echo $xml_arr["note"];} ?></td>
</tr>
<tr>
<td>插件介绍</td>
<td><?php if( !is_array($xml_arr["description"]) ) {echo $xml_arr["description"];} ?></td>
</tr>
<tr>
<td>插件作者</td>
<td>
作者名称:<?php if( !is_array($xml_arr["author"]["name"]) ) {echo $xml_arr["author"]["name"];} ?><br />
作者邮箱:<?php if( !is_array($xml_arr["author"]["email"]) ) {echo $xml_arr["author"]["email"];} ?><br />
作者网站:<?php if( !is_array($xml_arr["author"]["url"]) ) {echo $xml_arr["author"]["url"];} ?>
</td>
</tr>
</tbody>
</table>
</div>
<br /><br /><br />

View File

@@ -0,0 +1,24 @@
<?php
/* 公共头部开始 */
require '../../../../zb_system/function/c_system_base.php';
require '../../../../zb_system/function/c_system_admin.php';
$zbp->Load();
$action = 'root';
if (!$zbp->CheckRights($action) || empty($_GET['action'])) { $zbp->ShowError(6); die(); }
if (!$zbp->CheckPlugin('zxd_ctrlcenter')) { $zbp->ShowError(48); die(); }
//?><script>alert("<?php echo $_GET['action']; ?>");</script><?php
switch ($_GET['action']) {
case 'Delete':
$zbp->DelConfig('zxd_ctrlcenter'); ?>
<script>alert("插件设置清空完毕!");window.location.href="<?=$bloghost.'/zb_users/plugin/zxd_ctrlcenter/main.php'?>";</script>
<?php break;
default: ?>
<script>alert("啊喔,出了点问题~");window.location.href="<?=$bloghost.'/zb_users/plugin/zxd_ctrlcenter/main.php'?>";</script>
<?php break;
}
// 以上逻辑还有问题

7
public/plugin-disbtn.php Normal file
View File

@@ -0,0 +1,7 @@
<script>
function disbtnclick() {
window.open().location = "<?php echo $bloghost.'zb_users/plugin/zxd_ctrlcenter/plugin/'.$PluginName.'/manage/status.php?include=c_system_base&action=dis'; ?>";
}
</script>
<span style="position: relative; margin-left: 8px;"><img width="16" style="position: absolute;top: 50%;left: 50%;margin-top: -8px;margin-left: -8px;" src="<?php echo $bloghost.'zb_system/image/admin/ok.png'; ?>"/></span>&nbsp;<span id="pluginName"></span>插件已启用,<input type="submit" class="button" value="禁用插件" onclick="disbtnclick();">

6
public/plugin-enbbtn.php Normal file
View File

@@ -0,0 +1,6 @@
<script>
function enbbtnclick() {
window.open().location = "<?php echo $bloghost.'zb_users/plugin/zxd_ctrlcenter/plugin/'.$PluginName.'/manage/status.php?include=c_system_base&action=enb'; ?>";
}
</script>
<span style="position: relative; margin-left: 8px;"><img width="16" style="position: absolute;top: 50%;left: 50%;margin-top: -8px;margin-left: -8px;" src="<?php echo $bloghost.'zb_system/image/admin/information.png'; ?>"/></span>&nbsp;<span id="pluginName"></span>插件已禁用,<input type="submit" class="button" value="启用插件" onclick="enbbtnclick();">