Skip to content

Commit

Permalink
20181226
Browse files Browse the repository at this point in the history
  • Loading branch information
PHClaus authored Dec 26, 2018
1 parent 6582e4e commit 694078b
Show file tree
Hide file tree
Showing 9 changed files with 194 additions and 283 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# PHP Atomchat

**PHP Atomchat** is a **free PHP chat script** for low volume sites or individual homepages, e.g. P2P chat.
**PHP Atomchat** is a **free PHP chat script** for low volume websites or individual homepages.

- Works OOTB
- Completely anonymous
- No registration or passwords ever
- Emoji auto-conversion
- File uploads
- Themeable
- Multi-lingual
- No database required
8 changes: 4 additions & 4 deletions TRANSLATE
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Make a copy of en.php and save it as xx.php, where xx is
the language ID, e.g. fr for French, it for Italian, etc.
Make a copy of en.php and save as xx.php, where xx is the
language ID, e.g. "fr" for French, "it" for Italian, etc.

https://www.loc.gov/standards/iso639-2/php/code_list.php

Edit xx.php and mail a copy to @author given in en.php.

Subject: Lang_XX_PHP_Atomchat
Body : @author Your Name [email protected]
Subject: lang_xx_PHP_Atomchat
Body : Your Name <[email protected]>
Attach : xx.php
40 changes: 22 additions & 18 deletions chat.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
* Javascript push helper
* PHP Version 5 and above
*
* Javascript pseudo push -- actually more pull then push
*
* @category PHP_Chat
* @package PHP_Atomchat
Expand All @@ -12,43 +14,43 @@
*
* HELP WANTED
*
* AJAX push works OK but is neither pretty nor overly effective.
* Should only trigger refresh when someone adds an entry rather
* than continously pushing every n seconds. Also needs fixing to
* possibly skip content double-render when viewed without styles.
* This should only refresh on new entry rather than continously
* polling every n seconds. Existing code also needs fixing to
* prevent double-drawing content when viewed without styles.
*/


// Refresh every n seconds -- default 2 = 2000 ms
// Refresh rate -- default 2 = 2000 ms
var wait = 2000;

// Init object
var http = null;

// Link object
function object() {

function ajax()
{
if (window.ActiveXObject) {
return new ActiveXObject("Microsoft.XMLHTTP");
} else if (window.XMLHttpRequest) {
return new XMLHttpRequest();
} else {
alert("Your browser does not support AJAX!");
alert("Your browser doesn't support AJAX!");
return null;
}
}

// Status
function status() {

function status()
{
if (http.readyState == 4) {
document.getElementById("push").innerHTML = http.responseText;
}
}

// Timer
function timer() {
http = object();
function wait()
{
http = ajax();

if (http != null) {
http.open("POST", "?"+Math.floor(Math.random()*10000), true);
Expand All @@ -58,13 +60,15 @@ function timer() {
}

// Update
function update() {
timer();
setTimeout('update()', wait);
function push()
{
wait();
setTimeout('push()', wait);
}

// Beep
function bell() {
function bell()
{
var beep = new Audio("data:audio/wav;base64,"+
"//uQRAAAAWMSLwUIYAAsYkXgoQwAEaYLWfkWgAI0wWs/ItAAAGDgYtAgAyN+QWaAAihw"+
"MWm4G8QQRDiMcCBcH3Cc+CDv/7xA4Tvh9Rz/y8QADBwMWgQAZG/ILNAARQ4GLTcDeIII"+
Expand Down Expand Up @@ -130,5 +134,5 @@ function bell() {
}

// Init
update();
push();
bell();
Loading

0 comments on commit 694078b

Please sign in to comment.