[ABD] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
dpm
Registered User
Posts: 10
Joined: Sat Mar 07, 2009 5:06 pm

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by dpm » Tue May 26, 2009 9:44 am

I have this chat installed on my site http://domebo.net/forum and it works great, thanks! However, some users are requesting that we have a way of turning off images in the chat in the UCP or via some button on the chat itself (i.e. some want to see the images, others do not). Is this possible?

Jeroen B
Registered User
Posts: 1222
Joined: Wed Jul 02, 2008 6:23 pm
Location: The Netherlands
Name: Jeroen

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by Jeroen B » Tue May 26, 2009 1:03 pm

Is it possible to have another chat on the forum?
So to have 2 different chat's, with not the same posts.

Has someone already tried this? Can someone explain me if this possible/how? :)
Jeroen • My modifications

superj707
Registered User
Posts: 1136
Joined: Thu Feb 26, 2009 12:20 am

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by superj707 » Tue May 26, 2009 8:02 pm

Pietje15 wrote:Is it possible to have another chat on the forum?
So to have 2 different chat's, with not the same posts.

Has someone already tried this? Can someone explain me if this possible/how? :)
sounds like you are trying to have multi room chat. this is listed as being in the roadmap for upcoming versions of this chat. I am not sure how far a long handyman is with this but presumably he is getting closer. If you can wait it may be best to do so. I hope this helps.

tbma2008
Registered User
Posts: 44
Joined: Wed Apr 16, 2008 1:07 am

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by tbma2008 » Thu May 28, 2009 8:37 pm

tryin to install.....everytime i try i get a white screen that says "you did not select a mode"

am i missing somethin? haha
TBMAMUSIC.COM

User avatar
spaceace
Registered User
Posts: 1857
Joined: Wed Jan 30, 2008 8:50 pm
Contact:

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by spaceace » Thu May 28, 2009 8:50 pm

tbma2008 wrote:tryin to install.....everytime i try i get a white screen that says "you did not select a mode"

am i missing somethin? haha
yes, the DIY instructions at the bottom of the install instructions ;)

browse to

Code: Select all

yourforumhere/chat_install.php?mode=install

User avatar
Neuropass
Registered User
Posts: 1158
Joined: Fri Apr 17, 2009 2:02 pm
Location: SciTE4AutoIt3

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by Neuropass » Fri May 29, 2009 12:06 am

i have a problem.. when i "shout" something between the code tag in the chatbox something weird happens.. check the screen shot you'll see what i mean.. How can i fix it? what could be the problem?


http://i44.tinypic.com/347zfpx.jpg

User avatar
vwrmic
Registered User
Posts: 175
Joined: Mon Apr 07, 2008 11:06 pm
Location: Inside my server!

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by vwrmic » Fri May 29, 2009 9:07 am

Would anyone be kind enough to tell me how I could change the text colour for "Chat updates every 5 seconds" without changing the colour of all the text on the page? The text colour seems to go off of this in the colours.css

Code: Select all

html, body {
   color: #000000;
   background-color: #202020;
}

THRASHx
Registered User
Posts: 46
Joined: Wed May 27, 2009 1:40 pm

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by THRASHx » Fri May 29, 2009 4:55 pm

I just tried installing this but nothing has shown up :? I did the DIY bit at the end too but nothing shows up.

Any ideas?

platinum_2007
Registered User
Posts: 1101
Joined: Tue Jul 22, 2008 2:47 am
Location: Nova Scotia, Canada

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by platinum_2007 » Fri May 29, 2009 4:57 pm

THRASHx wrote:I just tried installing this but nothing has shown up :? I did the DIY bit at the end too but nothing shows up.

Any ideas?
WHat happens when you go to yoursite.com/chat.php ?


Make sure you did the edits to index_body.html to the template in your custom style if you are using one also.

User avatar
mej284
Registered User
Posts: 1126
Joined: Fri Nov 02, 2007 11:38 am

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by mej284 » Fri May 29, 2009 5:05 pm

Did you also remember to go to the ACP>styles>template and select refresh on all the styles that you worked on. As well as go to ACP>General and purge cache and finally reload your site's page on the brower you are using.
I do not respond to unsolicited PM's

Skin-lab styles
SubMerged Style

Jeroen B
Registered User
Posts: 1222
Joined: Wed Jul 02, 2008 6:23 pm
Location: The Netherlands
Name: Jeroen

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by Jeroen B » Fri May 29, 2009 7:11 pm

Pietje15 wrote:Is it possible to have another chat on the forum?
So to have 2 different chat's, with not the same posts.

Has someone already tried this? Can someone explain me if this possible/how? :)
Someone please help me! :)
Jeroen • My modifications

tbma2008
Registered User
Posts: 44
Joined: Wed Apr 16, 2008 1:07 am

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by tbma2008 » Fri May 29, 2009 7:43 pm

the chat is working from the link chat.php. but it is not working on my actual index_body. it shows the body of the chat but thats it.
TBMAMUSIC.COM

platinum_2007
Registered User
Posts: 1101
Joined: Tue Jul 22, 2008 2:47 am
Location: Nova Scotia, Canada

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by platinum_2007 » Fri May 29, 2009 7:46 pm

tbma2008 wrote:the chat is working from the link chat.php. but it is not working on my actual index_body. it shows the body of the chat but thats it.
This probably means you either forgot to do the edits in index.php or did the incorrectly

User avatar
napus
Registered User
Posts: 128
Joined: Sat Apr 25, 2009 12:01 pm
Location: Poland
Contact:

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by napus » Sat May 30, 2009 3:35 pm

Pietje15 wrote:
Pietje15 wrote:Is it possible to have another chat on the forum?
So to have 2 different chat's, with not the same posts.

Has someone already tried this? Can someone explain me if this possible/how? :)
Someone please help me! :)
nemed another chat eg. xchat make table in SQL phpbb_xchat, also you need to change from chat.php to to xchat.php, chat_body.html to xchat_body.html edn many other changes in files or you can install Ajax Chat which has rooms.

RazerRazer
Registered User
Posts: 180
Joined: Thu Feb 26, 2009 4:56 pm

Re: [Beta] AJAX Chat/Shoutbox MOD 2.0.0 Beta 8

Post by RazerRazer » Sat May 30, 2009 9:14 pm

I tried to make a scond chat room. So I installed the second tables with chatx and make a chatx.php like this:

Code: Select all

<?php
/**
*
* @package phpBB3
* @version $Id: chat.php 52 2007-11-04 05:56:17Z Handyman $
* @copyright (c) 2007 StarTrekGuide
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('chat');

define('CHAT_TABLE', $table_prefix . 'chatx');
define('CHAT_SESSIONS_TABLE', $table_prefix . 'chatx_sessions');

/******************************************/
/* EDIT these for custom online settings */
/****************************************/
$session_time = 300;
$default_delay = 15;
//set status
$times = array(
	'online'	=> 0,
	'idle'		=> 300,
	'offline'	=> 1800,
);
//set delay for each status
$delay = array(
	'online'	=> 5,
	'idle'		=> 60,
	'offline'	=> 300,
);
/*****************************************/
/* DO NOT EDIT ANYTHING BELOW THIS LINE */
/***************************************/

$mode = request_var('mode', '');
$last_id = request_var('last_id', 0);
$last_post = request_var('last_post', 0);
$last_time = request_var('last_time', 0);
$get = $init = false;
$count = 0;

switch ($mode)
{
	default:
$sql = 'SELECT * FROM ' . CHAT_TABLE . ' ORDER BY message_id DESC';
        $result = $db->sql_query_limit($sql, 25);
        $rows = $db->sql_fetchrowset($result);
        $db->sql_freeresult($result);

        $delete_id = 0;
        foreach ($rows as $row)
        {
            if ($count++ == 0)
            {
                $last_id = $row['message_id'];
            }
            $template->assign_block_vars('chatrow', array(
                'MESSAGE_ID'    => $row['message_id'],
                'USERNAME_FULL'    => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
                'MESSAGE'        => generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
                'TIME'            => $user->format_date($row['time']),
                'CLASS'            => ($row['message_id'] % 2) ? 1 : 2,
            ));
            $delete_id = $row['message_id'];
        }
        
        $sql = 'DELETE FROM ' . CHAT_TABLE . '
            WHERE message_id < ' . $delete_id;
        $db->sql_query($sql);

		if ($user->data['user_type'] == USER_FOUNDER || $user->data['user_type'] == USER_NORMAL)
		{
			$sql = 'SELECT * FROM ' . CHAT_SESSIONS_TABLE . " WHERE user_id = {$user->data['user_id']}";
			$result = $db->sql_query($sql);
			$row = $db->sql_fetchrow($result);
			$db->sql_freeresult($result);

			if ($row['user_id'] != $user->data['user_id'])
			{
				$sql_ary = array(
					'user_id'			=> $user->data['user_id'],
					'username'			=> $user->data['username'],
					'user_colour'		=> $user->data['user_colour'],
					'user_login'		=> time(),
					'user_lastupdate'	=> time(),
				);
				$sql = 'INSERT INTO ' . CHAT_SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
				$db->sql_query($sql);
			}
			else
			{
				$sql_ary = array(
					'username'			=> $user->data['username'],
					'user_colour'		=> $user->data['user_colour'],
					'user_login'		=> time(),
					'user_lastupdate'	=> time(),
				);
				$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$user->data['user_id']}";
				$db->sql_query($sql);
			}
		}
		whois_online();
		$template->assign_vars(array(
			'TIME'	=> time(),
			'DELAY'	=> $default_delay,
		));
	break;
	case 'read':
		$sql = 'SELECT * FROM ' . CHAT_TABLE . " WHERE message_id > $last_id ORDER BY message_id DESC";
		$result = $db->sql_query_limit($sql, 25);
		$rows = $db->sql_fetchrowset($result);

		if (!sizeof($rows) && ((time() - 60) < $last_time))
		{
			exit;
		}
		foreach ($rows as $row)
		{
			if ($count++ == 0)
			{
				$last_id = $row['message_id'];
			}
			$template->assign_block_vars('chatrow', array(
				'MESSAGE_ID'	=> $row['message_id'],
				'USERNAME_FULL'	=> clean_username(get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST'])),
				'MESSAGE'		=> generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
				'TIME'			=> $user->format_date($row['time']),
				'CLASS'			=> ($row['message_id'] % 2) ? 1 : 2,
			));
		}
		$db->sql_freeresult($result);
		if ((time() - 60) > $last_time)
		{
			whois_online();
			$sql_ary = array(
				'username'			=> $user->data['username'],
				'user_colour'		=> $user->data['user_colour'],
				'user_lastupdate'	=> time(),
			);
			$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . '
				SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
				WHERE user_id = {$user->data['user_id']}";
			$result = $db->sql_query($sql);
		}
		$get = true;
	break;
	case 'add':
		if (!$user->data['is_registered'] || $user->data['user_type'] == USER_INACTIVE || $user->data['user_type'] == USER_IGNORE)
		{
			redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login'));
		}

		$get = true;
		$read_interval = request_var('read_interval', 0);
		$message = utf8_normalize_nfc(request_var('message', '', true));

		if (!$message)
		{
			break;
		}
		clean_message($message);
		$uid = $bitfield = $options = '';
		$allow_bbcode = $allow_urls = $allow_smilies = true;
		generate_text_for_storage($message, $uid, $bitfield, $options, $allow_bbcode, $allow_urls, $allow_smilies);

		$sql_ary = array(
			'chat_id'			=> 2,
			'user_id'			=> $user->data['user_id'],
			'username'			=> $user->data['username'],
			'user_colour'		=> $user->data['user_colour'],
			'message'			=> $message,
			'bbcode_bitfield'	=> $bitfield,
			'bbcode_uid'		=> $uid,
			'bbcode_options'	=> $options,
			'time'				=> time(),
		);
		$sql = 'INSERT INTO ' . CHAT_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
		$db->sql_query($sql);

		$sql_ary = array(
			'username'			=> $user->data['username'],
			'user_colour'		=> $user->data['user_colour'],
			'user_lastpost'		=> time(),
			'user_lastupdate'	=> time(),
		);
		$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$user->data['user_id']}";
		$result = $db->sql_query($sql);


		$sql = 'SELECT * FROM ' . CHAT_TABLE . " WHERE message_id > $last_id ORDER BY message_id DESC";
		$result = $db->sql_query_limit($sql, 25);
		$rows = $db->sql_fetchrowset($result);

		if (!sizeof($rows) && ((time() - 60) < $last_time))
		{
			exit;
		}
		foreach ($rows as $row)
		{
			if ($count++ == 0)
			{
				$last_id = $row['message_id'];
			}
			$template->assign_block_vars('chatrow', array(
				'MESSAGE_ID'	=> $row['message_id'],
				'USERNAME_FULL'	=> clean_username(get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST'])),
				'MESSAGE'		=> generate_text_for_display($row['message'], $row['bbcode_uid'], $row['bbcode_bitfield'], $row['bbcode_options']),
				'TIME'			=> $user->format_date($row['time']),
				'CLASS'			=> ($row['message_id'] % 2) ? 1 : 2,
			));
		}
		$db->sql_freeresult($result);

		if ($read_interval != $delay['online'])
		{
			whois_online();
		}
	break;
	case 'delete':
		$get = true;
		$chat_id = request_var('chat_id', 0);

		if (!$chat_id)
		{
			break;
		}

		if (!$auth->acl_get('a_') && !$auth->acl_get('m_'))
		{
			break;
		}
		$sql = 'DELETE FROM ' . CHAT_TABLE . " WHERE message_id = $chat_id";
		$db->sql_query($sql);

	break;
}

$mode = strtoupper($mode);
$template->assign_vars(array(
	'FILENAME'		=> append_sid("{$phpbb_root_path}chat.$phpEx"),
	'LAST_ID'		=> $last_id,
	'S_CHAT'		=> (!$get) ? true : false,
	'S_GET_CHAT'	=> ($get) ? true : false,
	'S_' . $mode	=> true,
));
page_header($user->lang['PAGE_TITLE']);

$template->set_filenames(array(
	'body' => 'chat_body.html')
);

page_footer();

function whois_online()
{
	global $db, $template, $user;
	global $delay, $last_post, $session_time;

	$check_time = time() - $session_time;

	$sql_ary = array(
		'username'			=> $user->data['username'],
		'user_colour'		=> $user->data['user_colour'],
		'user_lastupdate'	=> time(),
	);
	$sql = 'UPDATE ' . CHAT_SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$user->data['user_id']}";
	$db->sql_query($sql);

	$sql = 'DELETE FROM ' . CHAT_SESSIONS_TABLE . " WHERE user_lastupdate < $check_time";
	$db->sql_query($sql);

	$sql = 'SELECT *
		FROM ' . CHAT_SESSIONS_TABLE . "
		WHERE user_lastupdate > $check_time
		ORDER BY username ASC";
	$result = $db->sql_query($sql);

	$status_time = time();
	while ($row = $db->sql_fetchrow($result))
	{
		if ($row['user_id'] == $user->data['user_id'])
		{
			$last_post = $row['user_lastpost'];
			$login_time = $row['user_login'];
			$status_time = ($last_post > $login_time) ? $last_post : $login_time;
		}
		$status = get_status($row['user_lastpost']);
		$template->assign_block_vars('whoisrow', array(
			'USERNAME_FULL'	=> clean_username(get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST'])),
			'USER_STATUS'	=> $status,
		));
	}
	$db->sql_freeresult($result);

	$template->assign_vars(array(
		'DELAY'			=> ($status_time) ? $delay[get_status($status_time)] : $delay['idle'],
		'LAST_TIME'		=> time(),
		'S_WHOISONLINE'	=> true,
	));
	return false;
}
function get_status($last)
{
	global $times;

	$status = 'online';
	if ($last < (time() - $times['offline']))
	{
		$status = 'offline';
	}
	else if ($last < (time() - $times['idle']))
	{
		$status = 'idle';
	}
	return $status;
}

function clean_message(&$message)
{
	if (strpos($message, '---') !== false)
	{
		$message = str_replace('---', '–––', $message);
		clean_message($message);
	}
}

function clean_username($user)
{
	if (strpos($user, '---') !== false)
	{
		$user = str_replace('---', '–––', $user);
		clean_username($user);
	}
	
	return $user;
}

?>
But when I post a message, I see the messages from my first chat. I think, I have to change the $sql = 'INSERT INTO ' . CHAT_TABLE , but $sql = 'INSERT INTO ' . CHATX_TABLE is not funcion. What is false?

Thanks!

Locked

Return to “[3.0.x] Abandoned MODs”