10-30-2013, 06:12 PM
Hi all
I have problem with added online time point script on my website,im added it and in bg_user added a_online_time,but its not give 5 online time point after 5min online in game...
here is screen:
2
and here is script:
<!DOCTYPE html>
<html>
<head>
<title>AutoIT Script By MaX</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript">
function Timer(id, minLimit, callback){
var thisTimer = this;
this.limit = minLimit * 60;
this.callback = callback;
this.timer = 0;
this.addEvent(window, load, function(){
thisTimer.el = document.getElementById(id);
thisTimer.txt = thisTimer.el.firstChild;
thisTimer.intv = setInterval(function(){thisTimer.intvFunc();}, 1000);
});
}
Timer.prototype = {
intvFunc: function(){
this.txt.nodeValue = this.formatTime(++this.timer);
if(this.timer === this.limit){
clearInterval(this.intv);
this.callback.call(this);
}
},
formatNum: function(n){
return n < 10? 0 + n : n;
},
formatTime: function (n, m, s){
s = n % 60;
m = (n - s) / 60;
return [this.formatNum(m), :, this.formatNum(s)].join();
},
addEvent: (function(){return window.addEventListener? function(el, ev, f){
el.addEventListener(ev, f, false);
}:window.attachEvent? function(el, ev, f){
el.attachEvent(on + ev, f);
}:function(){return;};
})()
};
// Usage: new Timer(id_of_counting_element, #_of_mins, callback_function(){});
new Timer(timer1, 5, function(){this.el.parentNode.style.color = red});
</script>
</head>
<body>
<?php
include settings.php ;
$connect = mysql_connect($server_ip, $user, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
mysql_select_db($database2) or die(mysql_error());
mysql_select_db($database3) or die(mysql_error());
// Add all needed website setting below:
$SiteSQL["config-server"] = 127.0.0.1 // mysql ip
$SiteSQL["config-username"] = username" // mysql username
$SiteSQL["config-password"] = password // mysql password
$SiteSQL["config-database_auth"] = newproject_db_auth // auth database
$SiteSQL["config-database_db"] = newproject_db // db database
$SiteSQL["config-database_data"] = newproject_data // data database
$Site_sqlcon = mysql_connect( $SiteSQL["config-server"] , $SiteSQL["config-username"] , $SiteSQL["config-password"] ) or die( mysql_error() );
echo "<b><font size=6>AutoIT Script By MaX</font></b><br />KEEP THIS FILE HIDDEN, ONLY RUN ON ROOT<br/>";
$mysql = mysql_select_db( $SiteSQL["config-database_db"] , $Site_sqlcon) or die( mysql_error() );
$result1 = mysql_query("SELECT a_portal_index from t_users WHERE a_zone_num > -1");
$result1a = mysql_query("SELECT count(a_index) from t_users WHERE a_zone_num > -1");
$r1a = mysql_fetch_row( $result1a );
$Effected = $r1a[0];
while($r1 = mysql_fetch_array( $result1 ))
{
$UID = $r1[a_portal_index];
$mysql2 = mysql_select_db( $SiteSQL["config-database_auth"] , $Site_sqlcon) or die( mysql_error() );
$result2 = mysql_query("UPDATE bg_user SET a_online_time = a_online_time + 5 where user_code = $UID");
}
?>
<hr/><br/>
Effected Accounts: <?PHP print $Effected; ?>
<div>Next AutoIT in 5 minutes: <span id="timer1">00:00</span></div>
Players will receive <font color = red><b><? print $points; ?></b></font> online points every 5 minutes.
<meta http-equiv="refresh" content="300; url=onlinetime.php">
</body>
</html>

