News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[RC] AJAX Chat

Started by madblueimp, September 04, 2007, 03:50:27 AM

Previous topic - Next topic

madblueimp

Important:
As the time and effort spent to support the AJAX Chat project [nofollow] has increased my support here on this topic will discontinue.
I will continue to answer support requests on the Official AJAX Chat Support Forum [nofollow].
Feel free to use this topic for user-to-user support.

Epifrin

Great application, Madblueimp.

@ Feline: You call it your chat, you rename it, assume the coder doesn't understand some function, claim to have fixed so many bugs & yet do not report any, require registration on your site for downloading your "modified" version when the actual coder doesn't. Aren't you arrogant.

feline


Epifrin


InternetMafia

So did anyone ever figure out how to actually integrate this onto the index template
Its better to be dead and cool than alive and uncool.

THUNDERxRAGE

https://sourceforge.net/forum/forum.php?thread_id=2527660&forum_id=774132

I asked for assistance on there, and asking on here as well to get quicker response.

Can someone read what I had posted on there and respond on here?

dillon

Quote from: madblueimp on December 06, 2007, 05:41:39 AM
Quote from: zionlion on December 03, 2007, 10:59:10 AM
I just wondered if it was also possible to display online users in chat on my SMF forum(site). Noticed that it was possible for other forums but SMF was not listed.

Is this possible...?  ;)
Yes it is:
https://blueimp.net/forum/viewtopic.php?f=11&t=367&st=0&sk=t&sd=a&start=210#p13292

Please have a look at the FAQ:
https://blueimp.net/forum/viewtopic.php?f=11&t=432#p12948
[/quote]

This link no longer works, is there another one?

Owdy

Quote from: zionlion on December 03, 2007, 10:59:10 AM
I just wondered if it was also possible to display online users in chat on my SMF forum(site). Noticed that it was possible for other forums but SMF was not listed.

Is this possible...?  ;)
Id like to know that also.
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Bergovoy

ugggh,

Is there any support for this anywhere???

Is there a different chat program/software that i can use to incorporate into my forum?

I can get this to work on my local machine but when i try to install the integration mod onto my working forum it shows an error 500, cannot connect to the database contact admin...

Well, i'm the admin and i dont know squat!!!!

And i cant find squat for help...


PLEASE if anyone still supports this or if anyone uses this and knows how to help me, i would appreciate it.


thanks


bill

Michael3185

Quote from: Bergovoy on April 26, 2009, 02:12:55 PM
ugggh,

Is there any support for this anywhere???

Is there a different chat program/software that i can use to incorporate into my forum?

I can get this to work on my local machine but when i try to install the integration mod onto my working forum it shows an error 500, cannot connect to the database contact admin...

Well, i'm the admin and i dont know squat!!!!

And i cant find squat for help...


PLEASE if anyone still supports this or if anyone uses this and knows how to help me, i would appreciate it.


thanks


bill

Hi Bill. Well, I knew squat about SMF, mods and chat add-ons until I built a couple of community forums in the last few weeks. Little sleep, oven dinners, and backache from leaning over my laptop - you probably know the story. However, persistence can bring results, and folks here are very helpful indeed.

(Though I agree with some other posters that Feline was very arrogant in using blueimp's hard work, cloning her own version of Ajax Chat, but seemingly refusing to upload or report errors she found and changes she made, except to her own site where you have to register. Shoot me down in flames if I'm wrong, but it looked that way in one major thread).

So, I too have problems with the SMF mods, yet if I install blueimp's Ajax Chat as the instructions in the download from his site say, it's a doddle. Very easy indeed. My only issue then was getting a link to my chat area into my forum navigation bar, but after a search for threads on that, I got it to function. I want a pop-up chat window, and am still waiting on help for that, but at least it all works.

Don't give up!

kswebs

I'm really satisfied with this chat room script but there is something i need to customize.. Please can u tell me how to change the name that shows on the browsers tab (AJAX Chat) in to (My site name - AJAX Chat) and i also need to add a link on the chat room to my forum.. I really appreciate if any intelligent coders help me.. thanks in advance..  :) 

someofdat

To modify the AJAX Chat that appears at top of browser, edit ALL of the LANG files under /lib/lang - you will note the setting at the top of the code in each file.


Quote from: kswebs on May 31, 2009, 12:42:55 PM
I'm really satisfied with this chat room script but there is something i need to customize.. Please can u tell me how to change the name that shows on the browsers tab (AJAX Chat) in to (My site name - AJAX Chat) and i also need to add a link on the chat room to my forum.. I really appreciate if any intelligent coders help me.. thanks in advance..  :)

rhapdog

#72
For people interested in adding the number of users in chat to your forum...

I use SMF 1.1.10.

I have added a script in my forum directory, and named it ajaxchat_getChatInterface.php.  The script is included in SMF's index.php, and allows me to clear off (log out) inactive users who close their chat page without logging out, and allows me to easily retrieve the number of people in chat for display on my forum.

Here is the script:

<?php
function getChatInterface() {
  static 
$ajaxChat;

  if(!
$ajaxChat) {

    
// URL to the chat directory:
    
if(!defined('AJAX_CHAT_URL')) {
      
//echo 'not defined AJAX_CHAT_URL<br />';
      
define('AJAX_CHAT_URL''./ajaxchat/');

    }

    
// Path to the chat directory:
    
if(!defined('AJAX_CHAT_PATH')) {
      
define('AJAX_CHAT_PATH',
      
realpath(dirname($_SERVER['SCRIPT_FILENAME']).'/ajaxchat').'/');
    }

    
// Validate the path to the chat:
    
if(@is_file(AJAX_CHAT_PATH.'lib/classes.php')) {

      
// Include Class libraries:
      
require_once(AJAX_CHAT_PATH.'lib/classes.php');

      
// Initialize the chat interface:
      
$ajaxChat = new CustomAJAXChatInterface();

    }
  }

  return 
$ajaxChat;
}

function 
removeInactiveChatUsers() {
  
$chatInterface getChatInterface();
  if(
$chatInterface)
  {
    
$chatInterface->removeInactive();
  }
}

function 
returnTotalOnlineInChat() {
  
$numusers 0;
  
$chatInterface getChatInterface();

  if(
$chatInterface)
  {
    
// Returns an associative array containing userName, userID and userRole
  // Returns null if login is invalid
    
$userlist $chatInterface->getOnlineUsersData();
  }
  
$newarr = array();
  foreach(
$userlist as $val) {
    
array_push($newarr$val['userID']);
  }
  
$array_online array_unique($newarr);
  return 
count($array_online);
}


Now, find the section in your forum's index.php file:

// Show an error if the connection couldn't be made.
if (!$db_connection || !@mysql_select_db($db_name, $db_connection))
db_fatal_error();


Immediately after that code, add:

// Get the AJAX Chat Interface, which we'll use to remove inactive chatters
// and to retrieve our number of chatters online in our theme templates.
require_once(dirname(__FILE__) . '/ajaxchat_getChatInterface.php');
removeInactiveChatUsers();
$onlinechat = returnTotalOnlineInChat();


Now, this refreshes the number of chatters by removing inactive users, and retrieves the total number of people in the chat.  The next step is to set up a menu button for CHAT and display the number of users.  I like to make the menu button "CHAT(#)" where # indicates the number of people currently in chat.

For this, go to the theme directory you use. 
Open up index.template.php.

Find the following section:

function template_menu()
{
global $context, $settings,


There is more after settings.  What you need to do there is add 2 variables to the global declaration: $boardurl and $onlinechat.

Now, find the following section:

// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


You are now in the section where your main menu bar at the top is located.  Either after this, or between any 2 menu items depending on where you want you menu button located, add the following:

//chat
   if ($context['user']['is_logged'])
echo '
<td valign="top" class="maintab_back">
<a href="', $boardurl, '/chat/">Chat (',$onlinechat,')</a>
</td>';


This setup is assuming you have AJAX Chat in a subdirectory of your forum called "chat".  If it is located elsewhere, then change the link accordingly.

Advertisement: