MyBB Community Forums

Full Version: AJAX Chat - including MyBB integration
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
Funny i asked the same question about a week ago and if you looked the answer was starring you in the face.

No they don't

what you have to do is here:
https://blueimp.net/forum/viewtopic.php?f=19&t=546

Good luck
This seems like a great plugin, except it doesn't work.

I get this error when I visit the /chat/ directory on my forum:

Quote:Query: SELECT userID, userName, userRole, channel, UNIX_TIMESTAMP(dateTime) AS timeStamp, ip FROM ajax_chat_online ORDER BY userName; Error-Report: Table 'artifici_mybb.ajax_chat_online' doesn't exist Error-Code: 1146

I also got an error when I tried to import the SQL file to the database:

Quote:Error

SQL query:

CREATE TABLE ajax_chat_online(
userID INT( 11 ) NOT NULL ,
userName VARCHAR( 64 ) NOT NULL ,
userRole INT( 1 ) NOT NULL ,
channel INT( 11 ) NOT NULL ,
dateTime DATETIME NOT NULL ,
ip VARBINARY( 16 ) NOT NULL
) DEFAULT CHARSET = utf8 COLLATE = utf8_bin;

MySQL said: Documentation
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=utf8 COLLATE=utf8_bin' at line 8
Well that error is because it can't find the table in the DB

when your importing the sql into your DB your getting that error more then likly due to a charset confllick

Try this below:
CREATE TABLE ajax_chat_online(
userID INT( 11 ) NOT NULL ,
userName VARCHAR( 64 ) NOT NULL ,
userRole INT( 1 ) NOT NULL ,
channel INT( 11 ) NOT NULL ,
dateTime DATETIME NOT NULL ,
ip VARBINARY( 16 ) NOT NULL
)
I thought it would have something to do with that too and I removed the charset part:

DROP TABLE IF EXISTS ajax_chat_online;
CREATE TABLE ajax_chat_online (
	userID INT(11) NOT NULL,
	userName VARCHAR(64) NOT NULL,
	userRole INT(1) NOT NULL,
	channel INT(11) NOT NULL,
	dateTime DATETIME NOT NULL,
	ip VARBINARY(16) NOT NULL
)

DROP TABLE IF EXISTS ajax_chat_messages;
CREATE TABLE ajax_chat_messages (
	id INT(11) NOT NULL AUTO_INCREMENT,
	userID INT(11) NOT NULL,
	userName VARCHAR(64) NOT NULL,
	userRole INT(1) NOT NULL,
	channel INT(11) NOT NULL,
	dateTime DATETIME NOT NULL,
	ip VARBINARY(16) NOT NULL,
	text TEXT,
	PRIMARY KEY (id)
)

DROP TABLE IF EXISTS ajax_chat_bans;
CREATE TABLE ajax_chat_bans (
	userID INT(11) NOT NULL,
	userName VARCHAR(64) NOT NULL,
	dateTime DATETIME NOT NULL,
	ip VARBINARY(16) NOT NULL
)

But it makes me get the following error:

Quote:Error

SQL query:

CREATE TABLE ajax_chat_online(
userID INT( 11 ) NOT NULL ,
userName VARCHAR( 64 ) NOT NULL ,
userRole INT( 1 ) NOT NULL ,
channel INT( 11 ) NOT NULL ,
dateTime DATETIME NOT NULL ,
ip VARBINARY( 16 ) NOT NULL
) DROP TABLE IF EXISTS ajax_chat_messages;

MySQL said: Documentation
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DROP TABLE IF EXISTS ajax_chat_messages' at line 10
try:

CREATE TABLE ajax_chat_online (
    userID INT(11) NOT NULL,
    userName VARCHAR(64) NOT NULL,
    userRole INT(1) NOT NULL,
    channel INT(11) NOT NULL,
    dateTime DATETIME NOT NULL,
    ip VARBINARY(16) NOT NULL
)

CREATE TABLE ajax_chat_messages (
    id INT(11) NOT NULL AUTO_INCREMENT,
    userID INT(11) NOT NULL,
    userName VARCHAR(64) NOT NULL,
    userRole INT(1) NOT NULL,
    channel INT(11) NOT NULL,
    dateTime DATETIME NOT NULL,
    ip VARBINARY(16) NOT NULL,
    text TEXT,
    PRIMARY KEY (id)
)

CREATE TABLE ajax_chat_bans (
    userID INT(11) NOT NULL,
    userName VARCHAR(64) NOT NULL,
    dateTime DATETIME NOT NULL,
    ip VARBINARY(16) NOT NULL
)

make sure there is no tabes with them names if there is drop them manually and sql the above one table at a time!
I tried what you said, but instead I now get the following error:

Quote:Error

SQL query:

CREATE TABLE ajax_chat_online(
userID INT( 11 ) NOT NULL ,
userName VARCHAR( 64 ) NOT NULL ,
userRole INT( 1 ) NOT NULL ,
channel INT( 11 ) NOT NULL ,
dateTime DATETIME NOT NULL ,
ip VARBINARY( 16 ) NOT NULL
) CREATE TABLE ajax_chat_messages(
id INT( 11 ) NOT NULL AUTO_INCREMENT ,
userID INT( 11 ) NOT NULL ,
userName VARCHAR( 64 ) NOT NULL ,
userRole INT( 1 ) NOT NULL ,
channel INT( 11 ) NOT NULL ,
dateTime DATETIME NOT NULL ,
ip VARBINARY( 16 ) NOT NULL ,
text TEXT,
PRIMARY KEY ( id )
) CREATE TABLE ajax_chat_bans(
userID INT( 11 ) NOT NULL ,
userName VARCHAR( 64 ) NOT NULL ,
dateTime DATETIME NOT NULL ,
ip VARBINARY( 16 ) NOT NULL
)

MySQL said: Documentation
#1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'CREATE TABLE ajax_chat_messages (
id INT(11) NOT NULL AUTO

(And no, no tables with such names exist in my database).
No do one table at a time!

so

CREATE TABLE ajax_chat_online(
userID INT( 11 ) NOT NULL ,
userName VARCHAR( 64 ) NOT NULL ,
userRole INT( 1 ) NOT NULL ,
channel INT( 11 ) NOT NULL ,
dateTime DATETIME NOT NULL ,
ip VARBINARY( 16 ) NOT NULL
)

then once you have pressed go do this this one:

CREATE TABLE ajax_chat_messages(
id INT( 11 ) NOT NULL AUTO_INCREMENT ,
userID INT( 11 ) NOT NULL ,
userName VARCHAR( 64 ) NOT NULL ,
userRole INT( 1 ) NOT NULL ,
channel INT( 11 ) NOT NULL ,
dateTime DATETIME NOT NULL ,
ip VARBINARY( 16 ) NOT NULL ,
text TEXT,
PRIMARY KEY ( id )
)

then after you have pressed go this one!

CREATE TABLE ajax_chat_bans(
userID INT( 11 ) NOT NULL ,
userName VARCHAR( 64 ) NOT NULL ,
dateTime DATETIME NOT NULL ,
ip VARBINARY( 16 ) NOT NULL
)

if this dont work then you can always create the tables and fields manually in phpMyAdmin!
Ah yeah, I'm sorry, I misread that part. Smile

It works like a charm. Thanks very much! Smile

I have another question. Is it possible to make the chat window show up within the forum interface itself? It would probably need more files to do that, wouldn't it ('Cause I do not think the chat script is connected to the myBB templates?) ?
Its not connected to the MyBB in anyother way of the DB fields and cookies being written to take in account the MyBB user system (so no direct connect at all)

There is a Shoutbox included with Ajax Chat thats very easy to incorparate into myBB and the instructions for that can be found in the install docs!

As for having the chat show up in the interface its self im not sure what you mean.... you can modify the chat rooms theme and layout by editing the CSS files and lib/LoggedIn.html file.

I will PM you with examples as i dont what to be seen as spamming!
HudsonCarpentry Wrote:Its not connected to the MyBB in anyother way of the DB fields and cookies being written to take in account the MyBB user system (so no direct connect at all)

There is a Shoutbox included with Ajax Chat thats very easy to incorparate into myBB and the instructions for that can be found in the install docs!

As for having the chat show up in the interface its self im not sure what you mean.... you can modify the chat rooms theme and layout by editing the CSS files and lib/LoggedIn.html file.

I will PM you with examples as i dont what to be seen as spamming!

Thanks very much. Smile It looks very interesting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38