Recent Tutorials
Who is online?
In total there are 7 users online :: 2 Registered, 0 Hidden and 5 Guests

djblah, SLGray

[ View the whole list ]


Most users ever online was 172 on Fri 19 Feb 2016, 05:17

[SUGGESTION] An @"ALL" script to mention each and every member

View previous topic View next topic Go down

avatar
Guest
Guest
View all awards

PostGuest on Sat 17 Dec 2016, 12:52

Hey! @Ange Tuteur,

We'd like to ask for an @"ALL" script for the admins to be able to mention everyone personally so they WILL get a certain message. Like "Read this before continuing..".

Thanks for looking into this and your time,

Regards,

Hello @Samantha NL (On behalf of @Prometheus).


Last edited by Samantha NL on Mon 19 Dec 2016, 13:56; edited 1 time in total
avatar
SLGray
Valued Member
Title :
Owner of 2 Forums
Gender : Male
Age : 44
Posts : 2398
Points : 4613
Reputation : 282
Location : United States
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : ModernBB
Awards :
View all awards
View user profile http://www.fmthemes.forumotion.com https://www.facebook.com/FM-Themes-655055824604957 https://twitter.com/FMThemes https://pinterest.com/FMThemes

PostSLGray on Sat 17 Dec 2016, 16:31

Do you mean something like this:
Code:
@{USERNAME}
avatar
Guest
Guest
View all awards

PostGuest on Sun 18 Dec 2016, 15:22

@SLGray wrote:Do you mean something like this:
Code:
@{USERNAME}

That would most likely not push out any notifications, just mentions. But if so that 'd expose a serious security leak @ FM and it should be a reason to have it blocked immediately being used by regular members. That sort of codes should be available to admins only, and that's exactly what I asked for.
avatar
SLGray
Valued Member
Title :
Owner of 2 Forums
Gender : Male
Age : 44
Posts : 2398
Points : 4613
Reputation : 282
Location : United States
Language : English
Browser : Browser : Mozilla Firefox Forum Version : Forum Version : ModernBB
Awards :
View all awards
View user profile http://www.fmthemes.forumotion.com https://www.facebook.com/FM-Themes-655055824604957 https://twitter.com/FMThemes https://pinterest.com/FMThemes

PostSLGray on Sun 18 Dec 2016, 17:10

Do you mean this:
Code:
{USERNAME}

It is one of the variables that appears in most lists that members can use on most sites.
avatar
Guest
Guest
View all awards

PostGuest on Sun 18 Dec 2016, 21:45

oh nvm. I guess it's just too complicated, if not technically impossible, what I'm asking for. @Ange Tuteur pls garbage the idea. ty.
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4675
Points : 9689
Reputation : 2331
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Mon 19 Dec 2016, 12:30

Hmm.. this should be possible. Awhile back I found a useful way to get all the members names using this page :
http://fmdesign.forumotion.com/search?mode=searchuser&fieldname=username&search_username=*

Thing is, it returns ALL members that are on the board, so if you have A LOT ( like THOUSANDS ) of members this page might become a bit unstable, nonetheless it should come in handy for this instance. Go to Admin Panel > Modules > JS Codes mangagement and create a new script

Title : Tag All
Placement : In all the pages
Code:
$(function() {
  if (_userdata.user_level == 1 && $.sceditor && toolbar) {
    var tagAll = function() {
      var editor = this;

      $.get('/search?mode=searchuser&fieldname=username&search_username=*', function(d) {
        for (var a = $('option', d), i = 0, j = a.length, str = ''; i < j; i++) {
          str += '@"' + $(a[i]).text() + '" ';
        }

        editor.insertText(str);
      });
    };

    $.sceditor.command.set('tagall', {
      exec : tagAll,
      txtExec : tagAll,
      tooltip : 'Tag all members'
    });

    toolbar += '|tagall';
  }

  'par ange tuteur';
});
Save the script and it'll add a new button to the editor. Clicking the button will add all member names to the editor. If you want this to be both for mods and admins, remove " == 1" from
Code:
_userdata.user_level == 1
.


Depending on what you want and what forum version you're using, use the following CSS rule(s) to give the button an icon.

FA Edge :
Code:
.sceditor-button-tagall:after {
  content:"\f1fa";
}

Forumotion default versions :
Code:
.sceditor-button-tagall div {
  background-image:url(IMAGE_URL) !important;
}
avatar
Guest
Guest
View all awards

PostGuest on Mon 19 Dec 2016, 13:30

You see... it IS possible after all! You're a genius @Ange Tuteur! It's even pushing out the tag notifications. Perfect. Just a small question:

On Edge, we've got just 2 users on our Edge test site. When sending the test message I saw there's a mention for each member. Is it possible to hide them or even better, to have it replaced with a standard text, say @All ?
avatar
Ange Tuteur
Administrator
Title :
Coffee Addict
Gender : Male
Age : 21
Posts : 4675
Points : 9689
Reputation : 2331
Location : Macungie, PA
Language : EN10, FR5
Browser : Browser : Brave Forum Version : Forum Version : Forumactif Edge
Awards :
View all awards
View user profile https://github.com/SethClydesdale https://twitter.com/sethc1995

PostAnge Tuteur on Mon 19 Dec 2016, 13:38

Yeah it should be possible. Try using the script below instead :
Code:
$(function() {
  if (_userdata.user_level == 1 && $.sceditor && toolbar) {
    var tagAll = function() {
      var editor = this;
 
      $.get('/search?mode=searchuser&fieldname=username&search_username=*', function(d) {
        for (var a = $('option', d), i = 0, j = a.length, str = ''; i < j; i++) {
          str += '@"' + $(a[i]).text() + '" ';
        }
 
        editor.insertText('[table class="tag-all"][tr][td]' + str + '[/td][/tr][/table]');
      });
    };
 
    $.sceditor.command.set('tagall', {
      exec : tagAll,
      txtExec : tagAll,
      tooltip : 'Tag all members'
    });
 
    toolbar += '|tagall';
  }
 
  'par ange tuteur';
});

document.write('<style>.tag-all { font-size:0; } .tag-all, .tag-all * { display:inline; } .tag-all:before { content:"@All"; font-size:12px; } .tag-all * { display:none; }</style>');
avatar
Guest
Guest
View all awards

PostGuest on Mon 19 Dec 2016, 13:56

Ahhh... le 'display nun' et la 'table' (dinneur for Deux) Laughing seu easy ... Wink

Sank Hugh and you hit perfection lol!

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