Mini Chat Area

By Timothy Foster Timothy 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

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!

rating: +15
I have a question
Frank9527 Frank9527 13 Aug 2021 12:59

If I want to discard this chat one day,
how can I delete the page"chatbox-csi-code" in the website?

by Frank9527 Frank9527 , 13 Aug 2021 12:59
Meatoad1 Meatoad1 13 Nov 2019 22:09

It keeps saying the ajax request failed when i try to send a message in them on my site.
How do I fix this?

by Meatoad1 Meatoad1 , 13 Nov 2019 22:09
same
1590320cvd 1590320cvd 08 Jul 2020 04:28

same

by 1590320cvd 1590320cvd , 08 Jul 2020 04:28
Battlesquid Battlesquid 01 May 2017 01:21

Erm, not sure if anybody sees this, but…is this customizable with CSS?

by Battlesquid Battlesquid , 01 May 2017 01:21
Yes, it is
Mai Selph Mai Selph 01 May 2017 21:56

Check under the "Advanced Use" header, there is a link to all of the chat's css, and the names of classes it uses.

by Mai Selph Mai Selph , 01 May 2017 21:56
Post
Teratomorph Teratomorph 24 Oct 2016 21:31

Seeing as nobody has said anything here, i thought i might say something, i have a few questions:

  1. Do you need to install anything else (software, programs, etc.)?
  2. What are the limits of what you can do with this?
  3. Can you host/use this on any wikidot site?
  4. Is it possible to put a comment limit to prevent spam?
  5. Can you make it so that only a certain amount of people can join?
  6. If somebody spams the chat room will it break?

I'm really curious about more details on how this works.

by Teratomorph Teratomorph , 24 Oct 2016 21:31
Re: Post
leiger leiger 25 Oct 2016 02:14

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

by leiger leiger , 25 Oct 2016 02:14
Re: Post
Teratomorph Teratomorph 25 Oct 2016 18:40

I see, guess i should have taken the time to read the post.
Thanks anyway!

by Teratomorph Teratomorph , 25 Oct 2016 18:40
page revision: 6, last edited: 15 May 2012 12:04
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License
Click here to edit contents of this page.
Click here to toggle editing of individual sections of the page (if possible). Watch headings for an "edit" link when available.
Append content without editing the whole page source.
Check out how this page has evolved in the past.
If you want to discuss contents of this page - this is the easiest way to do it.
View and manage file attachments for this page.
A few useful tools to manage this Site.
Change the name (also URL address, possibly the category) of the page.
View wiki source for this page without editing.
View/set parent page (used for creating breadcrumbs and structured layout).

AltStyle によって変換されたページ (->オリジナル) /