The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Chatbox

3 posters

Go down

In progress Chatbox

Post by smejker March 20th 2015, 1:20 am

Dear members of fm,

I would like to ask you why the conversations are not in the chat box field after 15-20 min. of my last conversation? I would like to explain that the chat box is empty after a while and i need to go to the archives to review last messages. Is there any way the conversations to stay on the chat box without automatically been send to the archives?

Thank you in advance
Many regards and respect!!
smejker
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

In progress Re: Chatbox

Post by brandon_g March 20th 2015, 1:45 am

Hello,

No I do not believe it is possible to do this. The system is simply set up that way from FM's Server side. Sorry Sad

-Brandon


Chatbox Brando10
Remember to mark your topic Chatbox Solved15 when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

Chatbox Scre1476
Team Leader
Review Section Rules | Request A Review | Sticker Points
brandon_g
brandon_g
Manager
Manager

Male Posts : 10113
Reputation : 923
Language : English
Location : USA

https://www.broadcastingduo.com

Back to top Go down

In progress Re: Chatbox

Post by smejker March 20th 2015, 5:45 am

Hmmm.... Nothing is imposssible...
smejker
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

In progress Re: Chatbox

Post by brandon_g March 20th 2015, 6:33 am

Well I meant legally it is not possible... of course if there is a will there is a way... but legally... there is no way and it is not possible unless you have access to FM's server (which I would very very much assume you don't), or can write your own scripts.

-Brandon


Last edited by brandon_g on March 21st 2015, 12:30 pm; edited 1 time in total
brandon_g
brandon_g
Manager
Manager

Male Posts : 10113
Reputation : 923
Language : English
Location : USA

https://www.broadcastingduo.com

Back to top Go down

In progress Re: Chatbox

Post by smejker March 20th 2015, 6:49 am

OK... But it's very bad when you going on site, and U see emptu chatbox... If U understend me!
smejker
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

In progress Re: Chatbox

Post by brandon_g March 20th 2015, 7:38 am

Oh I understand perfectly... I would love for there to be a way to do away with it (as well possibly the option to disable the chat timeout). Unforunately it is FM'S call in the end and there is very little if anything we can do besides make suggestions and put up with it.

-Brandon


Chatbox Brando10
Remember to mark your topic Chatbox Solved15 when a solution is found.
General Rules | Tips & Tricks | FAQ | Forgot Founder Password?

Chatbox Scre1476
Team Leader
Review Section Rules | Request A Review | Sticker Points
brandon_g
brandon_g
Manager
Manager

Male Posts : 10113
Reputation : 923
Language : English
Location : USA

https://www.broadcastingduo.com

Back to top Go down

In progress Re: Chatbox

Post by JScript March 21st 2015, 2:26 am

smejker wrote:Hmmm.... Nothing is imposssible...
Yes, you're absolutely right!!!

The impossible is just a matter of opinion.

Try this code below, placement only "In the home page":

New code: https://help.forumotion.com/t139727-chatbox#949784

So long,

JS


Last edited by JScript on March 25th 2015, 1:23 am; edited 1 time in total (Reason for editing : New code!)
JScript
JScript
Forumember

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

http://jscript.forumeiros.com/

Back to top Go down

In progress Re: Chatbox

Post by smejker March 24th 2015, 9:04 pm

Thanks jscript... but not working,

I try with something else... In index_body I erasure {CHATBOX_TOP}... after that in overall_header I put:
Code:
 <iframe src="/chatbox/index.forum?archives=1" id="frame_chatbox"  width=100% height=350 scrolling=no frameborder=0></iframe> 

and now Chatbox is visiable from every page and I see last messages, but (everytime but...)
In Chatbox I can't see message box and buttons (Bold, Underline, Italic, Strike, Fontcolor and Emoticons) See Picture:
Chatbox Chatbo10

If I put:
Code:
 <iframe src="/chatbox/index.forum?" id="frame_chatbox"  width=100% height=350 scrolling=no frameborder=0></iframe>
(Without archives=1)
I can see buttons, but Chatbox after 15-20 min. is empty... Still have problem...
And my question is How to put the first code, and have message box and buttons?

Thanks in advance!

Regards & Respect
smejker
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

In progress Re: Chatbox

Post by JScript March 25th 2015, 12:30 am

@smejker

Ok, so keep this format:
Code:
<iframe src="/chatbox/index.forum?archives=1" id="frame_chatbox" scrolling="no" width="100%" height="100%" marginwidth="0" marginheight="0" frameborder="0"></iframe>

And replace the previous code for this below with placement only "In the home page":

New code: https://help.forumotion.com/t139727-chatbox#949784

So long,

JS


Last edited by JScript on March 25th 2015, 1:25 am; edited 1 time in total
JScript
JScript
Forumember

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

http://jscript.forumeiros.com/

Back to top Go down

In progress Re: Chatbox

Post by smejker March 25th 2015, 1:15 am

Oooo It's work... Chatbox 1872900549

Chatbox 27547334 jscript

Chatbox 1791170337

Recpect!
smejker
smejker
Forumember

Male Posts : 167
Reputation : 4
Language : serbo-croatian/english/macedonian/bulgarian

Back to top Go down

In progress Re: Chatbox

Post by JScript March 25th 2015, 2:57 am

@smejker

Ok, try this new code because I made small changes that will leave it more faster and fixes a bug when disconnected:
Code:

// Redefine function!
function insertChatBox(chatbox_id, chatbox_url) {
   return insertChatBoxNew(chatbox_id, chatbox_url);
}
// Redefine function!
function insertChatBoxNew(chatbox_id, chatbox_url) {
   document.getElementById(chatbox_id).innerHTML = '<iframe src="/chatbox/index.forum?archives=1" id="frame_chatbox" scrolling="no" width="100%" height="100%" marginwidth="0" marginheight="0" frameborder="0"></iframe>';
}

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

function chat_archives() {
   var oIframe = (document.getElementById("frame_chatbox").contentWindow.document || document.getElementById("frame_chatbox").contentDocument),
      script = oIframe.createElement("script"),
      chatbox_script = function () {

      // "For" asynchronous loop, faster and does not lock the browser interface when you have many messages!
      (function ($) {
         $.assyncFor = function (arr, callback) {
            for (var i = 0, len = arr.length; i < len; ++i) {
               var boundCallback = callback.bind(null, i, arr[i]);
               setTimeout(boundCallback, i);
            }
            return this;
         };
      }(jQuery));

      var interval = 0;

      $("#chatbox_option_co, #chatbox_option_disco").bind("click", function () {
         $("#chatbox").empty();
      });

      Chatbox.prototype.refresh = function (data) {
         if (data.error) {
            $("body").html(data.error)
         } else {
            if (this.connected) {
               $("#chatbox_display_archives").show();
               $("#chatbox_option_co").hide();
               $("#chatbox_option_disco, #chatbox_footer").show();
               $("#chatbox_messenger_form").css('display', 'block');
               $("#chatbox_messenger_form").css('visibility', 'visible');
               $(".format-message").each(function () {
                  var name = $(this).attr('name');
                  var value = my_getcookie('CB_' + name);
                  $(this).prop('checked', parseInt(value) ? true : false)
               });
               this.format();
               if (data.lastModified) {
                  this.listenParams.lastModified = data.lastModified
               }
               if (!interval) {
                  interval = setInterval(function () {
                     chatbox.init();
                  }, 5000);
               }
            } else {
               clearInterval(interval);
               interval = 0;
               $("#chatbox_option_co").show();
               $("#chatbox_option_disco, #chatbox_footer").hide();
               $("#chatbox_display_archives").hide();
               $("#chatbox_messenger_form").css('display', 'none');
               $("#chatbox_messenger_form").css('visibility', 'hidden');
            }
            if (data.users) {
               this.users = [];
               $(".online-users, .away-users").empty();
               $(".member-title").hide();
               for (var i in data.users) {
                  var user = data.users[i];
                  this.users[user.id] = user;
                  var username = "<span style='color:" + user.color + "'>" + (user.admin ? "@ " : "") + "<span class='chatbox-username chatbox-user-username' data-user='" + user.id + "' >" + user.username + "</span>" + "</span>";
                  var list = user.online ? '.online-users' : '.away-users';
                  $(list).append('<li>' + username + '</li>')
               }
               if (!$(".online-users").is(':empty')) {
                  $(".member-title.online").show()
               }
               if (!$(".away-users").is(':empty')) {
                  $(".member-title.away").show()
               }
            }
            if (data.messages) {
               var scroll = !this.messages || this.messages.length != data.messages.length;
               this.messages = data.messages;

               if (this.messages) {
                  var oThis = this; // Here we save the current "this" for use inside "For" asynchronous loop!

                  $.assyncFor(oThis.messages, function (index, content) { // The "For" asynchronous loop...
                     // Here checks if there is already a message in the DOM, if already, not need to process the same message!
                     if ($(".shout-" + index).length) {
                        return oThis;
                     }

                     var message = content, //                                       |ClassName index|
                        html = "<p class='chatbox_row_" + (index % 2 == 1 ? 2 : 1) + " clearfix shout-" + index + "'>" + "<span class='date-and-time' title='" + message.date + "'>[" + message.datetime + "]</span>";

                     if (message.userId == -10) {
                        html += "<span class='msg'>" + "<span style='color:" + message.msgColor + "'>" + "<strong> " + message.msg + "</strong>" + "</span>" + "</span>"
                     } else {
                        html += "<span class='user-msg'>";
                        if (oThis.avatar) {
                           html += "   <span class='cb-avatar'><img src='" + message.user.avatar + "' /></span>"
                        }
                        html += "   <span class='user' style='color:" + message.user.color + "'>" + "<strong> " + (message.user.admin ? "@ " : "") + "<span class='chatbox-username chatbox-message-username'  data-user='" + message.userId + "' >" + message.username + "</span>&nbsp;:&nbsp;" + "</strong>" + "</span>" + "<span class='msg'>" + message.msg + "</span>" + "</span>"
                     }
                     html += "</p>";

                     /**
                      * Here the "append" will not make slow the code execution since it is not within a synchronous loop,
                      * but instead in an asynchronous loop that schedules the execution later!
                      */
                     $("#chatbox").append(html);

                     if ((index + 1) == oThis.messages.length) {
                        if (scroll) {
                           $("#chatbox")[0].scrollTop = $("#chatbox").prop("scrollHeight") * 2
                        }
                     }
                  });
               }
            }
         }
      };
      $("#chatbox").empty();
      chatbox.init();
      interval = setInterval(function () {
         chatbox.init();
      }, 5000);
   };

   script.type = "text/javascript";
   script.innerHTML = "(" + chatbox_script.toString() + ")();";
   oIframe.getElementsByTagName("head")[0].appendChild(script);
}

So long,

JS
JScript
JScript
Forumember

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

http://jscript.forumeiros.com/

Back to top Go down

Back to top

- Similar topics

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