Delete channel

qeekus

Active Member
Oct 12, 2015
17
5
93
Need help. How to ignore a channel id $ignorecid(this ids channels not delete)
PHP:
$ignorecid = '9380, 1194';
foreach ($ts3->channelList() as $clist) {
$cid = $clist['cid'];
if ($second_empty >= "864000") { //Removed if 10 days have passed
$ts3->channelDelete($cid);
}
}
 

Kieran

Tag me
Contributor
Jan 1, 2016
459
286
122
PHP:
$ignorecid = '9380, 1194';
foreach ($ts3->channelList() as $clist) {
     $cid = $clist['cid'];
     if (!stripos($ignorecid, $cid) {
          if ($second_empty >= "864000") { //Removed if 10 days have passed
               $ts3->channelDelete($cid);
          }
     }
}
Probably not the best way but i don't know any other way to do this with a string as the ignored channels
 

qeekus

Active Member
Oct 12, 2015
17
5
93
PHP:
$ignorecid = '9380, 1194';
foreach ($ts3->channelList() as $clist) {
     $cid = $clist['cid'];
     if (!stripos($ignorecid, $cid)) {
          if ($second_empty >= "864000") { //Removed if 10 days have passed
               $ts3->channelDelete($cid);
          }
     }
}
Probably not the best way but i don't know any other way to do this with a string as the ignored channels
Thank you, but not working. Delete channel... Any ideas?
 

Najsr

Moderator
TeamSpeak Developer
Apr 23, 2016
483
249
167
PHP:
    if($channel['seconds_empty'] >= 864000) {
        $channel->delete(true);
Insert it inside cycle
 
Top