diff --git a/README.md b/README.md
old mode 100644
new mode 100755
index d770fd4..0a6ea7d
--- a/README.md
+++ b/README.md
@@ -1,3 +1,26 @@
-# idleirc
+=== IdleIRC ===
+This is a simple ajax frontend with a very small footprint on web servers. IdleIRC uses a IRC backend
+written in PHP to communicate with IRC servers. With that being said, it's not secured by TLS or
+anything like that. This is in working condition!
-A simple JS / HTML IRC client frontend with a simple PHP irc client backend that operates as a bouncer as well.
\ No newline at end of file
+---Requirements:
+ PHP 5.2+
+ Read-Write access for working directory
+
+---Installation:
+ ~Download IdleIRC
+ ~Extract it to desired web server / htdocs directory
+ ~Customize config.php to your liking
+ ~Use it!
+
+---Changelog:
+ v1.0.0:
+ -Functioning web based front end with PHP based backend
+ -irc.php performs as an IRC bouncer when web client disconnects
+ -Controls to start / stop irc.php within web panel
+ -server.php is used by the AJAX frontend to communicate with irc.php
+ -Client supports: /join, /msg, and /me currently
+ -Multi user support
+
+Legal stuff:
+ License: GPLv3
diff --git a/config.php b/config.php
new file mode 100755
index 0000000..4f8f68d
--- /dev/null
+++ b/config.php
@@ -0,0 +1,26 @@
+
diff --git a/index.php b/index.php
new file mode 100755
index 0000000..ff1e670
--- /dev/null
+++ b/index.php
@@ -0,0 +1,306 @@
+
+
+
+
+
+
+
+
+
+ Welcome to the WebIRC client / bouncer!
+ Don't have an account? Create one here!
+
\n";
+ file_put_contents("$username.log", $socketFileContents . $msgline);
+ }
+ }
+
+ // second sleep to prevent insane CPU load
+ usleep(1000);
+}
+
+?>
diff --git a/server.php b/server.php
new file mode 100755
index 0000000..d125e39
--- /dev/null
+++ b/server.php
@@ -0,0 +1,145 @@
+
$nick -> " . $cmd[1] . ":
";
+ foreach($prvmsg as $word) {
+ // Grab each word in the array after the privmsg username
+ if($x == 0) {
+ $line .= ":" . $word;
+ $logline .= $word;
+ } else {
+ $line .= " " . $word;
+ $logline .= " " . $word;
+ }
+ $x++;
+ }
+ $line .= "\n";
+ $logline .= "
\n";
+ } else if($cmd[0]=="/me") { // If using /msg, push private message
+ $prvmsg = array_splice($cmd, 1); // grab private message from string
+ $line .= "PRIVMSG" . " " . $channel . " :\x01ACTION "; // set for push
+ $x = 0;
+ $logline .= "
$channel:
$nick ";
+ foreach($prvmsg as $word) {
+ // Grab each word in the array after the privmsg username
+ if($x == 0) {
+ $line .= $word;
+ $logline .= $word;
+ } else {
+ $line .= " " . $word;
+ $logline .= " " . $word;
+ }
+ $x++;
+ }
+ $logline .= "
\n";
+ $line .= "\x01\n";
+ } else if ($cmd[0]=="/join") {
+ doLog("$username: channel switch from $channel to" . $cmd[1] . "($msg)");
+ $line .= "PART $channel\n"; // push close command to IRC
+ $logline .= "
$nick:
Leaving $channel
\n"; // push to client
+ $line .= "JOIN" . " " . $cmd[1] . "\n"; // set for push
+ $logline .= "
$nick:
Joining " . $cmd[1] . "
\n"; // push to client
+ $_SESSION['cwchat-channel'] = trim($cmd[1]);
+ } else {
+ // @@ This is a work in progress
+ // Sends every channel message to each channel :[
+ $line .= "PRIVMSG $channel :$msg\n";
+ $logline .= "
$nick in $channel:
$msg
\n";
+ }
+
+ // Get original content
+ $content = file_get_contents("$nick.log");
+ echo "
" . nl2br(stripslashes($content)) . "
";
+ // Grab all contents, and push to socket output file.
+ file_put_contents("$nick.log", $content . $logline);
+ // Grab user message and push to IRC client
+ file_put_contents(".$nick.push", $line);
+ // Throw out your user message
+ //echo nl2br(stripslashes($line));
+ // DONE
+
+} else if (isset($_GET['get']) && isset($_GET['nick']) && $_GET['nick']!="") {
+ $nick = stripslashes(htmlentities($_GET['nick'])); // Username
+ // Grab IRC client output
+ $content = file_get_contents("$nick.log");
+ // Push content to the web frontend
+ echo "
" . nl2br(stripslashes($content)) . "
/dev/null 2>/dev/null &");
+ } else if($_GET['do']=="logout" && ($acctpass == $userpass)) { // Is user asking for logout?
+ // Remove ping file if user logs out. IRC server will close
+ $content = file_get_contents("$nick.log");
+ file_put_contents("$nick.log", $content . "