如何暂停新发布的记录?

This is my first time to publish a website and I'm very new to the following request. The website is featuring online classified advertisements, programmed by PHP, MySQL and Ajax.

In general, a new record published online immediately when a user post the new record (after completing the form and pressing the submit button).

I would like to avoid the immediate publishing of the new record by putting this record on hold until the website administrator will verify the content.

What should be the recommended procedure for the above.

Thanks for any help,

You could have a default flag of published = 0 and whatever page is displaying the records should query on published = 1. Only admins should be able to change published from 0 to 1. That is the simplest way to do this.

One way to do this is to mark new records as "not_validated" or something (maybe add an extra column to your database table, or put these unvalidated records in a separate table) and create yourself a simple page for admins (say protected by a .htaccess) where admins can validate records.

Add a column that is called published and set default to 0. Then, create a review tool that will update published to 1. Make all of you readers only display articles that are published = 1

Also, it's a great idea to created yet another column like date_created. This way you can organize your information in your review tool.

Without knowing your DB schema, I will presume you have a table called Classifieds

  1. Add a status column to the Classifieds table
  2. When a new ad is submited set the status to 'pending'
  3. Admin can then review an ads and changes the status to 'approved' or 'rejected'
    • Create a page that the admin can view and show items that are pending
      • select * from classifieds where status = 'pending'
    • allow the admin to change the status
      • update classifieds set status='approved' where classified_id=1
  4. The page that shows the ads to the public will only show approved pages
    • select * from classifieds where status = 'approved'