by _Twisted_Mods_ January 2nd 2015, 9:06 pm
this is the script for when you click the update button .. it grabs a list of users # from the post and removes the last one adds the user# of the user who clicked the button .. this is only for punbb because the elements are different in other versions
/t3-status-users = Â the post page that it gets used id's from
/post?p=4 = Â the post # for it to edit the post.. u can highlight edit post to get the post #
- Code:
jQuery(function(){
jQuery('.status-button').click(function(){
jQuery.get('/t3-status-users', function (data) {
      var groupz = {
        group1z: jQuery('.entry-content', data).text(),
};
ff = groupz.group1z;
gg = ff.split(' ');
mm="";
 for(var i = 0; i < 4; i++){
var hh = gg[i];
mm = mm  + " "+ hh;
}
 jQuery.post('/post?p=4&mode=editpost', {
 subject: 'Status Updates',
message: _userdata.user_id+mm,
post: 1
});
})
});
});
this is the code for the recent status update widget .. it grabs the list of user # from the post goes to each ones profile and gets their name,avatar, and status and attaches it to its holder
/t3-status-users = Â page it grabs the user ids from
#field_id2 = the profile field it grabs the status from
- Code:
<style>
/*-----ststusupdatewid--by-twisted------*/
.statsbox #statavatar {
  display: inline-block;
  width: 100%;
}
.statsbox {
  padding: 5px;
  margin-bottom: 2px;
  margin-top: 2px;
  border-radius: 5px;
  border: 1px solid #000;
Â
}
.statsbox #statavatar img {
  width: 30px;
  float: left;
}
.statsbox .h3 {
 background-color:white;
  border-radius: 5px;
  padding: 2px;
  border: 1px solid #000;
  display: inherit;
 width:110px;
 text-align: center;
}
/*-------------------------------------*/
</style>
<div id="supdate_widget">
</div><script>
jQuery(function(){
jQuery('#supdate_widget').empty();
jQuery.get('/t3-status-users', function (data) {
tpfieldid = '#field_id2:eq(0)';
      var group = {
        group1: jQuery('.entry-content', data).text(),
};
gg = "";
ff = group.group1;
gg = ff.split(' ');
nurl1 = '/u'+gg[0];
nurl2 = '/u'+gg[1];
nurl3 = '/u'+gg[2];
nurl4 = '/u'+gg[3];
nurl5 = '/u'+gg[4];
jQuery('#supdate_widget').append(' <div id="statusbox1" class="statsbox"><div id="statavatar"></div><div id="tstatus"></div></div> ');
jQuery('#supdate_widget').append(' <div id="statusbox2" class="statsbox"><div id="statavatar"></div><div id="tstatus"></div></div> ');
jQuery('#supdate_widget').append(' <div id="statusbox3" class="statsbox"><div id="statavatar"></div><div id="tstatus"></div></div> ');
jQuery('#supdate_widget').append(' <div id="statusbox4" class="statsbox"><div id="statavatar"></div><div id="tstatus"></div></div> ');
jQuery('#supdate_widget').append(' <div id="statusbox5" class="statsbox"><div id="statavatar"></div><div id="tstatus"></div></div> ');
Â
jQuery.get(nurl1, function (data) {
      var prof1 = {
       name1: jQuery('#profile-advanced-right .h3:eq(0)', data).parent().html().replace(/\(online\)/g,''),
avatar1: jQuery('#profile-advanced-right img:eq(0)', data).attr('src'),
status1: jQuery(tpfieldid, data).text(),
};
jQuery('#supdate_widget #statusbox1 #statavatar').prepend('<img src="'+prof1.avatar1+'">');
jQuery('#supdate_widget #statusbox1 #statavatar').append(prof1.name1);
jQuery('#supdate_widget #statusbox1 #tstatus').append(prof1.status1) ;
});
jQuery.get(nurl2, function (data) {
      var prof = {
       name: jQuery('#profile-advanced-right .h3:eq(0)', data).parent().html().replace(/\(online\)/g,''),
avatar: jQuery('#profile-advanced-right img:eq(0)', data).attr('src'),
status: jQuery(tpfieldid, data).text(),
};
jQuery('#supdate_widget #statusbox2 #statavatar').prepend('<img src="'+prof.avatar+'">');
jQuery('#supdate_widget #statusbox2 #statavatar').append(prof.name);
jQuery('#supdate_widget #statusbox2 #tstatus').append(prof.status) ;
});
 jQuery.get(nurl3, function (data) {
      var prof = {
       name: jQuery('#profile-advanced-right .h3:eq(0)', data).parent().html().replace(/\(online\)/g,''),
avatar: jQuery('#profile-advanced-right img:eq(0)', data).attr('src'),
status: jQuery(tpfieldid, data).text(),
}
jQuery('#supdate_widget #statusbox3 #statavatar').prepend('<img src="'+prof.avatar+'">');
jQuery('#supdate_widget #statusbox3 #statavatar').append(prof.name);
jQuery('#supdate_widget #statusbox3 #tstatus').append(prof.status) ;
});
 jQuery.get(nurl4, function (data) {
      var prof = {
       name: jQuery('#profile-advanced-right .h3:eq(0)', data).parent().html().replace(/\(online\)/g,''),
avatar: jQuery('#profile-advanced-right img:eq(0)', data).attr('src'),
status: jQuery(tpfieldid, data).text(),
}
jQuery('#supdate_widget #statusbox4 #statavatar').prepend('<img src="'+prof.avatar+'">');
jQuery('#supdate_widget #statusbox4 #statavatar').append(prof.name);
jQuery('#supdate_widget #statusbox4 #tstatus').append(prof.status) ;
});
 jQuery.get(nurl5, function (data) {
      var prof = {
       name: jQuery('#profile-advanced-right .h3:eq(0)', data).parent().html().replace(/\(online\)/g,''),
avatar: jQuery('#profile-advanced-right img:eq(0)', data).attr('src'),
status: jQuery(tpfieldid, data).text(),
}
jQuery('#supdate_widget #statusbox5 #statavatar').prepend('<img src="'+prof.avatar+'">');
jQuery('#supdate_widget #statusbox5 #statavatar').append(prof.name);
jQuery('#supdate_widget #statusbox5 #tstatus').append(prof.status) ;
});
});
});
</script>