<?
define('THIS_SCRIPT', 'dv_ajax');
require_once 'global.php';

LoadStyleJs();
switch($GLOBALS['setSign']){
	case 'Dhtml':
		_Show_Dhtml_FewROAll();
		break;
	case 'PicTab':
		_Show_PicTab();
		break;
	case 'Emot':
		_Show_Emot();
		break;
	case 'Eagicframe':
		_Show_Eagicframe();
		break;
	case 'DownLoad':
		_Show_DownLoad();
		break;
	default:
		break;
}

function _Show_Dhtml_FewROAll()
{
	global $userid,$userinfo,$arrUserToday,$UserToday,$lang,$GLOBALS,$board_settings,$groupsetting,$_DCACHE,$empath;
	$lang = load_lang($lang, 'post' );
	header('Content-Type: text/html;charset=UTF-8');
	require_once CACHE_PATH.'forum_pic.php';
	$empath = $_DCACHE['forum_emot'][0];

	require_once printout('dv_ajax');encoding_footer();
}
function _Show_Emot()//表情
{
	global $imgurl;
	require_once printout('dv_ajax');
}

function _Show_PicTab() //图片上传显示
{
	global $boardid,$imgurl,$groupsetting,$board_settings;
	$lang = load_lang($lang, 'post_upload' );
	header('Content-Type: text/html;charset=UTF-8');
	$strings11=ajax_UtfToGbk($lang['template.strings11'],"GB2312");

	$upset = intval($groupsetting[66]);//您最多只能同时上传{$upset}个文件
	$dateupnum = $arrUserToday[2];
	$lang['tpl.str1']=str_replace('{$upset}',$upset,$lang['tpl.str1']);
	$isnewbuy=(!empty($board_settings[57])) ? intval($board_settings[57]) :0;

	require_once printout('dv_ajax');

}

function _Show_Eagicframe() //魔法表情
{
	global $db,$dv,$imgurl,$fsetting;
	$lang = load_lang($lang, 'post' );
	header('Content-Type: text/html;charset=UTF-8');
	$str34=ajax_UtfToGbk($lang['tpl.str34'],"GB2312");
	$str35=ajax_UtfToGbk($lang['tpl.str35'],"GB2312");
	$str36=ajax_UtfToGbk($lang['tpl.str36'],"GB2312");

	if ($GLOBALS['action']==1)
	{
		if( $userid <= 0 ){
			$post_membername = $lang['tpl.str1'].'" readonly="readonly';
			$memberword = '**********" readonly="readonly';
		} else{
			$post_membername = $GLOBALS['membername'];
			$memberword = '**********';
		}

		$TopModeSelect = $MyTopicMode;
		$totalusetable = $fsetting['nowtablename'];
		$MoneyPostInfo = '';
		if( $query = $db->query("SELECT magicface_s,tmoney,tticket FROM {$dv}plus_tools_magicface ORDER BY id",array('pageSize'=>1)) ){
			$tmpResult = $db->fetch_row($query);
			$db->free_result($query);
		}
		if( empty($tmpResult) === false ){
			$firstmagicface = $tmpResult[0];
			$magicmoney = $tmpResult[1];
			$magicticket = $tmpResult[2];
		} else{
			$firstmagicface = 0;
			$magicmoney = 0;
			$magicticket = 0;
		}
	}

	require_once printout('dv_ajax');
}

function _Show_DownLoad()//效益
{
	global $imgurl,$arrDownLoad_benefit,$getDB_id;
	$currcachefile =CACHE_PATH.'Forum_DownLoad_benefit_File.php';
	if (file_exists($currcachefile))
	{
		require_once $currcachefile;
		$arrDownLoad_benefit = $Forum_DownLoad_benefit['DownLoad_benefit'];
		$arrdb=$arrDownLoad_benefit[$getDB_id];
		
		require_once INC_PATH.'BoardCache.class.php';
		dotDegree_Forum_DownLoad_benefit(1,$getDB_id,$arrDownLoad_benefit);//统计点击率
	}


	require_once printout('dv_ajax');
}



?>