News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

AjaxChat Integration (latest version 3.2.1)

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

Previous topic - Next topic

RCmod

T3CHN0

I know your trying and I appreciate that very very much :) Thanks!!!!

I managed to find the 3.2.2b version and replace the chat and shout folder from it into the 3.2.1 version as you suggested. Everything worked, yet with all the same errors.

Oh well I guess we will just deal with it. :(

Thanks so much for trying.

RCmod

Well with some more of T3CHN0's help I got it fixed. Came down to me just needing to enable chat. Silly that's all it was. I thought I could use just the shoutbox by its self.

Thanks again T3CHN0

aleks93ts

where can i download ajax chat for smf 2.0.1?
thanks

T3CHN0

Quote from: aleks93ts on November 19, 2011, 07:00:13 AM
where can i download ajax chat for smf 2.0.1?
thanks
A few pages back you would have found it but here you go

GlitchPC

T3CHN0,

Hate to bother you, but...I just installed the 3.2.2b version of this mod on my SMF 2.0.1 board.  Installation went without a hitch except for a single edit failure on a custom theme of mine.  The theme is Crip's Anecdota theme.  It failed for updating the index.template.php file for that particular theme.

The theme change is as follows from the package parser:

Code: (Find)
echo '
<li>', $context['current_time'], '</li>
</ul>';


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


Unfortunately, the Anecdota theme is not coded that way.  Instead, I have the following code for that particular theme:

echo '
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user"  size="10" />
<input type="password" name="passwrd"  size="10" />
<input type="submit" value="', $txt['login'], '" class="button_submit" />
<input type="hidden" name="hash_passwrd" value="" />
  </form>', $context['current_time'],'<br />';
  }


If there is any coding advice you can give me to fix the above edit, I certainly would appreciate it.


Thanks, in advance...

hcfwesker

#8445
Then just add the same code above what you already have, manually so it looks like this. ;) 

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

echo '
<script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
<form action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" style="margin: 4px 0;"', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<input type="text" name="user"  size="10" />
<input type="password" name="passwrd"  size="10" />
<input type="submit" value="', $txt['login'], '" class="button_submit" />
<input type="hidden" name="hash_passwrd" value="" />
  </form>', $context['current_time'],'<br />';
  }



But, to be honest, I removed that code cause it adds more to the member heading up top.  All it does is show how mnay users are in the chat, which there's already 2 other places that shows that, in the chat button, and on the board index info center.  So, it's not an absolute must to have that code for the ajax to work, if I remember correctly.

GlitchPC

hcfwesker,

Thanks...if it isn't necessary, then I won't add it.  I appreciate the quick reply.

maryclare

Hello.

I found code on the SourceForge.net [nofollow] sit that allows you to basically do a search and replace of posted text. 

Here is there code recommendation:  http://sourceforge.net/apps/mediawiki/ajax-chat/index.php?title=Mod_Word_Filter [nofollow]

Mod Word Filter

This modification is short and simple.

Open chat/js/custom.js
Add the following to the end of the file:

I have added the code, below is my custom.js file, and it does not work.  Could this be old, or is there something wrong with my custom.js file?



/*
* @package AJAX_Chat
* @author Sebastian Tschan
* @copyright (c) Sebastian Tschan
* @license GNU Affero General Public License
* @link https://blueimp.net/ajax/ [nofollow]
*/

// Overriding client side functionality:

/*
// Example - Overriding the replaceCustomCommands method:
ajaxChat.replaceCustomCommands = function(text, textParts) {
   return text;
   
}
*/

/*
//Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
    text=text.replace(/frug/gi, 'Fruggles');
    text=text.replace(/foo/gi, 'Donkey Foo');
    return text;
}
*/


hcfwesker

Try this instead.  Its what i use, and works.

//Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
text=text.replace('censor', 'c****r');
    return text;
}


Just copy and add this line for each censor word you want, and make the changes.

text=text.replace('censor', 'c****r');

MrNicotine

Quote from: T3CHN0 on November 15, 2011, 06:39:32 PM
Quote from: MrNicotine on November 15, 2011, 02:39:38 PM
Thanks for looking, but actually, you weren't a standard member.
One of my globals gave you a higher status, so you could see chat, after I mentioned you could come online and may ask some questions.
My fault, I didn't tell them to leave things as they are.
So, it still doesn't work for normal users. I'll take a look at the 3.2.2 version, as I'm starting to give up on this.

One last question, then. Could Portamx be the problem (as you mentioned it's probably a conflict between chat and a media mod).
And if it could, won't it give the same problem with the 3.2.2 version?
No I don't believe Portamx is the problem, it's a portal mod not a media mod.
As chat works for members greater then standard members it still looks like permission settings need to be set.
I sent you a PM.

T3chno, you've been a great help on my forum. Thanks for this, I really appreciate it ;)

T3CHN0

Quote from: hcfwesker on November 19, 2011, 05:43:24 PM
Try this instead.  Its what i use, and works.

//Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
text=text.replace('censor', 'c****r');
    return text;
}


Just copy and add this line for each censor word you want, and make the changes.

text=text.replace('censor', 'c****r');
Hi hcfwesker this is a good option for others and I didn't know about his one.
I added it to test but doesn't work for me
I did the following
edit the /chat/js/custom.js and added what you said so mine now looks like this
/*
* @package AJAX_Chat
* @author Sebastian Tschan
* @copyright (c) Sebastian Tschan
* @license GNU Affero General Public License
* @link https://blueimp.net/ajax/
*/

// Overriding client side functionality:

/*
// Example - Overriding the replaceCustomCommands method:
ajaxChat.replaceCustomCommands = function(text, textParts) {
    return text;
}
*/
//Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
text=text.replace('test', 't**T');
text=text.replace('hello', 'h***o');
text=text.replace('holden', 'ford');
    return text;
}

but after doing this and testing it; the words didn't change. I cleared my cache and tried a few other browsers but still the same.
tested as administrator and standard member as well.. Did I do something wrong

I only ask as others might find the same problem. my self if I see something posted I don't like I simply remove it.

hcfwesker

#8451
Quote from: T3CHN0 on November 19, 2011, 09:17:58 PM
but after doing this and testing it; the words didn't change. I cleared my cache and tried a few other browsers but still the same.
tested as administrator and standard member as well.. Did I do something wrong

I only ask as others might find the same problem. my self if I see something posted I don't like I simply remove it.

Have you set this files permissions to 777 , that may be it.

Go to the chat, and do an F5 hard refresh.  Then test.  All i know is it works perfectly on our forum.  We use this to store member's online gaming friend codes.  We've got over 200 members that are stored in this censor file, and all work.   Edited just to show as a preview ....

/Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
text=text.replace('hcfweskerFC?', 'hcfwesker FC: 3050-7720-6194');
text=text.replace('SpiritFC?', 'Spirit FC: 4554-3872-0844');
text=text.replace('TriforceOSMFC?', 'TriforceOSM FC: 0259-4991-6513');
text=text.replace('ArcueidFC?', 'Arcueid FC: 4897-5731-9905')
    return text;
}


I just noticed something, and not sure if it was always like that, or my co-admin messed up, but there's no ";" semi-colon on the last censor line in the code.   Maybe thats whats stopping it, but i doubt it.  Try the hard refresh in the chat, then try the code without the semicolon inb the last phrase like you see in my code, with   text=text.replace('ArcueidFC?', 'Arcueid FC: 4897-5731-9905')    <---- no semicolon

T3CHN0

Hmm did all that but still not working,, would you mind sending your js folder packed so I can download it and have a look
or maybe ask your co-admin if there is something else he changed as well for censorship to work.

hcfwesker

No other files were edited to make this work.  I did the edits in the file, my co-admin just helps me add new lines when members request their code 'reword' be added to the chat.   Here's what my entire custom.js file looks like (edited manu of the censors inbetween to limit space ....


/*
* @package AJAX_Chat
* @author Sebastian Tschan
* @copyright (c) Sebastian Tschan
* @license GNU Affero General Public License
* @link https://blueimp.net/ajax/
*/

// Overriding client side functionality:

/*
// Example - Overriding the replaceCustomCommands method:
ajaxChat.replaceCustomCommands = function(text, textParts) {
return text;
}
*/

//Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
text=text.replace('hcfweskerFC?', 'hcfwesker FC: 3050-7720-6194');
text=text.replace('SpiritFC?', 'Spirit FC: 4554-3872-0844');
text=text.replace('CamdenFC?', 'Camden FC: 0732-2814-7068');
text=text.replace('iLinkFC?', 'iLink FC: 0602-5945-7011');
text=text.replace('BoshiFC?', 'Boshi FC: 1032-1319-5420');
text=text.replace('Phoenix_vXFC?', 'Phoenix_vX FC: 0731-4415-7566');
text=text.replace('TriforceOSMFC?', 'TriforceOSM FC: 0259-4991-6513');
text=text.replace('ArcueidFC?', 'Arcueid FC: 4897-5731-9905')
    return text;
}

T3CHN0

#8454
OK I will have a play around with this and see if I can find out why it doesn't work for me.
just one other thing, in your edit I see '?' is this important to the edit
text=text.replace('censor', 'c****r');
should it be like this
text=text.replace('censor?', 'c****r');

Never mind found the answer
If I do the code like this in my

/chat/js/custom.js it works beautifully and if wanting the shoutbox only then the same edit needs to be done to /shoutbox/js/custom.js

//Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
    text=text.replace(/1/gi, 'one');
    text=text.replace(/2/gi, 'two');
    text=text.replace(/3/gi, 'three');
    text=text.replace(/4/gi, 'four');
    text=text.replace(/5/gi, 'five');
    text=text.replace(/hi/gi, 'hello');
     text=text.replace(/bob/gi, 'robert');
     text=text.replace(/sing/gi, 'song');
     text=text.replace(/live/gi, 'life');
     text=text.replace(/sun/gi, 'moon');
    return text;
}

    text=text.replace(/ put the correct word here /gi, ' put the new word here ');

luckyMM

Quote from: T3CHN0 on November 19, 2011, 09:07:32 AM
Quote from: aleks93ts on November 19, 2011, 07:00:13 AM
where can i download ajax chat for smf 2.0.1?
thanks
A few pages back you would have found it but here you go
Can someone please upload T3CHN0's Ajax chat package  from hxxp:www.mediafire.com [nonactive] . I can't download this link because i need to use proxy software . SMF give me dns server failure.

T3CHN0

Quote from: luckyMM on November 22, 2011, 08:58:45 AM
Quote from: T3CHN0 on November 19, 2011, 09:07:32 AM
Quote from: aleks93ts on November 19, 2011, 07:00:13 AM
where can i download ajax chat for smf 2.0.1?
thanks
A few pages back you would have found it but here you go
Can someone please upload T3CHN0's Ajax chat package  from www.mediafire.com . I can't download this link because i need to use proxy software . SMF give me dns server failure.
Not my mod lol just like it so much I am happy to support it if I can
try this link http://www.2shared.com/file/VaVsCT9w/AjaxChat_Integration_322b.html

bigggan

Can someone please post a Link here from wikiupload.com/ [nofollow] or something since I had to make an account here to get this mod....

T3CHN0

Quote from: bigggan on November 22, 2011, 03:53:00 PM
Can someone please post a Link here from wikiupload.com/ or something since I had to make an account here to get this mod....
Don't know why you need to register to the other link I gave you. I am not registered and others I have sent files didn't need to either
but thats beside the point here is a link to AjaxChat3.2.2b upload to the site you like http://www.wikiupload.com/M7F1AQN75PPFHHN

BaghdadGhost

first I would like to thank all members and mod authors helped in this matter.


I installed this great mod before and my hosting company complained about it as it was using a lot of their resources. I understood the situation and uninstalled it.


recently I upgraded my subscription with my host to plus (meaning double of what I used to get) and because I liked this chatbox before I thought of giving it a try with the new limits.

after searching and reading most of the comments in this topic, I installed the curve friendly version with no errors. and after setting everything I kept an eye on the chat and my cpanal indicators. the chat and shoutbox was used for about half an hour by two members at a time. all the sudden I noticed the following



Uploaded with ImageShack.us

as far as I understood from the author of this mod and some members, this chat box is ok on shared servers with limited use of it (less than 10 members) and based on that I should be ok especially after doubling the capacity of cpu usage and script executions.


does anyone have an opinion regarding my problem?


thanks

Advertisement: