From 10a16b190e5a865c6efe8f3ec864b3bb251edb16 Mon Sep 17 00:00:00 2001 From: IQ Date: Thu, 22 Mar 2018 21:07:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'README.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/index.class.php | 26 +++++++ admin/install.class.php | 108 +++++++++++++++++++++++++ admin/templates/index.php | 19 +++++ admin/templates/js/own.js | 6 ++ admin/uninstall.class.php | 160 ++++++++++++++++++++++++++++++++++++++ icon.png | Bin 0 -> 31060 bytes lang/cleaner.sql | 15 ++++ 7 files changed, 334 insertions(+) create mode 100644 admin/index.class.php create mode 100644 admin/install.class.php create mode 100644 admin/templates/index.php create mode 100644 admin/templates/js/own.js create mode 100644 admin/uninstall.class.php create mode 100644 icon.png create mode 100644 lang/cleaner.sql diff --git a/admin/index.class.php b/admin/index.class.php new file mode 100644 index 0000000..1412f20 --- /dev/null +++ b/admin/index.class.php @@ -0,0 +1,26 @@ +template('own/index'); + } + + //处理 + public function dohandle(){ + global $_M; + load::sys_func('file'); + $str = deldir(PATH_WEB.'cache/',1)?$_M['word']['cleaner_yw002']:$_M['word']['cleaner_yw003']; + turnover($_M['url']['own_form'].'a=doindex',$str); + } +} +?> \ No newline at end of file diff --git a/admin/install.class.php b/admin/install.class.php new file mode 100644 index 0000000..546b821 --- /dev/null +++ b/admin/install.class.php @@ -0,0 +1,108 @@ +m_name}'"; + if($this->sqlone('applist',$where) != false){ + echo '请勿重复安装'; + return '请勿重复安装'; + exit; + } + do{ + $this->no = mt_rand(2001,9999); + $stall = $this->sqlone('applist'); + } while ($stall != false); + + //开始执行程序[需要的东西可以在下面执行了] + $this->appsql(); + //再执行自定义的一些表SQL + //$this->zdysql(); + //安装其他 + $this->mydefault(); + + echo '安装成功'; + return '安装成功'; + } + + //自定义SQL + private function zdysql() { + global $_M; + } + //执行APP相关的表数据插入 + private function appsql() { + global $_M; + + //注册应用 + $field = "no='{$this->no}',ver='{$this->ver}',m_name='{$this->m_name}',m_class='index',m_action='doindex',appname='\$_M[''word''][''cleaner_name'']',info='\$_M[''word''][''cleaner_info'']',addtime='1473590889',updatetime=''"; + $this->addsql('applist',$field); + } + + //全局默认参数 + private function mydefault() { + global $_M; + //安装语言包 + $cl = $this->langsql(); + + } + + //公共查询方法 + private function sqlone($tname,$where = '') { + global $_M; + $table = $_M['table'][$tname]; + if(!$where){ + $where = "no='{$this->no}'"; + } + return DB::get_one("select * from {$table} where {$where}"); + } + + //公共查询方法 + private function sqlall($tname,$where = '') { + global $_M; + $table = $_M['table'][$tname]; + if(!$where){ + $where = "no='{$this->no}'"; + } + return DB::get_all("select * from {$table} where {$where}"); + } + + //公共写入方法 + private function addsql($tname,$field = '') { + global $_M; + $table = $_M['table'][$tname]; + DB::query("INSERT INTO {$table} SET {$field}"); + } + + #云网开发工具生成 + private function langsql() { + global $_M; + $file = PATH_ALL_APP.$this->m_name.'/lang/'.$this->m_name.'.sql'; + $_sql = file_get_contents($file); + $_arr = explode("#;#;", $_sql); + foreach ($_arr as $val) { + $val = str_replace("{\$_M['config']['tablepre']}", $_M['config']['tablepre'], $val); + $val = str_replace("{\$this->no}", $this->no, $val); + DB::query($val); + } + } + +} +?> \ No newline at end of file diff --git a/admin/templates/index.php b/admin/templates/index.php new file mode 100644 index 0000000..bd1a41d --- /dev/null +++ b/admin/templates/index.php @@ -0,0 +1,19 @@ + +
+
+

{$_M['word']['cleaner_info']}

+
+
+ +
+
+
+
+