AjaxChat Integration (latest version 3.2.1)

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

Previous topic - Next topic

Greymalkin

Okay, it's moving along (albeit slowly). :)  A few steps further on ...

Sweet Dream index.template has no:
// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
echo ' </span>';
}


(it has no reference to minutes that I can find at all).  So where would

// But, let's always show minutes - Time wasted here: 0 minutes ;).
echo $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
}
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>';
}

go?

primetime

Quote from: TheListener on June 08, 2009, 07:15:12 PM
https://blueimp.net/ajax/#documentation

Without stepping on any toes with my heavy feet the above link may help

I will have a look, but I am not sure where to begin :)

mrtrc266

@ Greymalkin

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

Add After

  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 />';
  }


For the button
Find
// Otherwise, they might want to [logout]...
Replace with
// the [chat] button
if (!empty($modSettings['chatPopUp']))
  echo '    <script type="text/javascript">
            function openWindow(url,width,height,options,name) {
                width = width ? width : 800;
                height = height ? height : 600;
                options = options ? options : \'resizable=yes\';
                name = name ? name : \'openWindow\';
                window.open(
                    url,
                    name,
                    \'screenX=\'+(screen.width-width)/2+\',screenY=\'+(screen.height-height)/2+\',width=\'+width+\',height=\'+height+\',\'+options
                )
            }
    </script>';
 
$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]...


And cross fingers LOL :D

Greymalkin

Seems to be working splendidly.  Thanks!

mrtrc266

Quote from: Greymalkin on June 09, 2009, 04:05:16 PM
Seems to be working splendidly.  Thanks!

NP Glad you got it goin.

allumius

Quote from: mrtrc266 on June 09, 2009, 11:44:40 AM
Quote from: allumius on June 09, 2009, 07:22:43 AM
Somebody can help me please?
my forum have helios multi and i cant modify index.template.php
please help me

Are you talkin about this theme?
This theme might give you troubles with a lot of mods it hasn't been updated in quite awhile and stopped at SMF 1.1

http://custom.simplemachines.org/themes/?lemma=1
Last Modified:  December 13, 2006, 04:09:08 PM 
Compatible With:  1.0.6, 1.0.7, 1.0.8, 1.1 RC2, 1.1 RC3, 1.1


Yes, this is the theme
sorry my english is very bad
i have instaled other mod manually, but with you mod, i cant  :'(
Please you can modify my index.template.php?

mrtrc266

Quote from: allumius on June 09, 2009, 04:16:08 PM
Quote from: mrtrc266 on June 09, 2009, 11:44:40 AM
Quote from: allumius on June 09, 2009, 07:22:43 AM
Somebody can help me please?
my forum have helios multi and i cant modify index.template.php
please help me

I couldn't download you index.template it came through corrupted.

Here is the original index.template from the helios_multi11final theme, you can see the edits I did and then just copy them to yours.

I'm having trouble with the button though, you'll have to take a look at your buttons and see if you can get it sorted.

zijO

Quote from: mrtrc266 on June 09, 2009, 02:50:35 PM
Quote from: zijO on June 08, 2009, 05:37:37 PM
This is great mod.
When shout box is activated it takes longer time for page to show up.
How I can disable shout box to not display on first page but to display on all the other pages?
Also is it possible to delete all chat at once?

That would disable shoutbox  completely.
I need to display it with boards or posts, but not at index template.



Goto your Admin and disable the shoutbox

fext

#2368
Hey mrtrc266,

How would I go about removing certain items from the member menu list?

I tried to remove the 'Enter private room' but when i do it fails?

EDIT: How do i remove the Chat link when guests view the site?

mrtrc266

@ zijO

At the moment you can only display the shoutbox on index or all pages.

As we speak the ability to have it show on specific pages and or boards is being worked on.

mrtrc266

Quote from: Youngiiie on June 09, 2009, 06:30:22 PM
Hey mrtrc266,

How would I go about removing certain items from the member menu list?

I tried to remove the 'Enter private room' but when i do it fails?

Follow the posts from here It's only a cpl pages back.
http://www.simplemachines.org/community/index.php?topic=257973.msg2100280#msg2100280

That should get you in the right direction.

fext

What about removing the "chat" link when guests view my site?

fext

#2372
Yeah i saw the but there are bits of code in IF statements that differ?

How would I remove the Enter Private Room?

getUserNodeStringItems: function(encodedUserName, userID) {
var menu;
if(encodedUserName != this.encodedUserName) {
menu = '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/msg '
+ encodedUserName
+ ' \');">'
+ this.lang['userMenuSendPrivateMessage']
+ '</a></li>'
+ '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/describe '
+ encodedUserName
+ ' \');">'
+ this.lang['userMenuDescribe']
+ '</a></li>'
+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/ignore '
+ encodedUserName
+ '\');">'
+ this.lang['userMenuIgnore']
+ '</a></li>'
+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/whereis '
+ encodedUserName
+ '\');">'
+ this.lang['userMenuWhereis']
+ '</a></li>';
if(this.userRole == 2 || this.userRole == 3) {
menu += '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/kick '
+ encodedUserName
+ ' \');">'
+ this.lang['userMenuKick']
+ '</a></li>'
+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/whois '
+ encodedUserName
+ '\');">'
+ this.lang['userMenuWhois']
+ '</a></li>';
}
} else {
menu = '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/quit\');">'
+ this.lang['userMenuLogout']
+ '</a></li>'
+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/who\');">'
+ this.lang['userMenuWho']
+ '</a></li>'
+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/ignore\');">'
+ this.lang['userMenuIgnoreList']
+ '</a></li>'
+ '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/list\');">'
+ this.lang['userMenuList']
+ '</a></li>'
+ '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/action \');">'
+ this.lang['userMenuAction']
+ '</a></li>'
+ '<li><a href="javascript:ajaxChat.insertMessageWrapper(\'/roll \');">'
+ this.lang['userMenuRoll']
+ '</a></li>';
if(this.userRole == 1 || this.userRole == 2 || this.userRole == 3) {
menu += '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/join\');">'
+ this.lang['userMenuEnterPrivateRoom']
+ '</a></li>';
if(this.userRole == 2 || this.userRole == 3) {
menu += '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/bans\');">'
+ this.lang['userMenuBans']
+ '</a></li>';
}
}
}


I tried to remove this section twice and the AjaxChat popup failed

if(this.userRole == 1 || this.userRole == 2 || this.userRole == 3) {
menu += '<li><a href="javascript:ajaxChat.sendMessageWrapper(\'/join\');">'
+ this.lang['userMenuEnterPrivateRoom']
+ '</a></li>';


See my problem now?

Also another couple of things:
1. How do I remove the chat link for when guests view my site
2. Is there a way to reverse the chat when in a popup to load back into the website? I have the popup currently loading the site after logout but it loads into the popup - ideally I'd like it to work so when you log out the popup closes and the page you spawned from would refresh?

Any ideas with the latter queires too?

mrtrc266

@ Young and anyone else wishing to remove features from AJAX Chat.

Most of what you are trying to do would be better found @ SourceForge.
EXAMPLE: How to close the window on logout is here
http://ajax-chat.wiki.sourceforge.net/Close+chat+window+on+logout

As well as removing the command/items from the chat window, all that info can be found @ Sourceforge Wiki. Remember this is NOT AJAX Chat, this Mod just intergrates AJAX Chat into SMF.

There have been a few requests lately to remove some of the main functions from the Chat, keep in mind that this is a FULL ON Chat Room and has many features that you will find in the most popular Chat Rooms so removing them would defeat the purpose of installing this in the first place. If anyone doesn't want all those features then maybe a simple shoutbox with basic feature might be more suited to your needs. Many can be found by searching "Shout" or "Chat" on the Mod site.

Please don't get me wrong we would love for everyone to use the AJAX Chat Intergration Mod but we would rather support it by customizing and adding features not take them away.

Regards

fext

thanks bro I'll look at those sites... But one last ask-how do I make the chat link invisible to guests? So when a guest visits my site they don't see the chat link?

Thanks for your patience and help :)

[unplugged]

What version of SMF, youngiiie?
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



fext

1.1.9. It's a custom theme to - mostly divs - would you need the index file?

[unplugged]

Post the index.template.php from the custom theme and I'll set the "members only" chat button for you.
« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



Chit-Chat ChatterBox Boss

#2378
One quick question. I know I edited this before but where do I make shoutbox msg's stay forever but limit say max 30 messages showing?

:-[I think I found it:

shoutbox/lib/config.php 
// Max time difference in hours for messages to display on each request:
$config['requestMessagesTimeDiff'] = 8760;
// Max number of messages to display on each request:
$config['requestMessagesLimit'] = 30;


8760 hours = 365 days

Also
Quote from: Chit-Chat ChatterBox Boss on June 08, 2009, 02:01:08 AM
mrtrc266 a member just relized a bug. The 'Logout' button to left of the channel listings area at the top works fine. The logout on the right side under 'Online Users' just flashes the screen and keeps you logged in it says this.
Quote
(06.08.2009 at 01:59) ChatBot: Caleb logs out of the Chat.
(06.08.2009 at 02:00) ChatBot: Caleb logs into the Chat.
(06.08.2009 at 02:00) ChatBot: Caleb logs out of the Chat.
(06.08.2009 at 02:00) ChatBot: Caleb logs into the Chat.
I clicked it 2 times and it logs you out and right back in right away.

Any idea on this? I will try to check it out tomorrow but if you had a clue I was gonna take it and use it
  ;D

~Edit~
I went to AJAXChat main site (sourceforge) and downloaded their newest release '0.8.2'  have been comparing alot of files the config.php ... and such and everything in the template file all seem pretty close to exactly the same except maybe 1 - 5 lines in each a little different. The new release has everything a bit cleaned up. Also I did notice this above problem that I posted is not there now, both logouts work. What I did have a problem with is this one issue.

The shoutbox is too long(where I put the red line is where the chat area that showed the chat messages stopped before. Now it goes all way down to where you can see). I want to remove from that red line and where the X's are how do I do this?


I figured out where to make this smaller in chat/css/shoutbox.css
Chit-Chat ChatterBox

Our site is open to everyone. It is a resource for anyone and everyone to talk about anything and everything you could possibly think of. It's a great place to come and talk, ask questions, or just simply hang out. We offer many great features. All we ask is that you follow by the site rules. Hope to see you around!
www.chitchatchatterbox.com
Remember in the "Referral" box to put "Caleb" while registering.

Chit-Chat ChatterBox Boss

#2379
For anyone that might want to make this edit here it is: (I don't know if this has already been mentioned in this topic)

To make your shoutbox smaller (not as long top to bottom) but then if more messages then the size of the shoutbox is entered it gets a scroll bar edit this:
chat/css/shoutbox.css   also edit the same one in shoutbox/css/shoutbox.css

#ajaxChatContent #ajaxChatChatList {

height:300px;

overflow:auto;

}

Edit the "height:300px;" number to your desired height.


To add the words "Shout Message" and a submit button to your shoutbox like this:

Do this:
shoutbox/lib/template/shoutbox.html
Find:

<input id="ajaxChatInputField" type="text" maxlength="[MESSAGE_TEXT_MAX_LENGTH/]" onkeypress="ajaxChat.handleInputFieldKeyPress(event);"/>


Replace With:

<h3>Shout Message</h3><input id="ajaxChatInputField" type="text" maxlength="[MESSAGE_TEXT_MAX_LENGTH/]" onkeypress="ajaxChat.handleInputFieldKeyPress(event);"/><input type="button" id="submitButton" value="Submit" onclick="ajaxChat.sendMessage();" />

This is all one line not 2 lines as it is appearing.

All of these changes were made on 2.0 RC1-1. Most likely they will be the same exact for your SMF Version as well.
Chit-Chat ChatterBox

Our site is open to everyone. It is a resource for anyone and everyone to talk about anything and everything you could possibly think of. It's a great place to come and talk, ask questions, or just simply hang out. We offer many great features. All we ask is that you follow by the site rules. Hope to see you around!
www.chitchatchatterbox.com
Remember in the "Referral" box to put "Caleb" while registering.

Advertisement: