SantaCruze
Erfahrenes Mitglied
Unset DB ist garnicht mehr drin im Script. Bei mir steht Zeile 20 die Class Anweisung
$db = new cl_extended_database;
und dann kommt das
$db = new cl_extended_database;
und dann kommt das
PHP:
if(isset($_GET['s']) && $somethingonbuild==1)
{
$taskid = $db->tasks_id_sci_on_build($_SESSION["coords"],$_GET['s']);
$db->task_kill($taskid);
$somethingonbuild=-1;
}
$buildlist = $db->planet_scilist($_SESSION["coords"]);
$smarty_buildlist = array();
$j=0;
foreach($buildlist as $sci_id => $lev)
{
$smarty_buildlist[$j]['id'] = $sci_id;
$smarty_buildlist[$j]['name'] = $db->sci_get_name($sci_id);
$smarty_buildlist[$j]['image'] = $db->sci_get_image($sci_id);
$smarty_buildlist[$j]['level'] = $lev-1;
$smarty_buildlist[$j]['buildlevel'] = $lev;
$smarty_buildlist[$j]['need_res'] = $db->formatted_sci_get_costs($sci_id,$lev);
$smarty_buildlist[$j]['need_time'] = $db->formatted_sci_get_time($sci_id,$lev,$_SESSION["coords"]);
$smarty_buildlist[$j]['color'] = "#FFFF00";
if($db->sci_can_build($_SESSION["coords"],$user_id,$sci_id))
{
$smarty_buildlist[$j]['color'] = "#00FF00";
}
else
{
$smarty_buildlist[$j]['color'] = "#FF0000";
}
$taskid = $db->tasks_id_sci_on_build($_SESSION["coords"],$sci_id);
if($taskid != -1)
{
$smarty_buildlist[$j]['onbuild'] = 1;
$smarty_buildlist[$j]['resttime'] = $db->tasks_endtime($taskid)-time();
if($smarty_buildlist[$j]['resttime'] < 0)
{
$smarty_buildlist[$j]['resttime'] = 0;
}
$smarty_buildlist[$j]['resttime_formatted'] = date("H:i:s",$smarty_buildlist[$j]['resttime']);
$smarty_buildlist[$j]['color'] = "#FFFFFF";
$somethingonbuild=1;
}
$db = new cl_extended_database;
$j++;
}