Hello, I have a problem.
This is my core.php file.
[php]<?php
require_once(“src/ts3admin.class.php”);
require_once(“config/config-admin.php”);
require_once(“config/config-login.php”);
function include_all_php($folder){
foreach (glob(“funkcje/Administrator/*.php”) as $filename)
{
include $filename;
fopen(“filename”, “r”);
}
}
include_all_php(“my_classes”);
$ts = new ts3admin($Polaczenie[‘logowanie’][‘Address’], $Polaczenie[‘logowanie’][‘Port-Query’]);
if($ts->getElement(‘success’, $ts->connect())) {
$ts->selectServer($Polaczenie[‘logowanie’][‘Port-Login’]);
$ts->login($Polaczenie[‘logowanie’][‘Login’], $Polaczenie[‘logowanie’][‘Password’]);
$ts->setName(’’.$Polaczenie[‘logowanie’][‘Nick_BoT_Admin’]);
$whoami = $ts->getElement(‘data’, $ts->whoAmI());
$ts->clientMove($whoami[‘client_id’], $Polaczenie[‘logowanie’][‘Channel_ID’]);
}
while(true) {
adminsonline();
adminList();
autoeRanks();
ban();
channelsAdmins();
PokeAdmin();
Promotion();
ochronaGroup();
test();
sleep(1);
}
?>
[/php]
And I have this
[php]function include_all_php($folder){
foreach (glob(“funkcje/Administrator/*.php”) as $filename)
{
include $filename;
fopen(“filename”, “r”);
}
}
include_all_php(“my_classes”);
[/php]
but how can I do the same to name(); so I dont have to write every single function.
Like:
[php]$ts = new ts3admin($Polaczenie[‘logowanie’][‘Address’], $Polaczenie[‘logowanie’][‘Port-Query’]);
if($ts->getElement(‘success’, $ts->connect())) {
$ts->selectServer($Polaczenie[‘logowanie’][‘Port-Login’]);
$ts->login($Polaczenie[‘logowanie’][‘Login’], $Polaczenie[‘logowanie’][‘Password’]);
$ts->setName(’’.$Polaczenie[‘logowanie’][‘Nick_BoT_Admin’]);
$whoami = $ts->getElement(‘data’, $ts->whoAmI());
$ts->clientMove($whoami[‘client_id’], $Polaczenie[‘logowanie’][‘Channel_ID’]);
}
while(true) {
$filename();
sleep(1);
}
?>
[/php]
This is my start of every function:
function adminsonline(){
etc