News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

AjaxChat Integration (latest version 3.2.1)

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

Previous topic - Next topic

mrtrc266

Quote from: clevelife on April 27, 2010, 10:46:04 AM
I never did figure out what happened to mine.  I should be able to reinstall SMF and use the old database to bring back my users and posts right?  Im just looking for a yes/no.  I dont want to clog this thread with that discussion when I can just search for the answer.

yes

Abavagada

Quote from: mrtrc266 on April 27, 2010, 10:33:15 AM
Quote from: Abavagada on April 27, 2010, 10:12:09 AM
This is a really great mod! Thanks so much! I love the way it is tied to the forums, with each one getting it's own channel.

I'm trying to make even more of a tie, with each forum having button that opens up the chat in the channel for that forum. However, I can't find a way to set a "default channel". It would just get it from the link passed, like ?chanid=Events.

Can anyone help me with this change?

Thanks

Glad you like the Mod, you can change the default channel in /chat/lib/config.php as explained in the FAQ's on the Mods Home Page (or the link in my signature), please be sure to check them out for future questions. A lot of them are answered there.

Thanks, but I guess I wasn't clear enough in my explanation.

I want a link on each forum that can open the chat to the chat channel for that forum.
So the link would be something like "...index.php?chanid=Events" for the Events forum.

So I want to pass to the chat a default channel. I have been unable to override that variable in the function for loading a channel... it always get the one stored in the session.

it would be something like this in the code:
$uchanid = $_GET['chanid'];
if ($uchanid !== '') { $channelID = $uchandid; }

but where would the $channelID be gotten so it could be alterred in this way?

Thanks

brion

Yes I am using a custom theme, but it only has index.template.php the only boardindex.template is in the default theme folder.

mrtrc266

@ Abavagada

I wouldn't have a clue as to go about that and I know that this is not what you're wanting but it might give you some insight as to where to look.
http://sourceforge.net/apps/mediawiki/ajax-chat/index.php?title=Custom_chat_channels#Adding_additional_chat_channels

mrtrc266

Quote from: brion on April 27, 2010, 11:31:33 AM
Yes I am using a custom theme, but it only has index.template.php the only boardindex.template is in the default theme folder.

Attach your BoardIndex.template.php file here please.

fairytears

Quote from: mrtrc266 on April 23, 2010, 01:30:57 AM
Quote from: fairytears on April 22, 2010, 11:58:57 AM
Hello
I installed the shoutbox that came with the AJAX chat in my forum. Recently, one of the members was able to save all the conversation that took place in the shoutbox. The moderators and I are worried that this can be done and we don't even know how. My questions are

-How did he do it????
-Is there a way to prevent this??

Thanks, I really appreciate any help on this.

Either he/she has access to the chat logs as an Admin on your site or he/she copied all the chats (public chat, not private chats) ?

Thank you. So if he is not an Admin, the only way is to do a Copy/Paste? We were worried because he is a computer programmer (at least that's what he says) and we thought maybe he is a hacker of some kind.

mrtrc266

@ fairytears

To my know knowledge yes that's the only way. After reading literally thousands upon thousands of posts here, Source Forge, and on the Internet regarding this chat I have never ran across a post with anyone's concerns about the chat system being hacked. It's secure. Not saying that it's impossible hack, but it's unlikely.

Quoted from the developers site on their features list https://blueimp.net/ajax/
QuoteDeveloped with Security as integral part - built to prevent Code injections, SQL injections, Cross-site scripting (XSS), Session stealing and other attacks

brion


brion


mrtrc266

#6029
Quote from: brion on April 27, 2010, 07:08:05 PM
Here you go  :)

The code seems to be in there okay I just tried your file on my site and it works fine, not sure why it's not working on your site.

Would it be too much trouble to ask you to uninstall it, delete it from the package manager and try this one?

This has the latest AJAX Chat, with 5 new language supports and some improved performance enhancements as well.

brion

It took me 2 weeks to get it working, so I'd hate to have to do it all over again. Is there anything I can add in my index.template.php to add to the chatroom link? Something like this

//Whos online code
blah blah blah
$NumOnline = mysql_num_rows($blah);

<li href="chatroom.php">$NumOnline are in Chat</li>

mrtrc266

Quote from: brion on April 27, 2010, 09:00:57 PM
It took me 2 weeks to get it working, so I'd hate to have to do it all over again. Is there anything I can add in my index.template.php to add to the chatroom link? Something like this

//Whos online code
blah blah blah
$NumOnline = mysql_num_rows($blah);

<li href="chatroom.php">$NumOnline are in Chat</li>


Not sure exactly what you mean, what's not working how would you like it to behave? Send screen shots and a link to your site for clarity, PM if you don't want it public.

Stigmartyr

Working with getting this mod running in my SMF 1.1.1 forum using custom theme Ps_Black.  I never figured out the IO Error, so I disabled sound altogether.  Just commented it out.

What I want to know now, is how to make the 'Chat' button show a chat user count like it should.. and how to make the Users Online list show 'User in Chat' properly.

I've attached my theme's index.template.php and BoardIndex.template.php for reference.  I appreciate your time and help.

URL: www.RealPerformanceMustangs.com

Login creds on request or simply login with facebook or register.

brion

Here is an image of what I mean, the top links like profile, search, home, etc. Would show number of users in chat.

mrtrc266

#6034
@ Stigmartyr

Find /Themes/Ps_Black/BoardIndex.template.php
', $txt[140], ':<br />', implode(', ', $context['list_users_online']);
Add after
    // users in chat
    if (isset($context['chat_links'])){
        if (count($context['chat_links']) == 0 )
          echo '<br />' . $txt['chat_no_user'];
        elseif (count($context['chat_links']) == 1 )
          echo '<br />  1' . $txt['chat_aUser']. ':<br />', implode($context['chat_links']);
        else
          echo '<br /> ' . count($context['chat_links']). $txt['chat_users']. ':<br />', implode(', ', $context['chat_links']);
  }


Find /Themes/Ps_Black/index.template.php
function template_menu()
{
    global $context, $settings, $options, $scripturl, $txt;

Replace with
function template_menu()
{
    global $context, $settings, $options, $scripturl, $txt, $modSettings;


Find
echo '<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br /><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';
Replace with
        echo '<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a><br /><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a>';

            if (!empty($modSettings['enableChatBelowPM'])){
            $count = count(chatOnlineUsers());
            if ($count == 0 )
            echo '<br />' . $txt['chat_no_user'];
            elseif ($count == 1 )
              echo '<br />  1' . $txt['chat_aUser']. '<br />';
            else
              echo '<br /> ' . $count . $txt['chat_users']. '<br />';
        }
        echo '                </span>';

Find
// Otherwise, they might want to [logout]...
Replace with
// the [chat] button
    $chatPath = str_replace("index.php", "chat/index.php", $scripturl);
    $num = (empty($modSettings['enableChatButtonNo'])) ? 0 : count(chatOnlineUsers());
    echo $context['browser']['is_ie4'] ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '', '
        <li><a href="', $chatPath, '"', empty($modSettings['chatPopUp']) ? 'target="_blank"' : ' onclick="openWindow(this.href);this.blur();return false;"', '>', $txt['chat'], ($num > 0) ?  ('('.$num.')') : '' , '</a></li>';
       
    // Otherwise, they might want to [logout]...

mrtrc266

#6035
Quote from: brion on April 27, 2010, 10:44:17 PM
Here is an image of what I mean, the top links like profile, search, home, etc. Would show number of users in chat.

That should be a default feature for AJAX Integration.

In your Forums Admin Enable online chat users numbering on chat   button?

For SMF 1.1.X Admin/Configuration/Features and Options/
For   SMF 2 RC1  Admin/Configuration/Modifications/Chat/

scooterhog

Is it typical behavior for a user attempting to chat from a different IP Address to be blocked?

SMF 1.1.11
Chat 3.2.1

brion

Quote from: mrtrc266 on April 27, 2010, 10:57:08 PM
Quote from: brion on April 27, 2010, 10:44:17 PM
Here is an image of what I mean, the top links like profile, search, home, etc. Would show number of users in chat.

That should be a default feature for AJAX Integration.

In your Forums Admin Enable online chat users numbering on chat   button?

For SMF 1.1.X Admin/Configuration/Features and Options/
For   SMF 2 RC1  Admin/Configuration/Modifications/Chat/

Ok I found out the button was unchecked, however it didn't fix it. Here is the two coding places for my chatroom button. I added it manually.

<link rel="chatroom" href="/chat/index.php" target="_BLANK" />

if ($context['allow_search'])
echo '<li', $current_action == 'search' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></li>';
echo '<li', $current_action == 'gallery' ? ' class="chosen"' : '', '><a href="', $scripturl, '?action=gallery">Gallery</a></li>';
echo '<li', $current_action == 'chatroom' ? ' class="chosen"' : '', '><a href="/chat/index.php" target="_BLANK">Chatroom</a></li>';
echo '<li', $current_action == 'game' ? ' class="chosen"' : '', '><a href="game.php">Game</a></li>';

hcfwesker

#6038
Custom Chat Commands

To add custom chat commands, for member use.  You can check this link, below.

http://sourceforge.net/apps/mediawiki/ajax-chat/index.php?title=Mod_Away_Command

I've worked up a tutorial for some who may be new to the process.

Under the file,  chat/lib/class/CustomAJAXChat.php

At the very bottom of the file, be sure to include the last closing bracket, the edit being inserted must go ABOVE the closing } in the last code listed.
Find
}
?>


Add Above
function parseCustomCommands($text, $textParts) {
switch($textParts[0]) {
// Away from keyboard message:
case '/afk':
// Set the userName:
$this->setUserName('<AFK>_'.$this->getUserName());
// Update the online user table:
$this->updateOnlineList();
// Add info message to update the client-side stored userName:
$this->addInfoMessage($this->getUserName(), 'userName');
// Store AFK status as session variable:
$this->setSessionVar('AwayFromKeyboard', true);
return true;
default:
return false;
}
}

function onNewMessage($text) {
// Reset AFK status on first inserted message:
if($this->getSessionVar('AwayFromKeyboard')) {
$this->setUserName($this->subString($this->getUserName(), 6));
$this->updateOnlineList();
$this->addInfoMessage($this->getUserName(), 'userName');
$this->setSessionVar('AwayFromKeyboard', false);
}
return true;
}


This code creates the custom command function list, which will be used for adding new custom commands.  By default, this adds an "away from keyboard" <AFK>_  in front of each memebrs name that uses it, by typing /afk into the chat.  To remove it, simply type any new message into the chat.


Adding and Creating custom commands.

Now, in the same exact code that was just added for "AFK".  Halfway down it

Find
return true;
default:
return false;


Add After:
case '/away':
$this->insertChatBotMessage($this->getChannel(), $this->getLoginUserName().' has set their status to Away');
$this->setUserName($this->getLoginUserName().'[Away]');
$this->updateOnlineList();
$this->addInfoMessage($this->getUserName(), 'userName');
return true;
case '/online':
$this->insertChatBotMessage($this->getChannel(), $this->getLoginUserName().' has set their status to Online');
$this->setUserName($this->getLoginUserName());
$this->updateOnlineList();
$this->addInfoMessage($this->getUserName(), 'userName');
return true;



You can add any number of these in a row for however many custom commands you want.  They're very entertaining for members to use in the chat.  Just edit certain lines to customize them.  I'll explain my best, down below.

case '/away':
      $this->insertChatBotMessage($this->getChannel(), $this->getLoginUserName().' has set their status to Away');  ***
      $this->setUserName($this->getLoginUserName().'[Away]');
      $this->updateOnlineList();
      $this->addInfoMessage($this->getUserName(), 'userName');
      return true;
   case '/online':
      $this->insertChatBotMessage($this->getChannel(), $this->getLoginUserName().' has set their status to Online');  ***
      $this->setUserName($this->getLoginUserName());
      $this->updateOnlineList();
      $this->addInfoMessage($this->getUserName(), 'userName');
      return true;

When the command is activated by a member in the chat.

/away --  what is typed by a memebr to activate the custom command.

has set their status to Away  -- what the ChatBot message will say when a memebr activates the command.

***  For either activating or deactivating the command by a member, you can delete this line of code so the "ChatBot" does not post the custom command being used in the chat posts.  ( Again, you chose which of the 2 to delete, or just leave them)

[Away] --- what will be displayed at the end of names in the chat member list.


When the command is de-activated by a member in the chat.


/online  --- what is typed by a member to de-activate the custom command ( and remove the added tag at the end of their display name.

has set their status to Online'  --- what the ChatBot message will say when a member de-activates the command.


As an example.  I run a site for the online game SSB Brawl.  When a member is looking for a match, they type /seeking  in the chat.  [Seeking a Match] gets put at the end of their name, and the ChatBot says , "hcfwesker is seeking a Brawl Match".

Then, if I have a match, I'll post /brawling.  Then, [Brawling] will show up in my name, so other know I'm already in a match, and the chatBot will message, "hcfwesker is currently in a Brawl Match".

The possibilites are quite limitless, just depends on forum prefernces.

I'm not a coder, and I explained the best I could.


Ozzie

im open to suggestions....

ive tried just about everything in this thread chmod'ing/new htaccess files manual upload etc etc and for the life of me all i keep geting in the shout is   ChatBot: Error: Connection status: 404...im at my wits end and about to give up anyone got any thing else i can try????

2000+ games available to download

 
Advertisement: