AjaxChat Integration (latest version 3.2.1)

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

Previous topic - Next topic

TheListener


mkalinowski

any members of my forum are having trouble logging into the Ajax chat except for the admins. They get the following message: You can't access the chat. Any ideas?

danielwmoore

Quote from: mkalinowski on September 04, 2009, 08:48:48 AM
any members of my forum are having trouble logging into the Ajax chat except for the admins. They get the following message: You can't access the chat. Any ideas?

As has been said many times through this thread: "You must set permissions per membergroup to access the chat."

ishaan

#3743
Hello Friends..

I am installed AjaxChat Integration_3.2.1 Mod.
The mod was working perfect.

But the chat button of AjaxChat not like other menu button.


Plzz Show me how to edit my theme index.template.php


Quote// Show the start of the tab section.
echo '
   <div id="styletwo">
   <ul>

';
      // Show the [home] button.
         echo '<li><a' , $current_action=='home' ? ' class="current"' : '' , ' href="', $scripturl, '"><span>' , $txt[103] , '</span></a></li>';

      // Show the [help] button.
          echo '<li><a' , $current_action=='help' ? ' class="current"' : '' , ' href="', $scripturl, '?action=help"><span>' , $txt[119] , '</span></a></li>';

      // Show the [Arcade] button.
          echo '<li><a' , $current_action=='arcade' ? ' class="current"' : '' , ' href="', $scripturl, '?action=arcade"><span>Arcade</span></a></li>';

// Show the [Contact] button.
          echo '<li><a' , $current_action=='contact' ? ' class="current"' : '' , ' href="', $scripturl, '?action=contact"><span>Contact</span></a></li>';

// Show the [Gallery] button.
          echo '<li><a' , $current_action=='mgallery' ? ' class="current"' : '' , ' href="', $scripturl, '?action=mgallery"><span>Gallery</span></a></li>';


     // Show the [Staff] button.
          echo '<li><a' , $current_action=='staff' ? ' class="current"' : '' , ' href="', $scripturl, '?action=staff"><span>Staff</span></a></li>';

      // How about the [search] button?
      if ($context['allow_search'])
         echo '<li><a' , $current_action=='search' ? ' class="current"' : '' , ' href="', $scripturl, '?action=search"><span>' , $txt[182] , '</span></a></li>';

      // The [calendar]!
      if ($context['allow_calendar'])
         echo '<li><a' , $current_action=='calendar' ? ' class="current"' : '' , ' href="', $scripturl, '?action=calendar"><span>' , $txt['calendar24'] , '</span></a></li>';

      // Is the user allowed to administrate at all? ([admin])
      if ($context['allow_admin'])
         echo '<li><a' , $current_action=='admin' ? ' class="current"' : '' , ' href="', $scripturl, '?action=admin"><span>' , $txt[2] , '</span></a></li>';

      // Edit Profile... [profile]
      if ($context['allow_edit_profile'])
         echo '<li><a' , $current_action=='profile' ? ' class="current"' : '' , ' href="', $scripturl, '?action=profile"><span>' , $txt[79] , '</span></a></li>';

      // Go to PM center... [pm]
   if ($context['user']['is_logged'] && $context['allow_pm'])
      echo '<li><a href="', $scripturl, '?action=pm"><span>' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</span></a></li>';

      // the [member] list button
      if ($context['allow_memberlist'])
         echo '<li><a ' , $current_action=='mlist' ? ' class="current"' : '' , ' href="', $scripturl, '?action=mlist"><span>' , $txt[331] , '</span></a></li>';

      // If the user is a guest, show [login] button.
      if ($context['user']['is_guest'])
         echo '<li><a ' , $current_action=='login' ? ' class="current"' : '' , ' href="', $scripturl, '?action=login"><span>' , $txt[34] , '</span></a></li>';

      // If the user is a guest, also show [register] button.
      if ($context['user']['is_guest'])
         echo '<li><a ' , $current_action=='register' ? ' class="current"' : '' , ' href="', $scripturl, '?action=register"><span>' , $txt[97] , '</span></a></li>';

  // 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>' : '', '
      <class="maintab_back">
         <a href="', $chatPath, '"', empty($modSettings['chatPopUp']) ? 'target="_blank"' : ' onclick="openWindow(this.href);this.blur();return false;"', '><span>Chat</span></a>
      </td>';





danielwmoore

#3744
@ishaan

Your chat button doesn't check for permissions before it displays.  I assume this was ok with you.

Find the code in the file you displayed that matches the following:

  // 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>' : '', '
      <class="maintab_back">
         <a href="', $chatPath, '"', empty($modSettings['chatPopUp']) ? 'target="_blank"' : ' onclick="openWindow(this.href);this.blur();return false;"', '><span>Chat</span></a>
      </td>';   


Replace that code with the following:

// the [Chat] button
$chatPath = str_replace("index.php", "chat/index.php", $scripturl);
$num = (empty($modSettings['enableChatButtonNo'])) ? 0 : count(chatOnlineUsers());
$chatnum = $num>0 ? '('.$num.')' : '';
echo '<li><a href="', $chatPath, '"', empty($modSettings['chatPopUp']) ? 'target="_blank"' : ' onclick="openWindow(this.href);this.blur();return false;"', '><span>Chat',$chatnum,'</span></a></li>


This will not only place your chat button in the right format, but will also give you the number of users in chat if chat is not empty.

Hope this is helpful.

ishaan

danielwmoore Thank you for replying me.

Brother i have tried what you  saz.

but this error was seeing..


QuoteTemplate Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.


what i do bro ?


TheListener

It looks like the code was not placed correctly.

Have you backed up the forum?

Please attach your boardindex template here

warlock2009

PLease help me guys...
i just install smf v1.1.10 dan used AjaxChat Integration  3.2.1
why this message appear: ChatBot: Error: Connection status: 500



TheListener

The answer is in the ajax chat link of my signature. I made a post with the answer a few pages back.

If you need further help I will be back online later.

Urbanite

#3749
Listener, the link in your signature isn't there any more, presuming you are meaning under AJAX CHAT HINTS AND TIPS
Just when you finally get it idiot proof ...along comes a bigger idiot!

warlock2009


TheListener

Quote from: Urbanite on September 04, 2009, 03:11:19 PM
Listener, the link in your signature isn't there any more, presuming you are meaning under AJAX CHAT HINTS AND TIPS

This is the section I was referring to.

If you get a 500 Connection error you might have to set your file permissions as well.

There are 2 folder for the AJAX Chat Intergration Mod "Chat" and "Shoutbox".
For AJAX Chat Intergration Version 3 "Folders" be sure to change the file permissions (CHMOD) /chat/index.php and /shoutbox/index.php to 755

ScottDB

Quote from: danielwmoore on September 03, 2009, 02:42:51 PM
Quote from: ScottDB on September 03, 2009, 02:22:36 PM
My chat and shoutbox seem to be working ok. The only problem is that my log is getting cluttered by an error message every time someone uses the chat or shoutbox. Here is the error
QuoteUndefined index:  chat
File: /home/scott/public_html/newbiescentral.com/Sources/Subs.php
Line: 3716
Any ideas?

ScottDB,

When it says, "Undefined index: chat", that means there is an array that is being passed 'chat' as the index, and it doesn't exist.

This is most likely the culprit of another issue I found and fixed with this Mod, that I completely forgot to mention above. 

While this mod will set some language strings for the shoutbox, it does not do so for the chat.  Open up your Modifications.english.php in your Themes/default/language directory, (or Modifications.german.php, or whatever language you're needing this for), and add to the list:

$txt['chat'] = 'Chat';


This will be the text that appears on your menu button.  That's why it seems to fail pretty much every time someone displays a page.

Do that somewhere on a new line before the final '?>' in the file.

That will fix the problem.

Should the file I am supposed to edit be admin.englis.php?
Thank you,
Scott

If at first you don't succeed. post and post again.

ishaan

Quote@TheListener

It looks like the code was not placed correctly.

Have you backed up the forum?

Please attach your boardindex template here


ya i have the backup!!


danielwmoore

Quote from: ishaan on September 04, 2009, 02:18:52 PM
danielwmoore Thank you for replying me.

Brother i have tried what you  saz.

but this error was seeing..


QuoteTemplate Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.


what i do bro ?

The code you should have replaced that other part should have been:

// the [Chat] button
$chatPath = str_replace("index.php", "chat/index.php", $scripturl);
$num = (empty($modSettings['enableChatButtonNo'])) ? 0 : count(chatOnlineUsers());
$chatnum = $num>0 ? '('.$num.')' : '';
echo '<li><a href="', $chatPath, '"', empty($modSettings['chatPopUp']) ? 'target="_blank"' : ' onclick="openWindow(this.href);this.blur();return false;"', '><span>Chat',$chatnum,'</span></a></li>';


For some reason, when I copied and pasted it into the above message, the last '; of that code didn't show up.  Sorry.  I should have checked a preview more carefully before hitting submit.  Please add the '; at the end as shown above.

Quote from: ScottDB
Should the file I am supposed to edit be admin.englis.php?

No, edit the Modifications.english.php, as was stated in my post.  Also edit whatever language your forum is using and add it there as well, editing Modifications.language.php where language is the name of the language you are using.

ishaan


C_Murder

Hey I also had first the problem that the Chat button didnt show. Then ive added this code at the end

// the [Chat] button
$chatPath = str_replace("index.php", "chat/index.php", $scripturl);
$num = (empty($modSettings['enableChatButtonNo'])) ? 0 : count(chatOnlineUsers());
$chatnum = $num>0 ? '('.$num.')' : '';
echo '<li><a href="', $chatPath, '"', empty($modSettings['chatPopUp']) ? 'target="_blank"' : ' onclick="openWindow(this.href);this.blur();return false;"', '><span>Chat',$chatnum,'</span></a></li>';




You can see now the "Chat" but it doesnt show as an option like the others.
Here the full code. I hope somebody can help me here out.




// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;

   // Work out where we currently are.
   $current_action = 'home';
   if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
      $current_action = 'admin';
   if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
      $current_action = $context['current_action'];
   if ($context['current_action'] == 'search2')
      $current_action = 'search';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

   // Are we using right-to-left orientation?
   if ($context['right_to_left'])
   {
      $first = 'last';
      $last = 'first';
   }
   else
   {
      $first = 'first';
      $last = 'last';
   }

   // Show the start of the tab section.
   echo '<div id="topmenu">

         <ul class="topmenu">';
            // Show the [home] button.
               echo '<li><a' , $current_action=='home' ? ' class="current"' : '' , ' href="', $scripturl, '"><span>' , $txt[103] , '</span></a></li>';

            // Show the [help] button.
               echo '<li><a' , $current_action=='help' ? ' class="current"' : '' , ' href="', $scripturl, '?action=help"><span>' , $txt[119] , '</span></a></li>';

            // How about the [search] button?
            if ($context['allow_search'])
               echo '<li><a' , $current_action=='search' ? ' class="current"' : '' , ' href="', $scripturl, '?action=search"><span>' , $txt[182] , '</span></a></li>';

            // Is the user allowed to administrate at all? ([admin])
            if ($context['allow_admin'])
               echo '<li><a' , $current_action=='admin' ? ' class="current"' : '' , ' href="', $scripturl, '?action=admin"><span>' , $txt[2] , '</span></a></li>';

            // The [calendar]!
            if ($context['allow_calendar'])
               echo '<li><a' , $current_action=='calendar' ? ' class="current"' : '' , ' href="', $scripturl, '?action=calendar"><span>' , $txt['calendar24'] , '</span></a></li>';

            // Edit Profile... [profile]
            if ($context['allow_edit_profile'])
               echo '<li><a' , $current_action=='profile' ? ' class="current"' : '' , ' href="', $scripturl, '?action=profile"><span>' , $txt[79] , '</span></a></li>';

            // Go to PM center... [pm]
            if ($context['user']['is_logged'] && $context['allow_pm'])
               echo '<li><a' , $current_action=='pm' ? ' class="current"' : '' , ' href="', $scripturl, '?action=pm"><span>' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</span></a></li>';

            // the [member] list button
            if ($context['allow_memberlist'])
               echo '<li><a ' , $current_action=='mlist' ? ' class="current"' : '' , ' href="', $scripturl, '?action=mlist"><span>' , $txt[331] , '</span></a></li>';

            // If the user is a guest, show [login] button.
            if ($context['user']['is_guest'])
               echo '<li><a ' , $current_action=='login' ? ' class="current"' : '' , ' href="', $scripturl, '?action=login"><span>' , $txt[34] , '</span></a></li>';

            // If the user is a guest, also show [register] button.
            if ($context['user']['is_guest'])
               echo '<li><a ' , $current_action=='register' ? ' class="current"' : '' , ' href="', $scripturl, '?action=register"><span>' , $txt[97] , '</span></a></li>';

            // Otherwise, they might want to [logout]...
            if ($context['user']['is_logged'])
               echo '<li><a ' , $current_action=='logout' ? ' class="current"' : '' , 'href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><span>' , $txt[108] , '</span></a></li>';

   echo '
         </ul></div>
<div style="clear:both;"></div>';

// the [Chat] button
$chatPath = str_replace("index.php", "chat/index.php", $scripturl);
$num = (empty($modSettings['enableChatButtonNo'])) ? 0 : count(chatOnlineUsers());
$chatnum = $num>0 ? '('.$num.')' : '';
echo '<li><a href="', $chatPath, '"', empty($modSettings['chatPopUp']) ? 'target="_blank"' : ' onclick="openWindow(this.href);this.blur();return false;"', '><span>Chat',$chatnum,'</span></a></li>';

}


danielwmoore

@C_Murder:

You placed the chat button after the end of the code for the menu bar.  That's why it wasn't part of it.

Here I've placed it for you before the Login/Logout and Register buttons, which is a more appropriate place for it.


// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
   global $context, $settings, $options, $scripturl, $txt;

   // Work out where we currently are.
   $current_action = 'home';
   if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
      $current_action = 'admin';
   if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
      $current_action = $context['current_action'];
   if ($context['current_action'] == 'search2')
      $current_action = 'search';
   if ($context['current_action'] == 'theme')
      $current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

   // Are we using right-to-left orientation?
   if ($context['right_to_left'])
   {
      $first = 'last';
      $last = 'first';
   }
   else
   {
      $first = 'first';
      $last = 'last';
   }

   // Show the start of the tab section.
   echo '<div id="topmenu">

         <ul class="topmenu">';
            // Show the [home] button.
               echo '<li><a' , $current_action=='home' ? ' class="current"' : '' , ' href="', $scripturl, '"><span>' , $txt[103] , '</span></a></li>';

            // Show the [help] button.
               echo '<li><a' , $current_action=='help' ? ' class="current"' : '' , ' href="', $scripturl, '?action=help"><span>' , $txt[119] , '</span></a></li>';

            // How about the [search] button?
            if ($context['allow_search'])
               echo '<li><a' , $current_action=='search' ? ' class="current"' : '' , ' href="', $scripturl, '?action=search"><span>' , $txt[182] , '</span></a></li>';

            // Is the user allowed to administrate at all? ([admin])
            if ($context['allow_admin'])
               echo '<li><a' , $current_action=='admin' ? ' class="current"' : '' , ' href="', $scripturl, '?action=admin"><span>' , $txt[2] , '</span></a></li>';

            // The [calendar]!
            if ($context['allow_calendar'])
               echo '<li><a' , $current_action=='calendar' ? ' class="current"' : '' , ' href="', $scripturl, '?action=calendar"><span>' , $txt['calendar24'] , '</span></a></li>';

            // Edit Profile... [profile]
            if ($context['allow_edit_profile'])
               echo '<li><a' , $current_action=='profile' ? ' class="current"' : '' , ' href="', $scripturl, '?action=profile"><span>' , $txt[79] , '</span></a></li>';

            // Go to PM center... [pm]
            if ($context['user']['is_logged'] && $context['allow_pm'])
               echo '<li><a' , $current_action=='pm' ? ' class="current"' : '' , ' href="', $scripturl, '?action=pm"><span>' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</span></a></li>';

            // the [member] list button
            if ($context['allow_memberlist'])
               echo '<li><a ' , $current_action=='mlist' ? ' class="current"' : '' , ' href="', $scripturl, '?action=mlist"><span>' , $txt[331] , '</span></a></li>';

            // the [Chat] button
            $chatPath = str_replace("index.php", "chat/index.php", $scripturl);
            $num = (empty($modSettings['enableChatButtonNo'])) ? 0 : count(chatOnlineUsers());
            $chatnum = $num>0 ? '('.$num.')' : '';
            echo '<li><a href="', $chatPath, '"', empty($modSettings['chatPopUp']) ? 'target="_blank"' : ' onclick="openWindow(this.href);this.blur();return false;"', '><span>Chat',$chatnum,'</span></a></li>';

            // If the user is a guest, show [login] button.
            if ($context['user']['is_guest'])
               echo '<li><a ' , $current_action=='login' ? ' class="current"' : '' , ' href="', $scripturl, '?action=login"><span>' , $txt[34] , '</span></a></li>';

            // If the user is a guest, also show [register] button.
            if ($context['user']['is_guest'])
               echo '<li><a ' , $current_action=='register' ? ' class="current"' : '' , ' href="', $scripturl, '?action=register"><span>' , $txt[97] , '</span></a></li>';

            // Otherwise, they might want to [logout]...
            if ($context['user']['is_logged'])
               echo '<li><a ' , $current_action=='logout' ? ' class="current"' : '' , 'href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '"><span>' , $txt[108] , '</span></a></li>';

   echo '
         </ul></div>
<div style="clear:both;"></div>';
}

C_Murder


Urbanite

I want to use just the shoutbox without the chat and need a little help to:-

(1) Remove or "// out" the chat button on the menu bar.

(2) On the shoutBox I want to change the title 'shoutBox' to something more forum geared and also change the word 'Shout' on the send button.

any clues please?   ... oh talented ones
Just when you finally get it idiot proof ...along comes a bigger idiot!

Advertisement: