Hi,
i have a chat from
https://blueimp.net/. This is a chat with a shoutbox for vbulletin.
Now my problem is, how can i bring the shoutbox code into vbadvanced. I've tried something but don't work for me. ;(
Can anyone help pls ?
Best regards
Termi
The readme.txt
PHP Code:
AJAX Chat
=========
Version 0.6.2.1 vBulletin 2007/11/28
Requirements
============
Server-Side:
- PHP >= 4
- MySQL >= 4
Client-Side:
- Enabled JavaScript
- Enabled Cookies
Installation
============
1. Creation of database tables
---------------------------
Execute the provided SQL script chat.sql by using phpMyAdmin:
http://www.phpmyadmin.net/
On phpMyAdmin, select your vBulletin database and click on "Import".
Select the file chat.sql from your local harddisk and click on "OK".
This should execute the included commands to create the tables needed by this chat.
2. Upload to the server
--------------------
Upload the chat folder to your server into your vBulletin forum directory:
e.g. http://example.org/vBulletin/chat/
Ready! Just place a link to the chat directory on your forum. :)
Configuration files:
====================
AJAX Chat is fully customizable and contains two configuration files:
1. lib/config.php
--------------
This file contains the server side (PHP) settings.
2. js/config.js
------------
This file contains the client side (JavaScript) settings.
Each configuration option is explained with a comment prior to the setting assignment.
Customizing the layout:
=======================
The layout of AJAX Chat is fully customizable by using CSS (Cascaded Style Sheets).
AJAX Chat comes with a predefined set of styles. To add your own style, do the following:
1. Add a new CSS file (e.g. mystyle.css) by copying one of the existing files from the CSS directory.
2. Edit your file (css/mystyle.css) and adjust the CSS settings to your liking.
3. Add the name of your style without file extension to the available styles in lib/config.php:
// Available styles:
$config['styleAvailable'] = array('mystyle','beige','black','grey');
// Default style:
$config['styleDefault'] = 'mystyle';
If customizing the layout by using CSS is not enough, adjust the template files in lib/template/.
Logs:
=====
By default, AJAX Chat stores all chat messages in the database.
To access the logs you have to add the GET parameter view=logs to your chat url:
e.g. http://example.org/path/to/chat/?view=logs
If you are not already logged in, you have to login as administrator to access the logs.
The log view enables you to monitor the latest chat messages on all channels.
It is also possible to view the logs of private rooms and private messages.
You have the option to filter the logs by date, time and search strings.
The search filter accepts MySQL style regular expressions:
http://dev.mysql.com/doc/refman/5.1/en/regexp.html
To search for IPs, use the following syntax:
ip=127.0.0.1
Shoutbox:
=========
AJAX Chat is also usable as shoutbox - this is a short guide on how to set it up:
1. Shoutbox stylesheet
----------------------
Add the following line to the stylesheet (CSS) of all pages displaying the shoutbox:
@import url("http://example.org/path/to/chat/css/shoutbox.css");
Replace http://example.org/path/to/chat/ with the URL to the chat.
Modify css/shoutbox.css to your liking.
2. Shoutbox function
--------------------
Add the following function to your PHP code:
<?php
function getShoutBoxContent() {
// URL to the chat directory:
if(!defined('AJAX_CHAT_URL')) {
define('AJAX_CHAT_URL', './chat/');
}
// Path to the chat directory:
if(!defined('AJAX_CHAT_PATH')) {
define('AJAX_CHAT_PATH', realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/chat').'/');
}
// Validate the path to the chat:
if(is_file(AJAX_CHAT_PATH.'lib/classes.php')) {
// Include Class libraries:
require_once(AJAX_CHAT_PATH.'lib/classes.php');
// Initialize the shoutbox:
$ajaxChat = new CustomAJAXChatShoutBox();
// Parse and return the shoutbox template content:
return $ajaxChat->getShoutBoxContent();
}
return null;
}
?>
Make sure AJAX_CHAT_URL and AJAX_CHAT_PATH point to the chat directory.
2. Shoutbox output
------------------
Display the shoutbox content using the shoutbox function:
<div style="width:200px;"><?php echo getShoutBoxContent(); ?></div>