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
Hide Tags - 14 Feb 2013 21:35
Image Box - 10 Jan 2013 15:15
Plurality Checker - 16 Jul 2012 03:21
Table Alterations - 16 Feb 2012 01:45
Fancy <hr> Dividers - 15 Feb 2012 00:51
Rate this solution
If you think this solution is useful — rate it up!





