|
From: Lo?c C. <lo...@us...> - 2001-04-21 09:44:03
|
Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib
In directory usw-pr-cvs1:/tmp/cvs-serv20722/chat/lib
Modified Files:
commands.lib.php3
Log Message:
Better handdling of commands
Index: commands.lib.php3
===================================================================
RCS file: /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands.lib.php3,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** commands.lib.php3 2001/04/19 21:05:04 1.6
--- commands.lib.php3 2001/04/21 09:43:59 1.7
***************
*** 25,47 ****
! if (eregi('^\/!$', $message, $cmd)
! && (isset($prevMessage) && $prevMessage != ''))
{
include('./lib/commands/history.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/announce[[:space:]](.*)?$', $message, $cmd))
{
include('./lib/commands/announce.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('^\/clear$', $message))
{
include('./lib/commands/clear.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/(help|\?)$', $message))
{
include('./lib/commands/help.cmd.' . C_EXTENSION);
--- 25,49 ----
! if ('/!' == $message
! && !empty($prevMessage))
{
include('./lib/commands/history.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/announce[[:space:]](.+)$', $message, $cmd))
{
include('./lib/commands/announce.cmd.' . C_EXTENSION);
}
! else if (C_BANISH
&& eregi('^\/ban[[:space:]](\*[[:space:]])?(.{1,30})$', $message, $cmd))
{
include('./lib/commands/banish.cmd.' . C_EXTENSION);
}
! else if (strcasecmp('/clear', $message) == 0
! && $dbSessionVars['jsVersion'] == 'high')
{
include('./lib/commands/clear.cmd.' . C_EXTENSION);
}
! else if ('/?' == $message
! || strcasecmp('/help', $message) == 0)
{
include('./lib/commands/help.cmd.' . C_EXTENSION);
***************
*** 51,55 ****
include('./lib/commands/ignore.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/img$', $message))
{
include('./lib/commands/img.cmd.' . C_EXTENSION);
--- 53,57 ----
include('./lib/commands/ignore.cmd.' . C_EXTENSION);
}
! else if (strcasecmp('/img', $message) == 0)
{
include('./lib/commands/img.cmd.' . C_EXTENSION);
***************
*** 59,63 ****
include('./lib/commands/invite.cmd.' . C_EXTENSION);
}
! else if (C_VERSION > 0
&& eregi('^\/join[[:space:]]((0|1)[[:space:]])?#(.{1,30})$', $message, $cmd))
{
--- 61,65 ----
include('./lib/commands/invite.cmd.' . C_EXTENSION);
}
! else if (0 < C_VERSION
&& eregi('^\/join[[:space:]]((0|1)[[:space:]])?#(.{1,30})$', $message, $cmd))
{
***************
*** 68,72 ****
include('./lib/commands/kick.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/me[[:space:]](.*)?$', $message, $cmd))
{
include('./lib/commands/me.cmd.' . C_EXTENSION);
--- 70,74 ----
include('./lib/commands/kick.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/me[[:space:]](.+)$', $message, $cmd))
{
include('./lib/commands/me.cmd.' . C_EXTENSION);
***************
*** 76,88 ****
include('./lib/commands/priv_msg.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/notify$', $message))
{
include('./lib/commands/notify.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/order$', $message))
{
include('./lib/commands/order.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/profile$', $message))
{
include('./lib/commands/profile.cmd.' . C_EXTENSION);
--- 78,91 ----
include('./lib/commands/priv_msg.cmd.' . C_EXTENSION);
}
! else if (strcasecmp('/notify', $message) == 0)
{
include('./lib/commands/notify.cmd.' . C_EXTENSION);
}
! else if (strcasecmp('/order', $message) == 0
! && $dbSessionVars['jsVersion'] != 'high')
{
include('./lib/commands/order.cmd.' . C_EXTENSION);
}
! else if (strcasecmp('/profile', $message) == 0)
{
include('./lib/commands/profile.cmd.' . C_EXTENSION);
***************
*** 100,104 ****
include('./lib/commands/refresh.cmd.' . C_EXTENSION);
}
! else if (C_SAVE
&& eregi('^\/save([[:space:]]([[:digit:]]*))?$', $message, $cmd)
&& ($cmd[2] == '' OR $cmd[2] > 0))
--- 103,107 ----
include('./lib/commands/refresh.cmd.' . C_EXTENSION);
}
! else if ('0' != C_SAVE
&& eregi('^\/save([[:space:]]([[:digit:]]*))?$', $message, $cmd)
&& ($cmd[2] == '' OR $cmd[2] > 0))
***************
*** 110,114 ****
include('./lib/commands/show.cmd.' . C_EXTENSION);
}
! else if (eregi('^\/timestamp$', $message))
{
include('./lib/commands/timestamp.cmd.' . C_EXTENSION);
--- 113,117 ----
include('./lib/commands/show.cmd.' . C_EXTENSION);
}
! else if (strcasecmp('/timestamp', $message) == 0)
{
include('./lib/commands/timestamp.cmd.' . C_EXTENSION);
***************
*** 118,121 ****
--- 121,127 ----
include('./lib/commands/whois.cmd.' . C_EXTENSION);
}
+
+ if (!($isCommand) && !isset($error))
+ $error = L_BAD_CMD;
?>
|