Page 3 of 5

Re: [Xaseco] Best Checkpoints Widget

Posted: 31 Jan 2010 00:23
by weerwolf1
Hi all,

I found that the times displayed horizontally with the checkpoints below where so much apart, it took me to long time to compare cp's with my opponents. I have added a new funtion which displays the round times below each other ans the cp's from left to right. (see screenshot)
Image

Added in plugins.bestruns.php :

Code: Select all

		elseif ($orientation == 4){
			display_best_runs_v4($aseco);
		}
and:

Code: Select all

function display_best_runs_v4($aseco){ // affiche les best runs | Modified by weerwolf 30.01.2010
	global $tab_meilleurs_temps;
	$config = simplexml_load_file('bestruns.xml');
	//==================
	//print_r($config);
	//print_r($tab_meilleurs_temps);
	
	$posx_frame = $config->position->x; //main x position of the widget
	$posy_frame = $config->position->y; //main y position of the widget
	$nb_temps_cp = $config->checkpoints->nb_bestruns_with_cp;
	$nb_cp_temps = $config->checkpoints->nb_max_checkpoints;
	$texte;
	$min=0;
	$sec=0; 
	$cen=0; 
	$i = 0;
	$place = 1;
	
	$posx;	
	
	$xml='<?xml version="1.0" encoding="UTF-8"?>';
	$xml.='<manialink id="342312">';
	$xml.='<frame posn="' .$posx_frame. ' ' .$posy_frame. '">';
	$xml.='<format textsize="1"/>';
	
	foreach($tab_meilleurs_temps as $info){ //pour chaque enregistrement
		
		$min = (int) (($info->temps) / 60000);
		$sec = (int) ((($info->temps) - $min * 60000) / 1000);
		$cen = (int) (($info->temps - $min*60000 - $sec*1000) / 10);
		$texte ="$z$place. $0f9";
		$texte .= "$min:";
		if ($sec < 10) $texte .= "0";	
		$texte .= $sec.'.';
		if ($cen < 10) $texte .= "0";
		$texte .= $cen;
		
		$posy = $i * (-2);
		$xml.='<quad  posn="0 ' .$posy. '" sizen="14 2.2" halign="center" valign="center" style="Bgs1InRace" substyle="NavButton" />';
		$posy = $posy+0.1;
		$xml.='<label posn="-6.2 ' .$posy. '" sizen="6.5 2" halign="left" valign="center" text="'.$texte.'"/>';
		$xml.='<label posn="-0.4 ' .$posy. '" sizen="6.5 2" halign="left" valign="center" text="'.$info->nickname.'"/>';
		if ($i < $nb_temps_cp){ // affiche les checkpoints de chaque temps
			$ii = 0;
			foreach ($info->checks as $cp){
				if ($ii < $nb_cp_temps){
					$minn = (int) (($cp) / 60000);
					$secc = (int) ((($cp) - $minn * 60000) / 1000);
					$cenn = (int) (($cp - $minn*60000 - $secc*1000) / 10);
					$textee ="$z$fff";
					$textee .= "$minn:";
					if ($secc < 10) $textee .= "0";	
					$textee .= $secc.'.';
					if ($cenn < 10) $textee .= "0";
					$textee .= $cenn;
					$posx = 9.5 + ($ii * (5.2));
					$xml.='<quad  posn="' .$posx. " " .$posy. '" sizen="5.5 2.2" halign="center" valign="center" style="Bgs1InRace" substyle="NavButton" />';
					$xml.='<label posn="' .$posx. " " .$posy. '" sizen="5.5 2" halign="center" valign="center" text="'.$textee.'"/>';
					$ii++;
				}else{
					break;
				}
			}
		}
		$i++;
		$place++;
	}
	
	$xml.='</frame></manialink>';
	$aseco->client->query("SendDisplayManialinkPage", $xml, 0, false); //requete d'affichage
}
Hope you can use it ;)

Re: [Xaseco] Best Checkpoints Widget

Posted: 21 Feb 2010 18:31
by afisse
Last Revision (21/02/2010) :

V1.1 :
http://www.sendspace.com/file/j77ylv

Re: [Xaseco] Best Checkpoints Widget

Posted: 21 Feb 2010 20:37
by weerwolf1
Ok..... Was the idea above so awful that you even did not try to give a comment of it and considering adding it to updates? :ftw:

Re: [Xaseco] Best Checkpoints Widget

Posted: 22 Feb 2010 08:57
by Xymph
afisse wrote:Last Revision (21/02/2010) :
V1.1 :
http://www.sendspace.com/file/j77ylv
You seem to have forgotten to include the Readme file that was in the previous version of the zip.

Re: [Xaseco] Best Checkpoints Widget

Posted: 01 Mar 2010 08:59
by afisse
weerwolf1 wrote:Ok..... Was the idea above so awful that you even did not try to give a comment of it and considering adding it to updates? :ftw:
Main Post :mrgreen:

viewtopic.php?f=127&t=22232

Re: [Xaseco] Best Checkpoints Widget

Posted: 21 Mar 2010 00:03
by nerve
I modified it so that the checkpoints will update in realtime, and so that users can hide the widget. Also added in the fix for CPs going to newline.

http://www.iron-pulse.com/TM_Plugins/bestcps.zip

Re: [Xaseco] Best Checkpoints Widget

Posted: 26 May 2010 18:55
by easyshaker
Hi
I have a problem with the updated version of that plugin .I get this error message in Xaseco --> [PHP Warning] array_keys() expects parameter 1 to be array, null given on line 180 in file plugin.bestcps.php.
[PHP Warning] in_array() expects parameter 2 to be array, null given on line 180 in file plugin.bestcps.php.
has someone an idea?

sorry for my english i'm german :D :D :D :D :D :D :D :thumbsup:

Re: [Xaseco] Best Checkpoints Widget

Posted: 31 May 2010 07:13
by afisse
easyshaker wrote:Hi
I have a problem with the updated version of that plugin .I get this error message in Xaseco --> [PHP Warning] array_keys() expects parameter 1 to be array, null given on line 180 in file plugin.bestcps.php.
[PHP Warning] in_array() expects parameter 2 to be array, null given on line 180 in file plugin.bestcps.php.
has someone an idea?

sorry for my english i'm german :D :D :D :D :D :D :D :thumbsup:
Because you don't dowload my version XD

http://www.sendspace.com/file/j77ylv

Re: [Xaseco] Best Checkpoints Widget

Posted: 25 Oct 2010 17:36
by pepel
afisse wrote:Hi all, here is the best Checkpoints widget

Image
how to configurate it like author pic?
give me cod pls

Re: [Xaseco] Best Checkpoints Widget

Posted: 25 Oct 2010 17:46
by w1lla
try one of these in the .xml provided.

Code: Select all

<orientation>1</orientation><!--0 : horizontal, 1 : vertical_V1, 2 : vertical_V2, 3 : vertical_V3 -->

Re: [Xaseco] Best Checkpoints Widget

Posted: 03 Nov 2010 21:26
by micsoccer10
Hi ! How I can close the plugin when we are at the scores ?

Re: [Xaseco] Best Checkpoints Widget

Posted: 03 Nov 2010 22:28
by Ant
In v1.1 add this after line 14 in plugin.bestcps.php

Code: Select all

Aseco::registerEvent('onEndRace', 'clear_bestcps');
That will call this function (which is lines 252 - 255)

Code: Select all

function clear_bestcps($aseco, $challenge){//efface le widget entre 2 challenges
	$xml = '<manialink id="123123456"></manialink>';
    $aseco->client->query("SendDisplayManialinkPage", $xml, 1, false);
}

Re: [Xaseco] Best Checkpoints Widget

Posted: 04 Nov 2010 21:05
by micsoccer10
OMG It work !

Thanks you so much !

Re: [Xaseco] Best Checkpoints Widget

Posted: 05 Nov 2010 18:56
by Ant
no problem man :thumbsup:

Re: [Xaseco] Best Checkpoints Widget

Posted: 07 Nov 2010 22:01
by nerve
easyshaker wrote:Hi
I have a problem with the updated version of that plugin .I get this error message in Xaseco --> [PHP Warning] array_keys() expects parameter 1 to be array, null given on line 180 in file plugin.bestcps.php.
[PHP Warning] in_array() expects parameter 2 to be array, null given on line 180 in file plugin.bestcps.php.
has someone an idea?

sorry for my english i'm german :D :D :D :D :D :D :D :thumbsup:
fixed it, online zip updated - you can download it again from same link