inherit
256020
0
Jan 16, 2019 10:19:58 GMT -8
stuffneedstobedone
6
August 2018
stuffneedstobedone
|
Post by stuffneedstobedone on Nov 17, 2018 13:47:18 GMT -8
I have this plugin, that I use in my community for a certain group of users, but right now it's only available for user 1 with the name "@ admin" (me), I don't seem to get it to work on more than just one person. Any ideas?
function adminhtml(){
for( var x=0;x<$('div.message').length;x++){
if(/\[html\]/i.test($('div.message').eq(x).html()) && $('.mini-profile').eq(x).find("a.user-link.user-1").attr("title")=="@admin"){
var lrep=new RegExp("&"+"lt;","gi");
var rrep=new RegExp("&"+"gt;","gi");
var newhtml=$('div.message').eq(x).html();
newhtml=newhtml.replace(/\[html\]/gi,"").replace(lrep,"<").replace(rrep,">");
$('div.message').eq(x).html(newhtml);
};
};
};
$(document).ready(function() {
if(proboards.data('route').name=="thread" || proboards.data('route').name=="all_recent_posts" || proboards.data('route').name == "permalink"){
adminhtml();
proboards.on('pageChange', function() { adminhtml(); });
}
});
For anyone seeing what I mean to achieve with this code, yes I know its dangers, but I am a 100% certain my forum will be safe.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,285
January 2004
todge
|
Post by Todge on Nov 18, 2018 16:52:44 GMT -8
The part of the code that is restricting it to the main admin is this part... if(/\[html\]/i.test($('div.message').eq(x).html()) && $('.mini-profile').eq(x).find("a.user-link.user-1").attr("title")=="@admin "){ Simply removing the red part should be enough to make it available to all users.
|
|
inherit
256020
0
Jan 16, 2019 10:19:58 GMT -8
stuffneedstobedone
6
August 2018
stuffneedstobedone
|
Post by stuffneedstobedone on Nov 19, 2018 0:19:24 GMT -8
Thanks! It worked
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,285
January 2004
todge
|
Post by Todge on Nov 19, 2018 13:01:15 GMT -8
No worries...
|
|