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.

Chatbox

View previous topic View next topic Go down

In progress Chatbox

Post by smejker on March 19th 2015, 2:20 pm

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
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

In progress Re: Chatbox

Post by brandon_g on March 19th 2015, 2:45 pm

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


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5355
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

In progress Re: Chatbox

Post by smejker on March 19th 2015, 6:45 pm

Hmmm.... Nothing is imposssible...

smejker
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

In progress Re: Chatbox

Post by brandon_g on March 19th 2015, 7:33 pm

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, 1:30 am; edited 1 time in total

brandon_g
Support Moderator
Support Moderator

Male Posts : 5355
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

In progress Re: Chatbox

Post by smejker on March 19th 2015, 7:49 pm

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

smejker
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

In progress Re: Chatbox

Post by brandon_g on March 19th 2015, 8:38 pm

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


Remember to mark your topic when a solution is found.

brandon_g
Support Moderator
Support Moderator

Male Posts : 5355
Reputation : 489
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

In progress Re: Chatbox

Post by JScript on March 20th 2015, 3:26 pm

@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: http://help.forumotion.com/t139727-chatbox#949784

So long,

JS


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

JScript
Forumember

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

http://jscript.forumeiros.com/

Back to top Go down

In progress Re: Chatbox

Post by smejker on March 24th 2015, 10:04 am

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:


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
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

In progress Re: Chatbox

Post by JScript on March 24th 2015, 1:30 pm

@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: http://help.forumotion.com/t139727-chatbox#949784

So long,

JS


Last edited by JScript on March 24th 2015, 2:25 pm; edited 1 time in total

JScript
Forumember

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

http://jscript.forumeiros.com/

Back to top Go down

In progress Re: Chatbox

Post by smejker on March 24th 2015, 2:15 pm

Oooo It's work...

jscript



Recpect!

smejker
Forumember

Male Posts : 158
Reputation : 3
Language : serbo-croatian/english/macedonian/bulgarian

http://smejker@yahoo.com

Back to top Go down

In progress Re: Chatbox

Post by JScript on March 24th 2015, 3:57 pm

@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
Forumember

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

http://jscript.forumeiros.com/

Back to top Go down

View previous topic View next topic Back to top


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