<?php
require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'functions/RegBuildModule.php';
require dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'functions/MP4video.php';
RegisterPlugin("qiyeseo","ActivePlugin_qiyeseo");
function ActivePlugin_qiyeseo() {
	global $zbp;
	Add_Filter_Plugin('Filter_Plugin_Admin_TopMenu','qiyeseo_AddMenu');
	Add_Filter_Plugin('Filter_Plugin_Edit_Response5','qiyeseo_article_AO');
    Add_Filter_Plugin('Filter_Plugin_Category_Edit_Response','qiyeseo_cate_AO');
    Add_Filter_Plugin( 'Filter_Plugin_Edit_Response5', 'qiyeseo_MP4video' );
	if ($zbp->Config('qiyeseo')->seo=="1"){
		Add_Filter_Plugin('Filter_Plugin_Edit_Response5','qiyeseo_article_seo');
	    Add_Filter_Plugin('Filter_Plugin_Category_Edit_Response','qiyeseo_cate_seo');
	    Add_Filter_Plugin('Filter_Plugin_Tag_Edit_Response','qiyeseo_tag_seo');
	}
}
function qiyeseo_AddMenu(&$m){
	global $zbp;
	array_unshift($m, MakeTopMenu("root",'主题配置',$zbp->host . "zb_users/theme/$zbp->theme/admin/config.php","","topmenu_qiyeseo"));
	}
function qiyeseo_SubMenu($id){
	$arySubMenu = array(
		2 => array('基本配置', 'config', 'left', false),
		3 => array('首页设置', 'home', 'left', false),
		4 => array('SEO设置', 'seo', 'left', false),
		5 => array('文章页设置', 'article', 'left', false),
        7 => array('网页配色', 'color', 'left', false),
	);
	foreach($arySubMenu as $k => $v){
		echo '<a href="'.$v[1].'.php" '.($v[3]==true?'target="_blank"':'').'><span class="m-'.$v[2].' '.($id==$k?'m-now':'').'">'.$v[0].'</span></a>';
	}
}
function InstallPlugin_qiyeseo(){
	global $zbp;
	if(!$zbp->Config('qiyeseo')->HasKey('Version')){
		$zbp->Config('qiyeseo')->Version = '2.0';
        //网站基本设置---
		$zbp->Config('qiyeseo')->logo = $zbp->host . 'zb_users/theme/qiyeseo/style/logo.png'; 
		$zbp->Config('qiyeseo')->shopsign = $zbp->host . 'zb_users/theme/qiyeseo/style/shopsign.jpg'; 
		$zbp->Config('qiyeseo')->shopsignon = '0'; 
        $zbp->Config('qiyeseo')->webwidth = '960px'; 
        $zbp->Config( 'qiyeseo' )->search = '1';  
		$zbp->Config('qiyeseo')->daohang = '1';
		$zbp->Config('qiyeseo')->ejdh = '0';
		$zbp->Config( 'qiyeseo' )->breadcrumb = '1';
        $zbp->Config('qiyeseo')->clearSetting = '0'; 
        //网站首页
		$zbp->Config('qiyeseo')->banner = '0';
		$zbp->Config('qiyeseo')->bannersort = '0';
		$zbp->Config('qiyeseo')->bannerdiy = '';
		$zbp->Config('qiyeseo')->about = '请在后台主题配置——首页设置——关于我们模块设置企业简介内容。';
		$zbp->Config('qiyeseo')->aboutphoto = $zbp->host . 'zb_users/theme/qiyeseo/style/about.jpg';
		$zbp->Config('qiyeseo')->aboutmore = '#';
		$zbp->Config('qiyeseo')->qiyenews = '1';
		$zbp->Config('qiyeseo')->qiyenews_num = '10';
		$zbp->Config('qiyeseo')->shop = '1';
		$zbp->Config('qiyeseo')->shopid = '1';
		$zbp->Config('qiyeseo')->shopmore = '1';
		$zbp->Config('qiyeseo')->shop_num = '4';
		$zbp->Config('qiyeseo')->news_num = '10';

        $zbp->Config('qiyeseo')->hottags = '1';
		$zbp->Config('qiyeseo')->hottags2 = '1';
        $zbp->Config('qiyeseo')->hottagsnum = '20';
		$zbp->Config('qiyeseo')->flinks = '1';
		//seo
		$zbp->Config('qiyeseo')->seo = '1';
		$zbp->Config('qiyeseo')->seotitle = '企业通用营销网站|Z-blogPHP响应式主题模板';
        $zbp->Config('qiyeseo')->seokeywords = '网站关键字,用英文的逗号隔开！（一般不超过100个字符）';
        $zbp->Config('qiyeseo')->seodescription = '用一段话描述你的网站！（一般不超过200个字符）';
		$zbp->Config('qiyeseo')->zhuanzai = '转载声明：本站发布文章及版权归原作者所有，转载本站文章请注明文章来源！';
	    $zbp->Config('qiyeseo')->aurl = '1';  
		$zbp->Config('qiyeseo')->details = '1'; 
		$zbp->Config('qiyeseo')->piece = '1';
		$zbp->Config('qiyeseo')->caini = '1';
		$zbp->Config('qiyeseo')->caini_xz = '1';
		$zbp->Config('qiyeseo')->caini_num = '10';
        //网页配色
		$zbp->Config( 'qiyeseo' )->bgon = '1';
        $zbp->Config( 'qiyeseo' )->bgimg = 'http://qiyeseo.qiyeh5.com/zb_users/upload/2020/02/202002091581252415239757.jpg';
        $zbp->Config( 'qiyeseo' )->color1 = '#eae9e6';
        $zbp->Config( 'qiyeseo' )->color2 = '#fcfcfc';
        $zbp->Config( 'qiyeseo' )->color3 = '#333333';
        $zbp->Config( 'qiyeseo' )->color4 = '#b10202';
        $zbp->Config( 'qiyeseo' )->color5 = '#ca0202';
        $zbp->Config( 'qiyeseo' )->color6 = '#444444';
        $zbp->Config( 'qiyeseo' )->color62 = '#970202';

        $zbp->Config( 'qiyeseo' )->color9 = '#dddddd';
        $zbp->SaveConfig('qiyeseo');
	}
}
function UninstallPlugin_qiyeseo(){
	global $zbp;
	if ($zbp->Config('qiyeseo')->clearSetting){
		$zbp->DelConfig('qiyeseo');		
	}
}
?>