Advertisement:

Author Topic: Mentions & Quote's Mentions[MOD]  (Read 13017 times)

Offline hhy89

  • Full Member
  • ***
  • Posts: 486
Mentions & Quote's Mentions[MOD]
« on: June 07, 2014, 01:08:01 PM »
if anybody use this mod. download here
« Last Edit: June 12, 2014, 06:32:49 AM by Gary »
Seo4Smf 2.0 - Full Top10 Stats(full top10) - Aligned and Bilateral Child Boards(2li 3lü alt bölümler)
http://www.smfmod.com
http://destek.smfmod.com

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: Mentions & Quote's Mentions[MOD]
« Reply #1 on: June 07, 2014, 01:33:14 PM »
Why does this whole thing look so familiar?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,047
    • Arantor on GitHub
Re: Mentions & Quote's Mentions[MOD]
« Reply #2 on: June 07, 2014, 01:47:42 PM »
Because it's the third mod in about a month to appear doing this thing?
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

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: Mentions & Quote's Mentions[MOD]
« Reply #3 on: June 07, 2014, 01:52:32 PM »
Okay so uhm....I'm confused?

1) The description is the exact same one from my mod (except the quote line)
2) The mod looks like it's derived from mine but the code is different? I mean you rewrote everything except most of the core matching code (which is kinda broken mind you, I rewrote it to a lexical parser because that is better IMO).
3) The core structure is practically same as mine, same libraries and everything (At.js, various filenames etc).
4) Loading every member's name in a JSON response is a seriously bad idea.
5) Again so like...what?

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: Mentions & Quote's Mentions[MOD]
« Reply #4 on: June 07, 2014, 01:52:48 PM »
Because it's the third mod in about a month to appear doing this thing?
No it's more like the description is a copy/paste from my mod

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,047
    • Arantor on GitHub
Re: Mentions & Quote's Mentions[MOD]
« Reply #5 on: June 07, 2014, 01:54:04 PM »
I did wonder, wasn't sure.

Hmm. I wonder...
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline hhy89

  • Full Member
  • ***
  • Posts: 486
Re: Mentions & Quote's Mentions[MOD]
« Reply #6 on: June 07, 2014, 02:20:07 PM »
1- because i have very bad eng :(
2- i had writen previously. but i havent finished yet. i did yesterday. i looked ur mod now but i didnt find any similar code or anything
3- because its a similar mod.
4- its your opinion. i respect that. but in my opinion its the best solution.

any problem with that mod?
Seo4Smf 2.0 - Full Top10 Stats(full top10) - Aligned and Bilateral Child Boards(2li 3lü alt bölümler)
http://www.smfmod.com
http://destek.smfmod.com

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: Mentions & Quote's Mentions[MOD]
« Reply #7 on: June 07, 2014, 03:55:36 PM »
2. The mention's matching code is totally mine except the fact that you changed the string's max possible length to 40 which is wrong.... I coded that for Wedge more than a year ago (and have rewritten from that multiple times since then...)
I mean seriously...
Code: (Mine) [Select]
    // Attempt to match all the @<username> type mentions in the post
    preg_match_all('/@(([^@\n\\\\]|\\\@){1,60})/', strip_tags($body), $matches);

    // Names can have spaces, or they can't...we try to match every possible
    if (empty($matches[1]) || !allowedTo('mention_member'))
        return;

    // Names can have spaces, other breaks, or they can't...we try to match every possible
    // combination.
    $names = array();
    foreach ($matches[1] as $match)
    {
        $match = preg_split('/([^\w])/', $match, -1, PREG_SPLIT_DELIM_CAPTURE);

        for ($i = 1; $i <= count($match); $i++)
            $names[] = str_replace('\@', '@', implode('', array_slice($match, 0, $i)));
    }
Code: (Yours) [Select]
if (preg_match_all('/\@(([^@\n\\\\]|\\\@){1,40})/', strip_tags($msgOptions['body']), $matches)) {
    $find = array();
$replace = array();
$valid_names = array();

    $names = array();
    foreach ($matches[1] as $match) {
        $match = preg_split('/([^\w^\'])/', $match, -1, PREG_SPLIT_DELIM_CAPTURE);

        $i = 1;
        while ($i <= count($match)) {
            $names[] = str_replace('\@', '@', implode('', array_slice($match, 0, $i)));
            $i++;
        }
    }
   
    $names = array_unique($names);
Oh btw, if you did steal this and did not magically stumble upon practically the same code, it was BSD licensed. You could've just given proper credits and it would've been fine.

4. This is not my opinion...loading up 10000+ members to a single response *is* a seriously bad idea, not only is it resource intensive for the server, the browser will also be filtering through that large a list for every key stroke after a @ which will potentially slow down the typing by a lot especially if they're on a weaker device such as a mobile.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,047
    • Arantor on GitHub
Re: Mentions & Quote's Mentions[MOD]
« Reply #8 on: June 07, 2014, 03:58:18 PM »
While the exact code is different, the odds of hitting the exact same expressions are actually somewhat unlikely given my experience. It's way too convenient.

I seem to recall similar accusations in the past, for different mods.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline hhy89

  • Full Member
  • ***
  • Posts: 486
Re: Mentions & Quote's Mentions[MOD]
« Reply #9 on: June 07, 2014, 04:46:06 PM »
expressions will be same or similar beacuse it works for same work. Just like arantor said the exact code is diffirent. and just like i said before i didnt stolen any mentions mod or ur mod. i didnt see ur wedge project and i was soldier in military and i came back a week ago.
Seo4Smf 2.0 - Full Top10 Stats(full top10) - Aligned and Bilateral Child Boards(2li 3lü alt bölümler)
http://www.smfmod.com
http://destek.smfmod.com

Offline hhy89

  • Full Member
  • ***
  • Posts: 486
Re: Mentions & Quote's Mentions[MOD]
« Reply #10 on: June 07, 2014, 04:48:52 PM »
anyway i will delete this mod. cong for smear campaign
Seo4Smf 2.0 - Full Top10 Stats(full top10) - Aligned and Bilateral Child Boards(2li 3lü alt bölümler)
http://www.smfmod.com
http://destek.smfmod.com