uninstall.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. if(!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) {
  3. exit('Access Denied');
  4. }
  5. $sql = <<<EOF
  6. DROP TABLE IF EXISTS `cdb_milu_seotool_included`, `cdb_milu_seotool_keyword`, `cdb_milu_seotool_keyword_rank`, `cdb_milu_seotool_spider`;
  7. EOF;
  8. runquery($sql);
  9. //헌뇜뻠닸
  10. $cache_dir = DISCUZ_VERSION != 'X2' ? 'sysdata' : 'cache';
  11. $cachefile = DISCUZ_ROOT.'./data/'.$cache_dir.'/milu_seotool_key.php';
  12. @unlink($cachefile);
  13. $cache_arr = array('milu_seotool_setting', 'milu_seotool_forum_catdata', 'milu_seotool_sitemap', 'milu_seotool_site_category', 'milu_seotool_keyword_data', 'milu_seotool_portal_catdata');
  14. foreach($cache_arr as $k => $v){
  15. DB::delete('common_syscache', "cname='$v'");
  16. }
  17. //貢籃뒈暠헌잿
  18. $sitemap_name_arr = array('html', 'txt', 'xml', 'xml.gz');
  19. foreach($sitemap_name_arr as $k => $v){
  20. @unlink(DISCUZ_ROOT.'/sitemap.'.$v);
  21. }
  22. //뻘覩reboot.txt
  23. $content = @file_get_contents(DISCUZ_ROOT.'/robots.txt');
  24. if($content){
  25. $text_arr = explode(PHP_EOL, $content);
  26. foreach($text_arr as $k => $v){
  27. if(strexists($v, 'sitemap')) unset($text_arr[$k]);
  28. }
  29. $text = implode(PHP_EOL, $text_arr);
  30. file_put_contents(DISCUZ_ROOT.'/robots.txt', $text);
  31. }
  32. $finish = TRUE;
  33. ?>