I wondered, why I couln't switch from lokal-cp-tracking (/cps) to dedi-cp-tracking (/dedicps) and found when using /dedicps the following PHP-warning in my logs:
[PHP Warning] end() expects parameter 1 to be array, string given on line 1207 in file /uaseco/plugins/plugin.checkpoints.php
I think I fixed this (switching now works for me and no more warning) by inserting a line in the plugin.checkpoints.php in line 1201:
Code: Select all
$current['Checks'] = explode(',',$current['Checks']);
Code: Select all
else if ($this->checkpoints[$login]->tracking['dedimania_records'] == 0 && isset($aseco->plugins['PluginDedimania']) && isset($aseco->plugins['PluginDedimania']->db['Map']) && isset($aseco->plugins['PluginDedimania']->db['Map']['Records']) && !empty($aseco->plugins['PluginDedimania']->db['Map']['Records'])) {
// Search for own/last record
$record = 0;
$current = false;
while ($record < count($aseco->plugins['PluginDedimania']->db['Map']['Records'])) {
$current = $aseco->plugins['PluginDedimania']->db['Map']['Records'][$record++];
$current['Checks'] = explode(',',$current['Checks']);
if ($current['Login'] == $login) {
break;
}
}
// Check for valid checkpoints
if (!empty($current['Checks']) && $current['Best'] == end($current['Checks'])) {
$this->checkpoints[$login]->best['finish'] = (int)$current['Best'];
$this->checkpoints[$login]->best['cps'] = $current['Checks'];
}
// Send Widget
if ($current['Login'] == $login) {
// $this->buildTimeDiffWidget($login, '$<$NPersonal Best$>', true);
$this->buildTimeDiffWidget($login, '$<$NOwn '. $record .'. Dedimania Record$>', false);
}
else {
$this->buildTimeDiffWidget($login, '$<$N'. $record .'. Dedimania Record$>', false);
}
}