Mini Chat Area

By Timothy FosterTimothy Foster

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


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

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
Fancy <hr> Dividers - 15 Feb 2012 00:51


Rate this solution

If you think this solution is useful — rate it up!

rating: +11+x
Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License