/** * 安装新的插件 */ public function newinstall() { $this->meta_title = '插件管理'; $dirlist = get_dir_list(ADDONS_PATH); $dirlist = str_replace('Plugin', '', $dirlist); $addoninfo = array(); foreach ($dirlist as $a) { $temarr = run_plugin_method($a, 'getConfig'); $mark = $a; //strtolower($temarr['mark']); $model = M('Addons')->where("mark='{$mark}'")->find(); if (empty($model)) { //没有信息说明还没有安装 $temarr['mark'] = $a; //strtolower($temarr['mark']); $temarr['install'] = 0; $temarr['status'] = 1; $temarr['type'] = 'other'; $addoninfo[] = $temarr; } } //trace($addoninfo); $list0 = array(); // $list1=array(); //排序 foreach ($addoninfo as $key => $a) { if ($a['install'] == '0') { $list0[] = $addoninfo[$key]; unset($addoninfo[$key]); // }else{ // $list1[]=$addoninfo[$key]; } } foreach ($addoninfo as $key => $a) { if ($a['status'] == '0') { $list0[] = $addoninfo[$key]; unset($addoninfo[$key]); } } foreach ($addoninfo as $key => $a) { if ($a['status'] == '1') { $list0[] = $addoninfo[$key]; unset($addoninfo[$key]); } } //$addoninfo=array_merge($list0,$list1); $page = new \Ainiku\Arrpage($list0, I('pg'), 10); $this->_list = $page->cur_page_data; $this->_page = $page->showpage(false); //$this->assign('_list',$list0); $this->display('index'); }
public function nolinkimg() { set_time_limit(0); $rows = M('Picture')->select(); //查找无效图片 //首先查找文章或产品中的图片(去除有效的) foreach ($rows as $key => $val) { $result = M('Article')->where("pic like '%{$val['id']}%'")->select(); if (0 < $result) { unset($rows[$key]); } $result = M('Goods')->where("pic like '%{$val['id']}%' or xc like '%{$val['id']}%'")->select(); if (0 < $result) { unset($rows[$key]); } $result = M('Category')->where("ico like '%{$val['id']}%'")->select(); if (0 < $result) { unset($rows[$key]); } $result = M('Link')->where("pic like '%{$val['id']}%'")->select(); if (0 < $result) { unset($rows[$key]); } } foreach ($rows as $key => $val) { $result = M('Article')->where("content like '%{$val['destname']}%'")->select(); if (0 < $result) { unset($rows[$key]); } $result = M('Goods')->where("content like '%{$val['destname']}%'")->select(); if (0 < $result) { unset($rows[$key]); } } $page = new \Ainiku\Arrpage($rows, 1, 10); $this->_list = $page->cur_page_data; $this->_page = $page->showpage(false); $this->meta_title = '无效图片管理'; $this->display('imglist'); }