@mention members

Started by Dragooon, May 02, 2014, 01:07:58 PM

Previous topic - Next topic

Adrek

It would be if user was mentioned...
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Dragooon

Quote from: phantomm on June 06, 2014, 10:46:37 AM
It would be if user was mentioned...
Hmm, I can't see why it wouldn't work. Are you sure the username is exact followed by @?

Adrek

It's selected from dropdown so yes, I'm sure it is followed by @ sign, exactly like this:
@Username <")))/
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Arantor

Probably due to the "? I'm assuming there's a call to htmlspecialchars or similar somewhere between receiving the user input and checking it against the list of people in the DB?

Dragooon

Quote from: Arantor on June 06, 2014, 11:30:32 AM
Probably due to the "? I'm assuming there's a call to htmlspecialchars or similar somewhere between receiving the user input and checking it against the list of people in the DB?
God damn you're probably right, it does a htmlspecialchars_decode but the username itself in the body is htmlspecialchar'd.

Arantor

So it is in the members table too ;)

Dragooon

Quote from: phantomm on June 06, 2014, 11:29:24 AM
It's selected from dropdown so yes, I'm sure it is followed by @ sign, exactly like this:
@Username <")))/
Try this, open mentions.php
Code (Find) Select
$names = array_unique(array_map('trim', $names));
Code (Replace) Select
$names = array_unique(array_map('htmlspecialchars', array_map('trim', $names)));

Adrek

Now it works :) Thanks for fix.
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

Alb0

Would it be possible to actually notify member(s) through PM(s) in the forum instead of E-Mail?

Squash

Quote from: Alb0 on June 07, 2014, 12:07:00 AM
Would it be possible to actually notify member(s) through PM(s) in the forum instead of E-Mail?

I'd agree this is a better option vs email....

Coldplay

Hello :)
I have some problems with this mod, sorry for refreshing and my bad english :)

So i instal mod, and only i can write @JADSF and show me the rest of the name. And if someone try to tag person with ID, some members get notification, some dont... Can you pls help me? :(

Thx

Dragooon

1) Make sure they have the permission to mention members
2) Make sure the members they're tagging can see the post.

MechSpecs

Great mod!

Is there a way to make the auto-suggest work with SCEditor4Smf?

strano

An idea.
is it possible to modify this great mod for emulate the notify on the quote?

Coldplay

Quote from: Dragooon on June 08, 2014, 02:06:39 PM
1) Make sure they have the permission to mention members
Do i have that option or?
Thx a lot for helping me :)

4LP3RUZ1

Quote from: Dragooon on June 06, 2014, 05:17:59 AM
Okay, this is lightly tested (and that too in 2.1 :P). Open Themes/default/mentions.js, replace the entire file with

/**
* Javascript interface for active suggestions while posting
*
* @author ******iz Garg <[email protected]>
* @copyright 2014 ******iz Garg
* @license Simplified BSD (2-Clause) License
*/

var mentionInit = function()
{
    var fails = [];

    var config = {
        at: '@',
        data: [],
        show_the_at: true,
        limit: 10,
        callbacks: {
            matcher: function(flag, subtext, should_start_with_space) {
                var match = '', started = false;
                var string = subtext.split('');
                for (var i = 0; i < string.length; i++)
                {
                    if (string[i] == flag && (!should_start_with_space || i == 0 || /[\s\n]/gi.test(string[i - 1])))
                    {
                        started = true;
                        match = '';
                    }
                    else if (started)
                        match = match + string[i];
                }

                if (match.length > 0)
                    return match;

                return null;
            },
            remote_filter: function (query, callback) {
                if (typeof query == 'undefined' || query.length < 2 || query.length > 60)
                    return;

                for (i in fails)
                    if (query.substr(0, fails[i].length) == fails[i])
                        return;

                $.ajax({
                    url: smf_scripturl + '?action=suggest;' + smf_sessvar + '=' + smf_sessid + ';xml',
                    method: 'GET',
                    data: {
                        search: query,
                        suggest_type: 'member'
                    },
                    success: function (data) {
                        var members = $(data).find('smf > items > item');
                        if (members.length == 0)
                            fails[fails.length] = query;

                        var callbackArray = [];
                        $.each(members, function (index, item) {
                            callbackArray[callbackArray.length] = {
                                name: $(item).text()
                            };
                        });

                        callback(callbackArray);
                    }
                });
            }
        }
    };

    if (typeof $.fn.atwho == 'undefined' && typeof jQuery.fn.atwho != 'undefined')
    {
        var iframe = jQuery('#html_message');

        if (typeof iframe[0] != 'undefined')
            jQuery(iframe[0].contentDocument.body).atwho(config);
        jQuery('textarea[name=message]').atwho(config);
    }
    else
    {
        var iframe = $('#html_message');
        if (typeof iframe[0] != 'undefined')
            $(iframe[0].contentDocument.body).atwho(config);
        $('textarea[name=message]').atwho(config);
    }
};

var atWhoElement = document.createElement('script');
atWhoElement.src = atwho_url;
atWhoElement.type = 'text/javascript';
atWhoElement.onload = mentionInit;

if (typeof $ == 'undefined' || (parseInt($.fn.jquery.substr(0, 1)) == 1 && parseInt($.fn.jquery.substr(2, 3)) < 8) || jQuery.fn.jquery != $.fn.jquery)
{
    var scriptElement = document.createElement('script');
    scriptElement.src = jquery_url;
    scriptElement.type = 'text/javascript';

    scriptElement.onload = function () {
        document.body.appendChild(atWhoElement);
    };

    document.body.appendChild(scriptElement);
}
else
    document.body.appendChild(atWhoElement);


Does it work better?

Sorry for the late reply,

This is awesome! It seems to work!
Frozen frogs are back :(

youngking

I've just added the @mention mod on my forums the mod works and all but now in my admin panel I cant manage my forums boards it gives me an internal server error. Everything else in the ACP works besides "forum>boards" please help. Thank you

Shambles

Did you get any warnings during the installation process?


Quote from: Kindred on June 02, 2014, 09:38:52 PM
... Also, please note that "help" or variations of that are not useful titles...

Acans

Merging with the Mods Support Topic...

Done, remember to post any issues you are having with modifications in their support topic. The author is usually the best person to speak to about it.
"The Book of Arantor, 17:3-5
  And I said unto him, thy database query shalt always be sent by the messenger of $smcFunc
  And $smcFunc shall protect you against injections and evil
  And so it came to pass that mysql_query was declared deprecated and even though he says he is not
  dead yet, the time was soon to come to pass when mysql_query shall be gone and no more

iorkara

I have attached an image to this post showing an issue I have run into. I tried to welcome a few new members to the forum. Everything worked fine, pop-ups and clicked on names. Then posted. Then I get the following (see image). Some mentions have worked and some haven't.

Also, some users have reported that they cannot mention at all.

Advertisement: