1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ego Squasher 0.2

Discussion in 'Plugins' started by Nick, Mar 28, 2010.

  1. Nick

    Nick Well-Known Member

    Ego Squasher
    Version: 0.2
    Author: Nick Ramsay
    Created: 2010/03/28
    Last Updated:
    2010/06/03
    Tested on: Hotaru 1.2.0 ~ 1.3.0
    Plugins Required: Submit
    Plug & Play: Yes
    Supported: Yes

    Description
    A simple plugin to prevent users from submitting back-to-back posts from the same domain, unless their last one made the front page. This plugin was inspired by bloggers selfishly submitting all their own posts to my site, regardless of whether they were any good or not.

    On Submit step 1, the message "Sorry, your last post was from that domain, too." is displayed and the user can't proceed to step 2. You can change the message by copying the language file to your own /languages folder in your theme and editing it there.

    Instructions
    1. Upload the "ego_squasher" folder to your plugins folder.
    2. Install it from Plugin Management in Admin.

    Revision History
    v.0.2 2010/4/22 - Nick - Checks only posts of type "news", not "blog", etc.
    v.0.1 2010/3/28 - Nick - Released first version
     

    Attached Files:

    druellae, baadier and hangbowl like this.
  2. JonH

    JonH Admin & Design

    Very clever!
     
  3. hangbowl

    hangbowl New Member

    aha, yes i need this. my site spammed frequently. but it's ok, since now i need more traffic :D
     
  4. Nick

    Nick Well-Known Member

    The best thing about this plugin is you can use it as a model for making your own "submission rules" plugin. :cool:
     
  5. rushnp774

    rushnp774 New Member

    Seems like it'd be a fantastic plugin! Does it allow you to bypass the rule for posts made by admins? I don't think I'd use it if it didn't.
     
  6. Nick

    Nick Well-Known Member

    It's a really short plugin, about a dozen lines, so it's easy to understand and adapt. You could exempt admins by editing line 41 to look like this:


    Code:
    if (!$h->currentUser->loggedIn || !$args [COLOR="#ff0000"]|| ($currentUser->role == "admin")[/COLOR]) { return false; }
    Or exempt any user with admin access like this:

    Code:
    if (!$h->currentUser->loggedIn || !$args [COLOR="#ff0000"]|| ($h->currentUser->getPermission('can_access_admin') == 'yes')[/COLOR]) { return false; }
     
  7. rushnp774

    rushnp774 New Member

    Thanks for that Nick! I'll take a look at it and try to implement it. I was at work when I asked the question, so I couldn't examine the plugin.
     
  8. Gunaxin

    Gunaxin Well-Known Member

    Nick,

    This gets bypassed by using the Bookmarklet I believe. I haven't looked into it yet, but how complicated would it be to make it work with that as well?
     
  9. Nick

    Nick Well-Known Member

    URLs submitted via the bookmarklet still run through the "Submit 1" checks, so this plugin shouldn't be getting bypassed. [:wondering:]
     
  10. Gunaxin

    Gunaxin Well-Known Member

    My bad. With more testing I realized that the domain I was submitting to test had actually gone popular on the previous submission. Just tried it with 2 fresh submissions and it works like a charm.
     
    Last edited: Apr 8, 2010
  11. JonH

    JonH Admin & Design

    This would be nice to integrate with Paypal donate somehow. Say a submitter wants to submit from 1 domain only and they can for a "fee" :cool:
     

Share This Page