Update($addVisitSql);
$linkmanSql = "select linkman from data_phopo where delflag = 0 and ID = $pid order by ID desc";
$linkman = $DB->GetOne($linkmanSql);
if($linkman)
{
echo "";
}
}
/************************
* 投票 *
************************/
elseif( $action == 'vote' )
{
$phopoSql = "select type from data_phopo where delflag = 0 and ID = $pid order by ID desc";
$phopo = $DB->GetOne($phopoSql);
$StandardTime = time() - 1800;
$sql = "select * from `8264_data`.`data_action` where ip = '".$_SERVER['REMOTE_ADDR']."' and pid = '".$pid."' and datetime > '".$StandardTime."'";
$voteAction = $DB->GetAll($sql);
if($voteAction)
{
$actionFlag = false;
}
else
{
$actionFlag = true;
}
if(!$actionFlag)
{
echo "";
exit;
}
//end
$datetime = time();
$ip = $_SERVER["REMOTE_ADDR"];
$userid = '';
$username = '';
$pid = $pid;
$type = $phopo;
$action = '投票';
$actionSql = "INSERT INTO `8264_data`.`data_action` (
`userid` ,
`username` ,
`datetime` ,
`ip` ,
`type` ,
`action` ,
`pid`
)
VALUES (
'$userid',
'$username',
'$datetime',
'$ip',
'$type',
'$action',
'$pid'
)";
$actionID = $DB->insert($actionSql);
if($actionID > 0 )
{
$addVoteSql = " UPDATE `8264_data`.`data_phopo` SET `vote` = `vote` + 1 WHERE `data_phopo`.`ID` = $pid ";
$updateVote = $DB->Update($addVoteSql);
echo "";
exit;
}
}
/************************
* 内容 *
************************/
$col = "*";
$countcol = "count(*)";
$sql = " select ".$col." from data_phopo where delflag = 0 and type = 23 order by datetime desc ";
$countsql = " select ".$countcol." from data_phopo where delflag = 0 and type = 23 order by datetime desc ";
$Page = new buildNav; //建立分页对象
$Page->DB = $DB;//为分页对象设立数据库连接
$Page->total_result = $DB->GetOne( $countsql ); //为分页对象设置总记录数
$Page->limit = 500;
$Page->execute($sql); //产生分页数据集
$List = $Page->GetArray();
$tpl->assign("list",$List);
$tpl->assign("page",$Page->pagenav());
$tpl->display($TWTConfig['WebUrl']."/moban/zt/2009woman/left.html");
?>