Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv23458/lib
Added Files:
commands.lib.php3
Log Message:
First working commands :)
--- NEW FILE ---
<?php
//
// +--------------------------------------------------------------------------+
// | phpMyChat version 0.15.0 |
// +--------------------------------------------------------------------------+
// | Copyright (c) 2000-2001 The phpHeaven-team |
// +--------------------------------------------------------------------------+
// | This library checks for 'IRC-like' commands submitted. |
// | |
// | It is called by the 'input.php3' and the 'handle_input.php3' scripts. |
// +--------------------------------------------------------------------------+
// | From the phpMyChat project: |
// | http://www.phpheaven.net/projects/phpMyChat/ |
// | |
// | Authors: the phpHeaven-team <php...@ya...> |
// +--------------------------------------------------------------------------+
//
// $Id: commands.lib.php3,v 1.1 2001/04/04 23:52:33 loic1 Exp $
//
// Handles command submitted.
//
if (eregi('^\/(show|last)([[:space:]]([[:digit:]]+))?$', $message, $cmd))
{
include('./lib/commands/show.cmd.' . C_EXTENSION);
}
else if (eregi('^\/refresh([[:space:]]([[:digit:]]*))?$', $message, $cmd))
{
include('./lib/commands/refresh.cmd.' . C_EXTENSION);
}
else if (eregi('^\/order$', $message))
{
include('./lib/commands/order.cmd.' . C_EXTENSION);
}
else if (eregi('^\/timestamp$', $message))
{
include('./lib/commands/timestamp.cmd.' . C_EXTENSION);
}
else if (C_VERSION > 0
&& eregi('^\/join[[:space:]]((0|1)[[:space:]])?#(.{1,30})$', $message, $cmd))
{
include('./lib/commands/join.cmd.' . C_EXTENSION);
}
else if (eregi('^\/(quit|exit|bye)([[:space:]](.+))?$', $message, $cmd))
{
include('./lib/commands/quit.cmd.' . C_EXTENSION);
}
else if (eregi('^\/ignore([[:space:]]\\-)?([[:space:]](.+))?$', $message, $cmd))
{
include('./lib/commands/ignore.cmd.' . C_EXTENSION);
}
else if (eregi('^\/!$', $message, $cmd)
&& (isset($prevMessage) && $prevMessage != ''))
{
include('./lib/commands/history.cmd.' . C_EXTENSION);
}
else if (eregi('^\/kick[[:space:]](.{1,30})$', $message, $cmd))
{
include('./lib/commands/kick.cmd.' . C_EXTENSION);
}
else if (eregi('^\/(msg|to)[[:space:]]([^[:space:]]{1,30})[[:space:]](.+)$', $message, $cmd))
{
include('./lib/commands/priv_msg.cmd.' . C_EXTENSION);
}
else if (eregi('^\/whois[[:space:]](.{1,30})$', $message, $cmd))
{
include('./lib/commands/whois.cmd.' . C_EXTENSION);
}
else if (eregi('^\/profile$', $message))
{
include('./lib/commands/profile.cmd.' . C_EXTENSION);
}
else if (eregi('^\/notify$', $message))
{
include('./lib/commands/notify.cmd.' . C_EXTENSION);
}
else if (eregi('^\/promote[[:space:]](.{1,30})$', $message, $cmd))
{
include('./lib/commands/promote.cmd.' . C_EXTENSION);
}
else if (eregi('^\/(help|\?)$', $message, $cmd))
{
include('./lib/commands/help.cmd.' . C_EXTENSION);
}
else if (eregi('^\/clear$', $message, $cmd))
{
include('./lib/commands/clear.cmd.' . C_EXTENSION);
}
else if (C_SAVE != 0
&& eregi('^\/save([[:space:]]([[:digit:]]*))?$', $message, $cmd)
&& ($cmd[2] == '' OR $cmd[2] > 0))
{
include('./lib/commands/save.cmd.' . C_EXTENSION);
}
else if (eregi('^\/announce[[:space:]](.*)?$', $message, $cmd))
{
include('./lib/commands/announce.cmd.' . C_EXTENSION);
}
else if (eregi('^\/invite([[:space:]](.+))+$', $message, $cmd))
{
include('./lib/commands/invite.cmd.' . C_EXTENSION);
}
else if (C_BANISH != 0
&& eregi('^\/ban[[:space:]](\*[[:space:]])?(.{1,30})$', $message, $cmd))
{
include('./lib/commands/banish.cmd.' . C_EXTENSION);
}
else if (eregi('^\/me[[:space:]](.*)?$', $message, $cmd))
{
include('./lib/commands/me.cmd.' . C_EXTENSION);
}
?>
|