Disable user submit

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 04-16-2009, 05:35 AM
New Pligger
 
Join Date: Apr 2009
Posts: 2
I want to temporary disable the possibility for my members to submit stories. I still want the opportunity to submit stories as god. I once did this by inserting some amIgod code in some tpl files, but maybe there is a better solution running new Pligg 1.0 RC4. I want to put some code in the Snippets module. Is there any module hook that would disable the user submit page? Another way to solve this would be to queue user submitted stories and let me delete the stories before they get published. Then I can put a text at the submit page that stories aren't allowed during a period.

I have tried to put some amIgod code after submit page 1 of 3 and at the end of the same page, but without success.
Reply With Quote
  #2 (permalink)  
Old 04-16-2009, 10:23 AM
Pligg Donor
 
Join Date: Jul 2007
Posts: 286
The simple solution is add blank line in the local-antispam.txt file. It will disable submissions. thanks
Reply With Quote
  #3 (permalink)  
Old 04-16-2009, 12:02 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 4,934
Send a message via AIM to Yankidank
rubber: that will disable even god submissions which I know Swede doesn't want to do. I've come up with a better solution for him.

Create a new Admin Snippet (using the Admin Snippet module) and give it the following values:

Title: God Only Submission
Location: tpl_pligg_submit_step1_start - After Submit step 1 of 3

Content:
Code:
{php}
// 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();
}
{/php}
This will allow God to submit stories, but redirect other user types to the login page. I'm sure there is a better soloution using smarty instead of PHP to accomplish this, but the one idea that I had didn't work out. Feel free to post if you figure out the smarty code for only showing content to a god-level user. I thought it was {if $amIgod} or {if $amIgod eq 1}

EDIT: I figured out that placing {if $amIgod} directly into submit_step_1.tpl works, but using the snippet module doesn't seem to keep it in.

The Twitter Module for Pligg CMS!
Register, Login, and Submit Stories with Twitter. An absolute MUST HAVE for all Pligg sites!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Submit Antispam Addon v 0.1 AnAlienHolakres3 Free Modules 45 12-05-2011 12:48 AM
How to Disable Story Submit for Normal User dasaxena Questions and Comments 3 07-28-2009 07:11 AM
Admin Panel for 1.0 and above mismeflight Wiki Articles 0 03-04-2009 11:04 AM
Disable User and SpamkillUser and bugs. sefs Questions and Comments 0 10-08-2007 09:43 AM
Disable User error gamespel Questions and Comments 9 10-30-2006 08:53 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development