Commit b25d16e4 authored by Valerii Kuznetsov's avatar Valerii Kuznetsov
Browse files

Reverting patch 3408 (Bug #547932)



Change-Id: Ic81c34a2bbd448bca78f353fa75317073844a19c
Signed-off-by: default avatarValerii Kuznetsov <valerii.kuznetsov@totaralms.com>
parent 6e503f08
Copyright (c) 2012 Stéphane Gully
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
phpFreeChat v2.1.0
phpFreeChat (pfc) is a Web based chat written in JQuery and PHP.
# Installation quickstart
[![Build Status](https://travis-ci.org/kerphi/phpfreechat.png?branch=master)](https://travis-ci.org/kerphi/phpfreechat)
## Prerequisites
* Web browser compatible with JQuery (almost all !)
* A server with:
* php >= 5.3.0 ([Slim framework](https://github.com/codeguy/Slim/blob/master/README.markdown#system-requirements) dependency)
* apache server with mod_rewrite and .htaccess enabled
* write access to the phpfreechat-2.1.0/server/data/ and phpfreechat-2.1.0/server/log/ folder (777 or write permission for the web server)
* No database needed !
## Quick start
Download [phpfreechat-2.1.0.zip](http://www.phpfreechat.net/download) and unzip it in the root folder of your Web server.
JQuery should be included in your html `<head>` before the phpfreechat code:
```html
<script src="/phpfreechat-2.1.0/client/lib/jquery-1.8.2.min.js" type="text/javascript"></script>
```
Include the phpfreechat plugin in your html `<head>`:
```html
<link rel="stylesheet" type="text/css" href="/phpfreechat-2.1.0/client/themes/default/jquery.phpfreechat.min.css" />
<script src="/phpfreechat-2.1.0/client/jquery.phpfreechat.min.js" type="text/javascript"></script>
```
Add this piece of HTML in your `<body>` where you want the chat to be displayed:
```html
...
<div id="mychat"><a href="http://www.phpfreechat.net">Creating chat rooms everywhere - phpFreeChat</a></div>
...
```
The add this piece of code just after (it will hook the chat on the page):
```html
<script type="text/javascript">
$('#mychat').phpfreechat({ serverUrl: '/phpfreechat-2.1.0/server' });
</script>
```
## Themes customization
phpfreechat is released with few themes. You can choose which one you want to use:
* `default`
* `carbon`
* `gamer`
To select the theme, you only have to change one line in your html `<head>`. To use the `default` theme:
```html
<link rel="stylesheet" type="text/css" href="/phpfreechat-2.1.0/client/themes/default/jquery.phpfreechat.min.css" />
```
or this code for `carbon` theme:
```html
<link rel="stylesheet" type="text/css" href="/phpfreechat-2.1.0/client/themes/carbon/jquery.phpfreechat.min.css" />
```
<?php
/**
* Script in charge of checking server configuration and returns a status
*/
$status = array();
// check that server/data/ folder is writable
if (!is_writable(dirname(__FILE__).'/server/data/')) {
$status[] = basename(dirname(__FILE__)).'/server/data/ folder is not writable by your Web server. Please adjust folder permissions to 777.';
}
// check that php version dependency is respected
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
$status[] = 'Your php version '.PHP_VERSION.' must be >= 5.3.0';
}
// check that Slim framework is installed
if (!file_exists(dirname(__FILE__).'/server/lib/Slim/Slim/Slim.php')) {
$status[] = 'Slim framework is not installed.<br/> It should be installed here: '.basename(dirname(__FILE__)).'/server/lib/Slim/<br/>Please run "make setup" to install it or download/unzip it yourself.';
}
if (!function_exists('microtime')) {
$status[] = 'microtime PHP function is not enable. phpFreeChat needs it';
}
header("HTTP/1.1 200");
header('Content-Type: application/json; charset=utf-8');
echo json_encode($status);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment