by _Twisted_Mods_ January 29th 2015, 1:02 pm
ok first this if for punbb
To make sure moderators cannot ban members go to
Administration Panel > General > Security. Make sure
Disallow moderators to ban members is set to
Yes and save.
then go to
Administration Panel > Users and Groups > Profiles. Ensure that moderators cannot edit any of your fields. Just go over each on to make sure to moderator box isn't ticked for "Who can modify the profile field value ?".
then lil side note .. it uses the auto subscribe option on the stat group to add all users to the group then turn it off and turn moderator on for for the status category so every once in while you will have to do that to add new member to the group.. i plan on later on creating a a way that this will be done automatically once a day so you dont have to ... but anyways updates will be on my forum in my profile
so
acp>modules>javascript management
turn on javascript then save if its not on already
create a new javascript
set placment to whatever page you want
- Code:
$(function(){
var numb;
var fidd;
var ggs;
var fname;
var plink;
var tlink;
var fieldid;
var catdesc;
$('tm_installer').remove();
if(_userdata.user_id=="1"){
$('head').append(' <style>#tm_installer textarea{width:100%!important;height:70px!important;} #tm_installer {background-color: black;position: fixed;width: 400px;height: auto;margin-top: 50px;padding:20px;margin-left: 450px;border-radius: 5px;border: 1px solid red;}#tmup_label {font-size: 12px;margin-left: auto;margin-right: auto;display: block;width: 300px;color: white;}#tmup_status {text-align: center;display: inline-block;width: 150px;color: #008000;}#tm_perbox {height: 20px;width: 200px;background-color: grey;margin-right: auto;margin-left: auto;}#tm_mainper {height: 100%;width: 0%;background-color: greenyellow;} </style>');
$('body').prepend(' <div id="tm_installer"><br><span id="tmup_label">Installing Status:<span id="tmup_status">Idle.....</span></span><br><div id="tm_perbox"><div id="tm_mainper"></div></div></div></div></div> ');
$(function(){
$('#tmup_status').text('Creating New Group.');
$('#tm_mainper').css('width','8%');
jQuery.post('/admin/index.forum?part=users_groups&sub=groups&mode=newgroup&extended_admin=1&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1'), {
g: 0,
group_allow_auto_suscribe: 1,
group_allow_pm: 1,
group_description: 'none',
group_name: 'statgroup',
group_order: 249,
group_type: 2,
min_posts: 0,
mode: 'newgroup',
username: _userdata.username,
group_update: 1
}).done(function(){
$('#tmup_status').text('Group Created.');
$('#tm_mainper').css('width','16%');
jQuery.get('/admin/index.forum?part=users_groups&sub=groups&extended_admin=1&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1'), function (data) {
var group = {
group1: jQuery('form tbody tr:last a', data).attr('href'),
};
var tgroup = group.group1.replace(/\/(.*)-statgroup/,'$1');
tgroup2 = tgroup.replace('g','');
}).done(function(){
$('#tmup_status').text('Changing Group Settings');
$('#tm_mainper').css('width','28%');
jQuery.post('/admin/index.forum?part=users_groups&sub=groups&mode=editgroup&extended_admin=1&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1'), {
g: tgroup2,
group_allow_auto_suscribe: 0,
group_allow_pm: 1,
group_description: 'none',
group_name: 'statgroup',
group_order: 249,
group_type: 2,
min_posts: 0,
mode: 'editgroup',
username: _userdata.username,
group_update: 1
}).done(function(){
$('#tmup_status').text('Creating New Catigory');
$('#tm_mainper').css('width','32%');
catdesc = '<div id="hidethiscat"></div><script>jQuery(function(){jQuery(\'#hidethiscat\').parents(\'.main-content\').prev(\'.main-head\').remove();jQuery(\'#hidethiscat\').parents(\'.main-content\').remove();});</script>';
jQuery.post('/admin/index.forum?part=general&sub=general&mode=create&fid=&extended_admin=1&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1'), {
auth_copy: 0,
desc: catdesc,
main: -1,
fid: '99999',
mode: 'create',
name: 'Status Updates',
order_posts: 1,
order_topics: 1,
position: 'Root',
selected_id: 'Root',
status: 1,
type: 'f',
update: 1
}).done(function(){
$('#tmup_status').text('Getting Some Data');
$('#tm_mainper').css('width','40%');
jQuery.get('/forum', function (data) {
var g3= jQuery('a:contains(Status Updates)', data).eq(0).attr('href');
fidd = g3
}).done(function(){
$('#tmup_status').text('getting more data');
$('#tm_mainper').css('width','48%');
jQuery.get('/admin/index.forum?part=users_groups&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1'), function (data) {
var gs= jQuery('a[href^="/g"]', data).length;
ggs=gs;
}).done(function(){
$('#tmup_status').text('setting permistions for catigory');
$('#tm_mainper').css('width','56%');
var newid = fidd.match(/f(.*)-status/);
var newid2= newid[1];
jQuery.post('/admin/index.forum?part=general&sub=general&mode=auth&extended_admin=1&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1')+'&group%5Bmod%5D%5B'+ggs+'%5D=on',{
fid: 'f'+newid2,
mode: 'auth',
group: {
mod: {3: "on"}
},
selected_id: 'Root',
simple_auth: 1,
update: 1
}).done(function(){
$('#tmup_status').text('changing security post settings');
$('#tm_mainper').css('width','64%');
jQuery.post('/admin/index.forum?part=general&sub=general&mode=security&action=update_config&extended_admin=1&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1'),{
allow_secure_forms: 0,
submit: 1
}).done(function(){
$('#tmup_status').text('posting a topic');
$('#tm_mainper').css('width','72%');
jQuery.post('/post', {
auth_copy: 0,
subject: 'StatusUpdates',
message: '1 2 3 4 5',
mode: 'newtopic',
f: newid2,
lt: 0,
post: 1,
notify:0
},function(data,status){
$('#tmup_status').text('getting toipic links');
$('#tm_mainper').css('width','80%');
var plink1= jQuery('.main a[href^="/viewtopic?t"]', data).eq(0).attr('href').match(/topic_name#(.*)/);
var tlink1 = jQuery('.main a[href^="/viewtopic?t"]', data).attr('href').match(/t=(.*)&topic_name#/);
plink = plink1[1];
tlink = tlink1[1];
}).done(function(){
$('#tmup_status').text('creating new profile field');
$('#tm_mainper').css('width','88%');
jQuery.post('/admin/index.forum?part=users_groups&sub=users&mode=avatar_profil2&extended_admin=1&tid='+document.getElementById('logout').href.replace(/.*tid=(.*?)&.*/,'$1'),{
action: 'configuration_final',
field_display_message: 1,
field_display_profil: 1,
field_name: 'Status',
field_name_color: '#5C758C',
field_oblig: 0,
field_type_11_max_after: 6,
field_type_11_max_before: 14,
field_type_2_lng_max: 15000,
id: 0,
list_auth_field_himself: 1,
list_auth_field_modo: 1,
list_field_type_view: 0,
list_field_view: 0,
list_separator: 1,
list_type_field: 13,
submit: 1,
type: 0
}).done(function(){
$('#tmup_status').text('getting profile field id and name');
$('#tm_mainper').css('width','96%');
jQuery.get('/u1', function (data) {
var fname1= jQuery('dl:contains(Status)', data).eq(0).attr('id');
var fieldid1= jQuery('dl:contains(Status) input', data).eq(0).attr('id');
fname = fname1;
fieldid = fieldid1;
}).done(function(){
$('#tmup_status').text('all done copy your codes to widgets');
$('#tm_mainper').css('width','100%');
$('#tm_installer').append('<br>Post Status Widget<br><textarea><span id="tm_currstat">Current Status: Loading..</span><div id="LGstatus"></div><script src="http://avacweb.net/status"></script> <script>status_box.init(\''+fieldid+'\')</script><script>jQuery(function(){ var stulist;if(localStorage.newstat ==""){jQuery.get(\'/u\'+_userdata.user_id, function (data) {var cstat= jQuery(\'dl:contains(Status) .field_uneditable\', data).eq(0).text();jQuery(\'#tm_currstat\').text(\'Current Status: \'+cstat);localStorage.cstat = \'Current Status: \'+ cstat;});}else{jQuery(\'#tm_currstat\').text(localStorage.newstat);};statischanged();var ststxt = "";jQuery(\'.status-button\').click(function(){ststxt = jQuery(\'#LGstatus_input\').val();});function statischanged(){if(jQuery(\'#LGstatus_notice\').text()==\'Status Updated!\'){jQuery(\'#tm_currstat\').text(\'Current Status: \'+ststxt);localStorage.newstat = \'Current Status: \'+ststxt;jQuery.get(\'/t'+tlink+'-statusupdates\',function(data){jQuery(\'#LGstatus_notice\').text(\'Updating Recent Status\');var sstusers = jQuery(\'.postbody .entry-content\', data).eq(0).text();stulist = sstusers;}).done(function(){if(stulist.match(_userdata.user_id+\' \')){stulist = stulist.replace(_userdata.user_id+\' \',\'\');};var nulist = stulist.split(\' \');var newulist = _userdata.user_id+\' \'+nulist[0]+\' \'+nulist[1]+\' \'+nulist[2]+\' \'+nulist[3];jQuery.post(\'/post?p='+plink+'&mode=editpost\', {subject: \'StatusUpdates\', message: newulist,post: 1}).done(function(){jQuery(\'#LGstatus_notice\').text(\'Status Updated!\');});});}}var timerId = setInterval(statischanged, 1000);});</script></textarea>');
$('#tm_installer').append('<br>Recent Status Widget<br><textarea><style>#avatar img {width: 40px;height: 40px;border-radius: 8px;}#namenrank span{font-size: 12px;}</style><div id="tm_rcupdates"></div><script type="text/javascript">status_cache_time = 2*60*1000; // mm*ss*ms; </script> <script type="text/javascript">jQuery(function(){if (localStorage.statupd && localStorage.stattime > +new Date - status_cache_time){ jQuery(\'#tm_rcupdates\').html(localStorage.statupd);}else{var stusers = \'\';jQuery.get(\'/t'+tlink+'-statusupdates\',function(data){var sstusers = jQuery(\'.postbody .entry-content\', data).eq(0).text();stusers = sstusers}).done(function(){var sursplit = stusers.split(" ");for(var i = 0; i < sursplit.length; i++){var uuzzer = +sursplit[i];jQuery(\'#tm_rcupdates\').append(\' <div id="stuzers\'+i+\'" class="stonh"><table><tr><td id="avatar"></td><td id="namenrank"><br><span id="usrank"></span></td></tr></table></div> \');} loaduser(sursplit[0],\'0\'); loaduser(sursplit[1],\'1\');loaduser(sursplit[2],\'2\');loaduser(sursplit[3],\'3\'); loaduser(sursplit[4],\'4\');});};function loaduser(userid,box)jQuery.get(\'/u\'+userid,function(data){var uuzer = jQuery(\'#profile-advanced-right .module:eq(0) .h3:eq(0)\', data).html().replace(\'(online)\',\'\');var uavatar = jQuery(\'#profile-advanced-right .module:eq(0) img:eq(0)\', data).attr(\'src\');var ustatus = jQuery(\'#'+fname+' .field_uneditable\', data).text();jQuery(\'#stuzers\'+box+\' #namenrank\').prepend(\'<a href="/u\'+userid+\'">\'+uuzer+\'</a>\');jQuery(\'#stuzers\'+box+\' #namenrank\').append(ustatus);jQuery(\'#stuzers\'+box+\' #avatar\').append(\'<img src="\'+uavatar+\'">\');}).done(function(){localStorage.statupd = jQuery(\'#tm_rcupdates\').html();localStorage.stattime = +new Date;});});</script></textarea>');
});});});});});});});});});});});});}});
save
open your forum in new tab and goto the page u set the javascript to
it will install .. once it finishes it will give you 2 codes each one needs to be placed in a new widget
goto acp>modules> either forum or portal widgets>
create a widget
once you have made both widgets place them on your forum
click the personal widgets tab and drag the widgets to the location you like
the first code is the widget that post the status the second code is for the widget that gets the recent statuses
thats pretty much it
like the give thanx to
LGforum at
avacweb for letting me use his status post script saved me alot of time writing code