Raised This Month: $231 Target: $400
 57% 

[ANY] Smart Link Remover


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Totenfluch
AlliedModders Donor
Join Date: Jan 2012
Location: Germany
Plugin ID:
5581
Plugin Version:
1.6.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Removes Links from Player Names (1.6.0 - 15-02-18)
    Old 03-31-2017 , 14:45   [ANY] Smart Link Remover
    Reply With Quote #1

    Hey0,

    This is a small Plugin that removes all links from a Players name

    Install
    - Drag 'n' drop the .smx


    And you're done.

    Github: https://github.com/Totenfluch/SmartLinkRemover

    Note: I released this to get input from other developers on how to remove advertisements in names completly and smart.
    If you have any ideas how to improve this further let me know!

    Download count ~510
    Thanks to AgentWesker and Mitchell for the code improvements!
    Attached Files
    File Type: sp Get Plugin or Get Source (SmartLinkRemover.sp - 892 views - 3.0 KB)
    File Type: zip SmartLinkRemover.zip (187.5 KB, 491 views)
    __________________
    Notable Projects:
    Event Item Spawner | Scissors, Rock, Paper for ZephStore
    tVip | Smart Link Remover
    PLG & GGC - CS:GO Roleplay

    and countless more...

    I can make a helicopter shoot missles if you want me to...

    Last edited by Totenfluch; 02-14-2018 at 18:40.
    Totenfluch is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 03-31-2017 , 15:10   Re: [ANY] Smart Link Remover
    Reply With Quote #2

    *redacted, fixed in the newest version*

    Last edited by Mitchell; 03-31-2017 at 15:53.
    Mitchell is offline
    Totenfluch
    AlliedModders Donor
    Join Date: Jan 2012
    Location: Germany
    Old 03-31-2017 , 15:13   Re: [ANY] Smart Link Remover
    Reply With Quote #3

    Quote:
    Originally Posted by Mitchell View Post
    Good spot!
    That was code I used for testing something else and forgot to remove <.<
    __________________
    Notable Projects:
    Event Item Spawner | Scissors, Rock, Paper for ZephStore
    tVip | Smart Link Remover
    PLG & GGC - CS:GO Roleplay

    and countless more...

    I can make a helicopter shoot missles if you want me to...
    Totenfluch is offline
    sneaK
    SourceMod Moderator
    Join Date: Feb 2015
    Location: USA
    Old 03-31-2017 , 15:18   Re: [ANY] Smart Link Remover
    Reply With Quote #4

    Nice release, was looking for something like this recently actually! Any chance you'll be doing any improvements/additions to this in the future? If so, a couple suggestions:

    - An option for flag-based immunity
    - A whitelist, without directly modifying the regex expression in the code - for example, I don't mind players who wish to self-advertise their twitch.tv in their names, but don't wish to have any other links in names
    __________________

    Last edited by sneaK; 03-31-2017 at 15:23.
    sneaK is offline
    Totenfluch
    AlliedModders Donor
    Join Date: Jan 2012
    Location: Germany
    Old 03-31-2017 , 15:36   Re: [ANY] Smart Link Remover
    Reply With Quote #5

    Quote:
    Originally Posted by blackhawk74 View Post
    Nice release, was looking for something like this recently actually! Any chance you'll be doing any improvements/additions to this in the future? If so, a couple suggestions:

    - An option for flag-based immunity
    - A whitelist, without directly modifying the regex expression in the code - for example, I don't mind players who wish to self-advertise their twitch.tv in their names, but don't wish to have any other links in names
    I planned a mysql database to blacklist certain other phrases directly and a (mysql)whitelist for pages like youtube, twitch (Menu/Command based Ingame)

    For Phrases that the regex doesn't catch there will be another database where the admin can target the client and specify the part of the name that is not allowed so the plugin gets it right on the next time.
    __________________
    Notable Projects:
    Event Item Spawner | Scissors, Rock, Paper for ZephStore
    tVip | Smart Link Remover
    PLG & GGC - CS:GO Roleplay

    and countless more...

    I can make a helicopter shoot missles if you want me to...

    Last edited by Totenfluch; 03-31-2017 at 15:38.
    Totenfluch is offline
    Agent Wesker
    Senior Member
    Join Date: Apr 2012
    Old 04-04-2017 , 14:12   Re: [ANY] Smart Link Remover
    Reply With Quote #6

    Here is a slightly improved Regex from testing on our server:
    ((http:[/]{2}|https:[/]{2}|www[.])?[-a-zA-Z0-9]{2,}[.][a-zA-Z]{2,5})



    I also modified your code to loop through each match in case of multiple links.

    Edit: Fixes have been merged https://github.com/Totenfluch/SmartLinkRemover

    Last edited by Agent Wesker; 04-05-2017 at 08:50.
    Agent Wesker is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 04-04-2017 , 14:39   Re: [ANY] Smart Link Remover
    Reply With Quote #7

    Depends how intrusive you want to be as something like:
    "HD.mtch"
    Is not a url, but
    "mtch.tech"
    is a url.
    Mitchell is offline
    Agent Wesker
    Senior Member
    Join Date: Apr 2012
    Old 04-04-2017 , 14:51   Re: [ANY] Smart Link Remover
    Reply With Quote #8

    Quote:
    Originally Posted by Mitchell View Post
    Depends how intrusive you want to be as something like:
    "HD.mtch"
    Is not a url, but
    "mtch.tech"
    is a url.
    You could do a regex "or" and look for the literal strings (.com .money .tech) but it would be a very large regex string and might not even parse correctly...
    Agent Wesker is offline
    Mitchell
    ~lick~
    Join Date: Mar 2010
    Old 04-04-2017 , 14:56   Re: [ANY] Smart Link Remover
    Reply With Quote #9

    Quote:
    Originally Posted by Agent Wesker View Post
    You could do a regex "or" and look for the literal strings (.com .money .tech) but it would be a very large regex string and might not even parse correctly...
    Either that or make a list of them and compare that list to the player's name.
    edit: there's 882 domain extensions and growing pretty fast.

    Last edited by Mitchell; 04-04-2017 at 15:01.
    Mitchell is offline
    Totenfluch
    AlliedModders Donor
    Join Date: Jan 2012
    Location: Germany
    Old 04-04-2017 , 15:18   Re: [ANY] Smart Link Remover
    Reply With Quote #10

    Quote:
    Originally Posted by Agent Wesker View Post
    Here is a slightly improved Regex from testing on our server:
    ((http:[/]{2}|https:[/]{2}|www[.])?[-a-zA-Z0-9]{2,}[.][a-zA-Z]{2,5})



    I also modified your code to loop through each match in case of multiple links.
    I have recoreded 73.000 player names and none of them had http in their name. So you can scrap that~
    the MAX_NAME_LENGTH makes it literally impossible to have two links in a name that's why I didn't implement it
    Other than that your regex looks extremly solid with 0 false positives and all matches in my ~350 name test - Well done!
    If you send me a pull requests I'll merge it


    we're having a discussion here:

    https://github.com/Totenfluch/SmartLinkRemover/pull/1

    if you want to join
    __________________
    Notable Projects:
    Event Item Spawner | Scissors, Rock, Paper for ZephStore
    tVip | Smart Link Remover
    PLG & GGC - CS:GO Roleplay

    and countless more...

    I can make a helicopter shoot missles if you want me to...

    Last edited by Totenfluch; 04-04-2017 at 15:22.
    Totenfluch is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 18:11.


    Powered by vBulletin®
    Copyright ©2000 - 2021, vBulletin Solutions, Inc.
    Theme made by Freecode