Page 4 of 177

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Fri Mar 19, 2010 3:57 pm
by djchrisnet
/**
*
* @package phpBB3
* @version $Id: chat.php 0.1.0
* @copyright (c) 20010 Kamahl http://www.phpbb3hacks.com
*
*/
funny year :)

I hope you are alive when the copyright begins xD

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Fri Mar 19, 2010 4:09 pm
by issjut
djchrisnet wrote:I hope you are alive when the copyright begins xD
And I hope I can send a message to other users with this mod before the copyright date is reached^^ :D :D

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Sun Mar 21, 2010 6:34 pm
by Kamahl19
issjut wrote:
djchrisnet wrote:I hope you are alive when the copyright begins xD
And I hope I can send a message to other users with this mod before the copyright date is reached^^ :D :D
it runs with prosilver even now. there is just a small problem with other styles. i hope i will fix it until 20010 too

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Tue Mar 23, 2010 7:42 pm
by purusam
what about chat id:s?

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Tue Mar 30, 2010 1:31 pm
by gennyna
can i used this mod with Subsilver? :roll:

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Tue Mar 30, 2010 7:51 pm
by superj707
I wish this mod had an ACP option that allows the site owner to set the mod such that only friends are shown in the online list for all users.

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Tue Mar 30, 2010 8:07 pm
by simvader
looks like this is not worked on anymore.. :(

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Tue Mar 30, 2010 10:45 pm
by Kamahl19
I definitely continue in developing this MOD, I myself consider it as the best chat solution for phpbb, but you all have to wait a little, i dont have time for MODs now :) Appreciate that you like my MOD :)

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Wed Mar 31, 2010 8:24 am
by gennyna
then again you can adapt it to subsilver?

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Wed Mar 31, 2010 12:34 pm
by Kamahl19
yes, but later. priorite no.1 is solve the IDs problem and compatibility with all prosilver styles

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Wed Mar 31, 2010 4:45 pm
by sitwi
simvader wrote:looks like this is not worked on anymore.. :(
Geez, give the guy a chance, he only put it up this month?

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Wed Mar 31, 2010 11:02 pm
by nagwani
Alright, been up almost 6 hours straight since I've seen this amazing mod and it is almost 4:30 AM now!!!. Loved the mod and have integrated with IcyPhoenix's Black Pearl theme on my forums.

The user ids showing up instead of the username was nagging me no end, so I decided to give it a shot and here is what I have been able to come up with. Please bear with me if you find any issues with mod mod :D as I've tackled coding after almost 4 years and been using phpBB only for about 15 days.

One of the issues I know still remains is that of the document.title. The blinking title still reads the user_id instead of the username and am too exhausted to tackle that at this moment.

To get the username showing up, you need to edit 3 files:

overall_header.html
Find:

Code: Select all

<a href="javascript:void(0)" onclick="javascript:chatWith('{online_row.USER_ID}')">{online_row.AVATAR} <span>{online_row.USERNAME}</span>{online_row.STATUS}</a>
Replace with:

Code: Select all

<a href="javascript:void(0)" onclick="javascript:chatWith('{online_row.USER_ID}', '{online_row.USERNAME}')">{online_row.AVATAR} <span class="chatlist">{online_row.USERNAME}</span>{online_row.STATUS}</a>
chat.php
Find:

Code: Select all

  $sql = 'SELECT * FROM ' . CHAT_TABLE . '
            WHERE (' . CHAT_TABLE . '.to = "'.$db->sql_escape($_SESSION['user_id']).'" AND recd = 0)
            ORDER BY id ASC';
Replace with:

Code: Select all

  $sql = 'SELECT ' . CHAT_TABLE . '.*, ' . USERS_TABLE . '.username FROM ' . CHAT_TABLE . ', ' . USERS_TABLE . '
            WHERE (' . CHAT_TABLE . '.to = "'.$db->sql_escape($_SESSION['user_id']).'" AND recd = 0 AND ' . USERS_TABLE . '.user_id=' . CHAT_TABLE . '.from)
            ORDER BY id ASC';
Find:

Code: Select all

		$items .= <<<EOD
					   {
			"s": "0",
			"f": "{$chat['from']}",
Add After:

Code: Select all

			"fu": "{$chat['username']}",
Find:

Code: Select all

	$_SESSION['chatHistory'][$chat['from']] .= <<<EOD
		 {
			"s": "0",
			"f": "{$chat['from']}",
Add After:

Code: Select all

			"fu": "{$chat['username']}",
chat.js
Find:

Code: Select all

var user_id;
Add After:

Code: Select all

var username;
Find:

Code: Select all

function chatWith(chatuser) {
	createChatBox(chatuser);
Replace with:

Code: Select all

function chatWith(chatuser, chatboxUsernameAsTitle) {
	createChatBox(chatuser, chatboxUsernameAsTitle);
Find:

Code: Select all

function createChatBox(chatboxtitle,minimizeChatBox) {
Replace with:

Code: Select all

function createChatBox(chatboxtitle,chatboxUsernameAsTitle,minimizeChatBox) {
Find:

Code: Select all

	.html('<div class="chatboxhead"><div class="chatboxtitle">'+chatboxtitle+'</div><div class="chatboxoptions"><a href="javascript:void(0)" onclick="javascript:toggleChatBoxGrowth(\''+chatboxtitle+'\')">-</a> <a href="javascript:void(0)" onclick="javascript:closeChatBox(\''+chatboxtitle+'\')">X</a></div><br clear="all"/></div><div class="chatboxcontent"></div><div class="chatboxinput"><textarea class="chatboxtextarea" onkeydown="javascript:return checkChatBoxInputKey(event,this,\''+chatboxtitle+'\');"></textarea></div>')
Replace with:

Code: Select all

	.html('<div class="chatboxhead"><div class="chatboxtitle">'+chatboxUsernameAsTitle+'</div><div class="chatboxoptions"><a href="javascript:void(0)" onclick="javascript:toggleChatBoxGrowth(\''+chatboxtitle+'\')">-</a> <a href="javascript:void(0)" onclick="javascript:closeChatBox(\''+chatboxtitle+'\')">X</a></div><br clear="all"/></div><div class="chatboxcontent"></div><div class="chatboxinput"><textarea class="chatboxtextarea" onkeydown="javascript:return checkChatBoxInputKey(event,this,\''+chatboxtitle+'\');"></textarea></div>')
Find:

Code: Select all

					createChatBox(chatboxtitle);
Replace with:

Code: Select all

					createChatBox(chatboxtitle, item.fu);
Find:

Code: Select all

					newMessagesWin[chatboxtitle] = true;
					$("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.f+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+item.m+'</span></div>');
Replace with:

Code: Select all

					newMessagesWin[chatboxtitle] = true;
					$("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.fu+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+item.m+'</span></div>');
Find:

Code: Select all

				$("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+user_id+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+message+'</span></div>');
Replace with:

Code: Select all

				$("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+username+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+message+'</span></div>');
Find:

Code: Select all

		user_id = data.user_id;
Add After:

Code: Select all

		username = data.username;
Find:

Code: Select all

					createChatBox(chatboxtitle,1);
Replace with:

Code: Select all

					createChatBox(chatboxtitle,item.fu,1);
Find:

Code: Select all

				} else {
					$("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.f+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+item.m+'</span></div>');
				}
Replace with:

Code: Select all

				} else {
					$("#chatbox_"+chatboxtitle+" .chatboxcontent").append('<div class="chatboxmessage"><span class="chatboxmessagefrom">'+item.fu+':&nbsp;&nbsp;</span><span class="chatboxmessagecontent">'+item.m+'</span></div>');
				}
This may be a crude hack and Kamahl may be able to integrate it better.

Cheers,
DeeJay

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Thu Apr 01, 2010 12:08 am
by nagwani
There is one step I forgot in the post above.

In chat.php

Find:

Code: Select all

"user_id": "<?php echo $_SESSION['user_id'];?>",
Add After:

Code: Select all

"username": "<?php echo $_SESSION['username'];?>",
Without this, the sender will see "undefined" in the chatbox of his/her session against the messages sent by him/her.

Cheers,
DeeJay

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Thu Apr 01, 2010 2:14 am
by Ahri89
Subscribed, thanks!

Re: [BETA] Facebook chat with fixed bottom bar

Posted: Thu Apr 01, 2010 7:35 am
by pegasus81
Hi nagwani. I tried the changes you have proposed, but chat doesn't work. I've noticed that your style is based on subsilver as mine. May you help me? This is my forum: http://ingegneriapisa.altervista.org/index.php. Thanks. :)