News:

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

Main Menu

AjaxChat Integration (latest version 3.2.1)

Started by .HuNTeR., August 27, 2008, 12:59:06 AM

Previous topic - Next topic

Blinker

Quote from: mrtrc266 on January 03, 2009, 11:20:53 AM
Hello, I have AJAX Chat and the intergration working just fine but I have searched everywhere to find out how to use the shoutbox feature.

Has anyone done this or does anyone know where to find a tutorial on how to do this for SMF?

Thanks in advance.

I too would like to hear from anyone who has managed to get it working as a shoutbox.

I have searched high and low here and on the official AJAX Chat forum as well as Google and cannot find any definitive answer.

The following is provided in the official readme.txt, the problem is it only refers to "PHP code", not which code or where to put it, ie: which template file.

Shoutbox:
=========

AJAX Chat is also usable as shoutbox - this is a short guide on how to set it up:


1. Shoutbox stylesheet
----------------------

Add the following line to the stylesheet (CSS) of all pages displaying the shoutbox:

@import url("http://example.org/path/to/chat/css/shoutbox.css");

Replace http://example.org/path/to/chat/ with the URL to the chat.
Modify css/shoutbox.css to your liking.


2. Shoutbox function
--------------------

Add the following function to your PHP code:

<?php
function getShoutBoxContent() {
// URL to the chat directory:
if(!defined('AJAX_CHAT_URL')) {
define('AJAX_CHAT_URL''./chat/');
}

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

// 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 shoutbox:
$ajaxChat = new CustomAJAXChatShoutBox();

// Parse and return the shoutbox template content:
return $ajaxChat->getShoutBoxContent();
}

return null;
}
?>


Make sure AJAX_CHAT_URL and AJAX_CHAT_PATH point to the chat directory.


2. Shoutbox output
------------------

Display the shoutbox content using the shoutbox function:

<div style="width:200px;"><?php echo getShoutBoxContent(); ?></div>

.HuNTeR.

#101
nwobhm:
opening the chat in new window is possible but i dont think it is possible to set it "always on top"
goto to chat/lib/config.php find the line:
$config['requestMessagesLimit'] = 10;
and set it to your desired number
and for time out
$config['inactiveTimeout'] = 2;
its in minute
-------------------------------------------------------------------
first i should say thank you because of this:
"It's a shame"
and i doesn't know this chat system has this ability
now i am working on it ;)
-------------------------------------------------------------------
funcouldron
i haven't enough time and may be until smf 2 is beta i don't do this
but maybe I'll do it before that

.HuNTeR.

ok its the ShoutBox
install the chat
install this mod
and everything is ready
also this mod fix a bug in chat system

mrtrc266

Quote from: HuNTeR@sm on January 08, 2009, 08:56:30 AM
ok its the ShoutBox
install the chat
install this mod
and everything is ready
also this mod fix a bug in chat system

Thanks, that worked pretty good. Sorry about my last post but was getting very frusterated with the lack of support for this board. Hope you can keep up with it. Thanks again.

netmatrix

How would I get this chatbox to show up as a shout box on my main index page? 
(whoznext.net) WhoZ NeXt Gaming Clan

.HuNTeR.

just install AjaxChat ShoutBox 1.0.zip
2 posts upper

nwobhm

At least one of my members on my forums has this kind of problem with Firefox.
It doesn't show messages or userlist, but if messages is written, it will show up, but for other users.

With IE it works fine.

.HuNTeR.

nwobhm i personally using Firefox(now 3.0.4) for a long time
and never had any problem with this chat

nwobhm

Quote from: HuNTeR@sm on January 09, 2009, 05:36:54 AM
nwobhm i personally using Firefox(now 3.0.4) for a long time
and never had any problem with this chat
I've used too.
But it seems that java needed some updating since problem has been cleared.

tittiger

I installed AjaxChat v1.3 into it's own database and it works it seems. I logged in and chatted.

Then I installed the mod  AjaxChat Integration 1.1.1.zip

When I go to the forum home page:

http://tittiger.com/bigjohnsforum/index.php

I get the following error:

Database Error
Table 'bigjohnsforum.ajax_chat_online' doesn't exist
File: /home/content/t/i/t/tittiger1/html/bigjohnsforum/Sources/BoardIndex.php
Line: 346

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.7, while your database is at version 1.1.6. The above error might possibly go away if you execute the latest version of upgrade.php.


Thanks!

Joe T.
   


.HuNTeR.

ajaxchat last version is 0.8.1.2 (for smf)
and here is the download link
http://downloads.sourceforge.net/ajax-chat/ajax_chat-0.8.1.2_SMF.tar.gz?modtime=1206204156&big_mirror=0
i think you downloaded a wrong chat system

Rattler

Today, following the readme, installed both chat and mod on a SMF 1.1.7 that was laden with mods, installed fine, runs smoothely.

Thanks, great mod!

Rattler
You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

tittiger

#112
Quote from: .HuNTeR. on January 11, 2009, 12:11:59 AM
ajaxchat last version is 0.8.1.2 (for smf)
and here is the download link
http://downloads.sourceforge.net/ajax-chat/ajax_chat-0.8.1.2_SMF.tar.gz?modtime=1206204156&big_mirror=0
i think you downloaded a wrong chat system

Thanks it seems to be working now!    :D

My only request is how do I get this to work with other themes than the default?

Joe

.HuNTeR.

you want place the chat button or number of chating users?

tittiger

Quote from: .HuNTeR. on January 11, 2009, 11:23:02 AM
you want place the chat button or number of chating users?

The chat button.

I did not know that the number of chatters could be displayed but that would also be a nice option.

Thanks,
Joe

tittiger

#115
Another issue that I just discovered is that I can not get into the logs, where ever they are stored.

I used the syntax:

http://www.bigjohnsforum.com/chat/?view=logs

as described in the readme.txt

When I log in I am taken to the SMF home page rather than having log access.


Thanks again,
Joe


WyckedDreamz

#116
I have a code snippet for a TP block that I'd like to show chat users in as well as the bottom of the forum... I have the display on the bottom of the forum working, if you want to take a look at my code snippet for my TP block so oyu can give me some pointers, I'll post it for you, not sure if its allowed here, so I wont post it unless you give me the go-ahead.





effex

#117
This mod is such a life saver, thanks for everything!

It would be nice if I could figure out how to put the chat button next the Help, Search, etc though on a custom theme.

Could someone also point out which files I would edit to add my main site's navigation bar to the top? That'd make this chat flawless.

.HuNTeR.

tittiger:
for chat button open your index.template.php
find:
    // Otherwise, they might want to [logout]...
add before:
    // the [chat] button
    $path = str_replace("index.php", "chat/index.php", $scripturl);
    echo $context['browser']['is_ie4'] ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '', '
        <td valign="top" class="maintab_back">
            <a href="', $path, '" target="_blank">', $txt['chat'], '</a></td>';


for list of chating users:
find:
    // Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
    if (!empty($context['users_online']))
        echo '
                            ', $txt[140], ':<br />', implode(', ', $context['list_users_online']);

add after:
                           
    // users in chat
  if(count($context['users_in_chat_links'])==0)
  {
      echo '<br />' . $txt['no_user_in_chat'];
  }elseif(count($context['users_in_chat_links'])==1)
  {
      echo '<br />  1' . $txt['user_in_chat']. '<br />', implode($context['users_in_chat_links']);
  }else
  {
      echo '<br /> ' . count($context['users_in_chat_links']). $txt['users_in_chat']. '<br />', implode(', ', $context['users_in_chat_links']);
  }


and for logs you should visit
http://www.bigjohnsforum.com/chat/index.php?view=logs
WyckedDreamz  I'll glad if you share your code with us
effex i think you find your answer ;) [/hr][/hr]

effex

Hunter is that code for the button only for the default theme? I did add it, but nothing appears on my end.

Advertisement: