AjaxChat Integration (latest version 3.2.1)

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

Previous topic - Next topic

mrtrc266

Quote from: harry66 on May 08, 2010, 04:57:55 PM
Thanks its working now. But can i disable the "Chat" Button + Chat? I only want to use the Shoutbox.

Glad you got it going.

You can't disable the chat cuz that's what runs the shout box but you can remove the button.

Go to /yoursite/index.php?action=admin;area=modsettings;sa=chat and uncheck "Enable online chat users numbering on chat button"

Then Open, Find and Remove the following...

/Sources/Subs.php
   $num = empty($modSettings['enableChatButtonNo']) ? 0 : count(chatOnlineUsers());
   $chatButton = 'Chat';
   $chatButton .= ($num > 0) ?  ('('.$num.')') : '';
   $chatLink = str_replace("index.php", "chat/index.php", $scripturl);
   if (!empty($modSettings['chatPopUp']))
      $chatLink .= '" onclick="openWindow(this.href);this.blur();return false;';

And
         'chat' => array(
         'title' => $chatButton,
         'href' => $chatLink,
         'show' => true,
         'sub_buttons' => array(
         ),
      ),

TheListener

Adbrad

Let me know when you are ready for the edits and I will give ya a hleping paw er I mean a hand.


Lou69

I searched this thread and did not see this covered, apologies if it has been.

No guest accounts are available, so the login/registration screen is first seen.

The Chat button appears between Help and Login. I would like to remove this button from being dispayed. I still want chat to work in other areas and for the Chat button to be visible in the other areas, just do not need this Chat button visible at the login page.

I am using a custom theme, RGBB Curves from Crip.

thanks,

Lou




Arantor

@Lou69: Would help to know what version of SMF you're using. The code's totally different between SMF 1.1.x and 2.0. If you're restricting it on the login page, what about the registration page? In fact, what about whether users are logged in generally?

mrtrc266

QuoteNo guest accounts are available, so the login/registration screen is first seen.
As stated in the FAQ's set permissions to allow guests to access chat

QuoteThe Chat button appears between Help and Login. I would like to remove this button from being dispayed. I still want chat to work in other areas and for the Chat button to be visible in the other areas, just do not need this Chat button visible at the login page.

What Arantor said LOL

I'm not even sure if you can set it to show on a per page basis, from my under standing it's either in the menu or not, but you can remove it / disable it entirely or make it visible on a member group basis.

Arantor

Well, actually you can make it on a per page basis with a little work, but it depends more on what version of SMF as to how easy it is.

mrtrc266

Ahhh very nice, will need some help with that one, I wouldn't have a clue

Arantor

Really, it's just PHP, meaning you can trigger it off anything in SMF if you so desire, it's just a case of knowing what to check against. Button visibility is really quite easy in the scheme of things in either version. In 1.1 you just preface the new echo with an if(), in 2.0 you just attach the condition you'd be checking in the if() into 'show' => (condition) in Subs.php.

There's no reason you even have to check normal SMF stuff; in SimpleDesk we have this mean ol' entry for example:
'show' => $modSettings['helpdesk_active'] && shd_allowed_to(array('access_helpdesk', 'admin_helpdesk')),

I've just realised that with the new permissions it doesn't actually need both to be checked now, but the principle holds - you can do anything to check, provided that it returns true or false at the end (or, at least, it's something that can be cast to true/false)

harry66

Quote from: mrtrc266 on May 08, 2010, 05:45:01 PM
@ Harry, attach that file please

done.


other question:
Why do Co-Admins or Mods have the same Color as normal Members in Shoutbox? Just the Admin is red. Groups with moderation rights are green in shoutbox.

mrtrc266

Here you go, you didn't add to this $smcFunc; to the end of this line.
function BoardIndex()
{
    global $txt, $user_info, $sourcedir, $modSettings, $context, $settings, $scripturl, $smcFunc;


AJAX Chat doesn't integrate Membergroup Colors, it would be AWESOME if it did though.

You have to set the colors for Chat Bot, Guest, Mods, Users and Admins in /chat/css/yourstyle.css and chat/css/shoutbox.css

In yourstyle.css look for
#content .guest

In shoutbox.css look for
#ajaxChatContent .guest

Lou69

Sorry Guys, tried posting twice, but had power failures. Storms in areas. 

My version is 2.0 RC3.  I did go back and check the permissions, the Guest account cannot browse forums and the permissions for Guest were all none/not enabled.

While Guest cannot browse, when on the initial login page, registration agreement or registration form page; the Chat button is visible and can be used to pop up chat box. User obviously cannot login as guest has no viable account. I just want to remove the visibility of Chat button those three pages. I would rather user not access chat unless already logged into via normal method.

Sorry for poor explanation the first time.  :)

thanks,

Lou



Arantor

Nice easy one.

Subs.php
Code (find) Select
'chat' => array(
'title' => $chatButton,
'href' => $chatLink,
'show' => true,
'sub_buttons' => array(
),
),


Replace with:
Code (find) Select
'chat' => array(
'title' => $chatButton,
'href' => $chatLink,
'show' => allowedTo('chat_access'),
'sub_buttons' => array(
),
),


That makes it driven from the permission, so if they have permission to access the chat, it shows the link.

pointalk

#6153
Moderate shoutBox without √.
But member still can delete own shout message?
How to disable it?

And i need this feature: member can only edit own chat message
SMF1.1.11

Lou69

Quote from: Arantor on May 08, 2010, 08:04:26 PM
Nice easy one.

Subs.php
Code (find) Select
'chat' => array(
'title' => $chatButton,
'href' => $chatLink,
'show' => true,
'sub_buttons' => array(
),
),


Replace with:
Code (find) Select
'chat' => array(
'title' => $chatButton,
'href' => $chatLink,
'show' => allowedTo('chat_access'),
'sub_buttons' => array(
),
),


That makes it driven from the permission, so if they have permission to access the chat, it shows the link.



You are an absolute genius! The fact that visiblity is driven by Permission is much more secure and cleaner than just having the button invisible. It works like a charm and was exactly what I needed.

Thank you so very much good sir. 

Lou

:)

psyxeon

#6155
I relocated the shoutbox, but now i have no idea how to add padding to it.


mrtrc266

#6156
@ psyxeon

Upload this Shout.template.php to your /Themes/default/

Then find
/chat/css/shoutbox.css
/*
* Positioning
*/

Add After
#sb {
    padding-left:9px;
    padding-right:9px;
}

psyxeon

#6157
Thanks a lot mate!
We fixed it writing

Let me try your fix  ;)

Quote

index.template.php

echo '<br class="clear">
<div id="shoutbox_wrapper">';
template_shout_above();
echo '</div>';

index.css

#shoutbox_wrapper
{
padding: 1em;
/*margin: 0 10px;*/
}



We have a big spacing between the link tree and the shout box, any quick fix?



mrtrc266

What was the result of what I posted above?

psyxeon


Advertisement: