A project of this scope goes beyond the purpose of this chat. Modifying the chat to store all messages in a queue until they receive an approved flag from a moderator is definitely possible, but would require a fair bit of work to add a new flag to those messages and provide a way for someone to review and approve them.
If you really need a feature like this, you should probably look into another more powerful chat system.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This feature is a great one. I was searching it for long time before discovering this simple chat and deciding to add this feature.
I'm finalizing an ugly version succesfully tested under FF, Opera, Google Chrome and IE6-7 (IE6 not accepting admin commands - for unsolved reasons).
The only trick is to create a derivation table in the SQL Storage called ajax_chat_queue waiting for the validation of a moderator. Then reintroducing this one into main table (ajax_chat_message) is sufficient for the chat to handle the change.
All the modifications I made affects mainly:
- loggedIn template for integration with linked class and css
- chat.js for interaction
- main class AjaxChat.php to create derivation
- a new page called queue.php to execute the requests - I'm trying to remove this one.
The system goes like this :
- all messages from guests are queued
- registered users no change
- admins and moderators can accept or reject the messages from users
Sample code for derivation :
function insertMessage($text) {
/*CYR MODIFICATION GUEST MESSAGES ENVOYES AU MODERATEUR*/
if(!$this->isAllowedToWriteMessage()) {
if (strpos($text, "/") === 0)
return;
$this->insertQueueMessage(
$this->getUserID(),
$this->getUserName(),
$this->getUserRole(),
$this->getChannel(),
$text
);
return;
}
[...]
the insertQueueMessage is the same than insertCustomMessage except a call for the new table called queue like this :
$sql = 'INSERT INTO '.$this->getDataBaseTable('queue').'(
userID,
userName,
userRole,
channel,
dateTime,
ip,
text
)
VALUES ( [...]
I wonder if I can publish my code here.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
sure you can publish this code by submitting it as a patch. Then anyone can download it from there, and we could consider pushing it into the official build.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: YES
user_id=1999877
Originator: NO
A project of this scope goes beyond the purpose of this chat. Modifying the chat to store all messages in a queue until they receive an approved flag from a moderator is definitely possible, but would require a fair bit of work to add a new flag to those messages and provide a way for someone to review and approve them.
If you really need a feature like this, you should probably look into another more powerful chat system.
This feature is a great one. I was searching it for long time before discovering this simple chat and deciding to add this feature.
I'm finalizing an ugly version succesfully tested under FF, Opera, Google Chrome and IE6-7 (IE6 not accepting admin commands - for unsolved reasons).
The only trick is to create a derivation table in the SQL Storage called ajax_chat_queue waiting for the validation of a moderator. Then reintroducing this one into main table (ajax_chat_message) is sufficient for the chat to handle the change.
All the modifications I made affects mainly:
- loggedIn template for integration with linked class and css
- chat.js for interaction
- main class AjaxChat.php to create derivation
- a new page called queue.php to execute the requests - I'm trying to remove this one.
The system goes like this :
- all messages from guests are queued
- registered users no change
- admins and moderators can accept or reject the messages from users
Sample code for derivation :
function insertMessage($text) {
/*CYR MODIFICATION GUEST MESSAGES ENVOYES AU MODERATEUR*/
if(!$this->isAllowedToWriteMessage()) {
if (strpos($text, "/") === 0)
return;
$this->insertQueueMessage(
$this->getUserID(),
$this->getUserName(),
$this->getUserRole(),
$this->getChannel(),
$text
);
return;
}
[...]
the insertQueueMessage is the same than insertCustomMessage except a call for the new table called queue like this :
$sql = 'INSERT INTO '.$this->getDataBaseTable('queue').'(
userID,
userName,
userRole,
channel,
dateTime,
ip,
text
)
VALUES ( [...]
I wonder if I can publish my code here.
sure you can publish this code by submitting it as a patch. Then anyone can download it from there, and we could consider pushing it into the official build.