<?php
/*
		[FuShow.cn] (C) 2013-2014 HXWY Inc.
		FuShow Friend V3.0				Id: magic_hot.php
		Email <service@fushow.cn>		http://fushow.cn/
*/

if(!defined('IN_FUSHOW')) {
	exit('Access Denied');
}

magic_check_idtype($id, $idtype);
//检查重复使用
if($_SGLOBAL['db']->result($_SGLOBAL['db']->query('SELECT COUNT(*) FROM '.tname('magicuselog')." WHERE id = '$id' AND idtype = '$idtype' AND uid = '$_SGLOBAL[supe_uid]' AND mid = '$mid'"), 0)) {
	showmessage("magicuse_object_once_limit");//已经对该信息使用过此道具，不能重复使用
}

//热点灯
if(submitcheck("usesubmit")) {

	//增加信息热点值
	$hot = intval($_SCONFIG['feedhotmin']);
	$_SGLOBAL['db']->query('UPDATE '.tname('feed')." SET hot = hot + $hot WHERE id = '$id' AND idtype = '$idtype' AND uid = '$_SGLOBAL[supe_uid]'");
	//增加日志热点值
	$_SGLOBAL['db']->query('UPDATE '.tname('blog')." SET hot = hot + $hot WHERE blogid = '$id' AND uid = '$_SGLOBAL[supe_uid]'");

	magic_use($mid, array('id'=>$id, 'idtype'=>$idtype), true);
	showmessage('magicuse_success', $_POST['refer']);
}

?>