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.

Request Certain Post Count Before Accessing The Chatbox

View previous topic View next topic Go down

Request Certain Post Count Before Accessing The Chatbox

Post by FrOsTyXi on December 29th 2014, 1:15 am

Hello! Another request if you will. Looking for a code or a system to implement on my forun to make it so new members have to have a post count of 5 to access the chatbox. Is this a possibility?

Thank you in advance!

punBB

Forum Link:TPSN

Regards
FrOsTyXi

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

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

Back to top Go down

Re: Request Certain Post Count Before Accessing The Chatbox

Post by JScript on December 29th 2014, 1:47 am

@FrOsTyXi

How do you want:
1- That the chatbox only appear if the member has the minimum number of threads;
2- That the chatbox is visible, but can only post if you have the minimum amount of posts.

JS

JScript
Forumember

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

http://jscript.forumeiros.com/

Back to top Go down

Re: Request Certain Post Count Before Accessing The Chatbox

Post by FrOsTyXi on December 29th 2014, 1:48 am

@JScript2-That the chatbox is visible, but can only post if you have the minimum amount of posts.


That will be perfect!

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

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

Back to top Go down

Re: Request Certain Post Count Before Accessing The Chatbox

Post by JScript on December 29th 2014, 1:52 am

@FrOsTyXi

Do you use any chatbox modified or that has custom functions like what I did that adds avatar and editing messages?

JS

JScript
Forumember

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

http://jscript.forumeiros.com/

Back to top Go down

Re: Request Certain Post Count Before Accessing The Chatbox

Post by _Twisted_Mods_ on December 29th 2014, 1:55 am

funny i just ask ange for something similar to this

i wanted the chatbox hidden from all members with an account that was older then 5 days and in order to see that chat box you had to make at least 1 post in a 24h period also with safe list to add some admins or like people who work on the site but don't post

that way members are forced to start posting instead of hanging out in chatbox and also the 5 day thing is to help prevent new members from leaving because they r forced to post

_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Re: Request Certain Post Count Before Accessing The Chatbox

Post by FrOsTyXi on December 29th 2014, 1:57 am

@JScript wrote:@FrOsTyXi

Do you use any chatbox modified or that has custom functions like what I did that adds avatar and editing messages?

JS

@JScript Yes i use your avatar and edit/delete chatbox style

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

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

Back to top Go down

Re: Request Certain Post Count Before Accessing The Chatbox

Post by JScript on December 29th 2014, 2:18 am

@FrOsTyXi

Replace with this code:
Code:

/**************************************************************************
 * Module: AVATARChat + JS_EditMsgChat
 * Description: Need?!
 * Author: Made and Optimizations by JScript - 2014/11/23
 * Version: RC2 (Release candidate 2!)
 ***************************************************************************/
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>';
   // $('#' + chatbox_id).parent().detach().prependTo('#wrapper');

    frames["frame_chatbox"].onload = function() {
        // Redefine function in chatbox7.js, by JScript Brasil at live dot com!
        var JS_search = {
                //inVar: /">\[(?:(?:2[0-3]|[0-1][0-9]|[0-9]):[0-5][0-9]:[0-5][0-9])\]<\/span>&nbsp;<span class=\\"user-msg\\">(.+)&Iota;id=(.*?)&Alpha;<(.*?)>&Epsilon;<img (.*?)&Chi;<img (.*?)>&Tau;(.+)&Mu;(.*?)<\/span>/g,
                //inHtml: /">\[(?:(?:2[0-3]|[0-1][0-9]|[0-9]):[0-5][0-9]:[0-5][0-9])\]<\/span>&nbsp;<span class=\\"user-msg\\">(.+)[\u0399]id=(.*?)[\u0391]<(.*?)>[\u0395]<img (.*?)[\u03a7]<img (.*?)>[\u039c](.*?)<\/span>/g
                inVar: /&Iota;id=(.*?)&Alpha;<(.*?)>&Epsilon;<img (.*?)&Chi;<img (.*?)>&Mu;(.*?)<\/span>/g,
                inHtml: /[\u0399]id=(.*?)[\u0391]<(.*?)>[\u0395]<img (.*?)[\u03a7]<img (.*?)>[\u039c](.*?)<\/span>/g
            },
            // JS_replace = '">[$6]$1<span class=\"id\" id=$2><span class=\"js-avatar\"><$3></span><span class=\"editor\"><img onclick=\"editor(this, 1)\" $4<img onclick=\"editor(this, 2)\" $5></span><span class=\"text\">$7</span>',
            JS_replace = '<span class=\"id\" id=$1><span class=\"js-avatar\"><$2></span><span class=\"editor\"><img onclick=\"editor(this, 1)\" $3<img onclick=\"editor(this, 2)\" $4></span><span class=\"text\">$5</span>',
            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 =
            'USERNAME = parent._userdata.username;' +
            'SUPERMOD = parent._userdata.user_level;' +
            'AVATAR = parent._userdata.avatar.replace(\'<img src="\', "[img]").replace(\'" alt="" />\', "[/img]");' +
            'JS_search = ' + JS_search.inVar + ';' +
            'JS_replace = \'' + JS_replace + '\';' +
         'pauseRefresh = 0;' +
            'function submitmsg(params) {' +
            '   if (document.post.message.value.length < 4 && SUPERMOD !== 1) return false;' +
            '   if (document.post.message.value.indexOf("/") !== 0) {' +
            '      var date = new Date();' +
            '       var UID = Math.ceil(date.getDate() + date.getHours() + Math.random() * Math.pow(10, 10) + date.getMinutes() + date.getSeconds() + date.getMilliseconds());' +
            '       if (UID.length < 10) {' +
            '         UID + "" + (10 - UID.length);' +
            '       }' +
            //'      var time = new Date().toLocaleTimeString();' +
            //'      document.post.message.value = \'&Iota;id="\' + UID + \'"&Alpha;\' + AVATAR + "&Epsilon;[img]http://goo.gl/brvCui[/img]&Chi;[img]http://goo.gl/k8FZx5[/img]&Tau;" + time + "&Mu;" + document.post.message.value;' +
            '      document.post.message.value = \'&Iota;id="\' + UID + \'"&Alpha;\' + AVATAR + "&Epsilon;[img]http://goo.gl/brvCui[/img]&Chi;[img]http://goo.gl/k8FZx5[/img]&Mu;" + document.post.message.value;' +
            '    }' +
            '   document.post.sent.value = document.post.message.value;' +
            '   document.post.message.value = "";' +
            '   document.post.message.focus();' +
            '   ajax_submit_chatbox(params);' +
            '   return false' +
            '}' +
            'function copy_user_name(user_name) {' +
            '   if (document.post.message) {' +
            '      document.post.message.focus();' +
            '      document.post.message.value += ((user_name.indexOf("@") == 0) ? "" : "@") + user_name + " -> ";' +
            '   }' +
            '    return false' +
            '}' +
            'function ajax_submit_chatbox(params, editor) {' +
         '   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;' +
            '   if (params == "" || params == undefined) {' +
            '      params = "?achives=0"' +
            '   }' +
            '   if (editor == "" || editor == undefined) {' +
            '      var msg_sent = document.post.sent.value;' +
            '   } else {' +
            '      var msg_sent = editor;' +
            '   }' +
            '   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' +
            '   }' +
            '   $.ajax({' +
            '      url: "/chatbox/chatbox_actions.forum" + params,' +
            '      type: "post",' +
            '      data: data,' +
            '      dataType: "script",' +
            '      success: function(response, status, xhr) {' +
            '         if (xhr.status == 200) {' +
            //'            if (typeof (chatbox_messages) !== "undefined") {' +
            '               chatbox_messages = chatbox_messages.replace(JS_search, JS_replace);' +
            '                document.getElementById("memdiv").innerHTML = chatbox_messages;' +
            '                  hackMsg();' +
            '               document.getElementById("chatbox").innerHTML = document.getElementById("memdiv").innerHTML;' +
            '               /*$("#chatbox").html(chatbox_messages) [0].scrollTop = $("#chatbox").prop("scrollHeight");*/' +
            '               document.getElementById("chatbox").scrollTop = 999999;' +
            //'            }' +
            '            if (typeof (chatbox_memberlist) !== "undefined") {' +
            '               document.getElementById("chatbox_members").innerHTML = chatbox_memberlist;' +
            '               /*$("#chatbox_members").html(chatbox_memberlist);*/' +
            '            }' +
            '         }' +
            '      },' +
            '   })' +
            '}' +
            'function ajax_refresh_chatbox(params, force) {' +
         '   if (pauseRefresh) {'+
         '      return false;' +
         '   }' +
            '   if (params == "" || params == undefined) {' +
            '      params = "?achives=0"' +
            '   }' +
            '   $.ajax({' +
            '      url: "/chatbox/chatbox_actions.forum" + params + "&mode=refresh",' +
            '      type: "get",' +
            '      dataType: "script",' +
            '      success: function(response, status, xhr) {' +
            '         if (xhr.status == 200) {' + // || force) {' + <- Fail!
            //'              if ($("#chatbox").length) {' +
            '            if (typeof (chatbox_messages) !== "undefined") {' +
            '               chatbox_messages = chatbox_messages.replace(JS_search, JS_replace);' +
            '                document.getElementById("memdiv").innerHTML = chatbox_messages;' +
            '                  hackMsg();' +
            '               document.getElementById("chatbox").innerHTML = document.getElementById("memdiv").innerHTML;' +
            '               document.getElementById("chatbox").scrollTop = document.getElementById("chatbox").scrollHeight + document.getElementById("chatbox").offsetHeight;' +
            '               document.getElementById("chatbox").scrollTop = 999999;' +
            '              }' +
            //'              if (document.getElementById("chatbox_members").innerHTML != null) document.getElementById("chatbox_members").innerHTML = chatbox_memberlist;' +
            '            if (typeof (chatbox_memberlist) !== "undefined") {' +
            '               document.getElementById("chatbox_members").innerHTML = chatbox_memberlist;' +
            '               /*$("#chatbox_members").html(chatbox_memberlist);*/' +
            '            }' +
            '         }' +
            '      },' +
            '   })' +
            '}' +
            'function hackMsg() {' +
            '   var oTarget = jQuery("#memdiv > p"),' +
            '      iLen = oTarget.length,' +
            '      index = 0;' +
            '   for (; index < iLen; index++) {' +
            '      var oThis = jQuery(oTarget[index]),' +
            '         sUserName = oThis.find(".user > a").text(),' +
            '         ID = oThis.find("span.id");' +
            '      if (ID.length == 0) {' +
            '         ID = oThis.find(".msg:last").text();' +
            // XORcipher -> '         ID = XORcipher(oThis.find(".msg").text());' +
            '         var del = ID.match(/^\\/remove[\\u0399](.*?)$/);' +
            // XORcipher -> '         var del = ID.match(/^\\/remove&Iota;(.*?)$/);' +
            '         if (del !== null) {' +
            '            var oMsg = oThis.parent().find("#" + del[1]).closest("p");' +
            '            if (oMsg.length) {' +
            //'               if (oMsg.find(".user > a").text() == sUserName || SUPERMOD > 0) {' +
            '                  oMsg.remove();' +
            //'               }' +
            '            }' +
            '         }' +
            '           var edit = ID.match(/^\\/edit[\\u0399]([0-9]+)[\\u039c](.*?)$/);' +
            // XORcipher -> '              var edit = ID.match(/^\\/edit&Iota;([0-9]+)&Mu;(.*?)$/);' +
            '           if (edit !== null) {' +
            '            var oMsg = oThis.parent().find("#" + edit[1]);' +
            '            if (oMsg.length) {' +
            //'               if (oMsg.closest("p").find(".user > a").text() == sUserName || SUPERMOD > 0) {' +
            '                  oMsg.find("span.text").text(edit[2]);' +
            //'               }' +
            '            }' +
            '              }' +
            '              /*var nudge = ID.match(/^\\/nudge[\\u0399]([0-9]+)[\\u039d](.*?)$/);' +
            '              if (nudge !== null) {' +
            '            var oMsg = oThis.parent().find("#" + nudge[1]);' +
            '            if (oMsg.length) {' +
            '               if (nudge[2] == USERNAME) {' +
            '                  // Developing!;' +
            '               }' +
            '            }' +
            '           }*/' +
            '         oThis.remove();' +
            '      } else {' +
            '         if (sUserName !== USERNAME && SUPERMOD == 0) {' +
            '            ID.find(".editor").remove();' +
            '         }' +
            '      }' +
            '   }' +
            '}' +
            'function editor(oThis, num) {' +
            '   if (num == 1 && iConfirm("Tem certeza de que deseja remover esta mensagem?\\n\\n" + jQuery(oThis).closest(".id").text() ) == 1) {' +
            '      ajax_submit_chatbox("?achives=1", "/remove&Iota;" + jQuery(oThis).closest(".id").attr("id"));' +
            '      jQuery(oThis).closest("p").remove();' +
            '   } else if (num == 2) {' +
         '      pauseRefresh = 1;' +
         '      var td = $(oThis).closest(".id"),' +
         //'         width = td.find(".text").width() - (td.find(".editor").width() * 2),' +
         '         width = td.width() - (td.find(".editor").width() * 4),' +
         '         height = td.find(".text").height(),' +
         '         sHtml =' +
         '            \'<span id="staff-shout-edit">\' +' +
         '               \'<textarea id="rt_input" style="width: \' + width + \'px; height: \' + height + \'px;vertical-align: middle;font-family: inherit;font-size: inherit;">\' + td.find(".text").text() + \'</textarea>\' +' +
         '               \'<input type="submit" id="rt_submit" class="button2" value="Save" onclick="ajax_submit_chatbox(&quot;?achives=1&quot;, &quot;/edit&Iota;&quot; + \' + jQuery(oThis).closest(".id").attr("id") + \' + &quot;&Mu;&quot; + jQuery(&quot;#rt_input&quot;).val());pauseRefresh = 0;" style="margin-right: 4px;">\' +' +
         '               \'<a title="Cancel" href="javascript:void(0);" onclick="var oEdit = jQuery(&quot;#staff-shout-edit&quot;); oEdit.next().show(); oEdit.prev().show(); oEdit.remove();return pauseRefresh = 0;">Cancel</a>\' +' +
         '            \'</span>\';' +
         '         td.find(".editor").hide();' +
         '         td.find(".text").hide().before(sHtml);' +
            /*
         '      var result = prompt("Editando a frase:", jQuery(oThis).closest(".id").text());' +
            '      if (result != null) {' +
            '         ajax_submit_chatbox("?achives=1", "/edit&Iota;" + jQuery(oThis).closest(".id").attr("id") + "&Mu;" + result);' +
            '         jQuery(oThis).closest(".id span.text").text(result);' +
            '      }' +
         */
            '   /*} else if (num == 3) {' +
            '      ajax_submit_chatbox("?achives=1", XORcipher("/nudge&Iota;" + jQuery(oThis).closest(".id").attr("id") + "&Nu;" + jQuery(oThis).closest("p").find(".user > a").text()));*/' +
            '   }' +
            '}' +
            /*'function XORcipher(sText) {' +
         '   var key = 2,' +
         '      result = "",' +
         '      len = sText.length,' +
         '      i = 0;' +
         '   for (; i < len; i++) {' +
         '      result += String.fromCharCode(key ^ sText.charCodeAt(i));' +
         '   }' +
         '   return result;' +
         '}' +*/
            'function iConfirm(text) {' +
            '   var iChoice = -1;' +
            '   if (confirm(text) == true) {' +
            '      iChoice = 1;' +
            '   } else {' +
            '      iChoice = 0;' +
            '   }' +
            '   return iChoice;' +
            '}';
        oIframe.document.getElementsByTagName("head")[0].appendChild(script);

        var style = oIframe.document.createElement("style");
      style.type = "text/css";
        style.innerHTML =
            '#chatbox p {' +
            '   background: none repeat scroll 0 0 #fff;' +
            '   border-bottom: 1px solid #e3e3e3;' +
            '   line-height: 1.3em;' +
            '   padding: 5px;' +
            '}' +
            '#chatbox span[title] {' +
            '   color: #8f8f8f !important;' +
            '   float: right !important;' +
            '}' +
            '#chatbox .user:not(:empty) {' +
            '   font-weight: 700;' +
            '   margin-left: 36px !important;' +
            '}' +
            '#chatbox .id {' +
            '   display: block;' +
            '   margin-top: 3px;' +
            '}' +
            '#chatbox .js-avatar img {' +
            '   background: none repeat scroll 0 0 #fff;' +
            '   border: 1px solid #ddd;' +
            '   float: left;' +
            '   height: 30px;' +
            '   margin-right: 5px;' +
            '   margin-top: -19px;' +
            '   max-width: 30px;' +
            '   padding: 1px;' +
            '   vertical-align: middle;' +
            '   width: 30px;' +
            '}' +
            '#chatbox .editor img {' +
            '   cursor: pointer;' +
            '   float: right;' +
            '   padding-left: 4px;' +
            '}' +
            '#chatbox {' +
            '   display: none;' +
            '}';
        oIframe.document.getElementsByTagName("head")[0].appendChild(style);

        var forceConnect = setInterval(function() {
            if (oIframe.document.getElementById("chatbox") !== null) {
                clearInterval(forceConnect);
                memDiv.id = 'memdiv';
                oIframe.document.getElementsByTagName('body')[0].appendChild(memDiv);
                oIframe.document.getElementById("memdiv").style.display = 'none';
                oIframe.document.getElementById("memdiv").innerHTML = oIframe.document.getElementById("chatbox").innerHTML.replace(JS_search.inHtml, JS_replace);

                oIframe.hackMsg();

                oIframe.document.getElementById("chatbox").innerHTML = oIframe.document.getElementById("memdiv").innerHTML;
                if (oIframe.document.getElementById('chatbox_option_disco').style.display == 'none') {
                    oIframe.CB_disconnect();
                }
                oIframe.document.getElementById("chatbox_option_with_archives").style.display = 'none';
                oIframe.document.getElementById("chatbox_option_without_archives").style.display = 'none';
                oIframe.document.getElementById("chatbox").style.display = 'block';
            }
        }, 250);
    };
}

In the code, search for:
Code:

         '   if (parent._userdata.user_posts < 5) {' +
         '      return alert("Warning!\\n\\nYou can only post messages when you have more than 5 threads started!");' +
         '   }' +
Change the warning: You can only post messages When You have more than 5 threads started! - By the notice that you want;
And change posts value 5 by the you want.

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

Re: Request Certain Post Count Before Accessing The Chatbox

Post by FrOsTyXi on December 29th 2014, 2:54 am

@JScript that was perfect! thank you kindly sir!

FrOsTyXi
Forumember

Male Posts : 460
Reputation : 12
Language : english

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

Back to top Go down

Re: Request Certain Post Count Before Accessing The Chatbox

Post by _Twisted_Mods_ on December 30th 2014, 5:19 am

i also did one

goto acp>display>pictures&colors>colors>css

add


Code:
  body.chatbox { display:none }



save/submit

goto

acp>modules>html page management

create a new html page

Title:tchatbox < must be the title
Do you wish to use your forum header and footer ? YES
Homepage: No

save/submit ... no html is needed


goto acp>modules>JavaScript management

Enable JavaScript code management :Yes

save

if its not already on

then

create a new JavaScript

Title: up to you
Placement: all pages

code

Code:





  $(function(){
  var hmanydold = "10" -1; // how many days old the account must be to run the scrit
  var dayppost = "5"; // how many days before required to make post again
  var hmpth = "2" -1 ;// how many post per dayppost
  var names = "3 876 232 1221 9764"; // safe list user# serperated by space
  var htlink = "/h1_tchatbox"; // url to your html page
  // this would set it to require 1 post every 5 days if the joindate was longer then 10 days ago

  $('a[href*="chatbox"]').attr('href', htlink);
  if(location.href.match('tchatbox')){
  $('head').append(' <style>body\{margin-top:0px!important;\} #fa_toolbar\{display:none!important;\} </style>');
  $('body').empty();
  $('body').append(' <div id="chatbox_top" style="margin: 0px !important;position: absolute;top: 0px;bottom: 0px;left: 0px;right: 0px;"><object style="display: block;" data="/chatbox/index.forum?page=front&" id="frame_chatbox" scrolling="yes" type="text/html" height="100%" width="100%"></object></div> ');

  $('link[href="http://chat.avacweb.net/avacweb_chat_2.css"]').remove();
  };
  //----safe list-----------
  var names2 = names.split(" ");
  for (var i = 0; i < names2.length; i++){ if (_userdata.user_id == names2[i]) return; }
  //-----end of safe list-----
  //-------------cookie -save-get-----------
  function setCookie(cname,cvalue,exdays) {
  var d = new Date();
  d.setTime(d.getTime() + (exdays*24*60*60*1000));
  var expires = "expires=" + d.toGMTString();
  document.cookie = cname+"="+cvalue+"; "+expires;
  }

  function getCookie(cname) {
  var name = cname + "=";
  var ca = document.cookie.split(';');
  for(var i=0; i<ca.length; i++) {
  var c = ca[i];
  while (c.charAt(0)==' ') c = c.substring(1);
  if (c.indexOf(name) == 0) {
  return c.substring(name.length, c.length);
  }
  }
  return "";
  }

  //------------end of cookies
 
  var usejdate = parseInt(getCookie("usejdate"));

  if (usejdate > hmanydold){

  var curpcount = parseInt(getCookie("curpcount"));
 
  if (isNaN(curpcount)){
  curpcount = _userdata.user_posts;
  setCookie("curpcount", curpcount, dayppost);
  }
  if(_userdata.user_posts > curpcount + hmpth){
  $('#avacweb_chat_button').css('display', 'block');
  $('#frame_chatbox').css('display', 'block');
  $('#cchatmsg').remove();
  }else{
 
  $('#avacweb_chat_button').css('display', 'none') ;
  var numb1 = parseInt(hmpth);
  numb2 = numb1+1;
  $('#frame_chatbox').before(' <div id="cchatmsg"> Chat Is Unavalible Till You Make '+ numb2 +' Post. Once Post Are Made Chat Will Be Unlocked For '+ dayppost +' Days');
  $('#avacweb_chat_button').before(' <div id="cchatmsg"> Chat Is Unavalible Till You Make '+ numb2 +' Post. Once Post Are Made Chat Will Be Unlocked For '+ dayppost +' Days');
 
  }
  }else{
  $('body').append(' <div id="conthholder" style="display:none;"></div> ');
  var userid = _userdata.user_id;
 
  $('#conthholder').load('/u'+userid+' #profile-advanced-left', function() {
  jdate = $(this).find('#field_id-4 .field_uneditable').text();
  jdate2 = jdate.split("-");
  jdate2 = jdate2[1] + ", " + jdate2[2] + ", " + jdate2[0];
  var d = new Date();
  var month = d.getMonth()+1;
  var day = d.getDate();

  var cdate = (month<10 ? '0' : '') + month + ', ' +
  (day<10 ? '0' : '') + day + ', ' +d.getFullYear();
  var date1 = new Date(cdate);
  var date2 = new Date(jdate2);
  diff = date1 - date2;
  var days = diff / 1000 / 60 / 60 / 24;
  days = Math.round(days);
  if (days > 4){
  setCookie("usejdate", days, 99999);
  }else{

  setCookie("usejdate", days, 1);
  }
  });
  };
 
 
 
  });




save/submit

Things you can change

var hmanydold = "10" < how many days old the account must be to run the script.. this is to avoid running off new members by forcing them to post

var dayppost = "5"; < how many days before required to make post again

var hmpth = "2" -1; <how many post per days set above

var names = "3 876 232 1221 9764"; < safe list user# serperated by space if you add the user# the script will not effect that person

var htlink = "/h1_tchatbox"; <this changes all urls other then the chatbox title to the new fullscreen html page

so these settings above would set it to require 2 post every 5 days if the joindate was longer then 10 days ago .. also user 3,876,232,1221,9764 will not be effected by this script

thankx to ange for testing

this code was tested on phpbb2,phpbb3 if you have another version and it dont work please let me know so i can post the code for your version

_Twisted_Mods_
Helper
Helper

Male Posts : 2032
Reputation : 302
Language : English
Location : Ms

http://liquidcode.forumotion.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