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.

Recent Status Update Widget like IPB is not working correctly

Page 3 of 3 Previous  1, 2, 3

View previous topic View next topic Go down

Solved Recent Status Update Widget like IPB is not working correctly

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

First topic message reminder :

Hello,
I am facing problem with status update widget with a previous post http://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
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down


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

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

Ok i have done both 2 changes.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

Post by _Twisted_Mods_ on 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);});

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

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

Post by Van-Helsing on 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
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

Post by Van-Helsing on 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?

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

Post by _Twisted_Mods_ on 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

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

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

Post by Van-Helsing on 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

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

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

little lost on what your referring to

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

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

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

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

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

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

what all security needs to be fixed? give me a list of all the issues

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

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

Post by Van-Helsing on 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)

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

Post by _Twisted_Mods_ on 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

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

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

Post by Van-Helsing on 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.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

Post by _Twisted_Mods_ on 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;};

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

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

Post by Van-Helsing on 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?

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

Post by _Twisted_Mods_ on 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_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

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

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

@Black-Shadow has this issue been solved?

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

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

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

Hello @_Twisted_Mods_,
Yes I its solved.

Van-Helsing
Hyperactive

Male Posts : 2198
Reputation : 82
Language : English, Greek

http://helpgr.forumgreek.com/

Back to top Go down

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

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

Topic solved and archived

_Twisted_Mods_
Helper
Helper

Male Posts : 2020
Reputation : 299
Language : English
Location : Ms

http://liquidcode.forumotion.com

Back to top Go down

Page 3 of 3 Previous  1, 2, 3

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum