channel()->get($channel->name);
?>
channel()->get($channel->name);
?>
channel()->get($channel->name);
?>
modes))
{
echo "No modes set";
return;
}
$fmodes = $channel->modes;
$tok = split($fmodes);
$modes = $tok[0];
$params = rparv($fmodes);
$paramed_modes = sort_paramed_modes($modes, $params);
for ($i=0; ($mode = (isset($modes[$i])) ? $modes[$i] : NULL); $i++)
{
$modeinfo = IRCList::lookup($mode);
if (!$modeinfo)
continue;
?>
"kliRzOL", ...
* The group "Other" has a number of preset ones PLUS
* will be automatically filled with any remaining modes
* that are detected and that we forgot to put in Other.
*/
function group_modes()
{
$modes = '';
foreach(IRCList::$uplink as $mode_groups)
$modes .= $mode_groups;
$grouping = IRCList::$grouping;
foreach (str_split($modes) as $letter)
{
$found = false;
foreach($grouping as $groupname=>$value)
{
if (str_contains($value, $letter))
{
$found = true;
break;
}
}
if (!$found)
$grouping["Other"] .= $letter;
}
return $grouping;
}
function generate_edit_chmodes($chan)
{
?>
modes))
{
echo "No modes set";
return;
}
$fmodes = $chan->modes;
$tok = split($fmodes);
$modes = $tok[0];
$params = rparv($fmodes);
$paramed_modes = sort_paramed_modes($modes, $params);
$all_modes = IRCList::$uplink;
$groups = group_modes();
foreach ($groups as $group_name=>$m)
{
echo "\n";
echo "$group_name \n";
for ($i=0; ($mode = (isset($m[$i])) ? $m[$i] : NULL); $i++)
{
$group = get_chmode_group($mode);
if (!$group || $group == 1)
continue;
$modeinfo = IRCList::lookup($mode);
$checked = (strstr($modes,$mode)) ? "checked " : " ";
$disabled = "";
if (isset($modeinfo) && $modeinfo['requires'] == "Server")
$disabled = "disabled";
?>
\n";
}
?>
$grp)
if (strstr($grp,$mode))
return $i + 1;
return 0; // invalid
}
/**
* Force loading of a particular modal by name
*/
function chlkup_autoload_modal($name)
{
?>
150)
{
// send what we've got already and prepare for the next lot
if (!$rpc->channel()->set_mode($chan->name, htmlspecialchars("-$n"), htmlspecialchars($str)))
$errors[] = $rpc->error . " ($rpc->errno)";
// prepare for the next set
$n = "";
$str = "";
}
$n .= $char;
$str .= " ".$l;
}
// if multiple, this will be the last one so we return here
if ($rpc->channel()->set_mode($chan->name, htmlspecialchars("-$n"), htmlspecialchars($str)))
{
if (!empty($errors))
Message::Fail("One or more errors occurred:", $errors);
Message::Success("Deleted successfully");
return true;
}
$errors[] = $rpc->error . " ($rpc->errno)";
Message::Fail("An error occurred:", $errors);
return false;
}
function do_delete_invite($chan, $list)
{
$errs = [];
_do_chan_item_delete($chan, "invite", $list, $errs);
}
function do_delete_chanban($chan, $list)
{
$errs = [];
_do_chan_item_delete($chan, "ban", $list, $errs);
}
function do_delete_chanex($chan, $list)
{
$errs = [];
_do_chan_item_delete($chan, "except", $list, $errs);
}
/**
* Sort the channels user list:
*/
function sort_user_list($list) : array
{
if (empty($list))
return $list;
$new = [];
foreach($list as $k => $user)
{
if (!property_exists($user,"level"))
{
$new["rest"][] = $user;
$list[$k] = NULL;
}
else if (strstr($user->level,"Y"))
{
$new["Y"][] = $user;
$list[$k] = NULL;
}
else if (strstr($user->level,"q"))
{
$new["q"][] = $user;
$list[$k] = NULL;
}
else if (strstr($user->level,"a"))
{
$new["a"][] = $user;
$list[$k] = NULL;
}
else if (strstr($user->level,"o"))
{
$new["o"][] = $user;
$list[$k] = NULL;
}
else if (strstr($user->level,"h"))
{
$new["h"][] = $user;
$list[$k] = NULL;
}
else if (strstr($user->level,"v"))
{
$new["v"][] = $user;
$list[$k] = NULL;
}
}
unset($list);
$list = [];
if (isset($new["q"]))
foreach($new["q"] as $u)
$list[] = $u;
if (isset($new["a"]))
foreach($new["a"] as $u)
$list[] = $u;
if (isset($new["o"]))
foreach($new["o"] as $u)
$list[] = $u;
if (isset($new["h"]))
foreach($new["h"] as $u)
$list[] = $u;
if (isset($new["v"]))
foreach($new["v"] as $u)
$list[] = $u;
if (isset($new["rest"]))
foreach($new["rest"] as $u)
$list[] = $u;
return $list;
}