Page 1 of 1

dedicps tracking

Posted: 13 Mar 2018, 13:52
by aca
Hello undef,

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']); 
The whole part (between line 1195 and 1221) now looks like this:

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);
			}
		}
Hope this is ok. Greetz, aca

Re: dedicps tracking

Posted: 13 Mar 2018, 19:26
by undef.de
Added to the to do list and will be fixed in the next update. :thumbsup:

Re: dedicps tracking

Posted: 13 Mar 2018, 20:42
by hackie
undef.de wrote: 13 Mar 2018, 19:26 Added to the to do list and will be fixed in the next update. :thumbsup:

next update , that sounds sooooo exited. :roflol:

Re: dedicps tracking

Posted: 14 Mar 2018, 19:23
by undef.de
There is already an new update planned:
When it's done. 8-)

Re: dedicps tracking

Posted: 14 Mar 2018, 22:21
by hackie
undef.de wrote: 14 Mar 2018, 19:23 There is already an new update planned:
When it's done. 8-)
Nice ! :pil

Re: dedicps tracking

Posted: 15 Mar 2018, 11:32
by endbase
undef.de wrote: 14 Mar 2018, 19:23 There is already an new update planned:
When it's done. 8-)
Nice to hear undef :) :thumbsup:

Re: dedicps tracking

Posted: 18 Mar 2018, 00:20
by aca
forgot to check whether it is already an array :oops:

code must look like this:

Code: Select all

			if(!is_array($current['Checks'])){
					$current['Checks'] = explode(',',$current['Checks']);
			}
and has to be inserted in line 1186 and in the previous mentioned line

Re: dedicps tracking

Posted: 17 Apr 2018, 17:38
by undef.de
Will be fixed in 0.9.6 release.