AJAX-Chat


Topic author
fbschroeder
Active Member
Posts: 20
Joined: 22. December 2010 08:59
phpBB.de User: fbschroeder

AJAX-Chat

Post by fbschroeder »

Hallo,
Ich habe den Chat von dieser Seite installiert:
http://frug.github.com/AJAX-Chat/
Wie Binde ich den jetzt ins Portal ein?
Meine Seite:
http://Www.koistammtisch-sh.de
Mir würde ein Block reichen, der anzeigt, wer gerade im Chat ist.

Gruß
Schroedi
User avatar

cpg
Sponsor
Posts: 119
Joined: 3. September 2010 19:42
phpBB.de User: cpg
Location: Ringsberg
Contact:

Re: AJAX-Chat

Post by cpg »

Moin,

ich habe in der overall_header.html
da, wo auch
<a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}"><span>{L_FAQ}</span></a>
steht, folgendes eingefügt:
<a title="{CHAT_TITLE}" href="http://www.meinforum.de/phpBB3/chat/">{CHAT_LABEL}</a>

Einen Block habe ich dafür nicht genommen, sondern einfach nur den Link zum Chat.

Gruß
CPG

Topic author
fbschroeder
Active Member
Posts: 20
Joined: 22. December 2010 08:59
phpBB.de User: fbschroeder

Re: AJAX-Chat

Post by fbschroeder »

Hi,
danke für den Tipp.
Vielleicht habe ich mich falsch ausgedrückt. Einen Menüpunkt, der zum Chat führt, habe ich gemacht. War auch kein Problem.
Mit geht es jetzt darum, dass im Portal angezeigt wird (in einem kleinen Block), ob und wer sich aktuell im Chat befindet. Also quasi als Hinweis "Da ist jemand, da will ich auch hin".
Gruß
Schroedi
User avatar

Kirk
Dev
Posts: 1954
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: AJAX-Chat

Post by Kirk »

Hi
Du müsstest dir ein neues Modul erstellen, wie hier beschrieben: /knowledge/kb_show.php?id=58
Gruß Udo
User avatar

cpg
Sponsor
Posts: 119
Joined: 3. September 2010 19:42
phpBB.de User: cpg
Location: Ringsberg
Contact:

Re: AJAX-Chat

Post by cpg »

Moin,

bei mir wird in der eckigen Klammer angezeigt, wieviele Leute gerade im Chat sind - und wenn ich mit der Maus drüberfahre, sehe ich, wer...

Image

Gruß
CPG

Topic author
fbschroeder
Active Member
Posts: 20
Joined: 22. December 2010 08:59
phpBB.de User: fbschroeder

Re: AJAX-Chat

Post by fbschroeder »

cpg wrote:Moin,

bei mir wird in der eckigen Klammer angezeigt, wieviele Leute gerade im Chat sind - und wenn ich mit der Maus drüberfahre, sehe ich, wer...

Image

Gruß
CPG
Hi,
genau so wäre das eine tolle Lösung für mich. Ein Block muss nicht unbedingt sein.
Wie hast Du das genau gemacht? Habe es mal mit Deinem o.a. Befehl zu machen. Da tut sich bei mir leider gar nichts.
Gruß
Schroedi
User avatar

cpg
Sponsor
Posts: 119
Joined: 3. September 2010 19:42
phpBB.de User: cpg
Location: Ringsberg
Contact:

Re: AJAX-Chat

Post by cpg »

Moin,

hast du den Chat in der includes/function.php
eingebunden?

vor

Code: Select all


?>
das ist ganz am Ende

Code: Select all

function getChatInterface() {
           static $ajaxChat;

           if(!$ajaxChat) {
              // 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 chat interface:
                 $ajaxChat = new CustomAJAXChatInterface();
              }
           }

           return $ajaxChat;
        }

        function getChatOnlineUsers() {
           return ($chatInterface = getChatInterface()) ? $chatInterface->getOnlineUsers() : array();
        }

        function getChatOnlineUserIDs() {
           return ($chatInterface = getChatInterface()) ? $chatInterface->getOnlineUserIDs() : 
}
und weiterhin auch in der includes/function.php:

Code: Select all

     if(in_array($row['user_id'], getChatOnlineUserIDs()))
                    {
                        $user_online_link = '<span title="* = '.strip_tags($row['username']).' is logged into the Chat">'.$user_online_link.'*</span>';
                    }
einfügen vor

Code: Select all

 $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;
und

Code: Select all

  'CHAT_LINK'                  => append_sid("{$phpbb_root_path}chat/index.$phpEx"),
        'CHAT_LABEL'               => 'Chat ['.count(getChatOnlineUserIDs()).']',
        'CHAT_TITLE'               => 'Online: '.htmlentities(implode(', ', getChatOnlineUsers()), ENT_QUOTES, 'UTF-8'),
nach

Code: Select all

// The following assigns all _common_ variables that may be used at any point in a template.
    $template->assign_vars(array(
die Zeile für die overall_header.html hatte ich Dir schon genannt.



Gruß
CPG

Topic author
fbschroeder
Active Member
Posts: 20
Joined: 22. December 2010 08:59
phpBB.de User: fbschroeder

Re: AJAX-Chat

Post by fbschroeder »

Hallo,
ich habe diese Änderung an den Systemdateien nicht gemacht. Davon ist in der Installation-Anweisung auch nicht die Rede.
Habe das jetzt mal nachgeholt und das verursachte nur Fehlermeldungen. Daher habe ich das ganze wieder rüclgängig gemacht.
Gruß
Schroedi
User avatar

cpg
Sponsor
Posts: 119
Joined: 3. September 2010 19:42
phpBB.de User: cpg
Location: Ringsberg
Contact:

Re: AJAX-Chat

Post by cpg »

Moin,
das verursachte nur Fehlermeldungen
Weißt Du noch welche?

Bei mir läuft das problemlos und sollte auch bei Dir hinzubekommen sein.

Gruß
CPG

Trilon
Active Member
Posts: 24
Joined: 4. February 2013 16:31
phpBB.de User: Trilon
phpBB.com User: Trilon

Re: AJAX-Chat

Post by Trilon »

Code: Select all

<div style="font-size: 1.2em; margin-bottom: 20px;">{SHOUTBOX}</div>
<div id="ajaxChatCopyright"><a href="https://blueimp.net/ajax/">AJAX Chat</a> &copy; <a href="https://blueimp.net">blueimp.net</a></div>
In den footer gelegt...aber die Shoutbox wird unter dem Copyright angezeigt...

Wie oder was muss ich ändern
User avatar

Kirk
Dev
Posts: 1954
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: AJAX-Chat

Post by Kirk »

Hallo
Versuch doch mal diesen Code in einen eigenen Block zu tun,
achte darauf das du bei BBCode für den eigenen Block aktivieren auf nein stellst.
Gruß Udo

Trilon
Active Member
Posts: 24
Joined: 4. February 2013 16:31
phpBB.de User: Trilon
phpBB.com User: Trilon

Re: AJAX-Chat

Post by Trilon »

Kirk wrote:Hallo
Versuch doch mal diesen Code in einen eigenen Block zu tun,
achte darauf das du bei BBCode für den eigenen Block aktivieren auf nein stellst.
Schon mal cool...aber schau mal dies
Image
User avatar

Kirk
Dev
Posts: 1954
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: AJAX-Chat

Post by Kirk »

Dann müßtest du dir selbst ein Modul erstellen, wie das geht steht hier:
Bearbeiten einer Modul Datei
Gruß Udo

Trilon
Active Member
Posts: 24
Joined: 4. February 2013 16:31
phpBB.de User: Trilon
phpBB.com User: Trilon

Re: AJAX-Chat

Post by Trilon »

Ja ich weiss...aber nach der Anleitung die dort ist habe ich es schon versucht...wo bekomme ich denn her wie diese Datei heisst...

Code: Select all

<?php
/**
*
* @package Board3 Portal v2 - Shoutbox
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* @package Shoutbox
*/
class portal_shoutbox_module
{
	/**
	* Allowed columns: Just sum up your options (Exp: left + right = 10)
	* top		1
	* left		2
	* center	4
	* right		8
	* bottom	16
	*/
	public $columns = 4;

	/**
	* Default modulename
	*/
	public $name = 'SHOUTBOX';

	/**
	* Default module-image:
	* file must be in "{T_THEME_PATH}/images/portal/"
	*/
	public $image_src = 'modulename.png';

	/**
	* module-language file
	* file must be in "language/{$user->lang}/mods/portal/"
	*/
	public $language = '';
	
	/**
	* custom acp template
	* file must be in "adm/style/portal/"
	*/
	public $custom_acp_tpl = '';
	
	/**
	* hide module name in ACP configuration page
	*/
	public $hide_name = false;

	public function get_template_center($module_id)
	{
		global $config, $template;

		$template->assign_vars(array(
			'EXAMPLE'			=> $config['board3_configname_' . $module_id],
		));

		return 'modulename_center.html';
	}

	public function get_template_side($module_id)
	{
		global $config, $template;

		$template->assign_vars(array(
			'EXAMPLE'			=> $config['board3_configname2_' . $module_id],
		));

		return 'modulename_side.html';
	}

	public function get_template_acp($module_id)
	{
		return array(
			'title'	=> 'ACP_CONFIG_MODULENAME',
			'vars'	=> array(
				'legend1'								=> 'ACP_MODULENAME_CONFIGLEGEND',
				'board3_configname_' . $module_id	=> array('lang' => 'MODULENAME_CONFIGNAME',		'validate' => 'string',	'type' => 'text:10:200',	'explain' => false),
				'board3_configname2_' . $module_id	=> array('lang' => 'MODULENAME_CONFIGNAME2',	'validate' => 'int',	'type' => 'text:3:3',		'explain' => true),
			),
		);
	}

	/**
	* API functions
	*/
	public function install($module_id)
	{
		set_config('board3_configname_' . $module_id, 'Hello World!');
		set_config('board3_configname2_' . $module_id, 1337);
		return true;
	}

	public function uninstall($module_id)
	{
		global $db;

		$del_config = array(
			'board3_configname_' . $module_id,
			'board3_configname2_' . $module_id,
		);
		$sql = 'DELETE FROM ' . CONFIG_TABLE . '
			WHERE ' . $db->sql_in_set('config_name', $del_config);
		return $db->sql_query($sql);
	}
}
User avatar

Kirk
Dev
Posts: 1954
Joined: 27. July 2010 18:02
phpBB.de User: Kirk
Contact:

Re: AJAX-Chat

Post by Kirk »

Ich hab zwar diesen Chat nicht aber probier das hier mal:

Erstelle eine Datei mit den Namen shoutbox.php mit folgenden Inhalt:

Code: Select all

<?php
/**
*
* @package - Board3portal v2 Shoutbox
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
    exit;
}

/**
* @package Shoutbox
*/
class shoutbox_module
{
    /**
    * Allowed columns: Just sum up your options (Exp: left + right = 10)
    * top        1
    * left        2
    * center    4
    * right        8
    * bottom    16
    */
    public $columns = 21;

    /**
    * Default modulename
    */
    public $name = 'SHOUTBOX';

    /**
    * Default module-image:
    * file must be in "{T_THEME_PATH}/images/portal/"
    */
    public $image_src = '';

    /**
    * module-language file
    * file must be in "language/{$user->lang}/mods/portal/"
    */
    public $language = 'portal_shoutbox';
    
    /**
    * custom acp template
    * file must be in "adm/style/portal/"
    */
    public $custom_acp_tpl = '';
    
    /**
    * hide module name in ACP configuration page
    */
    public $hide_name = false;

    public function get_template_center($module_id)
    {
        global $config, $template, $user, $phpbb_root_path, $phpEx;
        
// Show all errors:
error_reporting(E_ALL);

// Path to the chat directory:
define('AJAX_CHAT_PATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');

// Include custom libraries and initialization code:
require(AJAX_CHAT_PATH.'lib/custom.php');

// Include Class libraries:
require(AJAX_CHAT_PATH.'lib/classes.php');

// Initialize the chat:
$ajaxChat = new CustomAJAXChat();


        return 'shoutbox.html';
    }

    public function get_template_acp($module_id)
    {
        return array(
            'title'    => 'PORTAL_SHOUTBOX',
            'vars'    => array(),
        );
    }

    /**
    * API functions
    */
    public function install($module_id)
    {
        return true;
    }

    public function uninstall($module_id)
    {
        return true;
    }
}
Diese Datei lädst du nach root/portal/modules

Erstelle eine Datei mit den Namen portal_shoutbox.php mit folgenden Inhalt:

Code: Select all

<?php
/**
*
* @package - Board3portal v2 Shoutbox
* @version 1.0.0
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/

/**
* DO NOT CHANGE
*/
if (!defined('IN_PHPBB'))
{
    exit;
}

if (empty($lang) || !is_array($lang))
{
    $lang = array();
}

// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine

$lang = array_merge($lang, array(
    'PORTAL_SHOUTBOX'             => 'Shoutbox',

    
));
?>
Achte beim Abspeichern dieser Datei auf die richtige Kodierung UTF8 ohne BOM
Lade diese Datei nach root/language/de/mods/portal

Erstelle eine Datei mit den Namen shoutbox.html mit folgenden Inhalt:

Code: Select all

{$C_BLOCK_H_L}{$TITLE}{$C_BLOCK_H_R}
		<ul class="topiclist forums">
			<li>
				<dl> 
					<dd style="width: 100%; text-align: center; border-left:0px;">
					<table width="100%">
<div style="font-size: 1.2em; margin-bottom: 20px;">{SHOUTBOX}</div>
<div id="ajaxChatCopyright"><a href="https://blueimp.net/ajax/">AJAX Chat</a> &copy; <a href="https://blueimp.net">blueimp.net</a></div>
    					</table>
					</dd>
				</dl>
			</li>
		</ul>
{$C_BLOCK_F_L}{$C_BLOCK_F_R}
Lade diese nach root/styles/[stylename]/template/portal/modules
Anmerkung:
Diese html Datei ist für prosilver basierende Styles!
Gruß Udo
Post Reply

Return to “Modification Requests”