Integration einer Ajax-Shoutbox

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 3.0 hat das Ende seiner Lebenszeit überschritten
phpBB 3.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 3.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf die neuste phpBB-Version, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
Schafi
Mitglied
Beiträge: 5
Registriert: 06.01.2009 20:18

Integration einer Ajax-Shoutbox

Beitrag von Schafi »

Hallo Leute,

ich habe eine Shoutbox / einen Chat von http://sourceforge.net/project/showfile ... _id=214758 herunter geladen und installiert. Soweit so gut. Sie scheint auch zu funktionieren. Ich würde sie nun gerne in das Forum integrieren. Nutze den Style subsilver2. Welches Template muss ich nutzen? Habe schon viel probiert, aber es funktioniert nicht (im Forum ändert sich gar nichts - auch nicht, wenn ich aktualisiere).

Es wäre super, wenn mir jemand helfen könnte, wo ich den Code / die Codes einfügen muss, damit es funktioniert.

Vielen Dank!

Das hier ist in der Readme zu lesen:

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

Re: Integration einer Ajax-Shoutbox

Beitrag von worstbull »

overall_header
Benutzeravatar
Metzle
Ehemaliges Teammitglied
Beiträge: 10435
Registriert: 08.03.2008 02:50
Wohnort: Waiblingen-Neustadt
Kontaktdaten:

Re: Integration einer Ajax-Shoutbox

Beitrag von Metzle »

Hallo,

je nachdem wo du deine Shoutbox platzieren willst, musst du die Datei styles/subsilver2/template/index_body.html bearbeiten und den Code für die Shoutbox, also der Code unter 2., einfügen. Eventuell könnten auch die Dateien styles/subsilver2/template/overall_header.html oder styles/subsilver2/template/overeall_footer.html dafür in Frage kommen.
Metzle
phpBB.de-Support-Team
Allround-phpBB.de
Schafi
Mitglied
Beiträge: 5
Registriert: 06.01.2009 20:18

Re: Integration einer Ajax-Shoutbox

Beitrag von Schafi »

Hi,

also ich habe jetzt folgenden Code in index_body.html eingefügt:

Code: Alles auswählen

<?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;
}
?>



<div style="width:200px;"><?php echo getShoutBoxContent(); ?></div>
Es funktioniert nicht, d.h. es wird nichts angezeigt. Den Chat habe ich über einen Inline-Frame eingepflegt, das klappt sehr gut, ich möchte den Chat jetzt nur umwandeln in eine Shoutbox.

Vielleicht kann mir jemand sagen, ob ich an dem Quelltext noch etwas ändern muss.
Antworten

Zurück zu „[3.0.x] Mod Support“