We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

New Modue: LG Quarantine: The user powered comment and weblog entry monitoring system!

Development and Programming

Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Update 1.0.0:

  • Initial public release
  • Documentation

Version 1.0.0 is now available!

Heres the link: LG Quarantine - Flag ExpressionEngine entries and comments as inappropriate.


Hey guys,

I have just built a new module that needs some rigorous testing.

It’s called LG Quarantine and it allows users to flag weblog entries and comments. After a designated number of flags have been thrown the entry/comment is quarantined and a couple of things happen.

  • The entry’s status changes or if its a comment the comment is set to closed.
  • A new email is sent to a designted list of emails with information about the quarantine.

So hows it work…

Each entry/comment has a simple form added to it that stores some secure params and settings. When the form is submitted a new flag is added to the DB… other magic happens… I have chosen to use a form for a couple of reasons but the number one is security and it removes the risk of search engines accidently flagging all your entries as they index your site.

The module also features a couple of report pages listing flagged entries, flagged comments and individual flags so you can keep track of whats happening on your site.

The extension settings (there is an extension as part of the module) allows you to restrict who can flag and auto quarantine entries/comments. It also allows you to set the email responses, ajax server responses (if the form is submitted via ajax) and a couple of other things.

Implementing the {exp:lg_quaranine:form} tag inside of a weblog entries tag

Like I said either entries and/or comments can be flagged. This is great for user generated SAEF entries.

Example code (should be pretty self explanitory):

{exp:weblog:entries status='open|closed' limit="1"}
{title}
{exp:lg_quarantine:form
    {!-- Required --}
    entry_type = 'entry'
    entry_id = '{entry_id}'
    {!-- Optional --}
    notify_admins = 'y'
    notify_author = 'y'
    notify_admin_emails = 'test@leevigraham, [email protected]'
    return = '{comment_entry_id_auto_path}'
    return_if_quarantined = '{path="quarantine/success"}'
    quarantine_status = 'closed'
    form_name = 'form name'
    form_id = 'form id'
    form_class = 'form class'
}
    {if can_flag}
        {quarantine_form}
            <input type='submit' value='Flag as inappropriate' />
            {if can_quarantine}<input type='checkbox' name='auto_quarantine' value='y' /> Auto Quarantine?{/if}
        {/quarantine_form}
    {if:else}
        {if has_flagged}
            Sorry, you have already flagged this entry.
        {if:else}
            You don not have permission to flag this entry.
        {/if}
    {/if}
{/exp:lg_quarantine:form}
<hr >
{/exp:weblog:entries}

Implementing the {exp:lg_quaranine:form} tag inside of a comments tag

Eactly the same:

{exp:comment:entries sort="asc" limit="20"}
    {comment}
    By {name} on {comment_date format="%Y %m %d"}
    {exp:lg_quarantine:form
        {!-- Required --}
        entry_type = 'comment'
        entry_id = '{comment_id}'
        {!-- Optional --}
        notify_admins = 'y'
        notify_author = 'y'
        notify_admin_emails = 'test@leevigraham, [email protected]'
        return = 'template_group/template'
        return_if_quarantined = '{path="quarantine/success"}'
        quarantine_status = 'closed'
        form_name = 'form name'
        form_id = 'form id'
        form_class = 'form class'
    }
    {if can_flag}
        {quarantine_form}
            <input type='submit' value='Flag as inappropriate' />
            {if can_quarantine}<input type='checkbox' name='auto_quarantine' value='y' /> Auto Quarantine?{/if}
        {/quarantine_form}
    {if:else}
        {if has_flagged}
            Sorry, you have already flagged this entry.
        {if:else}
            You don not have permission to flag this entry.
        {/if}
    {/if}
    {/exp:lg_quarantine:form}
    <hr >
{/exp:comment:entries}

{exp:lg_quaranine:form} Settings

Most of the settings are pretty self explanitory but I’ll go over a couple of the important ones here:

  • entry_type: Must be either set to ‘entry’ or ‘comment’

  • entry_id: Must be either set to the entry_id or comment_id

  • return: The return path if an entry is flagged

  • return_if_quarantined: If an entry is quarantined it is likey its status will have changed so you might want to redirect to an index page or something similar.

  • quarantine_status: If an entry is quarantined its status can be set to something other than default set in the extension settings.

Instalation

The module comes with a module folder, extension file and a couple of language files.

Install the module and activate the extension and you should be good to go.

Wrap Up

I have tested this module pretty heavily and haven’t found any significant bugs. That said there are probably still improvements to be made so I’m throwing it out there for testing.

Another important disclaimer. I will probably end up developing this as a commercial module so if you plan to use this in your site feel free to download it but you will need to purchase a license in the future. If thats a worry best not to download it. 😊

Other than that enjoy.

Leevi

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Oh yeah… you can grab it form here: removed (see update)

Just uploaded some screenshots here, here & here

Update: I have been using this module quite a bit lately and I believe its ready for primetime.

The docs are currently being prepared before release but if you would like a copy email me and I’ll send you the license details.

Thanks for supporting independent EE development!

       
Sean C. Smith's avatar
Sean C. Smith
3,818 posts
17 years ago
Sean C. Smith's avatar Sean C. Smith

This looks to be a great module - don’t have a site with high enough traffic to test this but am going to watch this thread.

       
Matt Weinberg's avatar
Matt Weinberg
489 posts
17 years ago
Matt Weinberg's avatar Matt Weinberg

Looks awesome Leevi!

       
Rob Quigley's avatar
Rob Quigley
236 posts
17 years ago
Rob Quigley's avatar Rob Quigley

Lots of potential here. I uploaded the module to two EE installs. One is on Engine hosting and the other is at https://signup.dreamhost.com/ (dreamhost). On the dreamhost EE dev test install I get this error when clicking the “install” link in the module CP page (I checked that all files have been uploaded):

Parse error: syntax error, unexpected ‘(‘, expecting ‘}’ in /pathtowebsitedomain/system/modules/lg_quarantine/mcp.lg_quarantine.php on line 181

–

So, I set up on the Engine hosted EE install to double check and it installed fine there. However, in the extension, when

Can site visitors flag an entry / comment more than once?

is set to “no” it always displays:

You don not have permission to flag this comment. Sorry, you have already flagged this comment.

When I change that setting to “Yes” then it will allow Flagging but it will also still display:

Sorry, you have already flagged this comment.

After that, I made sure that i was not checking IP or cookie and just checking by user ID and same results. I logged in using a different user ID and received same results as before.

Other than that, it does as expected with quarantining flagged entries and showing results in the module page. Pretty darn cool if I could just get it to play nice in the template.

If you want to access either install and take a look, just let me know and I’ll set up access for you.

Thanks, Rob.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Thanks rob… I’ll look into these issues on my local machine and see how I go.

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

I have just updated the download to address the issues Rob mentioned…. Grab the latest for testing.. I think we are prety close to be being bug free

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Ok another quick update that addresses an issue with cookies + I uncommented the line that sends the emails out.

       
grantmx's avatar
grantmx
1,439 posts
17 years ago
grantmx's avatar grantmx

Nice stuff bro. Will give it a try. How much do you think you’ll charge for the commercial version?

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Hard to say… but probably no more than $US 50 I would like to add flagging of forum posts as well but that might be added in V2.

       
Danny T.'s avatar
Danny T.
426 posts
17 years ago
Danny T.'s avatar Danny T.

Still haven’t given it a shot yet Leevi.. But I’d like to drop a thank you for continuing support of the 1.x branch while it’s still around. 😊

       
Leevi Graham's avatar
Leevi Graham
1,143 posts
17 years ago
Leevi Graham's avatar Leevi Graham

Thanks mr_dimsum…. Its something that I have questioned quite a bit recently and I still think EE 1+ will be around for a little longer yet. Plus some of these modules shouldn’t be too hard to port to ee 2.0

       
avroo's avatar
avroo
164 posts
17 years ago
avroo's avatar avroo

sounds good, this was exactly what I was looking for a new website which will be user generated content only.. 😊

I will install it now and let you know if I found any bugs!

       
Jim F's avatar
Jim F
53 posts
17 years ago
Jim F's avatar Jim F

This looks almost perfect for a site update that I’m in the middle of. Any chance you could add another field in the table for users which explains why the entry/comment should be guaranteed? For example, Digg allows users to flag content as stuff like Lame, Duplicate Story, Spam, and a few other things.

       
grantmx's avatar
grantmx
1,439 posts
17 years ago
grantmx's avatar grantmx

Hey man. Everything looks good to me. Only thing is, only because it’s coming up blank, I assume we have to create a /quarantine/success page? What do you suggest it entail?

Also, if we make the form button an input image, will it still work? I know IE has some issues with image submit buttons. Still need to check.

       
1 2 3 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.