ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Delete entries and comments PLUGIN

July 30, 2010 7:13am

Subscribe [17]
  • #31 / Oct 17, 2011 12:09pm

    Frank Harrison

    154 posts

    I’m letting members of a site upload images and audio files to entries (via safecracker), and also delete those entries with this plugin.

    I’m a bit conscious that we’re going to build up more and more “orphaned” files on the server as entries are deleted but their files are left online. Does anyone know of a way round this?

    Thanks, Frank

  • #32 / Oct 17, 2011 1:37pm

    Milo Creative's avatar

    Milo Creative

    20 posts

    Good question.. this is an issue also when you delete an entry from the CP, any file associated with that entry will not be deleted (rightly so).
    If you want to delete files you should do so before you delete an entry, but this is beyond the scope of this plugin.

  • #33 / Oct 17, 2011 1:40pm

    Frank Harrison

    154 posts

    Thanks Milo. Yep I thought that would be the case. I might try to write a script that compares all the entry uploads with the contents of the uploads folder and deletes any that don’t match up. Then we just run that script every so often…

  • #34 / Oct 18, 2011 5:52am

    Milo Creative's avatar

    Milo Creative

    20 posts

    @Frank, have you tried searching for an extension, module or plugin that allows you to do that without reinventing the wheel? Like, http://www.devdemon.com/channel_files for instance?  Or at least giving you a starting point to develop your script..

  • #35 / Dec 09, 2011 2:49pm

    EnergyFreak's avatar

    EnergyFreak

    102 posts

    Hi,

    I can’t seem to find any updated example templates anywhere for this plugin.

    Thanks.

  • #36 / Dec 12, 2011 7:38am

    Milo Creative's avatar

    Milo Creative

    20 posts

    @EnergyFreak, examples are provided in the plugin file itself (pi.delete.php)

  • #37 / Jan 29, 2012 6:40pm

    Brandon C.'s avatar

    Brandon C.

    43 posts

    Frank, I found a roundabout way to do this using this plugin and PHP script. If anybody needs the details, feel free to PM me.

  • #38 / May 03, 2012 11:21am

    jbriggs

    38 posts

    Does anyone know how to allow guests to delete entries without being logged in? Thanks!

  • #39 / May 23, 2012 3:43pm

    KentonLHNL's avatar

    KentonLHNL

    1 posts

    I am having the same issue that Sean C. Smith posted about.

    I want to allow users to delete their own comments, but I keep getting this message… 
    Error: This content does not exist or has already been deleted.

    Here is my link code…

    {exp:delete:link id="{comment_id}" type="review" template="review/delete" alert="false"}Delete Review{/exp:delete:link}

    And here is my template code…

    {exp:delete:delete_comment comment_id="{comment_id}" message_success="Your Review Has Been Deleted"}

    Does anyone see what I am doing wrong?

  • #40 / Jun 22, 2012 9:21am

    Wprk14

    1 posts

    I had an issue with getting the plugin to use my template location so I tweaked it abit.

    Don’t know if this will help anyone but it worked great for me.

    Just replace the link function in pi.delete with this function below

    // ----------------------------------------
    //  Generate a delete link  
    // ----------------------------------------
        public function link()
        {
            $template = $this->EE->functions->create_url($this->EE->TMPL->fetch_param('template') . "/" . $this->EE->TMPL->fetch_param('id'));
    
            if ( ! $this->EE->TMPL->fetch_param('id') OR  ! $this->EE->TMPL->fetch_param('template')) return "Invalid delete plugin usage.";
    
            $type = ($this->EE->TMPL->fetch_param('type')) ? $this->EE->TMPL->fetch_param('type') : $this->type;
    
            // create a js alert box?
            $alert = "";
            if ($this->EE->TMPL->fetch_param('alert') != "false") $alert = " onclick=\"[removed] if (!confirm('Are you sure you want to delete this $type?')) return false;\"";
            $link = "<a href="http://">" . $this->EE->TMPL->tagdata . "</a>";
      
            return $link;
        }
  • #41 / Jul 05, 2012 11:06am

    Jolle

    38 posts

    I am having the same issue that Sean C. Smith posted about.

    I want to allow users to delete their own comments, but I keep getting this message… 
    Error: This content does not exist or has already been deleted.

    Here is my link code…

    {exp:delete:link id="{comment_id}" type="review" template="review/delete" alert="false"}Delete Review{/exp:delete:link}

    And here is my template code…

    {exp:delete:delete_comment comment_id="{comment_id}" message_success="Your Review Has Been Deleted"}

    Does anyone see what I am doing wrong?

    The code you’ve got there is just fine. Open up the delete template and replace {comment_id} with the segment in the URL that is created through the delete link function. Something like this:

    {exp:delete:delete_comment 
     comment_id="{segment_3}"
     error_no_permissions="You're not allowed to delete this comment" 
     error_invalid_content="It seems that this comment has been already deleted" 
     message_success="Comment deleted!"
    }

     

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases