FM Design
Would you like to react to this message? Create an account in a few clicks or log in to continue.

IMPORTANT

FM Design is in read-only mode, please click here for more information.

Latest topics
» Forumactif Edge - Releases
by Ange Tuteur Tue 03 Sep 2019, 11:49

» GIFActif - Giphy Button for the Editor
by Ange Tuteur Wed 08 May 2019, 17:21

» Forum Closure
by Ange Tuteur Mon 01 Jan 2018, 01:28

» Chit Chat Thread
by Valoish Sun 31 Dec 2017, 19:15

» Font/Text background color.
by Valoish Sun 31 Dec 2017, 19:11

» Forumactif Messenger - Instant Message Application for Forumotion
by Wolfuryo Sun 31 Dec 2017, 18:24

» [GAME] Count to One Million!
by brandon_g Fri 29 Dec 2017, 18:58

» Post Cards
by manikbiradar Wed 20 Dec 2017, 07:50

» [GAME] Countdown from 200,000
by Valoish Wed 13 Dec 2017, 23:22

» GeekPolice Tech Support Forums - GeekPolice.net
by Dr Jay Mon 11 Dec 2017, 19:12

» Asking about some plugin for Forumotion
by Dr Jay Mon 11 Dec 2017, 19:10

» [GAME] What are you thinking right now?
by Van-Helsing Sat 09 Dec 2017, 14:51

» Widget : Similar topics
by ranbac Wed 06 Dec 2017, 18:11

» Change the Background of the Forum and put an image and how to make prefixs?
by Clement Wed 06 Dec 2017, 15:19

» Hello from Western Australia
by SarkZKalie Wed 06 Dec 2017, 05:34

Recent Tutorials
Top posting users this month

Who is online?
In total there are 23 users online :: 0 Registered, 0 Hidden and 23 Guests :: 1 Bot

None

[ View the whole list ]


Most users ever online was 515 on Tue 14 Sep 2021, 15:24

Code subsitute for Foe feature.

Page 1 of 2 1, 2  Next

View previous topic View next topic Go down

brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Sat 24 Jan 2015, 14:53

Hello,

I was wondering if it is possible for someone to develop a code that could do the same thing as the 'Foe' feature except that a moderator can block another moderator. I know it sounds conflicting but I have a predicament where 2 of my Moderators would actually work better if one of them could not see the others post. It really help a bunch. Even if it is hiding the one moderators post would be helpful.

I hope this is possible,
Thanks in advance,
-Brandon
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sat 24 Jan 2015, 17:28

That would be possible by setting permissions for a certain user via javascript. It's just that it could cause some problems on your board. Personally, I'd insist that you ask the two moderators to sit down and work out their differences in a calm environment, because it wouldn't make sense to have a team which cannot work together..

Now, are you absolutely sure you want this ?
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Sat 24 Jan 2015, 20:18

Question, does it work for those 2 users specifically or the whole board?

And sitting down for a therapy hour is not going to work, these 2 are brothers, they both good people, they just disagree on things. I have tried everything in the book just shy of this.

If this work they will be able to work as a team, because I know both of them personally and I can serve as relay man.

If it only applies to those members only then yes I am absolutely sure I want to yes.

Thanks,

-Brandon
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sat 24 Jan 2015, 21:00

Okie dokie,

Go to Administration Panel > Modules > JavaScript codes management > Create a new script

Title : Your choice
Placement : In the topics
Paste the code below :
Code:
$(function() {
  filter({
    for_user : 1,
    hide_who : [2]
  });
 
  function filter(o) {
    for (var i=0,bb2; i<o.hide_who.length; i++) {
      $('.bodyline').length ? bb2 = ',.post:has(.name a[href="/u'+o.hide_who[i]+'"]) + tr': '';
      $('.post:has(.name a[href="/u'+o.hide_who[i]+'"])' + bb2).hide();
    }
  }
});

I have an example in the code above :
Code:
  filter({
    for_user : 1,
    hide_who : [2]
  });

You can repaste this as much as you want in the code above, just make sure it's after the current. You need to change the values for certain users.

for_user : the id of the user the filter will apply to
hide_who : the id of the users whose posts will be hidden. You can add as many users as you want just make sure they're separated by a comma. e.g. [1,2,3,4,5,6]

To find the user ID just go to their profile and look at the URL. You should see /u followed by a number. The number is their ID.
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Sat 24 Jan 2015, 21:10

Hello Ange,

Than You for the assistance. I have added the code, I will contact my Moderator now to see if it worked. Please stand by.

Smile
-Brandon


EDIT: Shoot! They went out again and left their pcs on. You can leave if you want Ange. I will get back to you with the results when they get back.

Thank You again for the help Ange!

-Brandon
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sat 24 Jan 2015, 21:44

Okay, no problem. If you have any questions, just let me know. Smile
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Sat 24 Jan 2015, 22:31

Hello Ange it is working, I have 1 problem though... I cannot see his posts ethier... any ideas?

Thanks Brandon


EDIT: Never mind Ange I forget to remove the comma, must have thought it was for everyone. I have removed the comma and the issue now resolved!

Thanks again Ange for his code
You are a real life saver! My mod is excited top. Smile

-Brandon

I will ask for this to be left open, jusr in case!
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sat 24 Jan 2015, 22:39

You're welcome Mr. Green

Did you keep the default filter in the script ?
Code:
  filter({
    for_user : 1,
    hide_who : [2]
  });

If so, you can remove it.
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Sat 24 Jan 2015, 22:57

I removed the comma after the number. It appears to have fixed problem! My mod no longer sees the other,ones posts and Everyone else can still see!

You are an Admin's super hero Ange!
You just saved me the trouble of creating an internal affairs unit! lol!

Thanks again,
-Brandon
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sat 24 Jan 2015, 23:15

LOL you're welcome. Angel

The only thing is you have to do it manually, but I don't think that's a problem for you, since it was only for those two. Razz
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Sat 24 Jan 2015, 23:21

It is better then foe system too, because if they needmto communicate via pm for any mod related issues they still can.

You are making me too happy Ange, I may have to climb up those PA mountains and kidnap you are so good (just kidding of coursr). Razz Laughing Very Happy
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sat 24 Jan 2015, 23:40

Oh yeah, you're right. I didn't think of that. reflect

LOL you can take me for a day, but after that I have to get back to work and studying. I can do a lot in a day Razz
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Sat 24 Jan 2015, 23:46

Ange Tuteur wrote:Oh yeah, you're right. I didn't think of that. reflect

LOL you can take me for a day, but after that I have to get back to work and studying. I can do a lot in a day Razz

I will be sure to bring my tablet so you can try some tablet surfing! lol!


ROFL ROFLMAO cracked myself up thereL
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sat 24 Jan 2015, 23:49

Ooooh we're going to go to the beach and use the tablet as a surf board !? Very Happy

Nevermind, it's too cold to go to the beach. Sad
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Sat 24 Jan 2015, 23:52

No it is too expensive for that! I meant web surfing!

And yes it is too cold!
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Sun 25 Jan 2015, 00:01

hehe I know, I was being silly ! Mr. Green
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Sun 25 Jan 2015, 00:02

I know!
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Mon 26 Jan 2015, 23:38

Do you have anymore questions on this script before I archive the topic ? Smile
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Tue 27 Jan 2015, 20:34

Nope it appears to working like a charm, for future reference though, say I wanted to add someone else to it, how do I that and you said I could more then 1 person right?


Last edited by brandon_g on Sun 08 Feb 2015, 15:51; edited 1 time in total
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Tue 27 Jan 2015, 20:39

To add a new filter for another member, simply copy and paste a new filter after your existing filters.

filter({

  • for_user : 1, <= this is the ID of the user the filter is for
  • hide_who : [2] <= this is the list of members whose posts you want to hide for the user
});

You separate multiple users by a comma :
hide_who : [2,3,4,5,6,7,8,9,10]

That's a lot of people u1 doesn't like, huh ? Oh wait.. lol!
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Tue 27 Jan 2015, 20:41

His whole forum will be invisible haha. Thanks Ange for the clarification. Smile
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Tue 27 Jan 2015, 21:07

You're welcome Mr. Green
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Wed 28 Jan 2015, 20:43

Hello Ange,

I have a problem...

So the code you gave me works, but it prevents me from seeing it as well, if I remove the comma my mod can't see it but I don't either, is there a way to fix this? I will provide the code in a moment.

EDIT: Here is the current code I have in the ACP JavaScript:

Code:
$(function() {
 filter({
   for_user : 54,
   hide_who : [24]
 });
 
 function filter(o) {
   for (var i=0,bb2; i<o.hide_who.length; i++) {
     $('.bodyline').length ? bb2 = ',.post:has(.name a[href="/u'+o.hide_who[i]+'"]) + tr': '';
     $('.post:has(.name a[href="/u'+o.hide_who[i]+'"])' + bb2).hide();
   }
 }
});

I suspect this little piggy to be the culprit:

for_user : 54,


Last edited by brandon_g on Sun 08 Feb 2015, 15:50; edited 1 time in total
Ange Tuteur
Ange Tuteur
Administrator
Gender : Male
Posts : 4741
Points : 12254
Reputation : 2376
Location : Pennsylvania
Language : EN, JA, FR
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
https://sethclydesdale.github.io/ https://twitter.com/sethc1995

PostAnge Tuteur Wed 28 Jan 2015, 21:10

Uhhh you're not going to believe this, but I, uh, forgot to put a condition for the user. This hiding of posts was visible to all.. lol!

Try now :
Code:
$(function() {
 filter({
  for_user : 54,
  hide_who : [24]
 });
 
 function filter(o) {
  if (o.for_user != _userdata.user_id) return;
  for (var i=0,bb2; i<o.hide_who.length; i++) {
    $('.bodyline').length ? bb2 = ',.post:has(.name a[href="/u'+o.hide_who[i]+'"]) + tr': '';
    $('.post:has(.name a[href="/u'+o.hide_who[i]+'"])' + bb2).hide();
  }
 }
});

I forgot to add : if (o.for_user != _userdata.user_id) return;
brandon_g
brandon_g

Gender : Unspecified
Age : 27
Posts : 458
Points : 4287
Reputation : 67
Location : USA
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : phpBB2
http://broadcastingduo.forumotion.com

Postbrandon_g Wed 28 Jan 2015, 21:16

Ahhh it is alright Ange, we all make mistakes, I figured you might have left something out anyway.


EDIT: That appears to have fixed the problem, I can see his posts now and my cant. Thanks a bunch Ange!

Smile


Last edited by brandon_g on Wed 28 Jan 2015, 21:23; edited 1 time in total
Sponsored content

PostSponsored content

Page 1 of 2 1, 2  Next

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

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