Advertisement:

Author Topic: @mention members  (Read 165814 times)

Offline phantomm

  • Sophist Member
  • *****
  • Posts: 1,064
  • Gender: Male
    • pages/smfpl/171860759503032 on Facebook
    • Polish ElkArte community
Re: @mention members
« Reply #20 on: May 03, 2014, 01:15:02 PM »
Great modification! Good work Dragooon :)
Polskie wsparcie SMF na simplemachines.org

My mods

Offline NoPasaran

  • Full Member
  • ***
  • Posts: 698
  • Gender: Male
  • Siyah Beyaz - Ölüm Yaşam
    • @volkandiyorki on Twitter
    • Kralkartal
Re: @mention members
« Reply #21 on: May 04, 2014, 06:51:37 AM »
Great mod ..


but there is a letter problem..


for example..


if i write


@nopasaran


is not going notice..


@NoPasaran is true spelling..


i think important problems
kralkartal.net SMF 2.0.8

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: @mention members
« Reply #22 on: May 04, 2014, 07:56:46 AM »
Great mod ..


but there is a letter problem..


for example..


if i write


@nopasaran


is not going notice..


@NoPasaran is true spelling..


i think important problems
Fix for this:
Code: (Find (Sources/Mentions.php)) [Select]
    foreach ($members as $member)
    {
        if (strpos($msgOptions['body'], '@' . $member['real_name']) === false
            || (!in_array(1, $member['groups']) && count(array_intersect($member['groups'], $member_groups)) == 0))
            continue;
 
        $msgOptions['body'] = str_replace('@' . $member['real_name'], '[member=' . $member['id'] . ']' . $member['original_name'] . '[/member]', $msgOptions['body']);
 
        // Why would an idiot mention themselves?
        if ($user_info['id'] == $member['id'])
            continue;
 
        $msgOptions['mentions'][] = $member;
    }
Code: (Replace) [Select]
    foreach ($members as $member)
    {
        if (stripos($msgOptions['body'], '@' . $member['real_name']) === false
            || (!in_array(1, $member['groups']) && count(array_intersect($member['groups'], $member_groups)) == 0))
            continue;
 
        $msgOptions['body'] = str_ireplace('@' . $member['real_name'], '[member=' . $member['id'] . ']' . $member['original_name'] . '[/member]', $msgOptions['body']);
 
        // Why would an idiot mention themselves?
        if ($user_info['id'] == $member['id'])
            continue;
 
        $msgOptions['mentions'][] = $member;
    }

Offline Study Force

  • SMF Hero
  • ******
  • Posts: 3,130
    • @studyforceps on Twitter
    • Study Force
Re: @mention members
« Reply #23 on: May 04, 2014, 11:23:40 AM »
I thought you were going to charge for this?

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: @mention members
« Reply #24 on: May 04, 2014, 11:32:27 AM »
I thought you were going to charge for this?
Changed my mind

Offline FrizzleFried

  • Drama-Monger
  • Sr. Member
  • ****
  • Posts: 754
Re: @mention members
« Reply #25 on: May 04, 2014, 11:23:37 PM »
FYI - Mod does not seem to work when editing... example...

I wrote a post I forgot to add the @ before the name of the person... I edited and went back in and added the @... it didn't work.


Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: @mention members
« Reply #26 on: May 05, 2014, 01:14:02 AM »
Is the name correct? I fixed this issue while the mod was being reviewed. Remember that currently the name is case sensitive.

Offline Tallypop

  • Newbie
  • *
  • Posts: 1
Re: @mention members
« Reply #27 on: May 05, 2014, 02:51:08 AM »
Bless you for this.

Offline Rhi-Rhi

  • Semi-Newbie
  • *
  • Posts: 10
Re: @mention members
« Reply #28 on: May 05, 2014, 02:54:45 AM »
You are my freakin' hero. *___*

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: @mention members
« Reply #29 on: May 05, 2014, 05:25:32 AM »
Can anyone help me by testing my latest changes (they're in the mod's GitHub repository)? I've done light testing and I think they're fine, but I want to be sure before releasing it on the mod site. Here is a a summary of changes

- Add active suggestions while mentioning someone, works in quick reply as well as full post page (normal and WYSIWYG editor).
- Add Scheduled Task for removing seen mentions before specified days
- Allow setting whether e-mail mentions should be enabled by default or not (defaulted to enable)
- Fix for making mentions case insensitive (@admin = @AdMIn = @adMIN =@Admin)
- Some code cleanup

Offline lurkalot

  • Sophist Member
  • *****
  • Posts: 1,057
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: @mention members
« Reply #30 on: May 05, 2014, 07:07:06 AM »
Can anyone help me by testing my latest changes (they're in the mod's GitHub repository)?


Looking good from here, testing it on a local install atm.  Liking the "active suggestions while mentioning someone"  Nice work. ;)

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: @mention members
« Reply #31 on: May 05, 2014, 07:09:48 AM »
Can anyone help me by testing my latest changes (they're in the mod's GitHub repository)?


Looking good from here, testing it on a local install atm.  Liking the "active suggestions while mentioning someone"  Nice work. ;)
Thanks! If you have any suggestions let me know

Offline lurkalot

  • Sophist Member
  • *****
  • Posts: 1,057
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: @mention members
« Reply #32 on: May 05, 2014, 07:37:42 AM »
Thanks.  Have noticed, and this might just be my testbed.  If I uninstall the mod it leaves the tags in,

What was there when mod installed = @lurkapo how you doing?

When mod un-installed it shows = [member=9]lurkapo[/member] how you doing?

Offline FrizzleFried

  • Drama-Monger
  • Sr. Member
  • ****
  • Posts: 754
Re: @mention members
« Reply #33 on: May 05, 2014, 10:59:53 AM »
Is the name correct? I fixed this issue while the mod was being reviewed. Remember that currently the name is case sensitive.

The name is correct and I used the code you posted above to fix "case sensitivity" issue which works when not in edit mode.  I'll test again though when I have time and get back to you.  Just something I noticed last night when I came across it.  Otherwise it seems to be working great.

Offline FrizzleFried

  • Drama-Monger
  • Sr. Member
  • ****
  • Posts: 754
Re: @mention members
« Reply #34 on: May 05, 2014, 11:50:59 AM »
I found another problem.  My membership are always looking for ways to screw with me and other members (it's the type of forum we have).  One of them mentioned a member "a bunch of times" in a single post.  I am trying to find out what "a bunch of times" means but it crashed the post to a white screen.  I can't get in to the post to determine how many times the jackwad mentioned the member but it appears that at a certain number it crashes the post to a white screen.  You might want to add a "limit" to the number of mentions permitted per post.

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: @mention members
« Reply #35 on: May 05, 2014, 11:55:25 AM »
Can you check your error logs for any errors?

Offline FrizzleFried

  • Drama-Monger
  • Sr. Member
  • ****
  • Posts: 754
Re: @mention members
« Reply #36 on: May 05, 2014, 12:04:02 PM »
Can you check your error logs for any errors?

I see nothing apparent... and accessing the post that "white screens" does not produce an error. 

Offline FrizzleFried

  • Drama-Monger
  • Sr. Member
  • ****
  • Posts: 754
Re: @mention members
« Reply #37 on: May 05, 2014, 12:06:24 PM »
OK... the user didn't know exactly how many times... 100 to 150 times was his estimate.

But you see how this could become a problem (even if it didn't white screen the post).... who wants 150 mentions sent to their profile from the same post?


Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm bIn
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: @mention members
« Reply #38 on: May 05, 2014, 12:07:20 PM »
There must be something else, because I just mentioned a member 300 times on my localhost and it worked fine. And an user will only get a single mention per post regardless of how many times they were mentioned

Offline FrizzleFried

  • Drama-Monger
  • Sr. Member
  • ****
  • Posts: 754
Re: @mention members
« Reply #39 on: May 05, 2014, 12:12:32 PM »
I will ask if he did anything else.  Any suggestion on how I can get in an read what he did if I am getting a white screen?