<?php


require_once( "_inc.php" );
echo "/*\n";
if ( !$gEnableClickIn )
{
	exit( "已禁用。\\n*/" );
}
$file = "clickindata.js";
$mTime = filemtime( $file );
if ( time( ) - $mTime < $gClickInRefreshInterval * 60 )
{
	exit( "不需要更新。\n*/" );
}
require_once( $dRootDir."inc/classes/template.php" );
require_once( $dRootDir."inc/classes/db.php" );
require_once( $dRootDir."inc/classes/util.php" );
$tpl = new template( $gTemplate );
$db = new db( $gDb );
$now = strtotime( $gTimezone." hours" );
$tpl->assign( "now", $now );
$content = $tpl->fetch( );
util::writefile( $file, $content );
echo date( "Y-m-d H:i:s", $now )." 更新成功。\n*/";
?>
