The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

How can I add edit/delete functions for each message in chatbox?

Page 3 of 4 Previous  1, 2, 3, 4  Next

View previous topic View next topic Go down

Solved How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on February 26th 2015, 1:56 pm

First topic message reminder :

Hello,
How can I add edit/delete functions in chatbox messages per each message? I need to allow the members edit/delete their messages from chatbox and the staff will be able to edit/delete messages for each message of chatbox.

Example:


Last edited by Black-Shadow on May 8th 2015, 10:30 pm; edited 2 times in total

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down


Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 7th 2015, 11:57 am

Bump

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 8th 2015, 11:54 am


JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 8th 2015, 1:18 pm

Hello @JScript,
How can I add just only the functions edit/delete(not change all of the chatbox code) in my current chatbox code? I have already added some other functions like auto-login, deleting messages user connected/disconnected etc). Furthermore some time it displays a test message how can i delete it?

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by FrOsTyXi on May 8th 2015, 1:31 pm

@JScript thank you sir this was perfect!

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

http://team-psn.forum-board.net/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 8th 2015, 1:40 pm

@FrOsTyXi
I'm a farao


@Black-Shadow
1- I have already added some other functions like auto-login
-> The auto-login function is already included!

2- deleting messages user connected/disconnected:
->
In the code, look for: if ($(".shout-" + index).length) {
And replace with: if ($(".shout-" + index).length || message.userId == -10 {

3- "Furthermore some time it displays a test message how can i delete it?"
-> You could post a "print"?

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by FrOsTyXi on May 8th 2015, 1:47 pm

@JScript very true friend it is very nice and glad you made this for us, amazing work friend!

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

http://team-psn.forum-board.net/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 8th 2015, 1:53 pm

@JScript wrote:@FrOsTyXi
I'm a  farao


@Black-Shadow
1- I have already added some other functions like auto-login
-> The auto-login function is already included!

2- deleting messages user connected/disconnected:
->
In the code, look for: if ($(".shout-" + index).length) {
And replace with: if ($(".shout-" + index).length || message.userId == -10 {

3- "Furthermore some time it displays a test message how can i delete it?"
-> You could post a "print"?

JS
@JScript can I pm you my code to check it and fix it?

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 8th 2015, 2:03 pm

Black-Shadow wrote:@JScript can I pm you my code to check it and fix it?
Due to the complexity of the code, we can not post it on topic, only download link!

But it's easy, follow the steps below:
In the code, search: if ($(".shout-" + index).length) {
And replace with: if ($(".shout-" + index).length || message.userId == -10) {

So long,

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 8th 2015, 2:18 pm

@JScript wrote:
Black-Shadow wrote:@JScript can I pm you my code to check it and fix it?
Due to the complexity of the code, we can not post it on topic, only download link!

But it's easy, follow the steps below:
In the code, search: if ($(".shout-" + index).length) {
And replace with: if ($(".shout-" + index).length || message.userId == -10) {

So long,

JS
@JScript i want to hide the chatbox option "logout" and "Back to Chat" when the member is connected to the chatbox and I need to remove @ from the chatbox because I have substituted with an icon.

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 8th 2015, 5:45 pm

Black-Shadow wrote:@JScript i want to hide the chatbox option "logout" and "Back to Chat" when the member is connected to the chatbox and I need to remove @ from the chatbox because I have substituted with an icon.
I made some changes based on what you want, I will implement them gradually, because I lack time!

The values of the following variables can be modified:

Translations:
Remove: "Tem certeza de que deseja remover esta mensagem?",
Save: "Salvar",
Cancel: "Cancelar",

Configurations:
Title: "", // Change your chatbox title, default is "" = (locale title!)
Notice: 0, // ligns "joined" and "logged off": 1 = Remove
Prefix: "@", // Change the moderator prefix
autoLogin: 1 // Automatic login: 0 = Disable
Important: Keep all that is bold and change only what is underlined!

So long,

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 8th 2015, 8:36 pm

Hello @JScript,
Nice update, thank you very much my friend, I have a problem I have hide the "archives/back to the chat" and "logout" links but after a few hour are appearing again also the symbol @ appearing again after some refreshes.


Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 8th 2015, 11:33 pm

Give me access to their forum with a temporary account with membership rights only!

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 8th 2015, 11:55 pm

Ok @JScript I will pm you a testing account.

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 9th 2015, 12:18 am

@Black-Shadow
OK, there is an error in your forum, see:


This error belongs to the widget "Staff Online" and the best you have to do is remove it and then ask for support!

JS


JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 9th 2015, 1:28 am

In my code, search this: $(function() { and change to this: $(window).load(function () {

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 9th 2015, 1:34 am

Ok @JScript, I change it but nothing happens

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 9th 2015, 1:57 am

Black-Shadow wrote:Ok @JScript, I change it but nothing happens
Ok, undo the change and remove this chat customization code: Remove the lines "...joined the chat & ... has logged off the chat"
My code already does this!

Check whether the problem still continues,

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 9th 2015, 2:01 am

JScript, Ok I have removed this customization too but the problem still remaining

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 9th 2015, 2:06 am

Black-Shadow wrote:JScript, Ok I have removed this customization too but the problem still remaining
You still did not undo what has been done in this post: http://help.forumotion.com/t139285p60-#956128 !!!

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 9th 2015, 2:11 am

I have been undone it now @JScript

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 9th 2015, 3:04 am

@Black-Shadow
Okay, in my code, search for this:
Code:

$(function() {
   if (_userdata.session_logged_in) {
      $('#frame_chatbox').load(function() {
         chat_edit();
      });
   }
});

And replace it with this other "loader":
Code:

$(function() {
   if (_userdata.session_logged_in) {
      var frame_chatbox_document = setInterval(function() {
         try {
            if (document.getElementById('frame_chatbox').contentWindow['chatbox']) {
               clearInterval(frame_chatbox_document);
               chat_edit();
            }
         } catch (e) {}
      }, 500);

      $('#frame_chatbox').load(function() {
         chat_edit();
      });
   }
});

So long,

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 9th 2015, 3:09 am

Ok @JScript I replaced the code but it duplicates the message "The messages has been cleared by..." and it is not hiding the memberslist when exiting.

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 9th 2015, 3:15 am

Black-Shadow wrote:Ok @JScript I replaced the code but it duplicates the message "The messages has been cleared by..."
I made a change in my post: http://help.forumotion.com/t139285p60-how-can-i-add-edit-delete-functions-for-each-message-in-chatbox#956139

Redo again and check ok?

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 9th 2015, 3:19 am

I checked it again.


Last edited by Black-Shadow on May 9th 2015, 3:28 am; edited 1 time in total

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 9th 2015, 3:27 am

@Black-Shadow
I already warned you you that due to the complexity of the code, it can not be posted within a topic, only download link!

Edit your last post and remove the code...

Here everything is ok, see: http://i.imgur.com/ecs5TWx.png


New info: http://help.forumotion.com/t139285p60-how-can-i-add-edit-delete-functions-for-each-message-in-chatbox#956145

So long,

JS


Last edited by JScript on May 9th 2015, 4:06 am; edited 1 time in total (Reason for editing : New info!)

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 9th 2015, 4:03 am

Ok i edited my post the only problem is that each time i am refreshing the page it duplicates the chatbox messages.

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 9th 2015, 4:05 am

@Black-Shadow
Ok...

In the code, search for:
Code:

                  if (!interval) {
                     interval = setInterval(function() {
                        chatbox.init();
                     }, 5000);
                  }
               } else {
                  clearInterval(interval);
                  interval = 0;

And replace with:
Code:

                  if (!interval) {
                     $("#chatbox").empty();
                     interval = setInterval(function() {
                        chatbox.init();
                     }, 5000);
                  }
               } else {
                  if (interval) {
                     $("#chatbox").empty();
                  }
                  clearInterval(interval);
                  interval = 0;

So long,

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by Van-Helsing on May 9th 2015, 4:10 am

I have done this change too but the problem remaining.

Van-Helsing
Hyperactive

Male Posts : 2222
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by FrOsTyXi on May 9th 2015, 5:00 am

@JScript Correct even after the changes above we are getting this,

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

http://team-psn.forum-board.net/

Back to top Go down

Solved Re: How can I add edit/delete functions for each message in chatbox?

Post by JScript on May 9th 2015, 5:19 am

@FrOsTyXi and @Black-Shadow

Please, download the code again cause I made a small change in it!
Link: http://help.forumotion.com/t138790-new-chat-box-a-brief-analysis#956061

JS

JScript
Forumember

Male Posts : 741
Reputation : 168
Language : PT-BR, EN
Location : Brazil

http://jscript.forumeiros.com/

Back to top Go down

Page 3 of 4 Previous  1, 2, 3, 4  Next

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum