struggling to code this class.

if you go to ts3admin.info you will see there is a documentation tab. i’m struggling to build together.

Spesifically these 2 parts.

This is the actual class function:

[php] function clientGetDbIdFromUid($cluid) {
if(!$this->runtime[‘selected’]) { return $this->checkSelected(); }
return $this->getData(‘array’, ‘clientgetdbidfromuid cluid=’.$cluid);
}[/php]

This is the class usage

[php]clientGetDbIdFromUid ($cluid)

clientGetDbIdFromUid[/php]

Displays the database ID matching the unique identifier specified by cluid.

Output:

[php]Array
{
[cluid] => nUixbsq/XakrrmbqU8O30R/D8Gc=
[cldbid] => 2
}
Author
Par0noid Solutions
Parameters
string $cluid clientUID
Returns
array clientInfo[/php]

As you can see it’s actually pretty simple… but this code is stubborn for some reason…

see i can pull the $cluid data from another place, and fill that in. but how do i get it to actually retrieve the "[cldbid]’ part… i can’t get that value from this function?

This is an example usage of another code, which is similair.

[php] if(!$tsAdmin->serverGroupAddClient($sg, $_GET[‘id’])) {
#show error if client kick was failed
echo ‘’;
}[/php]

Basically i have $sg as the setting and $_GET[‘id’] is the data from the weblink api id=(value)

simple, easy… but i’m just struggling so hard with the other one… please put together an example for me to use that function.

Well, I am not sure, but, if you use your function like this:
$test=clientGetDbIdFromUid(1);
And, it returns an array like you posted:
Array
{
[cluid] => nUixbsq/XakrrmbqU8O30R/D8Gc=
[cldbid] => 2
}
Then, you access the data like this:
$cluid = $test[‘cluid’];
$cldbid = $test[‘cldbid’];

Not sure if that is what you are asking for…

ADDED: By the way, to debug this, get to the point in your code where it runs this function and just display
the results using the print_r(); function to see the internal values in it. Then, you can figure out how to pull out
the data inside it.

Sponsor our Newsletter | Privacy Policy | Terms of Service