config.inc.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <?php
  2. if(!defined('IN_DISCUZ')) {
  3. exit('Access Denied');
  4. }
  5. loadcache('plugin');
  6. if(!defined('DEBUG_MODE')) define('DEBUG_MODE', $_G['cache']['plugin']['milu_seotool']['show_error']);
  7. if(DEBUG_MODE){
  8. ini_set("display_errors", "On");
  9. error_reporting(E_ALL);
  10. }
  11. if($_GET['inajax']) ob_start();
  12. ob_implicit_flush();
  13. if($_GET['inajax']) ob_end_flush();
  14. define('GBK', strtoupper(CHARSET) == 'GBK');
  15. define('PLUGIN_DIR', DISCUZ_ROOT.'source/plugin/milu_seotool');
  16. define('PLUGIN_CACHE', PLUGIN_DIR.'/data/cache');
  17. define('PLUGIN_URL', $_G['siteurl'].'source/plugin/milu_seotool/');
  18. define('PLUGIN_PATH', DISCUZ_ROOT.'source/plugin/milu_seotool');
  19. define('WRAP', PHP_EOL);
  20. define('GET_URL', 'http://www.56php.com/');
  21. //爬虫
  22. $milu_seotool_config = array(
  23. 'spider_type_arr' => array('googlebot' => lang('plugin/milu_seotool', 'google'), 'baiduspider' => lang('plugin/milu_seotool', 'baidu'), 'msnbot' => 'MSN','slurp' => 'Yahoo', 'sohu-search' => lang('plugin/milu_seotool', 'sohu'), 'lycos' => 'lycos','robozilla' => 'Robozilla', 'sosospider' => lang('plugin/milu_seotool', 'soso'), 'sogou' => lang('plugin/milu_seotool', 'sogou'), '360spider' => '360', 'bingbot' => lang('plugin/milu_seotool', 'bing')),//spider统一小写
  24. //数据库保存用数字比较省事
  25. 'spider_id_arr' => array('googlebot' => 1,'baiduspider' => '2', 'msnbot' => '3','slurp' => '4', 'sohu-search' => '5','lycos' => '6','robozilla' => '7', 'sosospider' => '8','sogou' => '9', '360spider' => 10, 'bingbot' => 11),
  26. //爬行区域分类
  27. 'spider_group_rules' => array(
  28. 1 => array(
  29. 'name' => lang('plugin/milu_seotool', 'bbs'),
  30. 'rules' => array('basescript' => 'forum'),
  31. 'child' => array(
  32. 1 => array(
  33. 'name' => lang('plugin/milu_seotool', 'index_'),
  34. 'rules' => array(),
  35. ),
  36. 2 => array(
  37. 'name' => lang('plugin/milu_seotool', 'thread_list'),
  38. 'rules' => array('mod' => 'forumdisplay', 'fid' => TRUE),
  39. ),
  40. 3 => array(
  41. 'name' => lang('plugin/milu_seotool', 'thread_detail'),
  42. 'rules' => array('mod' => 'viewthread', 'tid' => TRUE),
  43. ),
  44. )
  45. ),
  46. 2 => array(
  47. 'name' => lang('plugin/milu_seotool', 'portal'),
  48. 'rules' => array('basescript' => 'portal'),
  49. 'child' => array(
  50. 1 => array(
  51. 'name' => lang('plugin/milu_seotool', 'index_'),
  52. 'rules' => array(),
  53. ),
  54. 2 => array(
  55. 'name' => lang('plugin/milu_seotool', 'article_list'),
  56. 'rules' => array('mod' => 'list', 'gp_catid' => TRUE),
  57. ),
  58. 3 => array(
  59. 'name' => lang('plugin/milu_seotool', 'article_detail'),
  60. 'rules' => array('mod' => 'view', 'gp_aid' => TRUE),
  61. ),
  62. )
  63. ),
  64. 3 => array(
  65. 'name' => lang('plugin/milu_seotool', 'blog_'),
  66. 'rules' => array('basescript' => 'home'),
  67. 'child' => array(
  68. 1 => array(
  69. 'name' => lang('plugin/milu_seotool', 'index_'),
  70. 'rules' => array(),
  71. ),
  72. 2 => array(
  73. 'name' => lang('plugin/milu_seotool', 'dongtai'),
  74. 'rules' => array('mod' => 'space', 'gp_do' => 'home'),
  75. ),
  76. 3 => array(
  77. 'name' => lang('plugin/milu_seotool', '_record'),
  78. 'rules' => array('mod' => 'space', 'gp_do' => 'doing'),
  79. ),
  80. 4 => array(
  81. 'name' => lang('plugin/milu_seotool', 'rizhi_'),
  82. 'rules' => array('mod' => 'space', 'gp_do' => 'blog'),
  83. ),
  84. 5 => array(
  85. 'name' => lang('plugin/milu_seotool', 'album'),
  86. 'rules' => array('mod' => 'space', 'gp_do' => 'album'),
  87. ),
  88. 6 => array(
  89. 'name' => lang('plugin/milu_seotool', '_thread'),
  90. 'rules' => array('mod' => 'space', 'gp_do' => 'thread'),
  91. ),
  92. 7 => array(
  93. 'name' => lang('plugin/milu_seotool', 'share'),
  94. 'rules' => array('mod' => 'space', 'gp_do' => 'share'),
  95. ),
  96. 8 => array(
  97. 'name' => lang('plugin/milu_seotool', 'friend'),
  98. 'rules' => array('mod' => 'space', 'gp_do' => 'friend'),
  99. ),
  100. 9 => array(
  101. 'name' => lang('plugin/milu_seotool', 'wall_'),
  102. 'rules' => array('mod' => 'space', 'gp_do' => 'wall'),
  103. ),
  104. 10 => array(
  105. 'name' => lang('plugin/milu_seotool', 'profile'),
  106. 'rules' => array('mod' => 'space', 'gp_do' => 'profile'),
  107. ),
  108. 11 => array(
  109. 'name' => lang('plugin/milu_seotool', 'blog_index'),
  110. 'rules' => array('mod' => 'space', 'gp_uid' => TRUE, 'gp_view' => 'admin'),
  111. ),
  112. )
  113. ),
  114. ),
  115. );
  116. loadcache('milu_seotool');
  117. if( (!$pluin_info = $_G['cache']['milu_seotool'] ) || ( $_G['cache']['milu_seotool']['version'] != $_G['setting']['plugins']['version']['milu_seotool'] ) || $milu_seotool_config != $_G['cache']['milu_seotool']['config']){
  118. $pluin_info = DB::fetch_first("SELECT * FROM ".DB::table('common_plugin')." WHERE identifier='milu_seotool'");
  119. $pluin_info['config'] = $milu_seotool_config;
  120. save_syscache('milu_seotool', $pluin_info);
  121. }
  122. define('PLUGIN_ID', $pluin_info['pluginid']);
  123. define('PLUGIN_VERSION', $pluin_info['version']);//版本号
  124. define('PLUGIN_GO', 'action=plugins&operation=config&do='.PLUGIN_ID.'&identifier=milu_seotool&pmod=');
  125. define('PLUGIN_CACHE_SIZE', 25);//缓冲区最大空间 单位MB 超过指定大小将全部清空缓存
  126. define('PLUGIN_ENABLE_CACHE', FALSE);//开启缓存? TRUE
  127. if(!defined('DISCUZ_VERSION')) require_once(DISCUZ_ROOT.'/source/discuz_version.php');
  128. require_once(PLUGIN_DIR.'/version.php');
  129. require_once(PLUGIN_DIR.'/lib/function.global.php');
  130. define('SEO_WORD_FILE', PLUGIN_DIR.'/data/word.dat');//seo词库文件
  131. ?>