[ABD] AJAX Chat

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.
User avatar
RiTz21
Registered User
Posts: 213
Joined: Tue May 31, 2005 5:20 pm

Re: [RC] AJAX Chat

Post by RiTz21 »

GameraFan wrote:
RiTz21 wrote:Well, since I really wanted the feature #1 I requested, I implemented it on my copy of the chat mod...

Example:
/roll 2d6+12 returns:
(21:12:03) ChatBot: (admin) rolls 2d6+12 and gets [6,4]+12=22.

If anyone else needs this, lemme know and I'll share
I'd like to see this code. Would you post it here?
Sure. Just replace the insertParsedMessageRoll function in chat\lib\class\AJAXChat.php with the one below

Code: Select all

	// 12/06/2008: Bonus value can now be added to result (i.e. xdy+z) - RiTz21 http://TheOnlySheet.com
	function insertParsedMessageRoll($textParts) {
		if(count($textParts) == 1) {
			// default is one d6:
			$text = '/roll '.$this->getUserName().' 1d6 '.$this->rollDice(6);
		} else {
			$diceParts = explode('d', $textParts[1]);
			if(count($diceParts) == 2) {
				$bonus = 0;
				$number = (int)$diceParts[0];
				$diceandbonusParts = explode('+', $diceParts[1]);
				
				if(count($diceandbonusParts) == 1) {
					$sides = (int)$diceParts[1];
				} else {
					$sides = (int)$diceandbonusParts[0];
					$bonus = (int)$diceandbonusParts[1];
					if ($bonus > 1000)
						$bonus = 1000;
				}
				
				// Dice number must be an integer between 1 and 100, else roll only one:
				$number = ($number > 0 && $number <= 100) ?  $number : 1;
				
				// Sides must be an integer between 1 and 100, else take 6:
				$sides = ($sides > 0 && $sides <= 100) ?  $sides : 6;
				
				if ($bonus == 0) {
					$text = '/roll '.$this->getUserName().' '.$number.'d'.$sides.' '.'[';
				} else {
					$text = '/roll '.$this->getUserName().' '.$number.'d'.$sides.'+'.$bonus.' '.'[';
				}
				$totalresult = 0;
				$tmpvalue = 0;
				for($i=0; $i<$number; $i++) {
					if($i != 0)
						$text .= ',';
					$tmpvalue = $this->rollDice($sides);
					$text .= $tmpvalue;
					$totalresult += $tmpvalue;
				}
				$totalresult += $bonus;
				$text .= ']';
				if ($bonus != 0)
					$text .= '+'.$bonus;
				$text .= '='.$totalresult;
			} else {
				// if dice syntax is invalid, roll one d6:
				$text = '/roll '.$this->getUserName().' 1d6 '.$this->rollDice(6);
			}
		}
		$this->insertChatBotMessage(
			$this->getChannel(),
			$text
		);
	}
Do let me know of any improvements!
RiTz21
User avatar
muggins
Registered User
Posts: 1183
Joined: Fri Feb 22, 2008 5:12 pm
Location: Texas
Name: Donovan
Contact:

Re: [RC] AJAX Chat

Post by muggins »

Yeah! Like that! :mrgreen:

Thank you!
Muggins
User avatar
RiTz21
Registered User
Posts: 213
Joined: Tue May 31, 2005 5:20 pm

Re: [RC] AJAX Chat

Post by RiTz21 »

muggins wrote:Yeah! Like that! :mrgreen:
Thank you!
You're welcome!
RiTz21
User avatar
easygo
Registered User
Posts: 689
Joined: Sun Oct 31, 2004 4:23 pm
Contact:

Re: [RC] AJAX Chat

Post by easygo »

saaiberke wrote:
easygo wrote:
saaiberke wrote:Hello,

I just installed the shoutbox integration on an acidtech forum, now the background is white but I'd really like to have the shoutbox in the subblack theme. Any idea how I have to change the shoutbox.css to accomplish that?
In your text editor :mrgreen: color by color, taking subblack2.css as example to have something to go on.
Ok, thank you :) Will start the quest this weekend :)

Grtz,

Nic
Godspeed! If you think you got it right, be a treasure and make your css file available for future reference.
I shall consider putting it into the next mod release -- with credits to you of course! :)

Regards
Casual developer for AJAX Chat on behalf of the author / Arcade Center powered by phpBB Arcade

A problem well put is half solved. (John Dewey, 1859–1952)
satandream
Registered User
Posts: 383
Joined: Thu Mar 06, 2008 12:47 pm

Re: [RC] AJAX Chat

Post by satandream »

I got this error when update to 3.0.4

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3450: Undefined variable: row
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3769: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3771: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3772: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3773: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)

line 3450

Code: Select all

if(in_array($row['user_id'], getChatOnlineUserIDs()))
User avatar
easygo
Registered User
Posts: 689
Joined: Sun Oct 31, 2004 4:23 pm
Contact:

Re: [RC] AJAX Chat

Post by easygo »

satandream wrote:I got this error when update to 3.0.4

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3450: Undefined variable: row
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3769: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3771: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3772: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3773: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3184)

line 3450

Code: Select all

if(in_array($row['user_id'], getChatOnlineUserIDs()))
The var row will only be well defined inside the while loop beginning around line 3461!

So any mistake has happened during your update.
Casual developer for AJAX Chat on behalf of the author / Arcade Center powered by phpBB Arcade

A problem well put is half solved. (John Dewey, 1859–1952)
satandream
Registered User
Posts: 383
Joined: Thu Mar 06, 2008 12:47 pm

Re: [RC] AJAX Chat

Post by satandream »

i have

Code: Select all

$user_online_link = $online_userlist = '';
Thats the only line i can find
User avatar
easygo
Registered User
Posts: 689
Joined: Sun Oct 31, 2004 4:23 pm
Contact:

Re: [RC] AJAX Chat

Post by easygo »

satandream wrote:i have

Code: Select all

$user_online_link = $online_userlist = '';
Thats the only line i can find
Try again! Line 3474 (original file) should be the whole line to find ::

Code: Select all

					$online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;
See: http://ajax-chat.wiki.sourceforge.net/p ... chat+users
Casual developer for AJAX Chat on behalf of the author / Arcade Center powered by phpBB Arcade

A problem well put is half solved. (John Dewey, 1859–1952)
satandream
Registered User
Posts: 383
Joined: Thu Mar 06, 2008 12:47 pm

Re: [RC] AJAX Chat

Post by satandream »

sorry my mistake
User avatar
easygo
Registered User
Posts: 689
Joined: Sun Oct 31, 2004 4:23 pm
Contact:

Re: [RC] AJAX Chat

Post by easygo »

No problem! Things happen by doing things. :)
Casual developer for AJAX Chat on behalf of the author / Arcade Center powered by phpBB Arcade

A problem well put is half solved. (John Dewey, 1859–1952)
jhansle1
Registered User
Posts: 25
Joined: Sun Jul 30, 2006 4:53 pm

Re: [RC] AJAX Chat

Post by jhansle1 »

This is a great mod btw!

However, I am having a problem that I can't seem to figure out.

In IE, when I login I chat is launched but I seem to get automatically logged out for some odd reason. It's a matter of seconds... I login and the chat "loads" up and a second later, I get logged out ..

This is not a problem in Firefox, ONLY in IE.

Any help would be greatly appreciated!

Thanks,

J
satandream
Registered User
Posts: 383
Joined: Thu Mar 06, 2008 12:47 pm

Re: [RC] AJAX Chat

Post by satandream »

Can more colours for usergroups be listed in the wiki as i guess its not coming as an update to this mod?
User avatar
easygo
Registered User
Posts: 689
Joined: Sun Oct 31, 2004 4:23 pm
Contact:

Re: [RC] AJAX Chat

Post by easygo »

satandream wrote:Can more colours for usergroups be listed in the wiki as i guess its not coming as an update to this mod?
Why not! There you go. :)

http://ajax-chat.wiki.sourceforge.net/p ... user+group

Let me know if something goes wrong. Thanks.
Casual developer for AJAX Chat on behalf of the author / Arcade Center powered by phpBB Arcade

A problem well put is half solved. (John Dewey, 1859–1952)
danswano
Registered User
Posts: 273
Joined: Sun Apr 06, 2008 10:43 pm

Re: [RC] AJAX Chat

Post by danswano »

I tried the groups colors but it didn't work :?

Code: Select all

// Define AJAX Chat user roles:
if(!defined('AJAX_CHAT_VIP')) define('AJAX_CHAT_VIP', 5);
define('AJAX_CHAT_VIP',			6);

define('AJAX_CHAT_GMOD',		5);

define('AJAX_CHAT_CHATBOT',		4);

define('AJAX_CHAT_ADMIN',		3);

define('AJAX_CHAT_MODERATOR',	2);

define('AJAX_CHAT_USER',		1);

define('AJAX_CHAT_GUEST',		0);
i have the roles like this, they are right or messed up?
User avatar
easygo
Registered User
Posts: 689
Joined: Sun Oct 31, 2004 4:23 pm
Contact:

Re: [RC] AJAX Chat

Post by easygo »

danswano wrote:I tried the groups colors but it didn't work :?

Code: Select all

// Define AJAX Chat user roles:
if(!defined('AJAX_CHAT_VIP')) define('AJAX_CHAT_VIP', 5);
define('AJAX_CHAT_VIP',			6);

define('AJAX_CHAT_GMOD',		5);

define('AJAX_CHAT_CHATBOT',		4);

define('AJAX_CHAT_ADMIN',		3);

define('AJAX_CHAT_MODERATOR',	2);

define('AJAX_CHAT_USER',		1);

define('AJAX_CHAT_GUEST',		0);
i have the roles like this, they are right or messed up?
Hi,

what you have posted is not the original code nor wouldn't it work this way.

Try again with ::

Code: Select all

define('AJAX_CHAT_VIP',		5);
define('AJAX_CHAT_CHATBOT',		4);
define('AJAX_CHAT_ADMIN',		3);
define('AJAX_CHAT_MODERATOR',	2);
define('AJAX_CHAT_USER',		1);
define('AJAX_CHAT_GUEST',		0);
and keep following further instructions carefully.

Regards
Casual developer for AJAX Chat on behalf of the author / Arcade Center powered by phpBB Arcade

A problem well put is half solved. (John Dewey, 1859–1952)
Locked

Return to “[3.0.x] Abandoned MODs”