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.

Minimum posts required for chat box

View previous topic View next topic Go down

Solved Minimum posts required for chat box

Post by Guest on December 29th 2014, 6:31 pm

hello can any 1 help me

i want chat box chat activate for 5 post minimum posted member

chat box show all member but use only 5 posted member

if this is possible ??

Guest
Guest


Back to top Go down

Solved Re: Minimum posts required for chat box

Post by JScript on December 29th 2014, 7:17 pm

@__Ashiq__

Hi, try this:

In your ACP: Modules -> HTML&JAVASCRIPT -> JavaScript codes management -> [Create a new JavaScript]
Title *: <- Whatever you want
Placement : <- In the home page
Javascript Code * : <- Select, copy and paste the code below in this field:
Code:

// Redefine function in chatbox7.js, by JScript Brasil at live dot com!
function insertChatBox(chatbox_id, chatbox_url) {
    return insertChatBoxNew(chatbox_id, chatbox_url);
}

// Redefine function in frm_lang_xx.js, by JScript Brasil at live dot com!
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>';

    frames["frame_chatbox"].onload = function() {
      var oIframe = (document.getElementById("frame_chatbox").contentWindow || document.getElementById("frame_chatbox").contentDocument),
            script = oIframe.document.createElement("script"),
            memDiv = oIframe.document.createElement('div');

        script.type = "text/javascript";
        script.innerHTML =
            'function ajax_submit_chatbox(params) {' +
         '   if (parent._userdata.user_posts < 5) {' +
         '      return alert("Warning!\\n\\nYou can only post messages when you have more than 5 threads started!");' +
         '   }' +
         '   number_of_refresh = 0;' +
         '   var msg_sent = document.post.sent.value;' +
         '   if (params == "" || params == undefined) {' +
         '      params = "?achives=0"' +
         '   }' +
         '   var data = "&mode=send";' +
         '   data += "&sent=" + encodeURIComponent(msg_sent);' +
         '   data += "&sbold=" + document.post.sbold.value;' +
         '   data += "&sitalic=" + document.post.sitalic.value;' +
         '   data += "&sunderline=" + document.post.sunderline.value;' +
         '   data += "&sstrike=" + document.post.sstrike.value;' +
         '   data += "&scolor=" + document.post.scolor.value;' +
         '   if ((msg_sent.indexOf("/away") == 0) || (msg_sent.indexOf("/abs") == 0)) {' +
         '      document.getElementById("refresh_auto").checked = false' +
         '   }' +
         '   if (document.post.sent.value == "/banlist") {' +
         '      window.open("/chatbox/chatbox_banlist.forum" + params, "banlist", "toolbar=no,menubar=no,personalbar=no,width=450,height=300,scrollbars=yes,resizable=yes");' +
         '      return false' +
         '   }' +
         '   if (window.XMLHttpRequest) {' +
         '      var http_request = new XMLHttpRequest()' +
         '   } else if (window.ActiveXObject) {' +
         '      var http_request = new ActiveXObject("Microsoft.XMLHTTP")' +
         '   }' +
         '   http_request.onreadystatechange = function () {' +
         '      if (http_request.readyState == 4 && http_request.status == 200) {' +
         '         var parsed_text = http_request.responseText;' +
         '         eval(parsed_text);' +
         '         if (typeof (chatbox_messages) !== "undefined") {' +
         '            $("#chatbox").html(chatbox_messages)[0].scrollTop = $("#chatbox").prop("scrollHeight") * 2' +
         '         }' +
         '         if (typeof (chatbox_memberlist) !== "undefined") {' +
         '            $("#chatbox_members").html(chatbox_memberlist)' +
         '         }' +
         '      }' +
         '   };' +
         '   http_request.open("POST", "/chatbox/chatbox_actions.forum" + params, true);' +
         '   http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");' +
         '   http_request.send((data))' +
            '}';
        oIframe.document.getElementsByTagName("head")[0].appendChild(script);
    };
}

So long,

JS

JScript
Forumember

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

http://jscript.forumeiros.com/

Back to top Go down

Solved Re: Minimum posts required for chat box

Post by Guest on December 30th 2014, 6:32 am

Thanks Its Working Problem Solved

Guest
Guest


Back to top Go down

Solved Re: Minimum posts required for chat box

Post by brandon_g on January 1st 2015, 6:31 pm

Ashiq try changing the icon to solved, so a staff knows this is solved. Just a tip, you can do this by editing your original post.

And because I can hear the reminder already this post is not intended moderate anybody.

Happy new years!

brandon_g
Support Moderator
Support Moderator

Male Posts : 5139
Reputation : 478
Language : English
Location : USA

http://broadcastingduo.forumotion.com/

Back to top Go down

Solved Re: Minimum posts required for chat box

Post by Base on January 2nd 2015, 1:23 am

Solved => Archived

Next time, please use a more specific title that is related to your problem / question. Title changed to: Minimum posts required for chat box

Base
Forumaster

Male Posts : 10386
Reputation : 1687
Language : English and French
Location : United Kingdom, England

http://forumotionhub.net

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