[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.
Locked
T50
Registered User
Posts: 333
Joined: Mon May 07, 2007 11:51 pm
Contact:

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

Post by T50 »

I think your bbcode uid is messed up
Free Webhosting with option of getting paid plan <-- No Ads, No Pop-ups, Absolutely free/ or use promo code T50 to get a 10% discount on paid plan!
Make a few $$ in under a few minutes, easy to do

Webmaster of a Northeast Wisconsin Boy Scout Troop Website, http://bsat50.info
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 »

T50 wrote:I think your bbcode uid is messed up
Where can I find that and how can I fix it? :)

On the forum itself the BBCode does word, but not in the chat.
Jeroen • My modifications
User avatar
KeithR
Former Team Member
Posts: 750
Joined: Mon Jun 16, 2008 6:59 pm
Location: Manchester, UK
Name: Keith R

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

Post by KeithR »

Pietje15 wrote:Hello,

I use the smilie and BBCode add-on for prosilver styles.
But when I try to use a BBCode, for example bold, is gives a weird code when I submit a message in the chatbox. Like this: [b5nj][/b5nj].

And when I type something in the message box, and I click the bold button, it doesn't give me

Code: Select all

[b][/b]
, nothing happends when I click that button. It only works when I first select the text and then hit the bold button. Hope someone can help me! :(
Hi Pietje15 , are you sure you ran this query?

Code: Select all

ALTER TABLE phpbb_chat CHANGE bbcode_uid bbcode_uid varchar(8) NOT NULL default '';
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 »

Oh I forgot that!
Can you explain me how I do that? It's in phpMyAdmin isn't it?
Jeroen • My modifications
User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7826
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

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

Post by JimA »

Yes, it is. Here's a tutorial for running SQL Query's. :)

Knowledge Base - Executing SQL Queries in phpMyAdmin
Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.
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 »

JimA wrote:Yes, it is. Here's a tutorial for running SQL Query's. :)

Knowledge Base - Executing SQL Queries in phpMyAdmin
Oh I did it myself :oops:
I'm sorry!

Thank you 2 very much :D
Jeroen • My modifications
sevenseven
Registered User
Posts: 159
Joined: Mon Oct 23, 2006 9:35 pm

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

Post by sevenseven »

richey wrote:okay, here is a quick & dirty hack for a flooding limit (maximum number of concurrent users allowed to the chat), since Handyman´ doesn't sound like this resource-saving feature would ever be added.

After

Code: Select all

			if ($row['user_id'] != $user->data['user_id'])
add:

Code: Select all

			{ // limit concurrent users hack - START
				$sql = 'SELECT COUNT(user_id) as count FROM ' . CHAT_SESSIONS_TABLE;
				$result = $db->sql_query($sql);
				$users_count = $db->sql_fetchfield('count', false, $result);
				$db->sql_freeresult($result);
				if ($users_count >= 7){ // add max # of users or your global constant here
					redirect(append_sid("{$phpbb_root_path}index.$phpEx")); 
				}else
			// limit concurrent users hack - END
After

Code: Select all

				$sql = 'INSERT INTO ' . CHAT_SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
				$db->sql_query($sql);
			}
add:

Code: Select all

} // limit concurrent users hack
Hope this is of use for anyone else than me 8-) ..

Of course, a Javascript popup or something like that would be nice to inform the user, anyone knows how to do that?

There is a way to set a flood control for the message? something like the flood control for the topic?
rubenj
Registered User
Posts: 88
Joined: Wed Aug 13, 2008 1:20 am

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

Post by rubenj »

@Handyman

Hello. Sorry for the long delay. Very busy. I tired what you said, replacing the files. It didn't work. Look now. Something new.

rubenforum.co.cc
Pixel Raider Hosting
The best hosting known to man!
5GB Disk Space, Unlimited: Bandwidth, Email Accounts, MySQL Databases etc...
ALL FREE!
User avatar
Handyman`
Former Team Member
Posts: 1751
Joined: Thu Feb 03, 2005 8:44 pm
Contact:

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

Post by Handyman` »

rubenj wrote:@Handyman

Hello. Sorry for the long delay. Very busy. I tired what you said, replacing the files. It didn't work. Look now. Something new.

rubenforum.co.cc
erm, I can't see anything currently… do you have a login for me?
http://startrekguide.com My Mod Queue || 1/16/10 Display Posts Anywhere 1.2.0 RC5, Cash MOD 1.0.0 b1, MOD Version Check, AJAX Chat, SEO MOD, AJAX QR, Photo Gallery
MOD Development Manager (version 0.2.0-dev with MODX Generator)
shahinavthal
Registered User
Posts: 277
Joined: Fri Sep 19, 2008 6:53 am

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

Post by shahinavthal »

Can we have a smilies list,Bold,Italic options etc along with this MOD???
rubenj
Registered User
Posts: 88
Joined: Wed Aug 13, 2008 1:20 am

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

Post by rubenj »

Handyman` wrote:
rubenj wrote:@Handyman

Hello. Sorry for the long delay. Very busy. I tired what you said, replacing the files. It didn't work. Look now. Something new.

rubenforum.co.cc
erm, I can't see anything currently… do you have a login for me?
Ha! Kill me. :lol: How could I forgot that part! Ahh, silly me.

Your Account is guest_account password: test100
Pixel Raider Hosting
The best hosting known to man!
5GB Disk Space, Unlimited: Bandwidth, Email Accounts, MySQL Databases etc...
ALL FREE!
shahinavthal
Registered User
Posts: 277
Joined: Fri Sep 19, 2008 6:53 am

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

Post by shahinavthal »

shahinavthal wrote:Can we have a smilies list,Bold,Italic options etc along with this MOD???
Sorry for the question...I found the answer too :D
Deathly Hallow
Registered User
Posts: 277
Joined: Mon Apr 21, 2008 11:58 am
Location: Netherlands

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

Post by Deathly Hallow »

shahinavthal wrote:
shahinavthal wrote:Can we have a smilies list,Bold,Italic options etc along with this MOD???
Sorry for the question...I found the answer too :D
I didn't find the answer already. =( I use a prosilver based style.
User avatar
Handyman`
Former Team Member
Posts: 1751
Joined: Thu Feb 03, 2005 8:44 pm
Contact:

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

Post by Handyman` »

rubenj wrote:
Handyman` wrote:
rubenj wrote:@Handyman

Hello. Sorry for the long delay. Very busy. I tired what you said, replacing the files. It didn't work. Look now. Something new.

rubenforum.co.cc
erm, I can't see anything currently… do you have a login for me?
Ha! Kill me. :lol: How could I forgot that part! Ahh, silly me.

Your Account is guest_account password: test100
chat.php seems to be working now… it wasn't last time I looked.
What happens if you include shout.php as per the instructions now?
http://startrekguide.com My Mod Queue || 1/16/10 Display Posts Anywhere 1.2.0 RC5, Cash MOD 1.0.0 b1, MOD Version Check, AJAX Chat, SEO MOD, AJAX QR, Photo Gallery
MOD Development Manager (version 0.2.0-dev with MODX Generator)
rubenj
Registered User
Posts: 88
Joined: Wed Aug 13, 2008 1:20 am

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

Post by rubenj »

Code: Select all

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

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

define('CHAT_TABLE', $table_prefix . 'chat');
define('CHAT_SESSIONS_TABLE', $table_prefix . 'chat_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 */
/***************************************/
$user->add_lang('chat');
$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);

		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,
			));
		}
		$db->sql_freeresult($result);

		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_lastupdate'	=> time(),
					'user_login'		=> 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(),
		));
	break;
}

$mode = strtoupper($mode);
$template->assign_vars(array(
	'FILENAME'		=> append_sid("{$phpbb_root_path}chat.$phpEx"),
	'LAST_ID'		=> $last_id,
	'S_' . $mode	=> true,
));

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']}";
	$result = $db->sql_query($sql);

	$sql = 'DELETE FROM ' . CHAT_SESSIONS_TABLE . " WHERE user_lastupdate < $check_time";
	$db->sql_query($sql);
	
	$status_time = false;
	$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'	=> get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], $user->lang['GUEST']),
			'USER_STATUS'	=> $status,
		));
		$user_ary[] = $row['user_id'];
	}
	$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;
}
?>


There you are HandyMan.
Pixel Raider Hosting
The best hosting known to man!
5GB Disk Space, Unlimited: Bandwidth, Email Accounts, MySQL Databases etc...
ALL FREE!
Locked

Return to “[3.0.x] Abandoned MODs”