Update of /cvsroot/phpmychat/phpMyChat-0.15/chat/lib/commands
In directory usw-pr-cvs1:/tmp/cvs-serv17799/chat/lib/commands
Added Files:
me.cmd.php3
Log Message:
First working commands :)
--- NEW FILE ---
<?php
//
// +--------------------------------------------------------------------------+
// | phpMyChat version 0.15.0 |
// +--------------------------------------------------------------------------+
// | Copyright (c) 2000-2001 The phpHeaven-team |
// +--------------------------------------------------------------------------+
// | This library does the work associated to the 'me' command. |
// | |
// | It is called by the 'commands.lib.php3' script. |
// +--------------------------------------------------------------------------+
// | From the phpMyChat project: |
// | http://www.phpheaven.net/projects/phpMyChat/ |
// | |
// | Authors: the phpHeaven-team <php...@ya...> |
// +--------------------------------------------------------------------------+
//
// $Id: me.cmd.php3,v 1.1 2001/04/08 21:20:35 loic1 Exp $
//
// The work for the 'me' command.
//
// Ensure color is valid
checkColor($color);
// Store the strict original message
$strictMessage = $message;
// Remove swearings
if (C_BAD_WORDS)
{
include('./lib/swearing.lib.' . C_EXTENSION);
$message = checkwords($message, false);
}
// Do the '/me' transformation
$message = '<b>* ' . $dbSessionVars['nick'] . ' </b>'. $cmd[1];
// Format original message and set enhanced one (with graphical smilies)
$originalMessage = formatMessage($message);
$enhancedMessage = $originalMessage;
if (C_USE_SMILIES)
{
include('./lib/smilies.lib.' . C_EXTENSION);
checkForSmilies($enhancedMessage, $smilies);
unset($smilies);
}
// Put the message in the 'messages' table
$msgQuery = 'INSERT INTO ' . C_MSG_TBL . ' '
. 'VALUES ('
. $currentRoomType . ', '
. '\'' . $slashedCurrentRoomName . '\', '
. '\'' . $slashedNick . '\', '
. $latin1 . ', '
. time() . ', '
. 'NULL, '
. '\'' . $color . '\', '
. '\'' . pmcSlashSingleQuotes($originalMessage) . '\', '
. '\'' . pmcSlashSingleQuotes($enhancedMessage) . '\''
. ')';
$dbLink->query($msgQuery);
// Restore the strict original message and set some variables
$message = $strictMessage;
unset($strictMessage);
$isCommand = true;
$doRefreshMessages = true;
?>
|