Results 1 to 2 of 2
  1. #1
    New Pligger netirca's Avatar
    Joined
    Jul 2010
    Posts
    19

    Question Automatically Delete Discarded Stories

    Hello all,

    I have a ton of discarded stories every day, is there a way to run admin_delete_stories.php automatically every 2-3 hrs? I tried setting it up as a cron job via my hosting admin but it would not run properly for some reason (maybe it has something to do with admin authentication?)

    Thanks.

  2. #2
    Pligg Founder Yankidank's Avatar
    Joined
    Dec 2005
    Location
    San Francisco, CA
    Posts
    5,063
    Site
    http://pligg.com/demo/
    My suggestion is to...

    1. Create a new file with a random file name in your /admin directory.
    2. Paste in the contents of the admin_delete_stories.php file.
    3. Remove lines 11-23 (pasted below)
    Code:
    check_referrer();
    
    // require user to log in
    force_authentication();
    
    // restrict access to god only
    $canIhaveAccess = 0;
    $canIhaveAccess = $canIhaveAccess + checklevel('god');
    
    if($canIhaveAccess == 0){    
        header("Location: " . getmyurl('login', $_SERVER['REQUEST_URI']));
        die();
    }
    4. Save the file and you should now be able to run it with a cron job.

    I haven't tried it myself, but I think those are the lines that make you authenticate as an admin user in order to run the file.
    The Facebook Module for Pligg CMS!
    Register, Login, and Submit Stories with Facebook. An absolute MUST HAVE for all Pligg sites!

Similar Threads

  1. Delete Discarded Stories from Database
    By Yankidank in forum Questions & Comments
    Replies: 0
    Last Post: 01-01-2012, 08:57 PM
  2. Delete discarded stories not working
    By jphelps in forum Questions & Comments
    Replies: 2
    Last Post: 03-28-2011, 10:44 AM
  3. How to a) discarded stories and b) delete users?
    By Cruth in forum Questions & Comments
    Replies: 1
    Last Post: 06-01-2008, 04:50 PM
  4. Require Mod to Delete Discarded stories
    By rattlingabhi in forum Questions & Comments
    Replies: 2
    Last Post: 11-17-2007, 09:12 PM
  5. Stories automatically discarded
    By sum41 in forum Questions & Comments
    Replies: 0
    Last Post: 10-05-2007, 09:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Donate to Pligg CMS Dreamhost Web Hosting Host Gator Web Hosting