Archive > 0.3.x Custom/Unofficial Modules

AccessControlGUI.php

(1/1)

Ebag333:
Well, I finally decided to deal with the spam you get when using !commands <channel>.

Currently when using it, you see this:


--- Code: ---Cafraid: Current access levels for Private Chatgroup (Page 1) (page 1 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 1) (page 2 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 2) (page 1 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 2) (page 2 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 3) (page 1 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 3) (page 2 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 4) (page 1 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 4) (page 2 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 5) (page 1 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 5) (page 2 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 6) (page 1 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 6) (page 2 of 2)
Cafraid: Current access levels for Private Chatgroup (Page 7)

--- End code ---

With the changed code, you see this:


--- Code: ---Cafraid: Current access levels for Private Chatgroup (page 1 of 9)
Cafraid: Current access levels for Private Chatgroup (page 2 of 9)
Cafraid: Current access levels for Private Chatgroup (page 3 of 9)
Cafraid: Current access levels for Private Chatgroup (page 4 of 9)
Cafraid: Current access levels for Private Chatgroup (page 5 of 9)
Cafraid: Current access levels for Private Chatgroup (page 6 of 9)
Cafraid: Current access levels for Private Chatgroup (page 7 of 9)
Cafraid: Current access levels for Private Chatgroup (page 8 of 9)
Cafraid: Current access levels for Private Chatgroup (page 9 of 9)

--- End code ---

The problem is that it gets cut off halfway through a command (shows the command but not the access levels), but that happens currently anyway.

Couple of changes.

Line 105:


--- Code: ---<?php
$blob .= "<br>Click on an access level to change it for that command.##end##<br>";
?>

--- End code ---

Removed an annoying . before the first <br> .  :)

Line 122:


--- Code: ---<?php
foreach ($rights as $right)
{
if (isset($this -> bot -> commands[$channel][$right['command']]))
{
$cmdtext = "Access to command: ##highlight##<pre>{$right['command']}##end## <br> [" .
$this -> Make_access_string($right['command'], $right['minlevel'], $channel) . "]";
$blob .= "<br>" . $cmdtext . "<br>";
}
}
$page_counter ++;
$this -> bot -> send_tell($name, $this -> bot -> make_blob($title, $blob));
?>

--- End code ---

Removed the bit of code to try and split up the pages, so the bot can handle it automagically.

Khalem:
Committed to SVN.

Navigation

[0] Message Index

Go to full version