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.
The forum of the forums
3 posters

    Recent Status Update Widget like IPB is not working correctly

    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing January 18th 2015, 1:56 am

    First topic message reminder :

    Hello,
    I am facing problem with status update widget with a previous post https://help.forumotion.com/t137865p60-recent-status-update-widget-like-ipb#933777, the members cannot update their status in widget only the staff members can update their profiles the statuses normally.

    I am using the following widget code:
    Code:


            <style>
            /*-----ststusupdatewid--by-twisted------*/
            .statsbox #statavatar {

                display: inline-block;
                width: 100%;
            }
            .statsbox {
                color: darkgray;
                padding: 5px;
                margin-bottom: 2px;
                margin-top: 2px;
                border-radius: 4px;
                border: 1px solid #EBF0F3;
                background: transparent;
            }
            .statsbox #statavatar img {
                width: 35px;
                height: 35px;
                float: left;
                border: 1px solid whitesmoke;
                border-radius: 4px;
            }
            .statsbox .h3 {
              /*background-color:white;*/
                border-radius: 5px;
                padding: 2px;
              /* border: 1px solid #000;*/
                display: inherit;
              width:110px;
              text-align: left;
            }
            /*-------------------------------------*/
            </style>   
        <div id="supdate_widget">
        </div><script>

            jQuery(function(){
            jQuery('#supdate_widget').empty();
            jQuery.get('/t15831-topic', function (data) {
                tpfieldid = '#field_id5: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>


    Last edited by Black-Shadow on February 15th 2015, 8:50 pm; edited 1 time in total
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing January 30th 2015, 1:29 am

    Ok i have done both 2 changes.
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by _Twisted_Mods_ January 30th 2015, 1:53 am

    ok some bug i guess is with ur languge hopfuly this fixes it


    Code:
    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('/t15831-topic',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 newulist1 = _userdata.user_id+' '+nulist[0]+' '+nulist[1]+' '+nulist[2]+' '+nulist[3]; var newulist2 = newulist1.replace('+-----',''); jQuery.post('/post?p=20047&mode=editpost', {subject: 'StatusUpdates', message: newulist2,post: 1}).done(function(){jQuery('#LGstatus_notice').text('Status Updated.');});});}}var timerId = setInterval(statischanged, 1000);});
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing January 30th 2015, 1:59 am

    Thank you very much @_Twisted_Mods_ for your time, now the only problem is the widget which not working in google chrome and safari browsers.
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing January 31st 2015, 9:04 am

    Hello @_Twisted_Mods_,
    I watched that while testing these codes, there is a vulnerability issue which is that is displaying some moderation tools/functions to the simple members. Is there a way to stay the forum secure without displaying these tools/functions to members?
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by _Twisted_Mods_ January 31st 2015, 7:55 pm

    they should only see mod permissions in profiles and in that topic witch that topic is hidden.. and on my first post with the script tells you a few things you need to change
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing January 31st 2015, 9:53 pm

    Hello @_Twisted_Mods_ ,
    How can I protect the other javascripts/codes from this kind of moderators?It sounds very hard job.Sad
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by _Twisted_Mods_ February 1st 2015, 12:01 pm

    little lost on what your referring to
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing February 1st 2015, 5:43 pm

    Hello @_Twisted_Mods_,
    Is there a way to fix this security vulnerability?
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by _Twisted_Mods_ February 1st 2015, 7:31 pm

    what all security needs to be fixed? give me a list of all the issues
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing February 2nd 2015, 1:15 am

    Hello @_Twisted_Mods_,
    Look I have some moderation tools in different points on my forum, due the moderation permissions to all those tools are visible to everyone member which is login in the forum.

    Here is a short list:
    1. Quick Moderation Tool (Inside topics)
    2. Quick Moderation Tool (Topic List Box)
    3. Quick Ban Tool
    4. Some staff widgets (1-2 widgets)
    5. Staff BBCodes Button for replies
    6. Staff Posts (Different Background for Staff Members)
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by _Twisted_Mods_ February 2nd 2015, 3:44 am

    i could fix these

    Quick Moderation Tool (Inside topics)
    2. Quick Moderation Tool (Topic List Box)
    3. Quick Ban Tool

    but as for rest ur forums not in English so sorry but im not even gonna attempt to mess with it
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing February 2nd 2015, 3:05 pm

    Hello @_Twisted_Mods_,
    Is there a javascript function to control the moderators user rank? I need a javascript function to control them and disable some javascripts for this rank of members.
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by _Twisted_Mods_ February 2nd 2015, 3:17 pm

    you can add this to top of your JavaScript under $(function(){ at the beginning of the script
    i didnt test it but should work to disable script for users not in the authusers list

    Code:
    authusers = ['1','2','3'];
    var t = "";
    for(i=0;i<authusers.length;i++){
    if(_userdata.user_id==authusers[i]){
    t = "yes";
    };
    if(t=='yes'){}else{return;};
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing February 7th 2015, 1:55 pm

    _Twisted_Mods_ wrote:you can add this to top of your JavaScript under $(function(){ at the beginning of the script
    i didnt test it but should work to disable script for users not in the authusers list

    Code:
    authusers = ['1','2','3'];
    var t = "";
    for(i=0;i<authusers.length;i++){
    if(_userdata.user_id==authusers[i]){
    t = "yes";
    };
    if(t=='yes'){}else{return;};

    Hello @_Twisted_Mods_,
    This function must I added both in the widget and js code and modify the user-id numbers?
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by _Twisted_Mods_ February 7th 2015, 6:01 pm

    you can add that to any script that you have that you don't want members to be able to use that are not on the list

    basically it checks the llist if that persons userid# isnt on the list it stop the script from running
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by _Twisted_Mods_ February 15th 2015, 8:23 pm

    @Black-Shadow has this issue been solved?
    Van-Helsing
    Van-Helsing
    Hyperactive


    Male Posts : 2431
    Reputation : 116
    Language : English, Greek

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by Van-Helsing February 15th 2015, 8:49 pm

    Hello @_Twisted_Mods_,
    Yes I its solved.
    _Twisted_Mods_
    _Twisted_Mods_
    Helper
    Helper


    Male Posts : 2083
    Reputation : 336
    Language : English
    Location : Ms

    Solved Re: Recent Status Update Widget like IPB is not working correctly

    Post by _Twisted_Mods_ February 15th 2015, 8:51 pm

    Topic solved and archived

      Current date/time is November 13th 2024, 7:18 pm