Minimum posts required for chat box Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
3 posters

    Minimum posts required for chat box

    avatar
    Guest
    Guest


    Solved Minimum posts required for chat box

    Post by Guest 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 ??
    JScript
    JScript
    Forumember


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

    Solved Re: Minimum posts required for chat box

    Post by JScript 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
    avatar
    Guest
    Guest


    Solved Re: Minimum posts required for chat box

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

    Thanks Its Working Problem Solved
    brandon_g
    brandon_g
    Manager
    Manager


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

    Solved Re: Minimum posts required for chat box

    Post by brandon_g 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!
    Base
    Base
    Forumaster


    Male Posts : 10383
    Reputation : 1695
    Language : English and French
    Location : United Kingdom, England

    Solved Re: Minimum posts required for chat box

    Post by Base 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