Description
This is pretty much a much smaller and simpler version of James Kanjo's Chatroom Application and an improvement on leiger's and bcammo's Chatbox CSI.
The Chatroom Application is an extraordinary piece of work which utilizes many of Wikidot's tools to accomplish what was once thought to be impossible: make a true full fledged chatroom. This mini chat area is a very small version in comparison which effectively emulates a chat room. While it is recommended to simply go with James Kanjo's solution, this chatbox can be used in case you do not want a giant chatroom, as this chat area is smaller, simpler, and easier to install.
Attributes
This CSI uses the following optional attributes:
Attribute | Allowed Values | Default Value | Description |
---|---|---|---|
category | any category name | chatbox | Messages will be saved to this category. It is highly recommended that this category be autonumbered via the Site Manager. |
limit | any positive integer | 15 | The number of recent message that will be displayed. |
time | any positive integer | 15 | The interval by which the chatbox refreshes, in seconds. |
channel | alphanumeric strings without spaces | 1 | An ID that identifies a particular chatbox. |
page | any full page name | chatbox-csi-code | For advanced uses. |
Code
To install the mini chatbox, you only need to do one thing beforehand. On your site, create a page called chatbox-csi-code. Put this on it:
[[include :snippets:chat-code]]
You can use the form below to access the page more easily.
When that is done, you can put the following code on any page, and the chatbox will appear and function.
[[include :snippets:chat attributes...]]
The attributes are all optional and can be any of the above attributes which can enhance customization. For instance, the below will display more messages, refresh more frequently, and operate on a different channel:
[[include :snippets:chat |limit=20 |time=5 |channel=2]]
In addition it is highly recommended that you auto-number the category where messages will be stored (chatbox by default). This will prevent any conflicts that may occur. Autonumbering can be found in the Site Manager of your site.
In action
Feel free to leave a message!
Advanced Use
You may chose not to store the actual chat module on the chatbox-csi-code page. If not, then you must specify the actual page in the CSI using the page attribute. If you put the initiation code on the chat:csi page, then the chatbox code must define the page as below:
[[include :snippets:chat |page=chat:csi]]
You may also wish to alter the looks a little. This can be done with CSS; all of the CSS for this snippet can be found here; the chatbox utilizes the .chatbox, .message, .mainBox, and .new-page-box classes.
Credit
- Original Chatroom App made by James Kanjo
- Mini Chatbox CSI developed by leiger
- Design by bcammo
- Mini Chat Area Javascript by Timothy Foster
Thanks to tsangk for this great snippet: conditional-blocks
text above inserted with:
[[include :snippets:if START |unique=1|type=equal|var1=%%name%%|var2=conditional-blocks]]
**##red|Thanks to tsangk for this great snippet:##** [[[code:conditional-blocks]]]
[[include :snippets:if END]]
Other snippets posted by Timothy Foster
Fancy HR Dividers - 07 Apr 2021 06:23
Carousel - 24 May 2015 01:18
Modal Image - 01 May 2015 17:20
Bootstrap Image Box - 19 Jul 2014 01:27
Togglecheck - 17 Dec 2013 20:27
Alternative Specific Users Only - 11 Dec 2013 18:04
Image Box - 10 Dec 2013 03:14
Toggle Tag - 19 Jul 2013 11:13
Hide Tags - 14 Feb 2013 21:35
Plurality Checker - 16 Jul 2012 03:21
Table Alterations - 16 Feb 2012 01:45
Rate this solution
If you think this solution is useful — rate it up!
If I want to discard this chat one day,
how can I delete the page"chatbox-csi-code" in the website?
It keeps saying the ajax request failed when i try to send a message in them on my site.
How do I fix this?
same
Erm, not sure if anybody sees this, but…is this customizable with CSS?
Check under the "Advanced Use" header, there is a link to all of the chat's css, and the names of classes it uses.
Seeing as nobody has said anything here, i thought i might say something, i have a few questions:
I'm really curious about more details on how this works.
Hello,
The instructions on how to implement this are found on this page.
It works by creating a page in the chatbox category, which is why setting up auto-numbering on the category is essential.
Only users with access to the chatbox category will be able to post a message - but there is no comment limit.
It is unlikely that someone will 'break' the chat room - and even if something unexpected were to happen, it'd only affect that person (no-one else) and would be fixed by refreshing the page.
There would be no straight-forward way to limit the number of people that can 'join' the chat.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I see, guess i should have taken the time to read the post.
Thanks anyway!