<?php
if (!defined('IN_DISCUZ')) {
	exit('Access Denied');
}
class plugin_csdn123_news {
	protected static $zhiwu55_conf = array();
	public function plugin_csdn123_news() {
		global $_G;
		if (!isset($_G['cache']['plugin'])) {
			loadcache('plugin');
		}
		self::$zhiwu55_conf = $_G['cache']['plugin']['csdn123_news'];
		$zhiwu55_uid = self::$zhiwu55_conf['zhiwu55_uid'];
		if (strpos($zhiwu55_uid, ',') === false) {
			$zhiwu55_uid = array($zhiwu55_uid);
		} else {
			$zhiwu55_uid = explode(',', $zhiwu55_uid);
		}
		if (in_array($_G['uid'],$zhiwu55_uid)) {

			self::$zhiwu55_conf['disable']=false;

		} else {

			self::$zhiwu55_conf['disable']=true;
		}
	}
	function global_footer()
	{
		global $_G;
		$wwwzhiwu55com_cronUrl = $_G['siteurl'] . 'plugin.php?id=csdn123_news:zhiwu55_com';
		return '<script defer="defer" src="' . $wwwzhiwu55com_cronUrl . '"></script>';
	}
}
class plugin_csdn123_news_forum extends plugin_csdn123_news {
	public function post_top_output() {
		global $_G;
		if(!self::$zhiwu55_conf['disable'])	{
			$zhiwu55_fid = self::$zhiwu55_conf['zhiwu55_bbsfid'];
			$zhiwu55_fid = (array)unserialize($zhiwu55_fid);
			if (empty($zhiwu55_fid[0]) || in_array($_GET['fid'], $zhiwu55_fid)) {

				$zhiwu55_showmore = self::$zhiwu55_conf['zhiwu55_showmore'];
				if(!empty($_G['setting']['pluginhooks']['post_top']) && stripos($_G['setting']['pluginhooks']['post_top'],'zhiwu55keyword')!=false)
				{
					$zhiwu5comcn_15=lang('plugin/csdn123_news', 'zhiwu5comcn_15');
					return '<script>alert("'.$zhiwu5comcn_15.'");</script>';

				} else {

					include template('csdn123_news:post_forum');
					return $wwwzhiwu55com_return;

				}

			}
		}
	}
}
class plugin_csdn123_news_portal extends plugin_csdn123_news {
	public function portalcp_top_output() {
		global $_G;
		if(!self::$zhiwu55_conf['disable'])	{
			$zhiwu55_showmore = self::$zhiwu55_conf['zhiwu55_showmore'];
			if(!empty($_G['setting']['pluginhooks']['portalcp_top']) && stripos($_G['setting']['pluginhooks']['portalcp_top'],'zhiwu55keyword')!=false)
			{
				$zhiwu5comcn_15=lang('plugin/csdn123_news', 'zhiwu5comcn_15');
				return '<script>alert("'.$zhiwu5comcn_15.'");</script>';

			} else {
				
				include template('csdn123_news:post_portal');
				return $wwwzhiwu55com_return;
		
			}
		}
	}
}
class plugin_csdn123_news_group extends plugin_csdn123_news {
	public function post_top_output() {
		global $_G;
		if(!self::$zhiwu55_conf['disable'])	{
			$zhiwu55_showmore = self::$zhiwu55_conf['zhiwu55_showmore'];
			if(!empty($_G['setting']['pluginhooks']['post_top']) && stripos($_G['setting']['pluginhooks']['post_top'],'zhiwu55keyword')!=false)
			{
				$zhiwu5comcn_15=lang('plugin/csdn123_news', 'zhiwu5comcn_15');
				return '<script>alert("'.$zhiwu5comcn_15.'");</script>';

			} else {
				
				include template('csdn123_news:post_group');
				return $wwwzhiwu55com_return;
			}	
		}
	}
}