News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

@mention members

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

Previous topic - Next topic

Rain Forest

Quote from: Dragooon on May 11, 2014, 03:40:04 PM
Ah okay, find both instances of
mentions_process_store($msgOptions['mentions'], $msgOptions['id'], $msgOptions['subject'], $msgOptions['approved']);
and replace them with
mentions_process_store($msgOptions['mentions'], $msgOptions['id'], $msgOptions['subject'], isset($msgOptions['approved']) ? $msgOptions['approved'] : 1);
in Subs-Post.php

I had the same issue! This one works for me too :)

Kimmie

Not sure if this has been mentioned before (no pun intended..lol), but if someone has a blank space in their name, the drop down list will not find them. How do I fix this?


Thanks :)

Dragooon

Quote from: Kimmie on August 31, 2014, 01:07:06 PM
Not sure if this has been mentioned before (no pun intended..lol), but if someone has a blank space in their name, the drop down list will not find them. How do I fix this?


Thanks :)
Uh I fixed this for 2.1, not sure if I backported that to this mod. If not, I can take a look ina  few days.

Kimmie

Quote from: Dragooon on August 31, 2014, 01:16:09 PM
Quote from: Kimmie on August 31, 2014, 01:07:06 PM
Not sure if this has been mentioned before (no pun intended..lol), but if someone has a blank space in their name, the drop down list will not find them. How do I fix this?


Thanks :)
Uh I fixed this for 2.1, not sure if I backported that to this mod. If not, I can take a look ina  few days.


That would be awesome thanks :). I was just told that none of the current themes will work with 2.1 so chances are, many will not be upgrading to it any time soon.

Arantor

It was honestly no different going from 1.1 to 2.0 though ;)

Kimmie

Quote from: ⬔ on August 31, 2014, 01:21:08 PM
It was honestly no different going from 1.1 to 2.0 though ;)


That was a HUGE headache lol.

Arantor

This is no different. While it's a pain, sure, and I know full well I won't be migrating some of my stuff to 2.1 for a while for the same reason, the changes are necessary to accommodate mobile/tablet *and* they're necessary to streamline the theme to avoid all the main_block images and so on.

I'm just worrying about the fun of porting my gallery to 2.1 when it's done... that's complex.

ryan_dwight

Im not sure if there is a setting for this, but I can't find it.

when someone mention a regular member to a hidden board, can we disable the notification?

not sure if there is a conflict with the user info mod
with the bbcode [user]member[/user]
and if you will post it it will become @member which is same as mention.

butch2k

Hi Dragooon,

A small bug i noticed in mentions_process_store function.

The $subject parameter is being used to initialize $replacements['POSTNAME'] but a few lines later $subject is also used to store the result of an str_replace. Since this is located in a loop $replacements['POSTNAME'] ends up being replaced by the result of the str_replace for the next emails... You need to change the name of the variable storing the str_repalce from $subject to $emailsubject or whatever.

JeneeB53

What happens if a member is mentioned in a board they don't have access to?  For example, what if one of my mods accidentally uses the 'mention' of a member in a private thread in the mod board?  I hope my moderators know better - but they may not!

Kimmie

Quote from: JeneeB53 on September 12, 2014, 10:44:32 PM
What happens if a member is mentioned in a board they don't have access to?  For example, what if one of my mods accidentally uses the 'mention' of a member in a private thread in the mod board?  I hope my moderators know better - but they may not!


Chances are, all that will happen is when that member tries to view it, they will get the "this board is either missing or is off limits to you" message.

sunilimon

Hi Dragooon, sorry buy my system gives two mails when my users are mentioned, I checked for duplied lines but I didn't found something. Could you help me? Thank you very much! :D
SMF version: 2.0.14

http://www.hookahspain.com your hookah / shisha comunity at Spain

Troytime

When there are multiple people mentioned, the mention notification email contains incorrect text.

Example, here is an email I received (my username is Troy). Winz mentioned me, but also immediately mentioned Heyjude in the same reply.

--
Hello Troy!

Winz mentioned you in the post "Heyjude, you have been mentioned at a post in Weber Kettle Club Forums", you can view the post at XXXXXXXXXXXX
--

butch2k

Quote from: Troytime on September 30, 2014, 12:13:28 AM
When there are multiple people mentioned, the mention notification email contains incorrect text.

Example, here is an email I received (my username is Troy). Winz mentioned me, but also immediately mentioned Heyjude in the same reply.

--
Hello Troy!

Winz mentioned you in the post "Heyjude, you have been mentioned at a post in Weber Kettle Club Forums", you can view the post at XXXXXXXXXXXX
--

it's the bug i mentionned above.

Elizabeth II

Quote from: Britannia360 on June 30, 2014, 07:12:40 PM
There seems to be an issue with mentions number in Profile not resetting.. For example if you get mentioned and get Profile [1] and go on metions and back off it is still there and does not go unless I clear the forum cache.

Is there any fix to this??

butch2k

In mentions_process_store replace the $subject by an $emailsubject at two places:


loadLanguage('Mentions');

$emailsubject= str_replace(array_keys($replacements), array_values($replacements), $txt['mentions_subject']);
$body = str_replace(array_keys($replacements), array_values($replacements), $txt['mentions_body']);
sendmail($mention['email_address'],$emailsubject, $body);

Kimmie

Just noticed that if you modify an existing post and add a mention, it doesn't notify them of it at the top like it does when you add a mention to a new post. It still lists it on their mentions page, just not the notification at the top . This is causing some of my mods to miss mentions unless they go to their mentions page to look and see if they have been mentioned.

Is there a way to fix this? Thanks :)

Kornak

Hi Dragooon, this plugin its awesome! But its not work with user have russian name (@Алексей / @Влада )
How i can fix it?
I read topic & i make that ->
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?

Quote from: Dragooon on May 31, 2014, 01:40:36 AM
Oh I did opposite of what I was going for :P

Try replacing the find with this
	
foreach (
$string as $k => $char)
	
{
	
	
if (
$char == '@' && (!isset($string[$k 1]) || $string[$k 1] == ' '))


Quote from: Dragooon on June 06, 2014, 12:33:50 PM
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)));
But russian name don't work (
PS Sorry, my english bad i know.  :-\

Rain Forest

In error log when someone is using the Search button..

Apply Filter: Only show the error messages of this URL
../forums/index.php?action=search2
Apply Filter: Only show the errors with the same message
8: Undefined index: title
Apply Filter: Only show the errors from this file
File: /../Themes/default/languages/Mentions.english.php (body_above sub template - eval?)
Line: 391



Apply Filter: Only show the error messages of this URL
..forums/index.php?action=search2
Apply Filter: Only show the errors with the same message
8: Undefined index: href
Apply Filter: Only show the errors from this file
File: /../forums/Themes/default/languages/Mentions.english.php (body_above sub template - eval?)
Line: 390


After disable the eval.. it says this:

../forums/index.php?action=search2
Apply Filter: Only show the errors with the same message
8: Undefined index: title
Apply Filter: Only show the errors from this file
File: ../forums/Themes/writer/index.template.php
Line: 391


Line 391:    

<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>


Apply Filter: Only show the error messages of this URL
../forums/index.php?action=search2
Apply Filter: Only show the errors with the same message
8: Undefined index: href
Apply Filter: Only show the errors from this file
File: /../forums/Themes/writer/index.template.php
Line: 390


Line 390:    

<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>


portex1

#339
Hi.
The mod is great, but it doesn't work with usernames with spaces.
I tried it as admin (which has all permissions) and still doesn't work. But it works with other usernames. How to fix this?

Advertisement: