PDA

View Full Version : Chat Modifications - Water Cooler Chat into vBulletin (all versions)


Aristide
02-18-2023, 10:00 PM
My Forum has been around since 2007 with many in-house pieces of php codes and modifications running smoothly on vBulletin 3.8.x. A recent upgrade of php from my hosting has forced me to upgrade the software and I have moved from vBulletin 3.8.x to vBulletin 5.7.2. However, my forum missed the old "MGC Chatbox Evo" and I could not find a replacement here at vb.org for vBulletin 5.x.x.

I looked around the php/javascript communities and stumbled upon the Water Cooler Chat, which I could easily integrate into my Forum. Since many vBulletin forums have a similar chatbox/shoutbox problem and are looking for a functioning chatbox/shoutbox, I decided to share this integration of "Water Cooler Chat" to vBulletin, with vBulletin community.

I have not done code development for nearly 18 years and do not plan to do some (this means, do not request some additions or code development to the provided archive files).

WaterCooler chat is a simple flat file db chat system, which was developped by Jo?o Ferreira, and which lets you embed a chat container wherever you like into your forum or website. The original archive files are available at Github.com (https://github.com/jonufele/WaterCooler-Chat)

The adjusted files for integration into vBulletin files are given below in the attachment.

Features:

Does not require MySQL Database / Javascript Frameworks
Multi Topic rooms
Private / Read-Only Rooms
Multi user
Password protected profiles
Smilies/BBcode
Open chat interface
Easy to customize themes (100% Html/Css)
Private messages
Moderator tools
Independent display and store buffers
Invite link
Start chat with previous conversations listed
Anti-Spam feature
Account Recovery via E-mail
Generate image thumbnails for faster loading
Attachment uploads
Smart archive system
Shared Chat Across the websites hosted on the same server
Private Conversation Rooms


Requirements

PHP >= 5.3.0
Ability to change permissions if necessary
PHP GD library (for generating image thumbnails)


Installation
See README and README for vBulletin Integration files in the archive package.

Aristide
02-19-2023, 05:54 PM
For the installation, you create a directory (for example "watercooler" or whatever you want) on your website (root or public_html) and them copy the package contents into that created directory.

Aristide
02-26-2023, 08:30 PM
Anyone who wants to see a demo of the "water cooler chat" on my forum, should pm me and I will grant you observer access, as my forum is for "members only" and closed for registrations.

Aristide
03-07-2023, 09:58 PM
Replacement code for bb code:


<iframe id="watercooler" src="https://www.yourwebsite/watercooler/index.php" height="820px" width="960px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0"></iframe>
<script type="text/javascript">
var CurrentUser = document.getElementById('lnkUsernameMenu').textCon tent;

var mytoken = Math.random().toString(36) + Math.round(+new Date()/1000).toString(36) + "-" + Math.random().toString(36).substr(2);

var CurrentUserName = document.getElementsByClassName("b-comp-menu-dropdown__trigger-username js-menu__username-label")[0].innerHTML;

var iframeUrl = 'https://www.yourwebsite.net/watercooler/index.php?usr=' + CurrentUserName + '@' + mytoken;
document.getElementsByTagName("iframe")[0].src = iframeUrl;

document.cookie = 'wcusername='+CurrentUserName+'; path=/';
document.cookie = 'wctoken='+mytoken+'; path=/';

</script>


For integration into vbulletin, your server should give you direct access to the $_COOKIE variable contents via php.
https://www.php.net/manual/en/reserved.variables.cookies.php

Also disable your ad blockers, to allow the chat texts to be refreshed.

Stand alone demo at:
https://www.fuflixbulletin.net/watercoolerdemo/index.html