Hello folks!
Introduction:
I realized that many users would like to have a "chatbox for exclusive staff" and I also wanted!
It was then that so I had the idea of making one, I did inside a widget but I found it strange because it was very small, boring to implement, required many steps to create and parameter settings in the ACP ...
But now, based on another project I'm developing, this code has the ability of a true "installer", also having an uninstaller in which all the code and the pseudo database are removed completely !!!
Only by creating a new JavaScript so that we can have the installer code is required.
But how does it work?
It's simple:
The installer first create a category and within a forum with permissions only to administrators and moderators, but this can be changed later in the ACP.
Then it creates a topic within this forum that will serve as a pseudo database to our chat!
Features:
1- Each member will be able delete or edit your own message;
2- Messages are written in JSON format, thus we gain storage space and ease of maintenance in code;
3- The message storage capacity is the same as a topic.
How about we make tests?
First access the ACP and check "Unauthorize unoficial forms .." to "no", see example below:
In the ACP, create a new JavaScript as follows:
Title * : @install_chat_staff
Placement : In the home page
Javascript Code * : - Copy and paste the code below in this field:
Download link: https://www.dropbox.com/s/yeu4mif5bk62acg/Staff%27s_Chat_div.js?dl=1
Note: The title field should have exactly this name: @install_chat_staff
For uninstalling the code and structure of pseudo database depends exclusively on him!
When you finish this step, go to your forum, reload the page and wait for the following window:
Follow the steps waiting for the end of each.
After the installer finishes, the page will reload, then you can use the chatbox staff that will have the following appearance (varying according to the version of your forum):
Example: Editing a message!
To uninstall is easy,
You will see the following window:
Just follow the steps and the chat will be uninstalled completely!
Some chat commands:
/cls - Clear all messages, resetting the list.
/stop - Pause the reception of messages, useful when you do not want to be disturbed.
/start - Restarts the reception of messages.
See an example of how messages are stored in the pseudo database:
JSON format:
- Code:
{
"user": [{
"id": 1,
"name": "JScript",
"pname": "%3Cspan%20style%3D%22color%3A%23000099%22%3E%3Cstrong%3EJScript%3C%2Fstrong%3E%3C%2Fspan%3E",
"avatar": "http://autoitbrasil.com/forum/uploads/av-89.png"
}, {
"id": 2,
"name": "Member Test",
"pname": "%3Cspan%20style%3D%22color%3A%20rgb(0%2C%200%2C%20153)%3B%22%3E%3Cstrong%3EMember%20Test%3C%2Fstrong%3E%3C%2Fspan%3E",
"avatar": "http://2img.net/i/fa/invision/pp-blank-thumb.png"
}],
"msgs": [{
"id": 1,
"msg": "Messages%20cleared!",
"date": "18:56 - 19/12/2014"
}, {
"id": 1,
"msg": "Test%2001%20-%20FF",
"date": "18:56 - 19/12/2014"
}, {
"id": 2,
"msg": "Test%2002%20-%20IE",
"date": "18:57 - 19/12/2014"
}, {
"id": 2,
"msg": "Test%2003%20-%20CR",
"date": "18:57 - 19/12/2014"
}]
}
Who can contribute to the project, either with more ideas, codes and even translations into other languages, I thank you!
JS
Last edited by JScript on June 3rd 2015, 10:53 am; edited 7 times in total