Current date/time is March 28th 2024, 16:25

Search found 2 matches for field_id2

Recent Status Update Widget like IPB

_Twisted_Mods_ wrote: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>


Hello all,
@_Twisted_Mods_ can we place all the codes into the widget code?
by Van-Helsing
on January 3rd 2015, 04:14
 
Search in: Garbage
Topic: Recent Status Update Widget like IPB
Replies: 87
Views: 5069

Recent Status Update Widget like IPB

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>
by _Twisted_Mods_
on January 3rd 2015, 01:36
 
Search in: Garbage
Topic: Recent Status Update Widget like IPB
Replies: 87
Views: 5069

Back to top

Jump to: