DanWin / le-chat-php

A PHP Chat based on LE CHAT
https://danwin1210.de/chat/
GNU General Public License v3.0
266 stars 97 forks source link
chat hacktoberfest hidden-service hidden-services php php-chat tor tor-hidden-services

General Information:

This is a PHP Chat based on LE CHAT v.1.14. An up-to-date copy of this script can be downloaded at https://github.com/DanWin/le-chat-php The original perl LE CHAT script by Lucky Eddie can be downloaded at this github fork. If you add your own cool features or have a feature request, please tell me and I will add them, if I like them. Please also let me know about any bugs you find in the code, so I can fix them. Now a piece of information about the origin of the name "LE CHAT" copied from the original script: The "LE" in the name you can take as "Lucky Eddie", or since the script was meant to be lean and easy on server resources, as "Light Edition". It may even be the French word for "the" if you prefer. Translated from French to English, "le chat" means: "the cat".

Features:

Installation Instructions:

You'll need to have php with intl, gettext, pdo, pcre, mbstring and date extension, and a web-server installed. You will also need the pdo_sqlite, pdo_mysql or pdo_pgsql extension, depending on which database you choose. Optionally, you can install:

Translating:

Translations are managed in Weblate. If you prefer manually submitting translations, the script update-translations.sh can be used to update the language template and translation files from source. It will generate the file locale/le-chat-php.pot which you can then use as basis to create a new language file in YOUR_LANG_CODE/LC_MESSAGES/le-chat-php.po and edit it with a translation program, such as Poedit. Once you are done, you can open a pull request, or email me, to include the translation.

Regex:

Yes, the chat supports regular expression filtering of messages. As regex tends to be difficult for most people, I decided to give it an extra section here. Regex is very powerful and can be used to filter messages that contain certain expressions and replace them with something else. It can be used e.g. to turn BB Code into html, so it is possible to use BB Code in the chat to format messages. To do this, use this Regex-Match \[(u|b)\](.*?)\[\/\1\] and this Regex-Replace <$1>$2</$1> and your text will be [b]bold[/b] or [u]underlined[/u]. You can also use smilies by using this Regex-Match (?-i::(cry|eek|lol|sad|smile|surprised|wink):) and this Regex-Replace <img src="https://github.com/DanWin/le-chat-php/raw/master/pictures/$1.gif" alt=":$1:"> And now if you enter :smile: an image with the smiley will be loaded from your server at /pictures/smile.gif. The following should be escaped by putting \ in front of it, if you are trying to match one of these characters / \ ^ . $ | ( ) [ ] * + ? { } ,. I used / as delimiter, so you will have to escape that, too. The only options I used is i to make the regex case insensitive. If you want to test your regex, before applying you can use this site and enter your Regex and Replacement there and click on preg_replace. If you never used regex before, check out this starting guide to begin with regular expressions.