Sivu 1/1

3.0.5 ja Ajax/Shoutbox

Lähetetty: 18 Heinä 2009, 14:57
Kirjoittaja markov
Päivitin foorumin äskettäin 3.0.5-versioon ja asensin sen jälkeen Ajax Chatin- kaikki ok. Shoutboxin asentamiseen kaipaisin vähän lisäselvennystä: mitä mihinkin tiedostoon ja missä muodossa polut on oltava (AJAX_CHAT_PATH / AJAX_CHAT_URL). Jos joku pysty tarkemmin sanomaan tästä tai tietää muualla asiaa jo käsitellyn, niin please! Ilmeisesti Shoutbox kuitenkin on asennettavissa tähänkin versioon?

Kiitoksia!

_____________________________________
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>

____________________________________________

Re: 3.0.5 ja Ajax/Shoutbox

Lähetetty: 19 Heinä 2009, 14:32
Kirjoittaja Peetra
Ne ovat kaikki nimeltään jokin AJax Chat, voitko antaa urlia mistä nimenomaisesta chatista puhut?